commit 51e32366962630294a8b5b1c8db692f7c2c4c889 Author: xensik <8714336+xensik@users.noreply.github.com> Date: Thu May 21 13:32:38 2020 +0200 init diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..3aca17ca --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +ko_fi: xensik +custom: https://www.paypal.me/xensik diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..7a72df1b --- /dev/null +++ b/.gitignore @@ -0,0 +1,150 @@ +### Windows + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Shortcuts +*.lnk + +### OSX + +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Visual Studio + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +build + +# Visual Studio 2015 cache/options directory +.vs/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +### IDA +*.id0 +*.id1 +*.id2 +*.nam +*.til + +### Custom user files +# User scripts +user*.bat + +# VScode +.vscode/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..dbf5822a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "deps/zlib"] + path = deps/zlib + url = https://github.com/madler/zlib diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..f288702d --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + 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. + + + Copyright (C) + + 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 . + +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: + + Copyright (C) + 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 +. + + 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 +. diff --git a/README.md b/README.md new file mode 100644 index 00000000..822c14ed --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +[![Build status](https://ci.appveyor.com/api/projects/status/defmhg4753c1ap1o?svg=true)](https://ci.appveyor.com/project/xensik/gsc-tool) +![license](https://img.shields.io/github/license/xensik/gsc-tool.svg) +[![GitHub issues](https://img.shields.io/github/issues/xensik/gsc-tool)](https://github.com/xensik/gsc-tool/issues) +[![GitHub release (latest by date)](https://img.shields.io/github/v/release/xensik/gsc-tool)](https://github.com/xensik/gsc-tool/releases) +# GSC Tool +A utility to compile & decompile IW engine game scripts. +## Supported Games +- **IW5** *(Call of Duty: Modern Warfare 3)* +- **IW6** *(Call of Duty: Ghosts)* +- **IW7** *(Call of Duty: Infinite Warfare)* +- **IW8** *(Call of Duty: Modern Warfare (2019))* ***\*WIP\**** +- **S1** *(Call of Duty: Advanced Warfare)* +- **S2** *(Call of Duty: WWII)* +- **H1** *(Call of Duty: Modern Warfare Remastered)* +- **H2** *(Call of Duty: Modern Warfare 2 Campaign Remastered)* +## Usage +``./gsc-tool.exe `` + +**game**: `-iw5`, `-iw6`, `-iw7`, `-s1`, `-s2`, `-h1`, `-h2` +| Mode |Description | Output | +|:---------|:--------------------------|:------------| +|`-asm` |assemble a `file.gscasm` |`file.gscbin`| +|`-disasm` |dissasemble a `file.gscbin`|`file.gscasm`| +|`-comp` |compile a `file.gsc` |`file.gscbin`| +|`-decomp` |decompile a `file.gscbin` |`file.gsc` | + +for zonetool files (*.cgsc*, *.cgsc.stack*) use: `-zasm`, `-zdisasm`, `-zcomp`, `-zdecomp` +## Format +- gsc-tool ``.gscbin`` format is a serialized ScriptFile struct: ***name***: null-term string, ***compressedLen***: 4 byte uint, ***len***: 4 byte uint, ***bytecodeLen***: 4 byte uint, ***buffer***: byte array[compressedLen], ***bytecode***: byte array[bytecodeLen]. + +- zonetool format made of bytecode file ``.cgsc`` and decompressed stack buffer ``.cgsc.stack``. +## Credits +This project is based on [*RektInator's* gsc-asm](https://github.com/ZoneTool/gsc-asm). Special thanks to **RektInator**, **JTAG** & **Dasfonia**. +## Disclaimer +This software has been created purely for the purposes of academic research. Project maintainers are not responsible or liable for misuse of the software. Use responsibly. diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..790b6e2e --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,20 @@ +version: 1.0.{build} +skip_tags: true +image: Visual Studio 2019 +configuration: release +platform: x64 +before_build: +- git submodule update --init --recursive +- ps: tools\windows\premake5.exe vs2019 +build: + project: build/gsc-tool.sln + verbosity: minimal +test: off +artifacts: +- path: build/bin/release/gsc-tool.exe +deploy: +- provider: GitHub + auth_token: + secure: AqZXWi1GBskqk/3nQeAlwGBHipNnAHT4g7D4dCIcCs4l9mHAiUTqKRmLgaCAnPI3 + on: + branch: prod diff --git a/data/IW5/_unamed/1000.gscbin b/data/IW5/_unamed/1000.gscbin new file mode 100644 index 00000000..7a8826c4 Binary files /dev/null and b/data/IW5/_unamed/1000.gscbin differ diff --git a/data/IW5/_unamed/1094.gscbin b/data/IW5/_unamed/1094.gscbin new file mode 100644 index 00000000..70b2f104 Binary files /dev/null and b/data/IW5/_unamed/1094.gscbin differ diff --git a/data/IW5/_unamed/1098.gscbin b/data/IW5/_unamed/1098.gscbin new file mode 100644 index 00000000..530f9518 Binary files /dev/null and b/data/IW5/_unamed/1098.gscbin differ diff --git a/data/IW5/_unamed/11040.gscbin b/data/IW5/_unamed/11040.gscbin new file mode 100644 index 00000000..155dd987 Binary files /dev/null and b/data/IW5/_unamed/11040.gscbin differ diff --git a/data/IW5/_unamed/11041.gscbin b/data/IW5/_unamed/11041.gscbin new file mode 100644 index 00000000..79ee199e Binary files /dev/null and b/data/IW5/_unamed/11041.gscbin differ diff --git a/data/IW5/_unamed/11042.gscbin b/data/IW5/_unamed/11042.gscbin new file mode 100644 index 00000000..c65dfea7 Binary files /dev/null and b/data/IW5/_unamed/11042.gscbin differ diff --git a/data/IW5/_unamed/11043.gscbin b/data/IW5/_unamed/11043.gscbin new file mode 100644 index 00000000..27d3d3d6 Binary files /dev/null and b/data/IW5/_unamed/11043.gscbin differ diff --git a/data/IW5/_unamed/11044.gscbin b/data/IW5/_unamed/11044.gscbin new file mode 100644 index 00000000..6e81da2e Binary files /dev/null and b/data/IW5/_unamed/11044.gscbin differ diff --git a/data/IW5/_unamed/11045.gscbin b/data/IW5/_unamed/11045.gscbin new file mode 100644 index 00000000..245e56e4 Binary files /dev/null and b/data/IW5/_unamed/11045.gscbin differ diff --git a/data/IW5/_unamed/11046.gscbin b/data/IW5/_unamed/11046.gscbin new file mode 100644 index 00000000..5ab35021 Binary files /dev/null and b/data/IW5/_unamed/11046.gscbin differ diff --git a/data/IW5/_unamed/11047.gscbin b/data/IW5/_unamed/11047.gscbin new file mode 100644 index 00000000..7a425df0 Binary files /dev/null and b/data/IW5/_unamed/11047.gscbin differ diff --git a/data/IW5/_unamed/11048.gscbin b/data/IW5/_unamed/11048.gscbin new file mode 100644 index 00000000..f754af0f Binary files /dev/null and b/data/IW5/_unamed/11048.gscbin differ diff --git a/data/IW5/_unamed/11049.gscbin b/data/IW5/_unamed/11049.gscbin new file mode 100644 index 00000000..c7bf8649 Binary files /dev/null and b/data/IW5/_unamed/11049.gscbin differ diff --git a/data/IW5/_unamed/11050.gscbin b/data/IW5/_unamed/11050.gscbin new file mode 100644 index 00000000..4aae1be9 Binary files /dev/null and b/data/IW5/_unamed/11050.gscbin differ diff --git a/data/IW5/_unamed/11051.gscbin b/data/IW5/_unamed/11051.gscbin new file mode 100644 index 00000000..42e34a2a Binary files /dev/null and b/data/IW5/_unamed/11051.gscbin differ diff --git a/data/IW5/_unamed/11052.gscbin b/data/IW5/_unamed/11052.gscbin new file mode 100644 index 00000000..fd24919f Binary files /dev/null and b/data/IW5/_unamed/11052.gscbin differ diff --git a/data/IW5/_unamed/11053.gscbin b/data/IW5/_unamed/11053.gscbin new file mode 100644 index 00000000..f60e1b6e Binary files /dev/null and b/data/IW5/_unamed/11053.gscbin differ diff --git a/data/IW5/_unamed/11054.gscbin b/data/IW5/_unamed/11054.gscbin new file mode 100644 index 00000000..1b6b978d Binary files /dev/null and b/data/IW5/_unamed/11054.gscbin differ diff --git a/data/IW5/_unamed/11055.gscbin b/data/IW5/_unamed/11055.gscbin new file mode 100644 index 00000000..b353b275 Binary files /dev/null and b/data/IW5/_unamed/11055.gscbin differ diff --git a/data/IW5/_unamed/11056.gscbin b/data/IW5/_unamed/11056.gscbin new file mode 100644 index 00000000..29ca078c Binary files /dev/null and b/data/IW5/_unamed/11056.gscbin differ diff --git a/data/IW5/_unamed/11057.gscbin b/data/IW5/_unamed/11057.gscbin new file mode 100644 index 00000000..8c7934de Binary files /dev/null and b/data/IW5/_unamed/11057.gscbin differ diff --git a/data/IW5/_unamed/11058.gscbin b/data/IW5/_unamed/11058.gscbin new file mode 100644 index 00000000..b5780593 Binary files /dev/null and b/data/IW5/_unamed/11058.gscbin differ diff --git a/data/IW5/_unamed/11059.gscbin b/data/IW5/_unamed/11059.gscbin new file mode 100644 index 00000000..c11809f2 Binary files /dev/null and b/data/IW5/_unamed/11059.gscbin differ diff --git a/data/IW5/_unamed/11060.gscbin b/data/IW5/_unamed/11060.gscbin new file mode 100644 index 00000000..a9a002f6 Binary files /dev/null and b/data/IW5/_unamed/11060.gscbin differ diff --git a/data/IW5/_unamed/11061.gscbin b/data/IW5/_unamed/11061.gscbin new file mode 100644 index 00000000..0b9b7d63 Binary files /dev/null and b/data/IW5/_unamed/11061.gscbin differ diff --git a/data/IW5/_unamed/11062.gscbin b/data/IW5/_unamed/11062.gscbin new file mode 100644 index 00000000..3c738274 Binary files /dev/null and b/data/IW5/_unamed/11062.gscbin differ diff --git a/data/IW5/_unamed/11063.gscbin b/data/IW5/_unamed/11063.gscbin new file mode 100644 index 00000000..a9f4625d Binary files /dev/null and b/data/IW5/_unamed/11063.gscbin differ diff --git a/data/IW5/_unamed/11065.gscbin b/data/IW5/_unamed/11065.gscbin new file mode 100644 index 00000000..7e462be2 Binary files /dev/null and b/data/IW5/_unamed/11065.gscbin differ diff --git a/data/IW5/_unamed/11066.gscbin b/data/IW5/_unamed/11066.gscbin new file mode 100644 index 00000000..812aef62 Binary files /dev/null and b/data/IW5/_unamed/11066.gscbin differ diff --git a/data/IW5/_unamed/11067.gscbin b/data/IW5/_unamed/11067.gscbin new file mode 100644 index 00000000..8808fa99 Binary files /dev/null and b/data/IW5/_unamed/11067.gscbin differ diff --git a/data/IW5/_unamed/11068.gscbin b/data/IW5/_unamed/11068.gscbin new file mode 100644 index 00000000..191892d1 Binary files /dev/null and b/data/IW5/_unamed/11068.gscbin differ diff --git a/data/IW5/_unamed/11069.gscbin b/data/IW5/_unamed/11069.gscbin new file mode 100644 index 00000000..ca44f254 Binary files /dev/null and b/data/IW5/_unamed/11069.gscbin differ diff --git a/data/IW5/_unamed/11070.gscbin b/data/IW5/_unamed/11070.gscbin new file mode 100644 index 00000000..1c35a0fa Binary files /dev/null and b/data/IW5/_unamed/11070.gscbin differ diff --git a/data/IW5/_unamed/11071.gscbin b/data/IW5/_unamed/11071.gscbin new file mode 100644 index 00000000..63845ad0 Binary files /dev/null and b/data/IW5/_unamed/11071.gscbin differ diff --git a/data/IW5/_unamed/11072.gscbin b/data/IW5/_unamed/11072.gscbin new file mode 100644 index 00000000..05242745 Binary files /dev/null and b/data/IW5/_unamed/11072.gscbin differ diff --git a/data/IW5/_unamed/11073.gscbin b/data/IW5/_unamed/11073.gscbin new file mode 100644 index 00000000..a277ddd7 Binary files /dev/null and b/data/IW5/_unamed/11073.gscbin differ diff --git a/data/IW5/_unamed/11074.gscbin b/data/IW5/_unamed/11074.gscbin new file mode 100644 index 00000000..e164f249 Binary files /dev/null and b/data/IW5/_unamed/11074.gscbin differ diff --git a/data/IW5/_unamed/11075.gscbin b/data/IW5/_unamed/11075.gscbin new file mode 100644 index 00000000..351fd79c Binary files /dev/null and b/data/IW5/_unamed/11075.gscbin differ diff --git a/data/IW5/_unamed/11076.gscbin b/data/IW5/_unamed/11076.gscbin new file mode 100644 index 00000000..5ef9f52c Binary files /dev/null and b/data/IW5/_unamed/11076.gscbin differ diff --git a/data/IW5/_unamed/11077.gscbin b/data/IW5/_unamed/11077.gscbin new file mode 100644 index 00000000..9b4280eb Binary files /dev/null and b/data/IW5/_unamed/11077.gscbin differ diff --git a/data/IW5/_unamed/11078.gscbin b/data/IW5/_unamed/11078.gscbin new file mode 100644 index 00000000..bc5c1ccf Binary files /dev/null and b/data/IW5/_unamed/11078.gscbin differ diff --git a/data/IW5/_unamed/11079.gscbin b/data/IW5/_unamed/11079.gscbin new file mode 100644 index 00000000..d118d873 Binary files /dev/null and b/data/IW5/_unamed/11079.gscbin differ diff --git a/data/IW5/_unamed/11080.gscbin b/data/IW5/_unamed/11080.gscbin new file mode 100644 index 00000000..7a4522a5 Binary files /dev/null and b/data/IW5/_unamed/11080.gscbin differ diff --git a/data/IW5/_unamed/11081.gscbin b/data/IW5/_unamed/11081.gscbin new file mode 100644 index 00000000..5d384f49 Binary files /dev/null and b/data/IW5/_unamed/11081.gscbin differ diff --git a/data/IW5/_unamed/1205.gscbin b/data/IW5/_unamed/1205.gscbin new file mode 100644 index 00000000..22d3db4d Binary files /dev/null and b/data/IW5/_unamed/1205.gscbin differ diff --git a/data/IW5/_unamed/1206.gscbin b/data/IW5/_unamed/1206.gscbin new file mode 100644 index 00000000..59e42ec5 Binary files /dev/null and b/data/IW5/_unamed/1206.gscbin differ diff --git a/data/IW5/_unamed/1343.gscbin b/data/IW5/_unamed/1343.gscbin new file mode 100644 index 00000000..c3ba4f59 Binary files /dev/null and b/data/IW5/_unamed/1343.gscbin differ diff --git a/data/IW5/_unamed/1344.gscbin b/data/IW5/_unamed/1344.gscbin new file mode 100644 index 00000000..14c2ef87 Binary files /dev/null and b/data/IW5/_unamed/1344.gscbin differ diff --git a/data/IW5/_unamed/1345.gscbin b/data/IW5/_unamed/1345.gscbin new file mode 100644 index 00000000..463498ce Binary files /dev/null and b/data/IW5/_unamed/1345.gscbin differ diff --git a/data/IW5/_unamed/1346.gscbin b/data/IW5/_unamed/1346.gscbin new file mode 100644 index 00000000..27b3bb1a Binary files /dev/null and b/data/IW5/_unamed/1346.gscbin differ diff --git a/data/IW5/_unamed/1347.gscbin b/data/IW5/_unamed/1347.gscbin new file mode 100644 index 00000000..751a0648 Binary files /dev/null and b/data/IW5/_unamed/1347.gscbin differ diff --git a/data/IW5/_unamed/1348.gscbin b/data/IW5/_unamed/1348.gscbin new file mode 100644 index 00000000..92dd117f Binary files /dev/null and b/data/IW5/_unamed/1348.gscbin differ diff --git a/data/IW5/_unamed/1349.gscbin b/data/IW5/_unamed/1349.gscbin new file mode 100644 index 00000000..a0015432 Binary files /dev/null and b/data/IW5/_unamed/1349.gscbin differ diff --git a/data/IW5/_unamed/1350.gscbin b/data/IW5/_unamed/1350.gscbin new file mode 100644 index 00000000..5d33a7cc Binary files /dev/null and b/data/IW5/_unamed/1350.gscbin differ diff --git a/data/IW5/_unamed/1351.gscbin b/data/IW5/_unamed/1351.gscbin new file mode 100644 index 00000000..1a84890d Binary files /dev/null and b/data/IW5/_unamed/1351.gscbin differ diff --git a/data/IW5/_unamed/1352.gscbin b/data/IW5/_unamed/1352.gscbin new file mode 100644 index 00000000..5de4dc1f Binary files /dev/null and b/data/IW5/_unamed/1352.gscbin differ diff --git a/data/IW5/_unamed/1353.gscbin b/data/IW5/_unamed/1353.gscbin new file mode 100644 index 00000000..de85c3f7 Binary files /dev/null and b/data/IW5/_unamed/1353.gscbin differ diff --git a/data/IW5/_unamed/13534.gscbin b/data/IW5/_unamed/13534.gscbin new file mode 100644 index 00000000..c738993f Binary files /dev/null and b/data/IW5/_unamed/13534.gscbin differ diff --git a/data/IW5/_unamed/13535.gscbin b/data/IW5/_unamed/13535.gscbin new file mode 100644 index 00000000..a973bda9 Binary files /dev/null and b/data/IW5/_unamed/13535.gscbin differ diff --git a/data/IW5/_unamed/13536.gscbin b/data/IW5/_unamed/13536.gscbin new file mode 100644 index 00000000..21183499 Binary files /dev/null and b/data/IW5/_unamed/13536.gscbin differ diff --git a/data/IW5/_unamed/13537.gscbin b/data/IW5/_unamed/13537.gscbin new file mode 100644 index 00000000..73b1f351 Binary files /dev/null and b/data/IW5/_unamed/13537.gscbin differ diff --git a/data/IW5/_unamed/13538.gscbin b/data/IW5/_unamed/13538.gscbin new file mode 100644 index 00000000..884302dd Binary files /dev/null and b/data/IW5/_unamed/13538.gscbin differ diff --git a/data/IW5/_unamed/13539.gscbin b/data/IW5/_unamed/13539.gscbin new file mode 100644 index 00000000..01dce209 Binary files /dev/null and b/data/IW5/_unamed/13539.gscbin differ diff --git a/data/IW5/_unamed/1354.gscbin b/data/IW5/_unamed/1354.gscbin new file mode 100644 index 00000000..469829e1 Binary files /dev/null and b/data/IW5/_unamed/1354.gscbin differ diff --git a/data/IW5/_unamed/13540.gscbin b/data/IW5/_unamed/13540.gscbin new file mode 100644 index 00000000..f6f473ba Binary files /dev/null and b/data/IW5/_unamed/13540.gscbin differ diff --git a/data/IW5/_unamed/13541.gscbin b/data/IW5/_unamed/13541.gscbin new file mode 100644 index 00000000..bc6aa6d8 Binary files /dev/null and b/data/IW5/_unamed/13541.gscbin differ diff --git a/data/IW5/_unamed/13542.gscbin b/data/IW5/_unamed/13542.gscbin new file mode 100644 index 00000000..1bbe9246 Binary files /dev/null and b/data/IW5/_unamed/13542.gscbin differ diff --git a/data/IW5/_unamed/13543.gscbin b/data/IW5/_unamed/13543.gscbin new file mode 100644 index 00000000..aec04aa2 Binary files /dev/null and b/data/IW5/_unamed/13543.gscbin differ diff --git a/data/IW5/_unamed/13544.gscbin b/data/IW5/_unamed/13544.gscbin new file mode 100644 index 00000000..cb26999f Binary files /dev/null and b/data/IW5/_unamed/13544.gscbin differ diff --git a/data/IW5/_unamed/13545.gscbin b/data/IW5/_unamed/13545.gscbin new file mode 100644 index 00000000..96f51259 Binary files /dev/null and b/data/IW5/_unamed/13545.gscbin differ diff --git a/data/IW5/_unamed/13547.gscbin b/data/IW5/_unamed/13547.gscbin new file mode 100644 index 00000000..d241d8be Binary files /dev/null and b/data/IW5/_unamed/13547.gscbin differ diff --git a/data/IW5/_unamed/13548.gscbin b/data/IW5/_unamed/13548.gscbin new file mode 100644 index 00000000..6b00f9e0 Binary files /dev/null and b/data/IW5/_unamed/13548.gscbin differ diff --git a/data/IW5/_unamed/13549.gscbin b/data/IW5/_unamed/13549.gscbin new file mode 100644 index 00000000..767851d6 Binary files /dev/null and b/data/IW5/_unamed/13549.gscbin differ diff --git a/data/IW5/_unamed/1355.gscbin b/data/IW5/_unamed/1355.gscbin new file mode 100644 index 00000000..cda6ab5f Binary files /dev/null and b/data/IW5/_unamed/1355.gscbin differ diff --git a/data/IW5/_unamed/13550.gscbin b/data/IW5/_unamed/13550.gscbin new file mode 100644 index 00000000..5e634a63 Binary files /dev/null and b/data/IW5/_unamed/13550.gscbin differ diff --git a/data/IW5/_unamed/13551.gscbin b/data/IW5/_unamed/13551.gscbin new file mode 100644 index 00000000..db844982 Binary files /dev/null and b/data/IW5/_unamed/13551.gscbin differ diff --git a/data/IW5/_unamed/13552.gscbin b/data/IW5/_unamed/13552.gscbin new file mode 100644 index 00000000..6535d30d Binary files /dev/null and b/data/IW5/_unamed/13552.gscbin differ diff --git a/data/IW5/_unamed/13553.gscbin b/data/IW5/_unamed/13553.gscbin new file mode 100644 index 00000000..b4fed7c2 Binary files /dev/null and b/data/IW5/_unamed/13553.gscbin differ diff --git a/data/IW5/_unamed/13554.gscbin b/data/IW5/_unamed/13554.gscbin new file mode 100644 index 00000000..33a0825d Binary files /dev/null and b/data/IW5/_unamed/13554.gscbin differ diff --git a/data/IW5/_unamed/13555.gscbin b/data/IW5/_unamed/13555.gscbin new file mode 100644 index 00000000..ccb68797 Binary files /dev/null and b/data/IW5/_unamed/13555.gscbin differ diff --git a/data/IW5/_unamed/13556.gscbin b/data/IW5/_unamed/13556.gscbin new file mode 100644 index 00000000..63d9ffc0 Binary files /dev/null and b/data/IW5/_unamed/13556.gscbin differ diff --git a/data/IW5/_unamed/13557.gscbin b/data/IW5/_unamed/13557.gscbin new file mode 100644 index 00000000..bdcfe6c1 Binary files /dev/null and b/data/IW5/_unamed/13557.gscbin differ diff --git a/data/IW5/_unamed/13558.gscbin b/data/IW5/_unamed/13558.gscbin new file mode 100644 index 00000000..fd0f8f6b Binary files /dev/null and b/data/IW5/_unamed/13558.gscbin differ diff --git a/data/IW5/_unamed/13559.gscbin b/data/IW5/_unamed/13559.gscbin new file mode 100644 index 00000000..96bc5b23 Binary files /dev/null and b/data/IW5/_unamed/13559.gscbin differ diff --git a/data/IW5/_unamed/1356.gscbin b/data/IW5/_unamed/1356.gscbin new file mode 100644 index 00000000..c85c20db Binary files /dev/null and b/data/IW5/_unamed/1356.gscbin differ diff --git a/data/IW5/_unamed/13560.gscbin b/data/IW5/_unamed/13560.gscbin new file mode 100644 index 00000000..c612662e Binary files /dev/null and b/data/IW5/_unamed/13560.gscbin differ diff --git a/data/IW5/_unamed/13561.gscbin b/data/IW5/_unamed/13561.gscbin new file mode 100644 index 00000000..8ec7bab8 Binary files /dev/null and b/data/IW5/_unamed/13561.gscbin differ diff --git a/data/IW5/_unamed/13562.gscbin b/data/IW5/_unamed/13562.gscbin new file mode 100644 index 00000000..901cf8f7 Binary files /dev/null and b/data/IW5/_unamed/13562.gscbin differ diff --git a/data/IW5/_unamed/13563.gscbin b/data/IW5/_unamed/13563.gscbin new file mode 100644 index 00000000..ca08e4b4 Binary files /dev/null and b/data/IW5/_unamed/13563.gscbin differ diff --git a/data/IW5/_unamed/1357.gscbin b/data/IW5/_unamed/1357.gscbin new file mode 100644 index 00000000..582bc401 Binary files /dev/null and b/data/IW5/_unamed/1357.gscbin differ diff --git a/data/IW5/_unamed/1358.gscbin b/data/IW5/_unamed/1358.gscbin new file mode 100644 index 00000000..b39b63db Binary files /dev/null and b/data/IW5/_unamed/1358.gscbin differ diff --git a/data/IW5/_unamed/1359.gscbin b/data/IW5/_unamed/1359.gscbin new file mode 100644 index 00000000..cfcd678e Binary files /dev/null and b/data/IW5/_unamed/1359.gscbin differ diff --git a/data/IW5/_unamed/1360.gscbin b/data/IW5/_unamed/1360.gscbin new file mode 100644 index 00000000..c0151dc9 Binary files /dev/null and b/data/IW5/_unamed/1360.gscbin differ diff --git a/data/IW5/_unamed/1361.gscbin b/data/IW5/_unamed/1361.gscbin new file mode 100644 index 00000000..360d4030 Binary files /dev/null and b/data/IW5/_unamed/1361.gscbin differ diff --git a/data/IW5/_unamed/1362.gscbin b/data/IW5/_unamed/1362.gscbin new file mode 100644 index 00000000..675dfe63 Binary files /dev/null and b/data/IW5/_unamed/1362.gscbin differ diff --git a/data/IW5/_unamed/1363.gscbin b/data/IW5/_unamed/1363.gscbin new file mode 100644 index 00000000..96ddf9fe Binary files /dev/null and b/data/IW5/_unamed/1363.gscbin differ diff --git a/data/IW5/_unamed/1364.gscbin b/data/IW5/_unamed/1364.gscbin new file mode 100644 index 00000000..7fae1dce Binary files /dev/null and b/data/IW5/_unamed/1364.gscbin differ diff --git a/data/IW5/_unamed/1365.gscbin b/data/IW5/_unamed/1365.gscbin new file mode 100644 index 00000000..436e32b8 Binary files /dev/null and b/data/IW5/_unamed/1365.gscbin differ diff --git a/data/IW5/_unamed/1366.gscbin b/data/IW5/_unamed/1366.gscbin new file mode 100644 index 00000000..3d36d8f9 Binary files /dev/null and b/data/IW5/_unamed/1366.gscbin differ diff --git a/data/IW5/_unamed/1367.gscbin b/data/IW5/_unamed/1367.gscbin new file mode 100644 index 00000000..722d552f Binary files /dev/null and b/data/IW5/_unamed/1367.gscbin differ diff --git a/data/IW5/_unamed/1368.gscbin b/data/IW5/_unamed/1368.gscbin new file mode 100644 index 00000000..43350335 Binary files /dev/null and b/data/IW5/_unamed/1368.gscbin differ diff --git a/data/IW5/_unamed/1369.gscbin b/data/IW5/_unamed/1369.gscbin new file mode 100644 index 00000000..8a70e04a Binary files /dev/null and b/data/IW5/_unamed/1369.gscbin differ diff --git a/data/IW5/_unamed/1370.gscbin b/data/IW5/_unamed/1370.gscbin new file mode 100644 index 00000000..64abe2a2 Binary files /dev/null and b/data/IW5/_unamed/1370.gscbin differ diff --git a/data/IW5/_unamed/1371.gscbin b/data/IW5/_unamed/1371.gscbin new file mode 100644 index 00000000..bd26eb5b Binary files /dev/null and b/data/IW5/_unamed/1371.gscbin differ diff --git a/data/IW5/_unamed/1372.gscbin b/data/IW5/_unamed/1372.gscbin new file mode 100644 index 00000000..4ca51f70 Binary files /dev/null and b/data/IW5/_unamed/1372.gscbin differ diff --git a/data/IW5/_unamed/1373.gscbin b/data/IW5/_unamed/1373.gscbin new file mode 100644 index 00000000..15a64bd7 Binary files /dev/null and b/data/IW5/_unamed/1373.gscbin differ diff --git a/data/IW5/_unamed/1374.gscbin b/data/IW5/_unamed/1374.gscbin new file mode 100644 index 00000000..6ab0ded0 Binary files /dev/null and b/data/IW5/_unamed/1374.gscbin differ diff --git a/data/IW5/_unamed/1375.gscbin b/data/IW5/_unamed/1375.gscbin new file mode 100644 index 00000000..5f32ad05 Binary files /dev/null and b/data/IW5/_unamed/1375.gscbin differ diff --git a/data/IW5/_unamed/1376.gscbin b/data/IW5/_unamed/1376.gscbin new file mode 100644 index 00000000..7725f6e8 Binary files /dev/null and b/data/IW5/_unamed/1376.gscbin differ diff --git a/data/IW5/_unamed/1377.gscbin b/data/IW5/_unamed/1377.gscbin new file mode 100644 index 00000000..bbc4c56f Binary files /dev/null and b/data/IW5/_unamed/1377.gscbin differ diff --git a/data/IW5/_unamed/1378.gscbin b/data/IW5/_unamed/1378.gscbin new file mode 100644 index 00000000..7a64d0ec Binary files /dev/null and b/data/IW5/_unamed/1378.gscbin differ diff --git a/data/IW5/_unamed/1379.gscbin b/data/IW5/_unamed/1379.gscbin new file mode 100644 index 00000000..8e3e2259 Binary files /dev/null and b/data/IW5/_unamed/1379.gscbin differ diff --git a/data/IW5/_unamed/1380.gscbin b/data/IW5/_unamed/1380.gscbin new file mode 100644 index 00000000..05af789f Binary files /dev/null and b/data/IW5/_unamed/1380.gscbin differ diff --git a/data/IW5/_unamed/1381.gscbin b/data/IW5/_unamed/1381.gscbin new file mode 100644 index 00000000..783c9cc0 Binary files /dev/null and b/data/IW5/_unamed/1381.gscbin differ diff --git a/data/IW5/_unamed/1382.gscbin b/data/IW5/_unamed/1382.gscbin new file mode 100644 index 00000000..d5614d13 Binary files /dev/null and b/data/IW5/_unamed/1382.gscbin differ diff --git a/data/IW5/_unamed/1383.gscbin b/data/IW5/_unamed/1383.gscbin new file mode 100644 index 00000000..9c39e6b2 Binary files /dev/null and b/data/IW5/_unamed/1383.gscbin differ diff --git a/data/IW5/_unamed/1384.gscbin b/data/IW5/_unamed/1384.gscbin new file mode 100644 index 00000000..bc44c57b Binary files /dev/null and b/data/IW5/_unamed/1384.gscbin differ diff --git a/data/IW5/_unamed/1385.gscbin b/data/IW5/_unamed/1385.gscbin new file mode 100644 index 00000000..5d180cfc Binary files /dev/null and b/data/IW5/_unamed/1385.gscbin differ diff --git a/data/IW5/_unamed/1386.gscbin b/data/IW5/_unamed/1386.gscbin new file mode 100644 index 00000000..62269ed9 Binary files /dev/null and b/data/IW5/_unamed/1386.gscbin differ diff --git a/data/IW5/_unamed/1387.gscbin b/data/IW5/_unamed/1387.gscbin new file mode 100644 index 00000000..d919cd16 Binary files /dev/null and b/data/IW5/_unamed/1387.gscbin differ diff --git a/data/IW5/_unamed/1438.gscbin b/data/IW5/_unamed/1438.gscbin new file mode 100644 index 00000000..9f48eafd Binary files /dev/null and b/data/IW5/_unamed/1438.gscbin differ diff --git a/data/IW5/_unamed/1439.gscbin b/data/IW5/_unamed/1439.gscbin new file mode 100644 index 00000000..4e7c685c Binary files /dev/null and b/data/IW5/_unamed/1439.gscbin differ diff --git a/data/IW5/_unamed/1440.gscbin b/data/IW5/_unamed/1440.gscbin new file mode 100644 index 00000000..d365f4f8 Binary files /dev/null and b/data/IW5/_unamed/1440.gscbin differ diff --git a/data/IW5/_unamed/1441.gscbin b/data/IW5/_unamed/1441.gscbin new file mode 100644 index 00000000..f1e1d950 Binary files /dev/null and b/data/IW5/_unamed/1441.gscbin differ diff --git a/data/IW5/_unamed/1442.gscbin b/data/IW5/_unamed/1442.gscbin new file mode 100644 index 00000000..cc3990d4 Binary files /dev/null and b/data/IW5/_unamed/1442.gscbin differ diff --git a/data/IW5/_unamed/1443.gscbin b/data/IW5/_unamed/1443.gscbin new file mode 100644 index 00000000..d4d6dc65 Binary files /dev/null and b/data/IW5/_unamed/1443.gscbin differ diff --git a/data/IW5/_unamed/1463.gscbin b/data/IW5/_unamed/1463.gscbin new file mode 100644 index 00000000..20b3c348 Binary files /dev/null and b/data/IW5/_unamed/1463.gscbin differ diff --git a/data/IW5/_unamed/1464.gscbin b/data/IW5/_unamed/1464.gscbin new file mode 100644 index 00000000..120fc5f0 Binary files /dev/null and b/data/IW5/_unamed/1464.gscbin differ diff --git a/data/IW5/_unamed/1465.gscbin b/data/IW5/_unamed/1465.gscbin new file mode 100644 index 00000000..0688a2e0 Binary files /dev/null and b/data/IW5/_unamed/1465.gscbin differ diff --git a/data/IW5/_unamed/1466.gscbin b/data/IW5/_unamed/1466.gscbin new file mode 100644 index 00000000..7afab77e Binary files /dev/null and b/data/IW5/_unamed/1466.gscbin differ diff --git a/data/IW5/_unamed/1467.gscbin b/data/IW5/_unamed/1467.gscbin new file mode 100644 index 00000000..f60152fa Binary files /dev/null and b/data/IW5/_unamed/1467.gscbin differ diff --git a/data/IW5/_unamed/1468.gscbin b/data/IW5/_unamed/1468.gscbin new file mode 100644 index 00000000..14b0473c Binary files /dev/null and b/data/IW5/_unamed/1468.gscbin differ diff --git a/data/IW5/_unamed/1469.gscbin b/data/IW5/_unamed/1469.gscbin new file mode 100644 index 00000000..1822b6fe Binary files /dev/null and b/data/IW5/_unamed/1469.gscbin differ diff --git a/data/IW5/_unamed/1470.gscbin b/data/IW5/_unamed/1470.gscbin new file mode 100644 index 00000000..0588b1c9 Binary files /dev/null and b/data/IW5/_unamed/1470.gscbin differ diff --git a/data/IW5/_unamed/1471.gscbin b/data/IW5/_unamed/1471.gscbin new file mode 100644 index 00000000..451021bf Binary files /dev/null and b/data/IW5/_unamed/1471.gscbin differ diff --git a/data/IW5/_unamed/1472.gscbin b/data/IW5/_unamed/1472.gscbin new file mode 100644 index 00000000..7247aace Binary files /dev/null and b/data/IW5/_unamed/1472.gscbin differ diff --git a/data/IW5/_unamed/1473.gscbin b/data/IW5/_unamed/1473.gscbin new file mode 100644 index 00000000..e7f4851f Binary files /dev/null and b/data/IW5/_unamed/1473.gscbin differ diff --git a/data/IW5/_unamed/1474.gscbin b/data/IW5/_unamed/1474.gscbin new file mode 100644 index 00000000..9c923c28 Binary files /dev/null and b/data/IW5/_unamed/1474.gscbin differ diff --git a/data/IW5/_unamed/1475.gscbin b/data/IW5/_unamed/1475.gscbin new file mode 100644 index 00000000..38a07764 Binary files /dev/null and b/data/IW5/_unamed/1475.gscbin differ diff --git a/data/IW5/_unamed/1476.gscbin b/data/IW5/_unamed/1476.gscbin new file mode 100644 index 00000000..e6b0d8f2 Binary files /dev/null and b/data/IW5/_unamed/1476.gscbin differ diff --git a/data/IW5/_unamed/1477.gscbin b/data/IW5/_unamed/1477.gscbin new file mode 100644 index 00000000..a081f4c3 Binary files /dev/null and b/data/IW5/_unamed/1477.gscbin differ diff --git a/data/IW5/_unamed/1478.gscbin b/data/IW5/_unamed/1478.gscbin new file mode 100644 index 00000000..d9eb1f45 Binary files /dev/null and b/data/IW5/_unamed/1478.gscbin differ diff --git a/data/IW5/_unamed/1479.gscbin b/data/IW5/_unamed/1479.gscbin new file mode 100644 index 00000000..5c4840b0 Binary files /dev/null and b/data/IW5/_unamed/1479.gscbin differ diff --git a/data/IW5/_unamed/1480.gscbin b/data/IW5/_unamed/1480.gscbin new file mode 100644 index 00000000..c6805e6b Binary files /dev/null and b/data/IW5/_unamed/1480.gscbin differ diff --git a/data/IW5/_unamed/1481.gscbin b/data/IW5/_unamed/1481.gscbin new file mode 100644 index 00000000..fab4b086 Binary files /dev/null and b/data/IW5/_unamed/1481.gscbin differ diff --git a/data/IW5/_unamed/1482.gscbin b/data/IW5/_unamed/1482.gscbin new file mode 100644 index 00000000..184a6462 Binary files /dev/null and b/data/IW5/_unamed/1482.gscbin differ diff --git a/data/IW5/_unamed/1483.gscbin b/data/IW5/_unamed/1483.gscbin new file mode 100644 index 00000000..882a640e Binary files /dev/null and b/data/IW5/_unamed/1483.gscbin differ diff --git a/data/IW5/_unamed/1484.gscbin b/data/IW5/_unamed/1484.gscbin new file mode 100644 index 00000000..5062aae7 Binary files /dev/null and b/data/IW5/_unamed/1484.gscbin differ diff --git a/data/IW5/_unamed/1485.gscbin b/data/IW5/_unamed/1485.gscbin new file mode 100644 index 00000000..f9944af7 Binary files /dev/null and b/data/IW5/_unamed/1485.gscbin differ diff --git a/data/IW5/_unamed/1486.gscbin b/data/IW5/_unamed/1486.gscbin new file mode 100644 index 00000000..d74c671b Binary files /dev/null and b/data/IW5/_unamed/1486.gscbin differ diff --git a/data/IW5/_unamed/1487.gscbin b/data/IW5/_unamed/1487.gscbin new file mode 100644 index 00000000..bf792d28 Binary files /dev/null and b/data/IW5/_unamed/1487.gscbin differ diff --git a/data/IW5/_unamed/1488.gscbin b/data/IW5/_unamed/1488.gscbin new file mode 100644 index 00000000..a3403fc3 Binary files /dev/null and b/data/IW5/_unamed/1488.gscbin differ diff --git a/data/IW5/_unamed/1489.gscbin b/data/IW5/_unamed/1489.gscbin new file mode 100644 index 00000000..c14e1422 Binary files /dev/null and b/data/IW5/_unamed/1489.gscbin differ diff --git a/data/IW5/_unamed/1490.gscbin b/data/IW5/_unamed/1490.gscbin new file mode 100644 index 00000000..13ad576f Binary files /dev/null and b/data/IW5/_unamed/1490.gscbin differ diff --git a/data/IW5/_unamed/1491.gscbin b/data/IW5/_unamed/1491.gscbin new file mode 100644 index 00000000..3ba8d770 Binary files /dev/null and b/data/IW5/_unamed/1491.gscbin differ diff --git a/data/IW5/_unamed/1492.gscbin b/data/IW5/_unamed/1492.gscbin new file mode 100644 index 00000000..5fec43a7 Binary files /dev/null and b/data/IW5/_unamed/1492.gscbin differ diff --git a/data/IW5/_unamed/1493.gscbin b/data/IW5/_unamed/1493.gscbin new file mode 100644 index 00000000..3d294b35 Binary files /dev/null and b/data/IW5/_unamed/1493.gscbin differ diff --git a/data/IW5/_unamed/1494.gscbin b/data/IW5/_unamed/1494.gscbin new file mode 100644 index 00000000..4a3abbbb Binary files /dev/null and b/data/IW5/_unamed/1494.gscbin differ diff --git a/data/IW5/_unamed/1495.gscbin b/data/IW5/_unamed/1495.gscbin new file mode 100644 index 00000000..360e01aa Binary files /dev/null and b/data/IW5/_unamed/1495.gscbin differ diff --git a/data/IW5/_unamed/1496.gscbin b/data/IW5/_unamed/1496.gscbin new file mode 100644 index 00000000..beafe353 Binary files /dev/null and b/data/IW5/_unamed/1496.gscbin differ diff --git a/data/IW5/_unamed/1497.gscbin b/data/IW5/_unamed/1497.gscbin new file mode 100644 index 00000000..8d556d14 Binary files /dev/null and b/data/IW5/_unamed/1497.gscbin differ diff --git a/data/IW5/_unamed/1498.gscbin b/data/IW5/_unamed/1498.gscbin new file mode 100644 index 00000000..1b147895 Binary files /dev/null and b/data/IW5/_unamed/1498.gscbin differ diff --git a/data/IW5/_unamed/1499.gscbin b/data/IW5/_unamed/1499.gscbin new file mode 100644 index 00000000..8fe56747 Binary files /dev/null and b/data/IW5/_unamed/1499.gscbin differ diff --git a/data/IW5/_unamed/1500.gscbin b/data/IW5/_unamed/1500.gscbin new file mode 100644 index 00000000..343f9ac6 Binary files /dev/null and b/data/IW5/_unamed/1500.gscbin differ diff --git a/data/IW5/_unamed/1501.gscbin b/data/IW5/_unamed/1501.gscbin new file mode 100644 index 00000000..79f4ff8a Binary files /dev/null and b/data/IW5/_unamed/1501.gscbin differ diff --git a/data/IW5/_unamed/1502.gscbin b/data/IW5/_unamed/1502.gscbin new file mode 100644 index 00000000..246a2534 Binary files /dev/null and b/data/IW5/_unamed/1502.gscbin differ diff --git a/data/IW5/_unamed/1503.gscbin b/data/IW5/_unamed/1503.gscbin new file mode 100644 index 00000000..f4b1d279 Binary files /dev/null and b/data/IW5/_unamed/1503.gscbin differ diff --git a/data/IW5/_unamed/1504.gscbin b/data/IW5/_unamed/1504.gscbin new file mode 100644 index 00000000..83e6224c Binary files /dev/null and b/data/IW5/_unamed/1504.gscbin differ diff --git a/data/IW5/_unamed/1505.gscbin b/data/IW5/_unamed/1505.gscbin new file mode 100644 index 00000000..0ab4ae56 Binary files /dev/null and b/data/IW5/_unamed/1505.gscbin differ diff --git a/data/IW5/_unamed/1506.gscbin b/data/IW5/_unamed/1506.gscbin new file mode 100644 index 00000000..55bab8c6 Binary files /dev/null and b/data/IW5/_unamed/1506.gscbin differ diff --git a/data/IW5/_unamed/1507.gscbin b/data/IW5/_unamed/1507.gscbin new file mode 100644 index 00000000..ae1d2d12 Binary files /dev/null and b/data/IW5/_unamed/1507.gscbin differ diff --git a/data/IW5/_unamed/1508.gscbin b/data/IW5/_unamed/1508.gscbin new file mode 100644 index 00000000..342cee85 Binary files /dev/null and b/data/IW5/_unamed/1508.gscbin differ diff --git a/data/IW5/_unamed/1509.gscbin b/data/IW5/_unamed/1509.gscbin new file mode 100644 index 00000000..19049bcb Binary files /dev/null and b/data/IW5/_unamed/1509.gscbin differ diff --git a/data/IW5/_unamed/1510.gscbin b/data/IW5/_unamed/1510.gscbin new file mode 100644 index 00000000..12e88deb Binary files /dev/null and b/data/IW5/_unamed/1510.gscbin differ diff --git a/data/IW5/_unamed/1511.gscbin b/data/IW5/_unamed/1511.gscbin new file mode 100644 index 00000000..db8a2059 Binary files /dev/null and b/data/IW5/_unamed/1511.gscbin differ diff --git a/data/IW5/_unamed/1544.gscbin b/data/IW5/_unamed/1544.gscbin new file mode 100644 index 00000000..9d8e31f1 Binary files /dev/null and b/data/IW5/_unamed/1544.gscbin differ diff --git a/data/IW5/_unamed/1545.gscbin b/data/IW5/_unamed/1545.gscbin new file mode 100644 index 00000000..18e5552e Binary files /dev/null and b/data/IW5/_unamed/1545.gscbin differ diff --git a/data/IW5/_unamed/1546.gscbin b/data/IW5/_unamed/1546.gscbin new file mode 100644 index 00000000..cc4d2cbb Binary files /dev/null and b/data/IW5/_unamed/1546.gscbin differ diff --git a/data/IW5/_unamed/1547.gscbin b/data/IW5/_unamed/1547.gscbin new file mode 100644 index 00000000..f95bcd75 Binary files /dev/null and b/data/IW5/_unamed/1547.gscbin differ diff --git a/data/IW5/_unamed/1548.gscbin b/data/IW5/_unamed/1548.gscbin new file mode 100644 index 00000000..e4f616b6 Binary files /dev/null and b/data/IW5/_unamed/1548.gscbin differ diff --git a/data/IW5/_unamed/1549.gscbin b/data/IW5/_unamed/1549.gscbin new file mode 100644 index 00000000..060a6947 Binary files /dev/null and b/data/IW5/_unamed/1549.gscbin differ diff --git a/data/IW5/_unamed/1550.gscbin b/data/IW5/_unamed/1550.gscbin new file mode 100644 index 00000000..03ec5e2a Binary files /dev/null and b/data/IW5/_unamed/1550.gscbin differ diff --git a/data/IW5/_unamed/1551.gscbin b/data/IW5/_unamed/1551.gscbin new file mode 100644 index 00000000..c8e66231 Binary files /dev/null and b/data/IW5/_unamed/1551.gscbin differ diff --git a/data/IW5/_unamed/1552.gscbin b/data/IW5/_unamed/1552.gscbin new file mode 100644 index 00000000..2f165926 Binary files /dev/null and b/data/IW5/_unamed/1552.gscbin differ diff --git a/data/IW5/_unamed/1553.gscbin b/data/IW5/_unamed/1553.gscbin new file mode 100644 index 00000000..b059fb25 Binary files /dev/null and b/data/IW5/_unamed/1553.gscbin differ diff --git a/data/IW5/_unamed/1554.gscbin b/data/IW5/_unamed/1554.gscbin new file mode 100644 index 00000000..897fc0e4 Binary files /dev/null and b/data/IW5/_unamed/1554.gscbin differ diff --git a/data/IW5/_unamed/1555.gscbin b/data/IW5/_unamed/1555.gscbin new file mode 100644 index 00000000..ea204381 Binary files /dev/null and b/data/IW5/_unamed/1555.gscbin differ diff --git a/data/IW5/_unamed/1556.gscbin b/data/IW5/_unamed/1556.gscbin new file mode 100644 index 00000000..5046a453 Binary files /dev/null and b/data/IW5/_unamed/1556.gscbin differ diff --git a/data/IW5/_unamed/1557.gscbin b/data/IW5/_unamed/1557.gscbin new file mode 100644 index 00000000..9324e3dd Binary files /dev/null and b/data/IW5/_unamed/1557.gscbin differ diff --git a/data/IW5/_unamed/1558.gscbin b/data/IW5/_unamed/1558.gscbin new file mode 100644 index 00000000..ec79ee25 Binary files /dev/null and b/data/IW5/_unamed/1558.gscbin differ diff --git a/data/IW5/_unamed/1559.gscbin b/data/IW5/_unamed/1559.gscbin new file mode 100644 index 00000000..6a67adf3 Binary files /dev/null and b/data/IW5/_unamed/1559.gscbin differ diff --git a/data/IW5/_unamed/1560.gscbin b/data/IW5/_unamed/1560.gscbin new file mode 100644 index 00000000..f1c21c9d Binary files /dev/null and b/data/IW5/_unamed/1560.gscbin differ diff --git a/data/IW5/_unamed/1561.gscbin b/data/IW5/_unamed/1561.gscbin new file mode 100644 index 00000000..765151f0 Binary files /dev/null and b/data/IW5/_unamed/1561.gscbin differ diff --git a/data/IW5/_unamed/1562.gscbin b/data/IW5/_unamed/1562.gscbin new file mode 100644 index 00000000..cf17cae3 Binary files /dev/null and b/data/IW5/_unamed/1562.gscbin differ diff --git a/data/IW5/_unamed/1564.gscbin b/data/IW5/_unamed/1564.gscbin new file mode 100644 index 00000000..91624c26 Binary files /dev/null and b/data/IW5/_unamed/1564.gscbin differ diff --git a/data/IW5/_unamed/1565.gscbin b/data/IW5/_unamed/1565.gscbin new file mode 100644 index 00000000..d37893aa Binary files /dev/null and b/data/IW5/_unamed/1565.gscbin differ diff --git a/data/IW5/_unamed/1566.gscbin b/data/IW5/_unamed/1566.gscbin new file mode 100644 index 00000000..8f39db8c Binary files /dev/null and b/data/IW5/_unamed/1566.gscbin differ diff --git a/data/IW5/_unamed/1567.gscbin b/data/IW5/_unamed/1567.gscbin new file mode 100644 index 00000000..ef6efb6a Binary files /dev/null and b/data/IW5/_unamed/1567.gscbin differ diff --git a/data/IW5/_unamed/1568.gscbin b/data/IW5/_unamed/1568.gscbin new file mode 100644 index 00000000..92384576 Binary files /dev/null and b/data/IW5/_unamed/1568.gscbin differ diff --git a/data/IW5/_unamed/1569.gscbin b/data/IW5/_unamed/1569.gscbin new file mode 100644 index 00000000..6189190f Binary files /dev/null and b/data/IW5/_unamed/1569.gscbin differ diff --git a/data/IW5/_unamed/1570.gscbin b/data/IW5/_unamed/1570.gscbin new file mode 100644 index 00000000..0b25c54e Binary files /dev/null and b/data/IW5/_unamed/1570.gscbin differ diff --git a/data/IW5/_unamed/1571.gscbin b/data/IW5/_unamed/1571.gscbin new file mode 100644 index 00000000..8cfc2d2e Binary files /dev/null and b/data/IW5/_unamed/1571.gscbin differ diff --git a/data/IW5/_unamed/1574.gscbin b/data/IW5/_unamed/1574.gscbin new file mode 100644 index 00000000..865f9327 Binary files /dev/null and b/data/IW5/_unamed/1574.gscbin differ diff --git a/data/IW5/_unamed/1575.gscbin b/data/IW5/_unamed/1575.gscbin new file mode 100644 index 00000000..aba85f3d Binary files /dev/null and b/data/IW5/_unamed/1575.gscbin differ diff --git a/data/IW5/_unamed/1576.gscbin b/data/IW5/_unamed/1576.gscbin new file mode 100644 index 00000000..cc5d9362 Binary files /dev/null and b/data/IW5/_unamed/1576.gscbin differ diff --git a/data/IW5/_unamed/1577.gscbin b/data/IW5/_unamed/1577.gscbin new file mode 100644 index 00000000..1cbbd74b Binary files /dev/null and b/data/IW5/_unamed/1577.gscbin differ diff --git a/data/IW5/_unamed/1578.gscbin b/data/IW5/_unamed/1578.gscbin new file mode 100644 index 00000000..b36507ce Binary files /dev/null and b/data/IW5/_unamed/1578.gscbin differ diff --git a/data/IW5/_unamed/1579.gscbin b/data/IW5/_unamed/1579.gscbin new file mode 100644 index 00000000..722d4226 Binary files /dev/null and b/data/IW5/_unamed/1579.gscbin differ diff --git a/data/IW5/_unamed/1580.gscbin b/data/IW5/_unamed/1580.gscbin new file mode 100644 index 00000000..13091348 Binary files /dev/null and b/data/IW5/_unamed/1580.gscbin differ diff --git a/data/IW5/_unamed/1581.gscbin b/data/IW5/_unamed/1581.gscbin new file mode 100644 index 00000000..bbc8c830 Binary files /dev/null and b/data/IW5/_unamed/1581.gscbin differ diff --git a/data/IW5/_unamed/1582.gscbin b/data/IW5/_unamed/1582.gscbin new file mode 100644 index 00000000..a6e6d0b9 Binary files /dev/null and b/data/IW5/_unamed/1582.gscbin differ diff --git a/data/IW5/_unamed/1583.gscbin b/data/IW5/_unamed/1583.gscbin new file mode 100644 index 00000000..29b2a356 Binary files /dev/null and b/data/IW5/_unamed/1583.gscbin differ diff --git a/data/IW5/_unamed/1584.gscbin b/data/IW5/_unamed/1584.gscbin new file mode 100644 index 00000000..ecce7a30 Binary files /dev/null and b/data/IW5/_unamed/1584.gscbin differ diff --git a/data/IW5/_unamed/1585.gscbin b/data/IW5/_unamed/1585.gscbin new file mode 100644 index 00000000..3b66a7b8 Binary files /dev/null and b/data/IW5/_unamed/1585.gscbin differ diff --git a/data/IW5/_unamed/1586.gscbin b/data/IW5/_unamed/1586.gscbin new file mode 100644 index 00000000..0b6a2094 Binary files /dev/null and b/data/IW5/_unamed/1586.gscbin differ diff --git a/data/IW5/_unamed/1587.gscbin b/data/IW5/_unamed/1587.gscbin new file mode 100644 index 00000000..58a6cd7e Binary files /dev/null and b/data/IW5/_unamed/1587.gscbin differ diff --git a/data/IW5/_unamed/1588.gscbin b/data/IW5/_unamed/1588.gscbin new file mode 100644 index 00000000..7c689977 Binary files /dev/null and b/data/IW5/_unamed/1588.gscbin differ diff --git a/data/IW5/_unamed/1589.gscbin b/data/IW5/_unamed/1589.gscbin new file mode 100644 index 00000000..b209c7f1 Binary files /dev/null and b/data/IW5/_unamed/1589.gscbin differ diff --git a/data/IW5/_unamed/1590.gscbin b/data/IW5/_unamed/1590.gscbin new file mode 100644 index 00000000..8fac94e2 Binary files /dev/null and b/data/IW5/_unamed/1590.gscbin differ diff --git a/data/IW5/_unamed/1591.gscbin b/data/IW5/_unamed/1591.gscbin new file mode 100644 index 00000000..469b14a7 Binary files /dev/null and b/data/IW5/_unamed/1591.gscbin differ diff --git a/data/IW5/_unamed/1592.gscbin b/data/IW5/_unamed/1592.gscbin new file mode 100644 index 00000000..79885257 Binary files /dev/null and b/data/IW5/_unamed/1592.gscbin differ diff --git a/data/IW5/_unamed/1593.gscbin b/data/IW5/_unamed/1593.gscbin new file mode 100644 index 00000000..a52af29a Binary files /dev/null and b/data/IW5/_unamed/1593.gscbin differ diff --git a/data/IW5/_unamed/1594.gscbin b/data/IW5/_unamed/1594.gscbin new file mode 100644 index 00000000..7b2ef467 Binary files /dev/null and b/data/IW5/_unamed/1594.gscbin differ diff --git a/data/IW5/_unamed/1595.gscbin b/data/IW5/_unamed/1595.gscbin new file mode 100644 index 00000000..8f8e422d Binary files /dev/null and b/data/IW5/_unamed/1595.gscbin differ diff --git a/data/IW5/_unamed/15964.gscbin b/data/IW5/_unamed/15964.gscbin new file mode 100644 index 00000000..757cb9ec Binary files /dev/null and b/data/IW5/_unamed/15964.gscbin differ diff --git a/data/IW5/_unamed/15965.gscbin b/data/IW5/_unamed/15965.gscbin new file mode 100644 index 00000000..42dd899c Binary files /dev/null and b/data/IW5/_unamed/15965.gscbin differ diff --git a/data/IW5/_unamed/15966.gscbin b/data/IW5/_unamed/15966.gscbin new file mode 100644 index 00000000..76c29fcf Binary files /dev/null and b/data/IW5/_unamed/15966.gscbin differ diff --git a/data/IW5/_unamed/15967.gscbin b/data/IW5/_unamed/15967.gscbin new file mode 100644 index 00000000..b9f47341 Binary files /dev/null and b/data/IW5/_unamed/15967.gscbin differ diff --git a/data/IW5/_unamed/1597.gscbin b/data/IW5/_unamed/1597.gscbin new file mode 100644 index 00000000..7b47eb5f Binary files /dev/null and b/data/IW5/_unamed/1597.gscbin differ diff --git a/data/IW5/_unamed/15973.gscbin b/data/IW5/_unamed/15973.gscbin new file mode 100644 index 00000000..8ba9d5a3 Binary files /dev/null and b/data/IW5/_unamed/15973.gscbin differ diff --git a/data/IW5/_unamed/1598.gscbin b/data/IW5/_unamed/1598.gscbin new file mode 100644 index 00000000..dcc07708 Binary files /dev/null and b/data/IW5/_unamed/1598.gscbin differ diff --git a/data/IW5/_unamed/15992.gscbin b/data/IW5/_unamed/15992.gscbin new file mode 100644 index 00000000..bfa3f953 Binary files /dev/null and b/data/IW5/_unamed/15992.gscbin differ diff --git a/data/IW5/_unamed/1636.gscbin b/data/IW5/_unamed/1636.gscbin new file mode 100644 index 00000000..aa58eb76 Binary files /dev/null and b/data/IW5/_unamed/1636.gscbin differ diff --git a/data/IW5/_unamed/1637.gsc b/data/IW5/_unamed/1637.gsc new file mode 100644 index 00000000..ef3a92c9 --- /dev/null +++ b/data/IW5/_unamed/1637.gsc @@ -0,0 +1,15 @@ +// IW5 PC GSC +// Decompiled by https://github.com/xensik/gsc-tool + +main() +{ + self setmodel( "body_london_male_a" ); + codescripts\character::attachHead( "alias_civilian_heads_male_drone", _ID1636::main() ); + self._ID2738 = "british"; +} + +precache() +{ + precachemodel( "body_london_male_a" ); + codescripts\character::precacheModelArray( _ID1636::main() ); +} diff --git a/data/IW5/_unamed/1637.gscbin b/data/IW5/_unamed/1637.gscbin new file mode 100644 index 00000000..4da886ef Binary files /dev/null and b/data/IW5/_unamed/1637.gscbin differ diff --git a/data/IW5/_unamed/1638.gsc b/data/IW5/_unamed/1638.gsc new file mode 100644 index 00000000..7b2178b5 --- /dev/null +++ b/data/IW5/_unamed/1638.gsc @@ -0,0 +1,15 @@ +// IW5 PC GSC +// Decompiled by https://github.com/xensik/gsc-tool + +main() +{ + self setmodel( "body_london_male_b" ); + codescripts\character::attachHead( "alias_civilian_heads_male_drone", _ID1636::main() ); + self._ID2738 = "british"; +} + +precache() +{ + precachemodel( "body_london_male_b" ); + codescripts\character::precacheModelArray( _ID1636::main() ); +} diff --git a/data/IW5/_unamed/1638.gscbin b/data/IW5/_unamed/1638.gscbin new file mode 100644 index 00000000..c747fea6 Binary files /dev/null and b/data/IW5/_unamed/1638.gscbin differ diff --git a/data/IW5/_unamed/1639.gsc b/data/IW5/_unamed/1639.gsc new file mode 100644 index 00000000..d16e30df --- /dev/null +++ b/data/IW5/_unamed/1639.gsc @@ -0,0 +1,150 @@ +// IW5 PC GSC +// Decompiled by https://github.com/xensik/gsc-tool +#using_animtree("vehicles"); +#using_animtree("generic_human"); + +main( var0, var1, var2 ) +{ + _ID95::_ID10946( "gaz_tigr_turret", var0, var1, var2 ); + _ID95::_ID10962( ::_ID11037 ); + _ID95::_ID10957( ::_ID15960 ); + _ID95::_ID10945( %humvee_50cal_driving_idle_forward, %humvee_50cal_driving_idle_backward, 10 ); + _ID95::_ID10949(); + _ID95::_ID10958( 999, 500, 1500 ); + _ID95::_ID10950( "axis" ); + + if ( issubstr( var2, "turret" ) ) + { + _ID95::_ID10954( ::_ID17464, ::_ID15004 ); + _ID95::_ID10826( "dshk_gaz", "tag_turret", "weapon_dshk_turret", undefined, "auto_ai", 0.2, -20, -14 ); + } + else + _ID95::_ID10954( ::_ID15005, ::_ID15004 ); + + _ID17462( var2 ); + var_3 = _ID95::_ID11034( var0, var2 ); + _ID95::_ID10925( var_3, "headlight_L", "TAG_HEADLIGHT_LEFT", "misc/spotlight_btr80_daytime", "running", 0 ); + _ID95::_ID10925( var_3, "headlight_R", "TAG_HEADLIGHT_RIGHT", "misc/spotlight_btr80_daytime", "running", 0 ); + _ID95::_ID10925( var_3, "brakelight_L", "TAG_BRAKELIGHT_LEFT", "misc/car_taillight_btr80_eye", "running", 0 ); + _ID95::_ID10925( var_3, "brakelight_R", "TAG_BRAKELIGHT_RIGHT", "misc/car_taillight_btr80_eye", "running", 0 ); +} + +_ID11037() +{ + +} + +_ID15960() +{ + var_0 = []; + var_1 = "passengers"; + var_0[var_1] = []; + var_0[var_1][var_0[var_1].size] = 1; + var_0[var_1][var_0[var_1].size] = 2; + var_0[var_1][var_0[var_1].size] = 3; + var_1 = "all_but_gunner"; + var_0[var_1] = []; + var_0[var_1][var_0[var_1].size] = 0; + var_0[var_1][var_0[var_1].size] = 1; + var_0[var_1][var_0[var_1].size] = 2; + var_1 = "rear_driver_side"; + var_0[var_1] = []; + var_0[var_1][var_0[var_1].size] = 2; + var_1 = "gunner"; + var_0[var_1] = []; + var_0[var_1][var_0[var_1].size] = 3; + var_1 = "all"; + var_0[var_1] = []; + var_0[var_1][var_0[var_1].size] = 0; + var_0[var_1][var_0[var_1].size] = 1; + var_0[var_1][var_0[var_1].size] = 2; + var_0[var_1][var_0[var_1].size] = 3; + var_0["default"] = var_0["all"]; + return var_0; +} + +_ID17462( var0 ) +{ + level._effect["gazfire"] = loadfx( "fire/firelp_med_pm_nolight" ); + level._effect["gazexplode"] = loadfx( "explosions/vehicle_explosion_gaz" ); + level._effect["gazcookoff"] = loadfx( "explosions/ammo_cookoff" ); + level._effect["gazsmfire"] = loadfx( "fire/firelp_small_pm_a" ); + _ID95::_ID10942( "vehicle_gaz_tigr_base", "vehicle_gaz_tigr_harbor_destroyed" ); + _ID95::_ID10754( "explosions/vehicle_explosion_gaz", "tag_deathfx" ); + _ID95::_ID10754( "fire/firelp_med_pm_nolight", "tag_cab_fx", undefined, undefined, undefined, 1, 0 ); + _ID95::_ID10754( "fire/firelp_small_pm_a", "tag_trunk_fx", undefined, undefined, undefined, 1, 3 ); + _ID95::_ID10744( 1, 1.6, 500 ); + _ID95::_ID10739( ( 0, 0, 32 ), 300, 200, 0, 0 ); +} + +_ID15004( var0 ) +{ + var0[0]._ID9507 = %gaz_dismount_frontl_door; + var0[1]._ID9507 = %gaz_dismount_frontr_door; + var0[2]._ID9507 = %gaz_dismount_backl_door; + var0[3]._ID9507 = %gaz_dismount_backr_door; + var0[0]._ID9506 = %gaz_mount_frontl_door; + var0[1]._ID9506 = %gaz_mount_frontr_door; + var0[2]._ID9506 = %gaz_enter_back_door; + var0[3]._ID9506 = %gaz_enter_back_door; + var0[0]._ID9601 = "gaz_door_open"; + var0[1]._ID9601 = "gaz_door_open"; + var0[2]._ID9601 = "gaz_door_open"; + var0[3]._ID9601 = "gaz_door_open"; + var0[0]._ID9511 = "gaz_door_close"; + var0[1]._ID9511 = "gaz_door_close"; + var0[2]._ID9511 = "gaz_door_close"; + var0[3]._ID9511 = "gaz_door_close"; + return var0; +} + +_ID17463( var0 ) +{ + var0[3]._ID9507 = %gaz_turret_getout_gaz; + return var0; +} + +_ID15005() +{ + var_0 = []; + + for ( var_1 = 0; var_1 < 4; var_1++ ) + var_0[var_1] = spawnstruct(); + + var_0[0]._ID9458 = "tag_driver"; + var_0[1]._ID9458 = "tag_passenger"; + var_0[2]._ID9458 = "tag_guy0"; + var_0[3]._ID9458 = "tag_guy1"; + var_0[0]._ID9460 = 0; + var_0[0]._ID4168 = %gaz_dismount_frontl; + var_0[0]._ID9457 = 1; + var_0[0]._ID3929 = %gaz_idle_frontl; + var_0[1]._ID3929 = %gaz_idle_frontr; + var_0[2]._ID3929 = %gaz_idle_backl; + var_0[3]._ID3929 = %gaz_idle_backr; + var_0[0]._ID9596 = %gaz_dismount_frontl; + var_0[1]._ID9596 = %gaz_dismount_frontr; + var_0[2]._ID9596 = %gaz_dismount_backl; + var_0[3]._ID9596 = %gaz_dismount_backr; + var_0[0]._ID9497 = %gaz_mount_frontl; + var_0[1]._ID9497 = %gaz_mount_frontr; + var_0[2]._ID9497 = %gaz_enter_backr; + var_0[3]._ID9497 = %gaz_enter_backl; + return var_0; +} + +_ID17464() +{ + var_0 = _ID15005(); + var_0[3]._ID9469 = 0; + var_0[3]._ID9659 = ::_ID17465; + var_0[3]._ID9458 = "tag_guy_turret"; + var_0[3]._ID9596 = %gaz_turret_getout_guy1; + var_0 = _ID17463( var_0 ); + return var_0; +} + +_ID17465( var0, var1, var2, var3 ) +{ + +} diff --git a/data/IW5/_unamed/1639.gscbin b/data/IW5/_unamed/1639.gscbin new file mode 100644 index 00000000..b1eb463c Binary files /dev/null and b/data/IW5/_unamed/1639.gscbin differ diff --git a/data/IW5/_unamed/1640.gscasm b/data/IW5/_unamed/1640.gscasm new file mode 100644 index 00000000..a98737c3 --- /dev/null +++ b/data/IW5/_unamed/1640.gscasm @@ -0,0 +1,1171 @@ +// IW5 PC GSCASM +// Disassembled by https://github.com/xensik/gsc-tool + +sub_main + SAFE_CREATE_VARIABLE_FIELD_CACHED 0 + SAFE_CREATE_VARIABLE_FIELD_CACHED 1 + SAFE_CREATE_VARIABLE_FIELD_CACHED 2 + SAFE_CREATE_VARIABLE_FIELD_CACHED 3 + CHECK_CLEAR_PARAMS + PRE_CALL + EVAL_LOCAL_VARIABLE_CACHED1 + EVAL_LOCAL_VARIABLE_CACHED2 + EVAL_LOCAL_VARIABLE_CACHED3 + GET_STRING "hind" + CALL_FAR_FUNC _ID95 _ID10946 + DEC_TOP + PRE_CALL + GET_LOCAL_FUNC sub__ID11037 + CALL_FAR_FUNC _ID95 _ID10962 + DEC_TOP + PRE_CALL + GET_STRING "vehicle_mi24p_hind_desert" + CALL_FAR_FUNC _ID95 _ID10942 + DEC_TOP + PRE_CALL + GET_STRING "vehicle_mi24p_hind_woodland" + CALL_FAR_FUNC _ID95 _ID10942 + DEC_TOP + PRE_CALL + GET_STRING "vehicle_mi24p_hind_woodland_opened_door" + CALL_FAR_FUNC _ID95 _ID10942 + DEC_TOP + EMPTY_ARRAY + SET_NEW_LOCAL_VARIABLE_FIELD_CACHED0 4 + GET_STRING "explosions/helicopter_explosion_hind_desert" + GET_STRING "vehicle_mi24p_hind_desert" + EVAL_LOCAL_ARRAY_REF_CACHED0 + SET_VARIABLE_FIELD + GET_STRING "explosions/helicopter_explosion_hind_woodland" + GET_STRING "vehicle_mi24p_hind_woodland" + EVAL_LOCAL_ARRAY_REF_CACHED0 + SET_VARIABLE_FIELD + GET_STRING "explosions/helicopter_explosion_hind_woodland" + GET_STRING "vehicle_mi24p_hind_woodland_opened_door" + EVAL_LOCAL_ARRAY_REF_CACHED0 + SET_VARIABLE_FIELD + GET_STRING "explosions/helicopter_explosion_hind_chernobyl" + GET_STRING "vehicle_mi24p_hind_chernobyl" + EVAL_LOCAL_ARRAY_REF_CACHED0 + SET_VARIABLE_FIELD + GET_STRING "explosions/helicopter_explosion_hind_chernobyl" + GET_STRING "vehicle_ny_harbor_hind" + EVAL_LOCAL_ARRAY_REF_CACHED0 + SET_VARIABLE_FIELD + GET_STRING "explosions/helicopter_explosion_hind_chernobyl" + GET_STRING "payback_vehicle_hind" + EVAL_LOCAL_ARRAY_REF_CACHED0 + SET_VARIABLE_FIELD + EMPTY_ARRAY + SET_NEW_LOCAL_VARIABLE_FIELD_CACHED0 5 + GET_STRING "explosions/aerial_explosion_hind_desert" + GET_STRING "vehicle_mi24p_hind_desert" + EVAL_LOCAL_ARRAY_REF_CACHED0 + SET_VARIABLE_FIELD + GET_STRING "explosions/aerial_explosion_hind_woodland" + GET_STRING "vehicle_mi24p_hind_woodland" + EVAL_LOCAL_ARRAY_REF_CACHED0 + SET_VARIABLE_FIELD + GET_STRING "explosions/aerial_explosion_hind_woodland" + GET_STRING "vehicle_mi24p_hind_woodland_opened_door" + EVAL_LOCAL_ARRAY_REF_CACHED0 + SET_VARIABLE_FIELD + GET_STRING "explosions/aerial_explosion_hind_chernobyl" + GET_STRING "vehicle_mi24p_hind_chernobyl" + EVAL_LOCAL_ARRAY_REF_CACHED0 + SET_VARIABLE_FIELD + GET_STRING "explosions/aerial_explosion_hind_chernobyl" + GET_STRING "vehicle_ny_harbor_hind" + EVAL_LOCAL_ARRAY_REF_CACHED0 + SET_VARIABLE_FIELD + GET_STRING "explosions/aerial_explosion_hind_chernobyl" + GET_STRING "payback_vehicle_hind" + EVAL_LOCAL_ARRAY_REF_CACHED0 + SET_VARIABLE_FIELD + EVAL_LOCAL_VARIABLE_CACHED2 + CALL_BUILTIN_FUNC_1 isdefined + JMP_FALSE loc_C4 + PRE_CALL + GET_NBYTE 14 + GET_BYTE 20 + GET_FLOAT 0.5 + GET_STRING "auto_ai" + GET_UNDEFINED + GET_STRING "weapon_dshk" + GET_STRING "tag_doorgun" + GET_STRING "ny_harbor_hind_sideturret" + CALL_FAR_FUNC _ID95 _ID10826 + DEC_TOP + loc_C4 + PRE_CALL + GET_ZERO + GET_UNDEFINED + GET_ANIMATION "vehicles" "bh_rotors" + CALL_FAR_FUNC _ID95 _ID10945 + DEC_TOP + PRE_CALL + GET_BYTE 1 + GET_FLOAT 0.2 + GET_UNDEFINED + GET_UNDEFINED + GET_UNDEFINED + GET_STRING "hind_helicopter_hit" + GET_STRING "tag_engine_left" + GET_STRING "explosions/grenadeexp_default" + CALL_FAR_FUNC _ID95 _ID10754 + DEC_TOP + PRE_CALL + GET_BYTE 1 + GET_FLOAT 0.5 + GET_UNDEFINED + GET_UNDEFINED + GET_UNDEFINED + GET_STRING "hind_helicopter_secondary_exp" + GET_STRING "tail_rotor_jnt" + GET_STRING "explosions/grenadeexp_default" + CALL_FAR_FUNC _ID95 _ID10754 + DEC_TOP + PRE_CALL + GET_BYTE 1 + GET_FLOAT 0.5 + GET_BYTE 1 + GET_FLOAT 0.05 + GET_BYTE 1 + GET_STRING "hind_helicopter_dying_loop" + GET_STRING "tail_rotor_jnt" + GET_STRING "fire/fire_smoke_trail_L" + CALL_FAR_FUNC _ID95 _ID10754 + DEC_TOP + PRE_CALL + GET_BYTE 1 + GET_FLOAT 2.5 + GET_UNDEFINED + GET_UNDEFINED + GET_UNDEFINED + GET_STRING "hind_helicopter_secondary_exp" + GET_STRING "tag_engine_right" + GET_STRING "explosions/aerial_explosion" + CALL_FAR_FUNC _ID95 _ID10754 + DEC_TOP + PRE_CALL + GET_FLOAT 4 + GET_UNDEFINED + GET_UNDEFINED + GET_UNDEFINED + GET_STRING "hind_helicopter_secondary_exp" + GET_STRING "tag_deathfx" + GET_STRING "explosions/aerial_explosion" + CALL_FAR_FUNC _ID95 _ID10754 + DEC_TOP + PRE_CALL + GET_STRING "stop_crash_loop_sound" + GET_UNDEFINED + GET_NBYTE 1 + GET_UNDEFINED + GET_UNDEFINED + GET_UNDEFINED + GET_STRING "hind_helicopter_crash" + GET_UNDEFINED + EVAL_LOCAL_VARIABLE_CACHED5 + EVAL_LOCAL_ARRAY_CACHED 1 + CALL_FAR_FUNC _ID95 _ID10754 + DEC_TOP + PRE_CALL + GET_ZERO + GET_UNDEFINED + GET_BYTE 1 + GET_UNDEFINED + GET_UNDEFINED + GET_UNDEFINED + GET_UNDEFINED + GET_STRING "hind_helicopter_crash" + GET_STRING "tag_deathfx" + EVAL_LOCAL_VARIABLE_CACHED5 + EVAL_LOCAL_ARRAY_CACHED 0 + CALL_FAR_FUNC _ID95 _ID10756 + DEC_TOP + CALL_FAR_FUNC2 _ID95 _ID10949 + DEC_TOP + PRE_CALL + GET_USHORT 1500 + GET_USHORT 500 + GET_USHORT 999 + CALL_FAR_FUNC _ID95 _ID10958 + DEC_TOP + PRE_CALL + GET_STRING "axis" + CALL_FAR_FUNC _ID95 _ID10950 + DEC_TOP + PRE_CALL + GET_LOCAL_FUNC sub__ID15004 + GET_LOCAL_FUNC sub__ID15005 + CALL_FAR_FUNC _ID95 _ID10954 + DEC_TOP + PRE_CALL + GET_LOCAL_FUNC sub__ID16004 + CALL_FAR_FUNC _ID95 _ID10956 + DEC_TOP + PRE_CALL + GET_LOCAL_FUNC sub__ID15960 + CALL_FAR_FUNC _ID95 _ID10957 + DEC_TOP + GET_BYTE 1 + GET_ZERO + CALL_BUILTIN_FUNC_2 randomfloatrange + SET_NEW_LOCAL_VARIABLE_FIELD_CACHED0 6 + PRE_CALL + EVAL_LOCAL_VARIABLE_CACHED4 + EVAL_LOCAL_VARIABLE_CACHED 6 + CALL_FAR_FUNC _ID95 _ID11034 + SET_NEW_LOCAL_VARIABLE_FIELD_CACHED0 7 + PRE_CALL + GET_FLOAT 0 + GET_STRING "interior" + GET_STRING "misc/aircraft_light_cockpit_red" + GET_STRING "tag_light_cargo01" + GET_STRING "cockpit_blue_cargo01" + EVAL_LOCAL_VARIABLE_CACHED0 + CALL_FAR_FUNC _ID95 _ID10925 + DEC_TOP + PRE_CALL + GET_FLOAT 0.1 + GET_STRING "interior" + GET_STRING "misc/aircraft_light_cockpit_blue" + GET_STRING "tag_light_cockpit01" + GET_STRING "cockpit_blue_cockpit01" + EVAL_LOCAL_VARIABLE_CACHED0 + CALL_FAR_FUNC _ID95 _ID10925 + DEC_TOP + PRE_CALL + EVAL_LOCAL_VARIABLE_CACHED1 + GET_STRING "running" + GET_STRING "misc/aircraft_light_white_blink" + GET_STRING "tag_light_belly" + GET_STRING "white_blink" + EVAL_LOCAL_VARIABLE_CACHED0 + CALL_FAR_FUNC _ID95 _ID10925 + DEC_TOP + PRE_CALL + EVAL_LOCAL_VARIABLE_CACHED1 + GET_STRING "running" + GET_STRING "misc/aircraft_light_red_blink" + GET_STRING "tag_light_tail" + GET_STRING "white_blink_tail" + EVAL_LOCAL_VARIABLE_CACHED0 + CALL_FAR_FUNC _ID95 _ID10925 + DEC_TOP + PRE_CALL + EVAL_LOCAL_VARIABLE_CACHED1 + GET_STRING "running" + GET_STRING "misc/aircraft_light_wingtip_green" + GET_STRING "tag_light_L_wing" + GET_STRING "wingtip_green" + EVAL_LOCAL_VARIABLE_CACHED0 + CALL_FAR_FUNC _ID95 _ID10925 + DEC_TOP + PRE_CALL + EVAL_LOCAL_VARIABLE_CACHED1 + GET_STRING "running" + GET_STRING "misc/aircraft_light_wingtip_red" + GET_STRING "tag_light_R_wing" + GET_STRING "wingtip_red" + EVAL_LOCAL_VARIABLE_CACHED0 + CALL_FAR_FUNC _ID95 _ID10925 + DEC_TOP + PRE_CALL + GET_FLOAT 0 + GET_STRING "spot" + GET_STRING "misc/aircraft_light_hindspot" + GET_STRING "tag_passenger" + GET_STRING "spot" + EVAL_LOCAL_VARIABLE_CACHED0 + CALL_FAR_FUNC _ID95 _ID10925 + DEC_TOP + PRE_CALL + GET_BYTE 1 + CALL_FAR_FUNC _ID95 _ID10952 + DEC_TOP + END +end_main + +sub__ID11037 + CHECK_CLEAR_PARAMS + CALL_FAR_FUNC2 _ID65 _ID7717 + JMP_FALSE loc_289 + GET_BYTE 144 + SET_SELF_FIELD_VARIABLE_FIELD _ID10590 + GET_USHORT 762 + SET_SELF_FIELD_VARIABLE_FIELD _ID10586 + JMP loc_28F + loc_289 + GET_USHORT 906 + SET_SELF_FIELD_VARIABLE_FIELD _ID10586 + loc_28F + GET_ZERO + SET_SELF_FIELD_VARIABLE_FIELD _ID10561 + PRE_CALL + GET_STRING "running" + CALL_FAR_FUNC _ID95 _ID10931 + DEC_TOP + END +end__ID11037 + +sub__ID15004 + SAFE_CREATE_VARIABLE_FIELD_CACHED 0 + CHECK_CLEAR_PARAMS + GET_ZERO + SET_NEW_LOCAL_VARIABLE_FIELD_CACHED0 1 + loc_2A3 + EVAL_LOCAL_VARIABLE_CACHED0 + EVAL_LOCAL_VARIABLE_CACHED1 + SIZE + LESS + JMP_FALSE loc_2BD + GET_ANIMATION "" "bh_idle" + EVAL_LOCAL_VARIABLE_CACHED0 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9507 + SET_VARIABLE_FIELD + EVAL_LOCAL_VARIABLE_REF_CACHED0 + INC + SET_VARIABLE_FIELD + JMP_BACK loc_2A3 + loc_2BD + EVAL_LOCAL_VARIABLE_CACHED1 + RETN + END +end__ID15004 + +sub__ID16003 + SAFE_CREATE_VARIABLE_FIELD_CACHED 0 + CHECK_CLEAR_PARAMS + GET_ANIMATION "fastrope" "bh_player_idle" + GET_BYTE 3 + EVAL_LOCAL_ARRAY_CACHED 0 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9551 + SET_VARIABLE_FIELD + GET_STRING "fastrope_start_plr" + GET_BYTE 3 + EVAL_LOCAL_ARRAY_CACHED 0 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9612 + SET_VARIABLE_FIELD + GET_STRING "fastrope_loop_plr" + GET_BYTE 3 + EVAL_LOCAL_ARRAY_CACHED 0 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9615 + SET_VARIABLE_FIELD + GET_STRING "fastrope_end_plr" + GET_BYTE 3 + EVAL_LOCAL_ARRAY_CACHED 0 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9623 + SET_VARIABLE_FIELD + GET_ANIMATION "" "bh_player_drop" + GET_BYTE 3 + EVAL_LOCAL_ARRAY_CACHED 0 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9610 + SET_VARIABLE_FIELD + GET_ANIMTREE "" + GET_BYTE 3 + EVAL_LOCAL_ARRAY_CACHED 0 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID10916 + SET_VARIABLE_FIELD + EVAL_LOCAL_VARIABLE_CACHED0 + RETN + END +end__ID16003 + +sub__ID15005 + CHECK_CLEAR_PARAMS + EMPTY_ARRAY + SET_NEW_LOCAL_VARIABLE_FIELD_CACHED0 0 + GET_ZERO + SET_NEW_LOCAL_VARIABLE_FIELD_CACHED0 1 + loc_318 + EVAL_LOCAL_VARIABLE_CACHED0 + GET_BYTE 9 + LESS + JMP_FALSE loc_32C + CALL_BUILTIN_FUNC_0 spawnstruct + EVAL_LOCAL_VARIABLE_CACHED0 + EVAL_LOCAL_ARRAY_REF_CACHED 1 + SET_VARIABLE_FIELD + EVAL_LOCAL_VARIABLE_REF_CACHED0 + INC + SET_VARIABLE_FIELD + JMP_BACK loc_318 + loc_32C + GET_ANIMATION "generic_human" "helicopter_pilot1_idle" + GET_ZERO + GET_ZERO + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID3929 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_ANIMATION "" "helicopter_pilot1_twitch_clickpannel" + GET_BYTE 1 + GET_ZERO + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID3929 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_ANIMATION "" "helicopter_pilot1_twitch_lookback" + GET_BYTE 2 + GET_ZERO + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID3929 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_ANIMATION "" "helicopter_pilot1_twitch_lookoutside" + GET_BYTE 3 + GET_ZERO + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID3929 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_USHORT 500 + GET_ZERO + GET_ZERO + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9549 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_BYTE 100 + GET_BYTE 1 + GET_ZERO + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9549 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_BYTE 100 + GET_BYTE 2 + GET_ZERO + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9549 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_BYTE 100 + GET_BYTE 3 + GET_ZERO + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9549 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_ANIMATION "" "helicopter_pilot2_idle" + GET_ZERO + GET_BYTE 1 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID3929 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_ANIMATION "" "helicopter_pilot2_twitch_clickpannel" + GET_BYTE 1 + GET_BYTE 1 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID3929 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_ANIMATION "" "helicopter_pilot2_twitch_lookoutside" + GET_BYTE 2 + GET_BYTE 1 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID3929 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_ANIMATION "" "helicopter_pilot2_twitch_radio" + GET_BYTE 3 + GET_BYTE 1 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID3929 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_USHORT 450 + GET_ZERO + GET_BYTE 1 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9549 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_BYTE 100 + GET_BYTE 1 + GET_BYTE 1 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9549 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_BYTE 100 + GET_BYTE 2 + GET_BYTE 1 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9549 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_BYTE 100 + GET_BYTE 3 + GET_BYTE 1 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9549 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_ZERO + GET_ZERO + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9460 + SET_VARIABLE_FIELD + GET_ZERO + GET_BYTE 1 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9460 + SET_VARIABLE_FIELD + GET_ANIMATION "" "bh_1_idle" + GET_BYTE 2 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID3929 + SET_VARIABLE_FIELD + GET_ANIMATION "" "bh_2_idle" + GET_BYTE 3 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID3929 + SET_VARIABLE_FIELD + GET_ANIMATION "" "bh_4_idle" + GET_BYTE 4 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID3929 + SET_VARIABLE_FIELD + GET_ANIMATION "" "bh_5_idle" + GET_BYTE 5 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID3929 + SET_VARIABLE_FIELD + GET_ANIMATION "" "bh_8_idle" + GET_BYTE 6 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID3929 + SET_VARIABLE_FIELD + GET_ANIMATION "" "bh_6_idle" + GET_BYTE 7 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID3929 + SET_VARIABLE_FIELD + GET_ANIMATION "" "bh_7_idle" + GET_BYTE 8 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID3929 + SET_VARIABLE_FIELD + GET_STRING "tag_driver" + GET_ZERO + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9458 + SET_VARIABLE_FIELD + GET_STRING "tag_passenger" + GET_BYTE 1 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9458 + SET_VARIABLE_FIELD + GET_STRING "tag_detach" + GET_BYTE 2 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9458 + SET_VARIABLE_FIELD + GET_STRING "tag_detach" + GET_BYTE 3 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9458 + SET_VARIABLE_FIELD + GET_STRING "tag_detach" + GET_BYTE 4 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9458 + SET_VARIABLE_FIELD + GET_STRING "tag_detach" + GET_BYTE 5 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9458 + SET_VARIABLE_FIELD + GET_STRING "tag_detach" + GET_BYTE 6 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9458 + SET_VARIABLE_FIELD + GET_STRING "tag_detach" + GET_BYTE 7 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9458 + SET_VARIABLE_FIELD + GET_STRING "tag_detach" + GET_BYTE 8 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9458 + SET_VARIABLE_FIELD + GET_ANIMATION "" "bh_1_drop" + GET_BYTE 2 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9596 + SET_VARIABLE_FIELD + GET_ANIMATION "" "bh_2_drop" + GET_BYTE 3 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9596 + SET_VARIABLE_FIELD + GET_ANIMATION "" "bh_4_drop" + GET_BYTE 4 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9596 + SET_VARIABLE_FIELD + GET_ANIMATION "" "bh_5_drop" + GET_BYTE 5 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9596 + SET_VARIABLE_FIELD + GET_ANIMATION "" "bh_8_drop" + GET_BYTE 6 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9596 + SET_VARIABLE_FIELD + GET_ANIMATION "" "bh_6_drop" + GET_BYTE 7 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9596 + SET_VARIABLE_FIELD + GET_ANIMATION "" "bh_7_drop" + GET_BYTE 8 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9596 + SET_VARIABLE_FIELD + GET_STRING "crouch" + GET_BYTE 2 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9626 + SET_VARIABLE_FIELD + GET_STRING "crouch" + GET_BYTE 3 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9626 + SET_VARIABLE_FIELD + GET_STRING "crouch" + GET_BYTE 4 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9626 + SET_VARIABLE_FIELD + GET_STRING "crouch" + GET_BYTE 5 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9626 + SET_VARIABLE_FIELD + GET_STRING "crouch" + GET_BYTE 6 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9626 + SET_VARIABLE_FIELD + GET_STRING "crouch" + GET_BYTE 7 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9626 + SET_VARIABLE_FIELD + GET_STRING "crouch" + GET_BYTE 8 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9626 + SET_VARIABLE_FIELD + GET_BYTE 1 + GET_BYTE 2 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9585 + SET_VARIABLE_FIELD + GET_BYTE 1 + GET_BYTE 3 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9585 + SET_VARIABLE_FIELD + GET_BYTE 1 + GET_BYTE 4 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9585 + SET_VARIABLE_FIELD + GET_BYTE 1 + GET_BYTE 5 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9585 + SET_VARIABLE_FIELD + GET_BYTE 1 + GET_BYTE 6 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9585 + SET_VARIABLE_FIELD + GET_BYTE 1 + GET_BYTE 7 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9585 + SET_VARIABLE_FIELD + GET_BYTE 1 + GET_BYTE 8 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9585 + SET_VARIABLE_FIELD + GET_ANIMATION "" "fastrope_fall" + GET_BYTE 2 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9618 + SET_VARIABLE_FIELD + GET_ANIMATION "" "fastrope_fall" + GET_BYTE 3 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9618 + SET_VARIABLE_FIELD + GET_ANIMATION "" "fastrope_fall" + GET_BYTE 4 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9618 + SET_VARIABLE_FIELD + GET_ANIMATION "" "fastrope_fall" + GET_BYTE 5 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9618 + SET_VARIABLE_FIELD + GET_ANIMATION "" "fastrope_fall" + GET_BYTE 6 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9618 + SET_VARIABLE_FIELD + GET_ANIMATION "" "fastrope_fall" + GET_BYTE 7 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9618 + SET_VARIABLE_FIELD + GET_ANIMATION "" "fastrope_fall" + GET_BYTE 8 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9618 + SET_VARIABLE_FIELD + GET_BYTE 1 + GET_BYTE 1 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9616 + SET_VARIABLE_FIELD + GET_BYTE 1 + GET_BYTE 2 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9616 + SET_VARIABLE_FIELD + GET_BYTE 1 + GET_BYTE 3 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9616 + SET_VARIABLE_FIELD + GET_BYTE 1 + GET_BYTE 4 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9616 + SET_VARIABLE_FIELD + GET_BYTE 1 + GET_BYTE 5 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9616 + SET_VARIABLE_FIELD + GET_BYTE 1 + GET_BYTE 6 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9616 + SET_VARIABLE_FIELD + GET_BYTE 1 + GET_BYTE 7 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9616 + SET_VARIABLE_FIELD + GET_BYTE 1 + GET_BYTE 8 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9616 + SET_VARIABLE_FIELD + GET_STRING "fastrope_loop_npc" + GET_BYTE 2 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9613 + SET_VARIABLE_FIELD + GET_STRING "fastrope_loop_npc" + GET_BYTE 3 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9613 + SET_VARIABLE_FIELD + GET_STRING "fastrope_loop_npc" + GET_BYTE 4 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9613 + SET_VARIABLE_FIELD + GET_STRING "fastrope_loop_npc" + GET_BYTE 5 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9613 + SET_VARIABLE_FIELD + GET_STRING "fastrope_loop_npc" + GET_BYTE 6 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9613 + SET_VARIABLE_FIELD + GET_STRING "fastrope_loop_npc" + GET_BYTE 7 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9613 + SET_VARIABLE_FIELD + GET_STRING "fastrope_loop_npc" + GET_BYTE 8 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9613 + SET_VARIABLE_FIELD + GET_STRING "TAG_FastRope_RI" + GET_BYTE 2 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9578 + SET_VARIABLE_FIELD + GET_STRING "TAG_FastRope_RI" + GET_BYTE 3 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9578 + SET_VARIABLE_FIELD + GET_STRING "TAG_FastRope_LE" + GET_BYTE 4 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9578 + SET_VARIABLE_FIELD + GET_STRING "TAG_FastRope_LE" + GET_BYTE 5 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9578 + SET_VARIABLE_FIELD + GET_STRING "TAG_FastRope_RI" + GET_BYTE 6 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9578 + SET_VARIABLE_FIELD + GET_STRING "TAG_FastRope_LE" + GET_BYTE 7 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9578 + SET_VARIABLE_FIELD + GET_STRING "TAG_FastRope_RI" + GET_BYTE 8 + EVAL_LOCAL_ARRAY_CACHED 1 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9578 + SET_VARIABLE_FIELD + PRE_CALL + EVAL_LOCAL_VARIABLE_CACHED1 + CALL_LOCAL_FUNC sub__ID16003 + RETN + END +end__ID15005 + +sub__ID15960 + CHECK_CLEAR_PARAMS + EMPTY_ARRAY + SET_NEW_LOCAL_VARIABLE_FIELD_CACHED0 0 + EMPTY_ARRAY + GET_STRING "left" + EVAL_LOCAL_ARRAY_REF_CACHED0 + SET_VARIABLE_FIELD + EMPTY_ARRAY + GET_STRING "right" + EVAL_LOCAL_ARRAY_REF_CACHED0 + SET_VARIABLE_FIELD + EMPTY_ARRAY + GET_STRING "both" + EVAL_LOCAL_ARRAY_REF_CACHED0 + SET_VARIABLE_FIELD + GET_BYTE 4 + GET_STRING "left" + EVAL_LOCAL_ARRAY_CACHED 0 + SIZE + GET_STRING "left" + EVAL_LOCAL_ARRAY_REF_CACHED0 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_BYTE 5 + GET_STRING "left" + EVAL_LOCAL_ARRAY_CACHED 0 + SIZE + GET_STRING "left" + EVAL_LOCAL_ARRAY_REF_CACHED0 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_BYTE 7 + GET_STRING "left" + EVAL_LOCAL_ARRAY_CACHED 0 + SIZE + GET_STRING "left" + EVAL_LOCAL_ARRAY_REF_CACHED0 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_BYTE 2 + GET_STRING "right" + EVAL_LOCAL_ARRAY_CACHED 0 + SIZE + GET_STRING "right" + EVAL_LOCAL_ARRAY_REF_CACHED0 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_BYTE 3 + GET_STRING "right" + EVAL_LOCAL_ARRAY_CACHED 0 + SIZE + GET_STRING "right" + EVAL_LOCAL_ARRAY_REF_CACHED0 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_BYTE 6 + GET_STRING "right" + EVAL_LOCAL_ARRAY_CACHED 0 + SIZE + GET_STRING "right" + EVAL_LOCAL_ARRAY_REF_CACHED0 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_BYTE 8 + GET_STRING "right" + EVAL_LOCAL_ARRAY_CACHED 0 + SIZE + GET_STRING "right" + EVAL_LOCAL_ARRAY_REF_CACHED0 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_BYTE 2 + GET_STRING "both" + EVAL_LOCAL_ARRAY_CACHED 0 + SIZE + GET_STRING "both" + EVAL_LOCAL_ARRAY_REF_CACHED0 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_BYTE 3 + GET_STRING "both" + EVAL_LOCAL_ARRAY_CACHED 0 + SIZE + GET_STRING "both" + EVAL_LOCAL_ARRAY_REF_CACHED0 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_BYTE 4 + GET_STRING "both" + EVAL_LOCAL_ARRAY_CACHED 0 + SIZE + GET_STRING "both" + EVAL_LOCAL_ARRAY_REF_CACHED0 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_BYTE 5 + GET_STRING "both" + EVAL_LOCAL_ARRAY_CACHED 0 + SIZE + GET_STRING "both" + EVAL_LOCAL_ARRAY_REF_CACHED0 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_BYTE 6 + GET_STRING "both" + EVAL_LOCAL_ARRAY_CACHED 0 + SIZE + GET_STRING "both" + EVAL_LOCAL_ARRAY_REF_CACHED0 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_BYTE 7 + GET_STRING "both" + EVAL_LOCAL_ARRAY_CACHED 0 + SIZE + GET_STRING "both" + EVAL_LOCAL_ARRAY_REF_CACHED0 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_BYTE 8 + GET_STRING "both" + EVAL_LOCAL_ARRAY_CACHED 0 + SIZE + GET_STRING "both" + EVAL_LOCAL_ARRAY_REF_CACHED0 + EVAL_ARRAY_REF + SET_VARIABLE_FIELD + GET_STRING "both" + EVAL_LOCAL_ARRAY_CACHED 0 + GET_STRING "default" + EVAL_LOCAL_ARRAY_REF_CACHED0 + SET_VARIABLE_FIELD + EVAL_LOCAL_VARIABLE_CACHED0 + RETN + END +end__ID15960 + +sub__ID16004 + CHECK_CLEAR_PARAMS + EMPTY_ARRAY + SET_NEW_LOCAL_VARIABLE_FIELD_CACHED0 0 + CALL_BUILTIN_FUNC_0 spawnstruct + GET_STRING "TAG_FastRope_LE" + EVAL_LOCAL_ARRAY_REF_CACHED0 + SET_VARIABLE_FIELD + GET_STRING "rope_test" + GET_STRING "TAG_FastRope_LE" + EVAL_LOCAL_ARRAY_CACHED 0 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF model + SET_VARIABLE_FIELD + GET_STRING "TAG_FastRope_LE" + GET_STRING "TAG_FastRope_LE" + EVAL_LOCAL_ARRAY_CACHED 0 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF tag + SET_VARIABLE_FIELD + GET_ANIMATION "" "bh_rope_idle_le" + GET_STRING "TAG_FastRope_LE" + EVAL_LOCAL_ARRAY_CACHED 0 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID8216 + SET_VARIABLE_FIELD + GET_ANIMATION "" "bh_rope_drop_le" + GET_STRING "TAG_FastRope_LE" + EVAL_LOCAL_ARRAY_CACHED 0 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9591 + SET_VARIABLE_FIELD + CALL_BUILTIN_FUNC_0 spawnstruct + GET_STRING "TAG_FastRope_RI" + EVAL_LOCAL_ARRAY_REF_CACHED0 + SET_VARIABLE_FIELD + GET_STRING "rope_test_ri" + GET_STRING "TAG_FastRope_RI" + EVAL_LOCAL_ARRAY_CACHED 0 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF model + SET_VARIABLE_FIELD + GET_STRING "TAG_FastRope_RI" + GET_STRING "TAG_FastRope_RI" + EVAL_LOCAL_ARRAY_CACHED 0 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF tag + SET_VARIABLE_FIELD + GET_ANIMATION "" "bh_rope_idle_ri" + GET_STRING "TAG_FastRope_RI" + EVAL_LOCAL_ARRAY_CACHED 0 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID8216 + SET_VARIABLE_FIELD + GET_ANIMATION "" "bh_rope_drop_ri" + GET_STRING "TAG_FastRope_RI" + EVAL_LOCAL_ARRAY_CACHED 0 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE_REF _ID9591 + SET_VARIABLE_FIELD + EVAL_LOCAL_VARIABLE_CACHED0 + CALL_BUILTIN_FUNC_1 getarraykeys + SET_NEW_LOCAL_VARIABLE_FIELD_CACHED0 1 + GET_ZERO + SET_NEW_LOCAL_VARIABLE_FIELD_CACHED0 2 + loc_8DB + EVAL_LOCAL_VARIABLE_CACHED0 + EVAL_LOCAL_VARIABLE_CACHED1 + SIZE + LESS + JMP_FALSE loc_8F5 + EVAL_LOCAL_VARIABLE_CACHED0 + EVAL_LOCAL_ARRAY_CACHED 1 + EVAL_LOCAL_ARRAY_CACHED 2 + CAST_FIELD_OBJ + EVAL_FIELD_VARIABLE model + CALL_BUILTIN_FUNC_1 precachemodel + DEC_TOP + EVAL_LOCAL_VARIABLE_REF_CACHED0 + INC + SET_VARIABLE_FIELD + JMP_BACK loc_8DB + loc_8F5 + EVAL_LOCAL_VARIABLE_CACHED2 + RETN + END +end__ID16004 diff --git a/data/IW5/_unamed/1640.gscbin b/data/IW5/_unamed/1640.gscbin new file mode 100644 index 00000000..9e6e8d2d Binary files /dev/null and b/data/IW5/_unamed/1640.gscbin differ diff --git a/data/IW5/_unamed/1642.gscbin b/data/IW5/_unamed/1642.gscbin new file mode 100644 index 00000000..7ba5d763 Binary files /dev/null and b/data/IW5/_unamed/1642.gscbin differ diff --git a/data/IW5/_unamed/1644.gsc b/data/IW5/_unamed/1644.gsc new file mode 100644 index 00000000..8aedf22b --- /dev/null +++ b/data/IW5/_unamed/1644.gsc @@ -0,0 +1,875 @@ +// IW5 PC GSC +// Decompiled by https://github.com/xensik/gsc-tool + +main() +{ + level._ID15388 = ::_ID15388; + level._ID15407 = ::_ID15407; + level._ID15389 = ::_ID15389; + + if ( isdefined( level._ID18404 ) && level._ID18404 ) + level._ID15391 = ::_ID18436; + + precacheshader( "uav_predator2_dir" ); + precacheshader( "uav_predator2_dirbar" ); + precacheshader( "uav_predator2_xhair" ); + precacheshader( "uav_predator2_horz_bar1" ); + precacheshader( "uav_predator2_l_topleft" ); + precacheshader( "uav_predator2_l_topright" ); + precacheshader( "uav_predator2_l_bottomleft" ); + precacheshader( "uav_predator2_l_bottomright" ); + precacheshader( "uav_predator2_heading_frame" ); + precachestring( &"UAV_M" ); + precachestring( &"UAV_WTR_DVR_ON" ); + precachestring( &"UAV_NAR" ); + precachestring( &"UAV_BLK_WHT" ); + precachestring( &"UAV_KIAS" ); + precachestring( &"UAV_N2" ); + precachestring( &"UAV_W2" ); +} + +_ID15388() +{ + if ( issplitscreen() ) + self._ID18405 = 0.666667; + else + self._ID18405 = 1; + + self._ID18406 = []; + self._ID18406["screen"] = _ID18413( 1, 1 ); + self._ID18406["text"] = _ID18419(); + self._ID18406["kias"] = _ID18426(); + self._ID18406["alt"] = _ID18429(); + self._ID18406["heading"] = _ID18433(); + self._ID18406["crosshair"] = _ID18435(); +} + +_ID18407( var0, var1, var2 ) +{ + if ( isarray( var1 ) ) + { + foreach ( var_4 in var1 ) + { + if ( var0 ) + var_4 fadeovertime( var2 ); + + var_4.alpha = 0; + } + } + else + { + if ( var_3 ) + var_4 fadeovertime( var_5 ); + + var_4.alpha = 0; + } +} + +_ID18408( var0 ) +{ + self notify( "uav_cleanup_hud" ); + + foreach ( var_2 in self._ID18406 ) + { + if ( isdefined( var_2 ) ) + _ID18407( var0, var_2, 0.25 ); + } +} + +_ID15407( var0 ) +{ + if ( var0 == 0 ) + _ID18408( 1 ); + else + _ID18409(); +} + +_ID15389( var0 ) +{ + if ( var0 == 0 ) + _ID18408( 0 ); + else + _ID18409(); +} + +_ID18409() +{ + self notify( "uav_cleanup_hud" ); + + if ( isdefined( self._ID18406 ) ) + { + foreach ( var_1 in self._ID18406 ) + { + if ( isdefined( var_1 ) ) + { + if ( isarray( var_1 ) ) + { + foreach ( var_3 in var_1 ) + _ID18410( var_3 ); + + var_1 = undefined; + continue; + } + + _ID18410( var_3 ); + } + } + + self._ID18406 = undefined; + } +} + +_ID18410( var0 ) +{ + if ( !isdefined( var0 ) ) + return; + + if ( isdefined( var0._ID17631 ) ) + var0._ID17631 destroy(); + + if ( isdefined( var0._ID17632 ) ) + var0._ID17632 destroy(); + + var0 destroy(); +} + +_ID18411( var0 ) +{ + if ( issplitscreen() ) + return var0 * self._ID18405; + else + return var0; +} + +_ID18412( var0, var1, var2, var3, var4, var5, var6, var7, var8 ) +{ + var_9 = newclienthudelem( self ); + var_9.x = _ID18411( var0 ); + var_9.y = _ID18411( var1 ); + var_9.alignx = var7; + var_9.aligny = var8; + var_9.sort = var5; + var_9.horzalign = "fullscreen"; + var_9.vertalign = "fullscreen"; + var_9.alpha = var6; + var_9 setshader( var4, var2, var3 ); + return var_9; +} + +_ID18413( var0, var1 ) +{ + var_2[0] = _ID18412( 140, 135, 21, 32, "uav_predator2_l_topleft", var0, var1, "left", "top" ); + var_2[1] = _ID18412( 499, 135, 21, 32, "uav_predator2_l_topright", var0, var1, "right", "top" ); + var_2[2] = _ID18412( 140, 364, 21, 32, "uav_predator2_l_bottomleft", var0, var1, "left", "bottom" ); + var_2[3] = _ID18412( 499, 364, 21, 32, "uav_predator2_l_bottomright", var0, var1, "right", "bottom" ); + return var_2; +} + +_ID18414( var0 ) +{ + self endon( "uav_cleanup_hud" ); + self endon( "death" ); + var_1 = 37200000; + + while ( isdefined( var0 ) ) + { + var_2 = gettime() + var_1; + var_3 = int( var_2 / 1000 ); + var_4 = int( var_3 / 60 ); + var_3 = int( var_3 - 60 * var_4 ); + var_5 = int( var_4 / 60 ); + var_4 = int( var_4 - 60 * var_5 ); + var_5 = animscripts/utility::_ID3336( var_5, 24 ); + + if ( var_5 < 10 ) + var_6 = "0" + var_5; + else + var_6 = "" + var_5; + + var0[0] settext( var_6 ); + + if ( var_4 < 10 ) + var_6 = "0" + var_4; + else + var_6 = "" + var_4; + + var0[1] settext( var_6 ); + + if ( var_3 < 10 ) + var_6 = "0" + var_3; + else + var_6 = "" + var_3; + + var0[2] settext( var_6 ); + wait 0.05; + } +} + +_ID18415() +{ + var_0[0] = _ID98::_ID2442( "default", 2 ); + var_0[0].x = _ID18411( 288 ); + var_0[0].y = _ID18411( 420 ); + var_0[0].sort = 1; + var_0[0].horzalign = "fullscreen"; + var_0[0].vertalign = "fullscreen"; + var_0[0].alpha = 1; + var_0[0].color = ( 0.56, 1, 0.52 ); + var_0[0] settext( "01" ); + var_0[1] = _ID98::_ID2442( "default", 2 ); + var_0[1].x = _ID18411( 304 ); + var_0[1].y = _ID18411( 420 ); + var_0[1].sort = 1; + var_0[1].horzalign = "fullscreen"; + var_0[1].vertalign = "fullscreen"; + var_0[1].alpha = 1; + var_0[1].color = ( 0.56, 1, 0.52 ); + var_0[1].label = ":"; + var_0[1] settext( "23" ); + var_0[2] = _ID98::_ID2442( "default", 2 ); + var_0[2].x = _ID18411( 328 ); + var_0[2].y = _ID18411( 420 ); + var_0[2].sort = 1; + var_0[2].horzalign = "fullscreen"; + var_0[2].vertalign = "fullscreen"; + var_0[2].alpha = 1; + var_0[2].color = ( 0.56, 1, 0.52 ); + var_0[2].label = ":"; + var_0[2] settext( "45" ); + thread _ID18414( var_0 ); + return var_0; +} + +_ID18416( var0 ) +{ + self endon( "uav_cleanup_hud" ); + self endon( "death" ); + + while ( isdefined( var0 ) ) + { + var_1 = _ID1555::_ID15403(); + + if ( isdefined( var_1 ) ) + { + var_2 = var_1.origin[2]; + var_2 = var_2 * 0.0254; + var_2 = int( var_2 ); + var0[0] setvalue( var_2 ); + var_3 = 1; + + for ( var_2 = var_2 / 10; var_2 > 1; var_2 = var_2 / 10 ) + var_3++; + + var0[1].x = _ID18411( 480 + 8 * var_3 ); + } + + wait 0.05; + } +} + +_ID18417() +{ + var_0[0] = _ID98::_ID2442( "default", 2 ); + var_0[0].x = _ID18411( 480 ); + var_0[0].y = _ID18411( 70 ); + var_0[0].sort = 1; + var_0[0].horzalign = "fullscreen"; + var_0[0].vertalign = "fullscreen"; + var_0[0].alpha = 1; + var_0[0].color = ( 0.56, 1, 0.52 ); + var_0[0] setvalue( 16 ); + var_0[1] = _ID98::_ID2442( "default", 2 ); + var_0[1].x = _ID18411( 488 ); + var_0[1].y = _ID18411( 70 ); + var_0[1].sort = 1; + var_0[1].horzalign = "fullscreen"; + var_0[1].vertalign = "fullscreen"; + var_0[1].alpha = 1; + var_0[1].color = ( 0.56, 1, 0.52 ); + var_0[1] settext( &"UAV_MSL" ); + thread _ID18416( var_0 ); + return var_0; +} + +_ID18418() +{ + var_0 = _ID98::_ID2442( "default", 1.2 ); + var_0.sort = 1; + var_0.horzalign = "fullscreen"; + var_0.vertalign = "fullscreen"; + var_0.alpha = 1; + var_0.color = ( 0.56, 1, 0.52 ); + return var_0; +} + +_ID18419() +{ + var_0[0] = _ID18418(); + var_0[0].x = _ID18411( 50 ); + var_0[0].y = _ID18411( 109 ); + var_0[0] settext( &"UAV_WTR_DVR_ON" ); + var_0[1] = _ID18418(); + var_0[1].x = _ID18411( 50 ); + var_0[1].y = _ID18411( 121 ); + var_0[1] settext( &"UAV_NAR" ); + var_0[2] = _ID18418(); + var_0[2].x = _ID18411( 50 ); + var_0[2].y = _ID18411( 133 ); + var_0[2] settext( &"UAV_BLK_WHT" ); + var_0[3] = _ID18418(); + var_0[3].x = _ID18411( 50 ); + var_0[3].y = _ID18411( 147 ); + var_0[3] settext( &"UAV_KIAS" ); + var_0[4] = _ID18418(); + var_0[4].x = _ID18411( 510 ); + var_0[4].y = _ID18411( 380 ); + + if ( isdefined( level._ID18420 ) ) + var_0[4] settext( level._ID18420 ); + else + var_0[4] settext( &"UAV_N2" ); + + var_0[5] = _ID18418(); + var_0[5].x = _ID18411( 508 ); + var_0[5].y = _ID18411( 400 ); + + if ( isdefined( level._ID18421 ) ) + var_0[5] settext( level._ID18421 ); + else + var_0[5] settext( &"UAV_W2" ); + + var_0[6] = _ID18418(); + var_0[6].x = _ID18411( 491 ); + var_0[6].y = _ID18411( 420 ); + var_0[6] settext( &"UAV_ALT_MSL" ); + return var_0; +} + +_ID18422( var0 ) +{ + self endon( "uav_cleanup_hud" ); + self endon( "death" ); + + while ( isdefined( var0 ) ) + { + var_1 = _ID1554::_ID15385(); + + if ( isdefined( var_1 ) ) + { + if ( isdefined( self._ID15378 ) ) + { + var_2 = self._ID15378.origin; + var_3 = anglestoforward( self._ID15378.angles ); + var_4 = var_2 + 20000 * var_3; + var_5 = bullettrace( var_2, var_4, 1, self._ID15378 ); + var_6 = distance( var_5["position"], self._ID15378.origin ); + } + else + { + var_2 = var_6.origin; + var_7 = self getplayerangles(); + var_3 = anglestoforward( var_7 ); + var_2 = var_2 + 500 * var_3; + var_4 = var_2 + 20000 * var_3; + var_5 = bullettrace( var_2, var_4, 1, self ); + var_6 = distance( var_5["position"], var_6.origin ); + } + + var_7 = var_7 * 0.0254; + var_7 = int( var_7 ); + var_6[0] setvalue( var_7 ); + var_8 = 1; + + for ( var_7 = var_7 / 10; var_7 > 1; var_7 = var_7 / 10 ) + var_8++; + + var_6[0].x = _ID18411( 320 - 8 * var_8 + 1 / 2 ); + var_6[1].x = _ID18411( 320 - 8 * var_8 + 1 / 2 + 8 * var_8 ); + _ID103::_ID5719( "predator_dist_update", var_7 ); + } + + wait 0.05; + } +} + +_ID18423() +{ + var_0[0] = _ID98::_ID2442( "default", 2 ); + var_0[0].x = _ID18411( 304 ); + var_0[0].y = _ID18411( 60 ); + var_0[0].sort = 1; + var_0[0].horzalign = "fullscreen"; + var_0[0].vertalign = "fullscreen"; + var_0[0].alpha = 1; + var_0[0].color = ( 0.56, 1, 0.52 ); + var_0[0] setvalue( 215 ); + var_0[1] = _ID98::_ID2442( "default", 2 ); + var_0[1].x = _ID18411( 328 ); + var_0[1].y = _ID18411( 60 ); + var_0[1].sort = 1; + var_0[1].horzalign = "fullscreen"; + var_0[1].vertalign = "fullscreen"; + var_0[1].alpha = 1; + var_0[1].color = ( 0.56, 1, 0.52 ); + var_0[1] settext( &"UAV_M" ); + thread _ID18422( var_0 ); + return var_0; +} + +_ID18424( var0 ) +{ + self endon( "uav_cleanup_hud" ); + self endon( "death" ); + var_1 = _ID1555::_ID15403(); + var_2 = 0; + var_3 = 0; + var_4 = 200; + + if ( isdefined( var_1 ) ) + { + if ( var_1.code_classname == "script_vehicle" ) + var_2 = var_1 vehicle_getspeed(); + + var_3 = var_2 - 30; + var_4 = var_2 + 30; + } + + var_5 = 0; + var_6 = 3; + var_7 = var_6; + var_8 = 0; + var_9 = 0; + var_10 = 25; + var_11 = 55; + var_12 = 245; + + while ( isdefined( var0 ) ) + { + var_1 = _ID1555::_ID15403(); + + if ( isdefined( var_1 ) ) + { + if ( var_1.code_classname == "script_vehicle" ) + var_2 = var_1 vehicle_getspeed(); + + var_13 = var_2 - var_3 / var_4 - var_3; + var_13 = var_13 + var_8; + + if ( var_13 < 0 ) + var_13 = 0; + + if ( var_13 > 1 ) + var_13 = 1; + + var_2 = 80 + var_13 * 30; + var_14 = var_11 / 2; + var_15 = var_12 - var_11 * 2; + var_16 = var_15 + var_14; + var_17 = var_12 + var_11 * 2; + var_18 = var_17 - var_14; + var_19 = var_2 - int( var_2 / var_10 ) * var_10; + var_20 = var_2 - var_19; + var_21 = int( var_19 / var_10 * var_11 ); + var0[0] setvalue( var_20 + var_10 * 2 ); + var_22 = var_12 + var_21 - 2 * var_11; + var0[0].y = _ID18411( var_22 ); + var0[0].alpha = clamp( var_22 - var_15 / var_14, 0, 1 ); + var0[1] setvalue( var_20 + var_10 ); + var0[1].y = _ID18411( var_12 + var_21 - var_11 ); + var0[2] setvalue( var_20 ); + var0[2].y = _ID18411( var_12 + var_21 ); + var0[3] setvalue( var_20 - var_10 ); + var_22 = var_12 + var_21 + var_11; + var0[3].y = _ID18411( var_22 ); + var0[3].alpha = 1 - clamp( var_22 - var_18 / var_14, 0, 1 ); + var0[4] setvalue( int( var_2 ) ); + var_23 = 5; + + for ( var_24 = 0; var_24 < 25; var_24++ ) + { + var_22 = var_24 * 11 + 135 + var_21 - var_11 + 4; + var0[var_23 + var_24].y = int( _ID18411( var_22 ) ); + var0[var_23 + var_24].alpha = 1; + + if ( var_22 <= var_16 ) + var0[var_23 + var_24].alpha = clamp( var_22 - var_15 / var_14, 0, 1 ); + + if ( var_22 >= var_18 ) + var0[var_23 + var_24].alpha = 1 - clamp( var_22 - var_18 / var_14, 0, 1 ); + } + } + + var_19 = var_19 + 0.05; + var_20 = var_20 + var_17; + + if ( var_19 >= var_18 ) + { + var_19 = 0; + var_25 = var_21; + var_21 = randomfloatrange( -0.1, 0.1 ); + var_17 = var_21 - var_25 * 0.05 / var_18; + } + + wait 0.05; + } +} + +_ID18425( var0, var1 ) +{ + var_2 = _ID98::_ID2442( "default", 1 ); + var_2.x = _ID18411( var0 ); + var_2.y = _ID18411( var1 ); + var_2.alignx = "right"; + var_2.sort = 1; + var_2.horzalign = "fullscreen"; + var_2.vertalign = "fullscreen"; + var_2.alpha = 1; + var_2.color = ( 1, 1, 1 ); + var_2 setvalue( 0 ); + return var_2; +} + +_ID18426() +{ + var_0[0] = _ID18425( 120, 100 ); + var_0[1] = _ID18425( 120, 120 ); + var_0[2] = _ID18425( 120, 140 ); + var_0[3] = _ID18425( 120, 160 ); + var_0[4] = _ID18418(); + var_0[4].x = _ID18411( 80 ); + var_0[4].y = _ID18411( 147 ); + var_0[4] setvalue( 100 ); + var_1 = 5; + var_2 = 5; + var_3 = 1; + + for ( var_4 = 0; var_4 < 25; var_4++ ) + { + var_0[var_1 + var_4] = newclienthudelem( self ); + var_0[var_1 + var_4].x = _ID18411( 135 ); + var_0[var_1 + var_4].y = _ID18411( var_4 * 11 + 135 ); + var_0[var_1 + var_4].alignx = "right"; + var_0[var_1 + var_4].sort = 1; + var_0[var_1 + var_4].horzalign = "fullscreen"; + var_0[var_1 + var_4].vertalign = "fullscreen"; + var_0[var_1 + var_4].alpha = 1; + var_3 = var_3 - 1; + + if ( var_3 == 0 ) + { + var_0[var_1 + var_4] setshader( "uav_predator2_horz_bar1", 8, 4 ); + var_3 = var_2; + continue; + } + + var_0[var_1 + var_4] setshader( "uav_predator2_horz_bar1", 6, 4 ); + } + + thread _ID18424( var_0 ); + return var_0; +} + +_ID18427( var0 ) +{ + self endon( "uav_cleanup_hud" ); + self endon( "death" ); + var_1 = _ID1555::_ID15403(); + var_2 = 0; + var_3 = 0; + var_4 = 1000; + + if ( isdefined( var_1 ) ) + { + var_2 = var_1.origin[2]; + var_3 = var_2 - 100; + var_4 = var_2 + 100; + } + + var_5 = 0; + var_6 = 0; + var_7 = 0; + var_8 = 0; + var_9 = 4; + var_5 = var_9; + var_10 = 250; + var_11 = 55; + var_12 = 245; + + while ( isdefined( var0 ) ) + { + var_1 = _ID1555::_ID15403(); + + if ( isdefined( var_1 ) ) + { + var_2 = var_1.origin[2]; + var_13 = var_2 - var_3 / var_4 - var_3; + var_13 = var_13 + var_7; + + if ( var_13 < 0 ) + var_13 = 0; + + if ( var_13 > 1 ) + var_13 = 1; + + var_2 = var_3 + var_13 * var_4 - var_3; + var_14 = var_11 / 2; + var_15 = var_12 - var_11 * 2; + var_16 = var_15 + var_14; + var_17 = var_12 + var_11 * 2; + var_18 = var_17 - var_14; + var_19 = var_2 - int( var_2 / var_10 ) * var_10; + var_20 = var_2 - var_19; + var_21 = int( var_19 / var_10 * var_11 ); + var0[0] setvalue( var_20 + var_10 * 2 ); + var_22 = var_12 + var_21 - 2 * var_11; + var0[0].y = _ID18411( var_22 ); + var0[0].alpha = clamp( var_22 - var_15 / var_16 - var_15, 0, 1 ); + var0[1] setvalue( var_20 + var_10 ); + var0[1].y = _ID18411( var_12 + var_21 - var_11 ); + var0[2] setvalue( var_20 ); + var0[2].y = _ID18411( var_12 + var_21 ); + var0[3] setvalue( var_20 - var_10 ); + var_22 = var_12 + var_21 + var_11; + var0[3].y = _ID18411( var_22 ); + var0[3].alpha = 1 - clamp( var_22 - var_18 / var_17 - var_18, 0, 1 ); + var_23 = 4; + + for ( var_24 = 0; var_24 < 25; var_24++ ) + { + var_22 = var_24 * 11 + 135 + var_21 - var_11 + 4; + var0[var_23 + var_24].y = int( _ID18411( var_22 ) ); + var0[var_23 + var_24].alpha = 1; + + if ( var_22 <= var_16 ) + var0[var_23 + var_24].alpha = clamp( var_22 - var_15 / var_14, 0, 1 ); + + if ( var_22 >= var_18 ) + var0[var_23 + var_24].alpha = 1 - clamp( var_22 - var_18 / var_14, 0, 1 ); + } + } + + var_17 = var_17 + 0.05; + var_19 = var_19 + var_18; + + if ( var_17 >= var_21 ) + { + var_17 = 0; + var_25 = var_20; + var_20 = randomfloatrange( -0.1, 0.1 ); + var_18 = var_20 - var_25 * 0.05 / var_21; + } + + wait 0.05; + } +} + +_ID18428( var0, var1 ) +{ + var_2 = _ID98::_ID2442( "default", 1 ); + var_2.x = _ID18411( var0 ); + var_2.y = _ID18411( var1 ); + var_2.alignx = "left"; + var_2.sort = 1; + var_2.horzalign = "fullscreen"; + var_2.vertalign = "fullscreen"; + var_2.alpha = 1; + var_2.color = ( 1, 1, 1 ); + var_2 setvalue( 0 ); + return var_2; +} + +_ID18429() +{ + var_0[0] = _ID18428( 525, 100 ); + var_0[1] = _ID18428( 525, 120 ); + var_0[2] = _ID18428( 525, 140 ); + var_0[3] = _ID18428( 525, 160 ); + var_1 = 4; + var_2 = 5; + var_3 = 1; + + for ( var_4 = 0; var_4 < 25; var_4++ ) + { + var_0[var_1 + var_4] = newclienthudelem( self ); + var_0[var_1 + var_4].x = _ID18411( 505 ); + var_0[var_1 + var_4].y = _ID18411( var_4 * 11 + 135 ); + var_0[var_1 + var_4].alignx = "left"; + var_0[var_1 + var_4].sort = 1; + var_0[var_1 + var_4].horzalign = "fullscreen"; + var_0[var_1 + var_4].vertalign = "fullscreen"; + var_0[var_1 + var_4].alpha = 1; + var_3 = var_3 - 1; + + if ( var_3 == 0 ) + { + var_0[var_1 + var_4] setshader( "uav_predator2_horz_bar1", 8, 4 ); + var_3 = var_2; + continue; + } + + var_0[var_1 + var_4] setshader( "uav_predator2_horz_bar1", 6, 4 ); + } + + thread _ID18427( var_0 ); + return var_0; +} + +_ID18430( var0, var1 ) +{ + self endon( "uav_cleanup_hud" ); + self endon( "death" ); + var_2 = _ID1555::_ID15403(); + var_3 = 0; + var_4 = 360; + + while ( isdefined( var0 ) ) + { + var_2 = _ID1555::_ID15403(); + + if ( isdefined( var_2 ) ) + { + var_5 = var_2.angles[1]; + var_5 = animscripts/utility::_ID3336( var_5, 360 ); + var_6 = var_5 - var_3 / var_4 - var_3; + + if ( var_6 < 0 ) + var_6 = 0; + + if ( var_6 > 1 ) + var_6 = 1; + + var_7 = var0._ID18431 + var_6 * var0._ID18432 - var0._ID18431; + var0.x = _ID18411( var_7 ); + var1 setvalue( var_5 ); + } + + wait 0.05; + } +} + +_ID18433() +{ + var_0[0] = newclienthudelem( self ); + var_0[0].x = _ID18411( 304 ); + var_0[0].y = _ID18411( 8 ); + var_0[0].sort = 1; + var_0[0].horzalign = "fullscreen"; + var_0[0].vertalign = "fullscreen"; + var_0[0].alpha = 1; + var_0[0] setshader( "uav_predator2_dir", 24, 16 ); + var_0[0]._ID18431 = 188; + var_0[0]._ID18432 = 428; + var_0[1] = newclienthudelem( self ); + var_0[1].x = _ID18411( 320 ); + var_0[1].y = _ID18411( 36 ); + var_0[1].alignx = "center"; + var_0[1].aligny = "middle"; + var_0[1].sort = 1; + var_0[1].horzalign = "fullscreen"; + var_0[1].vertalign = "fullscreen"; + var_0[1].alpha = 1; + var_0[1] setshader( "uav_predator2_dirbar", 256, 32 ); + var_0[2] = newclienthudelem( self ); + var_0[2].x = _ID18411( 320 ); + var_0[2].y = _ID18411( 55 ); + var_0[2].alignx = "center"; + var_0[2].aligny = "middle"; + var_0[2].sort = 1; + var_0[2].horzalign = "fullscreen"; + var_0[2].vertalign = "fullscreen"; + var_0[2].alpha = 1; + var_0[2] setshader( "uav_predator2_heading_frame", 21, 32 ); + var_0[3] = _ID98::_ID2442( "default", 1.2 ); + var_0[3].x = _ID18411( 320 ); + var_0[3].y = _ID18411( 55 ); + var_0[3].sort = 1; + var_0[3].horzalign = "fullscreen"; + var_0[3].vertalign = "fullscreen"; + var_0[3].alignx = "center"; + var_0[3].aligny = "middle"; + var_0[3].alpha = 1; + var_0[3].color = ( 0.56, 1, 0.52 ); + var_0[3] setvalue( 215 ); + thread _ID18430( var_0[0], var_0[3] ); + return var_0; +} + +_ID18434() +{ + var_0 = newclienthudelem( self ); + var_0.x = _ID18411( 272 ); + var_0.y = _ID18411( 292 ); + var_0.sort = 1; + var_0.horzalign = "fullscreen"; + var_0.vertalign = "fullscreen"; + var_0.alpha = 1; + var_0 setshader( "uav_predator2_horz", 64, 64 ); + return var_0; +} + +_ID18435() +{ + var_0 = newclienthudelem( self ); + var_0.x = _ID18411( 320 ); + var_0.y = _ID18411( 240 ); + var_0.alignx = "center"; + var_0.aligny = "middle"; + var_0.sort = 1; + var_0.horzalign = "fullscreen"; + var_0.vertalign = "fullscreen"; + var_0.alpha = 1; + var_0 setshader( "uav_predator2_xhair", 205, 205 ); + return var_0; +} + +_ID18436( var0 ) +{ + while ( isdefined( var0 ) ) + { + if ( self adsbuttonpressed() ) + var0 thread _ID18437( self ); + + wait 0.05; + } +} + +_ID18437( var0 ) +{ + var0 dodamage( 1, var0.origin ); + var_1 = spawn( "script_origin", ( 0, 0, 0 ) ); + var_1.origin = self.origin; + var_1.angles = self.angles; + self delete(); + + for ( var_2 = 0; var_2 < 6; var_2++ ) + { + wait(randomfloatrange( 0.1, 0.3 )); + var_3 = anglestoforward( var_1.angles ); + var_4 = anglestoright( var_1.angles ); + var_5 = anglestoup( var_1.angles ); + var_6 = randomintrange( -64, 64 ); + var_7 = randomintrange( -64, 64 ); + var_8 = randomintrange( -64, -63 ); + var_9 = magicgrenade( "m203", var_1.origin, var_1.origin + var_6 * var_3 + var_7 * var_4 + var_8 * var_5 ); + var_9 thread _ID18438(); + } + + var_1 delete(); +} + +_ID18438() +{ + var_0 = spawn( "script_origin", ( 0, 0, 0 ) ); + + while ( isdefined( self ) ) + { + var_0.origin = self.origin; + wait 0.05; + } + + playfx( level._effect["slamraam_explosion"], var_0.origin ); + radiusdamage( var_0.origin + ( 0, 0, 128 ), 512, 200, 200 ); + earthquake( 0.4, 1, var_0.origin, 1000 ); + var_0 playsound( "detpack_explo_main", "sound_done" ); + var_0 delete(); +} diff --git a/data/IW5/_unamed/1644.gscbin b/data/IW5/_unamed/1644.gscbin new file mode 100644 index 00000000..ad4f4769 Binary files /dev/null and b/data/IW5/_unamed/1644.gscbin differ diff --git a/data/IW5/_unamed/1646.gsc b/data/IW5/_unamed/1646.gsc new file mode 100644 index 00000000..b56cf6f2 --- /dev/null +++ b/data/IW5/_unamed/1646.gsc @@ -0,0 +1,235 @@ +// IW5 PC GSC +// Decompiled by https://github.com/xensik/gsc-tool +#using_animtree("vehicles"); +#using_animtree("generic_human"); + +main( var0, var1, var2, var3, var4 ) +{ + _ID95::_ID10946( "blackhawk_minigun", var0, var1, var2 ); + _ID95::_ID10962( ::_ID11037 ); + _ID95::_ID10945( %bh_rotors, undefined, 0 ); + + if ( !isdefined( var3 ) ) + { + var_5 = []; + var_5["vehicle_blackhawk_minigun_low"] = "explosions/helicopter_explosion"; + var_5["vehicle_blackhawk_minigun_hero"] = "explosions/helicopter_explosion"; + var_5["vehicle_blackhawk_minigun_player"] = "explosions/helicopter_explosion"; + var_5["vehicle_blackhawk_minigun_player_so_ac130"] = "explosions/helicopter_explosion"; + var_5["vehicle_ny_blackhawk"] = "explosions/helicopter_explosion"; + _ID95::_ID10754( "explosions/helicopter_explosion_secondary_small", "tag_engine_left", "blackhawk_helicopter_hit", undefined, undefined, undefined, 0.2, 1 ); + _ID95::_ID10754( "explosions/helicopter_explosion_secondary_small", "elevator_jnt", "blackhawk_helicopter_secondary_exp", undefined, undefined, undefined, 0.5, 1 ); + _ID95::_ID10754( "fire/fire_smoke_trail_L", "elevator_jnt", "blackhawk_helicopter_dying_loop", 1, 0.05, 1, 0.5, 1 ); + _ID95::_ID10754( "explosions/helicopter_explosion_secondary_small", "tag_engine_right", "blackhawk_helicopter_secondary_exp", undefined, undefined, undefined, 2.5, 1 ); + _ID95::_ID10754( "explosions/helicopter_explosion_secondary_small", "tag_deathfx", "blackhawk_helicopter_secondary_exp", undefined, undefined, undefined, 4 ); + _ID95::_ID10754( var_5[var0], undefined, "blackhawk_helicopter_crash", undefined, undefined, undefined, -1, undefined, "stop_crash_loop_sound" ); + _ID95::_ID10756( "explosions/aerial_explosion_heli_large", "tag_deathfx", "blackhawk_helicopter_crash", undefined, undefined, undefined, undefined, 1, undefined, 0 ); + } + + _ID95::_ID10949(); + _ID95::_ID10958( 999, 500, 1500 ); + _ID95::_ID10950( "allies" ); + _ID95::_ID10954( ::_ID15005, ::_ID15004 ); + _ID95::_ID10956( ::_ID16004 ); + _ID95::_ID10957( ::_ID15960 ); + var_6 = randomfloatrange( 0, 1 ); + _ID95::_ID10925( var1, "cockpit_blue_cargo01", "tag_light_cargo01", "misc/aircraft_light_cockpit_red", "interior", 0 ); + _ID95::_ID10925( var1, "cockpit_blue_cockpit01", "tag_light_cockpit01", "misc/aircraft_light_cockpit_blue", "interior", 0 ); + _ID95::_ID10925( var1, "white_blink", "tag_light_belly", "misc/aircraft_light_white_blink", "running", var_6 ); + _ID95::_ID10925( var1, "white_blink_tail", "tag_light_tail", "misc/aircraft_light_white_blink", "running", var_6 ); + _ID95::_ID10925( var1, "wingtip_green", "tag_light_L_wing", "misc/aircraft_light_wingtip_green", "running", var_6 ); + _ID95::_ID10925( var1, "wingtip_red", "tag_light_R_wing", "misc/aircraft_light_wingtip_red", "running", var_6 ); + + if ( isdefined( var_5 ) ) + _ID95::_ID10826( var_5, "tag_doorgun", "weapon_blackhawk_minigun", undefined, undefined, 0.2, 20, -14 ); +} + +_ID11037() +{ + if ( _ID65::_ID7717() ) + { + self._ID10590 = distance( self gettagorigin( "tag_origin" ), self gettagorigin( "tag_ground" ) ); + self._ID10586 = 762; + } + else + self._ID10586 = 762 + distance( self gettagorigin( "tag_origin" ), self gettagorigin( "tag_ground" ) ); + + self._ID10561 = 0; +} + +_ID15004( var0 ) +{ + for ( var_1 = 0; var_1 < var0.size; var_1++ ) + var0[var_1]._ID9507 = %bh_idle; + + return var0; +} + +_ID15005() +{ + var_0 = []; + + for ( var_1 = 0; var_1 < 8; var_1++ ) + var_0[var_1] = spawnstruct(); + + var_0[0]._ID3929 = %bh_pilot_idle; + var_0[1]._ID3929 = %bh_copilot_idle; + var_0[2]._ID3929 = %bh_1_idle; + var_0[3]._ID3929 = %bh_2_idle; + var_0[4]._ID3929 = %bh_4_idle; + var_0[5]._ID3929 = %bh_5_idle; + var_0[6]._ID3929 = %bh_8_idle; + var_0[7]._ID3929 = %bh_6_idle; + var_0[0]._ID9458 = "tag_detach"; + var_0[1]._ID9458 = "tag_detach"; + var_0[2]._ID9458 = "tag_detach"; + var_0[3]._ID9458 = "tag_detach"; + var_0[4]._ID9458 = "tag_detach"; + var_0[5]._ID9458 = "tag_detach"; + var_0[6]._ID9458 = "tag_detach"; + var_0[7]._ID9458 = "tag_detach"; + var_0[2]._ID9596 = %bh_1_drop; + var_0[3]._ID9596 = %bh_2_drop; + var_0[4]._ID9596 = %bh_4_drop; + var_0[5]._ID9596 = %bh_5_drop; + var_0[6]._ID9596 = %bh_8_drop; + var_0[7]._ID9596 = %bh_6_drop; + var_0[2]._ID9626 = "crouch"; + var_0[3]._ID9626 = "crouch"; + var_0[4]._ID9626 = "crouch"; + var_0[5]._ID9626 = "crouch"; + var_0[6]._ID9626 = "crouch"; + var_0[7]._ID9626 = "crouch"; + var_0[2]._ID9585 = 1; + var_0[3]._ID9585 = 1; + var_0[4]._ID9585 = 1; + var_0[5]._ID9585 = 1; + var_0[6]._ID9585 = 1; + var_0[7]._ID9585 = 1; + var_0[2]._ID9618 = %fastrope_fall; + var_0[3]._ID9618 = %fastrope_fall; + var_0[4]._ID9618 = %fastrope_fall; + var_0[5]._ID9618 = %fastrope_fall; + var_0[6]._ID9618 = %fastrope_fall; + var_0[7]._ID9618 = %fastrope_fall; + var_0[1]._ID9616 = 1; + var_0[2]._ID9616 = 1; + var_0[3]._ID9616 = 1; + var_0[4]._ID9616 = 1; + var_0[5]._ID9616 = 1; + var_0[6]._ID9616 = 1; + var_0[7]._ID9616 = 1; + var_0[2]._ID9613 = "fastrope_loop_npc"; + var_0[3]._ID9613 = "fastrope_loop_npc"; + var_0[4]._ID9613 = "fastrope_loop_npc"; + var_0[5]._ID9613 = "fastrope_loop_npc"; + var_0[6]._ID9613 = "fastrope_loop_npc"; + var_0[7]._ID9613 = "fastrope_loop_npc"; + var_0[2]._ID9578 = "TAG_FastRope_RI"; + var_0[3]._ID9578 = "TAG_FastRope_RI"; + var_0[4]._ID9578 = "TAG_FastRope_LE"; + var_0[5]._ID9578 = "TAG_FastRope_LE"; + var_0[6]._ID9578 = "TAG_FastRope_RI"; + var_0[7]._ID9578 = "TAG_FastRope_LE"; + return var_0; +} + +_ID15960() +{ + var_0 = []; + var_0["left"] = []; + var_0["right"] = []; + var_0["both"] = []; + var_0["left"][var_0["left"].size] = 4; + var_0["left"][var_0["left"].size] = 5; + var_0["left"][var_0["left"].size] = 7; + var_0["right"][var_0["right"].size] = 2; + var_0["right"][var_0["right"].size] = 3; + var_0["right"][var_0["right"].size] = 6; + var_0["both"][var_0["both"].size] = 2; + var_0["both"][var_0["both"].size] = 3; + var_0["both"][var_0["both"].size] = 4; + var_0["both"][var_0["both"].size] = 5; + var_0["both"][var_0["both"].size] = 6; + var_0["both"][var_0["both"].size] = 7; + var_0["default"] = var_0["both"]; + return var_0; +} + +_ID16004() +{ + var_0 = []; + var_0["TAG_FastRope_LE"] = spawnstruct(); + var_0["TAG_FastRope_LE"].model = "rope_test"; + var_0["TAG_FastRope_LE"].tag = "TAG_FastRope_LE"; + var_0["TAG_FastRope_LE"]._ID8216 = %bh_rope_idle_le; + var_0["TAG_FastRope_LE"]._ID9591 = %bh_rope_drop_le; + var_0["TAG_FastRope_RI"] = spawnstruct(); + var_0["TAG_FastRope_RI"].model = "rope_test_ri"; + var_0["TAG_FastRope_RI"].tag = "TAG_FastRope_RI"; + var_0["TAG_FastRope_RI"]._ID8216 = %bh_rope_idle_ri; + var_0["TAG_FastRope_RI"]._ID9591 = %bh_rope_drop_ri; + var_1 = getarraykeys( var_0 ); + + for ( var_2 = 0; var_2 < var_1.size; var_2++ ) + precachemodel( var_0[var_1[var_2]].model ); + + return var_0; +} + +_ID17819( var0, var1, var2 ) +{ + if ( !isdefined( var1 ) ) + var1 = level.player; + + self._ID17746 = var1; + + if ( !isdefined( var2 ) ) + var2 = 1; + + thread _ID17813( var2 ); + var1 allowprone( 0 ); + var1 allowcrouch( 0 ); + + if ( !isdefined( var0 ) ) + { + var1 disableweapons(); + _ID65::_ID9994( var1, "tag_player", 1, 1, 30, 30, 30, 30 ); + } + + self useby( var1 ); + var_3 = self gettagangles( "tag_player" ); + var1 setplayerangles( var_3 + ( 0, 0, 0 ) ); + common_scripts\utility::flag_set( "player_on_minigun" ); + thread _ID1597::_ID17742(); +} + +_ID18564() +{ + self useby( self._ID17746 ); + self._ID17746 unlink(); + level notify( "player_off_blackhawk_gun" ); +} + +_ID17813( var0 ) +{ + wait 0.05; + + if ( var0 ) + { + setsaveddvar( "ui_hidemap", 1 ); + setsaveddvar( "hud_showStance", "0" ); + setsaveddvar( "compass", "0" ); + setdvar( "old_compass", "0" ); + setsaveddvar( "ammoCounterHide", "1" ); + } + else + { + setsaveddvar( "ui_hidemap", 0 ); + setsaveddvar( "hud_drawhud", "1" ); + setsaveddvar( "hud_showStance", "1" ); + setsaveddvar( "compass", "1" ); + setdvar( "old_compass", "1" ); + setsaveddvar( "ammoCounterHide", "0" ); + } +} diff --git a/data/IW5/_unamed/1646.gscbin b/data/IW5/_unamed/1646.gscbin new file mode 100644 index 00000000..7ef843d3 Binary files /dev/null and b/data/IW5/_unamed/1646.gscbin differ diff --git a/data/IW5/_unamed/1721.gscbin b/data/IW5/_unamed/1721.gscbin new file mode 100644 index 00000000..f228ee48 Binary files /dev/null and b/data/IW5/_unamed/1721.gscbin differ diff --git a/data/IW5/_unamed/18052.gscbin b/data/IW5/_unamed/18052.gscbin new file mode 100644 index 00000000..840074d5 Binary files /dev/null and b/data/IW5/_unamed/18052.gscbin differ diff --git a/data/IW5/_unamed/18053.gscbin b/data/IW5/_unamed/18053.gscbin new file mode 100644 index 00000000..d9904b66 Binary files /dev/null and b/data/IW5/_unamed/18053.gscbin differ diff --git a/data/IW5/_unamed/18380.gscbin b/data/IW5/_unamed/18380.gscbin new file mode 100644 index 00000000..045d0a1e Binary files /dev/null and b/data/IW5/_unamed/18380.gscbin differ diff --git a/data/IW5/_unamed/18649.gscbin b/data/IW5/_unamed/18649.gscbin new file mode 100644 index 00000000..77ca86aa Binary files /dev/null and b/data/IW5/_unamed/18649.gscbin differ diff --git a/data/IW5/_unamed/18650.gscbin b/data/IW5/_unamed/18650.gscbin new file mode 100644 index 00000000..d271d9ba Binary files /dev/null and b/data/IW5/_unamed/18650.gscbin differ diff --git a/data/IW5/_unamed/18661.gscbin b/data/IW5/_unamed/18661.gscbin new file mode 100644 index 00000000..2fe43ee6 Binary files /dev/null and b/data/IW5/_unamed/18661.gscbin differ diff --git a/data/IW5/_unamed/18666.gscbin b/data/IW5/_unamed/18666.gscbin new file mode 100644 index 00000000..d6a85fec Binary files /dev/null and b/data/IW5/_unamed/18666.gscbin differ diff --git a/data/IW5/_unamed/18672.gscbin b/data/IW5/_unamed/18672.gscbin new file mode 100644 index 00000000..b46a705e Binary files /dev/null and b/data/IW5/_unamed/18672.gscbin differ diff --git a/data/IW5/_unamed/18673.gscbin b/data/IW5/_unamed/18673.gscbin new file mode 100644 index 00000000..c3dfc1a4 Binary files /dev/null and b/data/IW5/_unamed/18673.gscbin differ diff --git a/data/IW5/_unamed/18697.gscbin b/data/IW5/_unamed/18697.gscbin new file mode 100644 index 00000000..e713f129 Binary files /dev/null and b/data/IW5/_unamed/18697.gscbin differ diff --git a/data/IW5/_unamed/18717.gscbin b/data/IW5/_unamed/18717.gscbin new file mode 100644 index 00000000..0afeb8a9 Binary files /dev/null and b/data/IW5/_unamed/18717.gscbin differ diff --git a/data/IW5/_unamed/18718.gscbin b/data/IW5/_unamed/18718.gscbin new file mode 100644 index 00000000..8d6cf62f Binary files /dev/null and b/data/IW5/_unamed/18718.gscbin differ diff --git a/data/IW5/_unamed/18736.gscbin b/data/IW5/_unamed/18736.gscbin new file mode 100644 index 00000000..f72cbf58 Binary files /dev/null and b/data/IW5/_unamed/18736.gscbin differ diff --git a/data/IW5/_unamed/18746.gscbin b/data/IW5/_unamed/18746.gscbin new file mode 100644 index 00000000..c0e91f98 Binary files /dev/null and b/data/IW5/_unamed/18746.gscbin differ diff --git a/data/IW5/_unamed/18766.gscbin b/data/IW5/_unamed/18766.gscbin new file mode 100644 index 00000000..cdbf1569 Binary files /dev/null and b/data/IW5/_unamed/18766.gscbin differ diff --git a/data/IW5/_unamed/18774.gscbin b/data/IW5/_unamed/18774.gscbin new file mode 100644 index 00000000..40585e6e Binary files /dev/null and b/data/IW5/_unamed/18774.gscbin differ diff --git a/data/IW5/_unamed/18775.gscbin b/data/IW5/_unamed/18775.gscbin new file mode 100644 index 00000000..eba34927 Binary files /dev/null and b/data/IW5/_unamed/18775.gscbin differ diff --git a/data/IW5/_unamed/18793.gscbin b/data/IW5/_unamed/18793.gscbin new file mode 100644 index 00000000..274d11c5 Binary files /dev/null and b/data/IW5/_unamed/18793.gscbin differ diff --git a/data/IW5/_unamed/18997.gscbin b/data/IW5/_unamed/18997.gscbin new file mode 100644 index 00000000..0dcae097 Binary files /dev/null and b/data/IW5/_unamed/18997.gscbin differ diff --git a/data/IW5/_unamed/18999.gscbin b/data/IW5/_unamed/18999.gscbin new file mode 100644 index 00000000..30bc2b18 Binary files /dev/null and b/data/IW5/_unamed/18999.gscbin differ diff --git a/data/IW5/_unamed/19019.gscbin b/data/IW5/_unamed/19019.gscbin new file mode 100644 index 00000000..9a2d27ee Binary files /dev/null and b/data/IW5/_unamed/19019.gscbin differ diff --git a/data/IW5/_unamed/19832.gscbin b/data/IW5/_unamed/19832.gscbin new file mode 100644 index 00000000..d25eb8a6 Binary files /dev/null and b/data/IW5/_unamed/19832.gscbin differ diff --git a/data/IW5/_unamed/20129.gscbin b/data/IW5/_unamed/20129.gscbin new file mode 100644 index 00000000..27d2adcd Binary files /dev/null and b/data/IW5/_unamed/20129.gscbin differ diff --git a/data/IW5/_unamed/20132.gscbin b/data/IW5/_unamed/20132.gscbin new file mode 100644 index 00000000..e4d154e9 Binary files /dev/null and b/data/IW5/_unamed/20132.gscbin differ diff --git a/data/IW5/_unamed/20133.gscbin b/data/IW5/_unamed/20133.gscbin new file mode 100644 index 00000000..09e1df7a Binary files /dev/null and b/data/IW5/_unamed/20133.gscbin differ diff --git a/data/IW5/_unamed/20177.gscbin b/data/IW5/_unamed/20177.gscbin new file mode 100644 index 00000000..1eaebd71 Binary files /dev/null and b/data/IW5/_unamed/20177.gscbin differ diff --git a/data/IW5/_unamed/20259.gscbin b/data/IW5/_unamed/20259.gscbin new file mode 100644 index 00000000..20aea4d1 Binary files /dev/null and b/data/IW5/_unamed/20259.gscbin differ diff --git a/data/IW5/_unamed/20498.gscbin b/data/IW5/_unamed/20498.gscbin new file mode 100644 index 00000000..f3d93bac Binary files /dev/null and b/data/IW5/_unamed/20498.gscbin differ diff --git a/data/IW5/_unamed/20499.gscbin b/data/IW5/_unamed/20499.gscbin new file mode 100644 index 00000000..e39ae89f Binary files /dev/null and b/data/IW5/_unamed/20499.gscbin differ diff --git a/data/IW5/_unamed/20500.gscbin b/data/IW5/_unamed/20500.gscbin new file mode 100644 index 00000000..7a603e1f Binary files /dev/null and b/data/IW5/_unamed/20500.gscbin differ diff --git a/data/IW5/_unamed/20502.gscbin b/data/IW5/_unamed/20502.gscbin new file mode 100644 index 00000000..d3251edc Binary files /dev/null and b/data/IW5/_unamed/20502.gscbin differ diff --git a/data/IW5/_unamed/20503.gscbin b/data/IW5/_unamed/20503.gscbin new file mode 100644 index 00000000..a41e356b Binary files /dev/null and b/data/IW5/_unamed/20503.gscbin differ diff --git a/data/IW5/_unamed/20504.gscbin b/data/IW5/_unamed/20504.gscbin new file mode 100644 index 00000000..f1c1708a Binary files /dev/null and b/data/IW5/_unamed/20504.gscbin differ diff --git a/data/IW5/_unamed/20737.gscbin b/data/IW5/_unamed/20737.gscbin new file mode 100644 index 00000000..55058630 Binary files /dev/null and b/data/IW5/_unamed/20737.gscbin differ diff --git a/data/IW5/_unamed/20806.gscbin b/data/IW5/_unamed/20806.gscbin new file mode 100644 index 00000000..525bce7e Binary files /dev/null and b/data/IW5/_unamed/20806.gscbin differ diff --git a/data/IW5/_unamed/20839.gscbin b/data/IW5/_unamed/20839.gscbin new file mode 100644 index 00000000..5abceff3 Binary files /dev/null and b/data/IW5/_unamed/20839.gscbin differ diff --git a/data/IW5/_unamed/20840.gscbin b/data/IW5/_unamed/20840.gscbin new file mode 100644 index 00000000..216773d0 Binary files /dev/null and b/data/IW5/_unamed/20840.gscbin differ diff --git a/data/IW5/_unamed/20841.gscbin b/data/IW5/_unamed/20841.gscbin new file mode 100644 index 00000000..d112dc7c Binary files /dev/null and b/data/IW5/_unamed/20841.gscbin differ diff --git a/data/IW5/_unamed/21066.gscbin b/data/IW5/_unamed/21066.gscbin new file mode 100644 index 00000000..5b1e500b Binary files /dev/null and b/data/IW5/_unamed/21066.gscbin differ diff --git a/data/IW5/_unamed/21269.gscbin b/data/IW5/_unamed/21269.gscbin new file mode 100644 index 00000000..ad57fa08 Binary files /dev/null and b/data/IW5/_unamed/21269.gscbin differ diff --git a/data/IW5/_unamed/21505.gscbin b/data/IW5/_unamed/21505.gscbin new file mode 100644 index 00000000..911287c1 Binary files /dev/null and b/data/IW5/_unamed/21505.gscbin differ diff --git a/data/IW5/_unamed/21531.gscbin b/data/IW5/_unamed/21531.gscbin new file mode 100644 index 00000000..2bf79b01 Binary files /dev/null and b/data/IW5/_unamed/21531.gscbin differ diff --git a/data/IW5/_unamed/21532.gscbin b/data/IW5/_unamed/21532.gscbin new file mode 100644 index 00000000..3f7a7ba9 Binary files /dev/null and b/data/IW5/_unamed/21532.gscbin differ diff --git a/data/IW5/_unamed/21533.gscbin b/data/IW5/_unamed/21533.gscbin new file mode 100644 index 00000000..a79fb865 Binary files /dev/null and b/data/IW5/_unamed/21533.gscbin differ diff --git a/data/IW5/_unamed/21589.gscbin b/data/IW5/_unamed/21589.gscbin new file mode 100644 index 00000000..caafaf3f Binary files /dev/null and b/data/IW5/_unamed/21589.gscbin differ diff --git a/data/IW5/_unamed/21674.gscbin b/data/IW5/_unamed/21674.gscbin new file mode 100644 index 00000000..71f28861 Binary files /dev/null and b/data/IW5/_unamed/21674.gscbin differ diff --git a/data/IW5/_unamed/21680.gscbin b/data/IW5/_unamed/21680.gscbin new file mode 100644 index 00000000..9e0f7ff7 Binary files /dev/null and b/data/IW5/_unamed/21680.gscbin differ diff --git a/data/IW5/_unamed/21683.gscbin b/data/IW5/_unamed/21683.gscbin new file mode 100644 index 00000000..bf42f977 Binary files /dev/null and b/data/IW5/_unamed/21683.gscbin differ diff --git a/data/IW5/_unamed/21720.gscbin b/data/IW5/_unamed/21720.gscbin new file mode 100644 index 00000000..5e3b827b Binary files /dev/null and b/data/IW5/_unamed/21720.gscbin differ diff --git a/data/IW5/_unamed/21725.gscbin b/data/IW5/_unamed/21725.gscbin new file mode 100644 index 00000000..ca3bff0e Binary files /dev/null and b/data/IW5/_unamed/21725.gscbin differ diff --git a/data/IW5/_unamed/21945.gscbin b/data/IW5/_unamed/21945.gscbin new file mode 100644 index 00000000..a5015876 Binary files /dev/null and b/data/IW5/_unamed/21945.gscbin differ diff --git a/data/IW5/_unamed/21946.gscbin b/data/IW5/_unamed/21946.gscbin new file mode 100644 index 00000000..c32a07ae Binary files /dev/null and b/data/IW5/_unamed/21946.gscbin differ diff --git a/data/IW5/_unamed/21947.gscbin b/data/IW5/_unamed/21947.gscbin new file mode 100644 index 00000000..8cbb162b Binary files /dev/null and b/data/IW5/_unamed/21947.gscbin differ diff --git a/data/IW5/_unamed/22217.gscbin b/data/IW5/_unamed/22217.gscbin new file mode 100644 index 00000000..385dcd18 Binary files /dev/null and b/data/IW5/_unamed/22217.gscbin differ diff --git a/data/IW5/_unamed/22218.gscbin b/data/IW5/_unamed/22218.gscbin new file mode 100644 index 00000000..826373c3 Binary files /dev/null and b/data/IW5/_unamed/22218.gscbin differ diff --git a/data/IW5/_unamed/22219.gscbin b/data/IW5/_unamed/22219.gscbin new file mode 100644 index 00000000..56c2d05f Binary files /dev/null and b/data/IW5/_unamed/22219.gscbin differ diff --git a/data/IW5/_unamed/22220.gscbin b/data/IW5/_unamed/22220.gscbin new file mode 100644 index 00000000..7277d3ad Binary files /dev/null and b/data/IW5/_unamed/22220.gscbin differ diff --git a/data/IW5/_unamed/22221.gscbin b/data/IW5/_unamed/22221.gscbin new file mode 100644 index 00000000..24a7e7c4 Binary files /dev/null and b/data/IW5/_unamed/22221.gscbin differ diff --git a/data/IW5/_unamed/22222.gscbin b/data/IW5/_unamed/22222.gscbin new file mode 100644 index 00000000..b44c9f0c Binary files /dev/null and b/data/IW5/_unamed/22222.gscbin differ diff --git a/data/IW5/_unamed/22224.gscbin b/data/IW5/_unamed/22224.gscbin new file mode 100644 index 00000000..676e40d6 Binary files /dev/null and b/data/IW5/_unamed/22224.gscbin differ diff --git a/data/IW5/_unamed/22232.gscbin b/data/IW5/_unamed/22232.gscbin new file mode 100644 index 00000000..2a855578 Binary files /dev/null and b/data/IW5/_unamed/22232.gscbin differ diff --git a/data/IW5/_unamed/22621.gscbin b/data/IW5/_unamed/22621.gscbin new file mode 100644 index 00000000..b993b9af Binary files /dev/null and b/data/IW5/_unamed/22621.gscbin differ diff --git a/data/IW5/_unamed/22622.gscbin b/data/IW5/_unamed/22622.gscbin new file mode 100644 index 00000000..7e034b18 Binary files /dev/null and b/data/IW5/_unamed/22622.gscbin differ diff --git a/data/IW5/_unamed/22672.gscbin b/data/IW5/_unamed/22672.gscbin new file mode 100644 index 00000000..5967a0cc Binary files /dev/null and b/data/IW5/_unamed/22672.gscbin differ diff --git a/data/IW5/_unamed/22673.gscbin b/data/IW5/_unamed/22673.gscbin new file mode 100644 index 00000000..cf63a73f Binary files /dev/null and b/data/IW5/_unamed/22673.gscbin differ diff --git a/data/IW5/_unamed/22674.gscbin b/data/IW5/_unamed/22674.gscbin new file mode 100644 index 00000000..bf09a7da Binary files /dev/null and b/data/IW5/_unamed/22674.gscbin differ diff --git a/data/IW5/_unamed/22675.gscbin b/data/IW5/_unamed/22675.gscbin new file mode 100644 index 00000000..fd4b42d6 Binary files /dev/null and b/data/IW5/_unamed/22675.gscbin differ diff --git a/data/IW5/_unamed/22676.gscbin b/data/IW5/_unamed/22676.gscbin new file mode 100644 index 00000000..3d7275d7 Binary files /dev/null and b/data/IW5/_unamed/22676.gscbin differ diff --git a/data/IW5/_unamed/22677.gscbin b/data/IW5/_unamed/22677.gscbin new file mode 100644 index 00000000..7e78a5b7 Binary files /dev/null and b/data/IW5/_unamed/22677.gscbin differ diff --git a/data/IW5/_unamed/22684.gscbin b/data/IW5/_unamed/22684.gscbin new file mode 100644 index 00000000..6b5439e4 Binary files /dev/null and b/data/IW5/_unamed/22684.gscbin differ diff --git a/data/IW5/_unamed/22685.gscbin b/data/IW5/_unamed/22685.gscbin new file mode 100644 index 00000000..cdd65a7d Binary files /dev/null and b/data/IW5/_unamed/22685.gscbin differ diff --git a/data/IW5/_unamed/23133.gscbin b/data/IW5/_unamed/23133.gscbin new file mode 100644 index 00000000..dfe6ee0f Binary files /dev/null and b/data/IW5/_unamed/23133.gscbin differ diff --git a/data/IW5/_unamed/23445.gscbin b/data/IW5/_unamed/23445.gscbin new file mode 100644 index 00000000..f28ac113 Binary files /dev/null and b/data/IW5/_unamed/23445.gscbin differ diff --git a/data/IW5/_unamed/23446.gscbin b/data/IW5/_unamed/23446.gscbin new file mode 100644 index 00000000..41604a7a Binary files /dev/null and b/data/IW5/_unamed/23446.gscbin differ diff --git a/data/IW5/_unamed/23447.gscbin b/data/IW5/_unamed/23447.gscbin new file mode 100644 index 00000000..fef2493c Binary files /dev/null and b/data/IW5/_unamed/23447.gscbin differ diff --git a/data/IW5/_unamed/23448.gscbin b/data/IW5/_unamed/23448.gscbin new file mode 100644 index 00000000..a5e32dfa Binary files /dev/null and b/data/IW5/_unamed/23448.gscbin differ diff --git a/data/IW5/_unamed/23449.gscbin b/data/IW5/_unamed/23449.gscbin new file mode 100644 index 00000000..3db7be2f Binary files /dev/null and b/data/IW5/_unamed/23449.gscbin differ diff --git a/data/IW5/_unamed/23450.gscbin b/data/IW5/_unamed/23450.gscbin new file mode 100644 index 00000000..1cc2d388 Binary files /dev/null and b/data/IW5/_unamed/23450.gscbin differ diff --git a/data/IW5/_unamed/23451.gscbin b/data/IW5/_unamed/23451.gscbin new file mode 100644 index 00000000..d171eee1 Binary files /dev/null and b/data/IW5/_unamed/23451.gscbin differ diff --git a/data/IW5/_unamed/23452.gscbin b/data/IW5/_unamed/23452.gscbin new file mode 100644 index 00000000..58892766 Binary files /dev/null and b/data/IW5/_unamed/23452.gscbin differ diff --git a/data/IW5/_unamed/23453.gscbin b/data/IW5/_unamed/23453.gscbin new file mode 100644 index 00000000..30a02002 Binary files /dev/null and b/data/IW5/_unamed/23453.gscbin differ diff --git a/data/IW5/_unamed/23454.gscbin b/data/IW5/_unamed/23454.gscbin new file mode 100644 index 00000000..7b21b09e Binary files /dev/null and b/data/IW5/_unamed/23454.gscbin differ diff --git a/data/IW5/_unamed/23455.gscbin b/data/IW5/_unamed/23455.gscbin new file mode 100644 index 00000000..4a573859 Binary files /dev/null and b/data/IW5/_unamed/23455.gscbin differ diff --git a/data/IW5/_unamed/23456.gscbin b/data/IW5/_unamed/23456.gscbin new file mode 100644 index 00000000..1e934b1d Binary files /dev/null and b/data/IW5/_unamed/23456.gscbin differ diff --git a/data/IW5/_unamed/23457.gscbin b/data/IW5/_unamed/23457.gscbin new file mode 100644 index 00000000..5b40d92c Binary files /dev/null and b/data/IW5/_unamed/23457.gscbin differ diff --git a/data/IW5/_unamed/23472.gscbin b/data/IW5/_unamed/23472.gscbin new file mode 100644 index 00000000..f1a6b77d Binary files /dev/null and b/data/IW5/_unamed/23472.gscbin differ diff --git a/data/IW5/_unamed/23558.gscbin b/data/IW5/_unamed/23558.gscbin new file mode 100644 index 00000000..db54d4fb Binary files /dev/null and b/data/IW5/_unamed/23558.gscbin differ diff --git a/data/IW5/_unamed/23559.gscbin b/data/IW5/_unamed/23559.gscbin new file mode 100644 index 00000000..fed48b28 Binary files /dev/null and b/data/IW5/_unamed/23559.gscbin differ diff --git a/data/IW5/_unamed/23560.gscbin b/data/IW5/_unamed/23560.gscbin new file mode 100644 index 00000000..6f51884b Binary files /dev/null and b/data/IW5/_unamed/23560.gscbin differ diff --git a/data/IW5/_unamed/23561.gscbin b/data/IW5/_unamed/23561.gscbin new file mode 100644 index 00000000..37159299 Binary files /dev/null and b/data/IW5/_unamed/23561.gscbin differ diff --git a/data/IW5/_unamed/23562.gscbin b/data/IW5/_unamed/23562.gscbin new file mode 100644 index 00000000..ebddd9f1 Binary files /dev/null and b/data/IW5/_unamed/23562.gscbin differ diff --git a/data/IW5/_unamed/23563.gscbin b/data/IW5/_unamed/23563.gscbin new file mode 100644 index 00000000..f0e0793c Binary files /dev/null and b/data/IW5/_unamed/23563.gscbin differ diff --git a/data/IW5/_unamed/23807.gscbin b/data/IW5/_unamed/23807.gscbin new file mode 100644 index 00000000..aa26d6dc Binary files /dev/null and b/data/IW5/_unamed/23807.gscbin differ diff --git a/data/IW5/_unamed/24216.gscbin b/data/IW5/_unamed/24216.gscbin new file mode 100644 index 00000000..eaa0be5c Binary files /dev/null and b/data/IW5/_unamed/24216.gscbin differ diff --git a/data/IW5/_unamed/24478.gscbin b/data/IW5/_unamed/24478.gscbin new file mode 100644 index 00000000..491815a0 Binary files /dev/null and b/data/IW5/_unamed/24478.gscbin differ diff --git a/data/IW5/_unamed/24481.gscbin b/data/IW5/_unamed/24481.gscbin new file mode 100644 index 00000000..80bb7982 Binary files /dev/null and b/data/IW5/_unamed/24481.gscbin differ diff --git a/data/IW5/_unamed/24482.gscbin b/data/IW5/_unamed/24482.gscbin new file mode 100644 index 00000000..d19940a4 Binary files /dev/null and b/data/IW5/_unamed/24482.gscbin differ diff --git a/data/IW5/_unamed/24483.gscbin b/data/IW5/_unamed/24483.gscbin new file mode 100644 index 00000000..ec4ae571 Binary files /dev/null and b/data/IW5/_unamed/24483.gscbin differ diff --git a/data/IW5/_unamed/24484.gscbin b/data/IW5/_unamed/24484.gscbin new file mode 100644 index 00000000..b3f46dbb Binary files /dev/null and b/data/IW5/_unamed/24484.gscbin differ diff --git a/data/IW5/_unamed/24485.gscbin b/data/IW5/_unamed/24485.gscbin new file mode 100644 index 00000000..9a542a66 Binary files /dev/null and b/data/IW5/_unamed/24485.gscbin differ diff --git a/data/IW5/_unamed/24486.gscbin b/data/IW5/_unamed/24486.gscbin new file mode 100644 index 00000000..39b22cf7 Binary files /dev/null and b/data/IW5/_unamed/24486.gscbin differ diff --git a/data/IW5/_unamed/24487.gscbin b/data/IW5/_unamed/24487.gscbin new file mode 100644 index 00000000..a217f6dc Binary files /dev/null and b/data/IW5/_unamed/24487.gscbin differ diff --git a/data/IW5/_unamed/24534.gscbin b/data/IW5/_unamed/24534.gscbin new file mode 100644 index 00000000..74c89bbf Binary files /dev/null and b/data/IW5/_unamed/24534.gscbin differ diff --git a/data/IW5/_unamed/24535.gscbin b/data/IW5/_unamed/24535.gscbin new file mode 100644 index 00000000..627bf9cf Binary files /dev/null and b/data/IW5/_unamed/24535.gscbin differ diff --git a/data/IW5/_unamed/24536.gscbin b/data/IW5/_unamed/24536.gscbin new file mode 100644 index 00000000..e98570e9 Binary files /dev/null and b/data/IW5/_unamed/24536.gscbin differ diff --git a/data/IW5/_unamed/24537.gscbin b/data/IW5/_unamed/24537.gscbin new file mode 100644 index 00000000..dda76e09 Binary files /dev/null and b/data/IW5/_unamed/24537.gscbin differ diff --git a/data/IW5/_unamed/24538.gscbin b/data/IW5/_unamed/24538.gscbin new file mode 100644 index 00000000..f8f41849 Binary files /dev/null and b/data/IW5/_unamed/24538.gscbin differ diff --git a/data/IW5/_unamed/24539.gscbin b/data/IW5/_unamed/24539.gscbin new file mode 100644 index 00000000..f664df37 Binary files /dev/null and b/data/IW5/_unamed/24539.gscbin differ diff --git a/data/IW5/_unamed/24789.gscbin b/data/IW5/_unamed/24789.gscbin new file mode 100644 index 00000000..04649eb7 Binary files /dev/null and b/data/IW5/_unamed/24789.gscbin differ diff --git a/data/IW5/_unamed/24791.gscbin b/data/IW5/_unamed/24791.gscbin new file mode 100644 index 00000000..88a8e9dc Binary files /dev/null and b/data/IW5/_unamed/24791.gscbin differ diff --git a/data/IW5/_unamed/24792.gscbin b/data/IW5/_unamed/24792.gscbin new file mode 100644 index 00000000..ca93f18e Binary files /dev/null and b/data/IW5/_unamed/24792.gscbin differ diff --git a/data/IW5/_unamed/24793.gscbin b/data/IW5/_unamed/24793.gscbin new file mode 100644 index 00000000..9e9c19c9 Binary files /dev/null and b/data/IW5/_unamed/24793.gscbin differ diff --git a/data/IW5/_unamed/24794.gscbin b/data/IW5/_unamed/24794.gscbin new file mode 100644 index 00000000..bce88311 Binary files /dev/null and b/data/IW5/_unamed/24794.gscbin differ diff --git a/data/IW5/_unamed/24795.gscbin b/data/IW5/_unamed/24795.gscbin new file mode 100644 index 00000000..b9a0c01b Binary files /dev/null and b/data/IW5/_unamed/24795.gscbin differ diff --git a/data/IW5/_unamed/24796.gscbin b/data/IW5/_unamed/24796.gscbin new file mode 100644 index 00000000..03c7d24a Binary files /dev/null and b/data/IW5/_unamed/24796.gscbin differ diff --git a/data/IW5/_unamed/24797.gscbin b/data/IW5/_unamed/24797.gscbin new file mode 100644 index 00000000..5adbf6d1 Binary files /dev/null and b/data/IW5/_unamed/24797.gscbin differ diff --git a/data/IW5/_unamed/24798.gscbin b/data/IW5/_unamed/24798.gscbin new file mode 100644 index 00000000..37038dd4 Binary files /dev/null and b/data/IW5/_unamed/24798.gscbin differ diff --git a/data/IW5/_unamed/24799.gscbin b/data/IW5/_unamed/24799.gscbin new file mode 100644 index 00000000..3c147360 Binary files /dev/null and b/data/IW5/_unamed/24799.gscbin differ diff --git a/data/IW5/_unamed/24800.gscbin b/data/IW5/_unamed/24800.gscbin new file mode 100644 index 00000000..5d3d5e8f Binary files /dev/null and b/data/IW5/_unamed/24800.gscbin differ diff --git a/data/IW5/_unamed/24801.gscbin b/data/IW5/_unamed/24801.gscbin new file mode 100644 index 00000000..504787d4 Binary files /dev/null and b/data/IW5/_unamed/24801.gscbin differ diff --git a/data/IW5/_unamed/24802.gscbin b/data/IW5/_unamed/24802.gscbin new file mode 100644 index 00000000..406cbfbe Binary files /dev/null and b/data/IW5/_unamed/24802.gscbin differ diff --git a/data/IW5/_unamed/24803.gscbin b/data/IW5/_unamed/24803.gscbin new file mode 100644 index 00000000..6e199a5d Binary files /dev/null and b/data/IW5/_unamed/24803.gscbin differ diff --git a/data/IW5/_unamed/24951.gscbin b/data/IW5/_unamed/24951.gscbin new file mode 100644 index 00000000..d5937106 Binary files /dev/null and b/data/IW5/_unamed/24951.gscbin differ diff --git a/data/IW5/_unamed/25064.gscbin b/data/IW5/_unamed/25064.gscbin new file mode 100644 index 00000000..e9d5b152 Binary files /dev/null and b/data/IW5/_unamed/25064.gscbin differ diff --git a/data/IW5/_unamed/25458.gscbin b/data/IW5/_unamed/25458.gscbin new file mode 100644 index 00000000..e0d795cd Binary files /dev/null and b/data/IW5/_unamed/25458.gscbin differ diff --git a/data/IW5/_unamed/25580.gscbin b/data/IW5/_unamed/25580.gscbin new file mode 100644 index 00000000..dc7b1336 Binary files /dev/null and b/data/IW5/_unamed/25580.gscbin differ diff --git a/data/IW5/_unamed/25716.gscbin b/data/IW5/_unamed/25716.gscbin new file mode 100644 index 00000000..f1df4111 Binary files /dev/null and b/data/IW5/_unamed/25716.gscbin differ diff --git a/data/IW5/_unamed/25726.gscbin b/data/IW5/_unamed/25726.gscbin new file mode 100644 index 00000000..89c63dab Binary files /dev/null and b/data/IW5/_unamed/25726.gscbin differ diff --git a/data/IW5/_unamed/25727.gscbin b/data/IW5/_unamed/25727.gscbin new file mode 100644 index 00000000..54b59745 Binary files /dev/null and b/data/IW5/_unamed/25727.gscbin differ diff --git a/data/IW5/_unamed/25728.gscbin b/data/IW5/_unamed/25728.gscbin new file mode 100644 index 00000000..fc37b81c Binary files /dev/null and b/data/IW5/_unamed/25728.gscbin differ diff --git a/data/IW5/_unamed/25729.gscbin b/data/IW5/_unamed/25729.gscbin new file mode 100644 index 00000000..7884f1df Binary files /dev/null and b/data/IW5/_unamed/25729.gscbin differ diff --git a/data/IW5/_unamed/25730.gscbin b/data/IW5/_unamed/25730.gscbin new file mode 100644 index 00000000..55c1d71b Binary files /dev/null and b/data/IW5/_unamed/25730.gscbin differ diff --git a/data/IW5/_unamed/25731.gscbin b/data/IW5/_unamed/25731.gscbin new file mode 100644 index 00000000..6aee4829 Binary files /dev/null and b/data/IW5/_unamed/25731.gscbin differ diff --git a/data/IW5/_unamed/25732.gscbin b/data/IW5/_unamed/25732.gscbin new file mode 100644 index 00000000..4de44946 Binary files /dev/null and b/data/IW5/_unamed/25732.gscbin differ diff --git a/data/IW5/_unamed/25894.gscbin b/data/IW5/_unamed/25894.gscbin new file mode 100644 index 00000000..ff6676fa Binary files /dev/null and b/data/IW5/_unamed/25894.gscbin differ diff --git a/data/IW5/_unamed/26691.gscbin b/data/IW5/_unamed/26691.gscbin new file mode 100644 index 00000000..2adb422e Binary files /dev/null and b/data/IW5/_unamed/26691.gscbin differ diff --git a/data/IW5/_unamed/26722.gscbin b/data/IW5/_unamed/26722.gscbin new file mode 100644 index 00000000..45df0f7f Binary files /dev/null and b/data/IW5/_unamed/26722.gscbin differ diff --git a/data/IW5/_unamed/26723.gscbin b/data/IW5/_unamed/26723.gscbin new file mode 100644 index 00000000..d1fa9b32 Binary files /dev/null and b/data/IW5/_unamed/26723.gscbin differ diff --git a/data/IW5/_unamed/26724.gscbin b/data/IW5/_unamed/26724.gscbin new file mode 100644 index 00000000..08c4f3eb Binary files /dev/null and b/data/IW5/_unamed/26724.gscbin differ diff --git a/data/IW5/_unamed/26725.gscbin b/data/IW5/_unamed/26725.gscbin new file mode 100644 index 00000000..64283798 Binary files /dev/null and b/data/IW5/_unamed/26725.gscbin differ diff --git a/data/IW5/_unamed/26726.gscbin b/data/IW5/_unamed/26726.gscbin new file mode 100644 index 00000000..8f36a193 Binary files /dev/null and b/data/IW5/_unamed/26726.gscbin differ diff --git a/data/IW5/_unamed/26727.gscbin b/data/IW5/_unamed/26727.gscbin new file mode 100644 index 00000000..70735352 Binary files /dev/null and b/data/IW5/_unamed/26727.gscbin differ diff --git a/data/IW5/_unamed/26728.gscbin b/data/IW5/_unamed/26728.gscbin new file mode 100644 index 00000000..98d3a01f Binary files /dev/null and b/data/IW5/_unamed/26728.gscbin differ diff --git a/data/IW5/_unamed/26800.gscbin b/data/IW5/_unamed/26800.gscbin new file mode 100644 index 00000000..e524ab14 Binary files /dev/null and b/data/IW5/_unamed/26800.gscbin differ diff --git a/data/IW5/_unamed/26851.gscbin b/data/IW5/_unamed/26851.gscbin new file mode 100644 index 00000000..310e7b13 Binary files /dev/null and b/data/IW5/_unamed/26851.gscbin differ diff --git a/data/IW5/_unamed/26886.gscbin b/data/IW5/_unamed/26886.gscbin new file mode 100644 index 00000000..4fccb4a7 Binary files /dev/null and b/data/IW5/_unamed/26886.gscbin differ diff --git a/data/IW5/_unamed/28218.gscbin b/data/IW5/_unamed/28218.gscbin new file mode 100644 index 00000000..14931712 Binary files /dev/null and b/data/IW5/_unamed/28218.gscbin differ diff --git a/data/IW5/_unamed/28262.gscbin b/data/IW5/_unamed/28262.gscbin new file mode 100644 index 00000000..235d561d Binary files /dev/null and b/data/IW5/_unamed/28262.gscbin differ diff --git a/data/IW5/_unamed/28366.gscbin b/data/IW5/_unamed/28366.gscbin new file mode 100644 index 00000000..f16674cb Binary files /dev/null and b/data/IW5/_unamed/28366.gscbin differ diff --git a/data/IW5/_unamed/28801.gscbin b/data/IW5/_unamed/28801.gscbin new file mode 100644 index 00000000..8580c6e5 Binary files /dev/null and b/data/IW5/_unamed/28801.gscbin differ diff --git a/data/IW5/_unamed/29027.gscbin b/data/IW5/_unamed/29027.gscbin new file mode 100644 index 00000000..90ccef3c Binary files /dev/null and b/data/IW5/_unamed/29027.gscbin differ diff --git a/data/IW5/_unamed/29068.gscbin b/data/IW5/_unamed/29068.gscbin new file mode 100644 index 00000000..d22a601a Binary files /dev/null and b/data/IW5/_unamed/29068.gscbin differ diff --git a/data/IW5/_unamed/29069.gscbin b/data/IW5/_unamed/29069.gscbin new file mode 100644 index 00000000..de97e4b5 Binary files /dev/null and b/data/IW5/_unamed/29069.gscbin differ diff --git a/data/IW5/_unamed/29647.gscbin b/data/IW5/_unamed/29647.gscbin new file mode 100644 index 00000000..1381169c Binary files /dev/null and b/data/IW5/_unamed/29647.gscbin differ diff --git a/data/IW5/_unamed/29780.gscbin b/data/IW5/_unamed/29780.gscbin new file mode 100644 index 00000000..24b66cec Binary files /dev/null and b/data/IW5/_unamed/29780.gscbin differ diff --git a/data/IW5/_unamed/30268.gscbin b/data/IW5/_unamed/30268.gscbin new file mode 100644 index 00000000..a38c35f4 Binary files /dev/null and b/data/IW5/_unamed/30268.gscbin differ diff --git a/data/IW5/_unamed/30313.gscbin b/data/IW5/_unamed/30313.gscbin new file mode 100644 index 00000000..ff9ba194 Binary files /dev/null and b/data/IW5/_unamed/30313.gscbin differ diff --git a/data/IW5/_unamed/30478.gscbin b/data/IW5/_unamed/30478.gscbin new file mode 100644 index 00000000..6f7bbb83 Binary files /dev/null and b/data/IW5/_unamed/30478.gscbin differ diff --git a/data/IW5/_unamed/30484.gscbin b/data/IW5/_unamed/30484.gscbin new file mode 100644 index 00000000..f40d5083 Binary files /dev/null and b/data/IW5/_unamed/30484.gscbin differ diff --git a/data/IW5/_unamed/30755.gscbin b/data/IW5/_unamed/30755.gscbin new file mode 100644 index 00000000..bbe21fbf Binary files /dev/null and b/data/IW5/_unamed/30755.gscbin differ diff --git a/data/IW5/_unamed/30756.gscbin b/data/IW5/_unamed/30756.gscbin new file mode 100644 index 00000000..6af4234a Binary files /dev/null and b/data/IW5/_unamed/30756.gscbin differ diff --git a/data/IW5/_unamed/30758.gscbin b/data/IW5/_unamed/30758.gscbin new file mode 100644 index 00000000..b61db30d Binary files /dev/null and b/data/IW5/_unamed/30758.gscbin differ diff --git a/data/IW5/_unamed/30893.gscbin b/data/IW5/_unamed/30893.gscbin new file mode 100644 index 00000000..8fb71705 Binary files /dev/null and b/data/IW5/_unamed/30893.gscbin differ diff --git a/data/IW5/_unamed/30999.gscbin b/data/IW5/_unamed/30999.gscbin new file mode 100644 index 00000000..67a7dcbe Binary files /dev/null and b/data/IW5/_unamed/30999.gscbin differ diff --git a/data/IW5/_unamed/31029.gscbin b/data/IW5/_unamed/31029.gscbin new file mode 100644 index 00000000..e71eec79 Binary files /dev/null and b/data/IW5/_unamed/31029.gscbin differ diff --git a/data/IW5/_unamed/31030.gscbin b/data/IW5/_unamed/31030.gscbin new file mode 100644 index 00000000..4b0fdc9e Binary files /dev/null and b/data/IW5/_unamed/31030.gscbin differ diff --git a/data/IW5/_unamed/31031.gscbin b/data/IW5/_unamed/31031.gscbin new file mode 100644 index 00000000..24b296ac Binary files /dev/null and b/data/IW5/_unamed/31031.gscbin differ diff --git a/data/IW5/_unamed/31032.gscbin b/data/IW5/_unamed/31032.gscbin new file mode 100644 index 00000000..2c5c3dfa Binary files /dev/null and b/data/IW5/_unamed/31032.gscbin differ diff --git a/data/IW5/_unamed/31033.gscbin b/data/IW5/_unamed/31033.gscbin new file mode 100644 index 00000000..c825cb25 Binary files /dev/null and b/data/IW5/_unamed/31033.gscbin differ diff --git a/data/IW5/_unamed/31034.gscbin b/data/IW5/_unamed/31034.gscbin new file mode 100644 index 00000000..aabd76f9 Binary files /dev/null and b/data/IW5/_unamed/31034.gscbin differ diff --git a/data/IW5/_unamed/31035.gscbin b/data/IW5/_unamed/31035.gscbin new file mode 100644 index 00000000..56376bbb Binary files /dev/null and b/data/IW5/_unamed/31035.gscbin differ diff --git a/data/IW5/_unamed/31036.gscbin b/data/IW5/_unamed/31036.gscbin new file mode 100644 index 00000000..a11c4734 Binary files /dev/null and b/data/IW5/_unamed/31036.gscbin differ diff --git a/data/IW5/_unamed/31037.gscbin b/data/IW5/_unamed/31037.gscbin new file mode 100644 index 00000000..842c80c3 Binary files /dev/null and b/data/IW5/_unamed/31037.gscbin differ diff --git a/data/IW5/_unamed/31038.gscbin b/data/IW5/_unamed/31038.gscbin new file mode 100644 index 00000000..362ed33a Binary files /dev/null and b/data/IW5/_unamed/31038.gscbin differ diff --git a/data/IW5/_unamed/31039.gscbin b/data/IW5/_unamed/31039.gscbin new file mode 100644 index 00000000..a8daf6ec Binary files /dev/null and b/data/IW5/_unamed/31039.gscbin differ diff --git a/data/IW5/_unamed/31040.gscbin b/data/IW5/_unamed/31040.gscbin new file mode 100644 index 00000000..0d22839b Binary files /dev/null and b/data/IW5/_unamed/31040.gscbin differ diff --git a/data/IW5/_unamed/31041.gscbin b/data/IW5/_unamed/31041.gscbin new file mode 100644 index 00000000..134de461 Binary files /dev/null and b/data/IW5/_unamed/31041.gscbin differ diff --git a/data/IW5/_unamed/31042.gscbin b/data/IW5/_unamed/31042.gscbin new file mode 100644 index 00000000..cb1eacde Binary files /dev/null and b/data/IW5/_unamed/31042.gscbin differ diff --git a/data/IW5/_unamed/31043.gscbin b/data/IW5/_unamed/31043.gscbin new file mode 100644 index 00000000..4b52cb8c Binary files /dev/null and b/data/IW5/_unamed/31043.gscbin differ diff --git a/data/IW5/_unamed/31044.gscbin b/data/IW5/_unamed/31044.gscbin new file mode 100644 index 00000000..fde818ff Binary files /dev/null and b/data/IW5/_unamed/31044.gscbin differ diff --git a/data/IW5/_unamed/31045.gscbin b/data/IW5/_unamed/31045.gscbin new file mode 100644 index 00000000..1a2b8a3c Binary files /dev/null and b/data/IW5/_unamed/31045.gscbin differ diff --git a/data/IW5/_unamed/31046.gscbin b/data/IW5/_unamed/31046.gscbin new file mode 100644 index 00000000..baa45660 Binary files /dev/null and b/data/IW5/_unamed/31046.gscbin differ diff --git a/data/IW5/_unamed/31047.gscbin b/data/IW5/_unamed/31047.gscbin new file mode 100644 index 00000000..943b20b3 Binary files /dev/null and b/data/IW5/_unamed/31047.gscbin differ diff --git a/data/IW5/_unamed/31048.gscbin b/data/IW5/_unamed/31048.gscbin new file mode 100644 index 00000000..d6677ca0 Binary files /dev/null and b/data/IW5/_unamed/31048.gscbin differ diff --git a/data/IW5/_unamed/31278.gscbin b/data/IW5/_unamed/31278.gscbin new file mode 100644 index 00000000..584dd453 Binary files /dev/null and b/data/IW5/_unamed/31278.gscbin differ diff --git a/data/IW5/_unamed/31279.gscbin b/data/IW5/_unamed/31279.gscbin new file mode 100644 index 00000000..f9fa98c2 Binary files /dev/null and b/data/IW5/_unamed/31279.gscbin differ diff --git a/data/IW5/_unamed/31280.gscbin b/data/IW5/_unamed/31280.gscbin new file mode 100644 index 00000000..2f89e931 Binary files /dev/null and b/data/IW5/_unamed/31280.gscbin differ diff --git a/data/IW5/_unamed/31281.gscbin b/data/IW5/_unamed/31281.gscbin new file mode 100644 index 00000000..0ba96403 Binary files /dev/null and b/data/IW5/_unamed/31281.gscbin differ diff --git a/data/IW5/_unamed/31282.gscbin b/data/IW5/_unamed/31282.gscbin new file mode 100644 index 00000000..8079717f Binary files /dev/null and b/data/IW5/_unamed/31282.gscbin differ diff --git a/data/IW5/_unamed/31283.gscbin b/data/IW5/_unamed/31283.gscbin new file mode 100644 index 00000000..218dda13 Binary files /dev/null and b/data/IW5/_unamed/31283.gscbin differ diff --git a/data/IW5/_unamed/31284.gscbin b/data/IW5/_unamed/31284.gscbin new file mode 100644 index 00000000..22cf8129 Binary files /dev/null and b/data/IW5/_unamed/31284.gscbin differ diff --git a/data/IW5/_unamed/31351.gscbin b/data/IW5/_unamed/31351.gscbin new file mode 100644 index 00000000..291e984e Binary files /dev/null and b/data/IW5/_unamed/31351.gscbin differ diff --git a/data/IW5/_unamed/31352.gscbin b/data/IW5/_unamed/31352.gscbin new file mode 100644 index 00000000..f91dc876 Binary files /dev/null and b/data/IW5/_unamed/31352.gscbin differ diff --git a/data/IW5/_unamed/31353.gscbin b/data/IW5/_unamed/31353.gscbin new file mode 100644 index 00000000..19d26f65 Binary files /dev/null and b/data/IW5/_unamed/31353.gscbin differ diff --git a/data/IW5/_unamed/31354.gscbin b/data/IW5/_unamed/31354.gscbin new file mode 100644 index 00000000..5eee8368 Binary files /dev/null and b/data/IW5/_unamed/31354.gscbin differ diff --git a/data/IW5/_unamed/31355.gscbin b/data/IW5/_unamed/31355.gscbin new file mode 100644 index 00000000..35c8e668 Binary files /dev/null and b/data/IW5/_unamed/31355.gscbin differ diff --git a/data/IW5/_unamed/31356.gscbin b/data/IW5/_unamed/31356.gscbin new file mode 100644 index 00000000..ff165960 Binary files /dev/null and b/data/IW5/_unamed/31356.gscbin differ diff --git a/data/IW5/_unamed/31357.gscbin b/data/IW5/_unamed/31357.gscbin new file mode 100644 index 00000000..e6caa063 Binary files /dev/null and b/data/IW5/_unamed/31357.gscbin differ diff --git a/data/IW5/_unamed/31358.gscbin b/data/IW5/_unamed/31358.gscbin new file mode 100644 index 00000000..c6627247 Binary files /dev/null and b/data/IW5/_unamed/31358.gscbin differ diff --git a/data/IW5/_unamed/31359.gscbin b/data/IW5/_unamed/31359.gscbin new file mode 100644 index 00000000..56544919 Binary files /dev/null and b/data/IW5/_unamed/31359.gscbin differ diff --git a/data/IW5/_unamed/31360.gscbin b/data/IW5/_unamed/31360.gscbin new file mode 100644 index 00000000..80269efe Binary files /dev/null and b/data/IW5/_unamed/31360.gscbin differ diff --git a/data/IW5/_unamed/31361.gscbin b/data/IW5/_unamed/31361.gscbin new file mode 100644 index 00000000..2aeb9764 Binary files /dev/null and b/data/IW5/_unamed/31361.gscbin differ diff --git a/data/IW5/_unamed/31362.gscbin b/data/IW5/_unamed/31362.gscbin new file mode 100644 index 00000000..e0c5a8ae Binary files /dev/null and b/data/IW5/_unamed/31362.gscbin differ diff --git a/data/IW5/_unamed/31363.gscbin b/data/IW5/_unamed/31363.gscbin new file mode 100644 index 00000000..bc5df70c Binary files /dev/null and b/data/IW5/_unamed/31363.gscbin differ diff --git a/data/IW5/_unamed/31364.gscbin b/data/IW5/_unamed/31364.gscbin new file mode 100644 index 00000000..d89c9ddb Binary files /dev/null and b/data/IW5/_unamed/31364.gscbin differ diff --git a/data/IW5/_unamed/31365.gscbin b/data/IW5/_unamed/31365.gscbin new file mode 100644 index 00000000..c557c121 Binary files /dev/null and b/data/IW5/_unamed/31365.gscbin differ diff --git a/data/IW5/_unamed/31366.gscbin b/data/IW5/_unamed/31366.gscbin new file mode 100644 index 00000000..606d4383 Binary files /dev/null and b/data/IW5/_unamed/31366.gscbin differ diff --git a/data/IW5/_unamed/31367.gscbin b/data/IW5/_unamed/31367.gscbin new file mode 100644 index 00000000..c0412fd8 Binary files /dev/null and b/data/IW5/_unamed/31367.gscbin differ diff --git a/data/IW5/_unamed/31368.gscbin b/data/IW5/_unamed/31368.gscbin new file mode 100644 index 00000000..a1f10863 Binary files /dev/null and b/data/IW5/_unamed/31368.gscbin differ diff --git a/data/IW5/_unamed/31369.gscbin b/data/IW5/_unamed/31369.gscbin new file mode 100644 index 00000000..b0bcba35 Binary files /dev/null and b/data/IW5/_unamed/31369.gscbin differ diff --git a/data/IW5/_unamed/31370.gscbin b/data/IW5/_unamed/31370.gscbin new file mode 100644 index 00000000..5d6f568d Binary files /dev/null and b/data/IW5/_unamed/31370.gscbin differ diff --git a/data/IW5/_unamed/31371.gscbin b/data/IW5/_unamed/31371.gscbin new file mode 100644 index 00000000..92f94775 Binary files /dev/null and b/data/IW5/_unamed/31371.gscbin differ diff --git a/data/IW5/_unamed/31372.gscbin b/data/IW5/_unamed/31372.gscbin new file mode 100644 index 00000000..c4d37a85 Binary files /dev/null and b/data/IW5/_unamed/31372.gscbin differ diff --git a/data/IW5/_unamed/31373.gscbin b/data/IW5/_unamed/31373.gscbin new file mode 100644 index 00000000..6b396b5f Binary files /dev/null and b/data/IW5/_unamed/31373.gscbin differ diff --git a/data/IW5/_unamed/31374.gscbin b/data/IW5/_unamed/31374.gscbin new file mode 100644 index 00000000..eaeecb51 Binary files /dev/null and b/data/IW5/_unamed/31374.gscbin differ diff --git a/data/IW5/_unamed/31375.gscbin b/data/IW5/_unamed/31375.gscbin new file mode 100644 index 00000000..7e901e30 Binary files /dev/null and b/data/IW5/_unamed/31375.gscbin differ diff --git a/data/IW5/_unamed/31376.gscbin b/data/IW5/_unamed/31376.gscbin new file mode 100644 index 00000000..1c101bb4 Binary files /dev/null and b/data/IW5/_unamed/31376.gscbin differ diff --git a/data/IW5/_unamed/31377.gscbin b/data/IW5/_unamed/31377.gscbin new file mode 100644 index 00000000..335683df Binary files /dev/null and b/data/IW5/_unamed/31377.gscbin differ diff --git a/data/IW5/_unamed/31378.gscbin b/data/IW5/_unamed/31378.gscbin new file mode 100644 index 00000000..a63b8851 Binary files /dev/null and b/data/IW5/_unamed/31378.gscbin differ diff --git a/data/IW5/_unamed/31379.gscbin b/data/IW5/_unamed/31379.gscbin new file mode 100644 index 00000000..67656363 Binary files /dev/null and b/data/IW5/_unamed/31379.gscbin differ diff --git a/data/IW5/_unamed/31380.gscbin b/data/IW5/_unamed/31380.gscbin new file mode 100644 index 00000000..db1c287d Binary files /dev/null and b/data/IW5/_unamed/31380.gscbin differ diff --git a/data/IW5/_unamed/31381.gscbin b/data/IW5/_unamed/31381.gscbin new file mode 100644 index 00000000..c3d4c00e Binary files /dev/null and b/data/IW5/_unamed/31381.gscbin differ diff --git a/data/IW5/_unamed/31382.gscbin b/data/IW5/_unamed/31382.gscbin new file mode 100644 index 00000000..551b214a Binary files /dev/null and b/data/IW5/_unamed/31382.gscbin differ diff --git a/data/IW5/_unamed/31383.gscbin b/data/IW5/_unamed/31383.gscbin new file mode 100644 index 00000000..f5e1bdcc Binary files /dev/null and b/data/IW5/_unamed/31383.gscbin differ diff --git a/data/IW5/_unamed/31384.gscbin b/data/IW5/_unamed/31384.gscbin new file mode 100644 index 00000000..94b620ae Binary files /dev/null and b/data/IW5/_unamed/31384.gscbin differ diff --git a/data/IW5/_unamed/31385.gscbin b/data/IW5/_unamed/31385.gscbin new file mode 100644 index 00000000..ded68de5 Binary files /dev/null and b/data/IW5/_unamed/31385.gscbin differ diff --git a/data/IW5/_unamed/31386.gscbin b/data/IW5/_unamed/31386.gscbin new file mode 100644 index 00000000..93dee104 Binary files /dev/null and b/data/IW5/_unamed/31386.gscbin differ diff --git a/data/IW5/_unamed/31387.gscbin b/data/IW5/_unamed/31387.gscbin new file mode 100644 index 00000000..88dab54b Binary files /dev/null and b/data/IW5/_unamed/31387.gscbin differ diff --git a/data/IW5/_unamed/31388.gscbin b/data/IW5/_unamed/31388.gscbin new file mode 100644 index 00000000..d1e5bb56 Binary files /dev/null and b/data/IW5/_unamed/31388.gscbin differ diff --git a/data/IW5/_unamed/31389.gscbin b/data/IW5/_unamed/31389.gscbin new file mode 100644 index 00000000..9f2d7a34 Binary files /dev/null and b/data/IW5/_unamed/31389.gscbin differ diff --git a/data/IW5/_unamed/31390.gscbin b/data/IW5/_unamed/31390.gscbin new file mode 100644 index 00000000..4f0211ad Binary files /dev/null and b/data/IW5/_unamed/31390.gscbin differ diff --git a/data/IW5/_unamed/31391.gscbin b/data/IW5/_unamed/31391.gscbin new file mode 100644 index 00000000..a9078e07 Binary files /dev/null and b/data/IW5/_unamed/31391.gscbin differ diff --git a/data/IW5/_unamed/31392.gscbin b/data/IW5/_unamed/31392.gscbin new file mode 100644 index 00000000..9550a256 Binary files /dev/null and b/data/IW5/_unamed/31392.gscbin differ diff --git a/data/IW5/_unamed/31393.gscbin b/data/IW5/_unamed/31393.gscbin new file mode 100644 index 00000000..27582bcc Binary files /dev/null and b/data/IW5/_unamed/31393.gscbin differ diff --git a/data/IW5/_unamed/31394.gscbin b/data/IW5/_unamed/31394.gscbin new file mode 100644 index 00000000..9e8b5fd0 Binary files /dev/null and b/data/IW5/_unamed/31394.gscbin differ diff --git a/data/IW5/_unamed/31395.gscbin b/data/IW5/_unamed/31395.gscbin new file mode 100644 index 00000000..3b4cd34c Binary files /dev/null and b/data/IW5/_unamed/31395.gscbin differ diff --git a/data/IW5/_unamed/32123.gscbin b/data/IW5/_unamed/32123.gscbin new file mode 100644 index 00000000..5074e496 Binary files /dev/null and b/data/IW5/_unamed/32123.gscbin differ diff --git a/data/IW5/_unamed/32124.gscbin b/data/IW5/_unamed/32124.gscbin new file mode 100644 index 00000000..0237f593 Binary files /dev/null and b/data/IW5/_unamed/32124.gscbin differ diff --git a/data/IW5/_unamed/32125.gscbin b/data/IW5/_unamed/32125.gscbin new file mode 100644 index 00000000..59141f0d Binary files /dev/null and b/data/IW5/_unamed/32125.gscbin differ diff --git a/data/IW5/_unamed/32126.gscbin b/data/IW5/_unamed/32126.gscbin new file mode 100644 index 00000000..4860a916 Binary files /dev/null and b/data/IW5/_unamed/32126.gscbin differ diff --git a/data/IW5/_unamed/32127.gscbin b/data/IW5/_unamed/32127.gscbin new file mode 100644 index 00000000..4bb456c0 Binary files /dev/null and b/data/IW5/_unamed/32127.gscbin differ diff --git a/data/IW5/_unamed/32128.gscbin b/data/IW5/_unamed/32128.gscbin new file mode 100644 index 00000000..1dfa4c84 Binary files /dev/null and b/data/IW5/_unamed/32128.gscbin differ diff --git a/data/IW5/_unamed/32129.gscbin b/data/IW5/_unamed/32129.gscbin new file mode 100644 index 00000000..24cb3fdd Binary files /dev/null and b/data/IW5/_unamed/32129.gscbin differ diff --git a/data/IW5/_unamed/32130.gscbin b/data/IW5/_unamed/32130.gscbin new file mode 100644 index 00000000..fbcd3b15 Binary files /dev/null and b/data/IW5/_unamed/32130.gscbin differ diff --git a/data/IW5/_unamed/32131.gscbin b/data/IW5/_unamed/32131.gscbin new file mode 100644 index 00000000..c82dd2dd Binary files /dev/null and b/data/IW5/_unamed/32131.gscbin differ diff --git a/data/IW5/_unamed/32132.gscbin b/data/IW5/_unamed/32132.gscbin new file mode 100644 index 00000000..02d9b010 Binary files /dev/null and b/data/IW5/_unamed/32132.gscbin differ diff --git a/data/IW5/_unamed/32133.gscbin b/data/IW5/_unamed/32133.gscbin new file mode 100644 index 00000000..aa24e2fd Binary files /dev/null and b/data/IW5/_unamed/32133.gscbin differ diff --git a/data/IW5/_unamed/32134.gscbin b/data/IW5/_unamed/32134.gscbin new file mode 100644 index 00000000..d1ab8708 Binary files /dev/null and b/data/IW5/_unamed/32134.gscbin differ diff --git a/data/IW5/_unamed/32135.gscbin b/data/IW5/_unamed/32135.gscbin new file mode 100644 index 00000000..708b0113 Binary files /dev/null and b/data/IW5/_unamed/32135.gscbin differ diff --git a/data/IW5/_unamed/32136.gscbin b/data/IW5/_unamed/32136.gscbin new file mode 100644 index 00000000..009b01e3 Binary files /dev/null and b/data/IW5/_unamed/32136.gscbin differ diff --git a/data/IW5/_unamed/32656.gscbin b/data/IW5/_unamed/32656.gscbin new file mode 100644 index 00000000..f0b80f97 Binary files /dev/null and b/data/IW5/_unamed/32656.gscbin differ diff --git a/data/IW5/_unamed/32854.gscbin b/data/IW5/_unamed/32854.gscbin new file mode 100644 index 00000000..2aa5f448 Binary files /dev/null and b/data/IW5/_unamed/32854.gscbin differ diff --git a/data/IW5/_unamed/32855.gscbin b/data/IW5/_unamed/32855.gscbin new file mode 100644 index 00000000..953c2000 Binary files /dev/null and b/data/IW5/_unamed/32855.gscbin differ diff --git a/data/IW5/_unamed/32856.gscbin b/data/IW5/_unamed/32856.gscbin new file mode 100644 index 00000000..08d9e4d1 Binary files /dev/null and b/data/IW5/_unamed/32856.gscbin differ diff --git a/data/IW5/_unamed/32857.gscbin b/data/IW5/_unamed/32857.gscbin new file mode 100644 index 00000000..1f010a78 Binary files /dev/null and b/data/IW5/_unamed/32857.gscbin differ diff --git a/data/IW5/_unamed/32859.gscbin b/data/IW5/_unamed/32859.gscbin new file mode 100644 index 00000000..c3c26346 Binary files /dev/null and b/data/IW5/_unamed/32859.gscbin differ diff --git a/data/IW5/_unamed/32860.gscbin b/data/IW5/_unamed/32860.gscbin new file mode 100644 index 00000000..a5cbcc20 Binary files /dev/null and b/data/IW5/_unamed/32860.gscbin differ diff --git a/data/IW5/_unamed/32861.gscbin b/data/IW5/_unamed/32861.gscbin new file mode 100644 index 00000000..13dfa0e2 Binary files /dev/null and b/data/IW5/_unamed/32861.gscbin differ diff --git a/data/IW5/_unamed/32862.gscbin b/data/IW5/_unamed/32862.gscbin new file mode 100644 index 00000000..17089021 Binary files /dev/null and b/data/IW5/_unamed/32862.gscbin differ diff --git a/data/IW5/_unamed/693.gscbin b/data/IW5/_unamed/693.gscbin new file mode 100644 index 00000000..e92a8ff8 Binary files /dev/null and b/data/IW5/_unamed/693.gscbin differ diff --git a/data/IW5/_unamed/694.gscbin b/data/IW5/_unamed/694.gscbin new file mode 100644 index 00000000..3866d903 Binary files /dev/null and b/data/IW5/_unamed/694.gscbin differ diff --git a/data/IW5/_unamed/704.gscbin b/data/IW5/_unamed/704.gscbin new file mode 100644 index 00000000..ebbbb4c6 Binary files /dev/null and b/data/IW5/_unamed/704.gscbin differ diff --git a/data/IW5/_unamed/705.gscbin b/data/IW5/_unamed/705.gscbin new file mode 100644 index 00000000..934afe0a Binary files /dev/null and b/data/IW5/_unamed/705.gscbin differ diff --git a/data/IW5/_unamed/708.gscbin b/data/IW5/_unamed/708.gscbin new file mode 100644 index 00000000..8fb1453d Binary files /dev/null and b/data/IW5/_unamed/708.gscbin differ diff --git a/data/IW5/_unamed/737.gscbin b/data/IW5/_unamed/737.gscbin new file mode 100644 index 00000000..0ae88df6 Binary files /dev/null and b/data/IW5/_unamed/737.gscbin differ diff --git a/data/IW5/_unamed/745.gscbin b/data/IW5/_unamed/745.gscbin new file mode 100644 index 00000000..eb506a61 Binary files /dev/null and b/data/IW5/_unamed/745.gscbin differ diff --git a/data/IW5/_unamed/757.gscbin b/data/IW5/_unamed/757.gscbin new file mode 100644 index 00000000..84c86382 Binary files /dev/null and b/data/IW5/_unamed/757.gscbin differ diff --git a/data/IW5/_unamed/758.gscbin b/data/IW5/_unamed/758.gscbin new file mode 100644 index 00000000..6ccfa0fe Binary files /dev/null and b/data/IW5/_unamed/758.gscbin differ diff --git a/data/IW5/_unamed/759.gscbin b/data/IW5/_unamed/759.gscbin new file mode 100644 index 00000000..50789425 Binary files /dev/null and b/data/IW5/_unamed/759.gscbin differ diff --git a/data/IW5/_unamed/760.gscbin b/data/IW5/_unamed/760.gscbin new file mode 100644 index 00000000..3e705d38 Binary files /dev/null and b/data/IW5/_unamed/760.gscbin differ diff --git a/data/IW5/_unamed/761.gscbin b/data/IW5/_unamed/761.gscbin new file mode 100644 index 00000000..9583c8af Binary files /dev/null and b/data/IW5/_unamed/761.gscbin differ diff --git a/data/IW5/_unamed/762.gscbin b/data/IW5/_unamed/762.gscbin new file mode 100644 index 00000000..dbd35d08 Binary files /dev/null and b/data/IW5/_unamed/762.gscbin differ diff --git a/data/IW5/_unamed/763.gscbin b/data/IW5/_unamed/763.gscbin new file mode 100644 index 00000000..a880e0a8 Binary files /dev/null and b/data/IW5/_unamed/763.gscbin differ diff --git a/data/IW5/_unamed/799.gscbin b/data/IW5/_unamed/799.gscbin new file mode 100644 index 00000000..d8f3212e Binary files /dev/null and b/data/IW5/_unamed/799.gscbin differ diff --git a/data/IW5/_unamed/800.gscbin b/data/IW5/_unamed/800.gscbin new file mode 100644 index 00000000..328dd5d6 Binary files /dev/null and b/data/IW5/_unamed/800.gscbin differ diff --git a/data/IW5/_unamed/802.gscbin b/data/IW5/_unamed/802.gscbin new file mode 100644 index 00000000..481a56c6 Binary files /dev/null and b/data/IW5/_unamed/802.gscbin differ diff --git a/data/IW5/_unamed/803.gscbin b/data/IW5/_unamed/803.gscbin new file mode 100644 index 00000000..8ffdd6c8 Binary files /dev/null and b/data/IW5/_unamed/803.gscbin differ diff --git a/data/IW5/_unamed/805.gscbin b/data/IW5/_unamed/805.gscbin new file mode 100644 index 00000000..e570026f Binary files /dev/null and b/data/IW5/_unamed/805.gscbin differ diff --git a/data/IW5/_unamed/807.gscbin b/data/IW5/_unamed/807.gscbin new file mode 100644 index 00000000..7f312043 Binary files /dev/null and b/data/IW5/_unamed/807.gscbin differ diff --git a/data/IW5/_unamed/8217.gscbin b/data/IW5/_unamed/8217.gscbin new file mode 100644 index 00000000..a677778d Binary files /dev/null and b/data/IW5/_unamed/8217.gscbin differ diff --git a/data/IW5/_unamed/8218.gscbin b/data/IW5/_unamed/8218.gscbin new file mode 100644 index 00000000..802a44d6 Binary files /dev/null and b/data/IW5/_unamed/8218.gscbin differ diff --git a/data/IW5/_unamed/8219.gscbin b/data/IW5/_unamed/8219.gscbin new file mode 100644 index 00000000..c260dc90 Binary files /dev/null and b/data/IW5/_unamed/8219.gscbin differ diff --git a/data/IW5/_unamed/8220.gscbin b/data/IW5/_unamed/8220.gscbin new file mode 100644 index 00000000..b68e2d1d Binary files /dev/null and b/data/IW5/_unamed/8220.gscbin differ diff --git a/data/IW5/_unamed/8221.gscbin b/data/IW5/_unamed/8221.gscbin new file mode 100644 index 00000000..2ec0cbda Binary files /dev/null and b/data/IW5/_unamed/8221.gscbin differ diff --git a/data/IW5/_unamed/8222.gscbin b/data/IW5/_unamed/8222.gscbin new file mode 100644 index 00000000..defb5503 Binary files /dev/null and b/data/IW5/_unamed/8222.gscbin differ diff --git a/data/IW5/_unamed/8223.gscbin b/data/IW5/_unamed/8223.gscbin new file mode 100644 index 00000000..1840919f Binary files /dev/null and b/data/IW5/_unamed/8223.gscbin differ diff --git a/data/IW5/_unamed/8226.gscbin b/data/IW5/_unamed/8226.gscbin new file mode 100644 index 00000000..8ebf6e63 Binary files /dev/null and b/data/IW5/_unamed/8226.gscbin differ diff --git a/data/IW5/_unamed/8227.gscbin b/data/IW5/_unamed/8227.gscbin new file mode 100644 index 00000000..377c5b6e Binary files /dev/null and b/data/IW5/_unamed/8227.gscbin differ diff --git a/data/IW5/_unamed/853.gscbin b/data/IW5/_unamed/853.gscbin new file mode 100644 index 00000000..4d84ee30 Binary files /dev/null and b/data/IW5/_unamed/853.gscbin differ diff --git a/data/IW5/_unamed/854.gscbin b/data/IW5/_unamed/854.gscbin new file mode 100644 index 00000000..5ee5ab36 Binary files /dev/null and b/data/IW5/_unamed/854.gscbin differ diff --git a/data/IW5/_unamed/855.gscbin b/data/IW5/_unamed/855.gscbin new file mode 100644 index 00000000..8f9cad1f Binary files /dev/null and b/data/IW5/_unamed/855.gscbin differ diff --git a/data/IW5/_unamed/861.gscbin b/data/IW5/_unamed/861.gscbin new file mode 100644 index 00000000..0873a13a Binary files /dev/null and b/data/IW5/_unamed/861.gscbin differ diff --git a/data/IW5/_unamed/866.gscbin b/data/IW5/_unamed/866.gscbin new file mode 100644 index 00000000..9a7b7518 Binary files /dev/null and b/data/IW5/_unamed/866.gscbin differ diff --git a/data/IW5/_unamed/868.gscbin b/data/IW5/_unamed/868.gscbin new file mode 100644 index 00000000..a7aca866 Binary files /dev/null and b/data/IW5/_unamed/868.gscbin differ diff --git a/data/IW5/_unamed/911.gscbin b/data/IW5/_unamed/911.gscbin new file mode 100644 index 00000000..000a444a Binary files /dev/null and b/data/IW5/_unamed/911.gscbin differ diff --git a/data/IW5/_unamed/931.gscbin b/data/IW5/_unamed/931.gscbin new file mode 100644 index 00000000..1d1c5c39 Binary files /dev/null and b/data/IW5/_unamed/931.gscbin differ diff --git a/data/IW5/_unamed/932.gscbin b/data/IW5/_unamed/932.gscbin new file mode 100644 index 00000000..8668edeb Binary files /dev/null and b/data/IW5/_unamed/932.gscbin differ diff --git a/data/IW5/_unamed/933.gscbin b/data/IW5/_unamed/933.gscbin new file mode 100644 index 00000000..8a17582a Binary files /dev/null and b/data/IW5/_unamed/933.gscbin differ diff --git a/data/IW5/_unamed/958.gscbin b/data/IW5/_unamed/958.gscbin new file mode 100644 index 00000000..f2e62c8f Binary files /dev/null and b/data/IW5/_unamed/958.gscbin differ diff --git a/data/IW5/_unamed/959.gscbin b/data/IW5/_unamed/959.gscbin new file mode 100644 index 00000000..e61069a3 Binary files /dev/null and b/data/IW5/_unamed/959.gscbin differ diff --git a/data/IW5/_unamed/960.gscbin b/data/IW5/_unamed/960.gscbin new file mode 100644 index 00000000..ab3e6344 Binary files /dev/null and b/data/IW5/_unamed/960.gscbin differ diff --git a/data/IW5/_unamed/961.gscbin b/data/IW5/_unamed/961.gscbin new file mode 100644 index 00000000..9d2411a0 Binary files /dev/null and b/data/IW5/_unamed/961.gscbin differ diff --git a/data/IW5/_unamed/962.gscbin b/data/IW5/_unamed/962.gscbin new file mode 100644 index 00000000..03f731a7 Binary files /dev/null and b/data/IW5/_unamed/962.gscbin differ diff --git a/data/IW5/_unamed/963.gscbin b/data/IW5/_unamed/963.gscbin new file mode 100644 index 00000000..5091a4b9 Binary files /dev/null and b/data/IW5/_unamed/963.gscbin differ diff --git a/data/IW5/_unamed/964.gscbin b/data/IW5/_unamed/964.gscbin new file mode 100644 index 00000000..98ca266e Binary files /dev/null and b/data/IW5/_unamed/964.gscbin differ diff --git a/data/IW5/_unamed/965.gscbin b/data/IW5/_unamed/965.gscbin new file mode 100644 index 00000000..df25f18e Binary files /dev/null and b/data/IW5/_unamed/965.gscbin differ diff --git a/data/IW5/_unamed/966.gscbin b/data/IW5/_unamed/966.gscbin new file mode 100644 index 00000000..fc3ea778 Binary files /dev/null and b/data/IW5/_unamed/966.gscbin differ diff --git a/data/IW5/_unamed/969.gscbin b/data/IW5/_unamed/969.gscbin new file mode 100644 index 00000000..b4d25256 Binary files /dev/null and b/data/IW5/_unamed/969.gscbin differ diff --git a/data/IW5/_unamed/970.gscbin b/data/IW5/_unamed/970.gscbin new file mode 100644 index 00000000..943b7210 Binary files /dev/null and b/data/IW5/_unamed/970.gscbin differ diff --git a/data/IW5/_unamed/996.gscbin b/data/IW5/_unamed/996.gscbin new file mode 100644 index 00000000..524b6e30 Binary files /dev/null and b/data/IW5/_unamed/996.gscbin differ diff --git a/data/IW5/_unamed/997.gscbin b/data/IW5/_unamed/997.gscbin new file mode 100644 index 00000000..45ac4b3d Binary files /dev/null and b/data/IW5/_unamed/997.gscbin differ diff --git a/data/IW5/_unamed/999.gscbin b/data/IW5/_unamed/999.gscbin new file mode 100644 index 00000000..3f6a47cd Binary files /dev/null and b/data/IW5/_unamed/999.gscbin differ diff --git a/data/IW5/aitype/ally_ac130_delta_ucp_m16.gscbin b/data/IW5/aitype/ally_ac130_delta_ucp_m16.gscbin new file mode 100644 index 00000000..5d66600f Binary files /dev/null and b/data/IW5/aitype/ally_ac130_delta_ucp_m16.gscbin differ diff --git a/data/IW5/aitype/ally_ac130_hostage.gscbin b/data/IW5/aitype/ally_ac130_hostage.gscbin new file mode 100644 index 00000000..41b8148a Binary files /dev/null and b/data/IW5/aitype/ally_ac130_hostage.gscbin differ diff --git a/data/IW5/aitype/ally_air_crew_manhattan.gscbin b/data/IW5/aitype/ally_air_crew_manhattan.gscbin new file mode 100644 index 00000000..7b27f63a Binary files /dev/null and b/data/IW5/aitype/ally_air_crew_manhattan.gscbin differ diff --git a/data/IW5/aitype/ally_airport_comrad_m4.gscbin b/data/IW5/aitype/ally_airport_comrad_m4.gscbin new file mode 100644 index 00000000..7d65ca6f Binary files /dev/null and b/data/IW5/aitype/ally_airport_comrad_m4.gscbin differ diff --git a/data/IW5/aitype/ally_airport_comrad_saw.gscbin b/data/IW5/aitype/ally_airport_comrad_saw.gscbin new file mode 100644 index 00000000..258c3b06 Binary files /dev/null and b/data/IW5/aitype/ally_airport_comrad_saw.gscbin differ diff --git a/data/IW5/aitype/ally_airport_comrad_shotgun.gscbin b/data/IW5/aitype/ally_airport_comrad_shotgun.gscbin new file mode 100644 index 00000000..b282de6b Binary files /dev/null and b/data/IW5/aitype/ally_airport_comrad_shotgun.gscbin differ diff --git a/data/IW5/aitype/ally_delta_multicam_m16.gscbin b/data/IW5/aitype/ally_delta_multicam_m16.gscbin new file mode 100644 index 00000000..91393ec8 Binary files /dev/null and b/data/IW5/aitype/ally_delta_multicam_m16.gscbin differ diff --git a/data/IW5/aitype/ally_delta_multicam_m4.gscbin b/data/IW5/aitype/ally_delta_multicam_m4.gscbin new file mode 100644 index 00000000..441d7aa3 Binary files /dev/null and b/data/IW5/aitype/ally_delta_multicam_m4.gscbin differ diff --git a/data/IW5/aitype/ally_delta_multicam_mp5.gscbin b/data/IW5/aitype/ally_delta_multicam_mp5.gscbin new file mode 100644 index 00000000..a67717e2 Binary files /dev/null and b/data/IW5/aitype/ally_delta_multicam_mp5.gscbin differ diff --git a/data/IW5/aitype/ally_delta_snow_m4.gscbin b/data/IW5/aitype/ally_delta_snow_m4.gscbin new file mode 100644 index 00000000..145f2359 Binary files /dev/null and b/data/IW5/aitype/ally_delta_snow_m4.gscbin differ diff --git a/data/IW5/aitype/ally_delta_snow_scar.gscbin b/data/IW5/aitype/ally_delta_snow_scar.gscbin new file mode 100644 index 00000000..c62872c7 Binary files /dev/null and b/data/IW5/aitype/ally_delta_snow_scar.gscbin differ diff --git a/data/IW5/aitype/ally_delta_ucp_m16.gscbin b/data/IW5/aitype/ally_delta_ucp_m16.gscbin new file mode 100644 index 00000000..d3b625b8 Binary files /dev/null and b/data/IW5/aitype/ally_delta_ucp_m16.gscbin differ diff --git a/data/IW5/aitype/ally_delta_udt_dive.gscbin b/data/IW5/aitype/ally_delta_udt_dive.gscbin new file mode 100644 index 00000000..2b83513a Binary files /dev/null and b/data/IW5/aitype/ally_delta_udt_dive.gscbin differ diff --git a/data/IW5/aitype/ally_delta_udt_mp5.gscbin b/data/IW5/aitype/ally_delta_udt_mp5.gscbin new file mode 100644 index 00000000..02991aa6 Binary files /dev/null and b/data/IW5/aitype/ally_delta_udt_mp5.gscbin differ diff --git a/data/IW5/aitype/ally_gign_paris_ar.gscbin b/data/IW5/aitype/ally_gign_paris_ar.gscbin new file mode 100644 index 00000000..3be85ac6 Binary files /dev/null and b/data/IW5/aitype/ally_gign_paris_ar.gscbin differ diff --git a/data/IW5/aitype/ally_gign_paris_gasmask_ar.gscbin b/data/IW5/aitype/ally_gign_paris_gasmask_ar.gscbin new file mode 100644 index 00000000..2b3d99e6 Binary files /dev/null and b/data/IW5/aitype/ally_gign_paris_gasmask_ar.gscbin differ diff --git a/data/IW5/aitype/ally_gign_paris_gasmask_leader.gscbin b/data/IW5/aitype/ally_gign_paris_gasmask_leader.gscbin new file mode 100644 index 00000000..4826af7d Binary files /dev/null and b/data/IW5/aitype/ally_gign_paris_gasmask_leader.gscbin differ diff --git a/data/IW5/aitype/ally_gign_paris_gasmask_lmg.gscbin b/data/IW5/aitype/ally_gign_paris_gasmask_lmg.gscbin new file mode 100644 index 00000000..6c0361d3 Binary files /dev/null and b/data/IW5/aitype/ally_gign_paris_gasmask_lmg.gscbin differ diff --git a/data/IW5/aitype/ally_gign_paris_gasmask_mp5.gscbin b/data/IW5/aitype/ally_gign_paris_gasmask_mp5.gscbin new file mode 100644 index 00000000..c5b29788 Binary files /dev/null and b/data/IW5/aitype/ally_gign_paris_gasmask_mp5.gscbin differ diff --git a/data/IW5/aitype/ally_gign_paris_gasmask_smg.gscbin b/data/IW5/aitype/ally_gign_paris_gasmask_smg.gscbin new file mode 100644 index 00000000..7b8423d2 Binary files /dev/null and b/data/IW5/aitype/ally_gign_paris_gasmask_smg.gscbin differ diff --git a/data/IW5/aitype/ally_gign_paris_leader.gscbin b/data/IW5/aitype/ally_gign_paris_leader.gscbin new file mode 100644 index 00000000..caf52627 Binary files /dev/null and b/data/IW5/aitype/ally_gign_paris_leader.gscbin differ diff --git a/data/IW5/aitype/ally_gign_paris_lmg.gscbin b/data/IW5/aitype/ally_gign_paris_lmg.gscbin new file mode 100644 index 00000000..ca458db9 Binary files /dev/null and b/data/IW5/aitype/ally_gign_paris_lmg.gscbin differ diff --git a/data/IW5/aitype/ally_gign_paris_shotgun.gscbin b/data/IW5/aitype/ally_gign_paris_shotgun.gscbin new file mode 100644 index 00000000..42377a02 Binary files /dev/null and b/data/IW5/aitype/ally_gign_paris_shotgun.gscbin differ diff --git a/data/IW5/aitype/ally_gign_paris_smg.gscbin b/data/IW5/aitype/ally_gign_paris_smg.gscbin new file mode 100644 index 00000000..3be96a33 Binary files /dev/null and b/data/IW5/aitype/ally_gign_paris_smg.gscbin differ diff --git a/data/IW5/aitype/ally_hero_grinch_delta.gscbin b/data/IW5/aitype/ally_hero_grinch_delta.gscbin new file mode 100644 index 00000000..6efe5f9b Binary files /dev/null and b/data/IW5/aitype/ally_hero_grinch_delta.gscbin differ diff --git a/data/IW5/aitype/ally_hero_grinch_delta_gasmask_m4.gscbin b/data/IW5/aitype/ally_hero_grinch_delta_gasmask_m4.gscbin new file mode 100644 index 00000000..479e768e Binary files /dev/null and b/data/IW5/aitype/ally_hero_grinch_delta_gasmask_m4.gscbin differ diff --git a/data/IW5/aitype/ally_hero_grinch_delta_snow.gscbin b/data/IW5/aitype/ally_hero_grinch_delta_snow.gscbin new file mode 100644 index 00000000..61ef00af Binary files /dev/null and b/data/IW5/aitype/ally_hero_grinch_delta_snow.gscbin differ diff --git a/data/IW5/aitype/ally_hero_kamarov_prague.gscbin b/data/IW5/aitype/ally_hero_kamarov_prague.gscbin new file mode 100644 index 00000000..e2de997e Binary files /dev/null and b/data/IW5/aitype/ally_hero_kamarov_prague.gscbin differ diff --git a/data/IW5/aitype/ally_hero_makarov_airport.gscbin b/data/IW5/aitype/ally_hero_makarov_airport.gscbin new file mode 100644 index 00000000..d62885c9 Binary files /dev/null and b/data/IW5/aitype/ally_hero_makarov_airport.gscbin differ diff --git a/data/IW5/aitype/ally_hero_nikolai_intro.gscbin b/data/IW5/aitype/ally_hero_nikolai_intro.gscbin new file mode 100644 index 00000000..16966b2c Binary files /dev/null and b/data/IW5/aitype/ally_hero_nikolai_intro.gscbin differ diff --git a/data/IW5/aitype/ally_hero_nikolai_payback.gscbin b/data/IW5/aitype/ally_hero_nikolai_payback.gscbin new file mode 100644 index 00000000..f9be3787 Binary files /dev/null and b/data/IW5/aitype/ally_hero_nikolai_payback.gscbin differ diff --git a/data/IW5/aitype/ally_hero_price_castle.gscbin b/data/IW5/aitype/ally_hero_price_castle.gscbin new file mode 100644 index 00000000..ce501607 Binary files /dev/null and b/data/IW5/aitype/ally_hero_price_castle.gscbin differ diff --git a/data/IW5/aitype/ally_hero_price_intro.gscbin b/data/IW5/aitype/ally_hero_price_intro.gscbin new file mode 100644 index 00000000..9caa517d Binary files /dev/null and b/data/IW5/aitype/ally_hero_price_intro.gscbin differ diff --git a/data/IW5/aitype/ally_hero_price_payback.gscbin b/data/IW5/aitype/ally_hero_price_payback.gscbin new file mode 100644 index 00000000..287e4b2c Binary files /dev/null and b/data/IW5/aitype/ally_hero_price_payback.gscbin differ diff --git a/data/IW5/aitype/ally_hero_price_prague.gscbin b/data/IW5/aitype/ally_hero_price_prague.gscbin new file mode 100644 index 00000000..8e16cf73 Binary files /dev/null and b/data/IW5/aitype/ally_hero_price_prague.gscbin differ diff --git a/data/IW5/aitype/ally_hero_price_rescue.gscbin b/data/IW5/aitype/ally_hero_price_rescue.gscbin new file mode 100644 index 00000000..11893c91 Binary files /dev/null and b/data/IW5/aitype/ally_hero_price_rescue.gscbin differ diff --git a/data/IW5/aitype/ally_hero_sandman_delta.gscbin b/data/IW5/aitype/ally_hero_sandman_delta.gscbin new file mode 100644 index 00000000..e65e41a8 Binary files /dev/null and b/data/IW5/aitype/ally_hero_sandman_delta.gscbin differ diff --git a/data/IW5/aitype/ally_hero_sandman_delta_gasmask_m4.gscbin b/data/IW5/aitype/ally_hero_sandman_delta_gasmask_m4.gscbin new file mode 100644 index 00000000..5cf1331e Binary files /dev/null and b/data/IW5/aitype/ally_hero_sandman_delta_gasmask_m4.gscbin differ diff --git a/data/IW5/aitype/ally_hero_sandman_delta_noglasses_m4.gscbin b/data/IW5/aitype/ally_hero_sandman_delta_noglasses_m4.gscbin new file mode 100644 index 00000000..f708e141 Binary files /dev/null and b/data/IW5/aitype/ally_hero_sandman_delta_noglasses_m4.gscbin differ diff --git a/data/IW5/aitype/ally_hero_sandman_delta_paris_ac130.gscbin b/data/IW5/aitype/ally_hero_sandman_delta_paris_ac130.gscbin new file mode 100644 index 00000000..651d4b5a Binary files /dev/null and b/data/IW5/aitype/ally_hero_sandman_delta_paris_ac130.gscbin differ diff --git a/data/IW5/aitype/ally_hero_sandman_delta_snow.gscbin b/data/IW5/aitype/ally_hero_sandman_delta_snow.gscbin new file mode 100644 index 00000000..93def183 Binary files /dev/null and b/data/IW5/aitype/ally_hero_sandman_delta_snow.gscbin differ diff --git a/data/IW5/aitype/ally_hero_soap_intro.gscbin b/data/IW5/aitype/ally_hero_soap_intro.gscbin new file mode 100644 index 00000000..f87a5a81 Binary files /dev/null and b/data/IW5/aitype/ally_hero_soap_intro.gscbin differ diff --git a/data/IW5/aitype/ally_hero_soap_payback.gscbin b/data/IW5/aitype/ally_hero_soap_payback.gscbin new file mode 100644 index 00000000..4fde0f95 Binary files /dev/null and b/data/IW5/aitype/ally_hero_soap_payback.gscbin differ diff --git a/data/IW5/aitype/ally_hero_soap_prague.gscbin b/data/IW5/aitype/ally_hero_soap_prague.gscbin new file mode 100644 index 00000000..82f89c24 Binary files /dev/null and b/data/IW5/aitype/ally_hero_soap_prague.gscbin differ diff --git a/data/IW5/aitype/ally_hero_soap_prague_injured.gscbin b/data/IW5/aitype/ally_hero_soap_prague_injured.gscbin new file mode 100644 index 00000000..4298d091 Binary files /dev/null and b/data/IW5/aitype/ally_hero_soap_prague_injured.gscbin differ diff --git a/data/IW5/aitype/ally_hero_truck_delta_m249.gscbin b/data/IW5/aitype/ally_hero_truck_delta_m249.gscbin new file mode 100644 index 00000000..57b34712 Binary files /dev/null and b/data/IW5/aitype/ally_hero_truck_delta_m249.gscbin differ diff --git a/data/IW5/aitype/ally_hero_truck_delta_m4.gscbin b/data/IW5/aitype/ally_hero_truck_delta_m4.gscbin new file mode 100644 index 00000000..04e68543 Binary files /dev/null and b/data/IW5/aitype/ally_hero_truck_delta_m4.gscbin differ diff --git a/data/IW5/aitype/ally_hero_truck_delta_snow_m4.gscbin b/data/IW5/aitype/ally_hero_truck_delta_snow_m4.gscbin new file mode 100644 index 00000000..1eb56f8e Binary files /dev/null and b/data/IW5/aitype/ally_hero_truck_delta_snow_m4.gscbin differ diff --git a/data/IW5/aitype/ally_hero_yuri_dubai.gscbin b/data/IW5/aitype/ally_hero_yuri_dubai.gscbin new file mode 100644 index 00000000..6ca5aba6 Binary files /dev/null and b/data/IW5/aitype/ally_hero_yuri_dubai.gscbin differ diff --git a/data/IW5/aitype/ally_hero_yuri_intro.gscbin b/data/IW5/aitype/ally_hero_yuri_intro.gscbin new file mode 100644 index 00000000..8caf11f3 Binary files /dev/null and b/data/IW5/aitype/ally_hero_yuri_intro.gscbin differ diff --git a/data/IW5/aitype/ally_intro_russian_ar.gscbin b/data/IW5/aitype/ally_intro_russian_ar.gscbin new file mode 100644 index 00000000..002c3333 Binary files /dev/null and b/data/IW5/aitype/ally_intro_russian_ar.gscbin differ diff --git a/data/IW5/aitype/ally_intro_russian_lmg.gscbin b/data/IW5/aitype/ally_intro_russian_lmg.gscbin new file mode 100644 index 00000000..f7ea2990 Binary files /dev/null and b/data/IW5/aitype/ally_intro_russian_lmg.gscbin differ diff --git a/data/IW5/aitype/ally_intro_russian_rpg.gscbin b/data/IW5/aitype/ally_intro_russian_rpg.gscbin new file mode 100644 index 00000000..d099d5f3 Binary files /dev/null and b/data/IW5/aitype/ally_intro_russian_rpg.gscbin differ diff --git a/data/IW5/aitype/ally_intro_russian_shotgun.gscbin b/data/IW5/aitype/ally_intro_russian_shotgun.gscbin new file mode 100644 index 00000000..365aa74d Binary files /dev/null and b/data/IW5/aitype/ally_intro_russian_shotgun.gscbin differ diff --git a/data/IW5/aitype/ally_juggernaut_dubai.gscbin b/data/IW5/aitype/ally_juggernaut_dubai.gscbin new file mode 100644 index 00000000..001253aa Binary files /dev/null and b/data/IW5/aitype/ally_juggernaut_dubai.gscbin differ diff --git a/data/IW5/aitype/ally_juggernaut_dubai_nohelmet.gscbin b/data/IW5/aitype/ally_juggernaut_dubai_nohelmet.gscbin new file mode 100644 index 00000000..3d4280b1 Binary files /dev/null and b/data/IW5/aitype/ally_juggernaut_dubai_nohelmet.gscbin differ diff --git a/data/IW5/aitype/ally_london_police_shotgun.gscbin b/data/IW5/aitype/ally_london_police_shotgun.gscbin new file mode 100644 index 00000000..373db0dd Binary files /dev/null and b/data/IW5/aitype/ally_london_police_shotgun.gscbin differ diff --git a/data/IW5/aitype/ally_prague_resistance_ar.gscbin b/data/IW5/aitype/ally_prague_resistance_ar.gscbin new file mode 100644 index 00000000..4113b25d Binary files /dev/null and b/data/IW5/aitype/ally_prague_resistance_ar.gscbin differ diff --git a/data/IW5/aitype/ally_prague_resistance_ar_drone.gscbin b/data/IW5/aitype/ally_prague_resistance_ar_drone.gscbin new file mode 100644 index 00000000..e1419ffa Binary files /dev/null and b/data/IW5/aitype/ally_prague_resistance_ar_drone.gscbin differ diff --git a/data/IW5/aitype/ally_prague_resistance_heroes.gscbin b/data/IW5/aitype/ally_prague_resistance_heroes.gscbin new file mode 100644 index 00000000..c37be3b4 Binary files /dev/null and b/data/IW5/aitype/ally_prague_resistance_heroes.gscbin differ diff --git a/data/IW5/aitype/ally_prague_resistance_rpg.gscbin b/data/IW5/aitype/ally_prague_resistance_rpg.gscbin new file mode 100644 index 00000000..59580b7e Binary files /dev/null and b/data/IW5/aitype/ally_prague_resistance_rpg.gscbin differ diff --git a/data/IW5/aitype/ally_prague_resistance_wounded.gscbin b/data/IW5/aitype/ally_prague_resistance_wounded.gscbin new file mode 100644 index 00000000..81dbf388 Binary files /dev/null and b/data/IW5/aitype/ally_prague_resistance_wounded.gscbin differ diff --git a/data/IW5/aitype/ally_rangers_ar.gscbin b/data/IW5/aitype/ally_rangers_ar.gscbin new file mode 100644 index 00000000..1d8b8e0b Binary files /dev/null and b/data/IW5/aitype/ally_rangers_ar.gscbin differ diff --git a/data/IW5/aitype/ally_rangers_m249.gscbin b/data/IW5/aitype/ally_rangers_m249.gscbin new file mode 100644 index 00000000..b2dd2e3f Binary files /dev/null and b/data/IW5/aitype/ally_rangers_m249.gscbin differ diff --git a/data/IW5/aitype/ally_rangers_m4.gscbin b/data/IW5/aitype/ally_rangers_m4.gscbin new file mode 100644 index 00000000..6af992af Binary files /dev/null and b/data/IW5/aitype/ally_rangers_m4.gscbin differ diff --git a/data/IW5/aitype/ally_rangers_m4_grenadier.gscbin b/data/IW5/aitype/ally_rangers_m4_grenadier.gscbin new file mode 100644 index 00000000..0249bed3 Binary files /dev/null and b/data/IW5/aitype/ally_rangers_m4_grenadier.gscbin differ diff --git a/data/IW5/aitype/ally_russian_advisor.gscbin b/data/IW5/aitype/ally_russian_advisor.gscbin new file mode 100644 index 00000000..d6f40770 Binary files /dev/null and b/data/IW5/aitype/ally_russian_advisor.gscbin differ diff --git a/data/IW5/aitype/ally_russian_assistant.gscbin b/data/IW5/aitype/ally_russian_assistant.gscbin new file mode 100644 index 00000000..97e6e569 Binary files /dev/null and b/data/IW5/aitype/ally_russian_assistant.gscbin differ diff --git a/data/IW5/aitype/ally_russian_commander.gscbin b/data/IW5/aitype/ally_russian_commander.gscbin new file mode 100644 index 00000000..10377c1b Binary files /dev/null and b/data/IW5/aitype/ally_russian_commander.gscbin differ diff --git a/data/IW5/aitype/ally_russian_commander_dirty.gscbin b/data/IW5/aitype/ally_russian_commander_dirty.gscbin new file mode 100644 index 00000000..4bb28d83 Binary files /dev/null and b/data/IW5/aitype/ally_russian_commander_dirty.gscbin differ diff --git a/data/IW5/aitype/ally_russian_daughter.gscbin b/data/IW5/aitype/ally_russian_daughter.gscbin new file mode 100644 index 00000000..b68ea12a Binary files /dev/null and b/data/IW5/aitype/ally_russian_daughter.gscbin differ diff --git a/data/IW5/aitype/ally_russian_daughter_dirty.gscbin b/data/IW5/aitype/ally_russian_daughter_dirty.gscbin new file mode 100644 index 00000000..539d6f88 Binary files /dev/null and b/data/IW5/aitype/ally_russian_daughter_dirty.gscbin differ diff --git a/data/IW5/aitype/ally_russian_doctor.gscbin b/data/IW5/aitype/ally_russian_doctor.gscbin new file mode 100644 index 00000000..d0254072 Binary files /dev/null and b/data/IW5/aitype/ally_russian_doctor.gscbin differ diff --git a/data/IW5/aitype/ally_russian_fso_ak74u.gscbin b/data/IW5/aitype/ally_russian_fso_ak74u.gscbin new file mode 100644 index 00000000..2c35aed1 Binary files /dev/null and b/data/IW5/aitype/ally_russian_fso_ak74u.gscbin differ diff --git a/data/IW5/aitype/ally_russian_fso_dirty_ak74u.gscbin b/data/IW5/aitype/ally_russian_fso_dirty_ak74u.gscbin new file mode 100644 index 00000000..28fc789c Binary files /dev/null and b/data/IW5/aitype/ally_russian_fso_dirty_ak74u.gscbin differ diff --git a/data/IW5/aitype/ally_russian_fso_nopacks_ak74u.gscbin b/data/IW5/aitype/ally_russian_fso_nopacks_ak74u.gscbin new file mode 100644 index 00000000..cbd5b812 Binary files /dev/null and b/data/IW5/aitype/ally_russian_fso_nopacks_ak74u.gscbin differ diff --git a/data/IW5/aitype/ally_russian_fso_nopacks_dirty_ak74u.gscbin b/data/IW5/aitype/ally_russian_fso_nopacks_dirty_ak74u.gscbin new file mode 100644 index 00000000..e0c27484 Binary files /dev/null and b/data/IW5/aitype/ally_russian_fso_nopacks_dirty_ak74u.gscbin differ diff --git a/data/IW5/aitype/ally_russian_pmc_payback_ar.gscbin b/data/IW5/aitype/ally_russian_pmc_payback_ar.gscbin new file mode 100644 index 00000000..d40a9ded Binary files /dev/null and b/data/IW5/aitype/ally_russian_pmc_payback_ar.gscbin differ diff --git a/data/IW5/aitype/ally_russian_pmc_payback_lmg.gscbin b/data/IW5/aitype/ally_russian_pmc_payback_lmg.gscbin new file mode 100644 index 00000000..d42f3caa Binary files /dev/null and b/data/IW5/aitype/ally_russian_pmc_payback_lmg.gscbin differ diff --git a/data/IW5/aitype/ally_russian_president_dirty.gscbin b/data/IW5/aitype/ally_russian_president_dirty.gscbin new file mode 100644 index 00000000..ebe46185 Binary files /dev/null and b/data/IW5/aitype/ally_russian_president_dirty.gscbin differ diff --git a/data/IW5/aitype/ally_russian_secretary.gscbin b/data/IW5/aitype/ally_russian_secretary.gscbin new file mode 100644 index 00000000..8d227ebb Binary files /dev/null and b/data/IW5/aitype/ally_russian_secretary.gscbin differ diff --git a/data/IW5/aitype/ally_russian_secretservice_ak74u.gscbin b/data/IW5/aitype/ally_russian_secretservice_ak74u.gscbin new file mode 100644 index 00000000..4b2eab28 Binary files /dev/null and b/data/IW5/aitype/ally_russian_secretservice_ak74u.gscbin differ diff --git a/data/IW5/aitype/ally_russian_staff_a.gscbin b/data/IW5/aitype/ally_russian_staff_a.gscbin new file mode 100644 index 00000000..ed3c5ef8 Binary files /dev/null and b/data/IW5/aitype/ally_russian_staff_a.gscbin differ diff --git a/data/IW5/aitype/ally_russian_staff_b.gscbin b/data/IW5/aitype/ally_russian_staff_b.gscbin new file mode 100644 index 00000000..a93c09eb Binary files /dev/null and b/data/IW5/aitype/ally_russian_staff_b.gscbin differ diff --git a/data/IW5/aitype/ally_sas_blackkit_mp5.gscbin b/data/IW5/aitype/ally_sas_blackkit_mp5.gscbin new file mode 100644 index 00000000..683ec2a1 Binary files /dev/null and b/data/IW5/aitype/ally_sas_blackkit_mp5.gscbin differ diff --git a/data/IW5/aitype/ally_sas_blackkit_mp5sd.gscbin b/data/IW5/aitype/ally_sas_blackkit_mp5sd.gscbin new file mode 100644 index 00000000..6d8ba000 Binary files /dev/null and b/data/IW5/aitype/ally_sas_blackkit_mp5sd.gscbin differ diff --git a/data/IW5/aitype/ally_sas_blackkit_shotgun.gscbin b/data/IW5/aitype/ally_sas_blackkit_shotgun.gscbin new file mode 100644 index 00000000..76db6400 Binary files /dev/null and b/data/IW5/aitype/ally_sas_blackkit_shotgun.gscbin differ diff --git a/data/IW5/aitype/ally_so_delta.gscbin b/data/IW5/aitype/ally_so_delta.gscbin new file mode 100644 index 00000000..c8cf225d Binary files /dev/null and b/data/IW5/aitype/ally_so_delta.gscbin differ diff --git a/data/IW5/aitype/ally_so_riotshield.gscbin b/data/IW5/aitype/ally_so_riotshield.gscbin new file mode 100644 index 00000000..150d7f6c Binary files /dev/null and b/data/IW5/aitype/ally_so_riotshield.gscbin differ diff --git a/data/IW5/aitype/ally_tank_crew.gscbin b/data/IW5/aitype/ally_tank_crew.gscbin new file mode 100644 index 00000000..0f522939 Binary files /dev/null and b/data/IW5/aitype/ally_tank_crew.gscbin differ diff --git a/data/IW5/aitype/ally_tank_crew_driver.gscbin b/data/IW5/aitype/ally_tank_crew_driver.gscbin new file mode 100644 index 00000000..63b26cac Binary files /dev/null and b/data/IW5/aitype/ally_tank_crew_driver.gscbin differ diff --git a/data/IW5/aitype/ally_tank_crew_loader.gscbin b/data/IW5/aitype/ally_tank_crew_loader.gscbin new file mode 100644 index 00000000..3ee6b4f5 Binary files /dev/null and b/data/IW5/aitype/ally_tank_crew_loader.gscbin differ diff --git a/data/IW5/aitype/civilian_africa_male.gscbin b/data/IW5/aitype/civilian_africa_male.gscbin new file mode 100644 index 00000000..770b0986 Binary files /dev/null and b/data/IW5/aitype/civilian_africa_male.gscbin differ diff --git a/data/IW5/aitype/civilian_africa_male_burned.gscbin b/data/IW5/aitype/civilian_africa_male_burned.gscbin new file mode 100644 index 00000000..0fd3be91 Binary files /dev/null and b/data/IW5/aitype/civilian_africa_male_burned.gscbin differ diff --git a/data/IW5/aitype/civilian_dubai_female.gscbin b/data/IW5/aitype/civilian_dubai_female.gscbin new file mode 100644 index 00000000..b39b8ed0 Binary files /dev/null and b/data/IW5/aitype/civilian_dubai_female.gscbin differ diff --git a/data/IW5/aitype/civilian_dubai_male.gscbin b/data/IW5/aitype/civilian_dubai_male.gscbin new file mode 100644 index 00000000..4571645e Binary files /dev/null and b/data/IW5/aitype/civilian_dubai_male.gscbin differ diff --git a/data/IW5/aitype/civilian_hamburg_male_hostage.gscbin b/data/IW5/aitype/civilian_hamburg_male_hostage.gscbin new file mode 100644 index 00000000..41fc22e3 Binary files /dev/null and b/data/IW5/aitype/civilian_hamburg_male_hostage.gscbin differ diff --git a/data/IW5/aitype/civilian_intro_female_drone.gscbin b/data/IW5/aitype/civilian_intro_female_drone.gscbin new file mode 100644 index 00000000..8cfc51ce Binary files /dev/null and b/data/IW5/aitype/civilian_intro_female_drone.gscbin differ diff --git a/data/IW5/aitype/civilian_intro_male_drone.gscbin b/data/IW5/aitype/civilian_intro_male_drone.gscbin new file mode 100644 index 00000000..2d78e691 Binary files /dev/null and b/data/IW5/aitype/civilian_intro_male_drone.gscbin differ diff --git a/data/IW5/aitype/civilian_london_daughter.gscbin b/data/IW5/aitype/civilian_london_daughter.gscbin new file mode 100644 index 00000000..9f0f852f Binary files /dev/null and b/data/IW5/aitype/civilian_london_daughter.gscbin differ diff --git a/data/IW5/aitype/civilian_london_female.gscbin b/data/IW5/aitype/civilian_london_female.gscbin new file mode 100644 index 00000000..d61d24ac Binary files /dev/null and b/data/IW5/aitype/civilian_london_female.gscbin differ diff --git a/data/IW5/aitype/civilian_london_female_drone.gscbin b/data/IW5/aitype/civilian_london_female_drone.gscbin new file mode 100644 index 00000000..13d76f30 Binary files /dev/null and b/data/IW5/aitype/civilian_london_female_drone.gscbin differ diff --git a/data/IW5/aitype/civilian_london_male.gscbin b/data/IW5/aitype/civilian_london_male.gscbin new file mode 100644 index 00000000..b8912c5d Binary files /dev/null and b/data/IW5/aitype/civilian_london_male.gscbin differ diff --git a/data/IW5/aitype/civilian_london_male_drone.gscbin b/data/IW5/aitype/civilian_london_male_drone.gscbin new file mode 100644 index 00000000..81e0c75f Binary files /dev/null and b/data/IW5/aitype/civilian_london_male_drone.gscbin differ diff --git a/data/IW5/aitype/civilian_london_wife.gscbin b/data/IW5/aitype/civilian_london_wife.gscbin new file mode 100644 index 00000000..cd4ef61f Binary files /dev/null and b/data/IW5/aitype/civilian_london_wife.gscbin differ diff --git a/data/IW5/aitype/civilian_prague_female_drone.gscbin b/data/IW5/aitype/civilian_prague_female_drone.gscbin new file mode 100644 index 00000000..6f8dee3a Binary files /dev/null and b/data/IW5/aitype/civilian_prague_female_drone.gscbin differ diff --git a/data/IW5/aitype/civilian_prague_male.gscbin b/data/IW5/aitype/civilian_prague_male.gscbin new file mode 100644 index 00000000..4bba3eab Binary files /dev/null and b/data/IW5/aitype/civilian_prague_male.gscbin differ diff --git a/data/IW5/aitype/civilian_prague_male_drone.gscbin b/data/IW5/aitype/civilian_prague_male_drone.gscbin new file mode 100644 index 00000000..f207a7f8 Binary files /dev/null and b/data/IW5/aitype/civilian_prague_male_drone.gscbin differ diff --git a/data/IW5/aitype/civilian_russian_president.gscbin b/data/IW5/aitype/civilian_russian_president.gscbin new file mode 100644 index 00000000..d3a95ecf Binary files /dev/null and b/data/IW5/aitype/civilian_russian_president.gscbin differ diff --git a/data/IW5/aitype/civilian_russian_president_daughter_iw.gscbin b/data/IW5/aitype/civilian_russian_president_daughter_iw.gscbin new file mode 100644 index 00000000..da418e96 Binary files /dev/null and b/data/IW5/aitype/civilian_russian_president_daughter_iw.gscbin differ diff --git a/data/IW5/aitype/civilian_russian_prisoner.gscbin b/data/IW5/aitype/civilian_russian_prisoner.gscbin new file mode 100644 index 00000000..096a98aa Binary files /dev/null and b/data/IW5/aitype/civilian_russian_prisoner.gscbin differ diff --git a/data/IW5/aitype/enemy_ac130_paris_ar_ak47.gscbin b/data/IW5/aitype/enemy_ac130_paris_ar_ak47.gscbin new file mode 100644 index 00000000..b925ee59 Binary files /dev/null and b/data/IW5/aitype/enemy_ac130_paris_ar_ak47.gscbin differ diff --git a/data/IW5/aitype/enemy_africa_militia_ak47.gscbin b/data/IW5/aitype/enemy_africa_militia_ak47.gscbin new file mode 100644 index 00000000..4d58b7db Binary files /dev/null and b/data/IW5/aitype/enemy_africa_militia_ak47.gscbin differ diff --git a/data/IW5/aitype/enemy_africa_militia_ar.gscbin b/data/IW5/aitype/enemy_africa_militia_ar.gscbin new file mode 100644 index 00000000..b5b94d8c Binary files /dev/null and b/data/IW5/aitype/enemy_africa_militia_ar.gscbin differ diff --git a/data/IW5/aitype/enemy_africa_militia_ar_elite.gscbin b/data/IW5/aitype/enemy_africa_militia_ar_elite.gscbin new file mode 100644 index 00000000..c77ef430 Binary files /dev/null and b/data/IW5/aitype/enemy_africa_militia_ar_elite.gscbin differ diff --git a/data/IW5/aitype/enemy_africa_militia_lmg.gscbin b/data/IW5/aitype/enemy_africa_militia_lmg.gscbin new file mode 100644 index 00000000..cbda3428 Binary files /dev/null and b/data/IW5/aitype/enemy_africa_militia_lmg.gscbin differ diff --git a/data/IW5/aitype/enemy_africa_militia_payback_ar.gscbin b/data/IW5/aitype/enemy_africa_militia_payback_ar.gscbin new file mode 100644 index 00000000..f8eca798 Binary files /dev/null and b/data/IW5/aitype/enemy_africa_militia_payback_ar.gscbin differ diff --git a/data/IW5/aitype/enemy_africa_militia_payback_lmg.gscbin b/data/IW5/aitype/enemy_africa_militia_payback_lmg.gscbin new file mode 100644 index 00000000..221e4d6e Binary files /dev/null and b/data/IW5/aitype/enemy_africa_militia_payback_lmg.gscbin differ diff --git a/data/IW5/aitype/enemy_africa_militia_payback_rpg.gscbin b/data/IW5/aitype/enemy_africa_militia_payback_rpg.gscbin new file mode 100644 index 00000000..41ce9a68 Binary files /dev/null and b/data/IW5/aitype/enemy_africa_militia_payback_rpg.gscbin differ diff --git a/data/IW5/aitype/enemy_africa_militia_payback_shgn.gscbin b/data/IW5/aitype/enemy_africa_militia_payback_shgn.gscbin new file mode 100644 index 00000000..d3bac183 Binary files /dev/null and b/data/IW5/aitype/enemy_africa_militia_payback_shgn.gscbin differ diff --git a/data/IW5/aitype/enemy_africa_militia_payback_smg.gscbin b/data/IW5/aitype/enemy_africa_militia_payback_smg.gscbin new file mode 100644 index 00000000..1e4bd9c9 Binary files /dev/null and b/data/IW5/aitype/enemy_africa_militia_payback_smg.gscbin differ diff --git a/data/IW5/aitype/enemy_africa_militia_rpg.gscbin b/data/IW5/aitype/enemy_africa_militia_rpg.gscbin new file mode 100644 index 00000000..e9921455 Binary files /dev/null and b/data/IW5/aitype/enemy_africa_militia_rpg.gscbin differ diff --git a/data/IW5/aitype/enemy_africa_militia_shgn.gscbin b/data/IW5/aitype/enemy_africa_militia_shgn.gscbin new file mode 100644 index 00000000..407c31da Binary files /dev/null and b/data/IW5/aitype/enemy_africa_militia_shgn.gscbin differ diff --git a/data/IW5/aitype/enemy_africa_militia_smg.gscbin b/data/IW5/aitype/enemy_africa_militia_smg.gscbin new file mode 100644 index 00000000..711ccd1a Binary files /dev/null and b/data/IW5/aitype/enemy_africa_militia_smg.gscbin differ diff --git a/data/IW5/aitype/enemy_africa_militia_smg_elite.gscbin b/data/IW5/aitype/enemy_africa_militia_smg_elite.gscbin new file mode 100644 index 00000000..a0c01927 Binary files /dev/null and b/data/IW5/aitype/enemy_africa_militia_smg_elite.gscbin differ diff --git a/data/IW5/aitype/enemy_africa_militia_stabbed.gscbin b/data/IW5/aitype/enemy_africa_militia_stabbed.gscbin new file mode 100644 index 00000000..4211bdcc Binary files /dev/null and b/data/IW5/aitype/enemy_africa_militia_stabbed.gscbin differ diff --git a/data/IW5/aitype/enemy_docks_gasmask_smg.gscbin b/data/IW5/aitype/enemy_docks_gasmask_smg.gscbin new file mode 100644 index 00000000..be16ba8b Binary files /dev/null and b/data/IW5/aitype/enemy_docks_gasmask_smg.gscbin differ diff --git a/data/IW5/aitype/enemy_docks_rpg.gscbin b/data/IW5/aitype/enemy_docks_rpg.gscbin new file mode 100644 index 00000000..f24e6021 Binary files /dev/null and b/data/IW5/aitype/enemy_docks_rpg.gscbin differ diff --git a/data/IW5/aitype/enemy_docks_shtgn.gscbin b/data/IW5/aitype/enemy_docks_shtgn.gscbin new file mode 100644 index 00000000..8a24477b Binary files /dev/null and b/data/IW5/aitype/enemy_docks_shtgn.gscbin differ diff --git a/data/IW5/aitype/enemy_docks_smg.gscbin b/data/IW5/aitype/enemy_docks_smg.gscbin new file mode 100644 index 00000000..ffff36f6 Binary files /dev/null and b/data/IW5/aitype/enemy_docks_smg.gscbin differ diff --git a/data/IW5/aitype/enemy_docks_smgsd.gscbin b/data/IW5/aitype/enemy_docks_smgsd.gscbin new file mode 100644 index 00000000..5d3bc7c4 Binary files /dev/null and b/data/IW5/aitype/enemy_docks_smgsd.gscbin differ diff --git a/data/IW5/aitype/enemy_dog.gscbin b/data/IW5/aitype/enemy_dog.gscbin new file mode 100644 index 00000000..805821d2 Binary files /dev/null and b/data/IW5/aitype/enemy_dog.gscbin differ diff --git a/data/IW5/aitype/enemy_dog_hyena.gscbin b/data/IW5/aitype/enemy_dog_hyena.gscbin new file mode 100644 index 00000000..84e90105 Binary files /dev/null and b/data/IW5/aitype/enemy_dog_hyena.gscbin differ diff --git a/data/IW5/aitype/enemy_hijacker_ak74u.gscbin b/data/IW5/aitype/enemy_hijacker_ak74u.gscbin new file mode 100644 index 00000000..41b06844 Binary files /dev/null and b/data/IW5/aitype/enemy_hijacker_ak74u.gscbin differ diff --git a/data/IW5/aitype/enemy_hijacker_ar.gscbin b/data/IW5/aitype/enemy_hijacker_ar.gscbin new file mode 100644 index 00000000..b6dc1dea Binary files /dev/null and b/data/IW5/aitype/enemy_hijacker_ar.gscbin differ diff --git a/data/IW5/aitype/enemy_hijacker_shgn.gscbin b/data/IW5/aitype/enemy_hijacker_shgn.gscbin new file mode 100644 index 00000000..7de17aad Binary files /dev/null and b/data/IW5/aitype/enemy_hijacker_shgn.gscbin differ diff --git a/data/IW5/aitype/enemy_juggernaut_bfg.gscbin b/data/IW5/aitype/enemy_juggernaut_bfg.gscbin new file mode 100644 index 00000000..20197fb9 Binary files /dev/null and b/data/IW5/aitype/enemy_juggernaut_bfg.gscbin differ diff --git a/data/IW5/aitype/enemy_juggernaut_explosive.gscbin b/data/IW5/aitype/enemy_juggernaut_explosive.gscbin new file mode 100644 index 00000000..6b5aead2 Binary files /dev/null and b/data/IW5/aitype/enemy_juggernaut_explosive.gscbin differ diff --git a/data/IW5/aitype/enemy_juggernaut_headshot.gscbin b/data/IW5/aitype/enemy_juggernaut_headshot.gscbin new file mode 100644 index 00000000..2ce38b81 Binary files /dev/null and b/data/IW5/aitype/enemy_juggernaut_headshot.gscbin differ diff --git a/data/IW5/aitype/enemy_juggernaut_riotshield.gscbin b/data/IW5/aitype/enemy_juggernaut_riotshield.gscbin new file mode 100644 index 00000000..f4fbed1a Binary files /dev/null and b/data/IW5/aitype/enemy_juggernaut_riotshield.gscbin differ diff --git a/data/IW5/aitype/enemy_juggernaut_so_survival.gscbin b/data/IW5/aitype/enemy_juggernaut_so_survival.gscbin new file mode 100644 index 00000000..7ee76e58 Binary files /dev/null and b/data/IW5/aitype/enemy_juggernaut_so_survival.gscbin differ diff --git a/data/IW5/aitype/enemy_merc_ar_ak74u.gscbin b/data/IW5/aitype/enemy_merc_ar_ak74u.gscbin new file mode 100644 index 00000000..f90dc6fb Binary files /dev/null and b/data/IW5/aitype/enemy_merc_ar_ak74u.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_berlin_ak47.gscbin b/data/IW5/aitype/enemy_opforce_berlin_ak47.gscbin new file mode 100644 index 00000000..3b9c5cdc Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_berlin_ak47.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_berlin_dusty_ak47.gscbin b/data/IW5/aitype/enemy_opforce_berlin_dusty_ak47.gscbin new file mode 100644 index 00000000..0e6d646e Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_berlin_dusty_ak47.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_berlin_dusty_shtgn.gscbin b/data/IW5/aitype/enemy_opforce_berlin_dusty_shtgn.gscbin new file mode 100644 index 00000000..522a8719 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_berlin_dusty_shtgn.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_berlin_lmg.gscbin b/data/IW5/aitype/enemy_opforce_berlin_lmg.gscbin new file mode 100644 index 00000000..366fe68b Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_berlin_lmg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_berlin_p90.gscbin b/data/IW5/aitype/enemy_opforce_berlin_p90.gscbin new file mode 100644 index 00000000..3614968e Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_berlin_p90.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_berlin_rpg.gscbin b/data/IW5/aitype/enemy_opforce_berlin_rpg.gscbin new file mode 100644 index 00000000..51d4a7c6 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_berlin_rpg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_berlin_shtgn.gscbin b/data/IW5/aitype/enemy_opforce_berlin_shtgn.gscbin new file mode 100644 index 00000000..290bfbac Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_berlin_shtgn.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_castle_ar.gscbin b/data/IW5/aitype/enemy_opforce_castle_ar.gscbin new file mode 100644 index 00000000..f96d24d7 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_castle_ar.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_castle_lmg.gscbin b/data/IW5/aitype/enemy_opforce_castle_lmg.gscbin new file mode 100644 index 00000000..959f8c47 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_castle_lmg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_castle_rpg.gscbin b/data/IW5/aitype/enemy_opforce_castle_rpg.gscbin new file mode 100644 index 00000000..08c1312e Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_castle_rpg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_castle_shotgun.gscbin b/data/IW5/aitype/enemy_opforce_castle_shotgun.gscbin new file mode 100644 index 00000000..c5e7d06c Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_castle_shotgun.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_castle_silenced_ar.gscbin b/data/IW5/aitype/enemy_opforce_castle_silenced_ar.gscbin new file mode 100644 index 00000000..514ef77f Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_castle_silenced_ar.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_castle_silenced_smg.gscbin b/data/IW5/aitype/enemy_opforce_castle_silenced_smg.gscbin new file mode 100644 index 00000000..94f7048c Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_castle_silenced_smg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_castle_smg.gscbin b/data/IW5/aitype/enemy_opforce_castle_smg.gscbin new file mode 100644 index 00000000..01f9e6cf Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_castle_smg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_castle_sniper.gscbin b/data/IW5/aitype/enemy_opforce_castle_sniper.gscbin new file mode 100644 index 00000000..d2c3e708 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_castle_sniper.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_dubai_ak47.gscbin b/data/IW5/aitype/enemy_opforce_dubai_ak47.gscbin new file mode 100644 index 00000000..c6cda11b Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_dubai_ak47.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_dubai_lmg.gscbin b/data/IW5/aitype/enemy_opforce_dubai_lmg.gscbin new file mode 100644 index 00000000..6da3202f Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_dubai_lmg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_dubai_notelite_ak47.gscbin b/data/IW5/aitype/enemy_opforce_dubai_notelite_ak47.gscbin new file mode 100644 index 00000000..bcd3969a Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_dubai_notelite_ak47.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_dubai_p90.gscbin b/data/IW5/aitype/enemy_opforce_dubai_p90.gscbin new file mode 100644 index 00000000..ffe86bb9 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_dubai_p90.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_dubai_rpg.gscbin b/data/IW5/aitype/enemy_opforce_dubai_rpg.gscbin new file mode 100644 index 00000000..a212be2e Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_dubai_rpg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_dubai_shotgun.gscbin b/data/IW5/aitype/enemy_opforce_dubai_shotgun.gscbin new file mode 100644 index 00000000..f3c02cad Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_dubai_shotgun.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_germany_ar.gscbin b/data/IW5/aitype/enemy_opforce_germany_ar.gscbin new file mode 100644 index 00000000..5c7abf34 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_germany_ar.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_germany_rpg.gscbin b/data/IW5/aitype/enemy_opforce_germany_rpg.gscbin new file mode 100644 index 00000000..a7d8c101 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_germany_rpg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_germany_smg.gscbin b/data/IW5/aitype/enemy_opforce_germany_smg.gscbin new file mode 100644 index 00000000..73d1efdb Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_germany_smg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_henchmen_ak47.gscbin b/data/IW5/aitype/enemy_opforce_henchmen_ak47.gscbin new file mode 100644 index 00000000..95295f6c Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_henchmen_ak47.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_india_ak47.gscbin b/data/IW5/aitype/enemy_opforce_india_ak47.gscbin new file mode 100644 index 00000000..e977e86e Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_india_ak47.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_india_lmg.gscbin b/data/IW5/aitype/enemy_opforce_india_lmg.gscbin new file mode 100644 index 00000000..83771656 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_india_lmg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_india_p90.gscbin b/data/IW5/aitype/enemy_opforce_india_p90.gscbin new file mode 100644 index 00000000..21df3644 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_india_p90.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_india_rpg.gscbin b/data/IW5/aitype/enemy_opforce_india_rpg.gscbin new file mode 100644 index 00000000..a57673ee Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_india_rpg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_india_shotgun.gscbin b/data/IW5/aitype/enemy_opforce_india_shotgun.gscbin new file mode 100644 index 00000000..19473987 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_india_shotgun.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_manhattan_ak47.gscbin b/data/IW5/aitype/enemy_opforce_manhattan_ak47.gscbin new file mode 100644 index 00000000..22689506 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_manhattan_ak47.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_manhattan_lmg.gscbin b/data/IW5/aitype/enemy_opforce_manhattan_lmg.gscbin new file mode 100644 index 00000000..4ff22376 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_manhattan_lmg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_manhattan_p90.gscbin b/data/IW5/aitype/enemy_opforce_manhattan_p90.gscbin new file mode 100644 index 00000000..05ac2ac6 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_manhattan_p90.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_manhattan_rpg.gscbin b/data/IW5/aitype/enemy_opforce_manhattan_rpg.gscbin new file mode 100644 index 00000000..69451c47 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_manhattan_rpg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_manhattan_shotgun.gscbin b/data/IW5/aitype/enemy_opforce_manhattan_shotgun.gscbin new file mode 100644 index 00000000..6a2de475 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_manhattan_shotgun.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_paris_ac130_ar.gscbin b/data/IW5/aitype/enemy_opforce_paris_ac130_ar.gscbin new file mode 100644 index 00000000..78a40f11 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_paris_ac130_ar.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_paris_ac130_smg.gscbin b/data/IW5/aitype/enemy_opforce_paris_ac130_smg.gscbin new file mode 100644 index 00000000..13173b62 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_paris_ac130_smg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_paris_ar.gscbin b/data/IW5/aitype/enemy_opforce_paris_ar.gscbin new file mode 100644 index 00000000..cef354ff Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_paris_ar.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_paris_gasmask.gscbin b/data/IW5/aitype/enemy_opforce_paris_gasmask.gscbin new file mode 100644 index 00000000..27e043a3 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_paris_gasmask.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_paris_gasmask_ar.gscbin b/data/IW5/aitype/enemy_opforce_paris_gasmask_ar.gscbin new file mode 100644 index 00000000..76767fcb Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_paris_gasmask_ar.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_paris_gasmask_lmg.gscbin b/data/IW5/aitype/enemy_opforce_paris_gasmask_lmg.gscbin new file mode 100644 index 00000000..ee021568 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_paris_gasmask_lmg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_paris_gasmask_rpg.gscbin b/data/IW5/aitype/enemy_opforce_paris_gasmask_rpg.gscbin new file mode 100644 index 00000000..690e2fa3 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_paris_gasmask_rpg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_paris_gasmask_smg.gscbin b/data/IW5/aitype/enemy_opforce_paris_gasmask_smg.gscbin new file mode 100644 index 00000000..46b3460b Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_paris_gasmask_smg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_paris_lmg.gscbin b/data/IW5/aitype/enemy_opforce_paris_lmg.gscbin new file mode 100644 index 00000000..1a61fdb2 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_paris_lmg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_paris_rpg.gscbin b/data/IW5/aitype/enemy_opforce_paris_rpg.gscbin new file mode 100644 index 00000000..ffb5a644 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_paris_rpg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_paris_smg.gscbin b/data/IW5/aitype/enemy_opforce_paris_smg.gscbin new file mode 100644 index 00000000..49954d82 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_paris_smg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_prague_ar.gscbin b/data/IW5/aitype/enemy_opforce_prague_ar.gscbin new file mode 100644 index 00000000..2310c2ca Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_prague_ar.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_prague_gasmask.gscbin b/data/IW5/aitype/enemy_opforce_prague_gasmask.gscbin new file mode 100644 index 00000000..2b9cb1bc Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_prague_gasmask.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_prague_lmg.gscbin b/data/IW5/aitype/enemy_opforce_prague_lmg.gscbin new file mode 100644 index 00000000..6e3281b3 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_prague_lmg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_prague_shotgun.gscbin b/data/IW5/aitype/enemy_opforce_prague_shotgun.gscbin new file mode 100644 index 00000000..b0a98921 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_prague_shotgun.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_prague_sniper.gscbin b/data/IW5/aitype/enemy_opforce_prague_sniper.gscbin new file mode 100644 index 00000000..f1633dc5 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_prague_sniper.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_rescue_ar.gscbin b/data/IW5/aitype/enemy_opforce_rescue_ar.gscbin new file mode 100644 index 00000000..cc1a54ab Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_rescue_ar.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_rescue_lmg.gscbin b/data/IW5/aitype/enemy_opforce_rescue_lmg.gscbin new file mode 100644 index 00000000..e8f33d3d Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_rescue_lmg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_rescue_rpg.gscbin b/data/IW5/aitype/enemy_opforce_rescue_rpg.gscbin new file mode 100644 index 00000000..a64d6af4 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_rescue_rpg.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_rescue_shotgun.gscbin b/data/IW5/aitype/enemy_opforce_rescue_shotgun.gscbin new file mode 100644 index 00000000..35abd677 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_rescue_shotgun.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_widowmaker_shtgn.gscbin b/data/IW5/aitype/enemy_opforce_widowmaker_shtgn.gscbin new file mode 100644 index 00000000..a6c5b1a8 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_widowmaker_shtgn.gscbin differ diff --git a/data/IW5/aitype/enemy_opforce_widowmaker_smg.gscbin b/data/IW5/aitype/enemy_opforce_widowmaker_smg.gscbin new file mode 100644 index 00000000..c16d0fa8 Binary files /dev/null and b/data/IW5/aitype/enemy_opforce_widowmaker_smg.gscbin differ diff --git a/data/IW5/aitype/enemy_so_chemical.gscbin b/data/IW5/aitype/enemy_so_chemical.gscbin new file mode 100644 index 00000000..b85d2561 Binary files /dev/null and b/data/IW5/aitype/enemy_so_chemical.gscbin differ diff --git a/data/IW5/aitype/enemy_so_claymore.gscbin b/data/IW5/aitype/enemy_so_claymore.gscbin new file mode 100644 index 00000000..74dbbc3e Binary files /dev/null and b/data/IW5/aitype/enemy_so_claymore.gscbin differ diff --git a/data/IW5/aitype/enemy_so_easy.gscbin b/data/IW5/aitype/enemy_so_easy.gscbin new file mode 100644 index 00000000..eb4da47c Binary files /dev/null and b/data/IW5/aitype/enemy_so_easy.gscbin differ diff --git a/data/IW5/aitype/enemy_so_easy_v2.gscbin b/data/IW5/aitype/enemy_so_easy_v2.gscbin new file mode 100644 index 00000000..f8518d32 Binary files /dev/null and b/data/IW5/aitype/enemy_so_easy_v2.gscbin differ diff --git a/data/IW5/aitype/enemy_so_elite.gscbin b/data/IW5/aitype/enemy_so_elite.gscbin new file mode 100644 index 00000000..199929e4 Binary files /dev/null and b/data/IW5/aitype/enemy_so_elite.gscbin differ diff --git a/data/IW5/aitype/enemy_so_hardened.gscbin b/data/IW5/aitype/enemy_so_hardened.gscbin new file mode 100644 index 00000000..89b302cd Binary files /dev/null and b/data/IW5/aitype/enemy_so_hardened.gscbin differ diff --git a/data/IW5/aitype/enemy_so_martyrdom.gscbin b/data/IW5/aitype/enemy_so_martyrdom.gscbin new file mode 100644 index 00000000..50058b25 Binary files /dev/null and b/data/IW5/aitype/enemy_so_martyrdom.gscbin differ diff --git a/data/IW5/aitype/enemy_so_regular.gscbin b/data/IW5/aitype/enemy_so_regular.gscbin new file mode 100644 index 00000000..6d7a3173 Binary files /dev/null and b/data/IW5/aitype/enemy_so_regular.gscbin differ diff --git a/data/IW5/aitype/enemy_so_veteran.gscbin b/data/IW5/aitype/enemy_so_veteran.gscbin new file mode 100644 index 00000000..b3382f6b Binary files /dev/null and b/data/IW5/aitype/enemy_so_veteran.gscbin differ diff --git a/data/IW5/aitype/enemy_villain_makarov_dubai.gscbin b/data/IW5/aitype/enemy_villain_makarov_dubai.gscbin new file mode 100644 index 00000000..8192791a Binary files /dev/null and b/data/IW5/aitype/enemy_villain_makarov_dubai.gscbin differ diff --git a/data/IW5/aitype/enemy_villain_makarov_dubai_pip.gscbin b/data/IW5/aitype/enemy_villain_makarov_dubai_pip.gscbin new file mode 100644 index 00000000..cc63cf8f Binary files /dev/null and b/data/IW5/aitype/enemy_villain_makarov_dubai_pip.gscbin differ diff --git a/data/IW5/aitype/enemy_villain_makarov_hijack.gscbin b/data/IW5/aitype/enemy_villain_makarov_hijack.gscbin new file mode 100644 index 00000000..eef1b409 Binary files /dev/null and b/data/IW5/aitype/enemy_villain_makarov_hijack.gscbin differ diff --git a/data/IW5/aitype/enemy_villain_makarov_oneshotonekill.gscbin b/data/IW5/aitype/enemy_villain_makarov_oneshotonekill.gscbin new file mode 100644 index 00000000..f90e067e Binary files /dev/null and b/data/IW5/aitype/enemy_villain_makarov_oneshotonekill.gscbin differ diff --git a/data/IW5/aitype/enemy_villain_makarov_shockandawe.gscbin b/data/IW5/aitype/enemy_villain_makarov_shockandawe.gscbin new file mode 100644 index 00000000..0b2fe056 Binary files /dev/null and b/data/IW5/aitype/enemy_villain_makarov_shockandawe.gscbin differ diff --git a/data/IW5/aitype/enemy_villain_volk.gscbin b/data/IW5/aitype/enemy_villain_volk.gscbin new file mode 100644 index 00000000..66f62216 Binary files /dev/null and b/data/IW5/aitype/enemy_villain_volk.gscbin differ diff --git a/data/IW5/aitype/enemy_villain_warlord.gscbin b/data/IW5/aitype/enemy_villain_warlord.gscbin new file mode 100644 index 00000000..172edde0 Binary files /dev/null and b/data/IW5/aitype/enemy_villain_warlord.gscbin differ diff --git a/data/IW5/aitype/enemy_villain_widowmaker_captain.gscbin b/data/IW5/aitype/enemy_villain_widowmaker_captain.gscbin new file mode 100644 index 00000000..da202d9e Binary files /dev/null and b/data/IW5/aitype/enemy_villain_widowmaker_captain.gscbin differ diff --git a/data/IW5/aitype/enemy_villian_kruger.gscbin b/data/IW5/aitype/enemy_villian_kruger.gscbin new file mode 100644 index 00000000..09f6c7f4 Binary files /dev/null and b/data/IW5/aitype/enemy_villian_kruger.gscbin differ diff --git a/data/IW5/aitype/enemy_villian_zakhaev.gscbin b/data/IW5/aitype/enemy_villian_zakhaev.gscbin new file mode 100644 index 00000000..d92838f0 Binary files /dev/null and b/data/IW5/aitype/enemy_villian_zakhaev.gscbin differ diff --git a/data/IW5/animscripts/animmode.gscbin b/data/IW5/animscripts/animmode.gscbin new file mode 100644 index 00000000..3c88f819 Binary files /dev/null and b/data/IW5/animscripts/animmode.gscbin differ diff --git a/data/IW5/animscripts/animset.gscbin b/data/IW5/animscripts/animset.gscbin new file mode 100644 index 00000000..c6b14ff0 Binary files /dev/null and b/data/IW5/animscripts/animset.gscbin differ diff --git a/data/IW5/animscripts/atv.gscbin b/data/IW5/animscripts/atv.gscbin new file mode 100644 index 00000000..8ee8022f Binary files /dev/null and b/data/IW5/animscripts/atv.gscbin differ diff --git a/data/IW5/animscripts/battlechatter.gscbin b/data/IW5/animscripts/battlechatter.gscbin new file mode 100644 index 00000000..91a30889 Binary files /dev/null and b/data/IW5/animscripts/battlechatter.gscbin differ diff --git a/data/IW5/animscripts/battlechatter_ai.gscbin b/data/IW5/animscripts/battlechatter_ai.gscbin new file mode 100644 index 00000000..8c761f89 Binary files /dev/null and b/data/IW5/animscripts/battlechatter_ai.gscbin differ diff --git a/data/IW5/animscripts/civilian.gscbin b/data/IW5/animscripts/civilian.gscbin new file mode 100644 index 00000000..a66dc9ca Binary files /dev/null and b/data/IW5/animscripts/civilian.gscbin differ diff --git a/data/IW5/animscripts/civilian/civilian_combat.gscbin b/data/IW5/animscripts/civilian/civilian_combat.gscbin new file mode 100644 index 00000000..3a5a9503 Binary files /dev/null and b/data/IW5/animscripts/civilian/civilian_combat.gscbin differ diff --git a/data/IW5/animscripts/civilian/civilian_cover_arrival.gscbin b/data/IW5/animscripts/civilian/civilian_cover_arrival.gscbin new file mode 100644 index 00000000..7005cfa3 Binary files /dev/null and b/data/IW5/animscripts/civilian/civilian_cover_arrival.gscbin differ diff --git a/data/IW5/animscripts/civilian/civilian_cover_crouch.gscbin b/data/IW5/animscripts/civilian/civilian_cover_crouch.gscbin new file mode 100644 index 00000000..8da50034 Binary files /dev/null and b/data/IW5/animscripts/civilian/civilian_cover_crouch.gscbin differ diff --git a/data/IW5/animscripts/civilian/civilian_cover_left.gscbin b/data/IW5/animscripts/civilian/civilian_cover_left.gscbin new file mode 100644 index 00000000..1371eac4 Binary files /dev/null and b/data/IW5/animscripts/civilian/civilian_cover_left.gscbin differ diff --git a/data/IW5/animscripts/civilian/civilian_cover_prone.gscbin b/data/IW5/animscripts/civilian/civilian_cover_prone.gscbin new file mode 100644 index 00000000..e5eefc9d Binary files /dev/null and b/data/IW5/animscripts/civilian/civilian_cover_prone.gscbin differ diff --git a/data/IW5/animscripts/civilian/civilian_cover_right.gscbin b/data/IW5/animscripts/civilian/civilian_cover_right.gscbin new file mode 100644 index 00000000..d077a846 Binary files /dev/null and b/data/IW5/animscripts/civilian/civilian_cover_right.gscbin differ diff --git a/data/IW5/animscripts/civilian/civilian_cover_stand.gscbin b/data/IW5/animscripts/civilian/civilian_cover_stand.gscbin new file mode 100644 index 00000000..06d79661 Binary files /dev/null and b/data/IW5/animscripts/civilian/civilian_cover_stand.gscbin differ diff --git a/data/IW5/animscripts/civilian/civilian_death.gscbin b/data/IW5/animscripts/civilian/civilian_death.gscbin new file mode 100644 index 00000000..a29450ca Binary files /dev/null and b/data/IW5/animscripts/civilian/civilian_death.gscbin differ diff --git a/data/IW5/animscripts/civilian/civilian_flashed.gscbin b/data/IW5/animscripts/civilian/civilian_flashed.gscbin new file mode 100644 index 00000000..9ba6b0ca Binary files /dev/null and b/data/IW5/animscripts/civilian/civilian_flashed.gscbin differ diff --git a/data/IW5/animscripts/civilian/civilian_grenade_response.gscbin b/data/IW5/animscripts/civilian/civilian_grenade_response.gscbin new file mode 100644 index 00000000..90d59285 Binary files /dev/null and b/data/IW5/animscripts/civilian/civilian_grenade_response.gscbin differ diff --git a/data/IW5/animscripts/civilian/civilian_init.gscbin b/data/IW5/animscripts/civilian/civilian_init.gscbin new file mode 100644 index 00000000..54f1e98e Binary files /dev/null and b/data/IW5/animscripts/civilian/civilian_init.gscbin differ diff --git a/data/IW5/animscripts/civilian/civilian_move.gscbin b/data/IW5/animscripts/civilian/civilian_move.gscbin new file mode 100644 index 00000000..9a421106 Binary files /dev/null and b/data/IW5/animscripts/civilian/civilian_move.gscbin differ diff --git a/data/IW5/animscripts/civilian/civilian_pain.gscbin b/data/IW5/animscripts/civilian/civilian_pain.gscbin new file mode 100644 index 00000000..9fe8948e Binary files /dev/null and b/data/IW5/animscripts/civilian/civilian_pain.gscbin differ diff --git a/data/IW5/animscripts/civilian/civilian_reactions.gscbin b/data/IW5/animscripts/civilian/civilian_reactions.gscbin new file mode 100644 index 00000000..8f5d9980 Binary files /dev/null and b/data/IW5/animscripts/civilian/civilian_reactions.gscbin differ diff --git a/data/IW5/animscripts/civilian/civilian_scripted.gscbin b/data/IW5/animscripts/civilian/civilian_scripted.gscbin new file mode 100644 index 00000000..8fffab5a Binary files /dev/null and b/data/IW5/animscripts/civilian/civilian_scripted.gscbin differ diff --git a/data/IW5/animscripts/civilian/civilian_stop.gscbin b/data/IW5/animscripts/civilian/civilian_stop.gscbin new file mode 100644 index 00000000..43a8aee6 Binary files /dev/null and b/data/IW5/animscripts/civilian/civilian_stop.gscbin differ diff --git a/data/IW5/animscripts/combat.gscbin b/data/IW5/animscripts/combat.gscbin new file mode 100644 index 00000000..68fa1172 Binary files /dev/null and b/data/IW5/animscripts/combat.gscbin differ diff --git a/data/IW5/animscripts/combat_say.gscbin b/data/IW5/animscripts/combat_say.gscbin new file mode 100644 index 00000000..e97e9133 Binary files /dev/null and b/data/IW5/animscripts/combat_say.gscbin differ diff --git a/data/IW5/animscripts/combat_utility.gscbin b/data/IW5/animscripts/combat_utility.gscbin new file mode 100644 index 00000000..3e58f970 Binary files /dev/null and b/data/IW5/animscripts/combat_utility.gscbin differ diff --git a/data/IW5/animscripts/corner.gscbin b/data/IW5/animscripts/corner.gscbin new file mode 100644 index 00000000..4851c4b5 Binary files /dev/null and b/data/IW5/animscripts/corner.gscbin differ diff --git a/data/IW5/animscripts/cover_arrival.gscbin b/data/IW5/animscripts/cover_arrival.gscbin new file mode 100644 index 00000000..7447d37e Binary files /dev/null and b/data/IW5/animscripts/cover_arrival.gscbin differ diff --git a/data/IW5/animscripts/cover_behavior.gscbin b/data/IW5/animscripts/cover_behavior.gscbin new file mode 100644 index 00000000..8851a8a0 Binary files /dev/null and b/data/IW5/animscripts/cover_behavior.gscbin differ diff --git a/data/IW5/animscripts/cover_crouch.gscbin b/data/IW5/animscripts/cover_crouch.gscbin new file mode 100644 index 00000000..966544ac Binary files /dev/null and b/data/IW5/animscripts/cover_crouch.gscbin differ diff --git a/data/IW5/animscripts/cover_left.gscbin b/data/IW5/animscripts/cover_left.gscbin new file mode 100644 index 00000000..ee30c46c Binary files /dev/null and b/data/IW5/animscripts/cover_left.gscbin differ diff --git a/data/IW5/animscripts/cover_prone.gscbin b/data/IW5/animscripts/cover_prone.gscbin new file mode 100644 index 00000000..1fb08f13 Binary files /dev/null and b/data/IW5/animscripts/cover_prone.gscbin differ diff --git a/data/IW5/animscripts/cover_right.gscbin b/data/IW5/animscripts/cover_right.gscbin new file mode 100644 index 00000000..d33ad158 Binary files /dev/null and b/data/IW5/animscripts/cover_right.gscbin differ diff --git a/data/IW5/animscripts/cover_stand.gscbin b/data/IW5/animscripts/cover_stand.gscbin new file mode 100644 index 00000000..91710dcb Binary files /dev/null and b/data/IW5/animscripts/cover_stand.gscbin differ diff --git a/data/IW5/animscripts/cover_wall.gscbin b/data/IW5/animscripts/cover_wall.gscbin new file mode 100644 index 00000000..9644148c Binary files /dev/null and b/data/IW5/animscripts/cover_wall.gscbin differ diff --git a/data/IW5/animscripts/cqb.gscbin b/data/IW5/animscripts/cqb.gscbin new file mode 100644 index 00000000..98f66d64 Binary files /dev/null and b/data/IW5/animscripts/cqb.gscbin differ diff --git a/data/IW5/animscripts/death.gscbin b/data/IW5/animscripts/death.gscbin new file mode 100644 index 00000000..0160619b Binary files /dev/null and b/data/IW5/animscripts/death.gscbin differ diff --git a/data/IW5/animscripts/dog/dog_combat.gscbin b/data/IW5/animscripts/dog/dog_combat.gscbin new file mode 100644 index 00000000..1cab7242 Binary files /dev/null and b/data/IW5/animscripts/dog/dog_combat.gscbin differ diff --git a/data/IW5/animscripts/dog/dog_death.gscbin b/data/IW5/animscripts/dog/dog_death.gscbin new file mode 100644 index 00000000..a0c68759 Binary files /dev/null and b/data/IW5/animscripts/dog/dog_death.gscbin differ diff --git a/data/IW5/animscripts/dog/dog_flashed.gscbin b/data/IW5/animscripts/dog/dog_flashed.gscbin new file mode 100644 index 00000000..6ef47e95 Binary files /dev/null and b/data/IW5/animscripts/dog/dog_flashed.gscbin differ diff --git a/data/IW5/animscripts/dog/dog_init.gscbin b/data/IW5/animscripts/dog/dog_init.gscbin new file mode 100644 index 00000000..01a3e584 Binary files /dev/null and b/data/IW5/animscripts/dog/dog_init.gscbin differ diff --git a/data/IW5/animscripts/dog/dog_move.gscbin b/data/IW5/animscripts/dog/dog_move.gscbin new file mode 100644 index 00000000..7df4cfb0 Binary files /dev/null and b/data/IW5/animscripts/dog/dog_move.gscbin differ diff --git a/data/IW5/animscripts/dog/dog_pain.gscbin b/data/IW5/animscripts/dog/dog_pain.gscbin new file mode 100644 index 00000000..bf4d1f56 Binary files /dev/null and b/data/IW5/animscripts/dog/dog_pain.gscbin differ diff --git a/data/IW5/animscripts/dog/dog_reactions.gscbin b/data/IW5/animscripts/dog/dog_reactions.gscbin new file mode 100644 index 00000000..14ea91e9 Binary files /dev/null and b/data/IW5/animscripts/dog/dog_reactions.gscbin differ diff --git a/data/IW5/animscripts/dog/dog_scripted.gscbin b/data/IW5/animscripts/dog/dog_scripted.gscbin new file mode 100644 index 00000000..557f23ba Binary files /dev/null and b/data/IW5/animscripts/dog/dog_scripted.gscbin differ diff --git a/data/IW5/animscripts/dog/dog_stop.gscbin b/data/IW5/animscripts/dog/dog_stop.gscbin new file mode 100644 index 00000000..7732543a Binary files /dev/null and b/data/IW5/animscripts/dog/dog_stop.gscbin differ diff --git a/data/IW5/animscripts/door.gscbin b/data/IW5/animscripts/door.gscbin new file mode 100644 index 00000000..07bb65c6 Binary files /dev/null and b/data/IW5/animscripts/door.gscbin differ diff --git a/data/IW5/animscripts/face.gscbin b/data/IW5/animscripts/face.gscbin new file mode 100644 index 00000000..f2c35955 Binary files /dev/null and b/data/IW5/animscripts/face.gscbin differ diff --git a/data/IW5/animscripts/first_frame.gscbin b/data/IW5/animscripts/first_frame.gscbin new file mode 100644 index 00000000..88999cda Binary files /dev/null and b/data/IW5/animscripts/first_frame.gscbin differ diff --git a/data/IW5/animscripts/flashed.gscbin b/data/IW5/animscripts/flashed.gscbin new file mode 100644 index 00000000..516b1dd3 Binary files /dev/null and b/data/IW5/animscripts/flashed.gscbin differ diff --git a/data/IW5/animscripts/grenade_cower.gscbin b/data/IW5/animscripts/grenade_cower.gscbin new file mode 100644 index 00000000..633bc067 Binary files /dev/null and b/data/IW5/animscripts/grenade_cower.gscbin differ diff --git a/data/IW5/animscripts/grenade_return_throw.gscbin b/data/IW5/animscripts/grenade_return_throw.gscbin new file mode 100644 index 00000000..29c831b1 Binary files /dev/null and b/data/IW5/animscripts/grenade_return_throw.gscbin differ diff --git a/data/IW5/animscripts/hummer_turret/common.gscbin b/data/IW5/animscripts/hummer_turret/common.gscbin new file mode 100644 index 00000000..57254148 Binary files /dev/null and b/data/IW5/animscripts/hummer_turret/common.gscbin differ diff --git a/data/IW5/animscripts/hummer_turret/dshk_stand.gscbin b/data/IW5/animscripts/hummer_turret/dshk_stand.gscbin new file mode 100644 index 00000000..0ee52e6c Binary files /dev/null and b/data/IW5/animscripts/hummer_turret/dshk_stand.gscbin differ diff --git a/data/IW5/animscripts/hummer_turret/minigun_code.gscbin b/data/IW5/animscripts/hummer_turret/minigun_code.gscbin new file mode 100644 index 00000000..dbe6b626 Binary files /dev/null and b/data/IW5/animscripts/hummer_turret/minigun_code.gscbin differ diff --git a/data/IW5/animscripts/init.gscbin b/data/IW5/animscripts/init.gscbin new file mode 100644 index 00000000..20b3f86f Binary files /dev/null and b/data/IW5/animscripts/init.gscbin differ diff --git a/data/IW5/animscripts/init_move_transitions.gscbin b/data/IW5/animscripts/init_move_transitions.gscbin new file mode 100644 index 00000000..58a1de92 Binary files /dev/null and b/data/IW5/animscripts/init_move_transitions.gscbin differ diff --git a/data/IW5/animscripts/melee.gscbin b/data/IW5/animscripts/melee.gscbin new file mode 100644 index 00000000..57b05ff3 Binary files /dev/null and b/data/IW5/animscripts/melee.gscbin differ diff --git a/data/IW5/animscripts/move.gscbin b/data/IW5/animscripts/move.gscbin new file mode 100644 index 00000000..d14d8c06 Binary files /dev/null and b/data/IW5/animscripts/move.gscbin differ diff --git a/data/IW5/animscripts/notetracks.gscbin b/data/IW5/animscripts/notetracks.gscbin new file mode 100644 index 00000000..b4750a86 Binary files /dev/null and b/data/IW5/animscripts/notetracks.gscbin differ diff --git a/data/IW5/animscripts/pain.gscbin b/data/IW5/animscripts/pain.gscbin new file mode 100644 index 00000000..bdcec984 Binary files /dev/null and b/data/IW5/animscripts/pain.gscbin differ diff --git a/data/IW5/animscripts/reactions.gscbin b/data/IW5/animscripts/reactions.gscbin new file mode 100644 index 00000000..c54b0e06 Binary files /dev/null and b/data/IW5/animscripts/reactions.gscbin differ diff --git a/data/IW5/animscripts/riotshield/riotshield.gscbin b/data/IW5/animscripts/riotshield/riotshield.gscbin new file mode 100644 index 00000000..2466d620 Binary files /dev/null and b/data/IW5/animscripts/riotshield/riotshield.gscbin differ diff --git a/data/IW5/animscripts/run.gscbin b/data/IW5/animscripts/run.gscbin new file mode 100644 index 00000000..a32f77fd Binary files /dev/null and b/data/IW5/animscripts/run.gscbin differ diff --git a/data/IW5/animscripts/saw/common.gscbin b/data/IW5/animscripts/saw/common.gscbin new file mode 100644 index 00000000..22af3eba Binary files /dev/null and b/data/IW5/animscripts/saw/common.gscbin differ diff --git a/data/IW5/animscripts/saw/crouch.gscbin b/data/IW5/animscripts/saw/crouch.gscbin new file mode 100644 index 00000000..9abb1d5a Binary files /dev/null and b/data/IW5/animscripts/saw/crouch.gscbin differ diff --git a/data/IW5/animscripts/saw/prone.gscbin b/data/IW5/animscripts/saw/prone.gscbin new file mode 100644 index 00000000..7088ac45 Binary files /dev/null and b/data/IW5/animscripts/saw/prone.gscbin differ diff --git a/data/IW5/animscripts/saw/stand.gscbin b/data/IW5/animscripts/saw/stand.gscbin new file mode 100644 index 00000000..d97801f8 Binary files /dev/null and b/data/IW5/animscripts/saw/stand.gscbin differ diff --git a/data/IW5/animscripts/scripted.gscbin b/data/IW5/animscripts/scripted.gscbin new file mode 100644 index 00000000..2f6a5f33 Binary files /dev/null and b/data/IW5/animscripts/scripted.gscbin differ diff --git a/data/IW5/animscripts/setposemovement.gscbin b/data/IW5/animscripts/setposemovement.gscbin new file mode 100644 index 00000000..a42ab430 Binary files /dev/null and b/data/IW5/animscripts/setposemovement.gscbin differ diff --git a/data/IW5/animscripts/shared.gscbin b/data/IW5/animscripts/shared.gscbin new file mode 100644 index 00000000..6c39b6e7 Binary files /dev/null and b/data/IW5/animscripts/shared.gscbin differ diff --git a/data/IW5/animscripts/shoot_behavior.gscbin b/data/IW5/animscripts/shoot_behavior.gscbin new file mode 100644 index 00000000..5cac38f9 Binary files /dev/null and b/data/IW5/animscripts/shoot_behavior.gscbin differ diff --git a/data/IW5/animscripts/snowmobile.gscbin b/data/IW5/animscripts/snowmobile.gscbin new file mode 100644 index 00000000..ab15a264 Binary files /dev/null and b/data/IW5/animscripts/snowmobile.gscbin differ diff --git a/data/IW5/animscripts/squadmanager.gscbin b/data/IW5/animscripts/squadmanager.gscbin new file mode 100644 index 00000000..98d3cc0a Binary files /dev/null and b/data/IW5/animscripts/squadmanager.gscbin differ diff --git a/data/IW5/animscripts/stop.gscbin b/data/IW5/animscripts/stop.gscbin new file mode 100644 index 00000000..eac7a884 Binary files /dev/null and b/data/IW5/animscripts/stop.gscbin differ diff --git a/data/IW5/animscripts/technical/common.gscbin b/data/IW5/animscripts/technical/common.gscbin new file mode 100644 index 00000000..1ac0e32e Binary files /dev/null and b/data/IW5/animscripts/technical/common.gscbin differ diff --git a/data/IW5/animscripts/technical/stand.gscbin b/data/IW5/animscripts/technical/stand.gscbin new file mode 100644 index 00000000..9f933dd3 Binary files /dev/null and b/data/IW5/animscripts/technical/stand.gscbin differ diff --git a/data/IW5/animscripts/track.gscbin b/data/IW5/animscripts/track.gscbin new file mode 100644 index 00000000..f18df300 Binary files /dev/null and b/data/IW5/animscripts/track.gscbin differ diff --git a/data/IW5/animscripts/traverse/berlin_column_jump.gscbin b/data/IW5/animscripts/traverse/berlin_column_jump.gscbin new file mode 100644 index 00000000..2296f7d8 Binary files /dev/null and b/data/IW5/animscripts/traverse/berlin_column_jump.gscbin differ diff --git a/data/IW5/animscripts/traverse/berlin_jumpdown_28.gscbin b/data/IW5/animscripts/traverse/berlin_jumpdown_28.gscbin new file mode 100644 index 00000000..185cd5a2 Binary files /dev/null and b/data/IW5/animscripts/traverse/berlin_jumpdown_28.gscbin differ diff --git a/data/IW5/animscripts/traverse/crawl.gscbin b/data/IW5/animscripts/traverse/crawl.gscbin new file mode 100644 index 00000000..01dcc401 Binary files /dev/null and b/data/IW5/animscripts/traverse/crawl.gscbin differ diff --git a/data/IW5/animscripts/traverse/crouch_jump_down_40.gscbin b/data/IW5/animscripts/traverse/crouch_jump_down_40.gscbin new file mode 100644 index 00000000..2f0527be Binary files /dev/null and b/data/IW5/animscripts/traverse/crouch_jump_down_40.gscbin differ diff --git a/data/IW5/animscripts/traverse/duck_under_56.gscbin b/data/IW5/animscripts/traverse/duck_under_56.gscbin new file mode 100644 index 00000000..9b49fd0d Binary files /dev/null and b/data/IW5/animscripts/traverse/duck_under_56.gscbin differ diff --git a/data/IW5/animscripts/traverse/fence_climb.gscbin b/data/IW5/animscripts/traverse/fence_climb.gscbin new file mode 100644 index 00000000..c760d530 Binary files /dev/null and b/data/IW5/animscripts/traverse/fence_climb.gscbin differ diff --git a/data/IW5/animscripts/traverse/hjk_tree_hop.gscbin b/data/IW5/animscripts/traverse/hjk_tree_hop.gscbin new file mode 100644 index 00000000..fa7a70aa Binary files /dev/null and b/data/IW5/animscripts/traverse/hjk_tree_hop.gscbin differ diff --git a/data/IW5/animscripts/traverse/jump_across_100.gscbin b/data/IW5/animscripts/traverse/jump_across_100.gscbin new file mode 100644 index 00000000..10534fd2 Binary files /dev/null and b/data/IW5/animscripts/traverse/jump_across_100.gscbin differ diff --git a/data/IW5/animscripts/traverse/jump_across_72.gscbin b/data/IW5/animscripts/traverse/jump_across_72.gscbin new file mode 100644 index 00000000..997e4580 Binary files /dev/null and b/data/IW5/animscripts/traverse/jump_across_72.gscbin differ diff --git a/data/IW5/animscripts/traverse/jump_over_high_wall.gscbin b/data/IW5/animscripts/traverse/jump_over_high_wall.gscbin new file mode 100644 index 00000000..4de83d50 Binary files /dev/null and b/data/IW5/animscripts/traverse/jump_over_high_wall.gscbin differ diff --git a/data/IW5/animscripts/traverse/jump_up_80.gscbin b/data/IW5/animscripts/traverse/jump_up_80.gscbin new file mode 100644 index 00000000..bbf2dcb8 Binary files /dev/null and b/data/IW5/animscripts/traverse/jump_up_80.gscbin differ diff --git a/data/IW5/animscripts/traverse/jumpdown_130.gscbin b/data/IW5/animscripts/traverse/jumpdown_130.gscbin new file mode 100644 index 00000000..64508220 Binary files /dev/null and b/data/IW5/animscripts/traverse/jumpdown_130.gscbin differ diff --git a/data/IW5/animscripts/traverse/jumpdown_40.gscbin b/data/IW5/animscripts/traverse/jumpdown_40.gscbin new file mode 100644 index 00000000..8e6d03a2 Binary files /dev/null and b/data/IW5/animscripts/traverse/jumpdown_40.gscbin differ diff --git a/data/IW5/animscripts/traverse/jumpdown_56.gscbin b/data/IW5/animscripts/traverse/jumpdown_56.gscbin new file mode 100644 index 00000000..41ef63ea Binary files /dev/null and b/data/IW5/animscripts/traverse/jumpdown_56.gscbin differ diff --git a/data/IW5/animscripts/traverse/jumpdown_96.gscbin b/data/IW5/animscripts/traverse/jumpdown_96.gscbin new file mode 100644 index 00000000..af6fc5f9 Binary files /dev/null and b/data/IW5/animscripts/traverse/jumpdown_96.gscbin differ diff --git a/data/IW5/animscripts/traverse/ladder_down.gscbin b/data/IW5/animscripts/traverse/ladder_down.gscbin new file mode 100644 index 00000000..afaaf658 Binary files /dev/null and b/data/IW5/animscripts/traverse/ladder_down.gscbin differ diff --git a/data/IW5/animscripts/traverse/ladder_up.gscbin b/data/IW5/animscripts/traverse/ladder_up.gscbin new file mode 100644 index 00000000..c317a992 Binary files /dev/null and b/data/IW5/animscripts/traverse/ladder_up.gscbin differ diff --git a/data/IW5/animscripts/traverse/london_roof_slide.gscbin b/data/IW5/animscripts/traverse/london_roof_slide.gscbin new file mode 100644 index 00000000..717fdd5e Binary files /dev/null and b/data/IW5/animscripts/traverse/london_roof_slide.gscbin differ diff --git a/data/IW5/animscripts/traverse/shared.gscbin b/data/IW5/animscripts/traverse/shared.gscbin new file mode 100644 index 00000000..67651e8d Binary files /dev/null and b/data/IW5/animscripts/traverse/shared.gscbin differ diff --git a/data/IW5/animscripts/traverse/slide_across_car.gscbin b/data/IW5/animscripts/traverse/slide_across_car.gscbin new file mode 100644 index 00000000..7faaa4d8 Binary files /dev/null and b/data/IW5/animscripts/traverse/slide_across_car.gscbin differ diff --git a/data/IW5/animscripts/traverse/step_down.gscbin b/data/IW5/animscripts/traverse/step_down.gscbin new file mode 100644 index 00000000..ab3712e2 Binary files /dev/null and b/data/IW5/animscripts/traverse/step_down.gscbin differ diff --git a/data/IW5/animscripts/traverse/step_up.gscbin b/data/IW5/animscripts/traverse/step_up.gscbin new file mode 100644 index 00000000..701c82cc Binary files /dev/null and b/data/IW5/animscripts/traverse/step_up.gscbin differ diff --git a/data/IW5/animscripts/traverse/step_up_12.gscbin b/data/IW5/animscripts/traverse/step_up_12.gscbin new file mode 100644 index 00000000..e82ca63c Binary files /dev/null and b/data/IW5/animscripts/traverse/step_up_12.gscbin differ diff --git a/data/IW5/animscripts/traverse/step_up_32.gscbin b/data/IW5/animscripts/traverse/step_up_32.gscbin new file mode 100644 index 00000000..84604b44 Binary files /dev/null and b/data/IW5/animscripts/traverse/step_up_32.gscbin differ diff --git a/data/IW5/animscripts/traverse/stepup_52.gscbin b/data/IW5/animscripts/traverse/stepup_52.gscbin new file mode 100644 index 00000000..a366bae6 Binary files /dev/null and b/data/IW5/animscripts/traverse/stepup_52.gscbin differ diff --git a/data/IW5/animscripts/traverse/stepup_52_fast.gscbin b/data/IW5/animscripts/traverse/stepup_52_fast.gscbin new file mode 100644 index 00000000..9b32a7de Binary files /dev/null and b/data/IW5/animscripts/traverse/stepup_52_fast.gscbin differ diff --git a/data/IW5/animscripts/traverse/trench_jump_out.gscbin b/data/IW5/animscripts/traverse/trench_jump_out.gscbin new file mode 100644 index 00000000..969d4ad8 Binary files /dev/null and b/data/IW5/animscripts/traverse/trench_jump_out.gscbin differ diff --git a/data/IW5/animscripts/traverse/trench_jumpout.gscbin b/data/IW5/animscripts/traverse/trench_jumpout.gscbin new file mode 100644 index 00000000..a200ed59 Binary files /dev/null and b/data/IW5/animscripts/traverse/trench_jumpout.gscbin differ diff --git a/data/IW5/animscripts/traverse/wall_climb_90.gscbin b/data/IW5/animscripts/traverse/wall_climb_90.gscbin new file mode 100644 index 00000000..3e565a5f Binary files /dev/null and b/data/IW5/animscripts/traverse/wall_climb_90.gscbin differ diff --git a/data/IW5/animscripts/traverse/wall_dive.gscbin b/data/IW5/animscripts/traverse/wall_dive.gscbin new file mode 100644 index 00000000..c3fe22cb Binary files /dev/null and b/data/IW5/animscripts/traverse/wall_dive.gscbin differ diff --git a/data/IW5/animscripts/traverse/wall_hop.gscbin b/data/IW5/animscripts/traverse/wall_hop.gscbin new file mode 100644 index 00000000..ea169df5 Binary files /dev/null and b/data/IW5/animscripts/traverse/wall_hop.gscbin differ diff --git a/data/IW5/animscripts/traverse/wall_over_40.gscbin b/data/IW5/animscripts/traverse/wall_over_40.gscbin new file mode 100644 index 00000000..75473680 Binary files /dev/null and b/data/IW5/animscripts/traverse/wall_over_40.gscbin differ diff --git a/data/IW5/animscripts/traverse/wall_over_40_turnr_90.gscbin b/data/IW5/animscripts/traverse/wall_over_40_turnr_90.gscbin new file mode 100644 index 00000000..0a51c534 Binary files /dev/null and b/data/IW5/animscripts/traverse/wall_over_40_turnr_90.gscbin differ diff --git a/data/IW5/animscripts/traverse/wall_over_96.gscbin b/data/IW5/animscripts/traverse/wall_over_96.gscbin new file mode 100644 index 00000000..cf43de0d Binary files /dev/null and b/data/IW5/animscripts/traverse/wall_over_96.gscbin differ diff --git a/data/IW5/animscripts/traverse/window.gscbin b/data/IW5/animscripts/traverse/window.gscbin new file mode 100644 index 00000000..c2130867 Binary files /dev/null and b/data/IW5/animscripts/traverse/window.gscbin differ diff --git a/data/IW5/animscripts/traverse/window_2.gscbin b/data/IW5/animscripts/traverse/window_2.gscbin new file mode 100644 index 00000000..79796790 Binary files /dev/null and b/data/IW5/animscripts/traverse/window_2.gscbin differ diff --git a/data/IW5/animscripts/traverse/window_divethrough_36.gscbin b/data/IW5/animscripts/traverse/window_divethrough_36.gscbin new file mode 100644 index 00000000..876ee489 Binary files /dev/null and b/data/IW5/animscripts/traverse/window_divethrough_36.gscbin differ diff --git a/data/IW5/animscripts/traverse/window_down.gscbin b/data/IW5/animscripts/traverse/window_down.gscbin new file mode 100644 index 00000000..d6bbc43e Binary files /dev/null and b/data/IW5/animscripts/traverse/window_down.gscbin differ diff --git a/data/IW5/animscripts/traverse/window_over_40.gscbin b/data/IW5/animscripts/traverse/window_over_40.gscbin new file mode 100644 index 00000000..68c6463c Binary files /dev/null and b/data/IW5/animscripts/traverse/window_over_40.gscbin differ diff --git a/data/IW5/animscripts/traverse/window_over_quick.gscbin b/data/IW5/animscripts/traverse/window_over_quick.gscbin new file mode 100644 index 00000000..b37ad938 Binary files /dev/null and b/data/IW5/animscripts/traverse/window_over_quick.gscbin differ diff --git a/data/IW5/animscripts/utility.gscbin b/data/IW5/animscripts/utility.gscbin new file mode 100644 index 00000000..da80f74b Binary files /dev/null and b/data/IW5/animscripts/utility.gscbin differ diff --git a/data/IW5/animscripts/walk.gscbin b/data/IW5/animscripts/walk.gscbin new file mode 100644 index 00000000..b950272a Binary files /dev/null and b/data/IW5/animscripts/walk.gscbin differ diff --git a/data/IW5/animscripts/weaponlist.gscbin b/data/IW5/animscripts/weaponlist.gscbin new file mode 100644 index 00000000..369ee7e0 Binary files /dev/null and b/data/IW5/animscripts/weaponlist.gscbin differ diff --git a/data/IW5/character/character_hero_europe_price_a.gscbin b/data/IW5/character/character_hero_europe_price_a.gscbin new file mode 100644 index 00000000..d4644440 Binary files /dev/null and b/data/IW5/character/character_hero_europe_price_a.gscbin differ diff --git a/data/IW5/character/character_hero_europe_price_aa.gscbin b/data/IW5/character/character_hero_europe_price_aa.gscbin new file mode 100644 index 00000000..93b4e2e1 Binary files /dev/null and b/data/IW5/character/character_hero_europe_price_aa.gscbin differ diff --git a/data/IW5/character/character_hero_europe_price_cc.gscbin b/data/IW5/character/character_hero_europe_price_cc.gscbin new file mode 100644 index 00000000..c75a6aba Binary files /dev/null and b/data/IW5/character/character_hero_europe_price_cc.gscbin differ diff --git a/data/IW5/character/character_hero_europe_soap_injured.gscbin b/data/IW5/character/character_hero_europe_soap_injured.gscbin new file mode 100644 index 00000000..8e0891ef Binary files /dev/null and b/data/IW5/character/character_hero_europe_soap_injured.gscbin differ diff --git a/data/IW5/character/character_opforce_henchmen_lmg_a.gscbin b/data/IW5/character/character_opforce_henchmen_lmg_a.gscbin new file mode 100644 index 00000000..f937c4ea Binary files /dev/null and b/data/IW5/character/character_opforce_henchmen_lmg_a.gscbin differ diff --git a/data/IW5/character/character_opforce_henchmen_lmg_b.gscbin b/data/IW5/character/character_opforce_henchmen_lmg_b.gscbin new file mode 100644 index 00000000..21b75c4a Binary files /dev/null and b/data/IW5/character/character_opforce_henchmen_lmg_b.gscbin differ diff --git a/data/IW5/character/character_tank_crew_a.gscbin b/data/IW5/character/character_tank_crew_a.gscbin new file mode 100644 index 00000000..b4ca61e5 Binary files /dev/null and b/data/IW5/character/character_tank_crew_a.gscbin differ diff --git a/data/IW5/character/character_tank_crew_b.gscbin b/data/IW5/character/character_tank_crew_b.gscbin new file mode 100644 index 00000000..67026964 Binary files /dev/null and b/data/IW5/character/character_tank_crew_b.gscbin differ diff --git a/data/IW5/character/mp_character_gign_head.gscbin b/data/IW5/character/mp_character_gign_head.gscbin new file mode 100644 index 00000000..c5891a2f Binary files /dev/null and b/data/IW5/character/mp_character_gign_head.gscbin differ diff --git a/data/IW5/codescripts/character.gscbin b/data/IW5/codescripts/character.gscbin new file mode 100644 index 00000000..ef394db9 Binary files /dev/null and b/data/IW5/codescripts/character.gscbin differ diff --git a/data/IW5/codescripts/delete.gscbin b/data/IW5/codescripts/delete.gscbin new file mode 100644 index 00000000..ecb098c7 Binary files /dev/null and b/data/IW5/codescripts/delete.gscbin differ diff --git a/data/IW5/codescripts/struct.gscbin b/data/IW5/codescripts/struct.gscbin new file mode 100644 index 00000000..869cd33b Binary files /dev/null and b/data/IW5/codescripts/struct.gscbin differ diff --git a/data/IW5/common_scripts/_artcommon.gscbin b/data/IW5/common_scripts/_artcommon.gscbin new file mode 100644 index 00000000..1a3c1bc3 Binary files /dev/null and b/data/IW5/common_scripts/_artcommon.gscbin differ diff --git a/data/IW5/common_scripts/_createfx.gscbin b/data/IW5/common_scripts/_createfx.gscbin new file mode 100644 index 00000000..e2df578e Binary files /dev/null and b/data/IW5/common_scripts/_createfx.gscbin differ diff --git a/data/IW5/common_scripts/_createfxmenu.gscbin b/data/IW5/common_scripts/_createfxmenu.gscbin new file mode 100644 index 00000000..5c9e2335 Binary files /dev/null and b/data/IW5/common_scripts/_createfxmenu.gscbin differ diff --git a/data/IW5/common_scripts/_destructible.gscbin b/data/IW5/common_scripts/_destructible.gscbin new file mode 100644 index 00000000..08c53b38 Binary files /dev/null and b/data/IW5/common_scripts/_destructible.gscbin differ diff --git a/data/IW5/common_scripts/_destructible_types.gscbin b/data/IW5/common_scripts/_destructible_types.gscbin new file mode 100644 index 00000000..8ed963a4 Binary files /dev/null and b/data/IW5/common_scripts/_destructible_types.gscbin differ diff --git a/data/IW5/common_scripts/_dynamic_world.gscbin b/data/IW5/common_scripts/_dynamic_world.gscbin new file mode 100644 index 00000000..46725da9 Binary files /dev/null and b/data/IW5/common_scripts/_dynamic_world.gscbin differ diff --git a/data/IW5/common_scripts/_elevator.gscbin b/data/IW5/common_scripts/_elevator.gscbin new file mode 100644 index 00000000..4c31e5d0 Binary files /dev/null and b/data/IW5/common_scripts/_elevator.gscbin differ diff --git a/data/IW5/common_scripts/_fx.gscbin b/data/IW5/common_scripts/_fx.gscbin new file mode 100644 index 00000000..b8a1ee7a Binary files /dev/null and b/data/IW5/common_scripts/_fx.gscbin differ diff --git a/data/IW5/common_scripts/_painter.gscbin b/data/IW5/common_scripts/_painter.gscbin new file mode 100644 index 00000000..4a48f0b1 Binary files /dev/null and b/data/IW5/common_scripts/_painter.gscbin differ diff --git a/data/IW5/common_scripts/_pipes.gscbin b/data/IW5/common_scripts/_pipes.gscbin new file mode 100644 index 00000000..71e72a8a Binary files /dev/null and b/data/IW5/common_scripts/_pipes.gscbin differ diff --git a/data/IW5/common_scripts/utility.gscbin b/data/IW5/common_scripts/utility.gscbin new file mode 100644 index 00000000..c7c07fa9 Binary files /dev/null and b/data/IW5/common_scripts/utility.gscbin differ diff --git a/data/IW5/maps/_ambient.gscbin b/data/IW5/maps/_ambient.gscbin new file mode 100644 index 00000000..de1404be Binary files /dev/null and b/data/IW5/maps/_ambient.gscbin differ diff --git a/data/IW5/maps/_anim.gscbin b/data/IW5/maps/_anim.gscbin new file mode 100644 index 00000000..7fd81f69 Binary files /dev/null and b/data/IW5/maps/_anim.gscbin differ diff --git a/data/IW5/maps/_animatedmodels.gscbin b/data/IW5/maps/_animatedmodels.gscbin new file mode 100644 index 00000000..e26ef055 Binary files /dev/null and b/data/IW5/maps/_animatedmodels.gscbin differ diff --git a/data/IW5/maps/_arcademode.gscbin b/data/IW5/maps/_arcademode.gscbin new file mode 100644 index 00000000..6ec0dea2 Binary files /dev/null and b/data/IW5/maps/_arcademode.gscbin differ diff --git a/data/IW5/maps/_art.gscbin b/data/IW5/maps/_art.gscbin new file mode 100644 index 00000000..65d75ca4 Binary files /dev/null and b/data/IW5/maps/_art.gscbin differ diff --git a/data/IW5/maps/_attack_heli.gscbin b/data/IW5/maps/_attack_heli.gscbin new file mode 100644 index 00000000..3de027e0 Binary files /dev/null and b/data/IW5/maps/_attack_heli.gscbin differ diff --git a/data/IW5/maps/_audio.gscbin b/data/IW5/maps/_audio.gscbin new file mode 100644 index 00000000..17095335 Binary files /dev/null and b/data/IW5/maps/_audio.gscbin differ diff --git a/data/IW5/maps/_audio_dynamic_ambi.gscbin b/data/IW5/maps/_audio_dynamic_ambi.gscbin new file mode 100644 index 00000000..95274194 Binary files /dev/null and b/data/IW5/maps/_audio_dynamic_ambi.gscbin differ diff --git a/data/IW5/maps/_audio_mix_manager.gscbin b/data/IW5/maps/_audio_mix_manager.gscbin new file mode 100644 index 00000000..6fbf2351 Binary files /dev/null and b/data/IW5/maps/_audio_mix_manager.gscbin differ diff --git a/data/IW5/maps/_audio_music.gscbin b/data/IW5/maps/_audio_music.gscbin new file mode 100644 index 00000000..6757f41c Binary files /dev/null and b/data/IW5/maps/_audio_music.gscbin differ diff --git a/data/IW5/maps/_audio_presets_vehicles.gscbin b/data/IW5/maps/_audio_presets_vehicles.gscbin new file mode 100644 index 00000000..f120d03b Binary files /dev/null and b/data/IW5/maps/_audio_presets_vehicles.gscbin differ diff --git a/data/IW5/maps/_audio_reverb.gscbin b/data/IW5/maps/_audio_reverb.gscbin new file mode 100644 index 00000000..18da5135 Binary files /dev/null and b/data/IW5/maps/_audio_reverb.gscbin differ diff --git a/data/IW5/maps/_audio_stream_manager.gscbin b/data/IW5/maps/_audio_stream_manager.gscbin new file mode 100644 index 00000000..f4017001 Binary files /dev/null and b/data/IW5/maps/_audio_stream_manager.gscbin differ diff --git a/data/IW5/maps/_audio_vehicles.gscbin b/data/IW5/maps/_audio_vehicles.gscbin new file mode 100644 index 00000000..6a2dbb8a Binary files /dev/null and b/data/IW5/maps/_audio_vehicles.gscbin differ diff --git a/data/IW5/maps/_audio_whizby.gscbin b/data/IW5/maps/_audio_whizby.gscbin new file mode 100644 index 00000000..9ca219e7 Binary files /dev/null and b/data/IW5/maps/_audio_whizby.gscbin differ diff --git a/data/IW5/maps/_audio_zone_manager.gscbin b/data/IW5/maps/_audio_zone_manager.gscbin new file mode 100644 index 00000000..1d00315b Binary files /dev/null and b/data/IW5/maps/_audio_zone_manager.gscbin differ diff --git a/data/IW5/maps/_autosave.gscbin b/data/IW5/maps/_autosave.gscbin new file mode 100644 index 00000000..4867aaae Binary files /dev/null and b/data/IW5/maps/_autosave.gscbin differ diff --git a/data/IW5/maps/_bcs_location_trigs.gscbin b/data/IW5/maps/_bcs_location_trigs.gscbin new file mode 100644 index 00000000..07f2c4c6 Binary files /dev/null and b/data/IW5/maps/_bcs_location_trigs.gscbin differ diff --git a/data/IW5/maps/_colors.gscbin b/data/IW5/maps/_colors.gscbin new file mode 100644 index 00000000..91abd621 Binary files /dev/null and b/data/IW5/maps/_colors.gscbin differ diff --git a/data/IW5/maps/_compass.gscbin b/data/IW5/maps/_compass.gscbin new file mode 100644 index 00000000..9ff3a24f Binary files /dev/null and b/data/IW5/maps/_compass.gscbin differ diff --git a/data/IW5/maps/_coop.gscbin b/data/IW5/maps/_coop.gscbin new file mode 100644 index 00000000..fe6b541b Binary files /dev/null and b/data/IW5/maps/_coop.gscbin differ diff --git a/data/IW5/maps/_createfx.gscbin b/data/IW5/maps/_createfx.gscbin new file mode 100644 index 00000000..5588a46b Binary files /dev/null and b/data/IW5/maps/_createfx.gscbin differ diff --git a/data/IW5/maps/_damagefeedback.gscbin b/data/IW5/maps/_damagefeedback.gscbin new file mode 100644 index 00000000..3d128b93 Binary files /dev/null and b/data/IW5/maps/_damagefeedback.gscbin differ diff --git a/data/IW5/maps/_debug.gscbin b/data/IW5/maps/_debug.gscbin new file mode 100644 index 00000000..93403163 Binary files /dev/null and b/data/IW5/maps/_debug.gscbin differ diff --git a/data/IW5/maps/_detonategrenades.gscbin b/data/IW5/maps/_detonategrenades.gscbin new file mode 100644 index 00000000..141459f8 Binary files /dev/null and b/data/IW5/maps/_detonategrenades.gscbin differ diff --git a/data/IW5/maps/_drone.gscbin b/data/IW5/maps/_drone.gscbin new file mode 100644 index 00000000..1597d109 Binary files /dev/null and b/data/IW5/maps/_drone.gscbin differ diff --git a/data/IW5/maps/_dshk_player_rescue.gscbin b/data/IW5/maps/_dshk_player_rescue.gscbin new file mode 100644 index 00000000..7f0bcaeb Binary files /dev/null and b/data/IW5/maps/_dshk_player_rescue.gscbin differ diff --git a/data/IW5/maps/_endmission.gscbin b/data/IW5/maps/_endmission.gscbin new file mode 100644 index 00000000..4386807c Binary files /dev/null and b/data/IW5/maps/_endmission.gscbin differ diff --git a/data/IW5/maps/_escalator.gscbin b/data/IW5/maps/_escalator.gscbin new file mode 100644 index 00000000..e51f0f81 Binary files /dev/null and b/data/IW5/maps/_escalator.gscbin differ diff --git a/data/IW5/maps/_friendlyfire.gscbin b/data/IW5/maps/_friendlyfire.gscbin new file mode 100644 index 00000000..bb8eb417 Binary files /dev/null and b/data/IW5/maps/_friendlyfire.gscbin differ diff --git a/data/IW5/maps/_fx.gscbin b/data/IW5/maps/_fx.gscbin new file mode 100644 index 00000000..64769e08 Binary files /dev/null and b/data/IW5/maps/_fx.gscbin differ diff --git a/data/IW5/maps/_gameskill.gscbin b/data/IW5/maps/_gameskill.gscbin new file mode 100644 index 00000000..efb5502a Binary files /dev/null and b/data/IW5/maps/_gameskill.gscbin differ diff --git a/data/IW5/maps/_global_fx.gscbin b/data/IW5/maps/_global_fx.gscbin new file mode 100644 index 00000000..291b70b8 Binary files /dev/null and b/data/IW5/maps/_global_fx.gscbin differ diff --git a/data/IW5/maps/_helicopter_ai.gscbin b/data/IW5/maps/_helicopter_ai.gscbin new file mode 100644 index 00000000..5b03b42e Binary files /dev/null and b/data/IW5/maps/_helicopter_ai.gscbin differ diff --git a/data/IW5/maps/_helicopter_globals.gscbin b/data/IW5/maps/_helicopter_globals.gscbin new file mode 100644 index 00000000..e982af48 Binary files /dev/null and b/data/IW5/maps/_helicopter_globals.gscbin differ diff --git a/data/IW5/maps/_hiding_door.gscbin b/data/IW5/maps/_hiding_door.gscbin new file mode 100644 index 00000000..8f67f953 Binary files /dev/null and b/data/IW5/maps/_hiding_door.gscbin differ diff --git a/data/IW5/maps/_hud.gscbin b/data/IW5/maps/_hud.gscbin new file mode 100644 index 00000000..0ac4f10f Binary files /dev/null and b/data/IW5/maps/_hud.gscbin differ diff --git a/data/IW5/maps/_hud_util.gscbin b/data/IW5/maps/_hud_util.gscbin new file mode 100644 index 00000000..a07594a4 Binary files /dev/null and b/data/IW5/maps/_hud_util.gscbin differ diff --git a/data/IW5/maps/_intelligence.gscbin b/data/IW5/maps/_intelligence.gscbin new file mode 100644 index 00000000..3ed75aaf Binary files /dev/null and b/data/IW5/maps/_intelligence.gscbin differ diff --git a/data/IW5/maps/_interactive_objects.gscbin b/data/IW5/maps/_interactive_objects.gscbin new file mode 100644 index 00000000..6a50bee0 Binary files /dev/null and b/data/IW5/maps/_interactive_objects.gscbin differ diff --git a/data/IW5/maps/_introscreen.gscbin b/data/IW5/maps/_introscreen.gscbin new file mode 100644 index 00000000..2ef44fef Binary files /dev/null and b/data/IW5/maps/_introscreen.gscbin differ diff --git a/data/IW5/maps/_laststand.gscbin b/data/IW5/maps/_laststand.gscbin new file mode 100644 index 00000000..da479402 Binary files /dev/null and b/data/IW5/maps/_laststand.gscbin differ diff --git a/data/IW5/maps/_lights.gscbin b/data/IW5/maps/_lights.gscbin new file mode 100644 index 00000000..01bc3dd3 Binary files /dev/null and b/data/IW5/maps/_lights.gscbin differ diff --git a/data/IW5/maps/_load.gscbin b/data/IW5/maps/_load.gscbin new file mode 100644 index 00000000..b3f9b4b4 Binary files /dev/null and b/data/IW5/maps/_load.gscbin differ diff --git a/data/IW5/maps/_loadout.gscbin b/data/IW5/maps/_loadout.gscbin new file mode 100644 index 00000000..7350c35c Binary files /dev/null and b/data/IW5/maps/_loadout.gscbin differ diff --git a/data/IW5/maps/_mg_penetration.gscbin b/data/IW5/maps/_mg_penetration.gscbin new file mode 100644 index 00000000..11c97909 Binary files /dev/null and b/data/IW5/maps/_mg_penetration.gscbin differ diff --git a/data/IW5/maps/_mgturret.gscbin b/data/IW5/maps/_mgturret.gscbin new file mode 100644 index 00000000..fc4f62db Binary files /dev/null and b/data/IW5/maps/_mgturret.gscbin differ diff --git a/data/IW5/maps/_missions.gscbin b/data/IW5/maps/_missions.gscbin new file mode 100644 index 00000000..4649e1be Binary files /dev/null and b/data/IW5/maps/_missions.gscbin differ diff --git a/data/IW5/maps/_names.gscbin b/data/IW5/maps/_names.gscbin new file mode 100644 index 00000000..5c6d8ecb Binary files /dev/null and b/data/IW5/maps/_names.gscbin differ diff --git a/data/IW5/maps/_noder.gscbin b/data/IW5/maps/_noder.gscbin new file mode 100644 index 00000000..5fc9d411 Binary files /dev/null and b/data/IW5/maps/_noder.gscbin differ diff --git a/data/IW5/maps/_patrol.gscbin b/data/IW5/maps/_patrol.gscbin new file mode 100644 index 00000000..a395e4fc Binary files /dev/null and b/data/IW5/maps/_patrol.gscbin differ diff --git a/data/IW5/maps/_player_stats.gscbin b/data/IW5/maps/_player_stats.gscbin new file mode 100644 index 00000000..0eebb2e6 Binary files /dev/null and b/data/IW5/maps/_player_stats.gscbin differ diff --git a/data/IW5/maps/_quotes.gscbin b/data/IW5/maps/_quotes.gscbin new file mode 100644 index 00000000..eca7c554 Binary files /dev/null and b/data/IW5/maps/_quotes.gscbin differ diff --git a/data/IW5/maps/_rank.gscbin b/data/IW5/maps/_rank.gscbin new file mode 100644 index 00000000..2bfa6f22 Binary files /dev/null and b/data/IW5/maps/_rank.gscbin differ diff --git a/data/IW5/maps/_shutter.gscbin b/data/IW5/maps/_shutter.gscbin new file mode 100644 index 00000000..49c896d1 Binary files /dev/null and b/data/IW5/maps/_shutter.gscbin differ diff --git a/data/IW5/maps/_spawner.gscbin b/data/IW5/maps/_spawner.gscbin new file mode 100644 index 00000000..8452150e Binary files /dev/null and b/data/IW5/maps/_spawner.gscbin differ diff --git a/data/IW5/maps/_specialops.gscbin b/data/IW5/maps/_specialops.gscbin new file mode 100644 index 00000000..34e6be8d Binary files /dev/null and b/data/IW5/maps/_specialops.gscbin differ diff --git a/data/IW5/maps/_specialops_battlechatter.gscbin b/data/IW5/maps/_specialops_battlechatter.gscbin new file mode 100644 index 00000000..153dfcde Binary files /dev/null and b/data/IW5/maps/_specialops_battlechatter.gscbin differ diff --git a/data/IW5/maps/_specialops_code.gscbin b/data/IW5/maps/_specialops_code.gscbin new file mode 100644 index 00000000..44eb1764 Binary files /dev/null and b/data/IW5/maps/_specialops_code.gscbin differ diff --git a/data/IW5/maps/_treadfx.gscbin b/data/IW5/maps/_treadfx.gscbin new file mode 100644 index 00000000..070ed383 Binary files /dev/null and b/data/IW5/maps/_treadfx.gscbin differ diff --git a/data/IW5/maps/_utility.gscbin b/data/IW5/maps/_utility.gscbin new file mode 100644 index 00000000..2a2148fa Binary files /dev/null and b/data/IW5/maps/_utility.gscbin differ diff --git a/data/IW5/maps/_utility_code.gscbin b/data/IW5/maps/_utility_code.gscbin new file mode 100644 index 00000000..8829551b Binary files /dev/null and b/data/IW5/maps/_utility_code.gscbin differ diff --git a/data/IW5/maps/_vehicle.gscbin b/data/IW5/maps/_vehicle.gscbin new file mode 100644 index 00000000..eb294d0e Binary files /dev/null and b/data/IW5/maps/_vehicle.gscbin differ diff --git a/data/IW5/maps/_vehicle_aianim.gscbin b/data/IW5/maps/_vehicle_aianim.gscbin new file mode 100644 index 00000000..7852dee2 Binary files /dev/null and b/data/IW5/maps/_vehicle_aianim.gscbin differ diff --git a/data/IW5/maps/berlin.gscbin b/data/IW5/maps/berlin.gscbin new file mode 100644 index 00000000..fcf752f0 Binary files /dev/null and b/data/IW5/maps/berlin.gscbin differ diff --git a/data/IW5/maps/berlin_a10.gscbin b/data/IW5/maps/berlin_a10.gscbin new file mode 100644 index 00000000..c0b85361 Binary files /dev/null and b/data/IW5/maps/berlin_a10.gscbin differ diff --git a/data/IW5/maps/berlin_anim.gscbin b/data/IW5/maps/berlin_anim.gscbin new file mode 100644 index 00000000..787da472 Binary files /dev/null and b/data/IW5/maps/berlin_anim.gscbin differ diff --git a/data/IW5/maps/berlin_aud.gscbin b/data/IW5/maps/berlin_aud.gscbin new file mode 100644 index 00000000..bbd0b8e3 Binary files /dev/null and b/data/IW5/maps/berlin_aud.gscbin differ diff --git a/data/IW5/maps/berlin_code.gscbin b/data/IW5/maps/berlin_code.gscbin new file mode 100644 index 00000000..baeb19d2 Binary files /dev/null and b/data/IW5/maps/berlin_code.gscbin differ diff --git a/data/IW5/maps/berlin_util.gscbin b/data/IW5/maps/berlin_util.gscbin new file mode 100644 index 00000000..af4dfb7a Binary files /dev/null and b/data/IW5/maps/berlin_util.gscbin differ diff --git a/data/IW5/maps/berlin_vo.gscbin b/data/IW5/maps/berlin_vo.gscbin new file mode 100644 index 00000000..56d3d6ac Binary files /dev/null and b/data/IW5/maps/berlin_vo.gscbin differ diff --git a/data/IW5/maps/castle.gscbin b/data/IW5/maps/castle.gscbin new file mode 100644 index 00000000..cca53b4f Binary files /dev/null and b/data/IW5/maps/castle.gscbin differ diff --git a/data/IW5/maps/castle_amb.gscbin b/data/IW5/maps/castle_amb.gscbin new file mode 100644 index 00000000..b22fe3e4 Binary files /dev/null and b/data/IW5/maps/castle_amb.gscbin differ diff --git a/data/IW5/maps/castle_anim.gscbin b/data/IW5/maps/castle_anim.gscbin new file mode 100644 index 00000000..84208c43 Binary files /dev/null and b/data/IW5/maps/castle_anim.gscbin differ diff --git a/data/IW5/maps/castle_bridge_crossing.gscbin b/data/IW5/maps/castle_bridge_crossing.gscbin new file mode 100644 index 00000000..37a417fe Binary files /dev/null and b/data/IW5/maps/castle_bridge_crossing.gscbin differ diff --git a/data/IW5/maps/castle_code.gscbin b/data/IW5/maps/castle_code.gscbin new file mode 100644 index 00000000..a1874434 Binary files /dev/null and b/data/IW5/maps/castle_code.gscbin differ diff --git a/data/IW5/maps/castle_courtyard_activity.gscbin b/data/IW5/maps/castle_courtyard_activity.gscbin new file mode 100644 index 00000000..e366fa03 Binary files /dev/null and b/data/IW5/maps/castle_courtyard_activity.gscbin differ diff --git a/data/IW5/maps/castle_courtyard_battle.gscbin b/data/IW5/maps/castle_courtyard_battle.gscbin new file mode 100644 index 00000000..63780ea1 Binary files /dev/null and b/data/IW5/maps/castle_courtyard_battle.gscbin differ diff --git a/data/IW5/maps/castle_courtyard_stealth.gscbin b/data/IW5/maps/castle_courtyard_stealth.gscbin new file mode 100644 index 00000000..493906d3 Binary files /dev/null and b/data/IW5/maps/castle_courtyard_stealth.gscbin differ diff --git a/data/IW5/maps/castle_escape_new.gscbin b/data/IW5/maps/castle_escape_new.gscbin new file mode 100644 index 00000000..25b0c2c0 Binary files /dev/null and b/data/IW5/maps/castle_escape_new.gscbin differ diff --git a/data/IW5/maps/castle_fx.gscbin b/data/IW5/maps/castle_fx.gscbin new file mode 100644 index 00000000..6d1301d1 Binary files /dev/null and b/data/IW5/maps/castle_fx.gscbin differ diff --git a/data/IW5/maps/castle_inner_courtyard.gscbin b/data/IW5/maps/castle_inner_courtyard.gscbin new file mode 100644 index 00000000..f6bdbdc4 Binary files /dev/null and b/data/IW5/maps/castle_inner_courtyard.gscbin differ diff --git a/data/IW5/maps/castle_interior.gscbin b/data/IW5/maps/castle_interior.gscbin new file mode 100644 index 00000000..7f4384b6 Binary files /dev/null and b/data/IW5/maps/castle_interior.gscbin differ diff --git a/data/IW5/maps/castle_into_wet_wall.gscbin b/data/IW5/maps/castle_into_wet_wall.gscbin new file mode 100644 index 00000000..89d30163 Binary files /dev/null and b/data/IW5/maps/castle_into_wet_wall.gscbin differ diff --git a/data/IW5/maps/castle_kitchen_battle.gscbin b/data/IW5/maps/castle_kitchen_battle.gscbin new file mode 100644 index 00000000..19d7060e Binary files /dev/null and b/data/IW5/maps/castle_kitchen_battle.gscbin differ diff --git a/data/IW5/maps/castle_parachute.gscbin b/data/IW5/maps/castle_parachute.gscbin new file mode 100644 index 00000000..0f2f1e2b Binary files /dev/null and b/data/IW5/maps/castle_parachute.gscbin differ diff --git a/data/IW5/maps/castle_parachute_sim.gscbin b/data/IW5/maps/castle_parachute_sim.gscbin new file mode 100644 index 00000000..9fb12939 Binary files /dev/null and b/data/IW5/maps/castle_parachute_sim.gscbin differ diff --git a/data/IW5/maps/castle_precache.gscbin b/data/IW5/maps/castle_precache.gscbin new file mode 100644 index 00000000..1696fe83 Binary files /dev/null and b/data/IW5/maps/castle_precache.gscbin differ diff --git a/data/IW5/maps/castle_prison_battle.gscbin b/data/IW5/maps/castle_prison_battle.gscbin new file mode 100644 index 00000000..e0b92b8d Binary files /dev/null and b/data/IW5/maps/castle_prison_battle.gscbin differ diff --git a/data/IW5/maps/castle_ruins.gscbin b/data/IW5/maps/castle_ruins.gscbin new file mode 100644 index 00000000..9146af18 Binary files /dev/null and b/data/IW5/maps/castle_ruins.gscbin differ diff --git a/data/IW5/maps/castle_truck_movement.gscbin b/data/IW5/maps/castle_truck_movement.gscbin new file mode 100644 index 00000000..dd02b1b3 Binary files /dev/null and b/data/IW5/maps/castle_truck_movement.gscbin differ diff --git a/data/IW5/maps/creditsmw3.gscbin b/data/IW5/maps/creditsmw3.gscbin new file mode 100644 index 00000000..2d0b1385 Binary files /dev/null and b/data/IW5/maps/creditsmw3.gscbin differ diff --git a/data/IW5/maps/dubai.gscbin b/data/IW5/maps/dubai.gscbin new file mode 100644 index 00000000..14e44a07 Binary files /dev/null and b/data/IW5/maps/dubai.gscbin differ diff --git a/data/IW5/maps/dubai_anim.gscbin b/data/IW5/maps/dubai_anim.gscbin new file mode 100644 index 00000000..39266d46 Binary files /dev/null and b/data/IW5/maps/dubai_anim.gscbin differ diff --git a/data/IW5/maps/dubai_aud.gscbin b/data/IW5/maps/dubai_aud.gscbin new file mode 100644 index 00000000..a96ffd9f Binary files /dev/null and b/data/IW5/maps/dubai_aud.gscbin differ diff --git a/data/IW5/maps/dubai_code.gscbin b/data/IW5/maps/dubai_code.gscbin new file mode 100644 index 00000000..76f189e7 Binary files /dev/null and b/data/IW5/maps/dubai_code.gscbin differ diff --git a/data/IW5/maps/dubai_finale.gscbin b/data/IW5/maps/dubai_finale.gscbin new file mode 100644 index 00000000..c9a9af1a Binary files /dev/null and b/data/IW5/maps/dubai_finale.gscbin differ diff --git a/data/IW5/maps/dubai_pip.gscbin b/data/IW5/maps/dubai_pip.gscbin new file mode 100644 index 00000000..9cdb63bc Binary files /dev/null and b/data/IW5/maps/dubai_pip.gscbin differ diff --git a/data/IW5/maps/dubai_utils.gscbin b/data/IW5/maps/dubai_utils.gscbin new file mode 100644 index 00000000..4d065941 Binary files /dev/null and b/data/IW5/maps/dubai_utils.gscbin differ diff --git a/data/IW5/maps/dubai_vo.gscbin b/data/IW5/maps/dubai_vo.gscbin new file mode 100644 index 00000000..f454dd18 Binary files /dev/null and b/data/IW5/maps/dubai_vo.gscbin differ diff --git a/data/IW5/maps/hamburg_a_starts.gscbin b/data/IW5/maps/hamburg_a_starts.gscbin new file mode 100644 index 00000000..cc7b4dc3 Binary files /dev/null and b/data/IW5/maps/hamburg_a_starts.gscbin differ diff --git a/data/IW5/maps/hamburg_a_to_b.gscbin b/data/IW5/maps/hamburg_a_to_b.gscbin new file mode 100644 index 00000000..b3e55b2e Binary files /dev/null and b/data/IW5/maps/hamburg_a_to_b.gscbin differ diff --git a/data/IW5/maps/hamburg_a_to_b_starts.gscbin b/data/IW5/maps/hamburg_a_to_b_starts.gscbin new file mode 100644 index 00000000..f58b03aa Binary files /dev/null and b/data/IW5/maps/hamburg_a_to_b_starts.gscbin differ diff --git a/data/IW5/maps/hamburg_amb.gscbin b/data/IW5/maps/hamburg_amb.gscbin new file mode 100644 index 00000000..13e5fcdb Binary files /dev/null and b/data/IW5/maps/hamburg_amb.gscbin differ diff --git a/data/IW5/maps/hamburg_code.gscbin b/data/IW5/maps/hamburg_code.gscbin new file mode 100644 index 00000000..463e5967 Binary files /dev/null and b/data/IW5/maps/hamburg_code.gscbin differ diff --git a/data/IW5/maps/hamburg_garage_crash_anim.gscbin b/data/IW5/maps/hamburg_garage_crash_anim.gscbin new file mode 100644 index 00000000..c965e9aa Binary files /dev/null and b/data/IW5/maps/hamburg_garage_crash_anim.gscbin differ diff --git a/data/IW5/maps/hamburg_hovercraft_code.gscbin b/data/IW5/maps/hamburg_hovercraft_code.gscbin new file mode 100644 index 00000000..941cb03b Binary files /dev/null and b/data/IW5/maps/hamburg_hovercraft_code.gscbin differ diff --git a/data/IW5/maps/hamburg_intro.gscbin b/data/IW5/maps/hamburg_intro.gscbin new file mode 100644 index 00000000..d1a39856 Binary files /dev/null and b/data/IW5/maps/hamburg_intro.gscbin differ diff --git a/data/IW5/maps/hamburg_landing_zone.gscbin b/data/IW5/maps/hamburg_landing_zone.gscbin new file mode 100644 index 00000000..a2ae0b8c Binary files /dev/null and b/data/IW5/maps/hamburg_landing_zone.gscbin differ diff --git a/data/IW5/maps/hamburg_landing_zone_anim.gscbin b/data/IW5/maps/hamburg_landing_zone_anim.gscbin new file mode 100644 index 00000000..fc4d1717 Binary files /dev/null and b/data/IW5/maps/hamburg_landing_zone_anim.gscbin differ diff --git a/data/IW5/maps/hamburg_minigun_death.gscbin b/data/IW5/maps/hamburg_minigun_death.gscbin new file mode 100644 index 00000000..4579e6ed Binary files /dev/null and b/data/IW5/maps/hamburg_minigun_death.gscbin differ diff --git a/data/IW5/maps/hamburg_starts.gscbin b/data/IW5/maps/hamburg_starts.gscbin new file mode 100644 index 00000000..81839dc3 Binary files /dev/null and b/data/IW5/maps/hamburg_starts.gscbin differ diff --git a/data/IW5/maps/hamburg_tank_ai.gscbin b/data/IW5/maps/hamburg_tank_ai.gscbin new file mode 100644 index 00000000..528f7480 Binary files /dev/null and b/data/IW5/maps/hamburg_tank_ai.gscbin differ diff --git a/data/IW5/maps/hijack.gscbin b/data/IW5/maps/hijack.gscbin new file mode 100644 index 00000000..6f31503c Binary files /dev/null and b/data/IW5/maps/hijack.gscbin differ diff --git a/data/IW5/maps/hijack_airplane.gscbin b/data/IW5/maps/hijack_airplane.gscbin new file mode 100644 index 00000000..9cf74a8b Binary files /dev/null and b/data/IW5/maps/hijack_airplane.gscbin differ diff --git a/data/IW5/maps/hijack_anim.gscbin b/data/IW5/maps/hijack_anim.gscbin new file mode 100644 index 00000000..a9d72b7a Binary files /dev/null and b/data/IW5/maps/hijack_anim.gscbin differ diff --git a/data/IW5/maps/hijack_aud.gscbin b/data/IW5/maps/hijack_aud.gscbin new file mode 100644 index 00000000..d0c84d26 Binary files /dev/null and b/data/IW5/maps/hijack_aud.gscbin differ diff --git a/data/IW5/maps/hijack_code.gscbin b/data/IW5/maps/hijack_code.gscbin new file mode 100644 index 00000000..31876ad0 Binary files /dev/null and b/data/IW5/maps/hijack_code.gscbin differ diff --git a/data/IW5/maps/hijack_crash.gscbin b/data/IW5/maps/hijack_crash.gscbin new file mode 100644 index 00000000..4cd6dc67 Binary files /dev/null and b/data/IW5/maps/hijack_crash.gscbin differ diff --git a/data/IW5/maps/hijack_drunk_player.gscbin b/data/IW5/maps/hijack_drunk_player.gscbin new file mode 100644 index 00000000..708fcbd1 Binary files /dev/null and b/data/IW5/maps/hijack_drunk_player.gscbin differ diff --git a/data/IW5/maps/hijack_script_2b.gscbin b/data/IW5/maps/hijack_script_2b.gscbin new file mode 100644 index 00000000..0cc150e4 Binary files /dev/null and b/data/IW5/maps/hijack_script_2b.gscbin differ diff --git a/data/IW5/maps/hijack_script_2c.gscbin b/data/IW5/maps/hijack_script_2c.gscbin new file mode 100644 index 00000000..e3adb261 Binary files /dev/null and b/data/IW5/maps/hijack_script_2c.gscbin differ diff --git a/data/IW5/maps/hijack_tarmac.gscbin b/data/IW5/maps/hijack_tarmac.gscbin new file mode 100644 index 00000000..56fe2c74 Binary files /dev/null and b/data/IW5/maps/hijack_tarmac.gscbin differ diff --git a/data/IW5/maps/innocent.gscbin b/data/IW5/maps/innocent.gscbin new file mode 100644 index 00000000..b7d11c61 Binary files /dev/null and b/data/IW5/maps/innocent.gscbin differ diff --git a/data/IW5/maps/innocent_anim.gscbin b/data/IW5/maps/innocent_anim.gscbin new file mode 100644 index 00000000..95d40fcc Binary files /dev/null and b/data/IW5/maps/innocent_anim.gscbin differ diff --git a/data/IW5/maps/innocent_code.gscbin b/data/IW5/maps/innocent_code.gscbin new file mode 100644 index 00000000..87a5c00f Binary files /dev/null and b/data/IW5/maps/innocent_code.gscbin differ diff --git a/data/IW5/maps/innocent_starts.gscbin b/data/IW5/maps/innocent_starts.gscbin new file mode 100644 index 00000000..66eda8da Binary files /dev/null and b/data/IW5/maps/innocent_starts.gscbin differ diff --git a/data/IW5/maps/intro.gscbin b/data/IW5/maps/intro.gscbin new file mode 100644 index 00000000..f981af89 Binary files /dev/null and b/data/IW5/maps/intro.gscbin differ diff --git a/data/IW5/maps/intro_anim.gscbin b/data/IW5/maps/intro_anim.gscbin new file mode 100644 index 00000000..ae5f892f Binary files /dev/null and b/data/IW5/maps/intro_anim.gscbin differ diff --git a/data/IW5/maps/intro_aud.gscbin b/data/IW5/maps/intro_aud.gscbin new file mode 100644 index 00000000..dd371279 Binary files /dev/null and b/data/IW5/maps/intro_aud.gscbin differ diff --git a/data/IW5/maps/intro_carry.gscbin b/data/IW5/maps/intro_carry.gscbin new file mode 100644 index 00000000..30723bce Binary files /dev/null and b/data/IW5/maps/intro_carry.gscbin differ diff --git a/data/IW5/maps/intro_code.gscbin b/data/IW5/maps/intro_code.gscbin new file mode 100644 index 00000000..01c29525 Binary files /dev/null and b/data/IW5/maps/intro_code.gscbin differ diff --git a/data/IW5/maps/intro_maars.gscbin b/data/IW5/maps/intro_maars.gscbin new file mode 100644 index 00000000..ec0831bc Binary files /dev/null and b/data/IW5/maps/intro_maars.gscbin differ diff --git a/data/IW5/maps/intro_obj.gscbin b/data/IW5/maps/intro_obj.gscbin new file mode 100644 index 00000000..3965d293 Binary files /dev/null and b/data/IW5/maps/intro_obj.gscbin differ diff --git a/data/IW5/maps/intro_utility.gscbin b/data/IW5/maps/intro_utility.gscbin new file mode 100644 index 00000000..fefec79b Binary files /dev/null and b/data/IW5/maps/intro_utility.gscbin differ diff --git a/data/IW5/maps/intro_vo.gscbin b/data/IW5/maps/intro_vo.gscbin new file mode 100644 index 00000000..dee8d2db Binary files /dev/null and b/data/IW5/maps/intro_vo.gscbin differ diff --git a/data/IW5/maps/jake_tools.gscbin b/data/IW5/maps/jake_tools.gscbin new file mode 100644 index 00000000..218d76e4 Binary files /dev/null and b/data/IW5/maps/jake_tools.gscbin differ diff --git a/data/IW5/maps/jeremy_tools.gscbin b/data/IW5/maps/jeremy_tools.gscbin new file mode 100644 index 00000000..6c93a56b Binary files /dev/null and b/data/IW5/maps/jeremy_tools.gscbin differ diff --git a/data/IW5/maps/london.gscbin b/data/IW5/maps/london.gscbin new file mode 100644 index 00000000..684bcc2a Binary files /dev/null and b/data/IW5/maps/london.gscbin differ diff --git a/data/IW5/maps/london_amb.gscbin b/data/IW5/maps/london_amb.gscbin new file mode 100644 index 00000000..e56f6f5f Binary files /dev/null and b/data/IW5/maps/london_amb.gscbin differ diff --git a/data/IW5/maps/london_code.gscbin b/data/IW5/maps/london_code.gscbin new file mode 100644 index 00000000..4a69da45 Binary files /dev/null and b/data/IW5/maps/london_code.gscbin differ diff --git a/data/IW5/maps/london_docks.gscbin b/data/IW5/maps/london_docks.gscbin new file mode 100644 index 00000000..1f030b7e Binary files /dev/null and b/data/IW5/maps/london_docks.gscbin differ diff --git a/data/IW5/maps/london_docks_anim.gscbin b/data/IW5/maps/london_docks_anim.gscbin new file mode 100644 index 00000000..9151c902 Binary files /dev/null and b/data/IW5/maps/london_docks_anim.gscbin differ diff --git a/data/IW5/maps/london_docks_code.gscbin b/data/IW5/maps/london_docks_code.gscbin new file mode 100644 index 00000000..bfd5bbfa Binary files /dev/null and b/data/IW5/maps/london_docks_code.gscbin differ diff --git a/data/IW5/maps/london_docks_script_starts.gscbin b/data/IW5/maps/london_docks_script_starts.gscbin new file mode 100644 index 00000000..27cb882f Binary files /dev/null and b/data/IW5/maps/london_docks_script_starts.gscbin differ diff --git a/data/IW5/maps/london_starts.gscbin b/data/IW5/maps/london_starts.gscbin new file mode 100644 index 00000000..27d76240 Binary files /dev/null and b/data/IW5/maps/london_starts.gscbin differ diff --git a/data/IW5/maps/london_uav.gscbin b/data/IW5/maps/london_uav.gscbin new file mode 100644 index 00000000..b74c35cd Binary files /dev/null and b/data/IW5/maps/london_uav.gscbin differ diff --git a/data/IW5/maps/london_west.gscbin b/data/IW5/maps/london_west.gscbin new file mode 100644 index 00000000..1bbdec5f Binary files /dev/null and b/data/IW5/maps/london_west.gscbin differ diff --git a/data/IW5/maps/london_west_anim.gscbin b/data/IW5/maps/london_west_anim.gscbin new file mode 100644 index 00000000..b27abab8 Binary files /dev/null and b/data/IW5/maps/london_west_anim.gscbin differ diff --git a/data/IW5/maps/london_west_code.gscbin b/data/IW5/maps/london_west_code.gscbin new file mode 100644 index 00000000..627e94ac Binary files /dev/null and b/data/IW5/maps/london_west_code.gscbin differ diff --git a/data/IW5/maps/mp/_animatedmodels.gscbin b/data/IW5/maps/mp/_animatedmodels.gscbin new file mode 100644 index 00000000..bcd624df Binary files /dev/null and b/data/IW5/maps/mp/_animatedmodels.gscbin differ diff --git a/data/IW5/maps/mp/_areas.gscbin b/data/IW5/maps/mp/_areas.gscbin new file mode 100644 index 00000000..893f3a53 Binary files /dev/null and b/data/IW5/maps/mp/_areas.gscbin differ diff --git a/data/IW5/maps/mp/_art.gscbin b/data/IW5/maps/mp/_art.gscbin new file mode 100644 index 00000000..f1f19f68 Binary files /dev/null and b/data/IW5/maps/mp/_art.gscbin differ diff --git a/data/IW5/maps/mp/_audio.gscbin b/data/IW5/maps/mp/_audio.gscbin new file mode 100644 index 00000000..f0fa16b1 Binary files /dev/null and b/data/IW5/maps/mp/_audio.gscbin differ diff --git a/data/IW5/maps/mp/_awards.gscbin b/data/IW5/maps/mp/_awards.gscbin new file mode 100644 index 00000000..cc0a4fb7 Binary files /dev/null and b/data/IW5/maps/mp/_awards.gscbin differ diff --git a/data/IW5/maps/mp/_compass.gscbin b/data/IW5/maps/mp/_compass.gscbin new file mode 100644 index 00000000..0790336a Binary files /dev/null and b/data/IW5/maps/mp/_compass.gscbin differ diff --git a/data/IW5/maps/mp/_createfx.gscbin b/data/IW5/maps/mp/_createfx.gscbin new file mode 100644 index 00000000..555b47ed Binary files /dev/null and b/data/IW5/maps/mp/_createfx.gscbin differ diff --git a/data/IW5/maps/mp/_crib.gscbin b/data/IW5/maps/mp/_crib.gscbin new file mode 100644 index 00000000..d47b48e1 Binary files /dev/null and b/data/IW5/maps/mp/_crib.gscbin differ diff --git a/data/IW5/maps/mp/_defcon.gscbin b/data/IW5/maps/mp/_defcon.gscbin new file mode 100644 index 00000000..4fa029e8 Binary files /dev/null and b/data/IW5/maps/mp/_defcon.gscbin differ diff --git a/data/IW5/maps/mp/_destructables.gscbin b/data/IW5/maps/mp/_destructables.gscbin new file mode 100644 index 00000000..cc0eeebf Binary files /dev/null and b/data/IW5/maps/mp/_destructables.gscbin differ diff --git a/data/IW5/maps/mp/_empgrenade.gscbin b/data/IW5/maps/mp/_empgrenade.gscbin new file mode 100644 index 00000000..d1e0c6f7 Binary files /dev/null and b/data/IW5/maps/mp/_empgrenade.gscbin differ diff --git a/data/IW5/maps/mp/_entityheadicons.gscbin b/data/IW5/maps/mp/_entityheadicons.gscbin new file mode 100644 index 00000000..9a5ccb49 Binary files /dev/null and b/data/IW5/maps/mp/_entityheadicons.gscbin differ diff --git a/data/IW5/maps/mp/_equipment.gscbin b/data/IW5/maps/mp/_equipment.gscbin new file mode 100644 index 00000000..7f8978d2 Binary files /dev/null and b/data/IW5/maps/mp/_equipment.gscbin differ diff --git a/data/IW5/maps/mp/_events.gscbin b/data/IW5/maps/mp/_events.gscbin new file mode 100644 index 00000000..ce950699 Binary files /dev/null and b/data/IW5/maps/mp/_events.gscbin differ diff --git a/data/IW5/maps/mp/_flashgrenades.gscbin b/data/IW5/maps/mp/_flashgrenades.gscbin new file mode 100644 index 00000000..141b89c8 Binary files /dev/null and b/data/IW5/maps/mp/_flashgrenades.gscbin differ diff --git a/data/IW5/maps/mp/_fx.gscbin b/data/IW5/maps/mp/_fx.gscbin new file mode 100644 index 00000000..1b04be49 Binary files /dev/null and b/data/IW5/maps/mp/_fx.gscbin differ diff --git a/data/IW5/maps/mp/_global_fx.gscbin b/data/IW5/maps/mp/_global_fx.gscbin new file mode 100644 index 00000000..a18e0f5f Binary files /dev/null and b/data/IW5/maps/mp/_global_fx.gscbin differ diff --git a/data/IW5/maps/mp/_highlights.gscbin b/data/IW5/maps/mp/_highlights.gscbin new file mode 100644 index 00000000..112b405e Binary files /dev/null and b/data/IW5/maps/mp/_highlights.gscbin differ diff --git a/data/IW5/maps/mp/_javelin.gscbin b/data/IW5/maps/mp/_javelin.gscbin new file mode 100644 index 00000000..7724662e Binary files /dev/null and b/data/IW5/maps/mp/_javelin.gscbin differ diff --git a/data/IW5/maps/mp/_load.gscbin b/data/IW5/maps/mp/_load.gscbin new file mode 100644 index 00000000..e6b3a7f8 Binary files /dev/null and b/data/IW5/maps/mp/_load.gscbin differ diff --git a/data/IW5/maps/mp/_matchdata.gscbin b/data/IW5/maps/mp/_matchdata.gscbin new file mode 100644 index 00000000..776aa245 Binary files /dev/null and b/data/IW5/maps/mp/_matchdata.gscbin differ diff --git a/data/IW5/maps/mp/_matchevents.gscbin b/data/IW5/maps/mp/_matchevents.gscbin new file mode 100644 index 00000000..747bb64f Binary files /dev/null and b/data/IW5/maps/mp/_matchevents.gscbin differ diff --git a/data/IW5/maps/mp/_minefields.gscbin b/data/IW5/maps/mp/_minefields.gscbin new file mode 100644 index 00000000..3891608d Binary files /dev/null and b/data/IW5/maps/mp/_minefields.gscbin differ diff --git a/data/IW5/maps/mp/_radiation.gscbin b/data/IW5/maps/mp/_radiation.gscbin new file mode 100644 index 00000000..641b2629 Binary files /dev/null and b/data/IW5/maps/mp/_radiation.gscbin differ diff --git a/data/IW5/maps/mp/_scoreboard.gscbin b/data/IW5/maps/mp/_scoreboard.gscbin new file mode 100644 index 00000000..64151e50 Binary files /dev/null and b/data/IW5/maps/mp/_scoreboard.gscbin differ diff --git a/data/IW5/maps/mp/_shutter.gscbin b/data/IW5/maps/mp/_shutter.gscbin new file mode 100644 index 00000000..8ed91e2a Binary files /dev/null and b/data/IW5/maps/mp/_shutter.gscbin differ diff --git a/data/IW5/maps/mp/_skill.gscbin b/data/IW5/maps/mp/_skill.gscbin new file mode 100644 index 00000000..939b5798 Binary files /dev/null and b/data/IW5/maps/mp/_skill.gscbin differ diff --git a/data/IW5/maps/mp/_stinger.gscbin b/data/IW5/maps/mp/_stinger.gscbin new file mode 100644 index 00000000..4c55a6e5 Binary files /dev/null and b/data/IW5/maps/mp/_stinger.gscbin differ diff --git a/data/IW5/maps/mp/_utility.gscbin b/data/IW5/maps/mp/_utility.gscbin new file mode 100644 index 00000000..11f30e3a Binary files /dev/null and b/data/IW5/maps/mp/_utility.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_battlechatter_mp.gscbin b/data/IW5/maps/mp/gametypes/_battlechatter_mp.gscbin new file mode 100644 index 00000000..901a2d09 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_battlechatter_mp.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_callbacksetup.gscbin b/data/IW5/maps/mp/gametypes/_callbacksetup.gscbin new file mode 100644 index 00000000..af02ed63 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_callbacksetup.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_class.gscbin b/data/IW5/maps/mp/gametypes/_class.gscbin new file mode 100644 index 00000000..8f8b3ed3 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_class.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_damage.gscbin b/data/IW5/maps/mp/gametypes/_damage.gscbin new file mode 100644 index 00000000..eef202a1 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_damage.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_damagefeedback.gscbin b/data/IW5/maps/mp/gametypes/_damagefeedback.gscbin new file mode 100644 index 00000000..f8840855 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_damagefeedback.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_deathicons.gscbin b/data/IW5/maps/mp/gametypes/_deathicons.gscbin new file mode 100644 index 00000000..6d2fdb48 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_deathicons.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_equipment.gscbin b/data/IW5/maps/mp/gametypes/_equipment.gscbin new file mode 100644 index 00000000..cc01692f Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_equipment.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_friendicons.gscbin b/data/IW5/maps/mp/gametypes/_friendicons.gscbin new file mode 100644 index 00000000..5856a264 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_friendicons.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_gamelogic.gscbin b/data/IW5/maps/mp/gametypes/_gamelogic.gscbin new file mode 100644 index 00000000..f62c772d Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_gamelogic.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_gameobjects.gscbin b/data/IW5/maps/mp/gametypes/_gameobjects.gscbin new file mode 100644 index 00000000..8098aa9c Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_gameobjects.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_gamescore.gscbin b/data/IW5/maps/mp/gametypes/_gamescore.gscbin new file mode 100644 index 00000000..2a1d211c Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_gamescore.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_globallogic.gscbin b/data/IW5/maps/mp/gametypes/_globallogic.gscbin new file mode 100644 index 00000000..117ee276 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_globallogic.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_healthoverlay.gscbin b/data/IW5/maps/mp/gametypes/_healthoverlay.gscbin new file mode 100644 index 00000000..6827e32f Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_healthoverlay.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_hud.gscbin b/data/IW5/maps/mp/gametypes/_hud.gscbin new file mode 100644 index 00000000..024abc85 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_hud.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_hud_message.gscbin b/data/IW5/maps/mp/gametypes/_hud_message.gscbin new file mode 100644 index 00000000..79bc89fb Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_hud_message.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_hud_util.gscbin b/data/IW5/maps/mp/gametypes/_hud_util.gscbin new file mode 100644 index 00000000..32842510 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_hud_util.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_killcam.gscbin b/data/IW5/maps/mp/gametypes/_killcam.gscbin new file mode 100644 index 00000000..66973b79 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_killcam.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_menus.gscbin b/data/IW5/maps/mp/gametypes/_menus.gscbin new file mode 100644 index 00000000..d3ae377d Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_menus.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_missions.gscbin b/data/IW5/maps/mp/gametypes/_missions.gscbin new file mode 100644 index 00000000..2293c4a9 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_missions.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_music_and_dialog.gscbin b/data/IW5/maps/mp/gametypes/_music_and_dialog.gscbin new file mode 100644 index 00000000..b3aa24d2 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_music_and_dialog.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_objpoints.gscbin b/data/IW5/maps/mp/gametypes/_objpoints.gscbin new file mode 100644 index 00000000..1ba1aabb Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_objpoints.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_persistence.gscbin b/data/IW5/maps/mp/gametypes/_persistence.gscbin new file mode 100644 index 00000000..8f826355 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_persistence.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_playercards.gscbin b/data/IW5/maps/mp/gametypes/_playercards.gscbin new file mode 100644 index 00000000..e309f5c3 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_playercards.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_playerlogic.gscbin b/data/IW5/maps/mp/gametypes/_playerlogic.gscbin new file mode 100644 index 00000000..50edc010 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_playerlogic.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_portable_radar.gscbin b/data/IW5/maps/mp/gametypes/_portable_radar.gscbin new file mode 100644 index 00000000..22366f03 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_portable_radar.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_quickmessages.gscbin b/data/IW5/maps/mp/gametypes/_quickmessages.gscbin new file mode 100644 index 00000000..0ea56fb6 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_quickmessages.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_rank.gscbin b/data/IW5/maps/mp/gametypes/_rank.gscbin new file mode 100644 index 00000000..0f3e8d33 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_rank.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_scrambler.gscbin b/data/IW5/maps/mp/gametypes/_scrambler.gscbin new file mode 100644 index 00000000..e6421cac Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_scrambler.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_serversettings.gscbin b/data/IW5/maps/mp/gametypes/_serversettings.gscbin new file mode 100644 index 00000000..b26dbc38 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_serversettings.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_shellshock.gscbin b/data/IW5/maps/mp/gametypes/_shellshock.gscbin new file mode 100644 index 00000000..69691df2 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_shellshock.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_spawnlogic.gscbin b/data/IW5/maps/mp/gametypes/_spawnlogic.gscbin new file mode 100644 index 00000000..9ed5785c Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_spawnlogic.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_spectating.gscbin b/data/IW5/maps/mp/gametypes/_spectating.gscbin new file mode 100644 index 00000000..ccfecf11 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_spectating.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_teams.gscbin b/data/IW5/maps/mp/gametypes/_teams.gscbin new file mode 100644 index 00000000..c485cfde Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_teams.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_tweakables.gscbin b/data/IW5/maps/mp/gametypes/_tweakables.gscbin new file mode 100644 index 00000000..f92d0ff3 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_tweakables.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/_weapons.gscbin b/data/IW5/maps/mp/gametypes/_weapons.gscbin new file mode 100644 index 00000000..345a58d3 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/_weapons.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/arena.gscbin b/data/IW5/maps/mp/gametypes/arena.gscbin new file mode 100644 index 00000000..eecc6080 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/arena.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/conf.gscbin b/data/IW5/maps/mp/gametypes/conf.gscbin new file mode 100644 index 00000000..200df77e Binary files /dev/null and b/data/IW5/maps/mp/gametypes/conf.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/ctf.gscbin b/data/IW5/maps/mp/gametypes/ctf.gscbin new file mode 100644 index 00000000..93dc546d Binary files /dev/null and b/data/IW5/maps/mp/gametypes/ctf.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/ctfpro.gscbin b/data/IW5/maps/mp/gametypes/ctfpro.gscbin new file mode 100644 index 00000000..3bff91f5 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/ctfpro.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/dd.gscbin b/data/IW5/maps/mp/gametypes/dd.gscbin new file mode 100644 index 00000000..f1e09be5 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/dd.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/dm.gscbin b/data/IW5/maps/mp/gametypes/dm.gscbin new file mode 100644 index 00000000..6da4dd1b Binary files /dev/null and b/data/IW5/maps/mp/gametypes/dm.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/dom.gscbin b/data/IW5/maps/mp/gametypes/dom.gscbin new file mode 100644 index 00000000..9ebef59a Binary files /dev/null and b/data/IW5/maps/mp/gametypes/dom.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/grnd.gscbin b/data/IW5/maps/mp/gametypes/grnd.gscbin new file mode 100644 index 00000000..f442557c Binary files /dev/null and b/data/IW5/maps/mp/gametypes/grnd.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/gtnw.gscbin b/data/IW5/maps/mp/gametypes/gtnw.gscbin new file mode 100644 index 00000000..8cd1d777 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/gtnw.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/gun.gscbin b/data/IW5/maps/mp/gametypes/gun.gscbin new file mode 100644 index 00000000..c0ee27bd Binary files /dev/null and b/data/IW5/maps/mp/gametypes/gun.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/infect.gscbin b/data/IW5/maps/mp/gametypes/infect.gscbin new file mode 100644 index 00000000..ecc9a233 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/infect.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/jugg.gscbin b/data/IW5/maps/mp/gametypes/jugg.gscbin new file mode 100644 index 00000000..46a0f220 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/jugg.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/koth.gscbin b/data/IW5/maps/mp/gametypes/koth.gscbin new file mode 100644 index 00000000..e6de85b2 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/koth.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/oic.gscbin b/data/IW5/maps/mp/gametypes/oic.gscbin new file mode 100644 index 00000000..e1fa4579 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/oic.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/oneflag.gscbin b/data/IW5/maps/mp/gametypes/oneflag.gscbin new file mode 100644 index 00000000..8b36e5f6 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/oneflag.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/sab.gscbin b/data/IW5/maps/mp/gametypes/sab.gscbin new file mode 100644 index 00000000..7477d8ac Binary files /dev/null and b/data/IW5/maps/mp/gametypes/sab.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/sd.gscbin b/data/IW5/maps/mp/gametypes/sd.gscbin new file mode 100644 index 00000000..b80dc2dc Binary files /dev/null and b/data/IW5/maps/mp/gametypes/sd.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/tdef.gscbin b/data/IW5/maps/mp/gametypes/tdef.gscbin new file mode 100644 index 00000000..d9710eac Binary files /dev/null and b/data/IW5/maps/mp/gametypes/tdef.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/tjugg.gscbin b/data/IW5/maps/mp/gametypes/tjugg.gscbin new file mode 100644 index 00000000..649926a9 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/tjugg.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/vip.gscbin b/data/IW5/maps/mp/gametypes/vip.gscbin new file mode 100644 index 00000000..f1ff4ce2 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/vip.gscbin differ diff --git a/data/IW5/maps/mp/gametypes/war.gscbin b/data/IW5/maps/mp/gametypes/war.gscbin new file mode 100644 index 00000000..ab3cbef0 Binary files /dev/null and b/data/IW5/maps/mp/gametypes/war.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_a10.gscbin b/data/IW5/maps/mp/killstreaks/_a10.gscbin new file mode 100644 index 00000000..bbf850f2 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_a10.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_aamissile.gscbin b/data/IW5/maps/mp/killstreaks/_aamissile.gscbin new file mode 100644 index 00000000..3bbf3c37 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_aamissile.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_aastrike.gscbin b/data/IW5/maps/mp/killstreaks/_aastrike.gscbin new file mode 100644 index 00000000..ae330844 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_aastrike.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_ac130.gscbin b/data/IW5/maps/mp/killstreaks/_ac130.gscbin new file mode 100644 index 00000000..663f857b Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_ac130.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_airdrop.gscbin b/data/IW5/maps/mp/killstreaks/_airdrop.gscbin new file mode 100644 index 00000000..1148c764 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_airdrop.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_airstrike.gscbin b/data/IW5/maps/mp/killstreaks/_airstrike.gscbin new file mode 100644 index 00000000..4d94e8f4 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_airstrike.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_autosentry.gscbin b/data/IW5/maps/mp/killstreaks/_autosentry.gscbin new file mode 100644 index 00000000..6804d247 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_autosentry.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_autoshotgun.gscbin b/data/IW5/maps/mp/killstreaks/_autoshotgun.gscbin new file mode 100644 index 00000000..b73d24e1 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_autoshotgun.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_deployablebox.gscbin b/data/IW5/maps/mp/killstreaks/_deployablebox.gscbin new file mode 100644 index 00000000..72150de4 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_deployablebox.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_emp.gscbin b/data/IW5/maps/mp/killstreaks/_emp.gscbin new file mode 100644 index 00000000..c9bb5db9 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_emp.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_escortairdrop.gscbin b/data/IW5/maps/mp/killstreaks/_escortairdrop.gscbin new file mode 100644 index 00000000..594a516b Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_escortairdrop.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_harrier.gscbin b/data/IW5/maps/mp/killstreaks/_harrier.gscbin new file mode 100644 index 00000000..3b2868a5 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_harrier.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_helicopter.gscbin b/data/IW5/maps/mp/killstreaks/_helicopter.gscbin new file mode 100644 index 00000000..3fc2ade9 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_helicopter.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_helicopter_flock.gscbin b/data/IW5/maps/mp/killstreaks/_helicopter_flock.gscbin new file mode 100644 index 00000000..b92689e9 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_helicopter_flock.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_helicopter_guard.gscbin b/data/IW5/maps/mp/killstreaks/_helicopter_guard.gscbin new file mode 100644 index 00000000..8fea2ea2 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_helicopter_guard.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_ims.gscbin b/data/IW5/maps/mp/killstreaks/_ims.gscbin new file mode 100644 index 00000000..a00cb611 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_ims.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_juggernaut.gscbin b/data/IW5/maps/mp/killstreaks/_juggernaut.gscbin new file mode 100644 index 00000000..4539a613 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_juggernaut.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_killstreaks.gscbin b/data/IW5/maps/mp/killstreaks/_killstreaks.gscbin new file mode 100644 index 00000000..0d792fda Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_killstreaks.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_mobilemortar.gscbin b/data/IW5/maps/mp/killstreaks/_mobilemortar.gscbin new file mode 100644 index 00000000..920e44be Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_mobilemortar.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_nuke.gscbin b/data/IW5/maps/mp/killstreaks/_nuke.gscbin new file mode 100644 index 00000000..9cbe4261 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_nuke.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_pavelow.gscbin b/data/IW5/maps/mp/killstreaks/_pavelow.gscbin new file mode 100644 index 00000000..909fedf1 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_pavelow.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_perkstreaks.gscbin b/data/IW5/maps/mp/killstreaks/_perkstreaks.gscbin new file mode 100644 index 00000000..fe0778a3 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_perkstreaks.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_reaper.gscbin b/data/IW5/maps/mp/killstreaks/_reaper.gscbin new file mode 100644 index 00000000..3fbc5f74 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_reaper.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_remotemissile.gscbin b/data/IW5/maps/mp/killstreaks/_remotemissile.gscbin new file mode 100644 index 00000000..8a6adb61 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_remotemissile.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_remotemortar.gscbin b/data/IW5/maps/mp/killstreaks/_remotemortar.gscbin new file mode 100644 index 00000000..97169614 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_remotemortar.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_remotetank.gscbin b/data/IW5/maps/mp/killstreaks/_remotetank.gscbin new file mode 100644 index 00000000..81dd1eeb Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_remotetank.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_remoteturret.gscbin b/data/IW5/maps/mp/killstreaks/_remoteturret.gscbin new file mode 100644 index 00000000..744645b3 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_remoteturret.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_remoteuav.gscbin b/data/IW5/maps/mp/killstreaks/_remoteuav.gscbin new file mode 100644 index 00000000..a8de6410 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_remoteuav.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_tank.gscbin b/data/IW5/maps/mp/killstreaks/_tank.gscbin new file mode 100644 index 00000000..37efcb4c Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_tank.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_teamammorefill.gscbin b/data/IW5/maps/mp/killstreaks/_teamammorefill.gscbin new file mode 100644 index 00000000..337ee778 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_teamammorefill.gscbin differ diff --git a/data/IW5/maps/mp/killstreaks/_uav.gscbin b/data/IW5/maps/mp/killstreaks/_uav.gscbin new file mode 100644 index 00000000..d686e345 Binary files /dev/null and b/data/IW5/maps/mp/killstreaks/_uav.gscbin differ diff --git a/data/IW5/maps/mp/mp_dome.gscbin b/data/IW5/maps/mp/mp_dome.gscbin new file mode 100644 index 00000000..1eed4435 Binary files /dev/null and b/data/IW5/maps/mp/mp_dome.gscbin differ diff --git a/data/IW5/maps/mp/perks/_perkfunctions.gscbin b/data/IW5/maps/mp/perks/_perkfunctions.gscbin new file mode 100644 index 00000000..a6cfe15a Binary files /dev/null and b/data/IW5/maps/mp/perks/_perkfunctions.gscbin differ diff --git a/data/IW5/maps/mp/perks/_perks.gscbin b/data/IW5/maps/mp/perks/_perks.gscbin new file mode 100644 index 00000000..ebe71a86 Binary files /dev/null and b/data/IW5/maps/mp/perks/_perks.gscbin differ diff --git a/data/IW5/maps/ny_blackhawk.gscbin b/data/IW5/maps/ny_blackhawk.gscbin new file mode 100644 index 00000000..27415029 Binary files /dev/null and b/data/IW5/maps/ny_blackhawk.gscbin differ diff --git a/data/IW5/maps/ny_harbor_anim.gscbin b/data/IW5/maps/ny_harbor_anim.gscbin new file mode 100644 index 00000000..ca647caa Binary files /dev/null and b/data/IW5/maps/ny_harbor_anim.gscbin differ diff --git a/data/IW5/maps/ny_harbor_aud.gscbin b/data/IW5/maps/ny_harbor_aud.gscbin new file mode 100644 index 00000000..8dcfae13 Binary files /dev/null and b/data/IW5/maps/ny_harbor_aud.gscbin differ diff --git a/data/IW5/maps/ny_harbor_code_sub.gscbin b/data/IW5/maps/ny_harbor_code_sub.gscbin new file mode 100644 index 00000000..a0b5556d Binary files /dev/null and b/data/IW5/maps/ny_harbor_code_sub.gscbin differ diff --git a/data/IW5/maps/ny_harbor_code_vo.gscbin b/data/IW5/maps/ny_harbor_code_vo.gscbin new file mode 100644 index 00000000..644145d8 Binary files /dev/null and b/data/IW5/maps/ny_harbor_code_vo.gscbin differ diff --git a/data/IW5/maps/ny_hind.gscbin b/data/IW5/maps/ny_hind.gscbin new file mode 100644 index 00000000..3e619cc7 Binary files /dev/null and b/data/IW5/maps/ny_hind.gscbin differ diff --git a/data/IW5/maps/ny_hind_ai.gscbin b/data/IW5/maps/ny_hind_ai.gscbin new file mode 100644 index 00000000..3516051d Binary files /dev/null and b/data/IW5/maps/ny_hind_ai.gscbin differ diff --git a/data/IW5/maps/ny_manhattan.gscbin b/data/IW5/maps/ny_manhattan.gscbin new file mode 100644 index 00000000..483be150 Binary files /dev/null and b/data/IW5/maps/ny_manhattan.gscbin differ diff --git a/data/IW5/maps/ny_manhattan_anim.gscbin b/data/IW5/maps/ny_manhattan_anim.gscbin new file mode 100644 index 00000000..9e0471d1 Binary files /dev/null and b/data/IW5/maps/ny_manhattan_anim.gscbin differ diff --git a/data/IW5/maps/ny_manhattan_code_downtown.gscbin b/data/IW5/maps/ny_manhattan_code_downtown.gscbin new file mode 100644 index 00000000..57c92a34 Binary files /dev/null and b/data/IW5/maps/ny_manhattan_code_downtown.gscbin differ diff --git a/data/IW5/maps/ny_manhattan_code_hind.gscbin b/data/IW5/maps/ny_manhattan_code_hind.gscbin new file mode 100644 index 00000000..0639df96 Binary files /dev/null and b/data/IW5/maps/ny_manhattan_code_hind.gscbin differ diff --git a/data/IW5/maps/ny_manhattan_code_intro.gscbin b/data/IW5/maps/ny_manhattan_code_intro.gscbin new file mode 100644 index 00000000..649b9215 Binary files /dev/null and b/data/IW5/maps/ny_manhattan_code_intro.gscbin differ diff --git a/data/IW5/maps/ocean_perlin.gscbin b/data/IW5/maps/ocean_perlin.gscbin new file mode 100644 index 00000000..2e8d4c3f Binary files /dev/null and b/data/IW5/maps/ocean_perlin.gscbin differ diff --git a/data/IW5/maps/paris_a.gscbin b/data/IW5/maps/paris_a.gscbin new file mode 100644 index 00000000..4b87f2f5 Binary files /dev/null and b/data/IW5/maps/paris_a.gscbin differ diff --git a/data/IW5/maps/paris_a_anim.gscbin b/data/IW5/maps/paris_a_anim.gscbin new file mode 100644 index 00000000..42219bee Binary files /dev/null and b/data/IW5/maps/paris_a_anim.gscbin differ diff --git a/data/IW5/maps/paris_a_code.gscbin b/data/IW5/maps/paris_a_code.gscbin new file mode 100644 index 00000000..4b3ec40c Binary files /dev/null and b/data/IW5/maps/paris_a_code.gscbin differ diff --git a/data/IW5/maps/paris_a_vo.gscbin b/data/IW5/maps/paris_a_vo.gscbin new file mode 100644 index 00000000..1f72b8bb Binary files /dev/null and b/data/IW5/maps/paris_a_vo.gscbin differ diff --git a/data/IW5/maps/paris_ac130.gscbin b/data/IW5/maps/paris_ac130.gscbin new file mode 100644 index 00000000..0abae9de Binary files /dev/null and b/data/IW5/maps/paris_ac130.gscbin differ diff --git a/data/IW5/maps/paris_ac130_anim.gscbin b/data/IW5/maps/paris_ac130_anim.gscbin new file mode 100644 index 00000000..c823a272 Binary files /dev/null and b/data/IW5/maps/paris_ac130_anim.gscbin differ diff --git a/data/IW5/maps/paris_ac130_code.gscbin b/data/IW5/maps/paris_ac130_code.gscbin new file mode 100644 index 00000000..52ccfcb1 Binary files /dev/null and b/data/IW5/maps/paris_ac130_code.gscbin differ diff --git a/data/IW5/maps/paris_ac130_pip.gscbin b/data/IW5/maps/paris_ac130_pip.gscbin new file mode 100644 index 00000000..e543725f Binary files /dev/null and b/data/IW5/maps/paris_ac130_pip.gscbin differ diff --git a/data/IW5/maps/paris_ac130_slamzoom.gscbin b/data/IW5/maps/paris_ac130_slamzoom.gscbin new file mode 100644 index 00000000..2620640b Binary files /dev/null and b/data/IW5/maps/paris_ac130_slamzoom.gscbin differ diff --git a/data/IW5/maps/paris_ac130_slamzoom_code.gscbin b/data/IW5/maps/paris_ac130_slamzoom_code.gscbin new file mode 100644 index 00000000..f7bf8c1e Binary files /dev/null and b/data/IW5/maps/paris_ac130_slamzoom_code.gscbin differ diff --git a/data/IW5/maps/paris_ac130_snd.gscbin b/data/IW5/maps/paris_ac130_snd.gscbin new file mode 100644 index 00000000..661699b4 Binary files /dev/null and b/data/IW5/maps/paris_ac130_snd.gscbin differ diff --git a/data/IW5/maps/paris_aud.gscbin b/data/IW5/maps/paris_aud.gscbin new file mode 100644 index 00000000..aa1a81bb Binary files /dev/null and b/data/IW5/maps/paris_aud.gscbin differ diff --git a/data/IW5/maps/paris_b.gscbin b/data/IW5/maps/paris_b.gscbin new file mode 100644 index 00000000..016c638d Binary files /dev/null and b/data/IW5/maps/paris_b.gscbin differ diff --git a/data/IW5/maps/paris_b_anim.gscbin b/data/IW5/maps/paris_b_anim.gscbin new file mode 100644 index 00000000..f1ca54b7 Binary files /dev/null and b/data/IW5/maps/paris_b_anim.gscbin differ diff --git a/data/IW5/maps/paris_b_code.gscbin b/data/IW5/maps/paris_b_code.gscbin new file mode 100644 index 00000000..ad8ecd3f Binary files /dev/null and b/data/IW5/maps/paris_b_code.gscbin differ diff --git a/data/IW5/maps/paris_b_vo.gscbin b/data/IW5/maps/paris_b_vo.gscbin new file mode 100644 index 00000000..84274403 Binary files /dev/null and b/data/IW5/maps/paris_b_vo.gscbin differ diff --git a/data/IW5/maps/paris_shared.gscbin b/data/IW5/maps/paris_shared.gscbin new file mode 100644 index 00000000..1d0838ea Binary files /dev/null and b/data/IW5/maps/paris_shared.gscbin differ diff --git a/data/IW5/maps/payback.gscbin b/data/IW5/maps/payback.gscbin new file mode 100644 index 00000000..289341a8 Binary files /dev/null and b/data/IW5/maps/payback.gscbin differ diff --git a/data/IW5/maps/payback_anim.gscbin b/data/IW5/maps/payback_anim.gscbin new file mode 100644 index 00000000..519d8c03 Binary files /dev/null and b/data/IW5/maps/payback_anim.gscbin differ diff --git a/data/IW5/maps/payback_aud.gscbin b/data/IW5/maps/payback_aud.gscbin new file mode 100644 index 00000000..ca535772 Binary files /dev/null and b/data/IW5/maps/payback_aud.gscbin differ diff --git a/data/IW5/maps/payback_aud_utils.gscbin b/data/IW5/maps/payback_aud_utils.gscbin new file mode 100644 index 00000000..8108a317 Binary files /dev/null and b/data/IW5/maps/payback_aud_utils.gscbin differ diff --git a/data/IW5/maps/payback_env_code.gscbin b/data/IW5/maps/payback_env_code.gscbin new file mode 100644 index 00000000..7c4b25db Binary files /dev/null and b/data/IW5/maps/payback_env_code.gscbin differ diff --git a/data/IW5/maps/payback_main.gscbin b/data/IW5/maps/payback_main.gscbin new file mode 100644 index 00000000..0859fbba Binary files /dev/null and b/data/IW5/maps/payback_main.gscbin differ diff --git a/data/IW5/maps/payback_rescue.gscbin b/data/IW5/maps/payback_rescue.gscbin new file mode 100644 index 00000000..3c5bd6d7 Binary files /dev/null and b/data/IW5/maps/payback_rescue.gscbin differ diff --git a/data/IW5/maps/payback_sandstorm.gscbin b/data/IW5/maps/payback_sandstorm.gscbin new file mode 100644 index 00000000..a8d702b2 Binary files /dev/null and b/data/IW5/maps/payback_sandstorm.gscbin differ diff --git a/data/IW5/maps/payback_sandstorm_code.gscbin b/data/IW5/maps/payback_sandstorm_code.gscbin new file mode 100644 index 00000000..45413a12 Binary files /dev/null and b/data/IW5/maps/payback_sandstorm_code.gscbin differ diff --git a/data/IW5/maps/payback_util.gscbin b/data/IW5/maps/payback_util.gscbin new file mode 100644 index 00000000..0f7dc7a2 Binary files /dev/null and b/data/IW5/maps/payback_util.gscbin differ diff --git a/data/IW5/maps/prague_church_script.gscbin b/data/IW5/maps/prague_church_script.gscbin new file mode 100644 index 00000000..d8cdd3a2 Binary files /dev/null and b/data/IW5/maps/prague_church_script.gscbin differ diff --git a/data/IW5/maps/prague_courtyard_script.gscbin b/data/IW5/maps/prague_courtyard_script.gscbin new file mode 100644 index 00000000..febb4fb7 Binary files /dev/null and b/data/IW5/maps/prague_courtyard_script.gscbin differ diff --git a/data/IW5/maps/prague_courtyard_script_code.gscbin b/data/IW5/maps/prague_courtyard_script_code.gscbin new file mode 100644 index 00000000..ceb98ed9 Binary files /dev/null and b/data/IW5/maps/prague_courtyard_script_code.gscbin differ diff --git a/data/IW5/maps/prague_escape.gscbin b/data/IW5/maps/prague_escape.gscbin new file mode 100644 index 00000000..71853371 Binary files /dev/null and b/data/IW5/maps/prague_escape.gscbin differ diff --git a/data/IW5/maps/prague_escape_airlift.gscbin b/data/IW5/maps/prague_escape_airlift.gscbin new file mode 100644 index 00000000..08b21a23 Binary files /dev/null and b/data/IW5/maps/prague_escape_airlift.gscbin differ diff --git a/data/IW5/maps/prague_escape_airport.gscbin b/data/IW5/maps/prague_escape_airport.gscbin new file mode 100644 index 00000000..627b229a Binary files /dev/null and b/data/IW5/maps/prague_escape_airport.gscbin differ diff --git a/data/IW5/maps/prague_escape_amb.gscbin b/data/IW5/maps/prague_escape_amb.gscbin new file mode 100644 index 00000000..34164748 Binary files /dev/null and b/data/IW5/maps/prague_escape_amb.gscbin differ diff --git a/data/IW5/maps/prague_escape_anim.gscbin b/data/IW5/maps/prague_escape_anim.gscbin new file mode 100644 index 00000000..cd4e8674 Binary files /dev/null and b/data/IW5/maps/prague_escape_anim.gscbin differ diff --git a/data/IW5/maps/prague_escape_bank.gscbin b/data/IW5/maps/prague_escape_bank.gscbin new file mode 100644 index 00000000..7a09edad Binary files /dev/null and b/data/IW5/maps/prague_escape_bank.gscbin differ diff --git a/data/IW5/maps/prague_escape_code.gscbin b/data/IW5/maps/prague_escape_code.gscbin new file mode 100644 index 00000000..6fbcc00e Binary files /dev/null and b/data/IW5/maps/prague_escape_code.gscbin differ diff --git a/data/IW5/maps/prague_escape_defend.gscbin b/data/IW5/maps/prague_escape_defend.gscbin new file mode 100644 index 00000000..7fd73ff6 Binary files /dev/null and b/data/IW5/maps/prague_escape_defend.gscbin differ diff --git a/data/IW5/maps/prague_escape_dumpster.gscbin b/data/IW5/maps/prague_escape_dumpster.gscbin new file mode 100644 index 00000000..a97dab9c Binary files /dev/null and b/data/IW5/maps/prague_escape_dumpster.gscbin differ diff --git a/data/IW5/maps/prague_escape_flashback_airport.gscbin b/data/IW5/maps/prague_escape_flashback_airport.gscbin new file mode 100644 index 00000000..5c511e28 Binary files /dev/null and b/data/IW5/maps/prague_escape_flashback_airport.gscbin differ diff --git a/data/IW5/maps/prague_escape_flashback_airport_code.gscbin b/data/IW5/maps/prague_escape_flashback_airport_code.gscbin new file mode 100644 index 00000000..3522dc4f Binary files /dev/null and b/data/IW5/maps/prague_escape_flashback_airport_code.gscbin differ diff --git a/data/IW5/maps/prague_escape_flashback_nuke.gscbin b/data/IW5/maps/prague_escape_flashback_nuke.gscbin new file mode 100644 index 00000000..618aca9a Binary files /dev/null and b/data/IW5/maps/prague_escape_flashback_nuke.gscbin differ diff --git a/data/IW5/maps/prague_escape_flashback_sniper.gscbin b/data/IW5/maps/prague_escape_flashback_sniper.gscbin new file mode 100644 index 00000000..fa753c87 Binary files /dev/null and b/data/IW5/maps/prague_escape_flashback_sniper.gscbin differ diff --git a/data/IW5/maps/prague_escape_medic.gscbin b/data/IW5/maps/prague_escape_medic.gscbin new file mode 100644 index 00000000..e091eab6 Binary files /dev/null and b/data/IW5/maps/prague_escape_medic.gscbin differ diff --git a/data/IW5/maps/prague_escape_outro.gscbin b/data/IW5/maps/prague_escape_outro.gscbin new file mode 100644 index 00000000..9ddcd7aa Binary files /dev/null and b/data/IW5/maps/prague_escape_outro.gscbin differ diff --git a/data/IW5/maps/prague_escape_scaffold.gscbin b/data/IW5/maps/prague_escape_scaffold.gscbin new file mode 100644 index 00000000..178962d0 Binary files /dev/null and b/data/IW5/maps/prague_escape_scaffold.gscbin differ diff --git a/data/IW5/maps/prague_escape_sniper.gscbin b/data/IW5/maps/prague_escape_sniper.gscbin new file mode 100644 index 00000000..1cb7bb7c Binary files /dev/null and b/data/IW5/maps/prague_escape_sniper.gscbin differ diff --git a/data/IW5/maps/prague_escape_soap_carry.gscbin b/data/IW5/maps/prague_escape_soap_carry.gscbin new file mode 100644 index 00000000..6c7578b5 Binary files /dev/null and b/data/IW5/maps/prague_escape_soap_carry.gscbin differ diff --git a/data/IW5/maps/prague_escape_statue.gscbin b/data/IW5/maps/prague_escape_statue.gscbin new file mode 100644 index 00000000..ff0aeeab Binary files /dev/null and b/data/IW5/maps/prague_escape_statue.gscbin differ diff --git a/data/IW5/maps/prague_escape_store.gscbin b/data/IW5/maps/prague_escape_store.gscbin new file mode 100644 index 00000000..d3fa4497 Binary files /dev/null and b/data/IW5/maps/prague_escape_store.gscbin differ diff --git a/data/IW5/maps/prague_escape_to_cellar.gscbin b/data/IW5/maps/prague_escape_to_cellar.gscbin new file mode 100644 index 00000000..befd8a4a Binary files /dev/null and b/data/IW5/maps/prague_escape_to_cellar.gscbin differ diff --git a/data/IW5/maps/prague_plaza_script.gscbin b/data/IW5/maps/prague_plaza_script.gscbin new file mode 100644 index 00000000..3c29affc Binary files /dev/null and b/data/IW5/maps/prague_plaza_script.gscbin differ diff --git a/data/IW5/maps/rescue_2.gscbin b/data/IW5/maps/rescue_2.gscbin new file mode 100644 index 00000000..c8e2e169 Binary files /dev/null and b/data/IW5/maps/rescue_2.gscbin differ diff --git a/data/IW5/maps/rescue_2_amb.gscbin b/data/IW5/maps/rescue_2_amb.gscbin new file mode 100644 index 00000000..837d6d39 Binary files /dev/null and b/data/IW5/maps/rescue_2_amb.gscbin differ diff --git a/data/IW5/maps/rescue_2_anim.gscbin b/data/IW5/maps/rescue_2_anim.gscbin new file mode 100644 index 00000000..4581e961 Binary files /dev/null and b/data/IW5/maps/rescue_2_anim.gscbin differ diff --git a/data/IW5/maps/rescue_2_anim_props.gscbin b/data/IW5/maps/rescue_2_anim_props.gscbin new file mode 100644 index 00000000..f3e24c12 Binary files /dev/null and b/data/IW5/maps/rescue_2_anim_props.gscbin differ diff --git a/data/IW5/maps/rescue_2_cavern_code.gscbin b/data/IW5/maps/rescue_2_cavern_code.gscbin new file mode 100644 index 00000000..1d80e4af Binary files /dev/null and b/data/IW5/maps/rescue_2_cavern_code.gscbin differ diff --git a/data/IW5/maps/rescue_2_cavern_script.gscbin b/data/IW5/maps/rescue_2_cavern_script.gscbin new file mode 100644 index 00000000..5ace8adf Binary files /dev/null and b/data/IW5/maps/rescue_2_cavern_script.gscbin differ diff --git a/data/IW5/maps/rescue_2_code.gscbin b/data/IW5/maps/rescue_2_code.gscbin new file mode 100644 index 00000000..db183ca7 Binary files /dev/null and b/data/IW5/maps/rescue_2_code.gscbin differ diff --git a/data/IW5/maps/so_aud.gscbin b/data/IW5/maps/so_aud.gscbin new file mode 100644 index 00000000..fe9c5e48 Binary files /dev/null and b/data/IW5/maps/so_aud.gscbin differ diff --git a/data/IW5/maps/so_survival_mp_alpha.gscbin b/data/IW5/maps/so_survival_mp_alpha.gscbin new file mode 100644 index 00000000..e74dd0c7 Binary files /dev/null and b/data/IW5/maps/so_survival_mp_alpha.gscbin differ diff --git a/data/IW5/maps/sp_berlin.gscbin b/data/IW5/maps/sp_berlin.gscbin new file mode 100644 index 00000000..19454a19 Binary files /dev/null and b/data/IW5/maps/sp_berlin.gscbin differ diff --git a/data/IW5/maps/sp_dubai.gscbin b/data/IW5/maps/sp_dubai.gscbin new file mode 100644 index 00000000..99dcc462 Binary files /dev/null and b/data/IW5/maps/sp_dubai.gscbin differ diff --git a/data/IW5/maps/ss_util.gscbin b/data/IW5/maps/ss_util.gscbin new file mode 100644 index 00000000..96173309 Binary files /dev/null and b/data/IW5/maps/ss_util.gscbin differ diff --git a/data/IW5/maps/warlord.gscbin b/data/IW5/maps/warlord.gscbin new file mode 100644 index 00000000..961f8b24 Binary files /dev/null and b/data/IW5/maps/warlord.gscbin differ diff --git a/data/IW5/maps/warlord_anim.gscbin b/data/IW5/maps/warlord_anim.gscbin new file mode 100644 index 00000000..2dc9545a Binary files /dev/null and b/data/IW5/maps/warlord_anim.gscbin differ diff --git a/data/IW5/maps/warlord_aud.gscbin b/data/IW5/maps/warlord_aud.gscbin new file mode 100644 index 00000000..dc682a03 Binary files /dev/null and b/data/IW5/maps/warlord_aud.gscbin differ diff --git a/data/IW5/maps/warlord_code.gscbin b/data/IW5/maps/warlord_code.gscbin new file mode 100644 index 00000000..84650e18 Binary files /dev/null and b/data/IW5/maps/warlord_code.gscbin differ diff --git a/data/IW5/maps/warlord_obj.gscbin b/data/IW5/maps/warlord_obj.gscbin new file mode 100644 index 00000000..29773ceb Binary files /dev/null and b/data/IW5/maps/warlord_obj.gscbin differ diff --git a/data/IW5/maps/warlord_stealth.gscbin b/data/IW5/maps/warlord_stealth.gscbin new file mode 100644 index 00000000..0d47cd60 Binary files /dev/null and b/data/IW5/maps/warlord_stealth.gscbin differ diff --git a/data/IW5/maps/warlord_utility.gscbin b/data/IW5/maps/warlord_utility.gscbin new file mode 100644 index 00000000..cbd10d27 Binary files /dev/null and b/data/IW5/maps/warlord_utility.gscbin differ diff --git a/data/IW5/maps/warlord_vo.gscbin b/data/IW5/maps/warlord_vo.gscbin new file mode 100644 index 00000000..11b39cf9 Binary files /dev/null and b/data/IW5/maps/warlord_vo.gscbin differ diff --git a/data/IW5/maps/westminster_code.gscbin b/data/IW5/maps/westminster_code.gscbin new file mode 100644 index 00000000..c86ab125 Binary files /dev/null and b/data/IW5/maps/westminster_code.gscbin differ diff --git a/data/IW5/maps/westminster_starts.gscbin b/data/IW5/maps/westminster_starts.gscbin new file mode 100644 index 00000000..7cc0f894 Binary files /dev/null and b/data/IW5/maps/westminster_starts.gscbin differ diff --git a/data/IW5/maps/westminster_station.gscbin b/data/IW5/maps/westminster_station.gscbin new file mode 100644 index 00000000..3f3b5317 Binary files /dev/null and b/data/IW5/maps/westminster_station.gscbin differ diff --git a/data/IW5/maps/westminster_truck_movement.gscbin b/data/IW5/maps/westminster_truck_movement.gscbin new file mode 100644 index 00000000..5f1c1e92 Binary files /dev/null and b/data/IW5/maps/westminster_truck_movement.gscbin differ diff --git a/data/IW5/maps/westminster_tunnels.gscbin b/data/IW5/maps/westminster_tunnels.gscbin new file mode 100644 index 00000000..b910e560 Binary files /dev/null and b/data/IW5/maps/westminster_tunnels.gscbin differ diff --git a/data/IW5/maps/westminster_tunnels_anim.gscbin b/data/IW5/maps/westminster_tunnels_anim.gscbin new file mode 100644 index 00000000..f7866bbe Binary files /dev/null and b/data/IW5/maps/westminster_tunnels_anim.gscbin differ diff --git a/data/IW5/xmodelalias/alias_pmc_africa_heads.gscbin b/data/IW5/xmodelalias/alias_pmc_africa_heads.gscbin new file mode 100644 index 00000000..8737ac8d Binary files /dev/null and b/data/IW5/xmodelalias/alias_pmc_africa_heads.gscbin differ diff --git a/data/IW6/_unamed/36620.gscbin b/data/IW6/_unamed/36620.gscbin new file mode 100644 index 00000000..f0717d74 Binary files /dev/null and b/data/IW6/_unamed/36620.gscbin differ diff --git a/data/IW6/_unamed/36631.gscbin b/data/IW6/_unamed/36631.gscbin new file mode 100644 index 00000000..757a3993 Binary files /dev/null and b/data/IW6/_unamed/36631.gscbin differ diff --git a/data/IW6/_unamed/36632.gscbin b/data/IW6/_unamed/36632.gscbin new file mode 100644 index 00000000..f2f16ef4 Binary files /dev/null and b/data/IW6/_unamed/36632.gscbin differ diff --git a/data/IW6/_unamed/36633.gscbin b/data/IW6/_unamed/36633.gscbin new file mode 100644 index 00000000..078a068e Binary files /dev/null and b/data/IW6/_unamed/36633.gscbin differ diff --git a/data/IW6/_unamed/36634.gscbin b/data/IW6/_unamed/36634.gscbin new file mode 100644 index 00000000..5288b1a8 Binary files /dev/null and b/data/IW6/_unamed/36634.gscbin differ diff --git a/data/IW6/_unamed/36635.gscbin b/data/IW6/_unamed/36635.gscbin new file mode 100644 index 00000000..4750cf01 Binary files /dev/null and b/data/IW6/_unamed/36635.gscbin differ diff --git a/data/IW6/_unamed/36636.gscbin b/data/IW6/_unamed/36636.gscbin new file mode 100644 index 00000000..42e9d833 Binary files /dev/null and b/data/IW6/_unamed/36636.gscbin differ diff --git a/data/IW6/_unamed/36637.gscbin b/data/IW6/_unamed/36637.gscbin new file mode 100644 index 00000000..fcc73b4b Binary files /dev/null and b/data/IW6/_unamed/36637.gscbin differ diff --git a/data/IW6/_unamed/36638.gscbin b/data/IW6/_unamed/36638.gscbin new file mode 100644 index 00000000..1064f178 Binary files /dev/null and b/data/IW6/_unamed/36638.gscbin differ diff --git a/data/IW6/_unamed/36639.gscbin b/data/IW6/_unamed/36639.gscbin new file mode 100644 index 00000000..516ebf66 Binary files /dev/null and b/data/IW6/_unamed/36639.gscbin differ diff --git a/data/IW6/_unamed/36640.gscbin b/data/IW6/_unamed/36640.gscbin new file mode 100644 index 00000000..92d6a0bc Binary files /dev/null and b/data/IW6/_unamed/36640.gscbin differ diff --git a/data/IW6/_unamed/36641.gscbin b/data/IW6/_unamed/36641.gscbin new file mode 100644 index 00000000..5c294492 Binary files /dev/null and b/data/IW6/_unamed/36641.gscbin differ diff --git a/data/IW6/_unamed/36642.gscbin b/data/IW6/_unamed/36642.gscbin new file mode 100644 index 00000000..1333f0b2 Binary files /dev/null and b/data/IW6/_unamed/36642.gscbin differ diff --git a/data/IW6/_unamed/36643.gscbin b/data/IW6/_unamed/36643.gscbin new file mode 100644 index 00000000..7c3ec9a3 Binary files /dev/null and b/data/IW6/_unamed/36643.gscbin differ diff --git a/data/IW6/_unamed/36644.gscbin b/data/IW6/_unamed/36644.gscbin new file mode 100644 index 00000000..908d92ff Binary files /dev/null and b/data/IW6/_unamed/36644.gscbin differ diff --git a/data/IW6/codescripts/character.gscbin b/data/IW6/codescripts/character.gscbin new file mode 100644 index 00000000..b3a91052 Binary files /dev/null and b/data/IW6/codescripts/character.gscbin differ diff --git a/data/IW6/codescripts/delete.gscbin b/data/IW6/codescripts/delete.gscbin new file mode 100644 index 00000000..725d6a6e Binary files /dev/null and b/data/IW6/codescripts/delete.gscbin differ diff --git a/data/IW6/codescripts/struct.gscbin b/data/IW6/codescripts/struct.gscbin new file mode 100644 index 00000000..535d77f9 Binary files /dev/null and b/data/IW6/codescripts/struct.gscbin differ diff --git a/data/IW6/common_scripts/_artcommon.gscbin b/data/IW6/common_scripts/_artcommon.gscbin new file mode 100644 index 00000000..7c38c1da Binary files /dev/null and b/data/IW6/common_scripts/_artcommon.gscbin differ diff --git a/data/IW6/common_scripts/_bcs_location_trigs.gscbin b/data/IW6/common_scripts/_bcs_location_trigs.gscbin new file mode 100644 index 00000000..6a1ff17f Binary files /dev/null and b/data/IW6/common_scripts/_bcs_location_trigs.gscbin differ diff --git a/data/IW6/common_scripts/_createfx.gscbin b/data/IW6/common_scripts/_createfx.gscbin new file mode 100644 index 00000000..f4118701 Binary files /dev/null and b/data/IW6/common_scripts/_createfx.gscbin differ diff --git a/data/IW6/common_scripts/_createfxmenu.gscbin b/data/IW6/common_scripts/_createfxmenu.gscbin new file mode 100644 index 00000000..ddc4f5a7 Binary files /dev/null and b/data/IW6/common_scripts/_createfxmenu.gscbin differ diff --git a/data/IW6/common_scripts/_csplines.gscbin b/data/IW6/common_scripts/_csplines.gscbin new file mode 100644 index 00000000..90f5fbd3 Binary files /dev/null and b/data/IW6/common_scripts/_csplines.gscbin differ diff --git a/data/IW6/common_scripts/_destructible.gscbin b/data/IW6/common_scripts/_destructible.gscbin new file mode 100644 index 00000000..afd97a8d Binary files /dev/null and b/data/IW6/common_scripts/_destructible.gscbin differ diff --git a/data/IW6/common_scripts/_dynamic_world.gscbin b/data/IW6/common_scripts/_dynamic_world.gscbin new file mode 100644 index 00000000..9ab56054 Binary files /dev/null and b/data/IW6/common_scripts/_dynamic_world.gscbin differ diff --git a/data/IW6/common_scripts/_elevator.gscbin b/data/IW6/common_scripts/_elevator.gscbin new file mode 100644 index 00000000..930359d0 Binary files /dev/null and b/data/IW6/common_scripts/_elevator.gscbin differ diff --git a/data/IW6/common_scripts/_exploder.gscbin b/data/IW6/common_scripts/_exploder.gscbin new file mode 100644 index 00000000..c025ebb8 Binary files /dev/null and b/data/IW6/common_scripts/_exploder.gscbin differ diff --git a/data/IW6/common_scripts/_fx.gscbin b/data/IW6/common_scripts/_fx.gscbin new file mode 100644 index 00000000..3c9217ba Binary files /dev/null and b/data/IW6/common_scripts/_fx.gscbin differ diff --git a/data/IW6/common_scripts/_pipes.gscbin b/data/IW6/common_scripts/_pipes.gscbin new file mode 100644 index 00000000..577286f8 Binary files /dev/null and b/data/IW6/common_scripts/_pipes.gscbin differ diff --git a/data/IW6/common_scripts/utility.gscbin b/data/IW6/common_scripts/utility.gscbin new file mode 100644 index 00000000..e8d7aba4 Binary files /dev/null and b/data/IW6/common_scripts/utility.gscbin differ diff --git a/data/IW6/destructible_scripts/toy_chicken.gscbin b/data/IW6/destructible_scripts/toy_chicken.gscbin new file mode 100644 index 00000000..0f5babff Binary files /dev/null and b/data/IW6/destructible_scripts/toy_chicken.gscbin differ diff --git a/data/IW6/destructible_scripts/toy_chicken_black_white.gscbin b/data/IW6/destructible_scripts/toy_chicken_black_white.gscbin new file mode 100644 index 00000000..a199d58d Binary files /dev/null and b/data/IW6/destructible_scripts/toy_chicken_black_white.gscbin differ diff --git a/data/IW6/destructible_scripts/toy_chicken_common.gscbin b/data/IW6/destructible_scripts/toy_chicken_common.gscbin new file mode 100644 index 00000000..19e7dd12 Binary files /dev/null and b/data/IW6/destructible_scripts/toy_chicken_common.gscbin differ diff --git a/data/IW6/destructible_scripts/toy_filecabinet.gscbin b/data/IW6/destructible_scripts/toy_filecabinet.gscbin new file mode 100644 index 00000000..ae90ce29 Binary files /dev/null and b/data/IW6/destructible_scripts/toy_filecabinet.gscbin differ diff --git a/data/IW6/destructible_scripts/toy_light_ceiling_fluorescent.gscbin b/data/IW6/destructible_scripts/toy_light_ceiling_fluorescent.gscbin new file mode 100644 index 00000000..ddaa9029 Binary files /dev/null and b/data/IW6/destructible_scripts/toy_light_ceiling_fluorescent.gscbin differ diff --git a/data/IW6/destructible_scripts/toy_transformer_small01.gscbin b/data/IW6/destructible_scripts/toy_transformer_small01.gscbin new file mode 100644 index 00000000..be7bc9de Binary files /dev/null and b/data/IW6/destructible_scripts/toy_transformer_small01.gscbin differ diff --git a/data/IW6/destructible_scripts/toy_trashcan_metal_closed.gscbin b/data/IW6/destructible_scripts/toy_trashcan_metal_closed.gscbin new file mode 100644 index 00000000..55e0a48d Binary files /dev/null and b/data/IW6/destructible_scripts/toy_trashcan_metal_closed.gscbin differ diff --git a/data/IW6/destructible_scripts/toy_tv_flatscreen.gscbin b/data/IW6/destructible_scripts/toy_tv_flatscreen.gscbin new file mode 100644 index 00000000..2b012e9a Binary files /dev/null and b/data/IW6/destructible_scripts/toy_tv_flatscreen.gscbin differ diff --git a/data/IW6/destructible_scripts/toy_tv_video_monitor.gscbin b/data/IW6/destructible_scripts/toy_tv_video_monitor.gscbin new file mode 100644 index 00000000..a2ae075b Binary files /dev/null and b/data/IW6/destructible_scripts/toy_tv_video_monitor.gscbin differ diff --git a/data/IW6/destructible_scripts/toy_wall_fan.gscbin b/data/IW6/destructible_scripts/toy_wall_fan.gscbin new file mode 100644 index 00000000..af08b289 Binary files /dev/null and b/data/IW6/destructible_scripts/toy_wall_fan.gscbin differ diff --git a/data/IW6/destructible_scripts/vehicle_pickup.gscbin b/data/IW6/destructible_scripts/vehicle_pickup.gscbin new file mode 100644 index 00000000..980d9c32 Binary files /dev/null and b/data/IW6/destructible_scripts/vehicle_pickup.gscbin differ diff --git a/data/IW6/destructible_scripts/vehicle_small_hatch.gscbin b/data/IW6/destructible_scripts/vehicle_small_hatch.gscbin new file mode 100644 index 00000000..146211d8 Binary files /dev/null and b/data/IW6/destructible_scripts/vehicle_small_hatch.gscbin differ diff --git a/data/IW6/destructible_scripts/vehicle_small_hatch_blue.gscbin b/data/IW6/destructible_scripts/vehicle_small_hatch_blue.gscbin new file mode 100644 index 00000000..0dd1721d Binary files /dev/null and b/data/IW6/destructible_scripts/vehicle_small_hatch_blue.gscbin differ diff --git a/data/IW6/destructible_scripts/vehicle_small_hatch_white.gscbin b/data/IW6/destructible_scripts/vehicle_small_hatch_white.gscbin new file mode 100644 index 00000000..74266ff0 Binary files /dev/null and b/data/IW6/destructible_scripts/vehicle_small_hatch_white.gscbin differ diff --git a/data/IW6/maps/animated_models/com_roofvent2.gscbin b/data/IW6/maps/animated_models/com_roofvent2.gscbin new file mode 100644 index 00000000..8a849dee Binary files /dev/null and b/data/IW6/maps/animated_models/com_roofvent2.gscbin differ diff --git a/data/IW6/maps/animated_models/foliage_pacific_bushtree01.gscbin b/data/IW6/maps/animated_models/foliage_pacific_bushtree01.gscbin new file mode 100644 index 00000000..87e77d61 Binary files /dev/null and b/data/IW6/maps/animated_models/foliage_pacific_bushtree01.gscbin differ diff --git a/data/IW6/maps/animated_models/hanging_apron_wind_medium.gscbin b/data/IW6/maps/animated_models/hanging_apron_wind_medium.gscbin new file mode 100644 index 00000000..98c88b90 Binary files /dev/null and b/data/IW6/maps/animated_models/hanging_apron_wind_medium.gscbin differ diff --git a/data/IW6/maps/animated_models/hanging_longsleeve_wind_medium.gscbin b/data/IW6/maps/animated_models/hanging_longsleeve_wind_medium.gscbin new file mode 100644 index 00000000..68cbaffc Binary files /dev/null and b/data/IW6/maps/animated_models/hanging_longsleeve_wind_medium.gscbin differ diff --git a/data/IW6/maps/animated_models/hanging_sheet_wind_medium.gscbin b/data/IW6/maps/animated_models/hanging_sheet_wind_medium.gscbin new file mode 100644 index 00000000..e319f5db Binary files /dev/null and b/data/IW6/maps/animated_models/hanging_sheet_wind_medium.gscbin differ diff --git a/data/IW6/maps/animated_models/hanging_shortsleeve_wind_medium.gscbin b/data/IW6/maps/animated_models/hanging_shortsleeve_wind_medium.gscbin new file mode 100644 index 00000000..5acb6445 Binary files /dev/null and b/data/IW6/maps/animated_models/hanging_shortsleeve_wind_medium.gscbin differ diff --git a/data/IW6/maps/animated_models/mp_flooded_water_debris_bob.gscbin b/data/IW6/maps/animated_models/mp_flooded_water_debris_bob.gscbin new file mode 100644 index 00000000..f150600d Binary files /dev/null and b/data/IW6/maps/animated_models/mp_flooded_water_debris_bob.gscbin differ diff --git a/data/IW6/maps/animated_models/mp_flooded_water_debris_spiral.gscbin b/data/IW6/maps/animated_models/mp_flooded_water_debris_spiral.gscbin new file mode 100644 index 00000000..e66831d1 Binary files /dev/null and b/data/IW6/maps/animated_models/mp_flooded_water_debris_spiral.gscbin differ diff --git a/data/IW6/maps/animated_models/mp_flooded_water_street.gscbin b/data/IW6/maps/animated_models/mp_flooded_water_street.gscbin new file mode 100644 index 00000000..05493643 Binary files /dev/null and b/data/IW6/maps/animated_models/mp_flooded_water_street.gscbin differ diff --git a/data/IW6/maps/animated_models/mp_frag_crane.gscbin b/data/IW6/maps/animated_models/mp_frag_crane.gscbin new file mode 100644 index 00000000..4e1d09e5 Binary files /dev/null and b/data/IW6/maps/animated_models/mp_frag_crane.gscbin differ diff --git a/data/IW6/maps/animated_models/wire_hanging_192long.gscbin b/data/IW6/maps/animated_models/wire_hanging_192long.gscbin new file mode 100644 index 00000000..76c2bafb Binary files /dev/null and b/data/IW6/maps/animated_models/wire_hanging_192long.gscbin differ diff --git a/data/IW6/maps/createart/mp_alien_armory_art.gscbin b/data/IW6/maps/createart/mp_alien_armory_art.gscbin new file mode 100644 index 00000000..0018ace1 Binary files /dev/null and b/data/IW6/maps/createart/mp_alien_armory_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_alien_armory_fog.gscbin b/data/IW6/maps/createart/mp_alien_armory_fog.gscbin new file mode 100644 index 00000000..5b3c5130 Binary files /dev/null and b/data/IW6/maps/createart/mp_alien_armory_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_alien_beacon_art.gscbin b/data/IW6/maps/createart/mp_alien_beacon_art.gscbin new file mode 100644 index 00000000..ebf35777 Binary files /dev/null and b/data/IW6/maps/createart/mp_alien_beacon_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_alien_beacon_fog.gscbin b/data/IW6/maps/createart/mp_alien_beacon_fog.gscbin new file mode 100644 index 00000000..6afeadba Binary files /dev/null and b/data/IW6/maps/createart/mp_alien_beacon_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_alien_dlc3_art.gscbin b/data/IW6/maps/createart/mp_alien_dlc3_art.gscbin new file mode 100644 index 00000000..8c8e8993 Binary files /dev/null and b/data/IW6/maps/createart/mp_alien_dlc3_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_alien_dlc3_fog.gscbin b/data/IW6/maps/createart/mp_alien_dlc3_fog.gscbin new file mode 100644 index 00000000..74e396e2 Binary files /dev/null and b/data/IW6/maps/createart/mp_alien_dlc3_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_alien_last_art.gscbin b/data/IW6/maps/createart/mp_alien_last_art.gscbin new file mode 100644 index 00000000..b784e3a2 Binary files /dev/null and b/data/IW6/maps/createart/mp_alien_last_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_alien_last_fog.gscbin b/data/IW6/maps/createart/mp_alien_last_fog.gscbin new file mode 100644 index 00000000..3978a97f Binary files /dev/null and b/data/IW6/maps/createart/mp_alien_last_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_alien_town_art.gscbin b/data/IW6/maps/createart/mp_alien_town_art.gscbin new file mode 100644 index 00000000..977fbc09 Binary files /dev/null and b/data/IW6/maps/createart/mp_alien_town_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_alien_town_fog.gscbin b/data/IW6/maps/createart/mp_alien_town_fog.gscbin new file mode 100644 index 00000000..b19a81a3 Binary files /dev/null and b/data/IW6/maps/createart/mp_alien_town_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_battery3_art.gscbin b/data/IW6/maps/createart/mp_battery3_art.gscbin new file mode 100644 index 00000000..aa04e209 Binary files /dev/null and b/data/IW6/maps/createart/mp_battery3_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_battery3_fog.gscbin b/data/IW6/maps/createart/mp_battery3_fog.gscbin new file mode 100644 index 00000000..bf2acdf7 Binary files /dev/null and b/data/IW6/maps/createart/mp_battery3_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_boneyard_ns_art.gscbin b/data/IW6/maps/createart/mp_boneyard_ns_art.gscbin new file mode 100644 index 00000000..c4a6f98c Binary files /dev/null and b/data/IW6/maps/createart/mp_boneyard_ns_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_boneyard_ns_fog.gscbin b/data/IW6/maps/createart/mp_boneyard_ns_fog.gscbin new file mode 100644 index 00000000..b1920502 Binary files /dev/null and b/data/IW6/maps/createart/mp_boneyard_ns_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_ca_behemoth_art.gscbin b/data/IW6/maps/createart/mp_ca_behemoth_art.gscbin new file mode 100644 index 00000000..751fd04a Binary files /dev/null and b/data/IW6/maps/createart/mp_ca_behemoth_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_ca_behemoth_fog.gscbin b/data/IW6/maps/createart/mp_ca_behemoth_fog.gscbin new file mode 100644 index 00000000..8f800bed Binary files /dev/null and b/data/IW6/maps/createart/mp_ca_behemoth_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_ca_impact_art.gscbin b/data/IW6/maps/createart/mp_ca_impact_art.gscbin new file mode 100644 index 00000000..f1692f09 Binary files /dev/null and b/data/IW6/maps/createart/mp_ca_impact_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_ca_impact_fog.gscbin b/data/IW6/maps/createart/mp_ca_impact_fog.gscbin new file mode 100644 index 00000000..5b4da051 Binary files /dev/null and b/data/IW6/maps/createart/mp_ca_impact_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_ca_red_river_art.gscbin b/data/IW6/maps/createart/mp_ca_red_river_art.gscbin new file mode 100644 index 00000000..87595ebd Binary files /dev/null and b/data/IW6/maps/createart/mp_ca_red_river_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_ca_red_river_fog.gscbin b/data/IW6/maps/createart/mp_ca_red_river_fog.gscbin new file mode 100644 index 00000000..000dba18 Binary files /dev/null and b/data/IW6/maps/createart/mp_ca_red_river_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_ca_rumble_art.gscbin b/data/IW6/maps/createart/mp_ca_rumble_art.gscbin new file mode 100644 index 00000000..5530ddd4 Binary files /dev/null and b/data/IW6/maps/createart/mp_ca_rumble_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_ca_rumble_fog.gscbin b/data/IW6/maps/createart/mp_ca_rumble_fog.gscbin new file mode 100644 index 00000000..cf025ebe Binary files /dev/null and b/data/IW6/maps/createart/mp_ca_rumble_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_chasm_art.gscbin b/data/IW6/maps/createart/mp_chasm_art.gscbin new file mode 100644 index 00000000..3f162275 Binary files /dev/null and b/data/IW6/maps/createart/mp_chasm_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_chasm_fog.gscbin b/data/IW6/maps/createart/mp_chasm_fog.gscbin new file mode 100644 index 00000000..b3671498 Binary files /dev/null and b/data/IW6/maps/createart/mp_chasm_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_conflict_art.gscbin b/data/IW6/maps/createart/mp_conflict_art.gscbin new file mode 100644 index 00000000..8b032e66 Binary files /dev/null and b/data/IW6/maps/createart/mp_conflict_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_conflict_fog.gscbin b/data/IW6/maps/createart/mp_conflict_fog.gscbin new file mode 100644 index 00000000..58b36650 Binary files /dev/null and b/data/IW6/maps/createart/mp_conflict_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_dart_art.gscbin b/data/IW6/maps/createart/mp_dart_art.gscbin new file mode 100644 index 00000000..0572b54e Binary files /dev/null and b/data/IW6/maps/createart/mp_dart_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_dart_fog.gscbin b/data/IW6/maps/createart/mp_dart_fog.gscbin new file mode 100644 index 00000000..aa361ec1 Binary files /dev/null and b/data/IW6/maps/createart/mp_dart_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_descent_new_art.gscbin b/data/IW6/maps/createart/mp_descent_new_art.gscbin new file mode 100644 index 00000000..f8910b5b Binary files /dev/null and b/data/IW6/maps/createart/mp_descent_new_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_descent_new_fog.gscbin b/data/IW6/maps/createart/mp_descent_new_fog.gscbin new file mode 100644 index 00000000..034faca4 Binary files /dev/null and b/data/IW6/maps/createart/mp_descent_new_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_dig_art.gscbin b/data/IW6/maps/createart/mp_dig_art.gscbin new file mode 100644 index 00000000..d04a1ba1 Binary files /dev/null and b/data/IW6/maps/createart/mp_dig_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_dig_fog.gscbin b/data/IW6/maps/createart/mp_dig_fog.gscbin new file mode 100644 index 00000000..ad7b5da8 Binary files /dev/null and b/data/IW6/maps/createart/mp_dig_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_dig_fx.gscbin b/data/IW6/maps/createart/mp_dig_fx.gscbin new file mode 100644 index 00000000..3d992292 Binary files /dev/null and b/data/IW6/maps/createart/mp_dig_fx.gscbin differ diff --git a/data/IW6/maps/createart/mp_dome_ns_art.gscbin b/data/IW6/maps/createart/mp_dome_ns_art.gscbin new file mode 100644 index 00000000..a3ca472e Binary files /dev/null and b/data/IW6/maps/createart/mp_dome_ns_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_dome_ns_fog.gscbin b/data/IW6/maps/createart/mp_dome_ns_fog.gscbin new file mode 100644 index 00000000..70467354 Binary files /dev/null and b/data/IW6/maps/createart/mp_dome_ns_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_fahrenheit_art.gscbin b/data/IW6/maps/createart/mp_fahrenheit_art.gscbin new file mode 100644 index 00000000..d5b000cc Binary files /dev/null and b/data/IW6/maps/createart/mp_fahrenheit_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_fahrenheit_fog.gscbin b/data/IW6/maps/createart/mp_fahrenheit_fog.gscbin new file mode 100644 index 00000000..a6c7a1b7 Binary files /dev/null and b/data/IW6/maps/createart/mp_fahrenheit_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_favela_iw6_art.gscbin b/data/IW6/maps/createart/mp_favela_iw6_art.gscbin new file mode 100644 index 00000000..ee759763 Binary files /dev/null and b/data/IW6/maps/createart/mp_favela_iw6_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_favela_iw6_fog.gscbin b/data/IW6/maps/createart/mp_favela_iw6_fog.gscbin new file mode 100644 index 00000000..cf62af80 Binary files /dev/null and b/data/IW6/maps/createart/mp_favela_iw6_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_flooded_art.gscbin b/data/IW6/maps/createart/mp_flooded_art.gscbin new file mode 100644 index 00000000..34ca09dc Binary files /dev/null and b/data/IW6/maps/createart/mp_flooded_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_flooded_fog.gscbin b/data/IW6/maps/createart/mp_flooded_fog.gscbin new file mode 100644 index 00000000..494e06ea Binary files /dev/null and b/data/IW6/maps/createart/mp_flooded_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_frag_art.gscbin b/data/IW6/maps/createart/mp_frag_art.gscbin new file mode 100644 index 00000000..b5bcc1a7 Binary files /dev/null and b/data/IW6/maps/createart/mp_frag_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_frag_fog.gscbin b/data/IW6/maps/createart/mp_frag_fog.gscbin new file mode 100644 index 00000000..d488277c Binary files /dev/null and b/data/IW6/maps/createart/mp_frag_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_hashima_art.gscbin b/data/IW6/maps/createart/mp_hashima_art.gscbin new file mode 100644 index 00000000..aff69072 Binary files /dev/null and b/data/IW6/maps/createart/mp_hashima_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_hashima_fog.gscbin b/data/IW6/maps/createart/mp_hashima_fog.gscbin new file mode 100644 index 00000000..cef41605 Binary files /dev/null and b/data/IW6/maps/createart/mp_hashima_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_lonestar_art.gscbin b/data/IW6/maps/createart/mp_lonestar_art.gscbin new file mode 100644 index 00000000..2ae4f929 Binary files /dev/null and b/data/IW6/maps/createart/mp_lonestar_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_lonestar_fog.gscbin b/data/IW6/maps/createart/mp_lonestar_fog.gscbin new file mode 100644 index 00000000..0f00afe7 Binary files /dev/null and b/data/IW6/maps/createart/mp_lonestar_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_mine_art.gscbin b/data/IW6/maps/createart/mp_mine_art.gscbin new file mode 100644 index 00000000..21e8dd6b Binary files /dev/null and b/data/IW6/maps/createart/mp_mine_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_mine_fog.gscbin b/data/IW6/maps/createart/mp_mine_fog.gscbin new file mode 100644 index 00000000..fdc2573b Binary files /dev/null and b/data/IW6/maps/createart/mp_mine_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_pirate_art.gscbin b/data/IW6/maps/createart/mp_pirate_art.gscbin new file mode 100644 index 00000000..a4bd61a5 Binary files /dev/null and b/data/IW6/maps/createart/mp_pirate_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_pirate_fog.gscbin b/data/IW6/maps/createart/mp_pirate_fog.gscbin new file mode 100644 index 00000000..2a77e9fe Binary files /dev/null and b/data/IW6/maps/createart/mp_pirate_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_prisonbreak_art.gscbin b/data/IW6/maps/createart/mp_prisonbreak_art.gscbin new file mode 100644 index 00000000..09146534 Binary files /dev/null and b/data/IW6/maps/createart/mp_prisonbreak_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_prisonbreak_fog.gscbin b/data/IW6/maps/createart/mp_prisonbreak_fog.gscbin new file mode 100644 index 00000000..4453feec Binary files /dev/null and b/data/IW6/maps/createart/mp_prisonbreak_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_shipment_ns_art.gscbin b/data/IW6/maps/createart/mp_shipment_ns_art.gscbin new file mode 100644 index 00000000..74ab5bc3 Binary files /dev/null and b/data/IW6/maps/createart/mp_shipment_ns_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_shipment_ns_fog.gscbin b/data/IW6/maps/createart/mp_shipment_ns_fog.gscbin new file mode 100644 index 00000000..d4e0e087 Binary files /dev/null and b/data/IW6/maps/createart/mp_shipment_ns_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_siege_unk.gscbin b/data/IW6/maps/createart/mp_siege_unk.gscbin new file mode 100644 index 00000000..b9040351 Binary files /dev/null and b/data/IW6/maps/createart/mp_siege_unk.gscbin differ diff --git a/data/IW6/maps/createart/mp_skeleton_art.gscbin b/data/IW6/maps/createart/mp_skeleton_art.gscbin new file mode 100644 index 00000000..fbe7983c Binary files /dev/null and b/data/IW6/maps/createart/mp_skeleton_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_skeleton_fog.gscbin b/data/IW6/maps/createart/mp_skeleton_fog.gscbin new file mode 100644 index 00000000..93de253b Binary files /dev/null and b/data/IW6/maps/createart/mp_skeleton_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_snow_art.gscbin b/data/IW6/maps/createart/mp_snow_art.gscbin new file mode 100644 index 00000000..0ebcfe47 Binary files /dev/null and b/data/IW6/maps/createart/mp_snow_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_snow_fog.gscbin b/data/IW6/maps/createart/mp_snow_fog.gscbin new file mode 100644 index 00000000..dd5974b2 Binary files /dev/null and b/data/IW6/maps/createart/mp_snow_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_sovereign_art.gscbin b/data/IW6/maps/createart/mp_sovereign_art.gscbin new file mode 100644 index 00000000..6df525d4 Binary files /dev/null and b/data/IW6/maps/createart/mp_sovereign_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_sovereign_fog.gscbin b/data/IW6/maps/createart/mp_sovereign_fog.gscbin new file mode 100644 index 00000000..45eed47a Binary files /dev/null and b/data/IW6/maps/createart/mp_sovereign_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_strikezone_art.gscbin b/data/IW6/maps/createart/mp_strikezone_art.gscbin new file mode 100644 index 00000000..228dfb55 Binary files /dev/null and b/data/IW6/maps/createart/mp_strikezone_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_strikezone_fog.gscbin b/data/IW6/maps/createart/mp_strikezone_fog.gscbin new file mode 100644 index 00000000..2ce5444d Binary files /dev/null and b/data/IW6/maps/createart/mp_strikezone_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_swamp_art.gscbin b/data/IW6/maps/createart/mp_swamp_art.gscbin new file mode 100644 index 00000000..ae2e54de Binary files /dev/null and b/data/IW6/maps/createart/mp_swamp_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_swamp_fog.gscbin b/data/IW6/maps/createart/mp_swamp_fog.gscbin new file mode 100644 index 00000000..9bb5b1b9 Binary files /dev/null and b/data/IW6/maps/createart/mp_swamp_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_warhawk_art.gscbin b/data/IW6/maps/createart/mp_warhawk_art.gscbin new file mode 100644 index 00000000..4833d462 Binary files /dev/null and b/data/IW6/maps/createart/mp_warhawk_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_warhawk_fog.gscbin b/data/IW6/maps/createart/mp_warhawk_fog.gscbin new file mode 100644 index 00000000..43e6fa9f Binary files /dev/null and b/data/IW6/maps/createart/mp_warhawk_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_zebra_art.gscbin b/data/IW6/maps/createart/mp_zebra_art.gscbin new file mode 100644 index 00000000..78bccd54 Binary files /dev/null and b/data/IW6/maps/createart/mp_zebra_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_zebra_fog.gscbin b/data/IW6/maps/createart/mp_zebra_fog.gscbin new file mode 100644 index 00000000..73644930 Binary files /dev/null and b/data/IW6/maps/createart/mp_zebra_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_zerosub_art.gscbin b/data/IW6/maps/createart/mp_zerosub_art.gscbin new file mode 100644 index 00000000..46804082 Binary files /dev/null and b/data/IW6/maps/createart/mp_zerosub_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_zerosub_fog.gscbin b/data/IW6/maps/createart/mp_zerosub_fog.gscbin new file mode 100644 index 00000000..62f6f490 Binary files /dev/null and b/data/IW6/maps/createart/mp_zerosub_fog.gscbin differ diff --git a/data/IW6/maps/createart/mp_zulu_art.gscbin b/data/IW6/maps/createart/mp_zulu_art.gscbin new file mode 100644 index 00000000..c1208926 Binary files /dev/null and b/data/IW6/maps/createart/mp_zulu_art.gscbin differ diff --git a/data/IW6/maps/createart/mp_zulu_fog.gscbin b/data/IW6/maps/createart/mp_zulu_fog.gscbin new file mode 100644 index 00000000..d6de3dfb Binary files /dev/null and b/data/IW6/maps/createart/mp_zulu_fog.gscbin differ diff --git a/data/IW6/maps/createfx/mp_alien_armory_fx.gscbin b/data/IW6/maps/createfx/mp_alien_armory_fx.gscbin new file mode 100644 index 00000000..cfc05251 Binary files /dev/null and b/data/IW6/maps/createfx/mp_alien_armory_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_alien_beacon_fx.gscbin b/data/IW6/maps/createfx/mp_alien_beacon_fx.gscbin new file mode 100644 index 00000000..b720008f Binary files /dev/null and b/data/IW6/maps/createfx/mp_alien_beacon_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_alien_dlc3_fx.gscbin b/data/IW6/maps/createfx/mp_alien_dlc3_fx.gscbin new file mode 100644 index 00000000..90c81aa9 Binary files /dev/null and b/data/IW6/maps/createfx/mp_alien_dlc3_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_alien_last_fx.gscbin b/data/IW6/maps/createfx/mp_alien_last_fx.gscbin new file mode 100644 index 00000000..23c8ea8f Binary files /dev/null and b/data/IW6/maps/createfx/mp_alien_last_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_alien_town_fx.gscbin b/data/IW6/maps/createfx/mp_alien_town_fx.gscbin new file mode 100644 index 00000000..cb421f62 Binary files /dev/null and b/data/IW6/maps/createfx/mp_alien_town_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_battery3_fx.gscbin b/data/IW6/maps/createfx/mp_battery3_fx.gscbin new file mode 100644 index 00000000..0d7c04a7 Binary files /dev/null and b/data/IW6/maps/createfx/mp_battery3_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_boneyard_ns_fx.gscbin b/data/IW6/maps/createfx/mp_boneyard_ns_fx.gscbin new file mode 100644 index 00000000..56e3df42 Binary files /dev/null and b/data/IW6/maps/createfx/mp_boneyard_ns_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_ca_behemoth_fx.gscbin b/data/IW6/maps/createfx/mp_ca_behemoth_fx.gscbin new file mode 100644 index 00000000..ba91256e Binary files /dev/null and b/data/IW6/maps/createfx/mp_ca_behemoth_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_ca_impact_fx.gscbin b/data/IW6/maps/createfx/mp_ca_impact_fx.gscbin new file mode 100644 index 00000000..9a43b630 Binary files /dev/null and b/data/IW6/maps/createfx/mp_ca_impact_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_ca_red_river_fx.gscbin b/data/IW6/maps/createfx/mp_ca_red_river_fx.gscbin new file mode 100644 index 00000000..218dee73 Binary files /dev/null and b/data/IW6/maps/createfx/mp_ca_red_river_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_ca_rumble_fx.gscbin b/data/IW6/maps/createfx/mp_ca_rumble_fx.gscbin new file mode 100644 index 00000000..967e84c1 Binary files /dev/null and b/data/IW6/maps/createfx/mp_ca_rumble_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_chasm_fx.gscbin b/data/IW6/maps/createfx/mp_chasm_fx.gscbin new file mode 100644 index 00000000..6a0f683b Binary files /dev/null and b/data/IW6/maps/createfx/mp_chasm_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_conflict_fx.gscbin b/data/IW6/maps/createfx/mp_conflict_fx.gscbin new file mode 100644 index 00000000..a6934739 Binary files /dev/null and b/data/IW6/maps/createfx/mp_conflict_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_dart_fx.gscbin b/data/IW6/maps/createfx/mp_dart_fx.gscbin new file mode 100644 index 00000000..c9bbb763 Binary files /dev/null and b/data/IW6/maps/createfx/mp_dart_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_descent_new_fx.gscbin b/data/IW6/maps/createfx/mp_descent_new_fx.gscbin new file mode 100644 index 00000000..ccdaf64b Binary files /dev/null and b/data/IW6/maps/createfx/mp_descent_new_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_dome_ns_fx.gscbin b/data/IW6/maps/createfx/mp_dome_ns_fx.gscbin new file mode 100644 index 00000000..fe34933b Binary files /dev/null and b/data/IW6/maps/createfx/mp_dome_ns_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_fahrenheit_fx.gscbin b/data/IW6/maps/createfx/mp_fahrenheit_fx.gscbin new file mode 100644 index 00000000..8baca08d Binary files /dev/null and b/data/IW6/maps/createfx/mp_fahrenheit_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_favela_iw6_fx.gscbin b/data/IW6/maps/createfx/mp_favela_iw6_fx.gscbin new file mode 100644 index 00000000..97420d93 Binary files /dev/null and b/data/IW6/maps/createfx/mp_favela_iw6_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_flooded_fx.gscbin b/data/IW6/maps/createfx/mp_flooded_fx.gscbin new file mode 100644 index 00000000..cf192289 Binary files /dev/null and b/data/IW6/maps/createfx/mp_flooded_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_frag_fx.gscbin b/data/IW6/maps/createfx/mp_frag_fx.gscbin new file mode 100644 index 00000000..a01e6b27 Binary files /dev/null and b/data/IW6/maps/createfx/mp_frag_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_hashima_fx.gscbin b/data/IW6/maps/createfx/mp_hashima_fx.gscbin new file mode 100644 index 00000000..959f810d Binary files /dev/null and b/data/IW6/maps/createfx/mp_hashima_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_lonestar_fx.gscbin b/data/IW6/maps/createfx/mp_lonestar_fx.gscbin new file mode 100644 index 00000000..367f8895 Binary files /dev/null and b/data/IW6/maps/createfx/mp_lonestar_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_mine_fx.gscbin b/data/IW6/maps/createfx/mp_mine_fx.gscbin new file mode 100644 index 00000000..35b78b01 Binary files /dev/null and b/data/IW6/maps/createfx/mp_mine_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_pirate_fx.gscbin b/data/IW6/maps/createfx/mp_pirate_fx.gscbin new file mode 100644 index 00000000..5aebfb59 Binary files /dev/null and b/data/IW6/maps/createfx/mp_pirate_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_prisonbreak_fx.gscbin b/data/IW6/maps/createfx/mp_prisonbreak_fx.gscbin new file mode 100644 index 00000000..d66f211e Binary files /dev/null and b/data/IW6/maps/createfx/mp_prisonbreak_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_shipment_ns_fx.gscbin b/data/IW6/maps/createfx/mp_shipment_ns_fx.gscbin new file mode 100644 index 00000000..d46db65c Binary files /dev/null and b/data/IW6/maps/createfx/mp_shipment_ns_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_skeleton_fx.gscbin b/data/IW6/maps/createfx/mp_skeleton_fx.gscbin new file mode 100644 index 00000000..c786d81d Binary files /dev/null and b/data/IW6/maps/createfx/mp_skeleton_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_snow_fx.gscbin b/data/IW6/maps/createfx/mp_snow_fx.gscbin new file mode 100644 index 00000000..5557f4b3 Binary files /dev/null and b/data/IW6/maps/createfx/mp_snow_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_sovereign_fx.gscbin b/data/IW6/maps/createfx/mp_sovereign_fx.gscbin new file mode 100644 index 00000000..78982b50 Binary files /dev/null and b/data/IW6/maps/createfx/mp_sovereign_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_strikezone_fx.gscbin b/data/IW6/maps/createfx/mp_strikezone_fx.gscbin new file mode 100644 index 00000000..d10abaa8 Binary files /dev/null and b/data/IW6/maps/createfx/mp_strikezone_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_swamp_fx.gscbin b/data/IW6/maps/createfx/mp_swamp_fx.gscbin new file mode 100644 index 00000000..91661f1e Binary files /dev/null and b/data/IW6/maps/createfx/mp_swamp_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_warhawk_fx.gscbin b/data/IW6/maps/createfx/mp_warhawk_fx.gscbin new file mode 100644 index 00000000..243fa95f Binary files /dev/null and b/data/IW6/maps/createfx/mp_warhawk_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_zebra_fx.gscbin b/data/IW6/maps/createfx/mp_zebra_fx.gscbin new file mode 100644 index 00000000..16b5c0de Binary files /dev/null and b/data/IW6/maps/createfx/mp_zebra_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_zerosub_fx.gscbin b/data/IW6/maps/createfx/mp_zerosub_fx.gscbin new file mode 100644 index 00000000..3cda9fb9 Binary files /dev/null and b/data/IW6/maps/createfx/mp_zerosub_fx.gscbin differ diff --git a/data/IW6/maps/createfx/mp_zulu_fx.gscbin b/data/IW6/maps/createfx/mp_zulu_fx.gscbin new file mode 100644 index 00000000..bed7c721 Binary files /dev/null and b/data/IW6/maps/createfx/mp_zulu_fx.gscbin differ diff --git a/data/IW6/maps/interactive_models/_birds_dlc.gscbin b/data/IW6/maps/interactive_models/_birds_dlc.gscbin new file mode 100644 index 00000000..fce9c16a Binary files /dev/null and b/data/IW6/maps/interactive_models/_birds_dlc.gscbin differ diff --git a/data/IW6/maps/interactive_models/_interactive_utility.gscbin b/data/IW6/maps/interactive_models/_interactive_utility.gscbin new file mode 100644 index 00000000..3354333a Binary files /dev/null and b/data/IW6/maps/interactive_models/_interactive_utility.gscbin differ diff --git a/data/IW6/maps/interactive_models/batcave.gscbin b/data/IW6/maps/interactive_models/batcave.gscbin new file mode 100644 index 00000000..245f0d79 Binary files /dev/null and b/data/IW6/maps/interactive_models/batcave.gscbin differ diff --git a/data/IW6/maps/interactive_models/crows_dlc.gscbin b/data/IW6/maps/interactive_models/crows_dlc.gscbin new file mode 100644 index 00000000..c0421647 Binary files /dev/null and b/data/IW6/maps/interactive_models/crows_dlc.gscbin differ diff --git a/data/IW6/maps/interactive_models/parakeets_dlc.gscbin b/data/IW6/maps/interactive_models/parakeets_dlc.gscbin new file mode 100644 index 00000000..9531d28f Binary files /dev/null and b/data/IW6/maps/interactive_models/parakeets_dlc.gscbin differ diff --git a/data/IW6/maps/interactive_models/vulture_mp.gscbin b/data/IW6/maps/interactive_models/vulture_mp.gscbin new file mode 100644 index 00000000..580dfcc3 Binary files /dev/null and b/data/IW6/maps/interactive_models/vulture_mp.gscbin differ diff --git a/data/IW6/maps/mp/_animatedmodels.gscbin b/data/IW6/maps/mp/_animatedmodels.gscbin new file mode 100644 index 00000000..e01b620c Binary files /dev/null and b/data/IW6/maps/mp/_animatedmodels.gscbin differ diff --git a/data/IW6/maps/mp/_areas.gscbin b/data/IW6/maps/mp/_areas.gscbin new file mode 100644 index 00000000..212faa3c Binary files /dev/null and b/data/IW6/maps/mp/_areas.gscbin differ diff --git a/data/IW6/maps/mp/_art.gscbin b/data/IW6/maps/mp/_art.gscbin new file mode 100644 index 00000000..a7b6673c Binary files /dev/null and b/data/IW6/maps/mp/_art.gscbin differ diff --git a/data/IW6/maps/mp/_audio.gscbin b/data/IW6/maps/mp/_audio.gscbin new file mode 100644 index 00000000..55aa935f Binary files /dev/null and b/data/IW6/maps/mp/_audio.gscbin differ diff --git a/data/IW6/maps/mp/_awards.gscbin b/data/IW6/maps/mp/_awards.gscbin new file mode 100644 index 00000000..97b98268 Binary files /dev/null and b/data/IW6/maps/mp/_awards.gscbin differ diff --git a/data/IW6/maps/mp/_barrels_leak.gscbin b/data/IW6/maps/mp/_barrels_leak.gscbin new file mode 100644 index 00000000..d3d57a38 Binary files /dev/null and b/data/IW6/maps/mp/_barrels_leak.gscbin differ diff --git a/data/IW6/maps/mp/_breach.gscbin b/data/IW6/maps/mp/_breach.gscbin new file mode 100644 index 00000000..c419a56f Binary files /dev/null and b/data/IW6/maps/mp/_breach.gscbin differ diff --git a/data/IW6/maps/mp/_compass.gscbin b/data/IW6/maps/mp/_compass.gscbin new file mode 100644 index 00000000..4433c329 Binary files /dev/null and b/data/IW6/maps/mp/_compass.gscbin differ diff --git a/data/IW6/maps/mp/_createfx.gscbin b/data/IW6/maps/mp/_createfx.gscbin new file mode 100644 index 00000000..d29a9892 Binary files /dev/null and b/data/IW6/maps/mp/_createfx.gscbin differ diff --git a/data/IW6/maps/mp/_crib.gscbin b/data/IW6/maps/mp/_crib.gscbin new file mode 100644 index 00000000..04096b82 Binary files /dev/null and b/data/IW6/maps/mp/_crib.gscbin differ diff --git a/data/IW6/maps/mp/_defcon.gscbin b/data/IW6/maps/mp/_defcon.gscbin new file mode 100644 index 00000000..01c28d05 Binary files /dev/null and b/data/IW6/maps/mp/_defcon.gscbin differ diff --git a/data/IW6/maps/mp/_destructables.gscbin b/data/IW6/maps/mp/_destructables.gscbin new file mode 100644 index 00000000..3ded5e69 Binary files /dev/null and b/data/IW6/maps/mp/_destructables.gscbin differ diff --git a/data/IW6/maps/mp/_elevator.gscbin b/data/IW6/maps/mp/_elevator.gscbin new file mode 100644 index 00000000..81fe1d60 Binary files /dev/null and b/data/IW6/maps/mp/_elevator.gscbin differ diff --git a/data/IW6/maps/mp/_elevator_v2.gscbin b/data/IW6/maps/mp/_elevator_v2.gscbin new file mode 100644 index 00000000..10b7704c Binary files /dev/null and b/data/IW6/maps/mp/_elevator_v2.gscbin differ diff --git a/data/IW6/maps/mp/_empgrenade.gscbin b/data/IW6/maps/mp/_empgrenade.gscbin new file mode 100644 index 00000000..43b06faa Binary files /dev/null and b/data/IW6/maps/mp/_empgrenade.gscbin differ diff --git a/data/IW6/maps/mp/_entityheadicons.gscbin b/data/IW6/maps/mp/_entityheadicons.gscbin new file mode 100644 index 00000000..efe7ccfd Binary files /dev/null and b/data/IW6/maps/mp/_entityheadicons.gscbin differ diff --git a/data/IW6/maps/mp/_events.gscbin b/data/IW6/maps/mp/_events.gscbin new file mode 100644 index 00000000..e3679931 Binary files /dev/null and b/data/IW6/maps/mp/_events.gscbin differ diff --git a/data/IW6/maps/mp/_flashgrenades.gscbin b/data/IW6/maps/mp/_flashgrenades.gscbin new file mode 100644 index 00000000..e6f9ac4f Binary files /dev/null and b/data/IW6/maps/mp/_flashgrenades.gscbin differ diff --git a/data/IW6/maps/mp/_fx.gscbin b/data/IW6/maps/mp/_fx.gscbin new file mode 100644 index 00000000..d34b057c Binary files /dev/null and b/data/IW6/maps/mp/_fx.gscbin differ diff --git a/data/IW6/maps/mp/_global_fx.gscbin b/data/IW6/maps/mp/_global_fx.gscbin new file mode 100644 index 00000000..7a94f00c Binary files /dev/null and b/data/IW6/maps/mp/_global_fx.gscbin differ diff --git a/data/IW6/maps/mp/_global_fx_code.gscbin b/data/IW6/maps/mp/_global_fx_code.gscbin new file mode 100644 index 00000000..358fda35 Binary files /dev/null and b/data/IW6/maps/mp/_global_fx_code.gscbin differ diff --git a/data/IW6/maps/mp/_highlights.gscbin b/data/IW6/maps/mp/_highlights.gscbin new file mode 100644 index 00000000..88785fdc Binary files /dev/null and b/data/IW6/maps/mp/_highlights.gscbin differ diff --git a/data/IW6/maps/mp/_javelin.gscbin b/data/IW6/maps/mp/_javelin.gscbin new file mode 100644 index 00000000..503025a6 Binary files /dev/null and b/data/IW6/maps/mp/_javelin.gscbin differ diff --git a/data/IW6/maps/mp/_laserguidedlauncher.gscbin b/data/IW6/maps/mp/_laserguidedlauncher.gscbin new file mode 100644 index 00000000..15efc6ef Binary files /dev/null and b/data/IW6/maps/mp/_laserguidedlauncher.gscbin differ diff --git a/data/IW6/maps/mp/_load.gscbin b/data/IW6/maps/mp/_load.gscbin new file mode 100644 index 00000000..fa932889 Binary files /dev/null and b/data/IW6/maps/mp/_load.gscbin differ diff --git a/data/IW6/maps/mp/_matchdata.gscbin b/data/IW6/maps/mp/_matchdata.gscbin new file mode 100644 index 00000000..169c94ef Binary files /dev/null and b/data/IW6/maps/mp/_matchdata.gscbin differ diff --git a/data/IW6/maps/mp/_matchevent.gscbin b/data/IW6/maps/mp/_matchevent.gscbin new file mode 100644 index 00000000..a082a87c Binary files /dev/null and b/data/IW6/maps/mp/_matchevent.gscbin differ diff --git a/data/IW6/maps/mp/_menus.gscbin b/data/IW6/maps/mp/_menus.gscbin new file mode 100644 index 00000000..0402df7b Binary files /dev/null and b/data/IW6/maps/mp/_menus.gscbin differ diff --git a/data/IW6/maps/mp/_minefields.gscbin b/data/IW6/maps/mp/_minefields.gscbin new file mode 100644 index 00000000..5b575baf Binary files /dev/null and b/data/IW6/maps/mp/_minefields.gscbin differ diff --git a/data/IW6/maps/mp/_movable_cover.gscbin b/data/IW6/maps/mp/_movable_cover.gscbin new file mode 100644 index 00000000..a0a3b1bb Binary files /dev/null and b/data/IW6/maps/mp/_movable_cover.gscbin differ diff --git a/data/IW6/maps/mp/_movers.gscbin b/data/IW6/maps/mp/_movers.gscbin new file mode 100644 index 00000000..f501db6a Binary files /dev/null and b/data/IW6/maps/mp/_movers.gscbin differ diff --git a/data/IW6/maps/mp/_obelisk.gscbin b/data/IW6/maps/mp/_obelisk.gscbin new file mode 100644 index 00000000..ba95c03c Binary files /dev/null and b/data/IW6/maps/mp/_obelisk.gscbin differ diff --git a/data/IW6/maps/mp/_radiation.gscbin b/data/IW6/maps/mp/_radiation.gscbin new file mode 100644 index 00000000..1c0a32eb Binary files /dev/null and b/data/IW6/maps/mp/_radiation.gscbin differ diff --git a/data/IW6/maps/mp/_scoreboard.gscbin b/data/IW6/maps/mp/_scoreboard.gscbin new file mode 100644 index 00000000..61e97a39 Binary files /dev/null and b/data/IW6/maps/mp/_scoreboard.gscbin differ diff --git a/data/IW6/maps/mp/_shutter.gscbin b/data/IW6/maps/mp/_shutter.gscbin new file mode 100644 index 00000000..5f964ef9 Binary files /dev/null and b/data/IW6/maps/mp/_shutter.gscbin differ diff --git a/data/IW6/maps/mp/_stinger.gscbin b/data/IW6/maps/mp/_stinger.gscbin new file mode 100644 index 00000000..97def7c2 Binary files /dev/null and b/data/IW6/maps/mp/_stinger.gscbin differ diff --git a/data/IW6/maps/mp/_teleport.gscbin b/data/IW6/maps/mp/_teleport.gscbin new file mode 100644 index 00000000..bc4fe529 Binary files /dev/null and b/data/IW6/maps/mp/_teleport.gscbin differ diff --git a/data/IW6/maps/mp/_utility.gscbin b/data/IW6/maps/mp/_utility.gscbin new file mode 100644 index 00000000..4095356a Binary files /dev/null and b/data/IW6/maps/mp/_utility.gscbin differ diff --git a/data/IW6/maps/mp/_water.gscbin b/data/IW6/maps/mp/_water.gscbin new file mode 100644 index 00000000..4dc315bc Binary files /dev/null and b/data/IW6/maps/mp/_water.gscbin differ diff --git a/data/IW6/maps/mp/_zipline.gscbin b/data/IW6/maps/mp/_zipline.gscbin new file mode 100644 index 00000000..c8aaf0cb Binary files /dev/null and b/data/IW6/maps/mp/_zipline.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agent_common.gscbin b/data/IW6/maps/mp/agents/_agent_common.gscbin new file mode 100644 index 00000000..0dec1c4a Binary files /dev/null and b/data/IW6/maps/mp/agents/_agent_common.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agent_utility.gscbin b/data/IW6/maps/mp/agents/_agent_utility.gscbin new file mode 100644 index 00000000..2b0cd287 Binary files /dev/null and b/data/IW6/maps/mp/agents/_agent_utility.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agents.gscbin b/data/IW6/maps/mp/agents/_agents.gscbin new file mode 100644 index 00000000..bca72aa7 Binary files /dev/null and b/data/IW6/maps/mp/agents/_agents.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agents_civ_hvt.gscbin b/data/IW6/maps/mp/agents/_agents_civ_hvt.gscbin new file mode 100644 index 00000000..8a85d266 Binary files /dev/null and b/data/IW6/maps/mp/agents/_agents_civ_hvt.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agents_gametype_aliens.gscbin b/data/IW6/maps/mp/agents/_agents_gametype_aliens.gscbin new file mode 100644 index 00000000..af74564d Binary files /dev/null and b/data/IW6/maps/mp/agents/_agents_gametype_aliens.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agents_gametype_blitz.gscbin b/data/IW6/maps/mp/agents/_agents_gametype_blitz.gscbin new file mode 100644 index 00000000..2fd64434 Binary files /dev/null and b/data/IW6/maps/mp/agents/_agents_gametype_blitz.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agents_gametype_conf.gscbin b/data/IW6/maps/mp/agents/_agents_gametype_conf.gscbin new file mode 100644 index 00000000..14f5dfa6 Binary files /dev/null and b/data/IW6/maps/mp/agents/_agents_gametype_conf.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agents_gametype_cranked.gscbin b/data/IW6/maps/mp/agents/_agents_gametype_cranked.gscbin new file mode 100644 index 00000000..8343d879 Binary files /dev/null and b/data/IW6/maps/mp/agents/_agents_gametype_cranked.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agents_gametype_dm.gscbin b/data/IW6/maps/mp/agents/_agents_gametype_dm.gscbin new file mode 100644 index 00000000..97ff5e26 Binary files /dev/null and b/data/IW6/maps/mp/agents/_agents_gametype_dm.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agents_gametype_dom.gscbin b/data/IW6/maps/mp/agents/_agents_gametype_dom.gscbin new file mode 100644 index 00000000..17c0972f Binary files /dev/null and b/data/IW6/maps/mp/agents/_agents_gametype_dom.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agents_gametype_grind.gscbin b/data/IW6/maps/mp/agents/_agents_gametype_grind.gscbin new file mode 100644 index 00000000..a54b13e7 Binary files /dev/null and b/data/IW6/maps/mp/agents/_agents_gametype_grind.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agents_gametype_gun.gscbin b/data/IW6/maps/mp/agents/_agents_gametype_gun.gscbin new file mode 100644 index 00000000..c72a5828 Binary files /dev/null and b/data/IW6/maps/mp/agents/_agents_gametype_gun.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agents_gametype_horde.gscbin b/data/IW6/maps/mp/agents/_agents_gametype_horde.gscbin new file mode 100644 index 00000000..e949cb4a Binary files /dev/null and b/data/IW6/maps/mp/agents/_agents_gametype_horde.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agents_gametype_infect.gscbin b/data/IW6/maps/mp/agents/_agents_gametype_infect.gscbin new file mode 100644 index 00000000..52fffe6b Binary files /dev/null and b/data/IW6/maps/mp/agents/_agents_gametype_infect.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agents_gametype_mugger.gscbin b/data/IW6/maps/mp/agents/_agents_gametype_mugger.gscbin new file mode 100644 index 00000000..5c5ee617 Binary files /dev/null and b/data/IW6/maps/mp/agents/_agents_gametype_mugger.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agents_gametype_sd.gscbin b/data/IW6/maps/mp/agents/_agents_gametype_sd.gscbin new file mode 100644 index 00000000..e844ec83 Binary files /dev/null and b/data/IW6/maps/mp/agents/_agents_gametype_sd.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agents_gametype_siege.gscbin b/data/IW6/maps/mp/agents/_agents_gametype_siege.gscbin new file mode 100644 index 00000000..647c4981 Binary files /dev/null and b/data/IW6/maps/mp/agents/_agents_gametype_siege.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agents_gametype_sotf.gscbin b/data/IW6/maps/mp/agents/_agents_gametype_sotf.gscbin new file mode 100644 index 00000000..8dd5b61b Binary files /dev/null and b/data/IW6/maps/mp/agents/_agents_gametype_sotf.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agents_gametype_sotf_ffa.gscbin b/data/IW6/maps/mp/agents/_agents_gametype_sotf_ffa.gscbin new file mode 100644 index 00000000..cdf8d427 Binary files /dev/null and b/data/IW6/maps/mp/agents/_agents_gametype_sotf_ffa.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agents_gametype_sr.gscbin b/data/IW6/maps/mp/agents/_agents_gametype_sr.gscbin new file mode 100644 index 00000000..679251ce Binary files /dev/null and b/data/IW6/maps/mp/agents/_agents_gametype_sr.gscbin differ diff --git a/data/IW6/maps/mp/agents/_agents_gametype_war.gscbin b/data/IW6/maps/mp/agents/_agents_gametype_war.gscbin new file mode 100644 index 00000000..df876ee2 Binary files /dev/null and b/data/IW6/maps/mp/agents/_agents_gametype_war.gscbin differ diff --git a/data/IW6/maps/mp/agents/_scriptedagents.gscbin b/data/IW6/maps/mp/agents/_scriptedagents.gscbin new file mode 100644 index 00000000..f8db13e7 Binary files /dev/null and b/data/IW6/maps/mp/agents/_scriptedagents.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/_alien_agents.gscbin b/data/IW6/maps/mp/agents/alien/_alien_agents.gscbin new file mode 100644 index 00000000..b18665c6 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/_alien_agents.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/_alien_anim_utils.gscbin b/data/IW6/maps/mp/agents/alien/_alien_anim_utils.gscbin new file mode 100644 index 00000000..d8960bc5 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/_alien_anim_utils.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/_alien_bomber.gscbin b/data/IW6/maps/mp/agents/alien/_alien_bomber.gscbin new file mode 100644 index 00000000..d5ded973 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/_alien_bomber.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/_alien_elite.gscbin b/data/IW6/maps/mp/agents/alien/_alien_elite.gscbin new file mode 100644 index 00000000..ac6144b5 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/_alien_elite.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/_alien_gargoyle.gscbin b/data/IW6/maps/mp/agents/alien/_alien_gargoyle.gscbin new file mode 100644 index 00000000..6f98ef84 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/_alien_gargoyle.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/_alien_human.gscbin b/data/IW6/maps/mp/agents/alien/_alien_human.gscbin new file mode 100644 index 00000000..f13c991d Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/_alien_human.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/_alien_idle.gscbin b/data/IW6/maps/mp/agents/alien/_alien_idle.gscbin new file mode 100644 index 00000000..83465cdf Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/_alien_idle.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/_alien_jump.gscbin b/data/IW6/maps/mp/agents/alien/_alien_jump.gscbin new file mode 100644 index 00000000..76effe58 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/_alien_jump.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/_alien_leper.gscbin b/data/IW6/maps/mp/agents/alien/_alien_leper.gscbin new file mode 100644 index 00000000..489a9ada Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/_alien_leper.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/_alien_mammoth.gscbin b/data/IW6/maps/mp/agents/alien/_alien_mammoth.gscbin new file mode 100644 index 00000000..5cc34904 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/_alien_mammoth.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/_alien_melee.gscbin b/data/IW6/maps/mp/agents/alien/_alien_melee.gscbin new file mode 100644 index 00000000..c175ed0a Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/_alien_melee.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/_alien_minion.gscbin b/data/IW6/maps/mp/agents/alien/_alien_minion.gscbin new file mode 100644 index 00000000..cfcf878c Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/_alien_minion.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/_alien_move.gscbin b/data/IW6/maps/mp/agents/alien/_alien_move.gscbin new file mode 100644 index 00000000..2a9f5086 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/_alien_move.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/_alien_seeder.gscbin b/data/IW6/maps/mp/agents/alien/_alien_seeder.gscbin new file mode 100644 index 00000000..51340e5d Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/_alien_seeder.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/_alien_spitter.gscbin b/data/IW6/maps/mp/agents/alien/_alien_spitter.gscbin new file mode 100644 index 00000000..aefd5365 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/_alien_spitter.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/_alien_think.gscbin b/data/IW6/maps/mp/agents/alien/_alien_think.gscbin new file mode 100644 index 00000000..36a7d7d5 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/_alien_think.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/_alien_traverse.gscbin b/data/IW6/maps/mp/agents/alien/_alien_traverse.gscbin new file mode 100644 index 00000000..e75d5ef0 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/_alien_traverse.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/alien_ancestor/_alien_ancestor.gscbin b/data/IW6/maps/mp/agents/alien/alien_ancestor/_alien_ancestor.gscbin new file mode 100644 index 00000000..aa8f8138 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/alien_ancestor/_alien_ancestor.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/alien_ancestor/_alien_ancestor_idle.gscbin b/data/IW6/maps/mp/agents/alien/alien_ancestor/_alien_ancestor_idle.gscbin new file mode 100644 index 00000000..d206b582 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/alien_ancestor/_alien_ancestor_idle.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/alien_ancestor/_alien_ancestor_melee.gscbin b/data/IW6/maps/mp/agents/alien/alien_ancestor/_alien_ancestor_melee.gscbin new file mode 100644 index 00000000..6be6dc87 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/alien_ancestor/_alien_ancestor_melee.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/alien_ancestor/_alien_ancestor_move.gscbin b/data/IW6/maps/mp/agents/alien/alien_ancestor/_alien_ancestor_move.gscbin new file mode 100644 index 00000000..6d08980f Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/alien_ancestor/_alien_ancestor_move.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/alien_ancestor/_alien_ancestor_think.gscbin b/data/IW6/maps/mp/agents/alien/alien_ancestor/_alien_ancestor_think.gscbin new file mode 100644 index 00000000..5c3831a3 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/alien_ancestor/_alien_ancestor_think.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/alien_kraken/_alien_kraken.gscbin b/data/IW6/maps/mp/agents/alien/alien_kraken/_alien_kraken.gscbin new file mode 100644 index 00000000..f507b815 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/alien_kraken/_alien_kraken.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/alien_kraken/_alien_kraken_idle.gscbin b/data/IW6/maps/mp/agents/alien/alien_kraken/_alien_kraken_idle.gscbin new file mode 100644 index 00000000..b1b5621d Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/alien_kraken/_alien_kraken_idle.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/alien_kraken/_alien_kraken_melee.gscbin b/data/IW6/maps/mp/agents/alien/alien_kraken/_alien_kraken_melee.gscbin new file mode 100644 index 00000000..5cb8e342 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/alien_kraken/_alien_kraken_melee.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/alien_kraken/_alien_kraken_tentacle.gscbin b/data/IW6/maps/mp/agents/alien/alien_kraken/_alien_kraken_tentacle.gscbin new file mode 100644 index 00000000..d18d4274 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/alien_kraken/_alien_kraken_tentacle.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/alien_kraken/_alien_tentacle_idle.gscbin b/data/IW6/maps/mp/agents/alien/alien_kraken/_alien_tentacle_idle.gscbin new file mode 100644 index 00000000..1425bd63 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/alien_kraken/_alien_tentacle_idle.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/alien_kraken/_alien_tentacle_melee.gscbin b/data/IW6/maps/mp/agents/alien/alien_kraken/_alien_tentacle_melee.gscbin new file mode 100644 index 00000000..ad432f89 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/alien_kraken/_alien_tentacle_melee.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/alien_spider/_alien_spider.gscbin b/data/IW6/maps/mp/agents/alien/alien_spider/_alien_spider.gscbin new file mode 100644 index 00000000..8f95403e Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/alien_spider/_alien_spider.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/alien_spider/_alien_spider_idle.gscbin b/data/IW6/maps/mp/agents/alien/alien_spider/_alien_spider_idle.gscbin new file mode 100644 index 00000000..00b42bb6 Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/alien_spider/_alien_spider_idle.gscbin differ diff --git a/data/IW6/maps/mp/agents/alien/alien_spider/_alien_spider_melee.gscbin b/data/IW6/maps/mp/agents/alien/alien_spider/_alien_spider_melee.gscbin new file mode 100644 index 00000000..ace7fa7f Binary files /dev/null and b/data/IW6/maps/mp/agents/alien/alien_spider/_alien_spider_melee.gscbin differ diff --git a/data/IW6/maps/mp/agents/dog/_dog_idle.gscbin b/data/IW6/maps/mp/agents/dog/_dog_idle.gscbin new file mode 100644 index 00000000..ebe23769 Binary files /dev/null and b/data/IW6/maps/mp/agents/dog/_dog_idle.gscbin differ diff --git a/data/IW6/maps/mp/agents/dog/_dog_melee.gscbin b/data/IW6/maps/mp/agents/dog/_dog_melee.gscbin new file mode 100644 index 00000000..4984609f Binary files /dev/null and b/data/IW6/maps/mp/agents/dog/_dog_melee.gscbin differ diff --git a/data/IW6/maps/mp/agents/dog/_dog_move.gscbin b/data/IW6/maps/mp/agents/dog/_dog_move.gscbin new file mode 100644 index 00000000..9c466298 Binary files /dev/null and b/data/IW6/maps/mp/agents/dog/_dog_move.gscbin differ diff --git a/data/IW6/maps/mp/agents/dog/_dog_think.gscbin b/data/IW6/maps/mp/agents/dog/_dog_think.gscbin new file mode 100644 index 00000000..cc2f322d Binary files /dev/null and b/data/IW6/maps/mp/agents/dog/_dog_think.gscbin differ diff --git a/data/IW6/maps/mp/agents/dog/_dog_traverse.gscbin b/data/IW6/maps/mp/agents/dog/_dog_traverse.gscbin new file mode 100644 index 00000000..a0f920b0 Binary files /dev/null and b/data/IW6/maps/mp/agents/dog/_dog_traverse.gscbin differ diff --git a/data/IW6/maps/mp/alien/1418.gscbin b/data/IW6/maps/mp/alien/1418.gscbin new file mode 100644 index 00000000..b5d6ff18 Binary files /dev/null and b/data/IW6/maps/mp/alien/1418.gscbin differ diff --git a/data/IW6/maps/mp/alien/1419.gscbin b/data/IW6/maps/mp/alien/1419.gscbin new file mode 100644 index 00000000..e293e5b6 Binary files /dev/null and b/data/IW6/maps/mp/alien/1419.gscbin differ diff --git a/data/IW6/maps/mp/alien/1420.gscbin b/data/IW6/maps/mp/alien/1420.gscbin new file mode 100644 index 00000000..a7fef98c Binary files /dev/null and b/data/IW6/maps/mp/alien/1420.gscbin differ diff --git a/data/IW6/maps/mp/alien/1421.gscbin b/data/IW6/maps/mp/alien/1421.gscbin new file mode 100644 index 00000000..f589ae16 Binary files /dev/null and b/data/IW6/maps/mp/alien/1421.gscbin differ diff --git a/data/IW6/maps/mp/alien/1422.gscbin b/data/IW6/maps/mp/alien/1422.gscbin new file mode 100644 index 00000000..5ee534cb Binary files /dev/null and b/data/IW6/maps/mp/alien/1422.gscbin differ diff --git a/data/IW6/maps/mp/alien/1423.gscbin b/data/IW6/maps/mp/alien/1423.gscbin new file mode 100644 index 00000000..d9a03624 Binary files /dev/null and b/data/IW6/maps/mp/alien/1423.gscbin differ diff --git a/data/IW6/maps/mp/alien/1424.gscbin b/data/IW6/maps/mp/alien/1424.gscbin new file mode 100644 index 00000000..9abf0324 Binary files /dev/null and b/data/IW6/maps/mp/alien/1424.gscbin differ diff --git a/data/IW6/maps/mp/alien/1425.gscbin b/data/IW6/maps/mp/alien/1425.gscbin new file mode 100644 index 00000000..3f4ccbe3 Binary files /dev/null and b/data/IW6/maps/mp/alien/1425.gscbin differ diff --git a/data/IW6/maps/mp/alien/1426.gscbin b/data/IW6/maps/mp/alien/1426.gscbin new file mode 100644 index 00000000..1f774c96 Binary files /dev/null and b/data/IW6/maps/mp/alien/1426.gscbin differ diff --git a/data/IW6/maps/mp/alien/1427.gscbin b/data/IW6/maps/mp/alien/1427.gscbin new file mode 100644 index 00000000..2c99b1cd Binary files /dev/null and b/data/IW6/maps/mp/alien/1427.gscbin differ diff --git a/data/IW6/maps/mp/alien/1428.gscbin b/data/IW6/maps/mp/alien/1428.gscbin new file mode 100644 index 00000000..b3ce239f Binary files /dev/null and b/data/IW6/maps/mp/alien/1428.gscbin differ diff --git a/data/IW6/maps/mp/alien/1429.gscbin b/data/IW6/maps/mp/alien/1429.gscbin new file mode 100644 index 00000000..03fd07e9 Binary files /dev/null and b/data/IW6/maps/mp/alien/1429.gscbin differ diff --git a/data/IW6/maps/mp/alien/1441.gscbin b/data/IW6/maps/mp/alien/1441.gscbin new file mode 100644 index 00000000..29889ee6 Binary files /dev/null and b/data/IW6/maps/mp/alien/1441.gscbin differ diff --git a/data/IW6/maps/mp/alien/1442.gscbin b/data/IW6/maps/mp/alien/1442.gscbin new file mode 100644 index 00000000..42874c1e Binary files /dev/null and b/data/IW6/maps/mp/alien/1442.gscbin differ diff --git a/data/IW6/maps/mp/alien/1443.gscbin b/data/IW6/maps/mp/alien/1443.gscbin new file mode 100644 index 00000000..f658da4a Binary files /dev/null and b/data/IW6/maps/mp/alien/1443.gscbin differ diff --git a/data/IW6/maps/mp/alien/1444.gscbin b/data/IW6/maps/mp/alien/1444.gscbin new file mode 100644 index 00000000..735bf3c9 Binary files /dev/null and b/data/IW6/maps/mp/alien/1444.gscbin differ diff --git a/data/IW6/maps/mp/alien/1445.gscbin b/data/IW6/maps/mp/alien/1445.gscbin new file mode 100644 index 00000000..f583dd26 Binary files /dev/null and b/data/IW6/maps/mp/alien/1445.gscbin differ diff --git a/data/IW6/maps/mp/alien/1446.gscbin b/data/IW6/maps/mp/alien/1446.gscbin new file mode 100644 index 00000000..83d873d4 Binary files /dev/null and b/data/IW6/maps/mp/alien/1446.gscbin differ diff --git a/data/IW6/maps/mp/alien/1447.gscbin b/data/IW6/maps/mp/alien/1447.gscbin new file mode 100644 index 00000000..59513dae Binary files /dev/null and b/data/IW6/maps/mp/alien/1447.gscbin differ diff --git a/data/IW6/maps/mp/alien/1448.gscbin b/data/IW6/maps/mp/alien/1448.gscbin new file mode 100644 index 00000000..7464e2ab Binary files /dev/null and b/data/IW6/maps/mp/alien/1448.gscbin differ diff --git a/data/IW6/maps/mp/alien/1449.gscbin b/data/IW6/maps/mp/alien/1449.gscbin new file mode 100644 index 00000000..1c3ca4a9 Binary files /dev/null and b/data/IW6/maps/mp/alien/1449.gscbin differ diff --git a/data/IW6/maps/mp/alien/1450.gscbin b/data/IW6/maps/mp/alien/1450.gscbin new file mode 100644 index 00000000..cc292f6c Binary files /dev/null and b/data/IW6/maps/mp/alien/1450.gscbin differ diff --git a/data/IW6/maps/mp/alien/1451.gscbin b/data/IW6/maps/mp/alien/1451.gscbin new file mode 100644 index 00000000..724cd4a1 Binary files /dev/null and b/data/IW6/maps/mp/alien/1451.gscbin differ diff --git a/data/IW6/maps/mp/alien/1452.gscbin b/data/IW6/maps/mp/alien/1452.gscbin new file mode 100644 index 00000000..69908788 Binary files /dev/null and b/data/IW6/maps/mp/alien/1452.gscbin differ diff --git a/data/IW6/maps/mp/alien/1453.gscbin b/data/IW6/maps/mp/alien/1453.gscbin new file mode 100644 index 00000000..e2cc5c75 Binary files /dev/null and b/data/IW6/maps/mp/alien/1453.gscbin differ diff --git a/data/IW6/maps/mp/alien/1454.gscbin b/data/IW6/maps/mp/alien/1454.gscbin new file mode 100644 index 00000000..bac33a2d Binary files /dev/null and b/data/IW6/maps/mp/alien/1454.gscbin differ diff --git a/data/IW6/maps/mp/alien/1455.gscbin b/data/IW6/maps/mp/alien/1455.gscbin new file mode 100644 index 00000000..cc1d721f Binary files /dev/null and b/data/IW6/maps/mp/alien/1455.gscbin differ diff --git a/data/IW6/maps/mp/alien/1456.gscbin b/data/IW6/maps/mp/alien/1456.gscbin new file mode 100644 index 00000000..c9d4ad8f Binary files /dev/null and b/data/IW6/maps/mp/alien/1456.gscbin differ diff --git a/data/IW6/maps/mp/alien/1457.gscbin b/data/IW6/maps/mp/alien/1457.gscbin new file mode 100644 index 00000000..37105b5e Binary files /dev/null and b/data/IW6/maps/mp/alien/1457.gscbin differ diff --git a/data/IW6/maps/mp/alien/1458.gscbin b/data/IW6/maps/mp/alien/1458.gscbin new file mode 100644 index 00000000..00dcdf08 Binary files /dev/null and b/data/IW6/maps/mp/alien/1458.gscbin differ diff --git a/data/IW6/maps/mp/alien/1459.gscbin b/data/IW6/maps/mp/alien/1459.gscbin new file mode 100644 index 00000000..f6ea3ec5 Binary files /dev/null and b/data/IW6/maps/mp/alien/1459.gscbin differ diff --git a/data/IW6/maps/mp/alien/1460.gscbin b/data/IW6/maps/mp/alien/1460.gscbin new file mode 100644 index 00000000..eaaa6390 Binary files /dev/null and b/data/IW6/maps/mp/alien/1460.gscbin differ diff --git a/data/IW6/maps/mp/alien/1461.gscbin b/data/IW6/maps/mp/alien/1461.gscbin new file mode 100644 index 00000000..2230fb0b Binary files /dev/null and b/data/IW6/maps/mp/alien/1461.gscbin differ diff --git a/data/IW6/maps/mp/alien/1462.gscbin b/data/IW6/maps/mp/alien/1462.gscbin new file mode 100644 index 00000000..1e102a92 Binary files /dev/null and b/data/IW6/maps/mp/alien/1462.gscbin differ diff --git a/data/IW6/maps/mp/alien/1463.gscbin b/data/IW6/maps/mp/alien/1463.gscbin new file mode 100644 index 00000000..3970819e Binary files /dev/null and b/data/IW6/maps/mp/alien/1463.gscbin differ diff --git a/data/IW6/maps/mp/alien/1464.gscbin b/data/IW6/maps/mp/alien/1464.gscbin new file mode 100644 index 00000000..131ec126 Binary files /dev/null and b/data/IW6/maps/mp/alien/1464.gscbin differ diff --git a/data/IW6/maps/mp/alien/_achievement_dlc2.gscbin b/data/IW6/maps/mp/alien/_achievement_dlc2.gscbin new file mode 100644 index 00000000..01e1562f Binary files /dev/null and b/data/IW6/maps/mp/alien/_achievement_dlc2.gscbin differ diff --git a/data/IW6/maps/mp/alien/_achievement_dlc3.gscbin b/data/IW6/maps/mp/alien/_achievement_dlc3.gscbin new file mode 100644 index 00000000..085b4a4c Binary files /dev/null and b/data/IW6/maps/mp/alien/_achievement_dlc3.gscbin differ diff --git a/data/IW6/maps/mp/alien/_achievement_dlc4.gscbin b/data/IW6/maps/mp/alien/_achievement_dlc4.gscbin new file mode 100644 index 00000000..671ffb34 Binary files /dev/null and b/data/IW6/maps/mp/alien/_achievement_dlc4.gscbin differ diff --git a/data/IW6/maps/mp/alien/_alien_class_skills_main.gscbin b/data/IW6/maps/mp/alien/_alien_class_skills_main.gscbin new file mode 100644 index 00000000..063229dc Binary files /dev/null and b/data/IW6/maps/mp/alien/_alien_class_skills_main.gscbin differ diff --git a/data/IW6/maps/mp/alien/_alien_maaws.gscbin b/data/IW6/maps/mp/alien/_alien_maaws.gscbin new file mode 100644 index 00000000..524e0e6e Binary files /dev/null and b/data/IW6/maps/mp/alien/_alien_maaws.gscbin differ diff --git a/data/IW6/maps/mp/alien/_alien_plant.gscbin b/data/IW6/maps/mp/alien/_alien_plant.gscbin new file mode 100644 index 00000000..34b113f1 Binary files /dev/null and b/data/IW6/maps/mp/alien/_alien_plant.gscbin differ diff --git a/data/IW6/maps/mp/alien/_alien_vanguard.gscbin b/data/IW6/maps/mp/alien/_alien_vanguard.gscbin new file mode 100644 index 00000000..00675991 Binary files /dev/null and b/data/IW6/maps/mp/alien/_alien_vanguard.gscbin differ diff --git a/data/IW6/maps/mp/alien/_beacon_weapon.gscbin b/data/IW6/maps/mp/alien/_beacon_weapon.gscbin new file mode 100644 index 00000000..dbf759e1 Binary files /dev/null and b/data/IW6/maps/mp/alien/_beacon_weapon.gscbin differ diff --git a/data/IW6/maps/mp/alien/_chaos.gscbin b/data/IW6/maps/mp/alien/_chaos.gscbin new file mode 100644 index 00000000..19d0cec3 Binary files /dev/null and b/data/IW6/maps/mp/alien/_chaos.gscbin differ diff --git a/data/IW6/maps/mp/alien/_chaos_laststand.gscbin b/data/IW6/maps/mp/alien/_chaos_laststand.gscbin new file mode 100644 index 00000000..5e912882 Binary files /dev/null and b/data/IW6/maps/mp/alien/_chaos_laststand.gscbin differ diff --git a/data/IW6/maps/mp/alien/_chaos_utility.gscbin b/data/IW6/maps/mp/alien/_chaos_utility.gscbin new file mode 100644 index 00000000..2ac39e99 Binary files /dev/null and b/data/IW6/maps/mp/alien/_chaos_utility.gscbin differ diff --git a/data/IW6/maps/mp/alien/_cortex.gscbin b/data/IW6/maps/mp/alien/_cortex.gscbin new file mode 100644 index 00000000..7fda53a4 Binary files /dev/null and b/data/IW6/maps/mp/alien/_cortex.gscbin differ diff --git a/data/IW6/maps/mp/alien/_dev.gscbin b/data/IW6/maps/mp/alien/_dev.gscbin new file mode 100644 index 00000000..64b3ffc7 Binary files /dev/null and b/data/IW6/maps/mp/alien/_dev.gscbin differ diff --git a/data/IW6/maps/mp/alien/_dlc3_weapon.gscbin b/data/IW6/maps/mp/alien/_dlc3_weapon.gscbin new file mode 100644 index 00000000..5736f754 Binary files /dev/null and b/data/IW6/maps/mp/alien/_dlc3_weapon.gscbin differ diff --git a/data/IW6/maps/mp/alien/_gamescore_beacon.gscbin b/data/IW6/maps/mp/alien/_gamescore_beacon.gscbin new file mode 100644 index 00000000..0debcf6a Binary files /dev/null and b/data/IW6/maps/mp/alien/_gamescore_beacon.gscbin differ diff --git a/data/IW6/maps/mp/alien/_gamescore_dlc3.gscbin b/data/IW6/maps/mp/alien/_gamescore_dlc3.gscbin new file mode 100644 index 00000000..f1a842d8 Binary files /dev/null and b/data/IW6/maps/mp/alien/_gamescore_dlc3.gscbin differ diff --git a/data/IW6/maps/mp/alien/_gamescore_last.gscbin b/data/IW6/maps/mp/alien/_gamescore_last.gscbin new file mode 100644 index 00000000..5c0fa6cf Binary files /dev/null and b/data/IW6/maps/mp/alien/_gamescore_last.gscbin differ diff --git a/data/IW6/maps/mp/alien/mp_alien_beacon_challenges.gscbin b/data/IW6/maps/mp/alien/mp_alien_beacon_challenges.gscbin new file mode 100644 index 00000000..7db874ad Binary files /dev/null and b/data/IW6/maps/mp/alien/mp_alien_beacon_challenges.gscbin differ diff --git a/data/IW6/maps/mp/alien/mp_alien_beacon_turret.gscbin b/data/IW6/maps/mp/alien/mp_alien_beacon_turret.gscbin new file mode 100644 index 00000000..11b0df48 Binary files /dev/null and b/data/IW6/maps/mp/alien/mp_alien_beacon_turret.gscbin differ diff --git a/data/IW6/maps/mp/alien/mp_alien_dlc3_ark.gscbin b/data/IW6/maps/mp/alien/mp_alien_dlc3_ark.gscbin new file mode 100644 index 00000000..c48cf8ad Binary files /dev/null and b/data/IW6/maps/mp/alien/mp_alien_dlc3_ark.gscbin differ diff --git a/data/IW6/maps/mp/alien/mp_alien_dlc3_challenges.gscbin b/data/IW6/maps/mp/alien/mp_alien_dlc3_challenges.gscbin new file mode 100644 index 00000000..b764f664 Binary files /dev/null and b/data/IW6/maps/mp/alien/mp_alien_dlc3_challenges.gscbin differ diff --git a/data/IW6/maps/mp/alien/mp_alien_last_challenges.gscbin b/data/IW6/maps/mp/alien/mp_alien_last_challenges.gscbin new file mode 100644 index 00000000..43a8778b Binary files /dev/null and b/data/IW6/maps/mp/alien/mp_alien_last_challenges.gscbin differ diff --git a/data/IW6/maps/mp/alien/mp_alien_last_turret.gscbin b/data/IW6/maps/mp/alien/mp_alien_last_turret.gscbin new file mode 100644 index 00000000..6b91f0f0 Binary files /dev/null and b/data/IW6/maps/mp/alien/mp_alien_last_turret.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots.gscbin b/data/IW6/maps/mp/bots/_bots.gscbin new file mode 100644 index 00000000..4b925c03 Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_fireteam.gscbin b/data/IW6/maps/mp/bots/_bots_fireteam.gscbin new file mode 100644 index 00000000..f4caa505 Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_fireteam.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_fireteam_commander.gscbin b/data/IW6/maps/mp/bots/_bots_fireteam_commander.gscbin new file mode 100644 index 00000000..0e516592 Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_fireteam_commander.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_gametype_aliens.gscbin b/data/IW6/maps/mp/bots/_bots_gametype_aliens.gscbin new file mode 100644 index 00000000..eefa7433 Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_gametype_aliens.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_gametype_blitz.gscbin b/data/IW6/maps/mp/bots/_bots_gametype_blitz.gscbin new file mode 100644 index 00000000..3fc1ae59 Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_gametype_blitz.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_gametype_conf.gscbin b/data/IW6/maps/mp/bots/_bots_gametype_conf.gscbin new file mode 100644 index 00000000..425d7b01 Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_gametype_conf.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_gametype_cranked.gscbin b/data/IW6/maps/mp/bots/_bots_gametype_cranked.gscbin new file mode 100644 index 00000000..ade82ef6 Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_gametype_cranked.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_gametype_dm.gscbin b/data/IW6/maps/mp/bots/_bots_gametype_dm.gscbin new file mode 100644 index 00000000..01c4c8f0 Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_gametype_dm.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_gametype_dom.gscbin b/data/IW6/maps/mp/bots/_bots_gametype_dom.gscbin new file mode 100644 index 00000000..ebd06486 Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_gametype_dom.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_gametype_grind.gscbin b/data/IW6/maps/mp/bots/_bots_gametype_grind.gscbin new file mode 100644 index 00000000..e2eb477e Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_gametype_grind.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_gametype_grnd.gscbin b/data/IW6/maps/mp/bots/_bots_gametype_grnd.gscbin new file mode 100644 index 00000000..9850ecb8 Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_gametype_grnd.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_gametype_gun.gscbin b/data/IW6/maps/mp/bots/_bots_gametype_gun.gscbin new file mode 100644 index 00000000..1278521f Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_gametype_gun.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_gametype_horde.gscbin b/data/IW6/maps/mp/bots/_bots_gametype_horde.gscbin new file mode 100644 index 00000000..c15a319c Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_gametype_horde.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_gametype_infect.gscbin b/data/IW6/maps/mp/bots/_bots_gametype_infect.gscbin new file mode 100644 index 00000000..936d88bc Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_gametype_infect.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_gametype_mugger.gscbin b/data/IW6/maps/mp/bots/_bots_gametype_mugger.gscbin new file mode 100644 index 00000000..3f16fd7b Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_gametype_mugger.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_gametype_sd.gscbin b/data/IW6/maps/mp/bots/_bots_gametype_sd.gscbin new file mode 100644 index 00000000..bda0227d Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_gametype_sd.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_gametype_siege.gscbin b/data/IW6/maps/mp/bots/_bots_gametype_siege.gscbin new file mode 100644 index 00000000..9591facb Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_gametype_siege.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_gametype_sotf.gscbin b/data/IW6/maps/mp/bots/_bots_gametype_sotf.gscbin new file mode 100644 index 00000000..42671e43 Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_gametype_sotf.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_gametype_sotf_ffa.gscbin b/data/IW6/maps/mp/bots/_bots_gametype_sotf_ffa.gscbin new file mode 100644 index 00000000..6d3e8b41 Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_gametype_sotf_ffa.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_gametype_sr.gscbin b/data/IW6/maps/mp/bots/_bots_gametype_sr.gscbin new file mode 100644 index 00000000..d79fd526 Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_gametype_sr.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_gametype_war.gscbin b/data/IW6/maps/mp/bots/_bots_gametype_war.gscbin new file mode 100644 index 00000000..a015ff80 Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_gametype_war.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_ks.gscbin b/data/IW6/maps/mp/bots/_bots_ks.gscbin new file mode 100644 index 00000000..d0586b9f Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_ks.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_ks_remote_vehicle.gscbin b/data/IW6/maps/mp/bots/_bots_ks_remote_vehicle.gscbin new file mode 100644 index 00000000..57bb2459 Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_ks_remote_vehicle.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_loadout.gscbin b/data/IW6/maps/mp/bots/_bots_loadout.gscbin new file mode 100644 index 00000000..32dab9cc Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_loadout.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_personality.gscbin b/data/IW6/maps/mp/bots/_bots_personality.gscbin new file mode 100644 index 00000000..18dee1af Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_personality.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_sentry.gscbin b/data/IW6/maps/mp/bots/_bots_sentry.gscbin new file mode 100644 index 00000000..125635b1 Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_sentry.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_strategy.gscbin b/data/IW6/maps/mp/bots/_bots_strategy.gscbin new file mode 100644 index 00000000..017a8e30 Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_strategy.gscbin differ diff --git a/data/IW6/maps/mp/bots/_bots_util.gscbin b/data/IW6/maps/mp/bots/_bots_util.gscbin new file mode 100644 index 00000000..0155a505 Binary files /dev/null and b/data/IW6/maps/mp/bots/_bots_util.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_battlebuddy.gscbin b/data/IW6/maps/mp/gametypes/_battlebuddy.gscbin new file mode 100644 index 00000000..ad2c7943 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_battlebuddy.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_battlechatter_mp.gscbin b/data/IW6/maps/mp/gametypes/_battlechatter_mp.gscbin new file mode 100644 index 00000000..50212b29 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_battlechatter_mp.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_callbacksetup.gscbin b/data/IW6/maps/mp/gametypes/_callbacksetup.gscbin new file mode 100644 index 00000000..24e81790 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_callbacksetup.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_class.gscbin b/data/IW6/maps/mp/gametypes/_class.gscbin new file mode 100644 index 00000000..da7b5d2e Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_class.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_clientids.gscbin b/data/IW6/maps/mp/gametypes/_clientids.gscbin new file mode 100644 index 00000000..2646aeda Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_clientids.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_damage.gscbin b/data/IW6/maps/mp/gametypes/_damage.gscbin new file mode 100644 index 00000000..0ae723b5 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_damage.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_damagefeedback.gscbin b/data/IW6/maps/mp/gametypes/_damagefeedback.gscbin new file mode 100644 index 00000000..a9c590f2 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_damagefeedback.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_deathicons.gscbin b/data/IW6/maps/mp/gametypes/_deathicons.gscbin new file mode 100644 index 00000000..3f72430b Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_deathicons.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_dev.gscbin b/data/IW6/maps/mp/gametypes/_dev.gscbin new file mode 100644 index 00000000..ad1ca7a2 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_dev.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_door.gscbin b/data/IW6/maps/mp/gametypes/_door.gscbin new file mode 100644 index 00000000..67dd466f Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_door.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_friendicons.gscbin b/data/IW6/maps/mp/gametypes/_friendicons.gscbin new file mode 100644 index 00000000..d03a7aeb Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_friendicons.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_gamelogic.gscbin b/data/IW6/maps/mp/gametypes/_gamelogic.gscbin new file mode 100644 index 00000000..f8dcdd15 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_gamelogic.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_gameobjects.gscbin b/data/IW6/maps/mp/gametypes/_gameobjects.gscbin new file mode 100644 index 00000000..c41aaeec Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_gameobjects.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_gamescore.gscbin b/data/IW6/maps/mp/gametypes/_gamescore.gscbin new file mode 100644 index 00000000..3159a79e Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_gamescore.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_globalentities.gscbin b/data/IW6/maps/mp/gametypes/_globalentities.gscbin new file mode 100644 index 00000000..7665b0a8 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_globalentities.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_globallogic.gscbin b/data/IW6/maps/mp/gametypes/_globallogic.gscbin new file mode 100644 index 00000000..0a10a15f Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_globallogic.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_hardpoints.gscbin b/data/IW6/maps/mp/gametypes/_hardpoints.gscbin new file mode 100644 index 00000000..51de5afc Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_hardpoints.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_healthoverlay.gscbin b/data/IW6/maps/mp/gametypes/_healthoverlay.gscbin new file mode 100644 index 00000000..e94e992f Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_healthoverlay.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_horde_crates.gscbin b/data/IW6/maps/mp/gametypes/_horde_crates.gscbin new file mode 100644 index 00000000..81e007e0 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_horde_crates.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_horde_laststand.gscbin b/data/IW6/maps/mp/gametypes/_horde_laststand.gscbin new file mode 100644 index 00000000..80c13046 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_horde_laststand.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_horde_util.gscbin b/data/IW6/maps/mp/gametypes/_horde_util.gscbin new file mode 100644 index 00000000..9c0bed57 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_horde_util.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_hostmigration.gscbin b/data/IW6/maps/mp/gametypes/_hostmigration.gscbin new file mode 100644 index 00000000..3731742e Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_hostmigration.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_hud.gscbin b/data/IW6/maps/mp/gametypes/_hud.gscbin new file mode 100644 index 00000000..c5b2f761 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_hud.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_hud_message.gscbin b/data/IW6/maps/mp/gametypes/_hud_message.gscbin new file mode 100644 index 00000000..b86ac314 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_hud_message.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_hud_util.gscbin b/data/IW6/maps/mp/gametypes/_hud_util.gscbin new file mode 100644 index 00000000..83a94ff8 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_hud_util.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_intel.gscbin b/data/IW6/maps/mp/gametypes/_intel.gscbin new file mode 100644 index 00000000..22ed583e Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_intel.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_intelchallenges.gscbin b/data/IW6/maps/mp/gametypes/_intelchallenges.gscbin new file mode 100644 index 00000000..ce3bf938 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_intelchallenges.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_killcam.gscbin b/data/IW6/maps/mp/gametypes/_killcam.gscbin new file mode 100644 index 00000000..f9baa8dd Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_killcam.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_menus.gscbin b/data/IW6/maps/mp/gametypes/_menus.gscbin new file mode 100644 index 00000000..033a77ab Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_menus.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_missions.gscbin b/data/IW6/maps/mp/gametypes/_missions.gscbin new file mode 100644 index 00000000..f065ca54 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_missions.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_music_and_dialog.gscbin b/data/IW6/maps/mp/gametypes/_music_and_dialog.gscbin new file mode 100644 index 00000000..88ba3883 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_music_and_dialog.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_objpoints.gscbin b/data/IW6/maps/mp/gametypes/_objpoints.gscbin new file mode 100644 index 00000000..07e89008 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_objpoints.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_outline.gscbin b/data/IW6/maps/mp/gametypes/_outline.gscbin new file mode 100644 index 00000000..f164c4bd Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_outline.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_persistence.gscbin b/data/IW6/maps/mp/gametypes/_persistence.gscbin new file mode 100644 index 00000000..580aa1c8 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_persistence.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_playercards.gscbin b/data/IW6/maps/mp/gametypes/_playercards.gscbin new file mode 100644 index 00000000..22559f7a Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_playercards.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_playerlogic.gscbin b/data/IW6/maps/mp/gametypes/_playerlogic.gscbin new file mode 100644 index 00000000..8699c2ef Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_playerlogic.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_rank.gscbin b/data/IW6/maps/mp/gametypes/_rank.gscbin new file mode 100644 index 00000000..4addcae3 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_rank.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_serversettings.gscbin b/data/IW6/maps/mp/gametypes/_serversettings.gscbin new file mode 100644 index 00000000..3952122a Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_serversettings.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_shellshock.gscbin b/data/IW6/maps/mp/gametypes/_shellshock.gscbin new file mode 100644 index 00000000..8c351cc3 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_shellshock.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_spawnfactor.gscbin b/data/IW6/maps/mp/gametypes/_spawnfactor.gscbin new file mode 100644 index 00000000..de6ed5d8 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_spawnfactor.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_spawnlogic.gscbin b/data/IW6/maps/mp/gametypes/_spawnlogic.gscbin new file mode 100644 index 00000000..2e387b3d Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_spawnlogic.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_spawnscoring.gscbin b/data/IW6/maps/mp/gametypes/_spawnscoring.gscbin new file mode 100644 index 00000000..0b39c7d0 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_spawnscoring.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_spectating.gscbin b/data/IW6/maps/mp/gametypes/_spectating.gscbin new file mode 100644 index 00000000..9721ed67 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_spectating.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_teams.gscbin b/data/IW6/maps/mp/gametypes/_teams.gscbin new file mode 100644 index 00000000..dff1ee45 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_teams.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_trophy_system.gscbin b/data/IW6/maps/mp/gametypes/_trophy_system.gscbin new file mode 100644 index 00000000..f16b68aa Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_trophy_system.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_tweakables.gscbin b/data/IW6/maps/mp/gametypes/_tweakables.gscbin new file mode 100644 index 00000000..dae73b86 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_tweakables.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/_weapons.gscbin b/data/IW6/maps/mp/gametypes/_weapons.gscbin new file mode 100644 index 00000000..e49ea09f Binary files /dev/null and b/data/IW6/maps/mp/gametypes/_weapons.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/aliens.gscbin b/data/IW6/maps/mp/gametypes/aliens.gscbin new file mode 100644 index 00000000..f4deec49 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/aliens.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/blitz.gscbin b/data/IW6/maps/mp/gametypes/blitz.gscbin new file mode 100644 index 00000000..deeef4d4 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/blitz.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/conf.gscbin b/data/IW6/maps/mp/gametypes/conf.gscbin new file mode 100644 index 00000000..8b947f30 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/conf.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/cranked.gscbin b/data/IW6/maps/mp/gametypes/cranked.gscbin new file mode 100644 index 00000000..a0987717 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/cranked.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/dm.gscbin b/data/IW6/maps/mp/gametypes/dm.gscbin new file mode 100644 index 00000000..a573b8fd Binary files /dev/null and b/data/IW6/maps/mp/gametypes/dm.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/dom.gscbin b/data/IW6/maps/mp/gametypes/dom.gscbin new file mode 100644 index 00000000..6a0515dc Binary files /dev/null and b/data/IW6/maps/mp/gametypes/dom.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/grind.gscbin b/data/IW6/maps/mp/gametypes/grind.gscbin new file mode 100644 index 00000000..3c16570b Binary files /dev/null and b/data/IW6/maps/mp/gametypes/grind.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/grnd.gscbin b/data/IW6/maps/mp/gametypes/grnd.gscbin new file mode 100644 index 00000000..fc1de183 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/grnd.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/gun.gscbin b/data/IW6/maps/mp/gametypes/gun.gscbin new file mode 100644 index 00000000..5b2934bf Binary files /dev/null and b/data/IW6/maps/mp/gametypes/gun.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/horde.gscbin b/data/IW6/maps/mp/gametypes/horde.gscbin new file mode 100644 index 00000000..6c7c2318 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/horde.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/infect.gscbin b/data/IW6/maps/mp/gametypes/infect.gscbin new file mode 100644 index 00000000..5954e04e Binary files /dev/null and b/data/IW6/maps/mp/gametypes/infect.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/mugger.gscbin b/data/IW6/maps/mp/gametypes/mugger.gscbin new file mode 100644 index 00000000..4b595f84 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/mugger.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/sd.gscbin b/data/IW6/maps/mp/gametypes/sd.gscbin new file mode 100644 index 00000000..4af61e69 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/sd.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/siege.gscbin b/data/IW6/maps/mp/gametypes/siege.gscbin new file mode 100644 index 00000000..3c5dccbf Binary files /dev/null and b/data/IW6/maps/mp/gametypes/siege.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/sotf.gscbin b/data/IW6/maps/mp/gametypes/sotf.gscbin new file mode 100644 index 00000000..5c21750b Binary files /dev/null and b/data/IW6/maps/mp/gametypes/sotf.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/sotf_ffa.gscbin b/data/IW6/maps/mp/gametypes/sotf_ffa.gscbin new file mode 100644 index 00000000..ea2c57cc Binary files /dev/null and b/data/IW6/maps/mp/gametypes/sotf_ffa.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/sr.gscbin b/data/IW6/maps/mp/gametypes/sr.gscbin new file mode 100644 index 00000000..f6ed7954 Binary files /dev/null and b/data/IW6/maps/mp/gametypes/sr.gscbin differ diff --git a/data/IW6/maps/mp/gametypes/war.gscbin b/data/IW6/maps/mp/gametypes/war.gscbin new file mode 100644 index 00000000..449ccd5b Binary files /dev/null and b/data/IW6/maps/mp/gametypes/war.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/1513.gscbin b/data/IW6/maps/mp/killstreaks/1513.gscbin new file mode 100644 index 00000000..1be95c66 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/1513.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/1515.gscbin b/data/IW6/maps/mp/killstreaks/1515.gscbin new file mode 100644 index 00000000..993f47b9 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/1515.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/1523.gscbin b/data/IW6/maps/mp/killstreaks/1523.gscbin new file mode 100644 index 00000000..3d361b91 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/1523.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/1534.gscbin b/data/IW6/maps/mp/killstreaks/1534.gscbin new file mode 100644 index 00000000..e0338f14 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/1534.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/1544.gscbin b/data/IW6/maps/mp/killstreaks/1544.gscbin new file mode 100644 index 00000000..7d4eb486 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/1544.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/1556.gscbin b/data/IW6/maps/mp/killstreaks/1556.gscbin new file mode 100644 index 00000000..10cdf527 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/1556.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/1561.gscbin b/data/IW6/maps/mp/killstreaks/1561.gscbin new file mode 100644 index 00000000..a48a1fd1 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/1561.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_a10.gscbin b/data/IW6/maps/mp/killstreaks/_a10.gscbin new file mode 100644 index 00000000..c4b7ab55 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_a10.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_aamissile.gscbin b/data/IW6/maps/mp/killstreaks/_aamissile.gscbin new file mode 100644 index 00000000..f3a56096 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_aamissile.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_ac130.gscbin b/data/IW6/maps/mp/killstreaks/_ac130.gscbin new file mode 100644 index 00000000..4d99fd0e Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_ac130.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_agent_killstreak.gscbin b/data/IW6/maps/mp/killstreaks/_agent_killstreak.gscbin new file mode 100644 index 00000000..7f89296e Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_agent_killstreak.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_air_superiority.gscbin b/data/IW6/maps/mp/killstreaks/_air_superiority.gscbin new file mode 100644 index 00000000..e777cb46 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_air_superiority.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_airdrop.gscbin b/data/IW6/maps/mp/killstreaks/_airdrop.gscbin new file mode 100644 index 00000000..6b8844ad Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_airdrop.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_airstrike.gscbin b/data/IW6/maps/mp/killstreaks/_airstrike.gscbin new file mode 100644 index 00000000..d8863965 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_airstrike.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_autosentry.gscbin b/data/IW6/maps/mp/killstreaks/_autosentry.gscbin new file mode 100644 index 00000000..bb5939b8 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_autosentry.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_autoshotgun.gscbin b/data/IW6/maps/mp/killstreaks/_autoshotgun.gscbin new file mode 100644 index 00000000..242313e5 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_autoshotgun.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_deployablebox.gscbin b/data/IW6/maps/mp/killstreaks/_deployablebox.gscbin new file mode 100644 index 00000000..1c5af161 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_deployablebox.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_deployablebox_ammo.gscbin b/data/IW6/maps/mp/killstreaks/_deployablebox_ammo.gscbin new file mode 100644 index 00000000..d5a19cf5 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_deployablebox_ammo.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_deployablebox_grenades.gscbin b/data/IW6/maps/mp/killstreaks/_deployablebox_grenades.gscbin new file mode 100644 index 00000000..d2f85525 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_deployablebox_grenades.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_deployablebox_gun.gscbin b/data/IW6/maps/mp/killstreaks/_deployablebox_gun.gscbin new file mode 100644 index 00000000..1af01a38 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_deployablebox_gun.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_deployablebox_juicebox.gscbin b/data/IW6/maps/mp/killstreaks/_deployablebox_juicebox.gscbin new file mode 100644 index 00000000..01ff3c0c Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_deployablebox_juicebox.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_deployablebox_vest.gscbin b/data/IW6/maps/mp/killstreaks/_deployablebox_vest.gscbin new file mode 100644 index 00000000..dba54b8f Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_deployablebox_vest.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_designator_grenade.gscbin b/data/IW6/maps/mp/killstreaks/_designator_grenade.gscbin new file mode 100644 index 00000000..843b3a3c Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_designator_grenade.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_dog_killstreak.gscbin b/data/IW6/maps/mp/killstreaks/_dog_killstreak.gscbin new file mode 100644 index 00000000..c1a34f47 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_dog_killstreak.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_dronehive.gscbin b/data/IW6/maps/mp/killstreaks/_dronehive.gscbin new file mode 100644 index 00000000..02517c70 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_dronehive.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_emp.gscbin b/data/IW6/maps/mp/killstreaks/_emp.gscbin new file mode 100644 index 00000000..48005f35 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_emp.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_escortairdrop.gscbin b/data/IW6/maps/mp/killstreaks/_escortairdrop.gscbin new file mode 100644 index 00000000..85ddb049 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_escortairdrop.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_flares.gscbin b/data/IW6/maps/mp/killstreaks/_flares.gscbin new file mode 100644 index 00000000..8e015a19 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_flares.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_gas_airstrike.gscbin b/data/IW6/maps/mp/killstreaks/_gas_airstrike.gscbin new file mode 100644 index 00000000..97d3dd1e Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_gas_airstrike.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_harrier.gscbin b/data/IW6/maps/mp/killstreaks/_harrier.gscbin new file mode 100644 index 00000000..fe18f301 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_harrier.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_helicopter.gscbin b/data/IW6/maps/mp/killstreaks/_helicopter.gscbin new file mode 100644 index 00000000..f827724f Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_helicopter.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_helicopter_flock.gscbin b/data/IW6/maps/mp/killstreaks/_helicopter_flock.gscbin new file mode 100644 index 00000000..093f2df6 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_helicopter_flock.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_helicopter_guard.gscbin b/data/IW6/maps/mp/killstreaks/_helicopter_guard.gscbin new file mode 100644 index 00000000..ec2fe291 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_helicopter_guard.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_helicopter_pilot.gscbin b/data/IW6/maps/mp/killstreaks/_helicopter_pilot.gscbin new file mode 100644 index 00000000..5213963a Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_helicopter_pilot.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_helisniper.gscbin b/data/IW6/maps/mp/killstreaks/_helisniper.gscbin new file mode 100644 index 00000000..f891282d Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_helisniper.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_ims.gscbin b/data/IW6/maps/mp/killstreaks/_ims.gscbin new file mode 100644 index 00000000..9584c4a6 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_ims.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_jammer.gscbin b/data/IW6/maps/mp/killstreaks/_jammer.gscbin new file mode 100644 index 00000000..c9216193 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_jammer.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_juggernaut.gscbin b/data/IW6/maps/mp/killstreaks/_juggernaut.gscbin new file mode 100644 index 00000000..98de9eb6 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_juggernaut.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_juggernaut_predator.gscbin b/data/IW6/maps/mp/killstreaks/_juggernaut_predator.gscbin new file mode 100644 index 00000000..bae9c254 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_juggernaut_predator.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_killstreaks.gscbin b/data/IW6/maps/mp/killstreaks/_killstreaks.gscbin new file mode 100644 index 00000000..e20a65f5 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_killstreaks.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_killstreaks_init.gscbin b/data/IW6/maps/mp/killstreaks/_killstreaks_init.gscbin new file mode 100644 index 00000000..62698e3e Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_killstreaks_init.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_lasedstrike.gscbin b/data/IW6/maps/mp/killstreaks/_lasedstrike.gscbin new file mode 100644 index 00000000..abe9d61c Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_lasedstrike.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_mobilemortar.gscbin b/data/IW6/maps/mp/killstreaks/_mobilemortar.gscbin new file mode 100644 index 00000000..3705cb5a Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_mobilemortar.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_mortarstrike.gscbin b/data/IW6/maps/mp/killstreaks/_mortarstrike.gscbin new file mode 100644 index 00000000..afb6d300 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_mortarstrike.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_mrsiartillery.gscbin b/data/IW6/maps/mp/killstreaks/_mrsiartillery.gscbin new file mode 100644 index 00000000..dde8fdc9 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_mrsiartillery.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_nuke.gscbin b/data/IW6/maps/mp/killstreaks/_nuke.gscbin new file mode 100644 index 00000000..7f7fcdcb Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_nuke.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_odin.gscbin b/data/IW6/maps/mp/killstreaks/_odin.gscbin new file mode 100644 index 00000000..d31a2024 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_odin.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_perkstreaks.gscbin b/data/IW6/maps/mp/killstreaks/_perkstreaks.gscbin new file mode 100644 index 00000000..55638029 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_perkstreaks.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_placeable_barrier.gscbin b/data/IW6/maps/mp/killstreaks/_placeable_barrier.gscbin new file mode 100644 index 00000000..5a49f79e Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_placeable_barrier.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_plane.gscbin b/data/IW6/maps/mp/killstreaks/_plane.gscbin new file mode 100644 index 00000000..10fd08a2 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_plane.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_portableaoegenerator.gscbin b/data/IW6/maps/mp/killstreaks/_portableaoegenerator.gscbin new file mode 100644 index 00000000..04f1285c Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_portableaoegenerator.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_remotemissile.gscbin b/data/IW6/maps/mp/killstreaks/_remotemissile.gscbin new file mode 100644 index 00000000..44f6d883 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_remotemissile.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_remotetank.gscbin b/data/IW6/maps/mp/killstreaks/_remotetank.gscbin new file mode 100644 index 00000000..78459ef9 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_remotetank.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_remoteturret.gscbin b/data/IW6/maps/mp/killstreaks/_remoteturret.gscbin new file mode 100644 index 00000000..d07e1def Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_remoteturret.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_remoteuav.gscbin b/data/IW6/maps/mp/killstreaks/_remoteuav.gscbin new file mode 100644 index 00000000..656acfb6 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_remoteuav.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_tank.gscbin b/data/IW6/maps/mp/killstreaks/_tank.gscbin new file mode 100644 index 00000000..ffbacd2a Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_tank.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_teamammorefill.gscbin b/data/IW6/maps/mp/killstreaks/_teamammorefill.gscbin new file mode 100644 index 00000000..dcd4ad7f Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_teamammorefill.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_uav.gscbin b/data/IW6/maps/mp/killstreaks/_uav.gscbin new file mode 100644 index 00000000..e8f83e58 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_uav.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_uplink.gscbin b/data/IW6/maps/mp/killstreaks/_uplink.gscbin new file mode 100644 index 00000000..db52e6e9 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_uplink.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/_vanguard.gscbin b/data/IW6/maps/mp/killstreaks/_vanguard.gscbin new file mode 100644 index 00000000..e98da3cc Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/_vanguard.gscbin differ diff --git a/data/IW6/maps/mp/killstreaks/mp_wolfpack_killstreak.gscbin b/data/IW6/maps/mp/killstreaks/mp_wolfpack_killstreak.gscbin new file mode 100644 index 00000000..a0dd08a1 Binary files /dev/null and b/data/IW6/maps/mp/killstreaks/mp_wolfpack_killstreak.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_armory.gscbin b/data/IW6/maps/mp/mp_alien_armory.gscbin new file mode 100644 index 00000000..53299b2e Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_armory.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_armory_fx.gscbin b/data/IW6/maps/mp/mp_alien_armory_fx.gscbin new file mode 100644 index 00000000..57229a37 Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_armory_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_armory_precache.gscbin b/data/IW6/maps/mp/mp_alien_armory_precache.gscbin new file mode 100644 index 00000000..f24f8dfb Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_armory_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_armory_vignettes.gscbin b/data/IW6/maps/mp/mp_alien_armory_vignettes.gscbin new file mode 100644 index 00000000..7d224e01 Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_armory_vignettes.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_beacon.gscbin b/data/IW6/maps/mp/mp_alien_beacon.gscbin new file mode 100644 index 00000000..f8b0b7b7 Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_beacon.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_beacon_fx.gscbin b/data/IW6/maps/mp/mp_alien_beacon_fx.gscbin new file mode 100644 index 00000000..f589e180 Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_beacon_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_beacon_precache.gscbin b/data/IW6/maps/mp/mp_alien_beacon_precache.gscbin new file mode 100644 index 00000000..3381ffb6 Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_beacon_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_beacon_vignettes.gscbin b/data/IW6/maps/mp/mp_alien_beacon_vignettes.gscbin new file mode 100644 index 00000000..51811bbd Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_beacon_vignettes.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_dlc3.gscbin b/data/IW6/maps/mp/mp_alien_dlc3.gscbin new file mode 100644 index 00000000..e511f723 Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_dlc3.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_dlc3_escape.gscbin b/data/IW6/maps/mp/mp_alien_dlc3_escape.gscbin new file mode 100644 index 00000000..7ca6c370 Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_dlc3_escape.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_dlc3_fx.gscbin b/data/IW6/maps/mp/mp_alien_dlc3_fx.gscbin new file mode 100644 index 00000000..9fc0a44e Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_dlc3_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_dlc3_precache.gscbin b/data/IW6/maps/mp/mp_alien_dlc3_precache.gscbin new file mode 100644 index 00000000..cbf259bc Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_dlc3_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_dlc3_vignettes.gscbin b/data/IW6/maps/mp/mp_alien_dlc3_vignettes.gscbin new file mode 100644 index 00000000..cfb8a516 Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_dlc3_vignettes.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_last.gscbin b/data/IW6/maps/mp/mp_alien_last.gscbin new file mode 100644 index 00000000..c01317db Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_last.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_last_encounters.gscbin b/data/IW6/maps/mp/mp_alien_last_encounters.gscbin new file mode 100644 index 00000000..94cabfa2 Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_last_encounters.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_last_final_battle.gscbin b/data/IW6/maps/mp/mp_alien_last_final_battle.gscbin new file mode 100644 index 00000000..b6b9672f Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_last_final_battle.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_last_fx.gscbin b/data/IW6/maps/mp/mp_alien_last_fx.gscbin new file mode 100644 index 00000000..41ed62de Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_last_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_last_precache.gscbin b/data/IW6/maps/mp/mp_alien_last_precache.gscbin new file mode 100644 index 00000000..a35c0095 Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_last_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_last_progression.gscbin b/data/IW6/maps/mp/mp_alien_last_progression.gscbin new file mode 100644 index 00000000..b35c6db8 Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_last_progression.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_last_traps.gscbin b/data/IW6/maps/mp/mp_alien_last_traps.gscbin new file mode 100644 index 00000000..4c615371 Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_last_traps.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_last_weapon.gscbin b/data/IW6/maps/mp/mp_alien_last_weapon.gscbin new file mode 100644 index 00000000..ef79f863 Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_last_weapon.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_town.gscbin b/data/IW6/maps/mp/mp_alien_town.gscbin new file mode 100644 index 00000000..ae8b834f Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_town.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_town_fx.gscbin b/data/IW6/maps/mp/mp_alien_town_fx.gscbin new file mode 100644 index 00000000..6e942009 Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_town_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_town_precache.gscbin b/data/IW6/maps/mp/mp_alien_town_precache.gscbin new file mode 100644 index 00000000..5ebf2bd9 Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_town_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_alien_weapon.gscbin b/data/IW6/maps/mp/mp_alien_weapon.gscbin new file mode 100644 index 00000000..ef7e6036 Binary files /dev/null and b/data/IW6/maps/mp/mp_alien_weapon.gscbin differ diff --git a/data/IW6/maps/mp/mp_battery3.gscbin b/data/IW6/maps/mp/mp_battery3.gscbin new file mode 100644 index 00000000..aaf8b609 Binary files /dev/null and b/data/IW6/maps/mp/mp_battery3.gscbin differ diff --git a/data/IW6/maps/mp/mp_battery3_fx.gscbin b/data/IW6/maps/mp/mp_battery3_fx.gscbin new file mode 100644 index 00000000..155a2caa Binary files /dev/null and b/data/IW6/maps/mp/mp_battery3_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_battery3_precache.gscbin b/data/IW6/maps/mp/mp_battery3_precache.gscbin new file mode 100644 index 00000000..c41ac165 Binary files /dev/null and b/data/IW6/maps/mp/mp_battery3_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_beast_men.gscbin b/data/IW6/maps/mp/mp_beast_men.gscbin new file mode 100644 index 00000000..6e74b7ed Binary files /dev/null and b/data/IW6/maps/mp/mp_beast_men.gscbin differ diff --git a/data/IW6/maps/mp/mp_boneyard_ns.gscbin b/data/IW6/maps/mp/mp_boneyard_ns.gscbin new file mode 100644 index 00000000..673b4ffe Binary files /dev/null and b/data/IW6/maps/mp/mp_boneyard_ns.gscbin differ diff --git a/data/IW6/maps/mp/mp_boneyard_ns_anim.gscbin b/data/IW6/maps/mp/mp_boneyard_ns_anim.gscbin new file mode 100644 index 00000000..58ce1e18 Binary files /dev/null and b/data/IW6/maps/mp/mp_boneyard_ns_anim.gscbin differ diff --git a/data/IW6/maps/mp/mp_boneyard_ns_fx.gscbin b/data/IW6/maps/mp/mp_boneyard_ns_fx.gscbin new file mode 100644 index 00000000..a985e904 Binary files /dev/null and b/data/IW6/maps/mp/mp_boneyard_ns_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_boneyard_ns_killstreak.gscbin b/data/IW6/maps/mp/mp_boneyard_ns_killstreak.gscbin new file mode 100644 index 00000000..9a862aee Binary files /dev/null and b/data/IW6/maps/mp/mp_boneyard_ns_killstreak.gscbin differ diff --git a/data/IW6/maps/mp/mp_boneyard_ns_precache.gscbin b/data/IW6/maps/mp/mp_boneyard_ns_precache.gscbin new file mode 100644 index 00000000..21181dba Binary files /dev/null and b/data/IW6/maps/mp/mp_boneyard_ns_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_ca_behemoth.gscbin b/data/IW6/maps/mp/mp_ca_behemoth.gscbin new file mode 100644 index 00000000..86f7e2ae Binary files /dev/null and b/data/IW6/maps/mp/mp_ca_behemoth.gscbin differ diff --git a/data/IW6/maps/mp/mp_ca_behemoth_fx.gscbin b/data/IW6/maps/mp/mp_ca_behemoth_fx.gscbin new file mode 100644 index 00000000..a09bd182 Binary files /dev/null and b/data/IW6/maps/mp/mp_ca_behemoth_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_ca_behemoth_precache.gscbin b/data/IW6/maps/mp/mp_ca_behemoth_precache.gscbin new file mode 100644 index 00000000..99ac97c3 Binary files /dev/null and b/data/IW6/maps/mp/mp_ca_behemoth_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_ca_impact.gscbin b/data/IW6/maps/mp/mp_ca_impact.gscbin new file mode 100644 index 00000000..71651c7d Binary files /dev/null and b/data/IW6/maps/mp/mp_ca_impact.gscbin differ diff --git a/data/IW6/maps/mp/mp_ca_impact_fx.gscbin b/data/IW6/maps/mp/mp_ca_impact_fx.gscbin new file mode 100644 index 00000000..444d26d8 Binary files /dev/null and b/data/IW6/maps/mp/mp_ca_impact_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_ca_impact_precache.gscbin b/data/IW6/maps/mp/mp_ca_impact_precache.gscbin new file mode 100644 index 00000000..13ce7fac Binary files /dev/null and b/data/IW6/maps/mp/mp_ca_impact_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_ca_killstreaks_a10.gscbin b/data/IW6/maps/mp/mp_ca_killstreaks_a10.gscbin new file mode 100644 index 00000000..8208ad73 Binary files /dev/null and b/data/IW6/maps/mp/mp_ca_killstreaks_a10.gscbin differ diff --git a/data/IW6/maps/mp/mp_ca_killstreaks_heligunner.gscbin b/data/IW6/maps/mp/mp_ca_killstreaks_heligunner.gscbin new file mode 100644 index 00000000..a10fbfdc Binary files /dev/null and b/data/IW6/maps/mp/mp_ca_killstreaks_heligunner.gscbin differ diff --git a/data/IW6/maps/mp/mp_ca_red_river.gscbin b/data/IW6/maps/mp/mp_ca_red_river.gscbin new file mode 100644 index 00000000..16f84952 Binary files /dev/null and b/data/IW6/maps/mp/mp_ca_red_river.gscbin differ diff --git a/data/IW6/maps/mp/mp_ca_red_river_bridge_device.gscbin b/data/IW6/maps/mp/mp_ca_red_river_bridge_device.gscbin new file mode 100644 index 00000000..aabfe267 Binary files /dev/null and b/data/IW6/maps/mp/mp_ca_red_river_bridge_device.gscbin differ diff --git a/data/IW6/maps/mp/mp_ca_red_river_bridge_event.gscbin b/data/IW6/maps/mp/mp_ca_red_river_bridge_event.gscbin new file mode 100644 index 00000000..7fc7e986 Binary files /dev/null and b/data/IW6/maps/mp/mp_ca_red_river_bridge_event.gscbin differ diff --git a/data/IW6/maps/mp/mp_ca_red_river_fx.gscbin b/data/IW6/maps/mp/mp_ca_red_river_fx.gscbin new file mode 100644 index 00000000..03cc5bce Binary files /dev/null and b/data/IW6/maps/mp/mp_ca_red_river_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_ca_red_river_precache.gscbin b/data/IW6/maps/mp/mp_ca_red_river_precache.gscbin new file mode 100644 index 00000000..4769268c Binary files /dev/null and b/data/IW6/maps/mp/mp_ca_red_river_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_ca_rumble.gscbin b/data/IW6/maps/mp/mp_ca_rumble.gscbin new file mode 100644 index 00000000..4d56ad54 Binary files /dev/null and b/data/IW6/maps/mp/mp_ca_rumble.gscbin differ diff --git a/data/IW6/maps/mp/mp_ca_rumble_fx.gscbin b/data/IW6/maps/mp/mp_ca_rumble_fx.gscbin new file mode 100644 index 00000000..a27f8ffe Binary files /dev/null and b/data/IW6/maps/mp/mp_ca_rumble_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_ca_rumble_precache.gscbin b/data/IW6/maps/mp/mp_ca_rumble_precache.gscbin new file mode 100644 index 00000000..c8888d8c Binary files /dev/null and b/data/IW6/maps/mp/mp_ca_rumble_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_chasm.gscbin b/data/IW6/maps/mp/mp_chasm.gscbin new file mode 100644 index 00000000..598e5be2 Binary files /dev/null and b/data/IW6/maps/mp/mp_chasm.gscbin differ diff --git a/data/IW6/maps/mp/mp_chasm_fx.gscbin b/data/IW6/maps/mp/mp_chasm_fx.gscbin new file mode 100644 index 00000000..83b179c0 Binary files /dev/null and b/data/IW6/maps/mp/mp_chasm_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_chasm_precache.gscbin b/data/IW6/maps/mp/mp_chasm_precache.gscbin new file mode 100644 index 00000000..112c5b2d Binary files /dev/null and b/data/IW6/maps/mp/mp_chasm_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_conflict.gscbin b/data/IW6/maps/mp/mp_conflict.gscbin new file mode 100644 index 00000000..06bdb282 Binary files /dev/null and b/data/IW6/maps/mp/mp_conflict.gscbin differ diff --git a/data/IW6/maps/mp/mp_conflict_fx.gscbin b/data/IW6/maps/mp/mp_conflict_fx.gscbin new file mode 100644 index 00000000..9da512c9 Binary files /dev/null and b/data/IW6/maps/mp/mp_conflict_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_conflict_precache.gscbin b/data/IW6/maps/mp/mp_conflict_precache.gscbin new file mode 100644 index 00000000..ba6a59a5 Binary files /dev/null and b/data/IW6/maps/mp/mp_conflict_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_dart.gscbin b/data/IW6/maps/mp/mp_dart.gscbin new file mode 100644 index 00000000..14a1cc53 Binary files /dev/null and b/data/IW6/maps/mp/mp_dart.gscbin differ diff --git a/data/IW6/maps/mp/mp_dart_events.gscbin b/data/IW6/maps/mp/mp_dart_events.gscbin new file mode 100644 index 00000000..de54fd57 Binary files /dev/null and b/data/IW6/maps/mp/mp_dart_events.gscbin differ diff --git a/data/IW6/maps/mp/mp_dart_fx.gscbin b/data/IW6/maps/mp/mp_dart_fx.gscbin new file mode 100644 index 00000000..ebe7bab7 Binary files /dev/null and b/data/IW6/maps/mp/mp_dart_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_dart_precache.gscbin b/data/IW6/maps/mp/mp_dart_precache.gscbin new file mode 100644 index 00000000..e2020151 Binary files /dev/null and b/data/IW6/maps/mp/mp_dart_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_dart_scriptlights.gscbin b/data/IW6/maps/mp/mp_dart_scriptlights.gscbin new file mode 100644 index 00000000..02493e7a Binary files /dev/null and b/data/IW6/maps/mp/mp_dart_scriptlights.gscbin differ diff --git a/data/IW6/maps/mp/mp_descent_new.gscbin b/data/IW6/maps/mp/mp_descent_new.gscbin new file mode 100644 index 00000000..c2836b19 Binary files /dev/null and b/data/IW6/maps/mp/mp_descent_new.gscbin differ diff --git a/data/IW6/maps/mp/mp_descent_new_fx.gscbin b/data/IW6/maps/mp/mp_descent_new_fx.gscbin new file mode 100644 index 00000000..e69004f0 Binary files /dev/null and b/data/IW6/maps/mp/mp_descent_new_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_descent_new_precache.gscbin b/data/IW6/maps/mp/mp_descent_new_precache.gscbin new file mode 100644 index 00000000..64a8c476 Binary files /dev/null and b/data/IW6/maps/mp/mp_descent_new_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_dig.gscbin b/data/IW6/maps/mp/mp_dig.gscbin new file mode 100644 index 00000000..59b233be Binary files /dev/null and b/data/IW6/maps/mp/mp_dig.gscbin differ diff --git a/data/IW6/maps/mp/mp_dig_fx.gscbin b/data/IW6/maps/mp/mp_dig_fx.gscbin new file mode 100644 index 00000000..b4f977ce Binary files /dev/null and b/data/IW6/maps/mp/mp_dig_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_dig_precache.gscbin b/data/IW6/maps/mp/mp_dig_precache.gscbin new file mode 100644 index 00000000..20ec8b29 Binary files /dev/null and b/data/IW6/maps/mp/mp_dig_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_dome_ns.gscbin b/data/IW6/maps/mp/mp_dome_ns.gscbin new file mode 100644 index 00000000..654a269f Binary files /dev/null and b/data/IW6/maps/mp/mp_dome_ns.gscbin differ diff --git a/data/IW6/maps/mp/mp_dome_ns_alien.gscbin b/data/IW6/maps/mp/mp_dome_ns_alien.gscbin new file mode 100644 index 00000000..642dec85 Binary files /dev/null and b/data/IW6/maps/mp/mp_dome_ns_alien.gscbin differ diff --git a/data/IW6/maps/mp/mp_dome_ns_alien_idle.gscbin b/data/IW6/maps/mp/mp_dome_ns_alien_idle.gscbin new file mode 100644 index 00000000..632a20d2 Binary files /dev/null and b/data/IW6/maps/mp/mp_dome_ns_alien_idle.gscbin differ diff --git a/data/IW6/maps/mp/mp_dome_ns_alien_move.gscbin b/data/IW6/maps/mp/mp_dome_ns_alien_move.gscbin new file mode 100644 index 00000000..8e256685 Binary files /dev/null and b/data/IW6/maps/mp/mp_dome_ns_alien_move.gscbin differ diff --git a/data/IW6/maps/mp/mp_dome_ns_alien_think.gscbin b/data/IW6/maps/mp/mp_dome_ns_alien_think.gscbin new file mode 100644 index 00000000..e7ce0594 Binary files /dev/null and b/data/IW6/maps/mp/mp_dome_ns_alien_think.gscbin differ diff --git a/data/IW6/maps/mp/mp_dome_ns_alien_traverse.gscbin b/data/IW6/maps/mp/mp_dome_ns_alien_traverse.gscbin new file mode 100644 index 00000000..e410a482 Binary files /dev/null and b/data/IW6/maps/mp/mp_dome_ns_alien_traverse.gscbin differ diff --git a/data/IW6/maps/mp/mp_dome_ns_fx.gscbin b/data/IW6/maps/mp/mp_dome_ns_fx.gscbin new file mode 100644 index 00000000..40880620 Binary files /dev/null and b/data/IW6/maps/mp/mp_dome_ns_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_dome_ns_precache.gscbin b/data/IW6/maps/mp/mp_dome_ns_precache.gscbin new file mode 100644 index 00000000..1a5a8f37 Binary files /dev/null and b/data/IW6/maps/mp/mp_dome_ns_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_fahrenheit.gscbin b/data/IW6/maps/mp/mp_fahrenheit.gscbin new file mode 100644 index 00000000..02368ce6 Binary files /dev/null and b/data/IW6/maps/mp/mp_fahrenheit.gscbin differ diff --git a/data/IW6/maps/mp/mp_fahrenheit_fx.gscbin b/data/IW6/maps/mp/mp_fahrenheit_fx.gscbin new file mode 100644 index 00000000..5f6aabad Binary files /dev/null and b/data/IW6/maps/mp/mp_fahrenheit_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_fahrenheit_precache.gscbin b/data/IW6/maps/mp/mp_fahrenheit_precache.gscbin new file mode 100644 index 00000000..7243facd Binary files /dev/null and b/data/IW6/maps/mp/mp_fahrenheit_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_favela_iw6.gscbin b/data/IW6/maps/mp/mp_favela_iw6.gscbin new file mode 100644 index 00000000..b2dc7afb Binary files /dev/null and b/data/IW6/maps/mp/mp_favela_iw6.gscbin differ diff --git a/data/IW6/maps/mp/mp_favela_iw6_fx.gscbin b/data/IW6/maps/mp/mp_favela_iw6_fx.gscbin new file mode 100644 index 00000000..fd05706c Binary files /dev/null and b/data/IW6/maps/mp/mp_favela_iw6_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_favela_iw6_precache.gscbin b/data/IW6/maps/mp/mp_favela_iw6_precache.gscbin new file mode 100644 index 00000000..19f1e2d8 Binary files /dev/null and b/data/IW6/maps/mp/mp_favela_iw6_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_flooded.gscbin b/data/IW6/maps/mp/mp_flooded.gscbin new file mode 100644 index 00000000..6fd8ddb4 Binary files /dev/null and b/data/IW6/maps/mp/mp_flooded.gscbin differ diff --git a/data/IW6/maps/mp/mp_flooded_fx.gscbin b/data/IW6/maps/mp/mp_flooded_fx.gscbin new file mode 100644 index 00000000..a1f05525 Binary files /dev/null and b/data/IW6/maps/mp/mp_flooded_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_flooded_precache.gscbin b/data/IW6/maps/mp/mp_flooded_precache.gscbin new file mode 100644 index 00000000..a695530a Binary files /dev/null and b/data/IW6/maps/mp/mp_flooded_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_frag.gscbin b/data/IW6/maps/mp/mp_frag.gscbin new file mode 100644 index 00000000..ec0dd1e9 Binary files /dev/null and b/data/IW6/maps/mp/mp_frag.gscbin differ diff --git a/data/IW6/maps/mp/mp_frag_fx.gscbin b/data/IW6/maps/mp/mp_frag_fx.gscbin new file mode 100644 index 00000000..b593cc65 Binary files /dev/null and b/data/IW6/maps/mp/mp_frag_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_frag_precache.gscbin b/data/IW6/maps/mp/mp_frag_precache.gscbin new file mode 100644 index 00000000..14005737 Binary files /dev/null and b/data/IW6/maps/mp/mp_frag_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_hashima.gscbin b/data/IW6/maps/mp/mp_hashima.gscbin new file mode 100644 index 00000000..dd75bb4f Binary files /dev/null and b/data/IW6/maps/mp/mp_hashima.gscbin differ diff --git a/data/IW6/maps/mp/mp_hashima_fx.gscbin b/data/IW6/maps/mp/mp_hashima_fx.gscbin new file mode 100644 index 00000000..790fc768 Binary files /dev/null and b/data/IW6/maps/mp/mp_hashima_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_hashima_precache.gscbin b/data/IW6/maps/mp/mp_hashima_precache.gscbin new file mode 100644 index 00000000..52a08ee4 Binary files /dev/null and b/data/IW6/maps/mp/mp_hashima_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_lonestar.gscbin b/data/IW6/maps/mp/mp_lonestar.gscbin new file mode 100644 index 00000000..50cd096c Binary files /dev/null and b/data/IW6/maps/mp/mp_lonestar.gscbin differ diff --git a/data/IW6/maps/mp/mp_lonestar_fx.gscbin b/data/IW6/maps/mp/mp_lonestar_fx.gscbin new file mode 100644 index 00000000..946b57f9 Binary files /dev/null and b/data/IW6/maps/mp/mp_lonestar_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_lonestar_precache.gscbin b/data/IW6/maps/mp/mp_lonestar_precache.gscbin new file mode 100644 index 00000000..265c4df3 Binary files /dev/null and b/data/IW6/maps/mp/mp_lonestar_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_mine.gscbin b/data/IW6/maps/mp/mp_mine.gscbin new file mode 100644 index 00000000..c3fc8033 Binary files /dev/null and b/data/IW6/maps/mp/mp_mine.gscbin differ diff --git a/data/IW6/maps/mp/mp_mine_fx.gscbin b/data/IW6/maps/mp/mp_mine_fx.gscbin new file mode 100644 index 00000000..62d9bb2f Binary files /dev/null and b/data/IW6/maps/mp/mp_mine_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_mine_precache.gscbin b/data/IW6/maps/mp/mp_mine_precache.gscbin new file mode 100644 index 00000000..58889fb2 Binary files /dev/null and b/data/IW6/maps/mp/mp_mine_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_pirate.gscbin b/data/IW6/maps/mp/mp_pirate.gscbin new file mode 100644 index 00000000..65e4850d Binary files /dev/null and b/data/IW6/maps/mp/mp_pirate.gscbin differ diff --git a/data/IW6/maps/mp/mp_pirate_fx.gscbin b/data/IW6/maps/mp/mp_pirate_fx.gscbin new file mode 100644 index 00000000..bfca5fc9 Binary files /dev/null and b/data/IW6/maps/mp/mp_pirate_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_pirate_ghost.gscbin b/data/IW6/maps/mp/mp_pirate_ghost.gscbin new file mode 100644 index 00000000..38038fa4 Binary files /dev/null and b/data/IW6/maps/mp/mp_pirate_ghost.gscbin differ diff --git a/data/IW6/maps/mp/mp_pirate_precache.gscbin b/data/IW6/maps/mp/mp_pirate_precache.gscbin new file mode 100644 index 00000000..9c6d4216 Binary files /dev/null and b/data/IW6/maps/mp/mp_pirate_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_prisonbreak.gscbin b/data/IW6/maps/mp/mp_prisonbreak.gscbin new file mode 100644 index 00000000..34303469 Binary files /dev/null and b/data/IW6/maps/mp/mp_prisonbreak.gscbin differ diff --git a/data/IW6/maps/mp/mp_prisonbreak_fx.gscbin b/data/IW6/maps/mp/mp_prisonbreak_fx.gscbin new file mode 100644 index 00000000..eb975933 Binary files /dev/null and b/data/IW6/maps/mp/mp_prisonbreak_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_prisonbreak_precache.gscbin b/data/IW6/maps/mp/mp_prisonbreak_precache.gscbin new file mode 100644 index 00000000..912b13d9 Binary files /dev/null and b/data/IW6/maps/mp/mp_prisonbreak_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_shipment_ns.gscbin b/data/IW6/maps/mp/mp_shipment_ns.gscbin new file mode 100644 index 00000000..20f9d2df Binary files /dev/null and b/data/IW6/maps/mp/mp_shipment_ns.gscbin differ diff --git a/data/IW6/maps/mp/mp_shipment_ns_fx.gscbin b/data/IW6/maps/mp/mp_shipment_ns_fx.gscbin new file mode 100644 index 00000000..1ff1dcd8 Binary files /dev/null and b/data/IW6/maps/mp/mp_shipment_ns_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_shipment_ns_precache.gscbin b/data/IW6/maps/mp/mp_shipment_ns_precache.gscbin new file mode 100644 index 00000000..6daee45d Binary files /dev/null and b/data/IW6/maps/mp/mp_shipment_ns_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_skeleton.gscbin b/data/IW6/maps/mp/mp_skeleton.gscbin new file mode 100644 index 00000000..83565bcf Binary files /dev/null and b/data/IW6/maps/mp/mp_skeleton.gscbin differ diff --git a/data/IW6/maps/mp/mp_skeleton_fx.gscbin b/data/IW6/maps/mp/mp_skeleton_fx.gscbin new file mode 100644 index 00000000..266ba923 Binary files /dev/null and b/data/IW6/maps/mp/mp_skeleton_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_skeleton_precache.gscbin b/data/IW6/maps/mp/mp_skeleton_precache.gscbin new file mode 100644 index 00000000..af4e78c0 Binary files /dev/null and b/data/IW6/maps/mp/mp_skeleton_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_snow.gscbin b/data/IW6/maps/mp/mp_snow.gscbin new file mode 100644 index 00000000..c0edc8fc Binary files /dev/null and b/data/IW6/maps/mp/mp_snow.gscbin differ diff --git a/data/IW6/maps/mp/mp_snow_fx.gscbin b/data/IW6/maps/mp/mp_snow_fx.gscbin new file mode 100644 index 00000000..28737b3d Binary files /dev/null and b/data/IW6/maps/mp/mp_snow_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_snow_precache.gscbin b/data/IW6/maps/mp/mp_snow_precache.gscbin new file mode 100644 index 00000000..5c4bb450 Binary files /dev/null and b/data/IW6/maps/mp/mp_snow_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_sovereign.gscbin b/data/IW6/maps/mp/mp_sovereign.gscbin new file mode 100644 index 00000000..710dff6d Binary files /dev/null and b/data/IW6/maps/mp/mp_sovereign.gscbin differ diff --git a/data/IW6/maps/mp/mp_sovereign_events.gscbin b/data/IW6/maps/mp/mp_sovereign_events.gscbin new file mode 100644 index 00000000..ee24c5e1 Binary files /dev/null and b/data/IW6/maps/mp/mp_sovereign_events.gscbin differ diff --git a/data/IW6/maps/mp/mp_sovereign_fx.gscbin b/data/IW6/maps/mp/mp_sovereign_fx.gscbin new file mode 100644 index 00000000..74d3b859 Binary files /dev/null and b/data/IW6/maps/mp/mp_sovereign_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_sovereign_precache.gscbin b/data/IW6/maps/mp/mp_sovereign_precache.gscbin new file mode 100644 index 00000000..a6fd16c5 Binary files /dev/null and b/data/IW6/maps/mp/mp_sovereign_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_strikezone.gscbin b/data/IW6/maps/mp/mp_strikezone.gscbin new file mode 100644 index 00000000..bf98c55d Binary files /dev/null and b/data/IW6/maps/mp/mp_strikezone.gscbin differ diff --git a/data/IW6/maps/mp/mp_strikezone_fx.gscbin b/data/IW6/maps/mp/mp_strikezone_fx.gscbin new file mode 100644 index 00000000..0ed6184c Binary files /dev/null and b/data/IW6/maps/mp/mp_strikezone_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_strikezone_precache.gscbin b/data/IW6/maps/mp/mp_strikezone_precache.gscbin new file mode 100644 index 00000000..a3a70bd4 Binary files /dev/null and b/data/IW6/maps/mp/mp_strikezone_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_swamp.gscbin b/data/IW6/maps/mp/mp_swamp.gscbin new file mode 100644 index 00000000..a89f7248 Binary files /dev/null and b/data/IW6/maps/mp/mp_swamp.gscbin differ diff --git a/data/IW6/maps/mp/mp_swamp_fx.gscbin b/data/IW6/maps/mp/mp_swamp_fx.gscbin new file mode 100644 index 00000000..16398793 Binary files /dev/null and b/data/IW6/maps/mp/mp_swamp_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_swamp_precache.gscbin b/data/IW6/maps/mp/mp_swamp_precache.gscbin new file mode 100644 index 00000000..13901050 Binary files /dev/null and b/data/IW6/maps/mp/mp_swamp_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_warhawk.gscbin b/data/IW6/maps/mp/mp_warhawk.gscbin new file mode 100644 index 00000000..eafdf6b9 Binary files /dev/null and b/data/IW6/maps/mp/mp_warhawk.gscbin differ diff --git a/data/IW6/maps/mp/mp_warhawk_events.gscbin b/data/IW6/maps/mp/mp_warhawk_events.gscbin new file mode 100644 index 00000000..ad0fa387 Binary files /dev/null and b/data/IW6/maps/mp/mp_warhawk_events.gscbin differ diff --git a/data/IW6/maps/mp/mp_warhawk_fx.gscbin b/data/IW6/maps/mp/mp_warhawk_fx.gscbin new file mode 100644 index 00000000..3972022c Binary files /dev/null and b/data/IW6/maps/mp/mp_warhawk_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_warhawk_precache.gscbin b/data/IW6/maps/mp/mp_warhawk_precache.gscbin new file mode 100644 index 00000000..f51ae78c Binary files /dev/null and b/data/IW6/maps/mp/mp_warhawk_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_zebra.gscbin b/data/IW6/maps/mp/mp_zebra.gscbin new file mode 100644 index 00000000..60e950fc Binary files /dev/null and b/data/IW6/maps/mp/mp_zebra.gscbin differ diff --git a/data/IW6/maps/mp/mp_zebra_events.gscbin b/data/IW6/maps/mp/mp_zebra_events.gscbin new file mode 100644 index 00000000..3cdce92d Binary files /dev/null and b/data/IW6/maps/mp/mp_zebra_events.gscbin differ diff --git a/data/IW6/maps/mp/mp_zebra_fx.gscbin b/data/IW6/maps/mp/mp_zebra_fx.gscbin new file mode 100644 index 00000000..93f19c6f Binary files /dev/null and b/data/IW6/maps/mp/mp_zebra_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_zebra_precache.gscbin b/data/IW6/maps/mp/mp_zebra_precache.gscbin new file mode 100644 index 00000000..f24e35a6 Binary files /dev/null and b/data/IW6/maps/mp/mp_zebra_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_zerosub.gscbin b/data/IW6/maps/mp/mp_zerosub.gscbin new file mode 100644 index 00000000..e1313a63 Binary files /dev/null and b/data/IW6/maps/mp/mp_zerosub.gscbin differ diff --git a/data/IW6/maps/mp/mp_zerosub_fx.gscbin b/data/IW6/maps/mp/mp_zerosub_fx.gscbin new file mode 100644 index 00000000..085238ca Binary files /dev/null and b/data/IW6/maps/mp/mp_zerosub_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_zerosub_precache.gscbin b/data/IW6/maps/mp/mp_zerosub_precache.gscbin new file mode 100644 index 00000000..404563b9 Binary files /dev/null and b/data/IW6/maps/mp/mp_zerosub_precache.gscbin differ diff --git a/data/IW6/maps/mp/mp_zulu.gscbin b/data/IW6/maps/mp/mp_zulu.gscbin new file mode 100644 index 00000000..b0856bee Binary files /dev/null and b/data/IW6/maps/mp/mp_zulu.gscbin differ diff --git a/data/IW6/maps/mp/mp_zulu_fx.gscbin b/data/IW6/maps/mp/mp_zulu_fx.gscbin new file mode 100644 index 00000000..47f89d1b Binary files /dev/null and b/data/IW6/maps/mp/mp_zulu_fx.gscbin differ diff --git a/data/IW6/maps/mp/mp_zulu_precache.gscbin b/data/IW6/maps/mp/mp_zulu_precache.gscbin new file mode 100644 index 00000000..796c4d76 Binary files /dev/null and b/data/IW6/maps/mp/mp_zulu_precache.gscbin differ diff --git a/data/IW6/maps/mp/perks/_abilities.gscbin b/data/IW6/maps/mp/perks/_abilities.gscbin new file mode 100644 index 00000000..9fbe1f08 Binary files /dev/null and b/data/IW6/maps/mp/perks/_abilities.gscbin differ diff --git a/data/IW6/maps/mp/perks/_perkfunctions.gscbin b/data/IW6/maps/mp/perks/_perkfunctions.gscbin new file mode 100644 index 00000000..8a535d43 Binary files /dev/null and b/data/IW6/maps/mp/perks/_perkfunctions.gscbin differ diff --git a/data/IW6/maps/mp/perks/_perks.gscbin b/data/IW6/maps/mp/perks/_perks.gscbin new file mode 100644 index 00000000..20a4149d Binary files /dev/null and b/data/IW6/maps/mp/perks/_perks.gscbin differ diff --git a/data/IW6/vehicle_scripts/_c130.gscbin b/data/IW6/vehicle_scripts/_c130.gscbin new file mode 100644 index 00000000..01963e26 Binary files /dev/null and b/data/IW6/vehicle_scripts/_c130.gscbin differ diff --git a/data/S1/_unamed/42778.gscbin b/data/S1/_unamed/42778.gscbin new file mode 100644 index 00000000..c47d9576 Binary files /dev/null and b/data/S1/_unamed/42778.gscbin differ diff --git a/data/S1/_unamed/42783.gscbin b/data/S1/_unamed/42783.gscbin new file mode 100644 index 00000000..0a178041 Binary files /dev/null and b/data/S1/_unamed/42783.gscbin differ diff --git a/data/S1/_unamed/42784.gscbin b/data/S1/_unamed/42784.gscbin new file mode 100644 index 00000000..5caefb4a Binary files /dev/null and b/data/S1/_unamed/42784.gscbin differ diff --git a/data/S1/_unamed/42785.gscbin b/data/S1/_unamed/42785.gscbin new file mode 100644 index 00000000..ca0bd285 Binary files /dev/null and b/data/S1/_unamed/42785.gscbin differ diff --git a/data/S1/_unamed/42786.gscbin b/data/S1/_unamed/42786.gscbin new file mode 100644 index 00000000..21f2f337 Binary files /dev/null and b/data/S1/_unamed/42786.gscbin differ diff --git a/data/S1/_unamed/42787.gscbin b/data/S1/_unamed/42787.gscbin new file mode 100644 index 00000000..adb64df9 Binary files /dev/null and b/data/S1/_unamed/42787.gscbin differ diff --git a/data/S1/_unamed/42788.gscbin b/data/S1/_unamed/42788.gscbin new file mode 100644 index 00000000..2fb72383 Binary files /dev/null and b/data/S1/_unamed/42788.gscbin differ diff --git a/data/S1/_unamed/42789.gscbin b/data/S1/_unamed/42789.gscbin new file mode 100644 index 00000000..91203b9b Binary files /dev/null and b/data/S1/_unamed/42789.gscbin differ diff --git a/data/S1/_unamed/42790.gscbin b/data/S1/_unamed/42790.gscbin new file mode 100644 index 00000000..722c0977 Binary files /dev/null and b/data/S1/_unamed/42790.gscbin differ diff --git a/data/S1/_unamed/42791.gscbin b/data/S1/_unamed/42791.gscbin new file mode 100644 index 00000000..5901f942 Binary files /dev/null and b/data/S1/_unamed/42791.gscbin differ diff --git a/data/S1/_unamed/42792.gscbin b/data/S1/_unamed/42792.gscbin new file mode 100644 index 00000000..6eb576a2 Binary files /dev/null and b/data/S1/_unamed/42792.gscbin differ diff --git a/data/S1/_unamed/42793.gscbin b/data/S1/_unamed/42793.gscbin new file mode 100644 index 00000000..2f4603ad Binary files /dev/null and b/data/S1/_unamed/42793.gscbin differ diff --git a/data/S1/_unamed/42794.gscbin b/data/S1/_unamed/42794.gscbin new file mode 100644 index 00000000..cad0fcfd Binary files /dev/null and b/data/S1/_unamed/42794.gscbin differ diff --git a/data/S1/_unamed/42795.gscbin b/data/S1/_unamed/42795.gscbin new file mode 100644 index 00000000..3165236b Binary files /dev/null and b/data/S1/_unamed/42795.gscbin differ diff --git a/data/S1/_unamed/42796.gscbin b/data/S1/_unamed/42796.gscbin new file mode 100644 index 00000000..3c3444b2 Binary files /dev/null and b/data/S1/_unamed/42796.gscbin differ diff --git a/data/S1/_unamed/42797.gscbin b/data/S1/_unamed/42797.gscbin new file mode 100644 index 00000000..c243b108 Binary files /dev/null and b/data/S1/_unamed/42797.gscbin differ diff --git a/data/S1/_unamed/42798.gscbin b/data/S1/_unamed/42798.gscbin new file mode 100644 index 00000000..5d44e3de Binary files /dev/null and b/data/S1/_unamed/42798.gscbin differ diff --git a/data/S1/_unamed/42799.gscbin b/data/S1/_unamed/42799.gscbin new file mode 100644 index 00000000..0408a782 Binary files /dev/null and b/data/S1/_unamed/42799.gscbin differ diff --git a/data/S1/_unamed/42800.gscbin b/data/S1/_unamed/42800.gscbin new file mode 100644 index 00000000..bd4fcad5 Binary files /dev/null and b/data/S1/_unamed/42800.gscbin differ diff --git a/data/S1/_unamed/42801.gscbin b/data/S1/_unamed/42801.gscbin new file mode 100644 index 00000000..ee110f57 Binary files /dev/null and b/data/S1/_unamed/42801.gscbin differ diff --git a/data/S1/_unamed/42802.gscbin b/data/S1/_unamed/42802.gscbin new file mode 100644 index 00000000..69436df7 Binary files /dev/null and b/data/S1/_unamed/42802.gscbin differ diff --git a/data/S1/_unamed/42803.gscbin b/data/S1/_unamed/42803.gscbin new file mode 100644 index 00000000..1df9ea84 Binary files /dev/null and b/data/S1/_unamed/42803.gscbin differ diff --git a/data/S1/_unamed/42804.gscbin b/data/S1/_unamed/42804.gscbin new file mode 100644 index 00000000..f6831a46 Binary files /dev/null and b/data/S1/_unamed/42804.gscbin differ diff --git a/data/S1/_unamed/42805.gscbin b/data/S1/_unamed/42805.gscbin new file mode 100644 index 00000000..caaac32e Binary files /dev/null and b/data/S1/_unamed/42805.gscbin differ diff --git a/data/S1/_unamed/42806.gscbin b/data/S1/_unamed/42806.gscbin new file mode 100644 index 00000000..85c0c482 Binary files /dev/null and b/data/S1/_unamed/42806.gscbin differ diff --git a/data/S1/_unamed/42807.gscbin b/data/S1/_unamed/42807.gscbin new file mode 100644 index 00000000..afbf7aa6 Binary files /dev/null and b/data/S1/_unamed/42807.gscbin differ diff --git a/data/S1/_unamed/42808.gscbin b/data/S1/_unamed/42808.gscbin new file mode 100644 index 00000000..634e45ec Binary files /dev/null and b/data/S1/_unamed/42808.gscbin differ diff --git a/data/S1/_unamed/42809.gscbin b/data/S1/_unamed/42809.gscbin new file mode 100644 index 00000000..2f7b006c Binary files /dev/null and b/data/S1/_unamed/42809.gscbin differ diff --git a/data/S1/_unamed/42810.gscbin b/data/S1/_unamed/42810.gscbin new file mode 100644 index 00000000..da2f714d Binary files /dev/null and b/data/S1/_unamed/42810.gscbin differ diff --git a/data/S1/_unamed/42811.gscbin b/data/S1/_unamed/42811.gscbin new file mode 100644 index 00000000..ee5c67b7 Binary files /dev/null and b/data/S1/_unamed/42811.gscbin differ diff --git a/data/S1/_unamed/42812.gscbin b/data/S1/_unamed/42812.gscbin new file mode 100644 index 00000000..df8f1283 Binary files /dev/null and b/data/S1/_unamed/42812.gscbin differ diff --git a/data/S1/_unamed/42813.gscbin b/data/S1/_unamed/42813.gscbin new file mode 100644 index 00000000..adfa8d69 Binary files /dev/null and b/data/S1/_unamed/42813.gscbin differ diff --git a/data/S1/_unamed/42814.gscbin b/data/S1/_unamed/42814.gscbin new file mode 100644 index 00000000..9c174af3 Binary files /dev/null and b/data/S1/_unamed/42814.gscbin differ diff --git a/data/S1/_unamed/42815.gscbin b/data/S1/_unamed/42815.gscbin new file mode 100644 index 00000000..6b15d849 Binary files /dev/null and b/data/S1/_unamed/42815.gscbin differ diff --git a/data/S1/_unamed/42816.gscbin b/data/S1/_unamed/42816.gscbin new file mode 100644 index 00000000..8c76c6f3 Binary files /dev/null and b/data/S1/_unamed/42816.gscbin differ diff --git a/data/S1/_unamed/42817.gscbin b/data/S1/_unamed/42817.gscbin new file mode 100644 index 00000000..11f17a09 Binary files /dev/null and b/data/S1/_unamed/42817.gscbin differ diff --git a/data/S1/_unamed/42818.gscbin b/data/S1/_unamed/42818.gscbin new file mode 100644 index 00000000..c78a6a1e Binary files /dev/null and b/data/S1/_unamed/42818.gscbin differ diff --git a/data/S1/_unamed/42819.gscbin b/data/S1/_unamed/42819.gscbin new file mode 100644 index 00000000..b0bdcab3 Binary files /dev/null and b/data/S1/_unamed/42819.gscbin differ diff --git a/data/S1/_unamed/42820.gscbin b/data/S1/_unamed/42820.gscbin new file mode 100644 index 00000000..8fbba2c0 Binary files /dev/null and b/data/S1/_unamed/42820.gscbin differ diff --git a/data/S1/_unamed/42821.gscbin b/data/S1/_unamed/42821.gscbin new file mode 100644 index 00000000..3c5e9bb1 Binary files /dev/null and b/data/S1/_unamed/42821.gscbin differ diff --git a/data/S1/_unamed/42822.gscbin b/data/S1/_unamed/42822.gscbin new file mode 100644 index 00000000..c518547c Binary files /dev/null and b/data/S1/_unamed/42822.gscbin differ diff --git a/data/S1/_unamed/42823.gscbin b/data/S1/_unamed/42823.gscbin new file mode 100644 index 00000000..4c1d36df Binary files /dev/null and b/data/S1/_unamed/42823.gscbin differ diff --git a/data/S1/_unamed/42824.gscbin b/data/S1/_unamed/42824.gscbin new file mode 100644 index 00000000..b5ae468e Binary files /dev/null and b/data/S1/_unamed/42824.gscbin differ diff --git a/data/S1/_unamed/42825.gscbin b/data/S1/_unamed/42825.gscbin new file mode 100644 index 00000000..955a9fec Binary files /dev/null and b/data/S1/_unamed/42825.gscbin differ diff --git a/data/S1/_unamed/42826.gscbin b/data/S1/_unamed/42826.gscbin new file mode 100644 index 00000000..eece8723 Binary files /dev/null and b/data/S1/_unamed/42826.gscbin differ diff --git a/data/S1/_unamed/42827.gscbin b/data/S1/_unamed/42827.gscbin new file mode 100644 index 00000000..d2827edc Binary files /dev/null and b/data/S1/_unamed/42827.gscbin differ diff --git a/data/S1/_unamed/42828.gscbin b/data/S1/_unamed/42828.gscbin new file mode 100644 index 00000000..b9101965 Binary files /dev/null and b/data/S1/_unamed/42828.gscbin differ diff --git a/data/S1/_unamed/42829.gscbin b/data/S1/_unamed/42829.gscbin new file mode 100644 index 00000000..79e6e0d7 Binary files /dev/null and b/data/S1/_unamed/42829.gscbin differ diff --git a/data/S1/_unamed/42830.gscbin b/data/S1/_unamed/42830.gscbin new file mode 100644 index 00000000..86fb2247 Binary files /dev/null and b/data/S1/_unamed/42830.gscbin differ diff --git a/data/S1/_unamed/42831.gscbin b/data/S1/_unamed/42831.gscbin new file mode 100644 index 00000000..555c3570 Binary files /dev/null and b/data/S1/_unamed/42831.gscbin differ diff --git a/data/S1/_unamed/42832.gscbin b/data/S1/_unamed/42832.gscbin new file mode 100644 index 00000000..a43b9590 Binary files /dev/null and b/data/S1/_unamed/42832.gscbin differ diff --git a/data/S1/_unamed/42833.gscbin b/data/S1/_unamed/42833.gscbin new file mode 100644 index 00000000..60ab2a68 Binary files /dev/null and b/data/S1/_unamed/42833.gscbin differ diff --git a/data/S1/_unamed/42834.gscbin b/data/S1/_unamed/42834.gscbin new file mode 100644 index 00000000..0ea6b575 Binary files /dev/null and b/data/S1/_unamed/42834.gscbin differ diff --git a/data/S1/_unamed/42835.gscbin b/data/S1/_unamed/42835.gscbin new file mode 100644 index 00000000..3f265490 Binary files /dev/null and b/data/S1/_unamed/42835.gscbin differ diff --git a/data/S1/_unamed/42836.gscbin b/data/S1/_unamed/42836.gscbin new file mode 100644 index 00000000..43c40e5c Binary files /dev/null and b/data/S1/_unamed/42836.gscbin differ diff --git a/data/S1/_unamed/42837.gscbin b/data/S1/_unamed/42837.gscbin new file mode 100644 index 00000000..db5d9161 Binary files /dev/null and b/data/S1/_unamed/42837.gscbin differ diff --git a/data/S1/_unamed/42838.gscbin b/data/S1/_unamed/42838.gscbin new file mode 100644 index 00000000..a29a2b6e Binary files /dev/null and b/data/S1/_unamed/42838.gscbin differ diff --git a/data/S1/_unamed/42839.gscbin b/data/S1/_unamed/42839.gscbin new file mode 100644 index 00000000..998bdaaa Binary files /dev/null and b/data/S1/_unamed/42839.gscbin differ diff --git a/data/S1/_unamed/42840.gscbin b/data/S1/_unamed/42840.gscbin new file mode 100644 index 00000000..cf35e5a4 Binary files /dev/null and b/data/S1/_unamed/42840.gscbin differ diff --git a/data/S1/_unamed/42841.gscbin b/data/S1/_unamed/42841.gscbin new file mode 100644 index 00000000..7367bdda Binary files /dev/null and b/data/S1/_unamed/42841.gscbin differ diff --git a/data/S1/_unamed/42842.gscbin b/data/S1/_unamed/42842.gscbin new file mode 100644 index 00000000..f271b33c Binary files /dev/null and b/data/S1/_unamed/42842.gscbin differ diff --git a/data/S1/_unamed/42843.gscbin b/data/S1/_unamed/42843.gscbin new file mode 100644 index 00000000..d4aa18ab Binary files /dev/null and b/data/S1/_unamed/42843.gscbin differ diff --git a/data/S1/_unamed/42844.gscbin b/data/S1/_unamed/42844.gscbin new file mode 100644 index 00000000..06851154 Binary files /dev/null and b/data/S1/_unamed/42844.gscbin differ diff --git a/data/S1/_unamed/42845.gscbin b/data/S1/_unamed/42845.gscbin new file mode 100644 index 00000000..b0808fe3 Binary files /dev/null and b/data/S1/_unamed/42845.gscbin differ diff --git a/data/S1/_unamed/42846.gscbin b/data/S1/_unamed/42846.gscbin new file mode 100644 index 00000000..a0d4b2ba Binary files /dev/null and b/data/S1/_unamed/42846.gscbin differ diff --git a/data/S1/_unamed/42848.gscbin b/data/S1/_unamed/42848.gscbin new file mode 100644 index 00000000..0f97334a Binary files /dev/null and b/data/S1/_unamed/42848.gscbin differ diff --git a/data/S1/_unamed/42877.gscbin b/data/S1/_unamed/42877.gscbin new file mode 100644 index 00000000..f4581e06 Binary files /dev/null and b/data/S1/_unamed/42877.gscbin differ diff --git a/data/S1/_unamed/42878.gscbin b/data/S1/_unamed/42878.gscbin new file mode 100644 index 00000000..682b9345 Binary files /dev/null and b/data/S1/_unamed/42878.gscbin differ diff --git a/data/S1/_unamed/42879.gscbin b/data/S1/_unamed/42879.gscbin new file mode 100644 index 00000000..50030a7b Binary files /dev/null and b/data/S1/_unamed/42879.gscbin differ diff --git a/data/S1/_unamed/42880.gscbin b/data/S1/_unamed/42880.gscbin new file mode 100644 index 00000000..caa2fa96 Binary files /dev/null and b/data/S1/_unamed/42880.gscbin differ diff --git a/data/S1/_unamed/42881.gscbin b/data/S1/_unamed/42881.gscbin new file mode 100644 index 00000000..e562f8bf Binary files /dev/null and b/data/S1/_unamed/42881.gscbin differ diff --git a/data/S1/_unamed/42882.gscbin b/data/S1/_unamed/42882.gscbin new file mode 100644 index 00000000..8abfdc7b Binary files /dev/null and b/data/S1/_unamed/42882.gscbin differ diff --git a/data/S1/_unamed/42883.gscbin b/data/S1/_unamed/42883.gscbin new file mode 100644 index 00000000..0e7d11df Binary files /dev/null and b/data/S1/_unamed/42883.gscbin differ diff --git a/data/S1/_unamed/42884.gscbin b/data/S1/_unamed/42884.gscbin new file mode 100644 index 00000000..d96de930 Binary files /dev/null and b/data/S1/_unamed/42884.gscbin differ diff --git a/data/S1/_unamed/42885.gscbin b/data/S1/_unamed/42885.gscbin new file mode 100644 index 00000000..1a5789c2 Binary files /dev/null and b/data/S1/_unamed/42885.gscbin differ diff --git a/data/S1/_unamed/42886.gscbin b/data/S1/_unamed/42886.gscbin new file mode 100644 index 00000000..260ac951 Binary files /dev/null and b/data/S1/_unamed/42886.gscbin differ diff --git a/data/S1/_unamed/42887.gscbin b/data/S1/_unamed/42887.gscbin new file mode 100644 index 00000000..792f82f0 Binary files /dev/null and b/data/S1/_unamed/42887.gscbin differ diff --git a/data/S1/_unamed/42888.gscbin b/data/S1/_unamed/42888.gscbin new file mode 100644 index 00000000..d142c9fa Binary files /dev/null and b/data/S1/_unamed/42888.gscbin differ diff --git a/data/S1/_unamed/42889.gscbin b/data/S1/_unamed/42889.gscbin new file mode 100644 index 00000000..8e3b54a3 Binary files /dev/null and b/data/S1/_unamed/42889.gscbin differ diff --git a/data/S1/_unamed/42890.gscbin b/data/S1/_unamed/42890.gscbin new file mode 100644 index 00000000..4af67466 Binary files /dev/null and b/data/S1/_unamed/42890.gscbin differ diff --git a/data/S1/_unamed/42891.gscbin b/data/S1/_unamed/42891.gscbin new file mode 100644 index 00000000..ae50ba75 Binary files /dev/null and b/data/S1/_unamed/42891.gscbin differ diff --git a/data/S1/_unamed/42892.gscbin b/data/S1/_unamed/42892.gscbin new file mode 100644 index 00000000..9e9482d9 Binary files /dev/null and b/data/S1/_unamed/42892.gscbin differ diff --git a/data/S1/_unamed/42893.gscbin b/data/S1/_unamed/42893.gscbin new file mode 100644 index 00000000..5a96e096 Binary files /dev/null and b/data/S1/_unamed/42893.gscbin differ diff --git a/data/S1/_unamed/42894.gscbin b/data/S1/_unamed/42894.gscbin new file mode 100644 index 00000000..4813b01e Binary files /dev/null and b/data/S1/_unamed/42894.gscbin differ diff --git a/data/S1/_unamed/42895.gscbin b/data/S1/_unamed/42895.gscbin new file mode 100644 index 00000000..1c191934 Binary files /dev/null and b/data/S1/_unamed/42895.gscbin differ diff --git a/data/S1/_unamed/42896.gscbin b/data/S1/_unamed/42896.gscbin new file mode 100644 index 00000000..257b5267 Binary files /dev/null and b/data/S1/_unamed/42896.gscbin differ diff --git a/data/S1/_unamed/42906.gscbin b/data/S1/_unamed/42906.gscbin new file mode 100644 index 00000000..55f197c0 Binary files /dev/null and b/data/S1/_unamed/42906.gscbin differ diff --git a/data/S1/_unamed/42907.gscbin b/data/S1/_unamed/42907.gscbin new file mode 100644 index 00000000..35e2cdc2 Binary files /dev/null and b/data/S1/_unamed/42907.gscbin differ diff --git a/data/S1/_unamed/42908.gscbin b/data/S1/_unamed/42908.gscbin new file mode 100644 index 00000000..159ec43d Binary files /dev/null and b/data/S1/_unamed/42908.gscbin differ diff --git a/data/S1/_unamed/42909.gscbin b/data/S1/_unamed/42909.gscbin new file mode 100644 index 00000000..d709081e Binary files /dev/null and b/data/S1/_unamed/42909.gscbin differ diff --git a/data/S1/_unamed/42910.gscbin b/data/S1/_unamed/42910.gscbin new file mode 100644 index 00000000..88038fd9 Binary files /dev/null and b/data/S1/_unamed/42910.gscbin differ diff --git a/data/S1/_unamed/42911.gscbin b/data/S1/_unamed/42911.gscbin new file mode 100644 index 00000000..44742e99 Binary files /dev/null and b/data/S1/_unamed/42911.gscbin differ diff --git a/data/S1/_unamed/42912.gscbin b/data/S1/_unamed/42912.gscbin new file mode 100644 index 00000000..7b552f13 Binary files /dev/null and b/data/S1/_unamed/42912.gscbin differ diff --git a/data/S1/_unamed/42913.gscbin b/data/S1/_unamed/42913.gscbin new file mode 100644 index 00000000..977fe9e4 Binary files /dev/null and b/data/S1/_unamed/42913.gscbin differ diff --git a/data/S1/_unamed/42914.gscbin b/data/S1/_unamed/42914.gscbin new file mode 100644 index 00000000..b7b09778 Binary files /dev/null and b/data/S1/_unamed/42914.gscbin differ diff --git a/data/S1/_unamed/42915.gscbin b/data/S1/_unamed/42915.gscbin new file mode 100644 index 00000000..57aa07ed Binary files /dev/null and b/data/S1/_unamed/42915.gscbin differ diff --git a/data/S1/_unamed/42916.gscbin b/data/S1/_unamed/42916.gscbin new file mode 100644 index 00000000..2539d0ad Binary files /dev/null and b/data/S1/_unamed/42916.gscbin differ diff --git a/data/S1/_unamed/42917.gscbin b/data/S1/_unamed/42917.gscbin new file mode 100644 index 00000000..21641a3c Binary files /dev/null and b/data/S1/_unamed/42917.gscbin differ diff --git a/data/S1/_unamed/42918.gscbin b/data/S1/_unamed/42918.gscbin new file mode 100644 index 00000000..823e1197 Binary files /dev/null and b/data/S1/_unamed/42918.gscbin differ diff --git a/data/S1/_unamed/42919.gscbin b/data/S1/_unamed/42919.gscbin new file mode 100644 index 00000000..d8440be6 Binary files /dev/null and b/data/S1/_unamed/42919.gscbin differ diff --git a/data/S1/_unamed/42920.gscbin b/data/S1/_unamed/42920.gscbin new file mode 100644 index 00000000..92fd284f Binary files /dev/null and b/data/S1/_unamed/42920.gscbin differ diff --git a/data/S1/_unamed/42921.gscbin b/data/S1/_unamed/42921.gscbin new file mode 100644 index 00000000..86120ead Binary files /dev/null and b/data/S1/_unamed/42921.gscbin differ diff --git a/data/S1/_unamed/42922.gscbin b/data/S1/_unamed/42922.gscbin new file mode 100644 index 00000000..74fb874f Binary files /dev/null and b/data/S1/_unamed/42922.gscbin differ diff --git a/data/S1/_unamed/42923.gscbin b/data/S1/_unamed/42923.gscbin new file mode 100644 index 00000000..81fb0538 Binary files /dev/null and b/data/S1/_unamed/42923.gscbin differ diff --git a/data/S1/_unamed/42924.gscbin b/data/S1/_unamed/42924.gscbin new file mode 100644 index 00000000..83b9a067 Binary files /dev/null and b/data/S1/_unamed/42924.gscbin differ diff --git a/data/S1/_unamed/42925.gscbin b/data/S1/_unamed/42925.gscbin new file mode 100644 index 00000000..a2436c97 Binary files /dev/null and b/data/S1/_unamed/42925.gscbin differ diff --git a/data/S1/_unamed/42926.gscbin b/data/S1/_unamed/42926.gscbin new file mode 100644 index 00000000..8d68fc10 Binary files /dev/null and b/data/S1/_unamed/42926.gscbin differ diff --git a/data/S1/_unamed/42927.gscbin b/data/S1/_unamed/42927.gscbin new file mode 100644 index 00000000..35b62d1a Binary files /dev/null and b/data/S1/_unamed/42927.gscbin differ diff --git a/data/S1/_unamed/42928.gscbin b/data/S1/_unamed/42928.gscbin new file mode 100644 index 00000000..b560e8cd Binary files /dev/null and b/data/S1/_unamed/42928.gscbin differ diff --git a/data/S1/_unamed/42929.gscbin b/data/S1/_unamed/42929.gscbin new file mode 100644 index 00000000..5d2f2b31 Binary files /dev/null and b/data/S1/_unamed/42929.gscbin differ diff --git a/data/S1/_unamed/42930.gscbin b/data/S1/_unamed/42930.gscbin new file mode 100644 index 00000000..a5dfe121 Binary files /dev/null and b/data/S1/_unamed/42930.gscbin differ diff --git a/data/S1/_unamed/42931.gscbin b/data/S1/_unamed/42931.gscbin new file mode 100644 index 00000000..5e991d83 Binary files /dev/null and b/data/S1/_unamed/42931.gscbin differ diff --git a/data/S1/_unamed/42932.gscbin b/data/S1/_unamed/42932.gscbin new file mode 100644 index 00000000..8a0e73e9 Binary files /dev/null and b/data/S1/_unamed/42932.gscbin differ diff --git a/data/S1/_unamed/42933.gscbin b/data/S1/_unamed/42933.gscbin new file mode 100644 index 00000000..0c01ab1a Binary files /dev/null and b/data/S1/_unamed/42933.gscbin differ diff --git a/data/S1/_unamed/42934.gscbin b/data/S1/_unamed/42934.gscbin new file mode 100644 index 00000000..c3edf733 Binary files /dev/null and b/data/S1/_unamed/42934.gscbin differ diff --git a/data/S1/_unamed/42935.gscbin b/data/S1/_unamed/42935.gscbin new file mode 100644 index 00000000..91434327 Binary files /dev/null and b/data/S1/_unamed/42935.gscbin differ diff --git a/data/S1/_unamed/42936.gscbin b/data/S1/_unamed/42936.gscbin new file mode 100644 index 00000000..9be34a28 Binary files /dev/null and b/data/S1/_unamed/42936.gscbin differ diff --git a/data/S1/_unamed/42937.gscbin b/data/S1/_unamed/42937.gscbin new file mode 100644 index 00000000..5d772045 Binary files /dev/null and b/data/S1/_unamed/42937.gscbin differ diff --git a/data/S1/_unamed/42938.gscbin b/data/S1/_unamed/42938.gscbin new file mode 100644 index 00000000..84456b5b Binary files /dev/null and b/data/S1/_unamed/42938.gscbin differ diff --git a/data/S1/_unamed/42939.gscbin b/data/S1/_unamed/42939.gscbin new file mode 100644 index 00000000..ca04ce83 Binary files /dev/null and b/data/S1/_unamed/42939.gscbin differ diff --git a/data/S1/_unamed/42940.gscbin b/data/S1/_unamed/42940.gscbin new file mode 100644 index 00000000..a34b2355 Binary files /dev/null and b/data/S1/_unamed/42940.gscbin differ diff --git a/data/S1/_unamed/42941.gscbin b/data/S1/_unamed/42941.gscbin new file mode 100644 index 00000000..0f427e40 Binary files /dev/null and b/data/S1/_unamed/42941.gscbin differ diff --git a/data/S1/_unamed/42942.gscbin b/data/S1/_unamed/42942.gscbin new file mode 100644 index 00000000..31ede0f3 Binary files /dev/null and b/data/S1/_unamed/42942.gscbin differ diff --git a/data/S1/_unamed/42943.gscbin b/data/S1/_unamed/42943.gscbin new file mode 100644 index 00000000..2bb6b971 Binary files /dev/null and b/data/S1/_unamed/42943.gscbin differ diff --git a/data/S1/_unamed/42944.gscbin b/data/S1/_unamed/42944.gscbin new file mode 100644 index 00000000..065ef547 Binary files /dev/null and b/data/S1/_unamed/42944.gscbin differ diff --git a/data/S1/_unamed/42945.gscbin b/data/S1/_unamed/42945.gscbin new file mode 100644 index 00000000..af247264 Binary files /dev/null and b/data/S1/_unamed/42945.gscbin differ diff --git a/data/S1/_unamed/42946.gscbin b/data/S1/_unamed/42946.gscbin new file mode 100644 index 00000000..716692cf Binary files /dev/null and b/data/S1/_unamed/42946.gscbin differ diff --git a/data/S1/_unamed/42947.gscbin b/data/S1/_unamed/42947.gscbin new file mode 100644 index 00000000..94198724 Binary files /dev/null and b/data/S1/_unamed/42947.gscbin differ diff --git a/data/S1/_unamed/42948.gscbin b/data/S1/_unamed/42948.gscbin new file mode 100644 index 00000000..5933d301 Binary files /dev/null and b/data/S1/_unamed/42948.gscbin differ diff --git a/data/S1/_unamed/42949.gscbin b/data/S1/_unamed/42949.gscbin new file mode 100644 index 00000000..2dec4206 Binary files /dev/null and b/data/S1/_unamed/42949.gscbin differ diff --git a/data/S1/_unamed/42950.gscbin b/data/S1/_unamed/42950.gscbin new file mode 100644 index 00000000..2d7f1b04 Binary files /dev/null and b/data/S1/_unamed/42950.gscbin differ diff --git a/data/S1/_unamed/42951.gscbin b/data/S1/_unamed/42951.gscbin new file mode 100644 index 00000000..be1b4c83 Binary files /dev/null and b/data/S1/_unamed/42951.gscbin differ diff --git a/data/S1/_unamed/42952.gscbin b/data/S1/_unamed/42952.gscbin new file mode 100644 index 00000000..1be77458 Binary files /dev/null and b/data/S1/_unamed/42952.gscbin differ diff --git a/data/S1/_unamed/42953.gscbin b/data/S1/_unamed/42953.gscbin new file mode 100644 index 00000000..74c69392 Binary files /dev/null and b/data/S1/_unamed/42953.gscbin differ diff --git a/data/S1/_unamed/42954.gscbin b/data/S1/_unamed/42954.gscbin new file mode 100644 index 00000000..442c30a6 Binary files /dev/null and b/data/S1/_unamed/42954.gscbin differ diff --git a/data/S1/_unamed/42955.gscbin b/data/S1/_unamed/42955.gscbin new file mode 100644 index 00000000..c690b782 Binary files /dev/null and b/data/S1/_unamed/42955.gscbin differ diff --git a/data/S1/_unamed/42956.gscbin b/data/S1/_unamed/42956.gscbin new file mode 100644 index 00000000..4254eb36 Binary files /dev/null and b/data/S1/_unamed/42956.gscbin differ diff --git a/data/S1/_unamed/42957.gscbin b/data/S1/_unamed/42957.gscbin new file mode 100644 index 00000000..102bd01a Binary files /dev/null and b/data/S1/_unamed/42957.gscbin differ diff --git a/data/S1/_unamed/42958.gscbin b/data/S1/_unamed/42958.gscbin new file mode 100644 index 00000000..281c88a8 Binary files /dev/null and b/data/S1/_unamed/42958.gscbin differ diff --git a/data/S1/_unamed/42959.gscbin b/data/S1/_unamed/42959.gscbin new file mode 100644 index 00000000..01a3b51e Binary files /dev/null and b/data/S1/_unamed/42959.gscbin differ diff --git a/data/S1/_unamed/42960.gscbin b/data/S1/_unamed/42960.gscbin new file mode 100644 index 00000000..1b89e5fb Binary files /dev/null and b/data/S1/_unamed/42960.gscbin differ diff --git a/data/S1/_unamed/42961.gscbin b/data/S1/_unamed/42961.gscbin new file mode 100644 index 00000000..d08885d2 Binary files /dev/null and b/data/S1/_unamed/42961.gscbin differ diff --git a/data/S1/_unamed/42971.gscbin b/data/S1/_unamed/42971.gscbin new file mode 100644 index 00000000..7e3a3ae7 Binary files /dev/null and b/data/S1/_unamed/42971.gscbin differ diff --git a/data/S1/_unamed/42972.gscbin b/data/S1/_unamed/42972.gscbin new file mode 100644 index 00000000..ea7c8946 Binary files /dev/null and b/data/S1/_unamed/42972.gscbin differ diff --git a/data/S1/codescripts/character.gscbin b/data/S1/codescripts/character.gscbin new file mode 100644 index 00000000..4989a1fa Binary files /dev/null and b/data/S1/codescripts/character.gscbin differ diff --git a/data/S1/codescripts/delete.gscbin b/data/S1/codescripts/delete.gscbin new file mode 100644 index 00000000..5df08c6f Binary files /dev/null and b/data/S1/codescripts/delete.gscbin differ diff --git a/data/S1/codescripts/struct.gscbin b/data/S1/codescripts/struct.gscbin new file mode 100644 index 00000000..27196b85 Binary files /dev/null and b/data/S1/codescripts/struct.gscbin differ diff --git a/data/S1/common_scripts/_artcommon.gscbin b/data/S1/common_scripts/_artcommon.gscbin new file mode 100644 index 00000000..7889e60f Binary files /dev/null and b/data/S1/common_scripts/_artcommon.gscbin differ diff --git a/data/S1/common_scripts/_bcs_location_trigs.gscbin b/data/S1/common_scripts/_bcs_location_trigs.gscbin new file mode 100644 index 00000000..33c92755 Binary files /dev/null and b/data/S1/common_scripts/_bcs_location_trigs.gscbin differ diff --git a/data/S1/common_scripts/_createfx.gscbin b/data/S1/common_scripts/_createfx.gscbin new file mode 100644 index 00000000..3726bee5 Binary files /dev/null and b/data/S1/common_scripts/_createfx.gscbin differ diff --git a/data/S1/common_scripts/_createfxmenu.gscbin b/data/S1/common_scripts/_createfxmenu.gscbin new file mode 100644 index 00000000..f3e80b50 Binary files /dev/null and b/data/S1/common_scripts/_createfxmenu.gscbin differ diff --git a/data/S1/common_scripts/_destructible.gscbin b/data/S1/common_scripts/_destructible.gscbin new file mode 100644 index 00000000..7ea21980 Binary files /dev/null and b/data/S1/common_scripts/_destructible.gscbin differ diff --git a/data/S1/common_scripts/_dynamic_world.gscbin b/data/S1/common_scripts/_dynamic_world.gscbin new file mode 100644 index 00000000..83a6d1f1 Binary files /dev/null and b/data/S1/common_scripts/_dynamic_world.gscbin differ diff --git a/data/S1/common_scripts/_elevator.gscbin b/data/S1/common_scripts/_elevator.gscbin new file mode 100644 index 00000000..87a504a4 Binary files /dev/null and b/data/S1/common_scripts/_elevator.gscbin differ diff --git a/data/S1/common_scripts/_exploder.gscbin b/data/S1/common_scripts/_exploder.gscbin new file mode 100644 index 00000000..11350e2c Binary files /dev/null and b/data/S1/common_scripts/_exploder.gscbin differ diff --git a/data/S1/common_scripts/_fx.gscbin b/data/S1/common_scripts/_fx.gscbin new file mode 100644 index 00000000..c12de7f9 Binary files /dev/null and b/data/S1/common_scripts/_fx.gscbin differ diff --git a/data/S1/common_scripts/utility.gscbin b/data/S1/common_scripts/utility.gscbin new file mode 100644 index 00000000..b5df3e95 Binary files /dev/null and b/data/S1/common_scripts/utility.gscbin differ diff --git a/data/S1/maps/createart/mp_vlobby_room_art.gscbin b/data/S1/maps/createart/mp_vlobby_room_art.gscbin new file mode 100644 index 00000000..b1960545 Binary files /dev/null and b/data/S1/maps/createart/mp_vlobby_room_art.gscbin differ diff --git a/data/S1/maps/createart/mp_vlobby_room_fog.gscbin b/data/S1/maps/createart/mp_vlobby_room_fog.gscbin new file mode 100644 index 00000000..40afb098 Binary files /dev/null and b/data/S1/maps/createart/mp_vlobby_room_fog.gscbin differ diff --git a/data/S1/maps/createart/mp_vlobby_room_fog_hdr.gscbin b/data/S1/maps/createart/mp_vlobby_room_fog_hdr.gscbin new file mode 100644 index 00000000..e422a6b7 Binary files /dev/null and b/data/S1/maps/createart/mp_vlobby_room_fog_hdr.gscbin differ diff --git a/data/S1/maps/mp/_dynamic_world.gscbin b/data/S1/maps/mp/_dynamic_world.gscbin new file mode 100644 index 00000000..21a8b449 Binary files /dev/null and b/data/S1/maps/mp/_dynamic_world.gscbin differ diff --git a/data/S1/maps/mp/_grappling_hook.gscbin b/data/S1/maps/mp/_grappling_hook.gscbin new file mode 100644 index 00000000..848a8b00 Binary files /dev/null and b/data/S1/maps/mp/_grappling_hook.gscbin differ diff --git a/data/S1/maps/mp/agents/_agent_common.gscbin b/data/S1/maps/mp/agents/_agent_common.gscbin new file mode 100644 index 00000000..20e709a9 Binary files /dev/null and b/data/S1/maps/mp/agents/_agent_common.gscbin differ diff --git a/data/S1/maps/mp/agents/_agent_utility.gscbin b/data/S1/maps/mp/agents/_agent_utility.gscbin new file mode 100644 index 00000000..65c92751 Binary files /dev/null and b/data/S1/maps/mp/agents/_agent_utility.gscbin differ diff --git a/data/S1/maps/mp/agents/_agents.gscbin b/data/S1/maps/mp/agents/_agents.gscbin new file mode 100644 index 00000000..1f8f1e3f Binary files /dev/null and b/data/S1/maps/mp/agents/_agents.gscbin differ diff --git a/data/S1/maps/mp/agents/_agents_gametype_vlobby.gscbin b/data/S1/maps/mp/agents/_agents_gametype_vlobby.gscbin new file mode 100644 index 00000000..afa0216a Binary files /dev/null and b/data/S1/maps/mp/agents/_agents_gametype_vlobby.gscbin differ diff --git a/data/S1/maps/mp/agents/_scriptedagents.gscbin b/data/S1/maps/mp/agents/_scriptedagents.gscbin new file mode 100644 index 00000000..878e10a8 Binary files /dev/null and b/data/S1/maps/mp/agents/_scriptedagents.gscbin differ diff --git a/data/S1/maps/mp/agents/dog/_dog_idle.gscbin b/data/S1/maps/mp/agents/dog/_dog_idle.gscbin new file mode 100644 index 00000000..e7f78a32 Binary files /dev/null and b/data/S1/maps/mp/agents/dog/_dog_idle.gscbin differ diff --git a/data/S1/maps/mp/agents/dog/_dog_melee.gscbin b/data/S1/maps/mp/agents/dog/_dog_melee.gscbin new file mode 100644 index 00000000..feb3cbcf Binary files /dev/null and b/data/S1/maps/mp/agents/dog/_dog_melee.gscbin differ diff --git a/data/S1/maps/mp/agents/dog/_dog_move.gscbin b/data/S1/maps/mp/agents/dog/_dog_move.gscbin new file mode 100644 index 00000000..688824b3 Binary files /dev/null and b/data/S1/maps/mp/agents/dog/_dog_move.gscbin differ diff --git a/data/S1/maps/mp/agents/dog/_dog_think.gscbin b/data/S1/maps/mp/agents/dog/_dog_think.gscbin new file mode 100644 index 00000000..2ee05388 Binary files /dev/null and b/data/S1/maps/mp/agents/dog/_dog_think.gscbin differ diff --git a/data/S1/maps/mp/agents/dog/_dog_traverse.gscbin b/data/S1/maps/mp/agents/dog/_dog_traverse.gscbin new file mode 100644 index 00000000..3d9ab967 Binary files /dev/null and b/data/S1/maps/mp/agents/dog/_dog_traverse.gscbin differ diff --git a/data/S1/maps/mp/bots/_bots.gscbin b/data/S1/maps/mp/bots/_bots.gscbin new file mode 100644 index 00000000..77d2c070 Binary files /dev/null and b/data/S1/maps/mp/bots/_bots.gscbin differ diff --git a/data/S1/maps/mp/bots/_bots_gametype_common.gscbin b/data/S1/maps/mp/bots/_bots_gametype_common.gscbin new file mode 100644 index 00000000..07a0a628 Binary files /dev/null and b/data/S1/maps/mp/bots/_bots_gametype_common.gscbin differ diff --git a/data/S1/maps/mp/bots/_bots_gametype_vlobby.gscbin b/data/S1/maps/mp/bots/_bots_gametype_vlobby.gscbin new file mode 100644 index 00000000..715770b2 Binary files /dev/null and b/data/S1/maps/mp/bots/_bots_gametype_vlobby.gscbin differ diff --git a/data/S1/maps/mp/bots/_bots_gametype_war.gscbin b/data/S1/maps/mp/bots/_bots_gametype_war.gscbin new file mode 100644 index 00000000..4414c323 Binary files /dev/null and b/data/S1/maps/mp/bots/_bots_gametype_war.gscbin differ diff --git a/data/S1/maps/mp/bots/_bots_ks.gscbin b/data/S1/maps/mp/bots/_bots_ks.gscbin new file mode 100644 index 00000000..6de7bbd7 Binary files /dev/null and b/data/S1/maps/mp/bots/_bots_ks.gscbin differ diff --git a/data/S1/maps/mp/bots/_bots_ks_remote_vehicle.gscbin b/data/S1/maps/mp/bots/_bots_ks_remote_vehicle.gscbin new file mode 100644 index 00000000..64d216f2 Binary files /dev/null and b/data/S1/maps/mp/bots/_bots_ks_remote_vehicle.gscbin differ diff --git a/data/S1/maps/mp/bots/_bots_loadout.gscbin b/data/S1/maps/mp/bots/_bots_loadout.gscbin new file mode 100644 index 00000000..e0fabe02 Binary files /dev/null and b/data/S1/maps/mp/bots/_bots_loadout.gscbin differ diff --git a/data/S1/maps/mp/bots/_bots_personality.gscbin b/data/S1/maps/mp/bots/_bots_personality.gscbin new file mode 100644 index 00000000..20bd35df Binary files /dev/null and b/data/S1/maps/mp/bots/_bots_personality.gscbin differ diff --git a/data/S1/maps/mp/bots/_bots_sentry.gscbin b/data/S1/maps/mp/bots/_bots_sentry.gscbin new file mode 100644 index 00000000..fb412ed8 Binary files /dev/null and b/data/S1/maps/mp/bots/_bots_sentry.gscbin differ diff --git a/data/S1/maps/mp/bots/_bots_strategy.gscbin b/data/S1/maps/mp/bots/_bots_strategy.gscbin new file mode 100644 index 00000000..c9782dc9 Binary files /dev/null and b/data/S1/maps/mp/bots/_bots_strategy.gscbin differ diff --git a/data/S1/maps/mp/bots/_bots_util.gscbin b/data/S1/maps/mp/bots/_bots_util.gscbin new file mode 100644 index 00000000..2ed069b9 Binary files /dev/null and b/data/S1/maps/mp/bots/_bots_util.gscbin differ diff --git a/data/S1/maps/mp/gametypes/_callbacksetup.gscbin b/data/S1/maps/mp/gametypes/_callbacksetup.gscbin new file mode 100644 index 00000000..1bccba8e Binary files /dev/null and b/data/S1/maps/mp/gametypes/_callbacksetup.gscbin differ diff --git a/data/S1/maps/mp/gametypes/_divisions.gscbin b/data/S1/maps/mp/gametypes/_divisions.gscbin new file mode 100644 index 00000000..6947ca95 Binary files /dev/null and b/data/S1/maps/mp/gametypes/_divisions.gscbin differ diff --git a/data/S1/maps/mp/gametypes/ball.gscbin b/data/S1/maps/mp/gametypes/ball.gscbin new file mode 100644 index 00000000..29eea221 Binary files /dev/null and b/data/S1/maps/mp/gametypes/ball.gscbin differ diff --git a/data/S1/maps/mp/gametypes/common_sd_sr.gscbin b/data/S1/maps/mp/gametypes/common_sd_sr.gscbin new file mode 100644 index 00000000..c1b1a8ef Binary files /dev/null and b/data/S1/maps/mp/gametypes/common_sd_sr.gscbin differ diff --git a/data/S1/maps/mp/gametypes/conf.gscbin b/data/S1/maps/mp/gametypes/conf.gscbin new file mode 100644 index 00000000..7be6fb28 Binary files /dev/null and b/data/S1/maps/mp/gametypes/conf.gscbin differ diff --git a/data/S1/maps/mp/gametypes/ctf.gscbin b/data/S1/maps/mp/gametypes/ctf.gscbin new file mode 100644 index 00000000..602cff10 Binary files /dev/null and b/data/S1/maps/mp/gametypes/ctf.gscbin differ diff --git a/data/S1/maps/mp/gametypes/dm.gscbin b/data/S1/maps/mp/gametypes/dm.gscbin new file mode 100644 index 00000000..5eb55c4d Binary files /dev/null and b/data/S1/maps/mp/gametypes/dm.gscbin differ diff --git a/data/S1/maps/mp/gametypes/dom.gscbin b/data/S1/maps/mp/gametypes/dom.gscbin new file mode 100644 index 00000000..3bcb9c2f Binary files /dev/null and b/data/S1/maps/mp/gametypes/dom.gscbin differ diff --git a/data/S1/maps/mp/gametypes/gun.gscbin b/data/S1/maps/mp/gametypes/gun.gscbin new file mode 100644 index 00000000..52ea3619 Binary files /dev/null and b/data/S1/maps/mp/gametypes/gun.gscbin differ diff --git a/data/S1/maps/mp/gametypes/hp.gscbin b/data/S1/maps/mp/gametypes/hp.gscbin new file mode 100644 index 00000000..d571e3da Binary files /dev/null and b/data/S1/maps/mp/gametypes/hp.gscbin differ diff --git a/data/S1/maps/mp/gametypes/infect.gscbin b/data/S1/maps/mp/gametypes/infect.gscbin new file mode 100644 index 00000000..25345caa Binary files /dev/null and b/data/S1/maps/mp/gametypes/infect.gscbin differ diff --git a/data/S1/maps/mp/gametypes/sd.gscbin b/data/S1/maps/mp/gametypes/sd.gscbin new file mode 100644 index 00000000..c98d1d7b Binary files /dev/null and b/data/S1/maps/mp/gametypes/sd.gscbin differ diff --git a/data/S1/maps/mp/gametypes/sr.gscbin b/data/S1/maps/mp/gametypes/sr.gscbin new file mode 100644 index 00000000..ac657eef Binary files /dev/null and b/data/S1/maps/mp/gametypes/sr.gscbin differ diff --git a/data/S1/maps/mp/gametypes/twar.gscbin b/data/S1/maps/mp/gametypes/twar.gscbin new file mode 100644 index 00000000..5d325fc4 Binary files /dev/null and b/data/S1/maps/mp/gametypes/twar.gscbin differ diff --git a/data/S1/maps/mp/gametypes/vlobby.gscbin b/data/S1/maps/mp/gametypes/vlobby.gscbin new file mode 100644 index 00000000..a5ab301e Binary files /dev/null and b/data/S1/maps/mp/gametypes/vlobby.gscbin differ diff --git a/data/S1/maps/mp/gametypes/war.gscbin b/data/S1/maps/mp/gametypes/war.gscbin new file mode 100644 index 00000000..f30ad3bc Binary files /dev/null and b/data/S1/maps/mp/gametypes/war.gscbin differ diff --git a/data/S1/maps/mp/killstreaks/streak_mp_bigben2.gscbin b/data/S1/maps/mp/killstreaks/streak_mp_bigben2.gscbin new file mode 100644 index 00000000..55821b2f Binary files /dev/null and b/data/S1/maps/mp/killstreaks/streak_mp_bigben2.gscbin differ diff --git a/data/S1/maps/mp/killstreaks/streak_mp_blackbox.gscbin b/data/S1/maps/mp/killstreaks/streak_mp_blackbox.gscbin new file mode 100644 index 00000000..afce995f Binary files /dev/null and b/data/S1/maps/mp/killstreaks/streak_mp_blackbox.gscbin differ diff --git a/data/S1/maps/mp/killstreaks/streak_mp_seoul2.gscbin b/data/S1/maps/mp/killstreaks/streak_mp_seoul2.gscbin new file mode 100644 index 00000000..ee53b725 Binary files /dev/null and b/data/S1/maps/mp/killstreaks/streak_mp_seoul2.gscbin differ diff --git a/data/S1/maps/mp/mp_vlobby_room.gscbin b/data/S1/maps/mp/mp_vlobby_room.gscbin new file mode 100644 index 00000000..4d5df906 Binary files /dev/null and b/data/S1/maps/mp/mp_vlobby_room.gscbin differ diff --git a/data/S1/maps/mp/mp_vlobby_room_aud.gscbin b/data/S1/maps/mp/mp_vlobby_room_aud.gscbin new file mode 100644 index 00000000..d999c7f3 Binary files /dev/null and b/data/S1/maps/mp/mp_vlobby_room_aud.gscbin differ diff --git a/data/S1/maps/mp/mp_vlobby_room_lighting.gscbin b/data/S1/maps/mp/mp_vlobby_room_lighting.gscbin new file mode 100644 index 00000000..cbdd1571 Binary files /dev/null and b/data/S1/maps/mp/mp_vlobby_room_lighting.gscbin differ diff --git a/data/h1/1341.gscbin b/data/h1/1341.gscbin new file mode 100644 index 00000000..9a955daf Binary files /dev/null and b/data/h1/1341.gscbin differ diff --git a/data/h1/1342.gscbin b/data/h1/1342.gscbin new file mode 100644 index 00000000..4d36467b Binary files /dev/null and b/data/h1/1342.gscbin differ diff --git a/data/h1/1344.gscbin b/data/h1/1344.gscbin new file mode 100644 index 00000000..2c87e82c Binary files /dev/null and b/data/h1/1344.gscbin differ diff --git a/data/h1/42223.gscbin b/data/h1/42223.gscbin new file mode 100644 index 00000000..f4710d50 Binary files /dev/null and b/data/h1/42223.gscbin differ diff --git a/data/h1/42224.gscbin b/data/h1/42224.gscbin new file mode 100644 index 00000000..2874c297 Binary files /dev/null and b/data/h1/42224.gscbin differ diff --git a/data/h1/42225.gscbin b/data/h1/42225.gscbin new file mode 100644 index 00000000..83c5cb4e Binary files /dev/null and b/data/h1/42225.gscbin differ diff --git a/data/h1/42226.gscbin b/data/h1/42226.gscbin new file mode 100644 index 00000000..defea7fb Binary files /dev/null and b/data/h1/42226.gscbin differ diff --git a/data/h1/42227.gscbin b/data/h1/42227.gscbin new file mode 100644 index 00000000..e654c615 Binary files /dev/null and b/data/h1/42227.gscbin differ diff --git a/data/h1/42228.gscbin b/data/h1/42228.gscbin new file mode 100644 index 00000000..a664687a Binary files /dev/null and b/data/h1/42228.gscbin differ diff --git a/data/h1/42229.gscbin b/data/h1/42229.gscbin new file mode 100644 index 00000000..6ebf2826 Binary files /dev/null and b/data/h1/42229.gscbin differ diff --git a/data/h1/42230.gscbin b/data/h1/42230.gscbin new file mode 100644 index 00000000..a1251cb0 Binary files /dev/null and b/data/h1/42230.gscbin differ diff --git a/data/h1/42231.gscbin b/data/h1/42231.gscbin new file mode 100644 index 00000000..ecb95ad2 Binary files /dev/null and b/data/h1/42231.gscbin differ diff --git a/data/h1/42232.gscbin b/data/h1/42232.gscbin new file mode 100644 index 00000000..8abe8d00 Binary files /dev/null and b/data/h1/42232.gscbin differ diff --git a/data/h1/42234.gscbin b/data/h1/42234.gscbin new file mode 100644 index 00000000..535f3998 Binary files /dev/null and b/data/h1/42234.gscbin differ diff --git a/data/h1/42794.gscbin b/data/h1/42794.gscbin new file mode 100644 index 00000000..f8b8a48e Binary files /dev/null and b/data/h1/42794.gscbin differ diff --git a/data/h1/42795.gscbin b/data/h1/42795.gscbin new file mode 100644 index 00000000..d6e45dc4 Binary files /dev/null and b/data/h1/42795.gscbin differ diff --git a/data/h1/42796.gscbin b/data/h1/42796.gscbin new file mode 100644 index 00000000..3139999c Binary files /dev/null and b/data/h1/42796.gscbin differ diff --git a/data/h1/42797.gscbin b/data/h1/42797.gscbin new file mode 100644 index 00000000..688d16b3 Binary files /dev/null and b/data/h1/42797.gscbin differ diff --git a/data/h1/42798.gscbin b/data/h1/42798.gscbin new file mode 100644 index 00000000..52f4a402 Binary files /dev/null and b/data/h1/42798.gscbin differ diff --git a/data/h1/42799.gscbin b/data/h1/42799.gscbin new file mode 100644 index 00000000..396c3d18 Binary files /dev/null and b/data/h1/42799.gscbin differ diff --git a/data/h1/42801.gscbin b/data/h1/42801.gscbin new file mode 100644 index 00000000..7c54946e Binary files /dev/null and b/data/h1/42801.gscbin differ diff --git a/data/h1/42802.gscbin b/data/h1/42802.gscbin new file mode 100644 index 00000000..72e2184a Binary files /dev/null and b/data/h1/42802.gscbin differ diff --git a/data/h1/42803.gscbin b/data/h1/42803.gscbin new file mode 100644 index 00000000..2949b901 Binary files /dev/null and b/data/h1/42803.gscbin differ diff --git a/data/h1/42804.gscbin b/data/h1/42804.gscbin new file mode 100644 index 00000000..7b63dc2a Binary files /dev/null and b/data/h1/42804.gscbin differ diff --git a/data/h1/42807.gscbin b/data/h1/42807.gscbin new file mode 100644 index 00000000..7c664221 Binary files /dev/null and b/data/h1/42807.gscbin differ diff --git a/data/h1/42808.gscbin b/data/h1/42808.gscbin new file mode 100644 index 00000000..8887a298 Binary files /dev/null and b/data/h1/42808.gscbin differ diff --git a/data/h1/42823.gscbin b/data/h1/42823.gscbin new file mode 100644 index 00000000..8f3ea7ef Binary files /dev/null and b/data/h1/42823.gscbin differ diff --git a/data/h1/42824.gscbin b/data/h1/42824.gscbin new file mode 100644 index 00000000..463fa462 Binary files /dev/null and b/data/h1/42824.gscbin differ diff --git a/data/h1/42825.gscbin b/data/h1/42825.gscbin new file mode 100644 index 00000000..2a632174 Binary files /dev/null and b/data/h1/42825.gscbin differ diff --git a/data/h1/42826.gscbin b/data/h1/42826.gscbin new file mode 100644 index 00000000..0d939887 Binary files /dev/null and b/data/h1/42826.gscbin differ diff --git a/data/h1/42827.gscbin b/data/h1/42827.gscbin new file mode 100644 index 00000000..e695795f Binary files /dev/null and b/data/h1/42827.gscbin differ diff --git a/data/h1/42828.gscbin b/data/h1/42828.gscbin new file mode 100644 index 00000000..8140c1c0 Binary files /dev/null and b/data/h1/42828.gscbin differ diff --git a/data/h1/42830.gscbin b/data/h1/42830.gscbin new file mode 100644 index 00000000..8f869892 Binary files /dev/null and b/data/h1/42830.gscbin differ diff --git a/data/h1/42831.gscbin b/data/h1/42831.gscbin new file mode 100644 index 00000000..1f22dfff Binary files /dev/null and b/data/h1/42831.gscbin differ diff --git a/data/h1/42833.gscbin b/data/h1/42833.gscbin new file mode 100644 index 00000000..df2ce858 Binary files /dev/null and b/data/h1/42833.gscbin differ diff --git a/data/h1/42834.gscbin b/data/h1/42834.gscbin new file mode 100644 index 00000000..c9011f1d Binary files /dev/null and b/data/h1/42834.gscbin differ diff --git a/data/h1/42837.gscbin b/data/h1/42837.gscbin new file mode 100644 index 00000000..8587a681 Binary files /dev/null and b/data/h1/42837.gscbin differ diff --git a/data/h1/42840.gscbin b/data/h1/42840.gscbin new file mode 100644 index 00000000..4c97b68d Binary files /dev/null and b/data/h1/42840.gscbin differ diff --git a/data/h1/42841.gscbin b/data/h1/42841.gscbin new file mode 100644 index 00000000..0dc6a266 Binary files /dev/null and b/data/h1/42841.gscbin differ diff --git a/data/h1/42842.gscbin b/data/h1/42842.gscbin new file mode 100644 index 00000000..542aeb8e Binary files /dev/null and b/data/h1/42842.gscbin differ diff --git a/data/h1/42843.gscbin b/data/h1/42843.gscbin new file mode 100644 index 00000000..5c6e0184 Binary files /dev/null and b/data/h1/42843.gscbin differ diff --git a/data/h1/42852.gscbin b/data/h1/42852.gscbin new file mode 100644 index 00000000..64d71c86 Binary files /dev/null and b/data/h1/42852.gscbin differ diff --git a/data/h1/42858.gscbin b/data/h1/42858.gscbin new file mode 100644 index 00000000..831b44d7 Binary files /dev/null and b/data/h1/42858.gscbin differ diff --git a/data/h1/42890.gscbin b/data/h1/42890.gscbin new file mode 100644 index 00000000..d64831ab Binary files /dev/null and b/data/h1/42890.gscbin differ diff --git a/data/h1/42891.gscbin b/data/h1/42891.gscbin new file mode 100644 index 00000000..f7912866 Binary files /dev/null and b/data/h1/42891.gscbin differ diff --git a/data/h1/42893.gscbin b/data/h1/42893.gscbin new file mode 100644 index 00000000..3f9c7416 Binary files /dev/null and b/data/h1/42893.gscbin differ diff --git a/data/h1/42894.gscbin b/data/h1/42894.gscbin new file mode 100644 index 00000000..38f176d5 Binary files /dev/null and b/data/h1/42894.gscbin differ diff --git a/data/h1/42895.gscbin b/data/h1/42895.gscbin new file mode 100644 index 00000000..86b25dd2 Binary files /dev/null and b/data/h1/42895.gscbin differ diff --git a/data/h1/42896.gscbin b/data/h1/42896.gscbin new file mode 100644 index 00000000..dbe7d1e0 Binary files /dev/null and b/data/h1/42896.gscbin differ diff --git a/data/h1/42898.gscbin b/data/h1/42898.gscbin new file mode 100644 index 00000000..9eec1589 Binary files /dev/null and b/data/h1/42898.gscbin differ diff --git a/data/h1/42899.gscbin b/data/h1/42899.gscbin new file mode 100644 index 00000000..ecdb8580 Binary files /dev/null and b/data/h1/42899.gscbin differ diff --git a/data/h1/42900.gscbin b/data/h1/42900.gscbin new file mode 100644 index 00000000..1081d462 Binary files /dev/null and b/data/h1/42900.gscbin differ diff --git a/data/h1/42901.gscbin b/data/h1/42901.gscbin new file mode 100644 index 00000000..ffd5a9a8 Binary files /dev/null and b/data/h1/42901.gscbin differ diff --git a/data/h1/42903.gscbin b/data/h1/42903.gscbin new file mode 100644 index 00000000..b95815ac Binary files /dev/null and b/data/h1/42903.gscbin differ diff --git a/data/h1/42904.gscbin b/data/h1/42904.gscbin new file mode 100644 index 00000000..21ae7459 Binary files /dev/null and b/data/h1/42904.gscbin differ diff --git a/data/h1/42905.gscbin b/data/h1/42905.gscbin new file mode 100644 index 00000000..8ced32a8 Binary files /dev/null and b/data/h1/42905.gscbin differ diff --git a/data/h1/42916.gscbin b/data/h1/42916.gscbin new file mode 100644 index 00000000..ab02ab97 Binary files /dev/null and b/data/h1/42916.gscbin differ diff --git a/data/h1/42917.gscbin b/data/h1/42917.gscbin new file mode 100644 index 00000000..b44dab4b Binary files /dev/null and b/data/h1/42917.gscbin differ diff --git a/data/h1/42918.gscbin b/data/h1/42918.gscbin new file mode 100644 index 00000000..cccdb512 Binary files /dev/null and b/data/h1/42918.gscbin differ diff --git a/data/h1/42919.gscbin b/data/h1/42919.gscbin new file mode 100644 index 00000000..7064b920 Binary files /dev/null and b/data/h1/42919.gscbin differ diff --git a/data/h1/42920.gscbin b/data/h1/42920.gscbin new file mode 100644 index 00000000..baae9671 Binary files /dev/null and b/data/h1/42920.gscbin differ diff --git a/data/h1/42921.gscbin b/data/h1/42921.gscbin new file mode 100644 index 00000000..76cda070 Binary files /dev/null and b/data/h1/42921.gscbin differ diff --git a/data/h1/42922.gscbin b/data/h1/42922.gscbin new file mode 100644 index 00000000..60316b0e Binary files /dev/null and b/data/h1/42922.gscbin differ diff --git a/data/h1/42923.gscbin b/data/h1/42923.gscbin new file mode 100644 index 00000000..f4227691 Binary files /dev/null and b/data/h1/42923.gscbin differ diff --git a/data/h1/42924.gscbin b/data/h1/42924.gscbin new file mode 100644 index 00000000..45ce5390 Binary files /dev/null and b/data/h1/42924.gscbin differ diff --git a/data/h1/42926.gscbin b/data/h1/42926.gscbin new file mode 100644 index 00000000..2498917f Binary files /dev/null and b/data/h1/42926.gscbin differ diff --git a/data/h1/42928.gscbin b/data/h1/42928.gscbin new file mode 100644 index 00000000..ffec52ed Binary files /dev/null and b/data/h1/42928.gscbin differ diff --git a/data/h1/42929.gscbin b/data/h1/42929.gscbin new file mode 100644 index 00000000..098a0623 Binary files /dev/null and b/data/h1/42929.gscbin differ diff --git a/data/h1/42930.gscbin b/data/h1/42930.gscbin new file mode 100644 index 00000000..9b1fc7c9 Binary files /dev/null and b/data/h1/42930.gscbin differ diff --git a/data/h1/42931.gscbin b/data/h1/42931.gscbin new file mode 100644 index 00000000..a373ba71 Binary files /dev/null and b/data/h1/42931.gscbin differ diff --git a/data/h1/42932.gscbin b/data/h1/42932.gscbin new file mode 100644 index 00000000..09cc790e Binary files /dev/null and b/data/h1/42932.gscbin differ diff --git a/data/h1/42933.gscbin b/data/h1/42933.gscbin new file mode 100644 index 00000000..f5bc6a77 Binary files /dev/null and b/data/h1/42933.gscbin differ diff --git a/data/h1/42934.gscbin b/data/h1/42934.gscbin new file mode 100644 index 00000000..7ca18258 Binary files /dev/null and b/data/h1/42934.gscbin differ diff --git a/data/h1/42935.gscbin b/data/h1/42935.gscbin new file mode 100644 index 00000000..c95e8f58 Binary files /dev/null and b/data/h1/42935.gscbin differ diff --git a/data/h1/42936.gscbin b/data/h1/42936.gscbin new file mode 100644 index 00000000..ac9a3c63 Binary files /dev/null and b/data/h1/42936.gscbin differ diff --git a/data/h1/42937.gscbin b/data/h1/42937.gscbin new file mode 100644 index 00000000..67e20f50 Binary files /dev/null and b/data/h1/42937.gscbin differ diff --git a/data/h1/42938.gscbin b/data/h1/42938.gscbin new file mode 100644 index 00000000..43dd5664 Binary files /dev/null and b/data/h1/42938.gscbin differ diff --git a/data/h1/42939.gscbin b/data/h1/42939.gscbin new file mode 100644 index 00000000..a27081ba Binary files /dev/null and b/data/h1/42939.gscbin differ diff --git a/data/h1/42940.gscbin b/data/h1/42940.gscbin new file mode 100644 index 00000000..f71d0916 Binary files /dev/null and b/data/h1/42940.gscbin differ diff --git a/data/h1/42941.gscbin b/data/h1/42941.gscbin new file mode 100644 index 00000000..74c58219 Binary files /dev/null and b/data/h1/42941.gscbin differ diff --git a/data/h1/42942.gscbin b/data/h1/42942.gscbin new file mode 100644 index 00000000..c23d058b Binary files /dev/null and b/data/h1/42942.gscbin differ diff --git a/data/h1/42981.gscbin b/data/h1/42981.gscbin new file mode 100644 index 00000000..6b82eb8f Binary files /dev/null and b/data/h1/42981.gscbin differ diff --git a/data/h1/42982.gscbin b/data/h1/42982.gscbin new file mode 100644 index 00000000..6743c61c Binary files /dev/null and b/data/h1/42982.gscbin differ diff --git a/data/h1/maps/_navigate_models.gscbin b/data/h1/maps/_navigate_models.gscbin new file mode 100644 index 00000000..00d2ae5c Binary files /dev/null and b/data/h1/maps/_navigate_models.gscbin differ diff --git a/data/h1/maps/mp/_dynamic_world.gscbin b/data/h1/maps/mp/_dynamic_world.gscbin new file mode 100644 index 00000000..44e0ac64 Binary files /dev/null and b/data/h1/maps/mp/_dynamic_world.gscbin differ diff --git a/data/h1/maps/mp/_helicopter.gscbin b/data/h1/maps/mp/_helicopter.gscbin new file mode 100644 index 00000000..8cff6553 Binary files /dev/null and b/data/h1/maps/mp/_helicopter.gscbin differ diff --git a/data/h1/maps/mp/_skill.gscbin b/data/h1/maps/mp/_skill.gscbin new file mode 100644 index 00000000..6099cc15 Binary files /dev/null and b/data/h1/maps/mp/_skill.gscbin differ diff --git a/data/h1/maps/mp/agents/_agent_common.gscbin b/data/h1/maps/mp/agents/_agent_common.gscbin new file mode 100644 index 00000000..a60b8779 Binary files /dev/null and b/data/h1/maps/mp/agents/_agent_common.gscbin differ diff --git a/data/h1/maps/mp/agents/_agent_utility.gscbin b/data/h1/maps/mp/agents/_agent_utility.gscbin new file mode 100644 index 00000000..6582d551 Binary files /dev/null and b/data/h1/maps/mp/agents/_agent_utility.gscbin differ diff --git a/data/h1/maps/mp/agents/_scriptedagents.gscbin b/data/h1/maps/mp/agents/_scriptedagents.gscbin new file mode 100644 index 00000000..41231583 Binary files /dev/null and b/data/h1/maps/mp/agents/_scriptedagents.gscbin differ diff --git a/data/h1/maps/mp/gametypes/_divisions.gscbin b/data/h1/maps/mp/gametypes/_divisions.gscbin new file mode 100644 index 00000000..49e3b59e Binary files /dev/null and b/data/h1/maps/mp/gametypes/_divisions.gscbin differ diff --git a/data/h1/maps/mp/gametypes/_hodgepodge.gscbin b/data/h1/maps/mp/gametypes/_hodgepodge.gscbin new file mode 100644 index 00000000..fd83646c Binary files /dev/null and b/data/h1/maps/mp/gametypes/_hodgepodge.gscbin differ diff --git a/data/h1/maps/mp/gametypes/_hodgepodge_ph.gscbin b/data/h1/maps/mp/gametypes/_hodgepodge_ph.gscbin new file mode 100644 index 00000000..f81fa547 Binary files /dev/null and b/data/h1/maps/mp/gametypes/_hodgepodge_ph.gscbin differ diff --git a/data/h1/maps/mp/gametypes/_legacyspawnlogic.gscbin b/data/h1/maps/mp/gametypes/_legacyspawnlogic.gscbin new file mode 100644 index 00000000..0c513441 Binary files /dev/null and b/data/h1/maps/mp/gametypes/_legacyspawnlogic.gscbin differ diff --git a/data/h1/maps/mp/gametypes/_oldschool.gscbin b/data/h1/maps/mp/gametypes/_oldschool.gscbin new file mode 100644 index 00000000..0083e0f5 Binary files /dev/null and b/data/h1/maps/mp/gametypes/_oldschool.gscbin differ diff --git a/data/h1/maps/mp/gametypes/common_bomb_gameobject.gscbin b/data/h1/maps/mp/gametypes/common_bomb_gameobject.gscbin new file mode 100644 index 00000000..cbd61978 Binary files /dev/null and b/data/h1/maps/mp/gametypes/common_bomb_gameobject.gscbin differ diff --git a/data/h1/maps/mp/gametypes/common_sd_sr.gscbin b/data/h1/maps/mp/gametypes/common_sd_sr.gscbin new file mode 100644 index 00000000..3ab836e8 Binary files /dev/null and b/data/h1/maps/mp/gametypes/common_sd_sr.gscbin differ diff --git a/data/h1/maps/mp/gametypes/conf.gscbin b/data/h1/maps/mp/gametypes/conf.gscbin new file mode 100644 index 00000000..d8500acf Binary files /dev/null and b/data/h1/maps/mp/gametypes/conf.gscbin differ diff --git a/data/h1/maps/mp/gametypes/ctf.gscbin b/data/h1/maps/mp/gametypes/ctf.gscbin new file mode 100644 index 00000000..b40f3e98 Binary files /dev/null and b/data/h1/maps/mp/gametypes/ctf.gscbin differ diff --git a/data/h1/maps/mp/gametypes/dd.gscbin b/data/h1/maps/mp/gametypes/dd.gscbin new file mode 100644 index 00000000..7ade58a4 Binary files /dev/null and b/data/h1/maps/mp/gametypes/dd.gscbin differ diff --git a/data/h1/maps/mp/gametypes/dm.gscbin b/data/h1/maps/mp/gametypes/dm.gscbin new file mode 100644 index 00000000..a306d20e Binary files /dev/null and b/data/h1/maps/mp/gametypes/dm.gscbin differ diff --git a/data/h1/maps/mp/gametypes/dom.gscbin b/data/h1/maps/mp/gametypes/dom.gscbin new file mode 100644 index 00000000..d02c4a51 Binary files /dev/null and b/data/h1/maps/mp/gametypes/dom.gscbin differ diff --git a/data/h1/maps/mp/gametypes/gun.gscbin b/data/h1/maps/mp/gametypes/gun.gscbin new file mode 100644 index 00000000..2aac0335 Binary files /dev/null and b/data/h1/maps/mp/gametypes/gun.gscbin differ diff --git a/data/h1/maps/mp/gametypes/hp.gscbin b/data/h1/maps/mp/gametypes/hp.gscbin new file mode 100644 index 00000000..208789b5 Binary files /dev/null and b/data/h1/maps/mp/gametypes/hp.gscbin differ diff --git a/data/h1/maps/mp/gametypes/koth.gscbin b/data/h1/maps/mp/gametypes/koth.gscbin new file mode 100644 index 00000000..e7d67fee Binary files /dev/null and b/data/h1/maps/mp/gametypes/koth.gscbin differ diff --git a/data/h1/maps/mp/gametypes/sab.gscbin b/data/h1/maps/mp/gametypes/sab.gscbin new file mode 100644 index 00000000..b0908623 Binary files /dev/null and b/data/h1/maps/mp/gametypes/sab.gscbin differ diff --git a/data/h1/maps/mp/gametypes/sd.gscbin b/data/h1/maps/mp/gametypes/sd.gscbin new file mode 100644 index 00000000..87b5207c Binary files /dev/null and b/data/h1/maps/mp/gametypes/sd.gscbin differ diff --git a/data/h1/maps/mp/gametypes/vlobby.gscbin b/data/h1/maps/mp/gametypes/vlobby.gscbin new file mode 100644 index 00000000..b8c2e3bd Binary files /dev/null and b/data/h1/maps/mp/gametypes/vlobby.gscbin differ diff --git a/data/h1/maps/mp/gametypes/war.gscbin b/data/h1/maps/mp/gametypes/war.gscbin new file mode 100644 index 00000000..9f826109 Binary files /dev/null and b/data/h1/maps/mp/gametypes/war.gscbin differ diff --git a/data/iw7/10.gscbin b/data/iw7/10.gscbin new file mode 100644 index 00000000..eb12f6ee Binary files /dev/null and b/data/iw7/10.gscbin differ diff --git a/data/iw7/11.gscbin b/data/iw7/11.gscbin new file mode 100644 index 00000000..917f5b30 Binary files /dev/null and b/data/iw7/11.gscbin differ diff --git a/data/iw7/2557.gscbin b/data/iw7/2557.gscbin new file mode 100644 index 00000000..42886d60 Binary files /dev/null and b/data/iw7/2557.gscbin differ diff --git a/data/iw7/2559.gscbin b/data/iw7/2559.gscbin new file mode 100644 index 00000000..b4b5f268 Binary files /dev/null and b/data/iw7/2559.gscbin differ diff --git a/data/iw7/2562.gscbin b/data/iw7/2562.gscbin new file mode 100644 index 00000000..67edc8b6 Binary files /dev/null and b/data/iw7/2562.gscbin differ diff --git a/data/iw7/2586.gscbin b/data/iw7/2586.gscbin new file mode 100644 index 00000000..6db220e6 Binary files /dev/null and b/data/iw7/2586.gscbin differ diff --git a/data/iw7/2587.gscbin b/data/iw7/2587.gscbin new file mode 100644 index 00000000..90151c56 Binary files /dev/null and b/data/iw7/2587.gscbin differ diff --git a/data/iw7/2589.gscbin b/data/iw7/2589.gscbin new file mode 100644 index 00000000..79133bcc Binary files /dev/null and b/data/iw7/2589.gscbin differ diff --git a/data/iw7/2606.gscbin b/data/iw7/2606.gscbin new file mode 100644 index 00000000..232332d0 Binary files /dev/null and b/data/iw7/2606.gscbin differ diff --git a/data/iw7/2609.gscbin b/data/iw7/2609.gscbin new file mode 100644 index 00000000..a1b53220 Binary files /dev/null and b/data/iw7/2609.gscbin differ diff --git a/data/iw7/2610.gscbin b/data/iw7/2610.gscbin new file mode 100644 index 00000000..a738bee3 Binary files /dev/null and b/data/iw7/2610.gscbin differ diff --git a/data/iw7/2611.gscbin b/data/iw7/2611.gscbin new file mode 100644 index 00000000..6ed236e8 Binary files /dev/null and b/data/iw7/2611.gscbin differ diff --git a/data/iw7/2613.gscbin b/data/iw7/2613.gscbin new file mode 100644 index 00000000..b1ddb361 Binary files /dev/null and b/data/iw7/2613.gscbin differ diff --git a/data/iw7/2614.gscbin b/data/iw7/2614.gscbin new file mode 100644 index 00000000..f87b1dcd Binary files /dev/null and b/data/iw7/2614.gscbin differ diff --git a/data/iw7/2617.gscbin b/data/iw7/2617.gscbin new file mode 100644 index 00000000..c2c73ebc Binary files /dev/null and b/data/iw7/2617.gscbin differ diff --git a/data/iw7/2618.gscbin b/data/iw7/2618.gscbin new file mode 100644 index 00000000..0c9f11c4 Binary files /dev/null and b/data/iw7/2618.gscbin differ diff --git a/data/iw7/2619.gscbin b/data/iw7/2619.gscbin new file mode 100644 index 00000000..0f6ef4f9 Binary files /dev/null and b/data/iw7/2619.gscbin differ diff --git a/data/iw7/2620.gscbin b/data/iw7/2620.gscbin new file mode 100644 index 00000000..7cf86f7c Binary files /dev/null and b/data/iw7/2620.gscbin differ diff --git a/data/iw7/2623.gscbin b/data/iw7/2623.gscbin new file mode 100644 index 00000000..e2fd3549 Binary files /dev/null and b/data/iw7/2623.gscbin differ diff --git a/data/iw7/2625.gscbin b/data/iw7/2625.gscbin new file mode 100644 index 00000000..79a75e8f Binary files /dev/null and b/data/iw7/2625.gscbin differ diff --git a/data/iw7/2626.gscbin b/data/iw7/2626.gscbin new file mode 100644 index 00000000..02f37231 Binary files /dev/null and b/data/iw7/2626.gscbin differ diff --git a/data/iw7/2680.gscbin b/data/iw7/2680.gscbin new file mode 100644 index 00000000..72d38ead Binary files /dev/null and b/data/iw7/2680.gscbin differ diff --git a/data/iw7/2681.gscbin b/data/iw7/2681.gscbin new file mode 100644 index 00000000..3a76a378 Binary files /dev/null and b/data/iw7/2681.gscbin differ diff --git a/data/iw7/2691.gscbin b/data/iw7/2691.gscbin new file mode 100644 index 00000000..6fee1603 Binary files /dev/null and b/data/iw7/2691.gscbin differ diff --git a/data/iw7/2692.gscbin b/data/iw7/2692.gscbin new file mode 100644 index 00000000..2512612e Binary files /dev/null and b/data/iw7/2692.gscbin differ diff --git a/data/iw7/2693.gscbin b/data/iw7/2693.gscbin new file mode 100644 index 00000000..5c5ff423 Binary files /dev/null and b/data/iw7/2693.gscbin differ diff --git a/data/iw7/2694.gscbin b/data/iw7/2694.gscbin new file mode 100644 index 00000000..c280ffd8 Binary files /dev/null and b/data/iw7/2694.gscbin differ diff --git a/data/iw7/2695.gscbin b/data/iw7/2695.gscbin new file mode 100644 index 00000000..f3838b3d Binary files /dev/null and b/data/iw7/2695.gscbin differ diff --git a/data/iw7/2696.gscbin b/data/iw7/2696.gscbin new file mode 100644 index 00000000..6d74b716 Binary files /dev/null and b/data/iw7/2696.gscbin differ diff --git a/data/iw7/2697.gscbin b/data/iw7/2697.gscbin new file mode 100644 index 00000000..1eff7e5e Binary files /dev/null and b/data/iw7/2697.gscbin differ diff --git a/data/iw7/2698.gscbin b/data/iw7/2698.gscbin new file mode 100644 index 00000000..b3ceb18e Binary files /dev/null and b/data/iw7/2698.gscbin differ diff --git a/data/iw7/2699.gscbin b/data/iw7/2699.gscbin new file mode 100644 index 00000000..8df465a9 Binary files /dev/null and b/data/iw7/2699.gscbin differ diff --git a/data/iw7/2700.gscbin b/data/iw7/2700.gscbin new file mode 100644 index 00000000..9b907cb0 Binary files /dev/null and b/data/iw7/2700.gscbin differ diff --git a/data/iw7/2701.gscbin b/data/iw7/2701.gscbin new file mode 100644 index 00000000..3559d6c9 Binary files /dev/null and b/data/iw7/2701.gscbin differ diff --git a/data/iw7/2702.gscbin b/data/iw7/2702.gscbin new file mode 100644 index 00000000..0ad0372c Binary files /dev/null and b/data/iw7/2702.gscbin differ diff --git a/data/iw7/2703.gscbin b/data/iw7/2703.gscbin new file mode 100644 index 00000000..068f5c3d Binary files /dev/null and b/data/iw7/2703.gscbin differ diff --git a/data/iw7/2704.gscbin b/data/iw7/2704.gscbin new file mode 100644 index 00000000..bebb1a10 Binary files /dev/null and b/data/iw7/2704.gscbin differ diff --git a/data/iw7/2705.gscbin b/data/iw7/2705.gscbin new file mode 100644 index 00000000..70d83520 Binary files /dev/null and b/data/iw7/2705.gscbin differ diff --git a/data/iw7/2706.gscbin b/data/iw7/2706.gscbin new file mode 100644 index 00000000..bd322f13 Binary files /dev/null and b/data/iw7/2706.gscbin differ diff --git a/data/iw7/2708.gscbin b/data/iw7/2708.gscbin new file mode 100644 index 00000000..e92f6130 Binary files /dev/null and b/data/iw7/2708.gscbin differ diff --git a/data/iw7/2709.gscbin b/data/iw7/2709.gscbin new file mode 100644 index 00000000..ebe26cb1 Binary files /dev/null and b/data/iw7/2709.gscbin differ diff --git a/data/iw7/2710.gscbin b/data/iw7/2710.gscbin new file mode 100644 index 00000000..292a0bdc Binary files /dev/null and b/data/iw7/2710.gscbin differ diff --git a/data/iw7/2711.gscbin b/data/iw7/2711.gscbin new file mode 100644 index 00000000..1994de3b Binary files /dev/null and b/data/iw7/2711.gscbin differ diff --git a/data/iw7/2712.gscbin b/data/iw7/2712.gscbin new file mode 100644 index 00000000..191ce7a9 Binary files /dev/null and b/data/iw7/2712.gscbin differ diff --git a/data/iw7/2713.gscbin b/data/iw7/2713.gscbin new file mode 100644 index 00000000..b4c00766 Binary files /dev/null and b/data/iw7/2713.gscbin differ diff --git a/data/iw7/2714.gscbin b/data/iw7/2714.gscbin new file mode 100644 index 00000000..75c51435 Binary files /dev/null and b/data/iw7/2714.gscbin differ diff --git a/data/iw7/2715.gscbin b/data/iw7/2715.gscbin new file mode 100644 index 00000000..8ec23acd Binary files /dev/null and b/data/iw7/2715.gscbin differ diff --git a/data/iw7/2716.gscbin b/data/iw7/2716.gscbin new file mode 100644 index 00000000..524329f8 Binary files /dev/null and b/data/iw7/2716.gscbin differ diff --git a/data/iw7/2717.gscbin b/data/iw7/2717.gscbin new file mode 100644 index 00000000..5696e263 Binary files /dev/null and b/data/iw7/2717.gscbin differ diff --git a/data/iw7/2718.gscbin b/data/iw7/2718.gscbin new file mode 100644 index 00000000..b19c856d Binary files /dev/null and b/data/iw7/2718.gscbin differ diff --git a/data/iw7/2719.gscbin b/data/iw7/2719.gscbin new file mode 100644 index 00000000..c46494d3 Binary files /dev/null and b/data/iw7/2719.gscbin differ diff --git a/data/iw7/2721.gscbin b/data/iw7/2721.gscbin new file mode 100644 index 00000000..40d8cabf Binary files /dev/null and b/data/iw7/2721.gscbin differ diff --git a/data/iw7/2722.gscbin b/data/iw7/2722.gscbin new file mode 100644 index 00000000..b5abd9bf Binary files /dev/null and b/data/iw7/2722.gscbin differ diff --git a/data/iw7/2723.gscbin b/data/iw7/2723.gscbin new file mode 100644 index 00000000..891373b4 Binary files /dev/null and b/data/iw7/2723.gscbin differ diff --git a/data/iw7/2724.gscbin b/data/iw7/2724.gscbin new file mode 100644 index 00000000..ca4cb39e Binary files /dev/null and b/data/iw7/2724.gscbin differ diff --git a/data/iw7/2726.gscbin b/data/iw7/2726.gscbin new file mode 100644 index 00000000..876bf235 Binary files /dev/null and b/data/iw7/2726.gscbin differ diff --git a/data/iw7/2727.gscbin b/data/iw7/2727.gscbin new file mode 100644 index 00000000..33e73755 Binary files /dev/null and b/data/iw7/2727.gscbin differ diff --git a/data/iw7/2728.gscbin b/data/iw7/2728.gscbin new file mode 100644 index 00000000..84a566ea Binary files /dev/null and b/data/iw7/2728.gscbin differ diff --git a/data/iw7/2729.gscbin b/data/iw7/2729.gscbin new file mode 100644 index 00000000..e21e3899 Binary files /dev/null and b/data/iw7/2729.gscbin differ diff --git a/data/iw7/2733.gscbin b/data/iw7/2733.gscbin new file mode 100644 index 00000000..9d9d3425 Binary files /dev/null and b/data/iw7/2733.gscbin differ diff --git a/data/iw7/2734.gscbin b/data/iw7/2734.gscbin new file mode 100644 index 00000000..1c55d841 Binary files /dev/null and b/data/iw7/2734.gscbin differ diff --git a/data/iw7/2735.gscbin b/data/iw7/2735.gscbin new file mode 100644 index 00000000..a4ab5c19 Binary files /dev/null and b/data/iw7/2735.gscbin differ diff --git a/data/iw7/2736.gscbin b/data/iw7/2736.gscbin new file mode 100644 index 00000000..fd05f13d Binary files /dev/null and b/data/iw7/2736.gscbin differ diff --git a/data/iw7/2737.gscbin b/data/iw7/2737.gscbin new file mode 100644 index 00000000..d2c5bf87 Binary files /dev/null and b/data/iw7/2737.gscbin differ diff --git a/data/iw7/2738.gscbin b/data/iw7/2738.gscbin new file mode 100644 index 00000000..7c7ad407 Binary files /dev/null and b/data/iw7/2738.gscbin differ diff --git a/data/iw7/2739.gscbin b/data/iw7/2739.gscbin new file mode 100644 index 00000000..afc2039d Binary files /dev/null and b/data/iw7/2739.gscbin differ diff --git a/data/iw7/2740.gscbin b/data/iw7/2740.gscbin new file mode 100644 index 00000000..e0d8318f Binary files /dev/null and b/data/iw7/2740.gscbin differ diff --git a/data/iw7/2742.gscbin b/data/iw7/2742.gscbin new file mode 100644 index 00000000..7461b3e9 Binary files /dev/null and b/data/iw7/2742.gscbin differ diff --git a/data/iw7/2744.gscbin b/data/iw7/2744.gscbin new file mode 100644 index 00000000..b0a1ff1f Binary files /dev/null and b/data/iw7/2744.gscbin differ diff --git a/data/iw7/2745.gscbin b/data/iw7/2745.gscbin new file mode 100644 index 00000000..47e80011 Binary files /dev/null and b/data/iw7/2745.gscbin differ diff --git a/data/iw7/2750.gscbin b/data/iw7/2750.gscbin new file mode 100644 index 00000000..bca584ba Binary files /dev/null and b/data/iw7/2750.gscbin differ diff --git a/data/iw7/2751.gscbin b/data/iw7/2751.gscbin new file mode 100644 index 00000000..81f2b5c7 Binary files /dev/null and b/data/iw7/2751.gscbin differ diff --git a/data/iw7/2752.gscbin b/data/iw7/2752.gscbin new file mode 100644 index 00000000..4b209909 Binary files /dev/null and b/data/iw7/2752.gscbin differ diff --git a/data/iw7/2753.gscbin b/data/iw7/2753.gscbin new file mode 100644 index 00000000..f3f43b4c Binary files /dev/null and b/data/iw7/2753.gscbin differ diff --git a/data/iw7/2755.gscbin b/data/iw7/2755.gscbin new file mode 100644 index 00000000..b9ec7007 Binary files /dev/null and b/data/iw7/2755.gscbin differ diff --git a/data/iw7/2756.gscbin b/data/iw7/2756.gscbin new file mode 100644 index 00000000..bf95e347 Binary files /dev/null and b/data/iw7/2756.gscbin differ diff --git a/data/iw7/2757.gscbin b/data/iw7/2757.gscbin new file mode 100644 index 00000000..fdf14029 Binary files /dev/null and b/data/iw7/2757.gscbin differ diff --git a/data/iw7/2758.gscbin b/data/iw7/2758.gscbin new file mode 100644 index 00000000..2fb6bce5 Binary files /dev/null and b/data/iw7/2758.gscbin differ diff --git a/data/iw7/2759.gscbin b/data/iw7/2759.gscbin new file mode 100644 index 00000000..2b753122 Binary files /dev/null and b/data/iw7/2759.gscbin differ diff --git a/data/iw7/2760.gscbin b/data/iw7/2760.gscbin new file mode 100644 index 00000000..6fbdedfa Binary files /dev/null and b/data/iw7/2760.gscbin differ diff --git a/data/iw7/2762.gscbin b/data/iw7/2762.gscbin new file mode 100644 index 00000000..1fb84fbb Binary files /dev/null and b/data/iw7/2762.gscbin differ diff --git a/data/iw7/2763.gscbin b/data/iw7/2763.gscbin new file mode 100644 index 00000000..50ab3175 Binary files /dev/null and b/data/iw7/2763.gscbin differ diff --git a/data/iw7/2764.gscbin b/data/iw7/2764.gscbin new file mode 100644 index 00000000..9e342e11 Binary files /dev/null and b/data/iw7/2764.gscbin differ diff --git a/data/iw7/2765.gscbin b/data/iw7/2765.gscbin new file mode 100644 index 00000000..8c48fe7d Binary files /dev/null and b/data/iw7/2765.gscbin differ diff --git a/data/iw7/2766.gscbin b/data/iw7/2766.gscbin new file mode 100644 index 00000000..af753dea Binary files /dev/null and b/data/iw7/2766.gscbin differ diff --git a/data/iw7/2767.gscbin b/data/iw7/2767.gscbin new file mode 100644 index 00000000..1ca62ce4 Binary files /dev/null and b/data/iw7/2767.gscbin differ diff --git a/data/iw7/2768.gscbin b/data/iw7/2768.gscbin new file mode 100644 index 00000000..4b2dce15 Binary files /dev/null and b/data/iw7/2768.gscbin differ diff --git a/data/iw7/2769.gscbin b/data/iw7/2769.gscbin new file mode 100644 index 00000000..e7f6278a Binary files /dev/null and b/data/iw7/2769.gscbin differ diff --git a/data/iw7/2770.gscbin b/data/iw7/2770.gscbin new file mode 100644 index 00000000..b5ac4187 Binary files /dev/null and b/data/iw7/2770.gscbin differ diff --git a/data/iw7/2771.gscbin b/data/iw7/2771.gscbin new file mode 100644 index 00000000..c14e2e8b Binary files /dev/null and b/data/iw7/2771.gscbin differ diff --git a/data/iw7/2772.gscbin b/data/iw7/2772.gscbin new file mode 100644 index 00000000..96e1208c Binary files /dev/null and b/data/iw7/2772.gscbin differ diff --git a/data/iw7/2773.gscbin b/data/iw7/2773.gscbin new file mode 100644 index 00000000..b181e713 Binary files /dev/null and b/data/iw7/2773.gscbin differ diff --git a/data/iw7/2775.gscbin b/data/iw7/2775.gscbin new file mode 100644 index 00000000..e0756ec2 Binary files /dev/null and b/data/iw7/2775.gscbin differ diff --git a/data/iw7/2776.gscbin b/data/iw7/2776.gscbin new file mode 100644 index 00000000..4c7ae84e Binary files /dev/null and b/data/iw7/2776.gscbin differ diff --git a/data/iw7/2777.gscbin b/data/iw7/2777.gscbin new file mode 100644 index 00000000..28a8faf2 Binary files /dev/null and b/data/iw7/2777.gscbin differ diff --git a/data/iw7/2778.gscbin b/data/iw7/2778.gscbin new file mode 100644 index 00000000..1301a15e Binary files /dev/null and b/data/iw7/2778.gscbin differ diff --git a/data/iw7/2779.gscbin b/data/iw7/2779.gscbin new file mode 100644 index 00000000..ac3b23e4 Binary files /dev/null and b/data/iw7/2779.gscbin differ diff --git a/data/iw7/2780.gscbin b/data/iw7/2780.gscbin new file mode 100644 index 00000000..c5aaa6a9 Binary files /dev/null and b/data/iw7/2780.gscbin differ diff --git a/data/iw7/2781.gscbin b/data/iw7/2781.gscbin new file mode 100644 index 00000000..06936e20 Binary files /dev/null and b/data/iw7/2781.gscbin differ diff --git a/data/iw7/2782.gscbin b/data/iw7/2782.gscbin new file mode 100644 index 00000000..8ce474f6 Binary files /dev/null and b/data/iw7/2782.gscbin differ diff --git a/data/iw7/2783.gscbin b/data/iw7/2783.gscbin new file mode 100644 index 00000000..122b8b79 Binary files /dev/null and b/data/iw7/2783.gscbin differ diff --git a/data/iw7/2784.gscbin b/data/iw7/2784.gscbin new file mode 100644 index 00000000..916e9d3e Binary files /dev/null and b/data/iw7/2784.gscbin differ diff --git a/data/iw7/2785.gscbin b/data/iw7/2785.gscbin new file mode 100644 index 00000000..cd6d957e Binary files /dev/null and b/data/iw7/2785.gscbin differ diff --git a/data/iw7/2786.gscbin b/data/iw7/2786.gscbin new file mode 100644 index 00000000..76922bc8 Binary files /dev/null and b/data/iw7/2786.gscbin differ diff --git a/data/iw7/2787.gscbin b/data/iw7/2787.gscbin new file mode 100644 index 00000000..751ea702 Binary files /dev/null and b/data/iw7/2787.gscbin differ diff --git a/data/iw7/2788.gscbin b/data/iw7/2788.gscbin new file mode 100644 index 00000000..5ba28033 Binary files /dev/null and b/data/iw7/2788.gscbin differ diff --git a/data/iw7/2789.gscbin b/data/iw7/2789.gscbin new file mode 100644 index 00000000..6bd7df19 Binary files /dev/null and b/data/iw7/2789.gscbin differ diff --git a/data/iw7/2791.gscbin b/data/iw7/2791.gscbin new file mode 100644 index 00000000..2c65e184 Binary files /dev/null and b/data/iw7/2791.gscbin differ diff --git a/data/iw7/2792.gscbin b/data/iw7/2792.gscbin new file mode 100644 index 00000000..0a64a813 Binary files /dev/null and b/data/iw7/2792.gscbin differ diff --git a/data/iw7/2793.gscbin b/data/iw7/2793.gscbin new file mode 100644 index 00000000..7c850450 Binary files /dev/null and b/data/iw7/2793.gscbin differ diff --git a/data/iw7/2794.gscbin b/data/iw7/2794.gscbin new file mode 100644 index 00000000..4eb21715 Binary files /dev/null and b/data/iw7/2794.gscbin differ diff --git a/data/iw7/2795.gscbin b/data/iw7/2795.gscbin new file mode 100644 index 00000000..5b9780ea Binary files /dev/null and b/data/iw7/2795.gscbin differ diff --git a/data/iw7/2796.gscbin b/data/iw7/2796.gscbin new file mode 100644 index 00000000..18cae51a Binary files /dev/null and b/data/iw7/2796.gscbin differ diff --git a/data/iw7/2797.gscbin b/data/iw7/2797.gscbin new file mode 100644 index 00000000..f33be9e4 Binary files /dev/null and b/data/iw7/2797.gscbin differ diff --git a/data/iw7/2798.gscbin b/data/iw7/2798.gscbin new file mode 100644 index 00000000..2f0f653c Binary files /dev/null and b/data/iw7/2798.gscbin differ diff --git a/data/iw7/2799.gscbin b/data/iw7/2799.gscbin new file mode 100644 index 00000000..cd3ad0ff Binary files /dev/null and b/data/iw7/2799.gscbin differ diff --git a/data/iw7/2800.gscbin b/data/iw7/2800.gscbin new file mode 100644 index 00000000..01649377 Binary files /dev/null and b/data/iw7/2800.gscbin differ diff --git a/data/iw7/2801.gscbin b/data/iw7/2801.gscbin new file mode 100644 index 00000000..c84c4e88 Binary files /dev/null and b/data/iw7/2801.gscbin differ diff --git a/data/iw7/2802.gscbin b/data/iw7/2802.gscbin new file mode 100644 index 00000000..95374125 Binary files /dev/null and b/data/iw7/2802.gscbin differ diff --git a/data/iw7/2803.gscbin b/data/iw7/2803.gscbin new file mode 100644 index 00000000..672de69b Binary files /dev/null and b/data/iw7/2803.gscbin differ diff --git a/data/iw7/2804.gscbin b/data/iw7/2804.gscbin new file mode 100644 index 00000000..121fe44b Binary files /dev/null and b/data/iw7/2804.gscbin differ diff --git a/data/iw7/2805.gscbin b/data/iw7/2805.gscbin new file mode 100644 index 00000000..d587f32a Binary files /dev/null and b/data/iw7/2805.gscbin differ diff --git a/data/iw7/2806.gscbin b/data/iw7/2806.gscbin new file mode 100644 index 00000000..36180f31 Binary files /dev/null and b/data/iw7/2806.gscbin differ diff --git a/data/iw7/2807.gscbin b/data/iw7/2807.gscbin new file mode 100644 index 00000000..98602ad3 Binary files /dev/null and b/data/iw7/2807.gscbin differ diff --git a/data/iw7/2808.gscbin b/data/iw7/2808.gscbin new file mode 100644 index 00000000..6defa422 Binary files /dev/null and b/data/iw7/2808.gscbin differ diff --git a/data/iw7/2809.gscbin b/data/iw7/2809.gscbin new file mode 100644 index 00000000..080593f1 Binary files /dev/null and b/data/iw7/2809.gscbin differ diff --git a/data/iw7/2810.gscbin b/data/iw7/2810.gscbin new file mode 100644 index 00000000..30aa56fe Binary files /dev/null and b/data/iw7/2810.gscbin differ diff --git a/data/iw7/2811.gscbin b/data/iw7/2811.gscbin new file mode 100644 index 00000000..fac984c0 Binary files /dev/null and b/data/iw7/2811.gscbin differ diff --git a/data/iw7/2812.gscbin b/data/iw7/2812.gscbin new file mode 100644 index 00000000..d674b864 Binary files /dev/null and b/data/iw7/2812.gscbin differ diff --git a/data/iw7/2813.gscbin b/data/iw7/2813.gscbin new file mode 100644 index 00000000..b447aab3 Binary files /dev/null and b/data/iw7/2813.gscbin differ diff --git a/data/iw7/2814.gscbin b/data/iw7/2814.gscbin new file mode 100644 index 00000000..bc70e1ac Binary files /dev/null and b/data/iw7/2814.gscbin differ diff --git a/data/iw7/3022.gscbin b/data/iw7/3022.gscbin new file mode 100644 index 00000000..128f7c96 Binary files /dev/null and b/data/iw7/3022.gscbin differ diff --git a/data/iw7/3024.gscbin b/data/iw7/3024.gscbin new file mode 100644 index 00000000..b8c5c444 Binary files /dev/null and b/data/iw7/3024.gscbin differ diff --git a/data/iw7/3027.gscbin b/data/iw7/3027.gscbin new file mode 100644 index 00000000..d8651e86 Binary files /dev/null and b/data/iw7/3027.gscbin differ diff --git a/data/iw7/3110.gscbin b/data/iw7/3110.gscbin new file mode 100644 index 00000000..bedd256b Binary files /dev/null and b/data/iw7/3110.gscbin differ diff --git a/data/iw7/3157.gscbin b/data/iw7/3157.gscbin new file mode 100644 index 00000000..5874f043 Binary files /dev/null and b/data/iw7/3157.gscbin differ diff --git a/data/iw7/3429.gscbin b/data/iw7/3429.gscbin new file mode 100644 index 00000000..47d6af57 Binary files /dev/null and b/data/iw7/3429.gscbin differ diff --git a/data/iw7/3431.gscbin b/data/iw7/3431.gscbin new file mode 100644 index 00000000..87f99928 Binary files /dev/null and b/data/iw7/3431.gscbin differ diff --git a/data/iw7/3432.gscbin b/data/iw7/3432.gscbin new file mode 100644 index 00000000..20d4d147 Binary files /dev/null and b/data/iw7/3432.gscbin differ diff --git a/data/iw7/3433.gscbin b/data/iw7/3433.gscbin new file mode 100644 index 00000000..5c40fe01 Binary files /dev/null and b/data/iw7/3433.gscbin differ diff --git a/data/iw7/3435.gscbin b/data/iw7/3435.gscbin new file mode 100644 index 00000000..579b00e4 Binary files /dev/null and b/data/iw7/3435.gscbin differ diff --git a/data/iw7/3436.gscbin b/data/iw7/3436.gscbin new file mode 100644 index 00000000..b1017433 Binary files /dev/null and b/data/iw7/3436.gscbin differ diff --git a/data/iw7/3438.gscbin b/data/iw7/3438.gscbin new file mode 100644 index 00000000..a0d7e66a Binary files /dev/null and b/data/iw7/3438.gscbin differ diff --git a/data/iw7/3439.gscbin b/data/iw7/3439.gscbin new file mode 100644 index 00000000..c90cc53b Binary files /dev/null and b/data/iw7/3439.gscbin differ diff --git a/data/iw7/3440.gscbin b/data/iw7/3440.gscbin new file mode 100644 index 00000000..1e707df5 Binary files /dev/null and b/data/iw7/3440.gscbin differ diff --git a/data/iw7/3441.gscbin b/data/iw7/3441.gscbin new file mode 100644 index 00000000..21717a57 Binary files /dev/null and b/data/iw7/3441.gscbin differ diff --git a/data/iw7/3442.gscbin b/data/iw7/3442.gscbin new file mode 100644 index 00000000..b1d93aff Binary files /dev/null and b/data/iw7/3442.gscbin differ diff --git a/data/iw7/3443.gscbin b/data/iw7/3443.gscbin new file mode 100644 index 00000000..b7417849 Binary files /dev/null and b/data/iw7/3443.gscbin differ diff --git a/data/iw7/3444.gscbin b/data/iw7/3444.gscbin new file mode 100644 index 00000000..7f9677db Binary files /dev/null and b/data/iw7/3444.gscbin differ diff --git a/data/iw7/3445.gscbin b/data/iw7/3445.gscbin new file mode 100644 index 00000000..cff1a4b9 Binary files /dev/null and b/data/iw7/3445.gscbin differ diff --git a/data/iw7/3446.gscbin b/data/iw7/3446.gscbin new file mode 100644 index 00000000..ca7b587b Binary files /dev/null and b/data/iw7/3446.gscbin differ diff --git a/data/iw7/3447.gscbin b/data/iw7/3447.gscbin new file mode 100644 index 00000000..88359ee6 Binary files /dev/null and b/data/iw7/3447.gscbin differ diff --git a/data/iw7/3448.gscbin b/data/iw7/3448.gscbin new file mode 100644 index 00000000..ede65590 Binary files /dev/null and b/data/iw7/3448.gscbin differ diff --git a/data/iw7/3449.gscbin b/data/iw7/3449.gscbin new file mode 100644 index 00000000..9b601379 Binary files /dev/null and b/data/iw7/3449.gscbin differ diff --git a/data/iw7/3450.gscbin b/data/iw7/3450.gscbin new file mode 100644 index 00000000..2880e899 Binary files /dev/null and b/data/iw7/3450.gscbin differ diff --git a/data/iw7/3451.gscbin b/data/iw7/3451.gscbin new file mode 100644 index 00000000..70b8e1d6 Binary files /dev/null and b/data/iw7/3451.gscbin differ diff --git a/data/iw7/3452.gscbin b/data/iw7/3452.gscbin new file mode 100644 index 00000000..93d6ce91 Binary files /dev/null and b/data/iw7/3452.gscbin differ diff --git a/data/iw7/3453.gscbin b/data/iw7/3453.gscbin new file mode 100644 index 00000000..b865d14d Binary files /dev/null and b/data/iw7/3453.gscbin differ diff --git a/data/iw7/3454.gscbin b/data/iw7/3454.gscbin new file mode 100644 index 00000000..8dc6675b Binary files /dev/null and b/data/iw7/3454.gscbin differ diff --git a/data/iw7/3455.gscbin b/data/iw7/3455.gscbin new file mode 100644 index 00000000..4ad7d1b0 Binary files /dev/null and b/data/iw7/3455.gscbin differ diff --git a/data/iw7/3456.gscbin b/data/iw7/3456.gscbin new file mode 100644 index 00000000..757dbf7f Binary files /dev/null and b/data/iw7/3456.gscbin differ diff --git a/data/iw7/3457.gscbin b/data/iw7/3457.gscbin new file mode 100644 index 00000000..67f2a0d0 Binary files /dev/null and b/data/iw7/3457.gscbin differ diff --git a/data/iw7/3458.gscbin b/data/iw7/3458.gscbin new file mode 100644 index 00000000..7eb5e08c Binary files /dev/null and b/data/iw7/3458.gscbin differ diff --git a/data/iw7/3459.gscbin b/data/iw7/3459.gscbin new file mode 100644 index 00000000..4c8e6134 Binary files /dev/null and b/data/iw7/3459.gscbin differ diff --git a/data/iw7/3460.gscbin b/data/iw7/3460.gscbin new file mode 100644 index 00000000..cbed7087 Binary files /dev/null and b/data/iw7/3460.gscbin differ diff --git a/data/iw7/3461.gscbin b/data/iw7/3461.gscbin new file mode 100644 index 00000000..6e94eb15 Binary files /dev/null and b/data/iw7/3461.gscbin differ diff --git a/data/iw7/3462.gscbin b/data/iw7/3462.gscbin new file mode 100644 index 00000000..436d176b Binary files /dev/null and b/data/iw7/3462.gscbin differ diff --git a/data/iw7/3464.gscbin b/data/iw7/3464.gscbin new file mode 100644 index 00000000..8a20aad4 Binary files /dev/null and b/data/iw7/3464.gscbin differ diff --git a/data/iw7/3466.gscbin b/data/iw7/3466.gscbin new file mode 100644 index 00000000..6b505602 Binary files /dev/null and b/data/iw7/3466.gscbin differ diff --git a/data/iw7/3467.gscbin b/data/iw7/3467.gscbin new file mode 100644 index 00000000..e5b7666d Binary files /dev/null and b/data/iw7/3467.gscbin differ diff --git a/data/iw7/3468.gscbin b/data/iw7/3468.gscbin new file mode 100644 index 00000000..5b579e5c Binary files /dev/null and b/data/iw7/3468.gscbin differ diff --git a/data/iw7/3469.gscbin b/data/iw7/3469.gscbin new file mode 100644 index 00000000..07313dad Binary files /dev/null and b/data/iw7/3469.gscbin differ diff --git a/data/iw7/3470.gscbin b/data/iw7/3470.gscbin new file mode 100644 index 00000000..cbaa002f Binary files /dev/null and b/data/iw7/3470.gscbin differ diff --git a/data/iw7/3471.gscbin b/data/iw7/3471.gscbin new file mode 100644 index 00000000..679bc632 Binary files /dev/null and b/data/iw7/3471.gscbin differ diff --git a/data/iw7/3472.gscbin b/data/iw7/3472.gscbin new file mode 100644 index 00000000..8a3eed12 Binary files /dev/null and b/data/iw7/3472.gscbin differ diff --git a/data/iw7/3473.gscbin b/data/iw7/3473.gscbin new file mode 100644 index 00000000..f262736f Binary files /dev/null and b/data/iw7/3473.gscbin differ diff --git a/data/iw7/3474.gscbin b/data/iw7/3474.gscbin new file mode 100644 index 00000000..a68933ba Binary files /dev/null and b/data/iw7/3474.gscbin differ diff --git a/data/iw7/3475.gscbin b/data/iw7/3475.gscbin new file mode 100644 index 00000000..54f6e222 Binary files /dev/null and b/data/iw7/3475.gscbin differ diff --git a/data/iw7/3476.gscbin b/data/iw7/3476.gscbin new file mode 100644 index 00000000..ea707f31 Binary files /dev/null and b/data/iw7/3476.gscbin differ diff --git a/data/iw7/3477.gscbin b/data/iw7/3477.gscbin new file mode 100644 index 00000000..98490508 Binary files /dev/null and b/data/iw7/3477.gscbin differ diff --git a/data/iw7/3479.gscbin b/data/iw7/3479.gscbin new file mode 100644 index 00000000..893217a2 Binary files /dev/null and b/data/iw7/3479.gscbin differ diff --git a/data/iw7/3480.gscbin b/data/iw7/3480.gscbin new file mode 100644 index 00000000..a1ced47b Binary files /dev/null and b/data/iw7/3480.gscbin differ diff --git a/data/iw7/3481.gscbin b/data/iw7/3481.gscbin new file mode 100644 index 00000000..7116e394 Binary files /dev/null and b/data/iw7/3481.gscbin differ diff --git a/data/iw7/3482.gscbin b/data/iw7/3482.gscbin new file mode 100644 index 00000000..6bbfa413 Binary files /dev/null and b/data/iw7/3482.gscbin differ diff --git a/data/iw7/3483.gscbin b/data/iw7/3483.gscbin new file mode 100644 index 00000000..1b3a522a Binary files /dev/null and b/data/iw7/3483.gscbin differ diff --git a/data/iw7/3485.gscbin b/data/iw7/3485.gscbin new file mode 100644 index 00000000..669f176c Binary files /dev/null and b/data/iw7/3485.gscbin differ diff --git a/data/iw7/3486.gscbin b/data/iw7/3486.gscbin new file mode 100644 index 00000000..c26a3af9 Binary files /dev/null and b/data/iw7/3486.gscbin differ diff --git a/data/iw7/3487.gscbin b/data/iw7/3487.gscbin new file mode 100644 index 00000000..0c80e78d Binary files /dev/null and b/data/iw7/3487.gscbin differ diff --git a/data/iw7/3488.gscbin b/data/iw7/3488.gscbin new file mode 100644 index 00000000..89d5299c Binary files /dev/null and b/data/iw7/3488.gscbin differ diff --git a/data/iw7/3489.gscbin b/data/iw7/3489.gscbin new file mode 100644 index 00000000..9e549b85 Binary files /dev/null and b/data/iw7/3489.gscbin differ diff --git a/data/iw7/3490.gscbin b/data/iw7/3490.gscbin new file mode 100644 index 00000000..6e8efdd9 Binary files /dev/null and b/data/iw7/3490.gscbin differ diff --git a/data/iw7/3491.gscbin b/data/iw7/3491.gscbin new file mode 100644 index 00000000..7407f5da Binary files /dev/null and b/data/iw7/3491.gscbin differ diff --git a/data/iw7/3492.gscbin b/data/iw7/3492.gscbin new file mode 100644 index 00000000..79d9aafd Binary files /dev/null and b/data/iw7/3492.gscbin differ diff --git a/data/iw7/3493.gscbin b/data/iw7/3493.gscbin new file mode 100644 index 00000000..3b08d248 Binary files /dev/null and b/data/iw7/3493.gscbin differ diff --git a/data/iw7/3494.gscbin b/data/iw7/3494.gscbin new file mode 100644 index 00000000..0a8beecc Binary files /dev/null and b/data/iw7/3494.gscbin differ diff --git a/data/iw7/3495.gscbin b/data/iw7/3495.gscbin new file mode 100644 index 00000000..986a0c76 Binary files /dev/null and b/data/iw7/3495.gscbin differ diff --git a/data/iw7/3496.gscbin b/data/iw7/3496.gscbin new file mode 100644 index 00000000..8329805d Binary files /dev/null and b/data/iw7/3496.gscbin differ diff --git a/data/iw7/3497.gscbin b/data/iw7/3497.gscbin new file mode 100644 index 00000000..95e266b2 Binary files /dev/null and b/data/iw7/3497.gscbin differ diff --git a/data/iw7/3498.gscbin b/data/iw7/3498.gscbin new file mode 100644 index 00000000..ba757b30 Binary files /dev/null and b/data/iw7/3498.gscbin differ diff --git a/data/iw7/3500.gscbin b/data/iw7/3500.gscbin new file mode 100644 index 00000000..b8d5d963 Binary files /dev/null and b/data/iw7/3500.gscbin differ diff --git a/data/iw7/3501.gscbin b/data/iw7/3501.gscbin new file mode 100644 index 00000000..cf922283 Binary files /dev/null and b/data/iw7/3501.gscbin differ diff --git a/data/iw7/3502.gscbin b/data/iw7/3502.gscbin new file mode 100644 index 00000000..0ca3cd94 Binary files /dev/null and b/data/iw7/3502.gscbin differ diff --git a/data/iw7/3503.gscbin b/data/iw7/3503.gscbin new file mode 100644 index 00000000..ce6f6da7 Binary files /dev/null and b/data/iw7/3503.gscbin differ diff --git a/data/iw7/3504.gscbin b/data/iw7/3504.gscbin new file mode 100644 index 00000000..d3b13d30 Binary files /dev/null and b/data/iw7/3504.gscbin differ diff --git a/data/iw7/3505.gscbin b/data/iw7/3505.gscbin new file mode 100644 index 00000000..cc674e9c Binary files /dev/null and b/data/iw7/3505.gscbin differ diff --git a/data/iw7/3506.gscbin b/data/iw7/3506.gscbin new file mode 100644 index 00000000..ea64d002 Binary files /dev/null and b/data/iw7/3506.gscbin differ diff --git a/data/iw7/3507.gscbin b/data/iw7/3507.gscbin new file mode 100644 index 00000000..701a1edf Binary files /dev/null and b/data/iw7/3507.gscbin differ diff --git a/data/iw7/3508.gscbin b/data/iw7/3508.gscbin new file mode 100644 index 00000000..e0491ed4 Binary files /dev/null and b/data/iw7/3508.gscbin differ diff --git a/data/iw7/3510.gscbin b/data/iw7/3510.gscbin new file mode 100644 index 00000000..fe8b2bc8 Binary files /dev/null and b/data/iw7/3510.gscbin differ diff --git a/data/iw7/3511.gscbin b/data/iw7/3511.gscbin new file mode 100644 index 00000000..8b7810ec Binary files /dev/null and b/data/iw7/3511.gscbin differ diff --git a/data/iw7/3512.gscbin b/data/iw7/3512.gscbin new file mode 100644 index 00000000..00e1f658 Binary files /dev/null and b/data/iw7/3512.gscbin differ diff --git a/data/iw7/3513.gscbin b/data/iw7/3513.gscbin new file mode 100644 index 00000000..31f96f02 Binary files /dev/null and b/data/iw7/3513.gscbin differ diff --git a/data/iw7/3514.gscbin b/data/iw7/3514.gscbin new file mode 100644 index 00000000..81ec7132 Binary files /dev/null and b/data/iw7/3514.gscbin differ diff --git a/data/iw7/3515.gscbin b/data/iw7/3515.gscbin new file mode 100644 index 00000000..abbf0575 Binary files /dev/null and b/data/iw7/3515.gscbin differ diff --git a/data/iw7/3516.gscbin b/data/iw7/3516.gscbin new file mode 100644 index 00000000..c18e99dd Binary files /dev/null and b/data/iw7/3516.gscbin differ diff --git a/data/iw7/3517.gscbin b/data/iw7/3517.gscbin new file mode 100644 index 00000000..1319bd41 Binary files /dev/null and b/data/iw7/3517.gscbin differ diff --git a/data/iw7/3518.gscbin b/data/iw7/3518.gscbin new file mode 100644 index 00000000..2a449986 Binary files /dev/null and b/data/iw7/3518.gscbin differ diff --git a/data/iw7/3520.gscbin b/data/iw7/3520.gscbin new file mode 100644 index 00000000..a27162bf Binary files /dev/null and b/data/iw7/3520.gscbin differ diff --git a/data/iw7/3521.gscbin b/data/iw7/3521.gscbin new file mode 100644 index 00000000..8d074023 Binary files /dev/null and b/data/iw7/3521.gscbin differ diff --git a/data/iw7/3522.gscbin b/data/iw7/3522.gscbin new file mode 100644 index 00000000..758387eb Binary files /dev/null and b/data/iw7/3522.gscbin differ diff --git a/data/iw7/3523.gscbin b/data/iw7/3523.gscbin new file mode 100644 index 00000000..2810a45e Binary files /dev/null and b/data/iw7/3523.gscbin differ diff --git a/data/iw7/3524.gscbin b/data/iw7/3524.gscbin new file mode 100644 index 00000000..60145410 Binary files /dev/null and b/data/iw7/3524.gscbin differ diff --git a/data/iw7/3525.gscbin b/data/iw7/3525.gscbin new file mode 100644 index 00000000..7d6de8bd Binary files /dev/null and b/data/iw7/3525.gscbin differ diff --git a/data/iw7/3526.gscbin b/data/iw7/3526.gscbin new file mode 100644 index 00000000..cbccba95 Binary files /dev/null and b/data/iw7/3526.gscbin differ diff --git a/data/iw7/3527.gscbin b/data/iw7/3527.gscbin new file mode 100644 index 00000000..21313fef Binary files /dev/null and b/data/iw7/3527.gscbin differ diff --git a/data/iw7/3528.gscbin b/data/iw7/3528.gscbin new file mode 100644 index 00000000..5c554360 Binary files /dev/null and b/data/iw7/3528.gscbin differ diff --git a/data/iw7/3529.gscbin b/data/iw7/3529.gscbin new file mode 100644 index 00000000..25bbbd92 Binary files /dev/null and b/data/iw7/3529.gscbin differ diff --git a/data/iw7/3530.gscbin b/data/iw7/3530.gscbin new file mode 100644 index 00000000..9902f413 Binary files /dev/null and b/data/iw7/3530.gscbin differ diff --git a/data/iw7/3531.gscbin b/data/iw7/3531.gscbin new file mode 100644 index 00000000..7801e97a Binary files /dev/null and b/data/iw7/3531.gscbin differ diff --git a/data/iw7/3533.gscbin b/data/iw7/3533.gscbin new file mode 100644 index 00000000..5efc9c7f Binary files /dev/null and b/data/iw7/3533.gscbin differ diff --git a/data/iw7/3534.gscbin b/data/iw7/3534.gscbin new file mode 100644 index 00000000..e37dfb23 Binary files /dev/null and b/data/iw7/3534.gscbin differ diff --git a/data/iw7/3535.gscbin b/data/iw7/3535.gscbin new file mode 100644 index 00000000..c2513fca Binary files /dev/null and b/data/iw7/3535.gscbin differ diff --git a/data/iw7/3536.gscbin b/data/iw7/3536.gscbin new file mode 100644 index 00000000..12b393ee Binary files /dev/null and b/data/iw7/3536.gscbin differ diff --git a/data/iw7/3537.gscbin b/data/iw7/3537.gscbin new file mode 100644 index 00000000..ab6edfb5 Binary files /dev/null and b/data/iw7/3537.gscbin differ diff --git a/data/iw7/3538.gscbin b/data/iw7/3538.gscbin new file mode 100644 index 00000000..8b843557 Binary files /dev/null and b/data/iw7/3538.gscbin differ diff --git a/data/iw7/3539.gscbin b/data/iw7/3539.gscbin new file mode 100644 index 00000000..b57ed48f Binary files /dev/null and b/data/iw7/3539.gscbin differ diff --git a/data/iw7/3540.gscbin b/data/iw7/3540.gscbin new file mode 100644 index 00000000..f6f9be3f Binary files /dev/null and b/data/iw7/3540.gscbin differ diff --git a/data/iw7/3541.gscbin b/data/iw7/3541.gscbin new file mode 100644 index 00000000..5cbba0af Binary files /dev/null and b/data/iw7/3541.gscbin differ diff --git a/data/iw7/3543.gscbin b/data/iw7/3543.gscbin new file mode 100644 index 00000000..ac8bfa42 Binary files /dev/null and b/data/iw7/3543.gscbin differ diff --git a/data/iw7/3544.gscbin b/data/iw7/3544.gscbin new file mode 100644 index 00000000..7b39930b Binary files /dev/null and b/data/iw7/3544.gscbin differ diff --git a/data/iw7/3545.gscbin b/data/iw7/3545.gscbin new file mode 100644 index 00000000..940be1d1 Binary files /dev/null and b/data/iw7/3545.gscbin differ diff --git a/data/iw7/3546.gscbin b/data/iw7/3546.gscbin new file mode 100644 index 00000000..ca72c8c2 Binary files /dev/null and b/data/iw7/3546.gscbin differ diff --git a/data/iw7/3547.gscbin b/data/iw7/3547.gscbin new file mode 100644 index 00000000..9552d3ad Binary files /dev/null and b/data/iw7/3547.gscbin differ diff --git a/data/iw7/3549.gscbin b/data/iw7/3549.gscbin new file mode 100644 index 00000000..ea3bda66 Binary files /dev/null and b/data/iw7/3549.gscbin differ diff --git a/data/iw7/3550.gscbin b/data/iw7/3550.gscbin new file mode 100644 index 00000000..08a48779 Binary files /dev/null and b/data/iw7/3550.gscbin differ diff --git a/data/iw7/3551.gscbin b/data/iw7/3551.gscbin new file mode 100644 index 00000000..e765245b Binary files /dev/null and b/data/iw7/3551.gscbin differ diff --git a/data/iw7/3552.gscbin b/data/iw7/3552.gscbin new file mode 100644 index 00000000..1ba7718a Binary files /dev/null and b/data/iw7/3552.gscbin differ diff --git a/data/iw7/3553.gscbin b/data/iw7/3553.gscbin new file mode 100644 index 00000000..dd238490 Binary files /dev/null and b/data/iw7/3553.gscbin differ diff --git a/data/iw7/3555.gscbin b/data/iw7/3555.gscbin new file mode 100644 index 00000000..293d2c6b Binary files /dev/null and b/data/iw7/3555.gscbin differ diff --git a/data/iw7/3556.gscbin b/data/iw7/3556.gscbin new file mode 100644 index 00000000..d0c9ed5b Binary files /dev/null and b/data/iw7/3556.gscbin differ diff --git a/data/iw7/3557.gscbin b/data/iw7/3557.gscbin new file mode 100644 index 00000000..8fd44e82 Binary files /dev/null and b/data/iw7/3557.gscbin differ diff --git a/data/iw7/3558.gscbin b/data/iw7/3558.gscbin new file mode 100644 index 00000000..67e77535 Binary files /dev/null and b/data/iw7/3558.gscbin differ diff --git a/data/iw7/3559.gscbin b/data/iw7/3559.gscbin new file mode 100644 index 00000000..e210d7d2 Binary files /dev/null and b/data/iw7/3559.gscbin differ diff --git a/data/iw7/3560.gscbin b/data/iw7/3560.gscbin new file mode 100644 index 00000000..661a3441 Binary files /dev/null and b/data/iw7/3560.gscbin differ diff --git a/data/iw7/3561.gscbin b/data/iw7/3561.gscbin new file mode 100644 index 00000000..412f061a Binary files /dev/null and b/data/iw7/3561.gscbin differ diff --git a/data/iw7/3562.gscbin b/data/iw7/3562.gscbin new file mode 100644 index 00000000..20395063 Binary files /dev/null and b/data/iw7/3562.gscbin differ diff --git a/data/iw7/3563.gscbin b/data/iw7/3563.gscbin new file mode 100644 index 00000000..ef3a3413 Binary files /dev/null and b/data/iw7/3563.gscbin differ diff --git a/data/iw7/3565.gscbin b/data/iw7/3565.gscbin new file mode 100644 index 00000000..4ff15a86 Binary files /dev/null and b/data/iw7/3565.gscbin differ diff --git a/data/iw7/3568.gscbin b/data/iw7/3568.gscbin new file mode 100644 index 00000000..04792947 Binary files /dev/null and b/data/iw7/3568.gscbin differ diff --git a/data/iw7/3569.gscbin b/data/iw7/3569.gscbin new file mode 100644 index 00000000..d9cf70bc Binary files /dev/null and b/data/iw7/3569.gscbin differ diff --git a/data/iw7/3570.gscbin b/data/iw7/3570.gscbin new file mode 100644 index 00000000..c79dc7e9 Binary files /dev/null and b/data/iw7/3570.gscbin differ diff --git a/data/iw7/3571.gscbin b/data/iw7/3571.gscbin new file mode 100644 index 00000000..b6cc5e45 Binary files /dev/null and b/data/iw7/3571.gscbin differ diff --git a/data/iw7/3573.gscbin b/data/iw7/3573.gscbin new file mode 100644 index 00000000..b5c52b57 Binary files /dev/null and b/data/iw7/3573.gscbin differ diff --git a/data/iw7/3574.gscbin b/data/iw7/3574.gscbin new file mode 100644 index 00000000..86598506 Binary files /dev/null and b/data/iw7/3574.gscbin differ diff --git a/data/iw7/3575.gscbin b/data/iw7/3575.gscbin new file mode 100644 index 00000000..2a1d6a8a Binary files /dev/null and b/data/iw7/3575.gscbin differ diff --git a/data/iw7/3576.gscbin b/data/iw7/3576.gscbin new file mode 100644 index 00000000..377d9815 Binary files /dev/null and b/data/iw7/3576.gscbin differ diff --git a/data/iw7/3577.gscbin b/data/iw7/3577.gscbin new file mode 100644 index 00000000..a8177350 Binary files /dev/null and b/data/iw7/3577.gscbin differ diff --git a/data/iw7/3578.gscbin b/data/iw7/3578.gscbin new file mode 100644 index 00000000..490411d7 Binary files /dev/null and b/data/iw7/3578.gscbin differ diff --git a/data/iw7/3579.gscbin b/data/iw7/3579.gscbin new file mode 100644 index 00000000..e8b055c7 Binary files /dev/null and b/data/iw7/3579.gscbin differ diff --git a/data/iw7/3580.gscbin b/data/iw7/3580.gscbin new file mode 100644 index 00000000..c661033f Binary files /dev/null and b/data/iw7/3580.gscbin differ diff --git a/data/iw7/3582.gscbin b/data/iw7/3582.gscbin new file mode 100644 index 00000000..6352783d Binary files /dev/null and b/data/iw7/3582.gscbin differ diff --git a/data/iw7/3584.gscbin b/data/iw7/3584.gscbin new file mode 100644 index 00000000..69b2d52f Binary files /dev/null and b/data/iw7/3584.gscbin differ diff --git a/data/iw7/3585.gscbin b/data/iw7/3585.gscbin new file mode 100644 index 00000000..7cc68020 Binary files /dev/null and b/data/iw7/3585.gscbin differ diff --git a/data/iw7/3586.gscbin b/data/iw7/3586.gscbin new file mode 100644 index 00000000..2bd6e9e9 Binary files /dev/null and b/data/iw7/3586.gscbin differ diff --git a/data/iw7/3589.gscbin b/data/iw7/3589.gscbin new file mode 100644 index 00000000..6be05184 Binary files /dev/null and b/data/iw7/3589.gscbin differ diff --git a/data/iw7/3590.gscbin b/data/iw7/3590.gscbin new file mode 100644 index 00000000..8eb0cbda Binary files /dev/null and b/data/iw7/3590.gscbin differ diff --git a/data/iw7/3591.gscbin b/data/iw7/3591.gscbin new file mode 100644 index 00000000..2a4fb862 Binary files /dev/null and b/data/iw7/3591.gscbin differ diff --git a/data/iw7/3592.gscbin b/data/iw7/3592.gscbin new file mode 100644 index 00000000..69f1bfc8 Binary files /dev/null and b/data/iw7/3592.gscbin differ diff --git a/data/iw7/3593.gscbin b/data/iw7/3593.gscbin new file mode 100644 index 00000000..8fc0fe49 Binary files /dev/null and b/data/iw7/3593.gscbin differ diff --git a/data/iw7/3594.gscbin b/data/iw7/3594.gscbin new file mode 100644 index 00000000..d7258e3a Binary files /dev/null and b/data/iw7/3594.gscbin differ diff --git a/data/iw7/3595.gscbin b/data/iw7/3595.gscbin new file mode 100644 index 00000000..764ab320 Binary files /dev/null and b/data/iw7/3595.gscbin differ diff --git a/data/iw7/3596.gscbin b/data/iw7/3596.gscbin new file mode 100644 index 00000000..6206f301 Binary files /dev/null and b/data/iw7/3596.gscbin differ diff --git a/data/iw7/3597.gscbin b/data/iw7/3597.gscbin new file mode 100644 index 00000000..81d6c8df Binary files /dev/null and b/data/iw7/3597.gscbin differ diff --git a/data/iw7/3598.gscbin b/data/iw7/3598.gscbin new file mode 100644 index 00000000..def6830a Binary files /dev/null and b/data/iw7/3598.gscbin differ diff --git a/data/iw7/3599.gscbin b/data/iw7/3599.gscbin new file mode 100644 index 00000000..51f7fadc Binary files /dev/null and b/data/iw7/3599.gscbin differ diff --git a/data/iw7/3602.gscbin b/data/iw7/3602.gscbin new file mode 100644 index 00000000..b580b334 Binary files /dev/null and b/data/iw7/3602.gscbin differ diff --git a/data/iw7/3604.gscbin b/data/iw7/3604.gscbin new file mode 100644 index 00000000..06bd668c Binary files /dev/null and b/data/iw7/3604.gscbin differ diff --git a/data/iw7/3606.gscbin b/data/iw7/3606.gscbin new file mode 100644 index 00000000..39b8297e Binary files /dev/null and b/data/iw7/3606.gscbin differ diff --git a/data/iw7/3607.gscbin b/data/iw7/3607.gscbin new file mode 100644 index 00000000..c22cff5d Binary files /dev/null and b/data/iw7/3607.gscbin differ diff --git a/data/iw7/3609.gscbin b/data/iw7/3609.gscbin new file mode 100644 index 00000000..f353cc6e Binary files /dev/null and b/data/iw7/3609.gscbin differ diff --git a/data/iw7/3611.gscbin b/data/iw7/3611.gscbin new file mode 100644 index 00000000..6901e793 Binary files /dev/null and b/data/iw7/3611.gscbin differ diff --git a/data/iw7/3896.gscbin b/data/iw7/3896.gscbin new file mode 100644 index 00000000..71fa7ebe Binary files /dev/null and b/data/iw7/3896.gscbin differ diff --git a/data/iw7/3897.gscbin b/data/iw7/3897.gscbin new file mode 100644 index 00000000..c9fb59a0 Binary files /dev/null and b/data/iw7/3897.gscbin differ diff --git a/data/iw7/3900.gscbin b/data/iw7/3900.gscbin new file mode 100644 index 00000000..ab96f0a3 Binary files /dev/null and b/data/iw7/3900.gscbin differ diff --git a/data/iw7/3950.gscbin b/data/iw7/3950.gscbin new file mode 100644 index 00000000..6ed10b9a Binary files /dev/null and b/data/iw7/3950.gscbin differ diff --git a/data/iw7/4009.gscbin b/data/iw7/4009.gscbin new file mode 100644 index 00000000..8d3aaace Binary files /dev/null and b/data/iw7/4009.gscbin differ diff --git a/data/iw7/4010.gscbin b/data/iw7/4010.gscbin new file mode 100644 index 00000000..67c0f38d Binary files /dev/null and b/data/iw7/4010.gscbin differ diff --git a/data/iw7/4307.gscbin b/data/iw7/4307.gscbin new file mode 100644 index 00000000..ffb41657 Binary files /dev/null and b/data/iw7/4307.gscbin differ diff --git a/data/iw7/5.gscbin b/data/iw7/5.gscbin new file mode 100644 index 00000000..223f2905 Binary files /dev/null and b/data/iw7/5.gscbin differ diff --git a/data/iw7/6.gscbin b/data/iw7/6.gscbin new file mode 100644 index 00000000..904ef873 Binary files /dev/null and b/data/iw7/6.gscbin differ diff --git a/data/iw7/7.gscbin b/data/iw7/7.gscbin new file mode 100644 index 00000000..4978c4d9 Binary files /dev/null and b/data/iw7/7.gscbin differ diff --git a/data/iw7/8.gscbin b/data/iw7/8.gscbin new file mode 100644 index 00000000..e011a1d4 Binary files /dev/null and b/data/iw7/8.gscbin differ diff --git a/data/iw7/9.gscbin b/data/iw7/9.gscbin new file mode 100644 index 00000000..68094560 Binary files /dev/null and b/data/iw7/9.gscbin differ diff --git a/data/iw7/945.gscbin b/data/iw7/945.gscbin new file mode 100644 index 00000000..fdaa4a2c Binary files /dev/null and b/data/iw7/945.gscbin differ diff --git a/data/iw7/anim/saw/common.gscbin b/data/iw7/anim/saw/common.gscbin new file mode 100644 index 00000000..ad7a2921 Binary files /dev/null and b/data/iw7/anim/saw/common.gscbin differ diff --git a/data/iw7/anim/saw/crouch.gscbin b/data/iw7/anim/saw/crouch.gscbin new file mode 100644 index 00000000..9106a90a Binary files /dev/null and b/data/iw7/anim/saw/crouch.gscbin differ diff --git a/data/iw7/anim/saw/prone.gscbin b/data/iw7/anim/saw/prone.gscbin new file mode 100644 index 00000000..4fedf558 Binary files /dev/null and b/data/iw7/anim/saw/prone.gscbin differ diff --git a/data/iw7/anim/saw/stand.gscbin b/data/iw7/anim/saw/stand.gscbin new file mode 100644 index 00000000..ea20f6b0 Binary files /dev/null and b/data/iw7/anim/saw/stand.gscbin differ diff --git a/data/iw7/anim/utility_common.gscbin b/data/iw7/anim/utility_common.gscbin new file mode 100644 index 00000000..9270bb66 Binary files /dev/null and b/data/iw7/anim/utility_common.gscbin differ diff --git a/data/iw7/mp/agents/gametype_assault.gscbin b/data/iw7/mp/agents/gametype_assault.gscbin new file mode 100644 index 00000000..8da038e7 Binary files /dev/null and b/data/iw7/mp/agents/gametype_assault.gscbin differ diff --git a/data/iw7/mp/agents/gametype_ball.gscbin b/data/iw7/mp/agents/gametype_ball.gscbin new file mode 100644 index 00000000..938afa5d Binary files /dev/null and b/data/iw7/mp/agents/gametype_ball.gscbin differ diff --git a/data/iw7/mp/agents/gametype_conf.gscbin b/data/iw7/mp/agents/gametype_conf.gscbin new file mode 100644 index 00000000..cd3bd3a1 Binary files /dev/null and b/data/iw7/mp/agents/gametype_conf.gscbin differ diff --git a/data/iw7/mp/agents/gametype_cranked.gscbin b/data/iw7/mp/agents/gametype_cranked.gscbin new file mode 100644 index 00000000..fd8f9bf6 Binary files /dev/null and b/data/iw7/mp/agents/gametype_cranked.gscbin differ diff --git a/data/iw7/mp/agents/gametype_ctf.gscbin b/data/iw7/mp/agents/gametype_ctf.gscbin new file mode 100644 index 00000000..fc105cee Binary files /dev/null and b/data/iw7/mp/agents/gametype_ctf.gscbin differ diff --git a/data/iw7/mp/agents/gametype_dd.gscbin b/data/iw7/mp/agents/gametype_dd.gscbin new file mode 100644 index 00000000..54eaba8f Binary files /dev/null and b/data/iw7/mp/agents/gametype_dd.gscbin differ diff --git a/data/iw7/mp/agents/gametype_dm.gscbin b/data/iw7/mp/agents/gametype_dm.gscbin new file mode 100644 index 00000000..801ffdfc Binary files /dev/null and b/data/iw7/mp/agents/gametype_dm.gscbin differ diff --git a/data/iw7/mp/agents/gametype_dom.gscbin b/data/iw7/mp/agents/gametype_dom.gscbin new file mode 100644 index 00000000..14467a63 Binary files /dev/null and b/data/iw7/mp/agents/gametype_dom.gscbin differ diff --git a/data/iw7/mp/agents/gametype_front.gscbin b/data/iw7/mp/agents/gametype_front.gscbin new file mode 100644 index 00000000..e9932057 Binary files /dev/null and b/data/iw7/mp/agents/gametype_front.gscbin differ diff --git a/data/iw7/mp/agents/gametype_grind.gscbin b/data/iw7/mp/agents/gametype_grind.gscbin new file mode 100644 index 00000000..34294584 Binary files /dev/null and b/data/iw7/mp/agents/gametype_grind.gscbin differ diff --git a/data/iw7/mp/agents/gametype_grnd.gscbin b/data/iw7/mp/agents/gametype_grnd.gscbin new file mode 100644 index 00000000..a832e17a Binary files /dev/null and b/data/iw7/mp/agents/gametype_grnd.gscbin differ diff --git a/data/iw7/mp/agents/gametype_gun.gscbin b/data/iw7/mp/agents/gametype_gun.gscbin new file mode 100644 index 00000000..af75489f Binary files /dev/null and b/data/iw7/mp/agents/gametype_gun.gscbin differ diff --git a/data/iw7/mp/agents/gametype_infect.gscbin b/data/iw7/mp/agents/gametype_infect.gscbin new file mode 100644 index 00000000..4d7492b8 Binary files /dev/null and b/data/iw7/mp/agents/gametype_infect.gscbin differ diff --git a/data/iw7/mp/agents/gametype_koth.gscbin b/data/iw7/mp/agents/gametype_koth.gscbin new file mode 100644 index 00000000..16fbc0aa Binary files /dev/null and b/data/iw7/mp/agents/gametype_koth.gscbin differ diff --git a/data/iw7/mp/agents/gametype_lava.gscbin b/data/iw7/mp/agents/gametype_lava.gscbin new file mode 100644 index 00000000..8c8bcd15 Binary files /dev/null and b/data/iw7/mp/agents/gametype_lava.gscbin differ diff --git a/data/iw7/mp/agents/gametype_mp_zomb.gscbin b/data/iw7/mp/agents/gametype_mp_zomb.gscbin new file mode 100644 index 00000000..f6e85a63 Binary files /dev/null and b/data/iw7/mp/agents/gametype_mp_zomb.gscbin differ diff --git a/data/iw7/mp/agents/gametype_mugger.gscbin b/data/iw7/mp/agents/gametype_mugger.gscbin new file mode 100644 index 00000000..871f0153 Binary files /dev/null and b/data/iw7/mp/agents/gametype_mugger.gscbin differ diff --git a/data/iw7/mp/agents/gametype_sd.gscbin b/data/iw7/mp/agents/gametype_sd.gscbin new file mode 100644 index 00000000..e6231f04 Binary files /dev/null and b/data/iw7/mp/agents/gametype_sd.gscbin differ diff --git a/data/iw7/mp/agents/gametype_siege.gscbin b/data/iw7/mp/agents/gametype_siege.gscbin new file mode 100644 index 00000000..5a66ca23 Binary files /dev/null and b/data/iw7/mp/agents/gametype_siege.gscbin differ diff --git a/data/iw7/mp/agents/gametype_sotf.gscbin b/data/iw7/mp/agents/gametype_sotf.gscbin new file mode 100644 index 00000000..f075f3ab Binary files /dev/null and b/data/iw7/mp/agents/gametype_sotf.gscbin differ diff --git a/data/iw7/mp/agents/gametype_sotf_ffa.gscbin b/data/iw7/mp/agents/gametype_sotf_ffa.gscbin new file mode 100644 index 00000000..85265733 Binary files /dev/null and b/data/iw7/mp/agents/gametype_sotf_ffa.gscbin differ diff --git a/data/iw7/mp/agents/gametype_sr.gscbin b/data/iw7/mp/agents/gametype_sr.gscbin new file mode 100644 index 00000000..c851a94a Binary files /dev/null and b/data/iw7/mp/agents/gametype_sr.gscbin differ diff --git a/data/iw7/mp/agents/gametype_tdef.gscbin b/data/iw7/mp/agents/gametype_tdef.gscbin new file mode 100644 index 00000000..e0647d13 Binary files /dev/null and b/data/iw7/mp/agents/gametype_tdef.gscbin differ diff --git a/data/iw7/mp/agents/gametype_war.gscbin b/data/iw7/mp/agents/gametype_war.gscbin new file mode 100644 index 00000000..67f31596 Binary files /dev/null and b/data/iw7/mp/agents/gametype_war.gscbin differ diff --git a/data/iw7/mp/archetypes/archassassin_utility.gscbin b/data/iw7/mp/archetypes/archassassin_utility.gscbin new file mode 100644 index 00000000..38e461d7 Binary files /dev/null and b/data/iw7/mp/archetypes/archassassin_utility.gscbin differ diff --git a/data/iw7/mp/bcs_location_trigs.gscbin b/data/iw7/mp/bcs_location_trigs.gscbin new file mode 100644 index 00000000..1ccf5591 Binary files /dev/null and b/data/iw7/mp/bcs_location_trigs.gscbin differ diff --git a/data/iw7/mp/bots/gametype_assault.gscbin b/data/iw7/mp/bots/gametype_assault.gscbin new file mode 100644 index 00000000..4a874919 Binary files /dev/null and b/data/iw7/mp/bots/gametype_assault.gscbin differ diff --git a/data/iw7/mp/bots/gametype_ball.gscbin b/data/iw7/mp/bots/gametype_ball.gscbin new file mode 100644 index 00000000..3fb149b0 Binary files /dev/null and b/data/iw7/mp/bots/gametype_ball.gscbin differ diff --git a/data/iw7/mp/bots/gametype_conf.gscbin b/data/iw7/mp/bots/gametype_conf.gscbin new file mode 100644 index 00000000..efc940c9 Binary files /dev/null and b/data/iw7/mp/bots/gametype_conf.gscbin differ diff --git a/data/iw7/mp/bots/gametype_cranked.gscbin b/data/iw7/mp/bots/gametype_cranked.gscbin new file mode 100644 index 00000000..8c2eff24 Binary files /dev/null and b/data/iw7/mp/bots/gametype_cranked.gscbin differ diff --git a/data/iw7/mp/bots/gametype_ctf.gscbin b/data/iw7/mp/bots/gametype_ctf.gscbin new file mode 100644 index 00000000..2ffe9701 Binary files /dev/null and b/data/iw7/mp/bots/gametype_ctf.gscbin differ diff --git a/data/iw7/mp/bots/gametype_dd.gscbin b/data/iw7/mp/bots/gametype_dd.gscbin new file mode 100644 index 00000000..1de3adfb Binary files /dev/null and b/data/iw7/mp/bots/gametype_dd.gscbin differ diff --git a/data/iw7/mp/bots/gametype_dm.gscbin b/data/iw7/mp/bots/gametype_dm.gscbin new file mode 100644 index 00000000..a83c585b Binary files /dev/null and b/data/iw7/mp/bots/gametype_dm.gscbin differ diff --git a/data/iw7/mp/bots/gametype_dom.gscbin b/data/iw7/mp/bots/gametype_dom.gscbin new file mode 100644 index 00000000..63122696 Binary files /dev/null and b/data/iw7/mp/bots/gametype_dom.gscbin differ diff --git a/data/iw7/mp/bots/gametype_front.gscbin b/data/iw7/mp/bots/gametype_front.gscbin new file mode 100644 index 00000000..9a441330 Binary files /dev/null and b/data/iw7/mp/bots/gametype_front.gscbin differ diff --git a/data/iw7/mp/bots/gametype_grind.gscbin b/data/iw7/mp/bots/gametype_grind.gscbin new file mode 100644 index 00000000..5236f67b Binary files /dev/null and b/data/iw7/mp/bots/gametype_grind.gscbin differ diff --git a/data/iw7/mp/bots/gametype_grnd.gscbin b/data/iw7/mp/bots/gametype_grnd.gscbin new file mode 100644 index 00000000..eb61214f Binary files /dev/null and b/data/iw7/mp/bots/gametype_grnd.gscbin differ diff --git a/data/iw7/mp/bots/gametype_gun.gscbin b/data/iw7/mp/bots/gametype_gun.gscbin new file mode 100644 index 00000000..030a9e9c Binary files /dev/null and b/data/iw7/mp/bots/gametype_gun.gscbin differ diff --git a/data/iw7/mp/bots/gametype_infect.gscbin b/data/iw7/mp/bots/gametype_infect.gscbin new file mode 100644 index 00000000..67f719f6 Binary files /dev/null and b/data/iw7/mp/bots/gametype_infect.gscbin differ diff --git a/data/iw7/mp/bots/gametype_koth.gscbin b/data/iw7/mp/bots/gametype_koth.gscbin new file mode 100644 index 00000000..cf63db5c Binary files /dev/null and b/data/iw7/mp/bots/gametype_koth.gscbin differ diff --git a/data/iw7/mp/bots/gametype_lava.gscbin b/data/iw7/mp/bots/gametype_lava.gscbin new file mode 100644 index 00000000..16844b0e Binary files /dev/null and b/data/iw7/mp/bots/gametype_lava.gscbin differ diff --git a/data/iw7/mp/bots/gametype_mp_zomb.gscbin b/data/iw7/mp/bots/gametype_mp_zomb.gscbin new file mode 100644 index 00000000..fb8cefaa Binary files /dev/null and b/data/iw7/mp/bots/gametype_mp_zomb.gscbin differ diff --git a/data/iw7/mp/bots/gametype_mugger.gscbin b/data/iw7/mp/bots/gametype_mugger.gscbin new file mode 100644 index 00000000..2c8eb77c Binary files /dev/null and b/data/iw7/mp/bots/gametype_mugger.gscbin differ diff --git a/data/iw7/mp/bots/gametype_sd.gscbin b/data/iw7/mp/bots/gametype_sd.gscbin new file mode 100644 index 00000000..c189be76 Binary files /dev/null and b/data/iw7/mp/bots/gametype_sd.gscbin differ diff --git a/data/iw7/mp/bots/gametype_siege.gscbin b/data/iw7/mp/bots/gametype_siege.gscbin new file mode 100644 index 00000000..c85c98c9 Binary files /dev/null and b/data/iw7/mp/bots/gametype_siege.gscbin differ diff --git a/data/iw7/mp/bots/gametype_sotf.gscbin b/data/iw7/mp/bots/gametype_sotf.gscbin new file mode 100644 index 00000000..d2c5905b Binary files /dev/null and b/data/iw7/mp/bots/gametype_sotf.gscbin differ diff --git a/data/iw7/mp/bots/gametype_sotf_ffa.gscbin b/data/iw7/mp/bots/gametype_sotf_ffa.gscbin new file mode 100644 index 00000000..900a60b5 Binary files /dev/null and b/data/iw7/mp/bots/gametype_sotf_ffa.gscbin differ diff --git a/data/iw7/mp/bots/gametype_sr.gscbin b/data/iw7/mp/bots/gametype_sr.gscbin new file mode 100644 index 00000000..9e5d445d Binary files /dev/null and b/data/iw7/mp/bots/gametype_sr.gscbin differ diff --git a/data/iw7/mp/bots/gametype_tdef.gscbin b/data/iw7/mp/bots/gametype_tdef.gscbin new file mode 100644 index 00000000..539c160e Binary files /dev/null and b/data/iw7/mp/bots/gametype_tdef.gscbin differ diff --git a/data/iw7/mp/bots/gametype_war.gscbin b/data/iw7/mp/bots/gametype_war.gscbin new file mode 100644 index 00000000..05f6c75a Binary files /dev/null and b/data/iw7/mp/bots/gametype_war.gscbin differ diff --git a/data/iw7/mp/broshot_utilities.gscbin b/data/iw7/mp/broshot_utilities.gscbin new file mode 100644 index 00000000..06e839fc Binary files /dev/null and b/data/iw7/mp/broshot_utilities.gscbin differ diff --git a/data/iw7/mp/contractchallenges.gscbin b/data/iw7/mp/contractchallenges.gscbin new file mode 100644 index 00000000..8086164f Binary files /dev/null and b/data/iw7/mp/contractchallenges.gscbin differ diff --git a/data/iw7/mp/contracts.gscbin b/data/iw7/mp/contracts.gscbin new file mode 100644 index 00000000..6a0121e5 Binary files /dev/null and b/data/iw7/mp/contracts.gscbin differ diff --git a/data/iw7/mp/gametypes/assault.gscbin b/data/iw7/mp/gametypes/assault.gscbin new file mode 100644 index 00000000..90e26210 Binary files /dev/null and b/data/iw7/mp/gametypes/assault.gscbin differ diff --git a/data/iw7/mp/gametypes/assault_system_lifesupport.gscbin b/data/iw7/mp/gametypes/assault_system_lifesupport.gscbin new file mode 100644 index 00000000..76a25b0f Binary files /dev/null and b/data/iw7/mp/gametypes/assault_system_lifesupport.gscbin differ diff --git a/data/iw7/mp/gametypes/assault_turret_network.gscbin b/data/iw7/mp/gametypes/assault_turret_network.gscbin new file mode 100644 index 00000000..eded827e Binary files /dev/null and b/data/iw7/mp/gametypes/assault_turret_network.gscbin differ diff --git a/data/iw7/mp/gametypes/ball.gscbin b/data/iw7/mp/gametypes/ball.gscbin new file mode 100644 index 00000000..f77d0416 Binary files /dev/null and b/data/iw7/mp/gametypes/ball.gscbin differ diff --git a/data/iw7/mp/gametypes/common.gscbin b/data/iw7/mp/gametypes/common.gscbin new file mode 100644 index 00000000..a42bfd4c Binary files /dev/null and b/data/iw7/mp/gametypes/common.gscbin differ diff --git a/data/iw7/mp/gametypes/conf.gscbin b/data/iw7/mp/gametypes/conf.gscbin new file mode 100644 index 00000000..8b41e341 Binary files /dev/null and b/data/iw7/mp/gametypes/conf.gscbin differ diff --git a/data/iw7/mp/gametypes/cranked.gscbin b/data/iw7/mp/gametypes/cranked.gscbin new file mode 100644 index 00000000..24b8781b Binary files /dev/null and b/data/iw7/mp/gametypes/cranked.gscbin differ diff --git a/data/iw7/mp/gametypes/ctf.gscbin b/data/iw7/mp/gametypes/ctf.gscbin new file mode 100644 index 00000000..cfb3749d Binary files /dev/null and b/data/iw7/mp/gametypes/ctf.gscbin differ diff --git a/data/iw7/mp/gametypes/dd.gscbin b/data/iw7/mp/gametypes/dd.gscbin new file mode 100644 index 00000000..e5421853 Binary files /dev/null and b/data/iw7/mp/gametypes/dd.gscbin differ diff --git a/data/iw7/mp/gametypes/dm.gscbin b/data/iw7/mp/gametypes/dm.gscbin new file mode 100644 index 00000000..4950dff1 Binary files /dev/null and b/data/iw7/mp/gametypes/dm.gscbin differ diff --git a/data/iw7/mp/gametypes/dom.gscbin b/data/iw7/mp/gametypes/dom.gscbin new file mode 100644 index 00000000..598c7cb6 Binary files /dev/null and b/data/iw7/mp/gametypes/dom.gscbin differ diff --git a/data/iw7/mp/gametypes/front.gscbin b/data/iw7/mp/gametypes/front.gscbin new file mode 100644 index 00000000..7dd66161 Binary files /dev/null and b/data/iw7/mp/gametypes/front.gscbin differ diff --git a/data/iw7/mp/gametypes/frontend.gscbin b/data/iw7/mp/gametypes/frontend.gscbin new file mode 100644 index 00000000..8f825816 Binary files /dev/null and b/data/iw7/mp/gametypes/frontend.gscbin differ diff --git a/data/iw7/mp/gametypes/grind.gscbin b/data/iw7/mp/gametypes/grind.gscbin new file mode 100644 index 00000000..066775cf Binary files /dev/null and b/data/iw7/mp/gametypes/grind.gscbin differ diff --git a/data/iw7/mp/gametypes/grnd.gscbin b/data/iw7/mp/gametypes/grnd.gscbin new file mode 100644 index 00000000..63fd4ac6 Binary files /dev/null and b/data/iw7/mp/gametypes/grnd.gscbin differ diff --git a/data/iw7/mp/gametypes/gun.gscbin b/data/iw7/mp/gametypes/gun.gscbin new file mode 100644 index 00000000..c30e450d Binary files /dev/null and b/data/iw7/mp/gametypes/gun.gscbin differ diff --git a/data/iw7/mp/gametypes/infect.gscbin b/data/iw7/mp/gametypes/infect.gscbin new file mode 100644 index 00000000..91680a53 Binary files /dev/null and b/data/iw7/mp/gametypes/infect.gscbin differ diff --git a/data/iw7/mp/gametypes/koth.gscbin b/data/iw7/mp/gametypes/koth.gscbin new file mode 100644 index 00000000..c07b87c9 Binary files /dev/null and b/data/iw7/mp/gametypes/koth.gscbin differ diff --git a/data/iw7/mp/gametypes/lava.gscbin b/data/iw7/mp/gametypes/lava.gscbin new file mode 100644 index 00000000..dfff283a Binary files /dev/null and b/data/iw7/mp/gametypes/lava.gscbin differ diff --git a/data/iw7/mp/gametypes/mugger.gscbin b/data/iw7/mp/gametypes/mugger.gscbin new file mode 100644 index 00000000..dec64957 Binary files /dev/null and b/data/iw7/mp/gametypes/mugger.gscbin differ diff --git a/data/iw7/mp/gametypes/obj_ball.gscbin b/data/iw7/mp/gametypes/obj_ball.gscbin new file mode 100644 index 00000000..42c1b596 Binary files /dev/null and b/data/iw7/mp/gametypes/obj_ball.gscbin differ diff --git a/data/iw7/mp/gametypes/obj_bombzone.gscbin b/data/iw7/mp/gametypes/obj_bombzone.gscbin new file mode 100644 index 00000000..b1884d9b Binary files /dev/null and b/data/iw7/mp/gametypes/obj_bombzone.gscbin differ diff --git a/data/iw7/mp/gametypes/obj_capture.gscbin b/data/iw7/mp/gametypes/obj_capture.gscbin new file mode 100644 index 00000000..8c005dd8 Binary files /dev/null and b/data/iw7/mp/gametypes/obj_capture.gscbin differ diff --git a/data/iw7/mp/gametypes/obj_dogtag.gscbin b/data/iw7/mp/gametypes/obj_dogtag.gscbin new file mode 100644 index 00000000..f44f8c61 Binary files /dev/null and b/data/iw7/mp/gametypes/obj_dogtag.gscbin differ diff --git a/data/iw7/mp/gametypes/obj_dom.gscbin b/data/iw7/mp/gametypes/obj_dom.gscbin new file mode 100644 index 00000000..65b509b1 Binary files /dev/null and b/data/iw7/mp/gametypes/obj_dom.gscbin differ diff --git a/data/iw7/mp/gametypes/obj_grindzone.gscbin b/data/iw7/mp/gametypes/obj_grindzone.gscbin new file mode 100644 index 00000000..ccb9db4d Binary files /dev/null and b/data/iw7/mp/gametypes/obj_grindzone.gscbin differ diff --git a/data/iw7/mp/gametypes/obj_zonecapture.gscbin b/data/iw7/mp/gametypes/obj_zonecapture.gscbin new file mode 100644 index 00000000..089911d0 Binary files /dev/null and b/data/iw7/mp/gametypes/obj_zonecapture.gscbin differ diff --git a/data/iw7/mp/gametypes/sd.gscbin b/data/iw7/mp/gametypes/sd.gscbin new file mode 100644 index 00000000..31150e63 Binary files /dev/null and b/data/iw7/mp/gametypes/sd.gscbin differ diff --git a/data/iw7/mp/gametypes/siege.gscbin b/data/iw7/mp/gametypes/siege.gscbin new file mode 100644 index 00000000..89588914 Binary files /dev/null and b/data/iw7/mp/gametypes/siege.gscbin differ diff --git a/data/iw7/mp/gametypes/sotf.gscbin b/data/iw7/mp/gametypes/sotf.gscbin new file mode 100644 index 00000000..3402320d Binary files /dev/null and b/data/iw7/mp/gametypes/sotf.gscbin differ diff --git a/data/iw7/mp/gametypes/sotf_ffa.gscbin b/data/iw7/mp/gametypes/sotf_ffa.gscbin new file mode 100644 index 00000000..d0eeb493 Binary files /dev/null and b/data/iw7/mp/gametypes/sotf_ffa.gscbin differ diff --git a/data/iw7/mp/gametypes/sr.gscbin b/data/iw7/mp/gametypes/sr.gscbin new file mode 100644 index 00000000..6692c636 Binary files /dev/null and b/data/iw7/mp/gametypes/sr.gscbin differ diff --git a/data/iw7/mp/gametypes/tdef.gscbin b/data/iw7/mp/gametypes/tdef.gscbin new file mode 100644 index 00000000..2a89a49c Binary files /dev/null and b/data/iw7/mp/gametypes/tdef.gscbin differ diff --git a/data/iw7/mp/gametypes/war.gscbin b/data/iw7/mp/gametypes/war.gscbin new file mode 100644 index 00000000..7389ceec Binary files /dev/null and b/data/iw7/mp/gametypes/war.gscbin differ diff --git a/data/iw7/mp/maps/mp_frontend/gen/mp_frontend_art.gscbin b/data/iw7/mp/maps/mp_frontend/gen/mp_frontend_art.gscbin new file mode 100644 index 00000000..84650f33 Binary files /dev/null and b/data/iw7/mp/maps/mp_frontend/gen/mp_frontend_art.gscbin differ diff --git a/data/iw7/mp/maps/mp_frontend/gen/mp_frontend_sound.gscbin b/data/iw7/mp/maps/mp_frontend/gen/mp_frontend_sound.gscbin new file mode 100644 index 00000000..6013c041 Binary files /dev/null and b/data/iw7/mp/maps/mp_frontend/gen/mp_frontend_sound.gscbin differ diff --git a/data/iw7/mp/maps/mp_frontend/mp_frontend.gscbin b/data/iw7/mp/maps/mp_frontend/mp_frontend.gscbin new file mode 100644 index 00000000..d7570c92 Binary files /dev/null and b/data/iw7/mp/maps/mp_frontend/mp_frontend.gscbin differ diff --git a/data/iw7/mp/objidpoolmanager.gscbin b/data/iw7/mp/objidpoolmanager.gscbin new file mode 100644 index 00000000..cc960a39 Binary files /dev/null and b/data/iw7/mp/objidpoolmanager.gscbin differ diff --git a/data/iw7/mp/powers/blink_knife.gscbin b/data/iw7/mp/powers/blink_knife.gscbin new file mode 100644 index 00000000..eea5e617 Binary files /dev/null and b/data/iw7/mp/powers/blink_knife.gscbin differ diff --git a/data/iw7/mp/rangefinder.gscbin b/data/iw7/mp/rangefinder.gscbin new file mode 100644 index 00000000..b630e9c6 Binary files /dev/null and b/data/iw7/mp/rangefinder.gscbin differ diff --git a/data/iw7/mp/sentientpoolmanager.gscbin b/data/iw7/mp/sentientpoolmanager.gscbin new file mode 100644 index 00000000..565631b7 Binary files /dev/null and b/data/iw7/mp/sentientpoolmanager.gscbin differ diff --git a/data/s2/1128.gscbin b/data/s2/1128.gscbin new file mode 100644 index 00000000..0d0a0240 Binary files /dev/null and b/data/s2/1128.gscbin differ diff --git a/data/s2/1129.gscbin b/data/s2/1129.gscbin new file mode 100644 index 00000000..2960b01a Binary files /dev/null and b/data/s2/1129.gscbin differ diff --git a/data/s2/1130.gscbin b/data/s2/1130.gscbin new file mode 100644 index 00000000..f53a2e47 Binary files /dev/null and b/data/s2/1130.gscbin differ diff --git a/data/s2/1131.gscbin b/data/s2/1131.gscbin new file mode 100644 index 00000000..611dfe8b Binary files /dev/null and b/data/s2/1131.gscbin differ diff --git a/data/s2/1132.gscbin b/data/s2/1132.gscbin new file mode 100644 index 00000000..2518c43a Binary files /dev/null and b/data/s2/1132.gscbin differ diff --git a/data/s2/1133.gscbin b/data/s2/1133.gscbin new file mode 100644 index 00000000..287209be Binary files /dev/null and b/data/s2/1133.gscbin differ diff --git a/data/s2/1134.gscbin b/data/s2/1134.gscbin new file mode 100644 index 00000000..38b1cc32 Binary files /dev/null and b/data/s2/1134.gscbin differ diff --git a/data/s2/1135.gscbin b/data/s2/1135.gscbin new file mode 100644 index 00000000..ce5d1b7f Binary files /dev/null and b/data/s2/1135.gscbin differ diff --git a/data/s2/1136.gscbin b/data/s2/1136.gscbin new file mode 100644 index 00000000..909bc12c Binary files /dev/null and b/data/s2/1136.gscbin differ diff --git a/data/s2/1137.gscbin b/data/s2/1137.gscbin new file mode 100644 index 00000000..5c4a4d2d Binary files /dev/null and b/data/s2/1137.gscbin differ diff --git a/data/s2/1138.gscbin b/data/s2/1138.gscbin new file mode 100644 index 00000000..6cb85934 Binary files /dev/null and b/data/s2/1138.gscbin differ diff --git a/data/s2/1139.gscbin b/data/s2/1139.gscbin new file mode 100644 index 00000000..8f38b6fa Binary files /dev/null and b/data/s2/1139.gscbin differ diff --git a/data/s2/1140.gscbin b/data/s2/1140.gscbin new file mode 100644 index 00000000..58d03eb3 Binary files /dev/null and b/data/s2/1140.gscbin differ diff --git a/data/s2/1142.gscbin b/data/s2/1142.gscbin new file mode 100644 index 00000000..d068a7fa Binary files /dev/null and b/data/s2/1142.gscbin differ diff --git a/data/s2/1143.gscbin b/data/s2/1143.gscbin new file mode 100644 index 00000000..1b63e724 Binary files /dev/null and b/data/s2/1143.gscbin differ diff --git a/data/s2/1144.gscbin b/data/s2/1144.gscbin new file mode 100644 index 00000000..ae96d901 Binary files /dev/null and b/data/s2/1144.gscbin differ diff --git a/data/s2/1145.gscbin b/data/s2/1145.gscbin new file mode 100644 index 00000000..26caaf7c Binary files /dev/null and b/data/s2/1145.gscbin differ diff --git a/data/s2/1146.gscbin b/data/s2/1146.gscbin new file mode 100644 index 00000000..aa28d496 Binary files /dev/null and b/data/s2/1146.gscbin differ diff --git a/data/s2/1147.gscbin b/data/s2/1147.gscbin new file mode 100644 index 00000000..2633ad1b Binary files /dev/null and b/data/s2/1147.gscbin differ diff --git a/data/s2/1148.gscbin b/data/s2/1148.gscbin new file mode 100644 index 00000000..5a31dafb Binary files /dev/null and b/data/s2/1148.gscbin differ diff --git a/data/s2/1149.gscbin b/data/s2/1149.gscbin new file mode 100644 index 00000000..6d2310b8 Binary files /dev/null and b/data/s2/1149.gscbin differ diff --git a/data/s2/1150.gscbin b/data/s2/1150.gscbin new file mode 100644 index 00000000..ab7fae0a Binary files /dev/null and b/data/s2/1150.gscbin differ diff --git a/data/s2/1151.gscbin b/data/s2/1151.gscbin new file mode 100644 index 00000000..f23e040d Binary files /dev/null and b/data/s2/1151.gscbin differ diff --git a/data/s2/1152.gscbin b/data/s2/1152.gscbin new file mode 100644 index 00000000..0c120d6e Binary files /dev/null and b/data/s2/1152.gscbin differ diff --git a/data/s2/1153.gscbin b/data/s2/1153.gscbin new file mode 100644 index 00000000..6b966236 Binary files /dev/null and b/data/s2/1153.gscbin differ diff --git a/data/s2/1155.gscbin b/data/s2/1155.gscbin new file mode 100644 index 00000000..ca285fd8 Binary files /dev/null and b/data/s2/1155.gscbin differ diff --git a/data/s2/1156.gscbin b/data/s2/1156.gscbin new file mode 100644 index 00000000..02453df2 Binary files /dev/null and b/data/s2/1156.gscbin differ diff --git a/data/s2/1157.gscbin b/data/s2/1157.gscbin new file mode 100644 index 00000000..a461338c Binary files /dev/null and b/data/s2/1157.gscbin differ diff --git a/data/s2/1158.gscbin b/data/s2/1158.gscbin new file mode 100644 index 00000000..d1df6b66 Binary files /dev/null and b/data/s2/1158.gscbin differ diff --git a/data/s2/1159.gscbin b/data/s2/1159.gscbin new file mode 100644 index 00000000..ce84bd8a Binary files /dev/null and b/data/s2/1159.gscbin differ diff --git a/data/s2/1160.gscbin b/data/s2/1160.gscbin new file mode 100644 index 00000000..96203cb8 Binary files /dev/null and b/data/s2/1160.gscbin differ diff --git a/data/s2/1161.gscbin b/data/s2/1161.gscbin new file mode 100644 index 00000000..9a8c376a Binary files /dev/null and b/data/s2/1161.gscbin differ diff --git a/data/s2/1162.gscbin b/data/s2/1162.gscbin new file mode 100644 index 00000000..7b712528 Binary files /dev/null and b/data/s2/1162.gscbin differ diff --git a/data/s2/1163.gscbin b/data/s2/1163.gscbin new file mode 100644 index 00000000..0940e6f8 Binary files /dev/null and b/data/s2/1163.gscbin differ diff --git a/data/s2/1164.gscbin b/data/s2/1164.gscbin new file mode 100644 index 00000000..b659836a Binary files /dev/null and b/data/s2/1164.gscbin differ diff --git a/data/s2/1165.gscbin b/data/s2/1165.gscbin new file mode 100644 index 00000000..c6f915ae Binary files /dev/null and b/data/s2/1165.gscbin differ diff --git a/data/s2/1166.gscbin b/data/s2/1166.gscbin new file mode 100644 index 00000000..48ff2dc8 Binary files /dev/null and b/data/s2/1166.gscbin differ diff --git a/data/s2/1167.gscbin b/data/s2/1167.gscbin new file mode 100644 index 00000000..db24aed0 Binary files /dev/null and b/data/s2/1167.gscbin differ diff --git a/data/s2/1168.gscbin b/data/s2/1168.gscbin new file mode 100644 index 00000000..9cde7613 Binary files /dev/null and b/data/s2/1168.gscbin differ diff --git a/data/s2/1169.gscbin b/data/s2/1169.gscbin new file mode 100644 index 00000000..fe92ced1 Binary files /dev/null and b/data/s2/1169.gscbin differ diff --git a/data/s2/1170.gscbin b/data/s2/1170.gscbin new file mode 100644 index 00000000..12f98591 Binary files /dev/null and b/data/s2/1170.gscbin differ diff --git a/data/s2/1171.gscbin b/data/s2/1171.gscbin new file mode 100644 index 00000000..3baa4513 Binary files /dev/null and b/data/s2/1171.gscbin differ diff --git a/data/s2/1172.gscbin b/data/s2/1172.gscbin new file mode 100644 index 00000000..33659253 Binary files /dev/null and b/data/s2/1172.gscbin differ diff --git a/data/s2/1173.gscbin b/data/s2/1173.gscbin new file mode 100644 index 00000000..50a83091 Binary files /dev/null and b/data/s2/1173.gscbin differ diff --git a/data/s2/1175.gscbin b/data/s2/1175.gscbin new file mode 100644 index 00000000..2472c50b Binary files /dev/null and b/data/s2/1175.gscbin differ diff --git a/data/s2/1176.gscbin b/data/s2/1176.gscbin new file mode 100644 index 00000000..95057254 Binary files /dev/null and b/data/s2/1176.gscbin differ diff --git a/data/s2/1218.gscbin b/data/s2/1218.gscbin new file mode 100644 index 00000000..bb4a4eab Binary files /dev/null and b/data/s2/1218.gscbin differ diff --git a/data/s2/1219.gscbin b/data/s2/1219.gscbin new file mode 100644 index 00000000..b1b6d276 Binary files /dev/null and b/data/s2/1219.gscbin differ diff --git a/data/s2/1220.gscbin b/data/s2/1220.gscbin new file mode 100644 index 00000000..79a17490 Binary files /dev/null and b/data/s2/1220.gscbin differ diff --git a/data/s2/1221.gscbin b/data/s2/1221.gscbin new file mode 100644 index 00000000..e29ea819 Binary files /dev/null and b/data/s2/1221.gscbin differ diff --git a/data/s2/1222.gscbin b/data/s2/1222.gscbin new file mode 100644 index 00000000..d9c48ac5 Binary files /dev/null and b/data/s2/1222.gscbin differ diff --git a/data/s2/1223.gscbin b/data/s2/1223.gscbin new file mode 100644 index 00000000..a134bd2d Binary files /dev/null and b/data/s2/1223.gscbin differ diff --git a/data/s2/1224.gscbin b/data/s2/1224.gscbin new file mode 100644 index 00000000..0eae59e5 Binary files /dev/null and b/data/s2/1224.gscbin differ diff --git a/data/s2/1225.gscbin b/data/s2/1225.gscbin new file mode 100644 index 00000000..ff0b29e4 Binary files /dev/null and b/data/s2/1225.gscbin differ diff --git a/data/s2/1226.gscbin b/data/s2/1226.gscbin new file mode 100644 index 00000000..c00e4ad9 Binary files /dev/null and b/data/s2/1226.gscbin differ diff --git a/data/s2/1227.gscbin b/data/s2/1227.gscbin new file mode 100644 index 00000000..dab383c7 Binary files /dev/null and b/data/s2/1227.gscbin differ diff --git a/data/s2/1228.gscbin b/data/s2/1228.gscbin new file mode 100644 index 00000000..68840998 Binary files /dev/null and b/data/s2/1228.gscbin differ diff --git a/data/s2/1229.gscbin b/data/s2/1229.gscbin new file mode 100644 index 00000000..bad27da5 Binary files /dev/null and b/data/s2/1229.gscbin differ diff --git a/data/s2/1230.gscbin b/data/s2/1230.gscbin new file mode 100644 index 00000000..9d275751 Binary files /dev/null and b/data/s2/1230.gscbin differ diff --git a/data/s2/1231.gscbin b/data/s2/1231.gscbin new file mode 100644 index 00000000..761456b8 Binary files /dev/null and b/data/s2/1231.gscbin differ diff --git a/data/s2/1232.gscbin b/data/s2/1232.gscbin new file mode 100644 index 00000000..8699d2a0 Binary files /dev/null and b/data/s2/1232.gscbin differ diff --git a/data/s2/1233.gscbin b/data/s2/1233.gscbin new file mode 100644 index 00000000..86df6711 Binary files /dev/null and b/data/s2/1233.gscbin differ diff --git a/data/s2/1234.gscbin b/data/s2/1234.gscbin new file mode 100644 index 00000000..4097c815 Binary files /dev/null and b/data/s2/1234.gscbin differ diff --git a/data/s2/1235.gscbin b/data/s2/1235.gscbin new file mode 100644 index 00000000..96035dc1 Binary files /dev/null and b/data/s2/1235.gscbin differ diff --git a/data/s2/1236.gscbin b/data/s2/1236.gscbin new file mode 100644 index 00000000..ad9cc316 Binary files /dev/null and b/data/s2/1236.gscbin differ diff --git a/data/s2/1237.gscbin b/data/s2/1237.gscbin new file mode 100644 index 00000000..359ede4c Binary files /dev/null and b/data/s2/1237.gscbin differ diff --git a/data/s2/1238.gscbin b/data/s2/1238.gscbin new file mode 100644 index 00000000..db74c691 Binary files /dev/null and b/data/s2/1238.gscbin differ diff --git a/data/s2/1239.gscbin b/data/s2/1239.gscbin new file mode 100644 index 00000000..2e22a556 Binary files /dev/null and b/data/s2/1239.gscbin differ diff --git a/data/s2/1251.gscbin b/data/s2/1251.gscbin new file mode 100644 index 00000000..430bcc4a Binary files /dev/null and b/data/s2/1251.gscbin differ diff --git a/data/s2/1252.gscbin b/data/s2/1252.gscbin new file mode 100644 index 00000000..3fcd767d Binary files /dev/null and b/data/s2/1252.gscbin differ diff --git a/data/s2/1253.gscbin b/data/s2/1253.gscbin new file mode 100644 index 00000000..d5db6b43 Binary files /dev/null and b/data/s2/1253.gscbin differ diff --git a/data/s2/1254.gscbin b/data/s2/1254.gscbin new file mode 100644 index 00000000..11dba656 Binary files /dev/null and b/data/s2/1254.gscbin differ diff --git a/data/s2/1255.gscbin b/data/s2/1255.gscbin new file mode 100644 index 00000000..e29b37f9 Binary files /dev/null and b/data/s2/1255.gscbin differ diff --git a/data/s2/1256.gscbin b/data/s2/1256.gscbin new file mode 100644 index 00000000..4b8d915f Binary files /dev/null and b/data/s2/1256.gscbin differ diff --git a/data/s2/1257.gscbin b/data/s2/1257.gscbin new file mode 100644 index 00000000..22caa510 Binary files /dev/null and b/data/s2/1257.gscbin differ diff --git a/data/s2/1258.gscbin b/data/s2/1258.gscbin new file mode 100644 index 00000000..f610fffc Binary files /dev/null and b/data/s2/1258.gscbin differ diff --git a/data/s2/1259.gscbin b/data/s2/1259.gscbin new file mode 100644 index 00000000..1c15c0f1 Binary files /dev/null and b/data/s2/1259.gscbin differ diff --git a/data/s2/1260.gscbin b/data/s2/1260.gscbin new file mode 100644 index 00000000..3a938270 Binary files /dev/null and b/data/s2/1260.gscbin differ diff --git a/data/s2/1261.gscbin b/data/s2/1261.gscbin new file mode 100644 index 00000000..60d34e61 Binary files /dev/null and b/data/s2/1261.gscbin differ diff --git a/data/s2/1262.gscbin b/data/s2/1262.gscbin new file mode 100644 index 00000000..656f8f9a Binary files /dev/null and b/data/s2/1262.gscbin differ diff --git a/data/s2/1263.gscbin b/data/s2/1263.gscbin new file mode 100644 index 00000000..ac3a1f3d Binary files /dev/null and b/data/s2/1263.gscbin differ diff --git a/data/s2/1264.gscbin b/data/s2/1264.gscbin new file mode 100644 index 00000000..6bc4d680 Binary files /dev/null and b/data/s2/1264.gscbin differ diff --git a/data/s2/1265.gscbin b/data/s2/1265.gscbin new file mode 100644 index 00000000..5fc714dd Binary files /dev/null and b/data/s2/1265.gscbin differ diff --git a/data/s2/1266.gscbin b/data/s2/1266.gscbin new file mode 100644 index 00000000..adb92daa Binary files /dev/null and b/data/s2/1266.gscbin differ diff --git a/data/s2/1287.gscbin b/data/s2/1287.gscbin new file mode 100644 index 00000000..d4c6a306 Binary files /dev/null and b/data/s2/1287.gscbin differ diff --git a/data/s2/1288.gscbin b/data/s2/1288.gscbin new file mode 100644 index 00000000..92b1e121 Binary files /dev/null and b/data/s2/1288.gscbin differ diff --git a/data/s2/1289.gscbin b/data/s2/1289.gscbin new file mode 100644 index 00000000..c86e0922 Binary files /dev/null and b/data/s2/1289.gscbin differ diff --git a/data/s2/1290.gscbin b/data/s2/1290.gscbin new file mode 100644 index 00000000..45bfa8cf Binary files /dev/null and b/data/s2/1290.gscbin differ diff --git a/data/s2/1291.gscbin b/data/s2/1291.gscbin new file mode 100644 index 00000000..2dfb2f1d Binary files /dev/null and b/data/s2/1291.gscbin differ diff --git a/data/s2/1292.gscbin b/data/s2/1292.gscbin new file mode 100644 index 00000000..bfb3cc96 Binary files /dev/null and b/data/s2/1292.gscbin differ diff --git a/data/s2/1293.gscbin b/data/s2/1293.gscbin new file mode 100644 index 00000000..4dd68dd8 Binary files /dev/null and b/data/s2/1293.gscbin differ diff --git a/data/s2/1294.gscbin b/data/s2/1294.gscbin new file mode 100644 index 00000000..0cbff3a3 Binary files /dev/null and b/data/s2/1294.gscbin differ diff --git a/data/s2/1295.gscbin b/data/s2/1295.gscbin new file mode 100644 index 00000000..398b591f Binary files /dev/null and b/data/s2/1295.gscbin differ diff --git a/data/s2/1296.gscbin b/data/s2/1296.gscbin new file mode 100644 index 00000000..b45ae336 Binary files /dev/null and b/data/s2/1296.gscbin differ diff --git a/data/s2/1297.gscbin b/data/s2/1297.gscbin new file mode 100644 index 00000000..de66bc7a Binary files /dev/null and b/data/s2/1297.gscbin differ diff --git a/data/s2/1298.gscbin b/data/s2/1298.gscbin new file mode 100644 index 00000000..05166228 Binary files /dev/null and b/data/s2/1298.gscbin differ diff --git a/data/s2/1299.gscbin b/data/s2/1299.gscbin new file mode 100644 index 00000000..edd14aa1 Binary files /dev/null and b/data/s2/1299.gscbin differ diff --git a/data/s2/1300.gscbin b/data/s2/1300.gscbin new file mode 100644 index 00000000..04016669 Binary files /dev/null and b/data/s2/1300.gscbin differ diff --git a/data/s2/1301.gscbin b/data/s2/1301.gscbin new file mode 100644 index 00000000..29bb73a0 Binary files /dev/null and b/data/s2/1301.gscbin differ diff --git a/data/s2/1302.gscbin b/data/s2/1302.gscbin new file mode 100644 index 00000000..96323995 Binary files /dev/null and b/data/s2/1302.gscbin differ diff --git a/data/s2/1303.gscbin b/data/s2/1303.gscbin new file mode 100644 index 00000000..9a520e8f Binary files /dev/null and b/data/s2/1303.gscbin differ diff --git a/data/s2/1304.gscbin b/data/s2/1304.gscbin new file mode 100644 index 00000000..1d2b5c90 Binary files /dev/null and b/data/s2/1304.gscbin differ diff --git a/data/s2/1305.gscbin b/data/s2/1305.gscbin new file mode 100644 index 00000000..e00b1d95 Binary files /dev/null and b/data/s2/1305.gscbin differ diff --git a/data/s2/1306.gscbin b/data/s2/1306.gscbin new file mode 100644 index 00000000..4d8bf121 Binary files /dev/null and b/data/s2/1306.gscbin differ diff --git a/data/s2/1307.gscbin b/data/s2/1307.gscbin new file mode 100644 index 00000000..322840a8 Binary files /dev/null and b/data/s2/1307.gscbin differ diff --git a/data/s2/1308.gscbin b/data/s2/1308.gscbin new file mode 100644 index 00000000..510d85c4 Binary files /dev/null and b/data/s2/1308.gscbin differ diff --git a/data/s2/1309.gscbin b/data/s2/1309.gscbin new file mode 100644 index 00000000..6e46b485 Binary files /dev/null and b/data/s2/1309.gscbin differ diff --git a/data/s2/1310.gscbin b/data/s2/1310.gscbin new file mode 100644 index 00000000..d4cb4c64 Binary files /dev/null and b/data/s2/1310.gscbin differ diff --git a/data/s2/1311.gscbin b/data/s2/1311.gscbin new file mode 100644 index 00000000..5c44926e Binary files /dev/null and b/data/s2/1311.gscbin differ diff --git a/data/s2/1312.gscbin b/data/s2/1312.gscbin new file mode 100644 index 00000000..fac12be9 Binary files /dev/null and b/data/s2/1312.gscbin differ diff --git a/data/s2/1313.gscbin b/data/s2/1313.gscbin new file mode 100644 index 00000000..add826f7 Binary files /dev/null and b/data/s2/1313.gscbin differ diff --git a/data/s2/1314.gscbin b/data/s2/1314.gscbin new file mode 100644 index 00000000..d9acb64f Binary files /dev/null and b/data/s2/1314.gscbin differ diff --git a/data/s2/1315.gscbin b/data/s2/1315.gscbin new file mode 100644 index 00000000..44030a1c Binary files /dev/null and b/data/s2/1315.gscbin differ diff --git a/data/s2/1316.gscbin b/data/s2/1316.gscbin new file mode 100644 index 00000000..de8b068d Binary files /dev/null and b/data/s2/1316.gscbin differ diff --git a/data/s2/1317.gscbin b/data/s2/1317.gscbin new file mode 100644 index 00000000..a87c6ffb Binary files /dev/null and b/data/s2/1317.gscbin differ diff --git a/data/s2/1318.gscbin b/data/s2/1318.gscbin new file mode 100644 index 00000000..567c05b0 Binary files /dev/null and b/data/s2/1318.gscbin differ diff --git a/data/s2/1319.gscbin b/data/s2/1319.gscbin new file mode 100644 index 00000000..b76a80a7 Binary files /dev/null and b/data/s2/1319.gscbin differ diff --git a/data/s2/1320.gscbin b/data/s2/1320.gscbin new file mode 100644 index 00000000..c2eef11f Binary files /dev/null and b/data/s2/1320.gscbin differ diff --git a/data/s2/1321.gscbin b/data/s2/1321.gscbin new file mode 100644 index 00000000..fa3ea614 Binary files /dev/null and b/data/s2/1321.gscbin differ diff --git a/data/s2/1322.gscbin b/data/s2/1322.gscbin new file mode 100644 index 00000000..8b30b342 Binary files /dev/null and b/data/s2/1322.gscbin differ diff --git a/data/s2/1323.gscbin b/data/s2/1323.gscbin new file mode 100644 index 00000000..ddc65569 Binary files /dev/null and b/data/s2/1323.gscbin differ diff --git a/data/s2/1324.gscbin b/data/s2/1324.gscbin new file mode 100644 index 00000000..9e32f529 Binary files /dev/null and b/data/s2/1324.gscbin differ diff --git a/data/s2/1325.gscbin b/data/s2/1325.gscbin new file mode 100644 index 00000000..9d5cc8dd Binary files /dev/null and b/data/s2/1325.gscbin differ diff --git a/data/s2/1326.gscbin b/data/s2/1326.gscbin new file mode 100644 index 00000000..96a43dc4 Binary files /dev/null and b/data/s2/1326.gscbin differ diff --git a/data/s2/1327.gscbin b/data/s2/1327.gscbin new file mode 100644 index 00000000..6460d0ed Binary files /dev/null and b/data/s2/1327.gscbin differ diff --git a/data/s2/1328.gscbin b/data/s2/1328.gscbin new file mode 100644 index 00000000..e01c6aac Binary files /dev/null and b/data/s2/1328.gscbin differ diff --git a/data/s2/1329.gscbin b/data/s2/1329.gscbin new file mode 100644 index 00000000..edbadbc3 Binary files /dev/null and b/data/s2/1329.gscbin differ diff --git a/data/s2/1330.gscbin b/data/s2/1330.gscbin new file mode 100644 index 00000000..85e509be Binary files /dev/null and b/data/s2/1330.gscbin differ diff --git a/data/s2/1331.gscbin b/data/s2/1331.gscbin new file mode 100644 index 00000000..954509af Binary files /dev/null and b/data/s2/1331.gscbin differ diff --git a/data/s2/1332.gscbin b/data/s2/1332.gscbin new file mode 100644 index 00000000..16c91356 Binary files /dev/null and b/data/s2/1332.gscbin differ diff --git a/data/s2/1333.gscbin b/data/s2/1333.gscbin new file mode 100644 index 00000000..a94da1d9 Binary files /dev/null and b/data/s2/1333.gscbin differ diff --git a/data/s2/1334.gscbin b/data/s2/1334.gscbin new file mode 100644 index 00000000..770942f4 Binary files /dev/null and b/data/s2/1334.gscbin differ diff --git a/data/s2/1335.gscbin b/data/s2/1335.gscbin new file mode 100644 index 00000000..be13483a Binary files /dev/null and b/data/s2/1335.gscbin differ diff --git a/data/s2/1336.gscbin b/data/s2/1336.gscbin new file mode 100644 index 00000000..fe9dc2df Binary files /dev/null and b/data/s2/1336.gscbin differ diff --git a/data/s2/1337.gscbin b/data/s2/1337.gscbin new file mode 100644 index 00000000..6db1644b Binary files /dev/null and b/data/s2/1337.gscbin differ diff --git a/data/s2/1338.gscbin b/data/s2/1338.gscbin new file mode 100644 index 00000000..48f3f5a8 Binary files /dev/null and b/data/s2/1338.gscbin differ diff --git a/data/s2/1339.gscbin b/data/s2/1339.gscbin new file mode 100644 index 00000000..081dba12 Binary files /dev/null and b/data/s2/1339.gscbin differ diff --git a/data/s2/1340.gscbin b/data/s2/1340.gscbin new file mode 100644 index 00000000..4563be83 Binary files /dev/null and b/data/s2/1340.gscbin differ diff --git a/data/s2/1342.gscbin b/data/s2/1342.gscbin new file mode 100644 index 00000000..08740c06 Binary files /dev/null and b/data/s2/1342.gscbin differ diff --git a/data/s2/1343.gscbin b/data/s2/1343.gscbin new file mode 100644 index 00000000..40d138fa Binary files /dev/null and b/data/s2/1343.gscbin differ diff --git a/data/s2/1344.gscbin b/data/s2/1344.gscbin new file mode 100644 index 00000000..ac50ab17 Binary files /dev/null and b/data/s2/1344.gscbin differ diff --git a/data/s2/1345.gscbin b/data/s2/1345.gscbin new file mode 100644 index 00000000..6dc632d1 Binary files /dev/null and b/data/s2/1345.gscbin differ diff --git a/data/s2/1346.gscbin b/data/s2/1346.gscbin new file mode 100644 index 00000000..0af5b894 Binary files /dev/null and b/data/s2/1346.gscbin differ diff --git a/data/s2/1347.gscbin b/data/s2/1347.gscbin new file mode 100644 index 00000000..14c8e47f Binary files /dev/null and b/data/s2/1347.gscbin differ diff --git a/data/s2/1348.gscbin b/data/s2/1348.gscbin new file mode 100644 index 00000000..38c56c54 Binary files /dev/null and b/data/s2/1348.gscbin differ diff --git a/data/s2/1349.gscbin b/data/s2/1349.gscbin new file mode 100644 index 00000000..b35b8cfe Binary files /dev/null and b/data/s2/1349.gscbin differ diff --git a/data/s2/1350.gscbin b/data/s2/1350.gscbin new file mode 100644 index 00000000..f534f420 Binary files /dev/null and b/data/s2/1350.gscbin differ diff --git a/data/s2/1351.gscbin b/data/s2/1351.gscbin new file mode 100644 index 00000000..3726a3f3 Binary files /dev/null and b/data/s2/1351.gscbin differ diff --git a/data/s2/1352.gscbin b/data/s2/1352.gscbin new file mode 100644 index 00000000..33718d1c Binary files /dev/null and b/data/s2/1352.gscbin differ diff --git a/data/s2/1353.gscbin b/data/s2/1353.gscbin new file mode 100644 index 00000000..66e0e1d9 Binary files /dev/null and b/data/s2/1353.gscbin differ diff --git a/data/s2/1354.gscbin b/data/s2/1354.gscbin new file mode 100644 index 00000000..e08ef364 Binary files /dev/null and b/data/s2/1354.gscbin differ diff --git a/data/s2/1355.gscbin b/data/s2/1355.gscbin new file mode 100644 index 00000000..36f48083 Binary files /dev/null and b/data/s2/1355.gscbin differ diff --git a/data/s2/1356.gscbin b/data/s2/1356.gscbin new file mode 100644 index 00000000..2cda9516 Binary files /dev/null and b/data/s2/1356.gscbin differ diff --git a/data/s2/1357.gscbin b/data/s2/1357.gscbin new file mode 100644 index 00000000..1c5b4a2d Binary files /dev/null and b/data/s2/1357.gscbin differ diff --git a/data/s2/1358.gscbin b/data/s2/1358.gscbin new file mode 100644 index 00000000..c2eaa874 Binary files /dev/null and b/data/s2/1358.gscbin differ diff --git a/data/s2/1359.gscbin b/data/s2/1359.gscbin new file mode 100644 index 00000000..939f4c50 Binary files /dev/null and b/data/s2/1359.gscbin differ diff --git a/data/s2/1360.gscbin b/data/s2/1360.gscbin new file mode 100644 index 00000000..eb128f72 Binary files /dev/null and b/data/s2/1360.gscbin differ diff --git a/data/s2/1361.gscbin b/data/s2/1361.gscbin new file mode 100644 index 00000000..e4ed0e28 Binary files /dev/null and b/data/s2/1361.gscbin differ diff --git a/data/s2/1362.gscbin b/data/s2/1362.gscbin new file mode 100644 index 00000000..f8ea1875 Binary files /dev/null and b/data/s2/1362.gscbin differ diff --git a/data/s2/1363.gscbin b/data/s2/1363.gscbin new file mode 100644 index 00000000..a55c4719 Binary files /dev/null and b/data/s2/1363.gscbin differ diff --git a/data/s2/1364.gscbin b/data/s2/1364.gscbin new file mode 100644 index 00000000..a4bdf077 Binary files /dev/null and b/data/s2/1364.gscbin differ diff --git a/data/s2/1365.gscbin b/data/s2/1365.gscbin new file mode 100644 index 00000000..518578c9 Binary files /dev/null and b/data/s2/1365.gscbin differ diff --git a/data/s2/1366.gscbin b/data/s2/1366.gscbin new file mode 100644 index 00000000..e24d0e90 Binary files /dev/null and b/data/s2/1366.gscbin differ diff --git a/data/s2/1367.gscbin b/data/s2/1367.gscbin new file mode 100644 index 00000000..b14acb52 Binary files /dev/null and b/data/s2/1367.gscbin differ diff --git a/data/s2/1368.gscbin b/data/s2/1368.gscbin new file mode 100644 index 00000000..1f9e8c1d Binary files /dev/null and b/data/s2/1368.gscbin differ diff --git a/data/s2/1369.gscbin b/data/s2/1369.gscbin new file mode 100644 index 00000000..633dc55e Binary files /dev/null and b/data/s2/1369.gscbin differ diff --git a/data/s2/1370.gscbin b/data/s2/1370.gscbin new file mode 100644 index 00000000..bf2173c9 Binary files /dev/null and b/data/s2/1370.gscbin differ diff --git a/data/s2/1371.gscbin b/data/s2/1371.gscbin new file mode 100644 index 00000000..3c4469ab Binary files /dev/null and b/data/s2/1371.gscbin differ diff --git a/data/s2/1372.gscbin b/data/s2/1372.gscbin new file mode 100644 index 00000000..99adcd89 Binary files /dev/null and b/data/s2/1372.gscbin differ diff --git a/data/s2/1374.gscbin b/data/s2/1374.gscbin new file mode 100644 index 00000000..2df4b0bc Binary files /dev/null and b/data/s2/1374.gscbin differ diff --git a/data/s2/1377.gscbin b/data/s2/1377.gscbin new file mode 100644 index 00000000..a64cad79 Binary files /dev/null and b/data/s2/1377.gscbin differ diff --git a/data/s2/1378.gscbin b/data/s2/1378.gscbin new file mode 100644 index 00000000..16d42eca Binary files /dev/null and b/data/s2/1378.gscbin differ diff --git a/data/s2/1379.gscbin b/data/s2/1379.gscbin new file mode 100644 index 00000000..f4ed508e Binary files /dev/null and b/data/s2/1379.gscbin differ diff --git a/data/s2/1380.gscbin b/data/s2/1380.gscbin new file mode 100644 index 00000000..fd30094d Binary files /dev/null and b/data/s2/1380.gscbin differ diff --git a/data/s2/1381.gscbin b/data/s2/1381.gscbin new file mode 100644 index 00000000..bbc35b9d Binary files /dev/null and b/data/s2/1381.gscbin differ diff --git a/data/s2/1382.gscbin b/data/s2/1382.gscbin new file mode 100644 index 00000000..64fc02ec Binary files /dev/null and b/data/s2/1382.gscbin differ diff --git a/data/s2/1383.gscbin b/data/s2/1383.gscbin new file mode 100644 index 00000000..19a5c6fb Binary files /dev/null and b/data/s2/1383.gscbin differ diff --git a/data/s2/1385.gscbin b/data/s2/1385.gscbin new file mode 100644 index 00000000..6d411a30 Binary files /dev/null and b/data/s2/1385.gscbin differ diff --git a/data/s2/1386.gscbin b/data/s2/1386.gscbin new file mode 100644 index 00000000..0b67090e Binary files /dev/null and b/data/s2/1386.gscbin differ diff --git a/data/s2/1387.gscbin b/data/s2/1387.gscbin new file mode 100644 index 00000000..1807fb8e Binary files /dev/null and b/data/s2/1387.gscbin differ diff --git a/data/s2/1388.gscbin b/data/s2/1388.gscbin new file mode 100644 index 00000000..492d8bb3 Binary files /dev/null and b/data/s2/1388.gscbin differ diff --git a/data/s2/1389.gscbin b/data/s2/1389.gscbin new file mode 100644 index 00000000..08b34593 Binary files /dev/null and b/data/s2/1389.gscbin differ diff --git a/data/s2/1390.gscbin b/data/s2/1390.gscbin new file mode 100644 index 00000000..dab32eca Binary files /dev/null and b/data/s2/1390.gscbin differ diff --git a/data/s2/1391.gscbin b/data/s2/1391.gscbin new file mode 100644 index 00000000..1aee8354 Binary files /dev/null and b/data/s2/1391.gscbin differ diff --git a/data/s2/1392.gscbin b/data/s2/1392.gscbin new file mode 100644 index 00000000..145f5fc4 Binary files /dev/null and b/data/s2/1392.gscbin differ diff --git a/data/s2/1393.gscbin b/data/s2/1393.gscbin new file mode 100644 index 00000000..d97e3473 Binary files /dev/null and b/data/s2/1393.gscbin differ diff --git a/data/s2/1394.gscbin b/data/s2/1394.gscbin new file mode 100644 index 00000000..dd2e9d2e Binary files /dev/null and b/data/s2/1394.gscbin differ diff --git a/data/s2/1395.gscbin b/data/s2/1395.gscbin new file mode 100644 index 00000000..89b3e3e0 Binary files /dev/null and b/data/s2/1395.gscbin differ diff --git a/data/s2/1396.gscbin b/data/s2/1396.gscbin new file mode 100644 index 00000000..9ee13f7a Binary files /dev/null and b/data/s2/1396.gscbin differ diff --git a/data/s2/1397.gscbin b/data/s2/1397.gscbin new file mode 100644 index 00000000..72039f6d Binary files /dev/null and b/data/s2/1397.gscbin differ diff --git a/data/s2/1398.gscbin b/data/s2/1398.gscbin new file mode 100644 index 00000000..765f79d9 Binary files /dev/null and b/data/s2/1398.gscbin differ diff --git a/data/s2/1399.gscbin b/data/s2/1399.gscbin new file mode 100644 index 00000000..965dfce5 Binary files /dev/null and b/data/s2/1399.gscbin differ diff --git a/data/s2/1400.gscbin b/data/s2/1400.gscbin new file mode 100644 index 00000000..d10d27f8 Binary files /dev/null and b/data/s2/1400.gscbin differ diff --git a/data/s2/1401.gscbin b/data/s2/1401.gscbin new file mode 100644 index 00000000..720fdc28 Binary files /dev/null and b/data/s2/1401.gscbin differ diff --git a/data/s2/1402.gscbin b/data/s2/1402.gscbin new file mode 100644 index 00000000..b0d9a0bd Binary files /dev/null and b/data/s2/1402.gscbin differ diff --git a/data/s2/1403.gscbin b/data/s2/1403.gscbin new file mode 100644 index 00000000..7252054f Binary files /dev/null and b/data/s2/1403.gscbin differ diff --git a/data/s2/1404.gscbin b/data/s2/1404.gscbin new file mode 100644 index 00000000..c4ebe069 Binary files /dev/null and b/data/s2/1404.gscbin differ diff --git a/data/s2/1405.gscbin b/data/s2/1405.gscbin new file mode 100644 index 00000000..95e4a1f6 Binary files /dev/null and b/data/s2/1405.gscbin differ diff --git a/data/s2/1406.gscbin b/data/s2/1406.gscbin new file mode 100644 index 00000000..ef2382a8 Binary files /dev/null and b/data/s2/1406.gscbin differ diff --git a/data/s2/1414.gscbin b/data/s2/1414.gscbin new file mode 100644 index 00000000..a2782ae0 Binary files /dev/null and b/data/s2/1414.gscbin differ diff --git a/data/s2/477.gscbin b/data/s2/477.gscbin new file mode 100644 index 00000000..ee8a6701 Binary files /dev/null and b/data/s2/477.gscbin differ diff --git a/data/s2/640.gscbin b/data/s2/640.gscbin new file mode 100644 index 00000000..4a028fda Binary files /dev/null and b/data/s2/640.gscbin differ diff --git a/data/s2/641.gscbin b/data/s2/641.gscbin new file mode 100644 index 00000000..4f9d958b Binary files /dev/null and b/data/s2/641.gscbin differ diff --git a/data/s2/642.gscbin b/data/s2/642.gscbin new file mode 100644 index 00000000..beec815b Binary files /dev/null and b/data/s2/642.gscbin differ diff --git a/data/s2/643.gscbin b/data/s2/643.gscbin new file mode 100644 index 00000000..ef37847d Binary files /dev/null and b/data/s2/643.gscbin differ diff --git a/data/s2/644.gscbin b/data/s2/644.gscbin new file mode 100644 index 00000000..d3504479 Binary files /dev/null and b/data/s2/644.gscbin differ diff --git a/data/s2/645.gscbin b/data/s2/645.gscbin new file mode 100644 index 00000000..d984a0fc Binary files /dev/null and b/data/s2/645.gscbin differ diff --git a/data/s2/646.gscbin b/data/s2/646.gscbin new file mode 100644 index 00000000..fbc69ec9 Binary files /dev/null and b/data/s2/646.gscbin differ diff --git a/data/s2/648.gscbin b/data/s2/648.gscbin new file mode 100644 index 00000000..865545fa Binary files /dev/null and b/data/s2/648.gscbin differ diff --git a/data/s2/649.gscbin b/data/s2/649.gscbin new file mode 100644 index 00000000..6ea9a42e Binary files /dev/null and b/data/s2/649.gscbin differ diff --git a/data/s2/650.gscbin b/data/s2/650.gscbin new file mode 100644 index 00000000..bed69a03 Binary files /dev/null and b/data/s2/650.gscbin differ diff --git a/data/s2/651.gscbin b/data/s2/651.gscbin new file mode 100644 index 00000000..4f309d2c Binary files /dev/null and b/data/s2/651.gscbin differ diff --git a/data/s2/652.gscbin b/data/s2/652.gscbin new file mode 100644 index 00000000..89fc1461 Binary files /dev/null and b/data/s2/652.gscbin differ diff --git a/data/s2/653.gscbin b/data/s2/653.gscbin new file mode 100644 index 00000000..4d9fe2a4 Binary files /dev/null and b/data/s2/653.gscbin differ diff --git a/data/s2/654.gscbin b/data/s2/654.gscbin new file mode 100644 index 00000000..c34962e4 Binary files /dev/null and b/data/s2/654.gscbin differ diff --git a/data/s2/751.gscbin b/data/s2/751.gscbin new file mode 100644 index 00000000..a099bef0 Binary files /dev/null and b/data/s2/751.gscbin differ diff --git a/data/s2/752.gscbin b/data/s2/752.gscbin new file mode 100644 index 00000000..28cd4a3a Binary files /dev/null and b/data/s2/752.gscbin differ diff --git a/data/s2/753.gscbin b/data/s2/753.gscbin new file mode 100644 index 00000000..5f311a51 Binary files /dev/null and b/data/s2/753.gscbin differ diff --git a/data/s2/754.gscbin b/data/s2/754.gscbin new file mode 100644 index 00000000..2e187b63 Binary files /dev/null and b/data/s2/754.gscbin differ diff --git a/data/s2/766.gscbin b/data/s2/766.gscbin new file mode 100644 index 00000000..932ff802 Binary files /dev/null and b/data/s2/766.gscbin differ diff --git a/data/s2/870.gscbin b/data/s2/870.gscbin new file mode 100644 index 00000000..3136377b Binary files /dev/null and b/data/s2/870.gscbin differ diff --git a/data/s2/871.gscbin b/data/s2/871.gscbin new file mode 100644 index 00000000..e77cf8ea Binary files /dev/null and b/data/s2/871.gscbin differ diff --git a/data/s2/888.gscbin b/data/s2/888.gscbin new file mode 100644 index 00000000..ad624497 Binary files /dev/null and b/data/s2/888.gscbin differ diff --git a/data/s2/896.gscbin b/data/s2/896.gscbin new file mode 100644 index 00000000..0d697073 Binary files /dev/null and b/data/s2/896.gscbin differ diff --git a/data/s2/codescripts/delete.gscbin b/data/s2/codescripts/delete.gscbin new file mode 100644 index 00000000..7ed674b9 Binary files /dev/null and b/data/s2/codescripts/delete.gscbin differ diff --git a/data/s2/codescripts/struct.gscbin b/data/s2/codescripts/struct.gscbin new file mode 100644 index 00000000..2348461e Binary files /dev/null and b/data/s2/codescripts/struct.gscbin differ diff --git a/data/s2/maps/mp/_achievement_engine_z_utils.gscbin b/data/s2/maps/mp/_achievement_engine_z_utils.gscbin new file mode 100644 index 00000000..87be371c Binary files /dev/null and b/data/s2/maps/mp/_achievement_engine_z_utils.gscbin differ diff --git a/data/s2/maps/mp/_events_z.gscbin b/data/s2/maps/mp/_events_z.gscbin new file mode 100644 index 00000000..ac47fca6 Binary files /dev/null and b/data/s2/maps/mp/_events_z.gscbin differ diff --git a/data/s2/maps/mp/_leprechauns.gscbin b/data/s2/maps/mp/_leprechauns.gscbin new file mode 100644 index 00000000..70a315c8 Binary files /dev/null and b/data/s2/maps/mp/_leprechauns.gscbin differ diff --git a/data/s2/maps/mp/_zombie_mp.gscbin b/data/s2/maps/mp/_zombie_mp.gscbin new file mode 100644 index 00000000..55ab1974 Binary files /dev/null and b/data/s2/maps/mp/_zombie_mp.gscbin differ diff --git a/data/s2/maps/mp/agents/_agent_common.gscbin b/data/s2/maps/mp/agents/_agent_common.gscbin new file mode 100644 index 00000000..a6279b4c Binary files /dev/null and b/data/s2/maps/mp/agents/_agent_common.gscbin differ diff --git a/data/s2/maps/mp/agents/_agent_utility.gscbin b/data/s2/maps/mp/agents/_agent_utility.gscbin new file mode 100644 index 00000000..965e5669 Binary files /dev/null and b/data/s2/maps/mp/agents/_agent_utility.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents.gscbin b/data/s2/maps/mp/agents/_agents.gscbin new file mode 100644 index 00000000..64bcf5c0 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_aces.gscbin b/data/s2/maps/mp/agents/_agents_gametype_aces.gscbin new file mode 100644 index 00000000..af0a2233 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_aces.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_air.gscbin b/data/s2/maps/mp/agents/_agents_gametype_air.gscbin new file mode 100644 index 00000000..86943d4f Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_air.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_aon.gscbin b/data/s2/maps/mp/agents/_agents_gametype_aon.gscbin new file mode 100644 index 00000000..3c4cf876 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_aon.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_assault.gscbin b/data/s2/maps/mp/agents/_agents_gametype_assault.gscbin new file mode 100644 index 00000000..988820b5 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_assault.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_ball.gscbin b/data/s2/maps/mp/agents/_agents_gametype_ball.gscbin new file mode 100644 index 00000000..0e637310 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_ball.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_blades.gscbin b/data/s2/maps/mp/agents/_agents_gametype_blades.gscbin new file mode 100644 index 00000000..7fc013c6 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_blades.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_conf.gscbin b/data/s2/maps/mp/agents/_agents_gametype_conf.gscbin new file mode 100644 index 00000000..7666bbe6 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_conf.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_control.gscbin b/data/s2/maps/mp/agents/_agents_gametype_control.gscbin new file mode 100644 index 00000000..167aac4d Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_control.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_ctf.gscbin b/data/s2/maps/mp/agents/_agents_gametype_ctf.gscbin new file mode 100644 index 00000000..9f37fcaa Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_ctf.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_demo.gscbin b/data/s2/maps/mp/agents/_agents_gametype_demo.gscbin new file mode 100644 index 00000000..4bfb2b4b Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_demo.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_dm.gscbin b/data/s2/maps/mp/agents/_agents_gametype_dm.gscbin new file mode 100644 index 00000000..4eb1948e Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_dm.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_dogfight.gscbin b/data/s2/maps/mp/agents/_agents_gametype_dogfight.gscbin new file mode 100644 index 00000000..d528cacc Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_dogfight.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_dogfight_ffa.gscbin b/data/s2/maps/mp/agents/_agents_gametype_dogfight_ffa.gscbin new file mode 100644 index 00000000..598d8dad Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_dogfight_ffa.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_dom.gscbin b/data/s2/maps/mp/agents/_agents_gametype_dom.gscbin new file mode 100644 index 00000000..fe021166 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_dom.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_gun.gscbin b/data/s2/maps/mp/agents/_agents_gametype_gun.gscbin new file mode 100644 index 00000000..14b6fba9 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_gun.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_hp.gscbin b/data/s2/maps/mp/agents/_agents_gametype_hp.gscbin new file mode 100644 index 00000000..d59d8ca8 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_hp.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_hub.gscbin b/data/s2/maps/mp/agents/_agents_gametype_hub.gscbin new file mode 100644 index 00000000..eaa80db6 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_hub.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_infect.gscbin b/data/s2/maps/mp/agents/_agents_gametype_infect.gscbin new file mode 100644 index 00000000..f32ee973 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_infect.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_lockdown.gscbin b/data/s2/maps/mp/agents/_agents_gametype_lockdown.gscbin new file mode 100644 index 00000000..b4f382e0 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_lockdown.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_oitc.gscbin b/data/s2/maps/mp/agents/_agents_gametype_oitc.gscbin new file mode 100644 index 00000000..0ee24134 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_oitc.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_onevone.gscbin b/data/s2/maps/mp/agents/_agents_gametype_onevone.gscbin new file mode 100644 index 00000000..a32ae6e4 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_onevone.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_prop.gscbin b/data/s2/maps/mp/agents/_agents_gametype_prop.gscbin new file mode 100644 index 00000000..fe2908a3 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_prop.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_raid.gscbin b/data/s2/maps/mp/agents/_agents_gametype_raid.gscbin new file mode 100644 index 00000000..000eab80 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_raid.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_relic.gscbin b/data/s2/maps/mp/agents/_agents_gametype_relic.gscbin new file mode 100644 index 00000000..039a9787 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_relic.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_scorestreak_training.gscbin b/data/s2/maps/mp/agents/_agents_gametype_scorestreak_training.gscbin new file mode 100644 index 00000000..8aae205a Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_scorestreak_training.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_sd.gscbin b/data/s2/maps/mp/agents/_agents_gametype_sd.gscbin new file mode 100644 index 00000000..f1a0bd37 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_sd.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_sr.gscbin b/data/s2/maps/mp/agents/_agents_gametype_sr.gscbin new file mode 100644 index 00000000..1c49378b Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_sr.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_twar.gscbin b/data/s2/maps/mp/agents/_agents_gametype_twar.gscbin new file mode 100644 index 00000000..5f64acd1 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_twar.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_undead.gscbin b/data/s2/maps/mp/agents/_agents_gametype_undead.gscbin new file mode 100644 index 00000000..511b0001 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_undead.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_vlobby.gscbin b/data/s2/maps/mp/agents/_agents_gametype_vlobby.gscbin new file mode 100644 index 00000000..a4a453d5 Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_vlobby.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_war.gscbin b/data/s2/maps/mp/agents/_agents_gametype_war.gscbin new file mode 100644 index 00000000..1fca47cc Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_war.gscbin differ diff --git a/data/s2/maps/mp/agents/_agents_gametype_zombies.gscbin b/data/s2/maps/mp/agents/_agents_gametype_zombies.gscbin new file mode 100644 index 00000000..27c2193d Binary files /dev/null and b/data/s2/maps/mp/agents/_agents_gametype_zombies.gscbin differ diff --git a/data/s2/maps/mp/agents/_scripted_agent_anim_util.gscbin b/data/s2/maps/mp/agents/_scripted_agent_anim_util.gscbin new file mode 100644 index 00000000..1906f2e3 Binary files /dev/null and b/data/s2/maps/mp/agents/_scripted_agent_anim_util.gscbin differ diff --git a/data/s2/maps/mp/agents/_scriptedagents.gscbin b/data/s2/maps/mp/agents/_scriptedagents.gscbin new file mode 100644 index 00000000..06decbb9 Binary files /dev/null and b/data/s2/maps/mp/agents/_scriptedagents.gscbin differ diff --git a/data/s2/maps/mp/agents/dog/_dog_idle.gscbin b/data/s2/maps/mp/agents/dog/_dog_idle.gscbin new file mode 100644 index 00000000..c35ba382 Binary files /dev/null and b/data/s2/maps/mp/agents/dog/_dog_idle.gscbin differ diff --git a/data/s2/maps/mp/agents/dog/_dog_melee.gscbin b/data/s2/maps/mp/agents/dog/_dog_melee.gscbin new file mode 100644 index 00000000..b8dbc825 Binary files /dev/null and b/data/s2/maps/mp/agents/dog/_dog_melee.gscbin differ diff --git a/data/s2/maps/mp/agents/dog/_dog_move.gscbin b/data/s2/maps/mp/agents/dog/_dog_move.gscbin new file mode 100644 index 00000000..0f452a59 Binary files /dev/null and b/data/s2/maps/mp/agents/dog/_dog_move.gscbin differ diff --git a/data/s2/maps/mp/agents/dog/_dog_think.gscbin b/data/s2/maps/mp/agents/dog/_dog_think.gscbin new file mode 100644 index 00000000..d71d0fb4 Binary files /dev/null and b/data/s2/maps/mp/agents/dog/_dog_think.gscbin differ diff --git a/data/s2/maps/mp/agents/dog/_dog_traverse.gscbin b/data/s2/maps/mp/agents/dog/_dog_traverse.gscbin new file mode 100644 index 00000000..81c26b9c Binary files /dev/null and b/data/s2/maps/mp/agents/dog/_dog_traverse.gscbin differ diff --git a/data/s2/maps/mp/agents/humanoid/_humanoid.gscbin b/data/s2/maps/mp/agents/humanoid/_humanoid.gscbin new file mode 100644 index 00000000..92bc9c27 Binary files /dev/null and b/data/s2/maps/mp/agents/humanoid/_humanoid.gscbin differ diff --git a/data/s2/maps/mp/agents/humanoid/_humanoid_idle.gscbin b/data/s2/maps/mp/agents/humanoid/_humanoid_idle.gscbin new file mode 100644 index 00000000..876cb6be Binary files /dev/null and b/data/s2/maps/mp/agents/humanoid/_humanoid_idle.gscbin differ diff --git a/data/s2/maps/mp/agents/humanoid/_humanoid_melee.gscbin b/data/s2/maps/mp/agents/humanoid/_humanoid_melee.gscbin new file mode 100644 index 00000000..c713dfc2 Binary files /dev/null and b/data/s2/maps/mp/agents/humanoid/_humanoid_melee.gscbin differ diff --git a/data/s2/maps/mp/agents/humanoid/_humanoid_move.gscbin b/data/s2/maps/mp/agents/humanoid/_humanoid_move.gscbin new file mode 100644 index 00000000..b94294f9 Binary files /dev/null and b/data/s2/maps/mp/agents/humanoid/_humanoid_move.gscbin differ diff --git a/data/s2/maps/mp/agents/humanoid/_humanoid_traverse.gscbin b/data/s2/maps/mp/agents/humanoid/_humanoid_traverse.gscbin new file mode 100644 index 00000000..47901eb2 Binary files /dev/null and b/data/s2/maps/mp/agents/humanoid/_humanoid_traverse.gscbin differ diff --git a/data/s2/maps/mp/agents/humanoid/_humanoid_util.gscbin b/data/s2/maps/mp/agents/humanoid/_humanoid_util.gscbin new file mode 100644 index 00000000..12a9bd64 Binary files /dev/null and b/data/s2/maps/mp/agents/humanoid/_humanoid_util.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots.gscbin b/data/s2/maps/mp/bots/_bots.gscbin new file mode 100644 index 00000000..34b3b1f9 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_aces.gscbin b/data/s2/maps/mp/bots/_bots_gametype_aces.gscbin new file mode 100644 index 00000000..14e8ab43 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_aces.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_air.gscbin b/data/s2/maps/mp/bots/_bots_gametype_air.gscbin new file mode 100644 index 00000000..5969842a Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_air.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_aon.gscbin b/data/s2/maps/mp/bots/_bots_gametype_aon.gscbin new file mode 100644 index 00000000..d613fdc2 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_aon.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_assault.gscbin b/data/s2/maps/mp/bots/_bots_gametype_assault.gscbin new file mode 100644 index 00000000..f9c6b4fd Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_assault.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_ball.gscbin b/data/s2/maps/mp/bots/_bots_gametype_ball.gscbin new file mode 100644 index 00000000..cafc846c Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_ball.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_blades.gscbin b/data/s2/maps/mp/bots/_bots_gametype_blades.gscbin new file mode 100644 index 00000000..f3883bdd Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_blades.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_common.gscbin b/data/s2/maps/mp/bots/_bots_gametype_common.gscbin new file mode 100644 index 00000000..1b6db078 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_common.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_conf.gscbin b/data/s2/maps/mp/bots/_bots_gametype_conf.gscbin new file mode 100644 index 00000000..b681ed06 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_conf.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_control.gscbin b/data/s2/maps/mp/bots/_bots_gametype_control.gscbin new file mode 100644 index 00000000..ec73ef6c Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_control.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_ctf.gscbin b/data/s2/maps/mp/bots/_bots_gametype_ctf.gscbin new file mode 100644 index 00000000..c53acaf7 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_ctf.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_demo.gscbin b/data/s2/maps/mp/bots/_bots_gametype_demo.gscbin new file mode 100644 index 00000000..9b4dc020 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_demo.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_dm.gscbin b/data/s2/maps/mp/bots/_bots_gametype_dm.gscbin new file mode 100644 index 00000000..79548d10 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_dm.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_dogfight.gscbin b/data/s2/maps/mp/bots/_bots_gametype_dogfight.gscbin new file mode 100644 index 00000000..c750b0c1 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_dogfight.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_dogfight_ffa.gscbin b/data/s2/maps/mp/bots/_bots_gametype_dogfight_ffa.gscbin new file mode 100644 index 00000000..ec2231e7 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_dogfight_ffa.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_dom.gscbin b/data/s2/maps/mp/bots/_bots_gametype_dom.gscbin new file mode 100644 index 00000000..71c92d00 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_dom.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_gun.gscbin b/data/s2/maps/mp/bots/_bots_gametype_gun.gscbin new file mode 100644 index 00000000..dec58725 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_gun.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_hp.gscbin b/data/s2/maps/mp/bots/_bots_gametype_hp.gscbin new file mode 100644 index 00000000..89cd6617 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_hp.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_hub.gscbin b/data/s2/maps/mp/bots/_bots_gametype_hub.gscbin new file mode 100644 index 00000000..8e2f4d02 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_hub.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_infect.gscbin b/data/s2/maps/mp/bots/_bots_gametype_infect.gscbin new file mode 100644 index 00000000..093b7421 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_infect.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_lockdown.gscbin b/data/s2/maps/mp/bots/_bots_gametype_lockdown.gscbin new file mode 100644 index 00000000..8230be54 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_lockdown.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_oitc.gscbin b/data/s2/maps/mp/bots/_bots_gametype_oitc.gscbin new file mode 100644 index 00000000..79552ebb Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_oitc.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_onevone.gscbin b/data/s2/maps/mp/bots/_bots_gametype_onevone.gscbin new file mode 100644 index 00000000..bc9bb695 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_onevone.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_prop.gscbin b/data/s2/maps/mp/bots/_bots_gametype_prop.gscbin new file mode 100644 index 00000000..6ec9e185 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_prop.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_raid.gscbin b/data/s2/maps/mp/bots/_bots_gametype_raid.gscbin new file mode 100644 index 00000000..dda931dd Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_raid.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_relic.gscbin b/data/s2/maps/mp/bots/_bots_gametype_relic.gscbin new file mode 100644 index 00000000..c40b49e7 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_relic.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_scorestreak_training.gscbin b/data/s2/maps/mp/bots/_bots_gametype_scorestreak_training.gscbin new file mode 100644 index 00000000..a8fd1f3c Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_scorestreak_training.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_sd.gscbin b/data/s2/maps/mp/bots/_bots_gametype_sd.gscbin new file mode 100644 index 00000000..fe84c370 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_sd.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_sr.gscbin b/data/s2/maps/mp/bots/_bots_gametype_sr.gscbin new file mode 100644 index 00000000..92d5f499 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_sr.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_twar.gscbin b/data/s2/maps/mp/bots/_bots_gametype_twar.gscbin new file mode 100644 index 00000000..b5ea75b2 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_twar.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_undead.gscbin b/data/s2/maps/mp/bots/_bots_gametype_undead.gscbin new file mode 100644 index 00000000..214f155a Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_undead.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_vlobby.gscbin b/data/s2/maps/mp/bots/_bots_gametype_vlobby.gscbin new file mode 100644 index 00000000..2ea9747c Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_vlobby.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_war.gscbin b/data/s2/maps/mp/bots/_bots_gametype_war.gscbin new file mode 100644 index 00000000..f3b77423 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_war.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_gametype_zombies.gscbin b/data/s2/maps/mp/bots/_bots_gametype_zombies.gscbin new file mode 100644 index 00000000..a31e0451 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_gametype_zombies.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_ks.gscbin b/data/s2/maps/mp/bots/_bots_ks.gscbin new file mode 100644 index 00000000..f3e30d3a Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_ks.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_ks_remote_vehicle.gscbin b/data/s2/maps/mp/bots/_bots_ks_remote_vehicle.gscbin new file mode 100644 index 00000000..c05fcd32 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_ks_remote_vehicle.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_loadout.gscbin b/data/s2/maps/mp/bots/_bots_loadout.gscbin new file mode 100644 index 00000000..481d53c5 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_loadout.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_personality.gscbin b/data/s2/maps/mp/bots/_bots_personality.gscbin new file mode 100644 index 00000000..6e677462 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_personality.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_sentry.gscbin b/data/s2/maps/mp/bots/_bots_sentry.gscbin new file mode 100644 index 00000000..86e8b5ae Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_sentry.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_strategy.gscbin b/data/s2/maps/mp/bots/_bots_strategy.gscbin new file mode 100644 index 00000000..55efc288 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_strategy.gscbin differ diff --git a/data/s2/maps/mp/bots/_bots_util.gscbin b/data/s2/maps/mp/bots/_bots_util.gscbin new file mode 100644 index 00000000..f5fa4893 Binary files /dev/null and b/data/s2/maps/mp/bots/_bots_util.gscbin differ diff --git a/data/s2/maps/mp/gametypes/_prop_controls.gscbin b/data/s2/maps/mp/gametypes/_prop_controls.gscbin new file mode 100644 index 00000000..20a3da5a Binary files /dev/null and b/data/s2/maps/mp/gametypes/_prop_controls.gscbin differ diff --git a/data/s2/maps/mp/gametypes/_prop_dev.gscbin b/data/s2/maps/mp/gametypes/_prop_dev.gscbin new file mode 100644 index 00000000..b690e4eb Binary files /dev/null and b/data/s2/maps/mp/gametypes/_prop_dev.gscbin differ diff --git a/data/s2/maps/mp/gametypes/_raid_tripwire.gscbin b/data/s2/maps/mp/gametypes/_raid_tripwire.gscbin new file mode 100644 index 00000000..c82286d6 Binary files /dev/null and b/data/s2/maps/mp/gametypes/_raid_tripwire.gscbin differ diff --git a/data/s2/maps/mp/gametypes/aon.gscbin b/data/s2/maps/mp/gametypes/aon.gscbin new file mode 100644 index 00000000..506c3b40 Binary files /dev/null and b/data/s2/maps/mp/gametypes/aon.gscbin differ diff --git a/data/s2/maps/mp/gametypes/ball.gscbin b/data/s2/maps/mp/gametypes/ball.gscbin new file mode 100644 index 00000000..80332207 Binary files /dev/null and b/data/s2/maps/mp/gametypes/ball.gscbin differ diff --git a/data/s2/maps/mp/gametypes/blades.gscbin b/data/s2/maps/mp/gametypes/blades.gscbin new file mode 100644 index 00000000..437da70f Binary files /dev/null and b/data/s2/maps/mp/gametypes/blades.gscbin differ diff --git a/data/s2/maps/mp/gametypes/common_sd_sr.gscbin b/data/s2/maps/mp/gametypes/common_sd_sr.gscbin new file mode 100644 index 00000000..cf04c1e4 Binary files /dev/null and b/data/s2/maps/mp/gametypes/common_sd_sr.gscbin differ diff --git a/data/s2/maps/mp/gametypes/conf.gscbin b/data/s2/maps/mp/gametypes/conf.gscbin new file mode 100644 index 00000000..48c1dea1 Binary files /dev/null and b/data/s2/maps/mp/gametypes/conf.gscbin differ diff --git a/data/s2/maps/mp/gametypes/control.gscbin b/data/s2/maps/mp/gametypes/control.gscbin new file mode 100644 index 00000000..a3fbec59 Binary files /dev/null and b/data/s2/maps/mp/gametypes/control.gscbin differ diff --git a/data/s2/maps/mp/gametypes/ctf.gscbin b/data/s2/maps/mp/gametypes/ctf.gscbin new file mode 100644 index 00000000..19943989 Binary files /dev/null and b/data/s2/maps/mp/gametypes/ctf.gscbin differ diff --git a/data/s2/maps/mp/gametypes/demo.gscbin b/data/s2/maps/mp/gametypes/demo.gscbin new file mode 100644 index 00000000..45f1f757 Binary files /dev/null and b/data/s2/maps/mp/gametypes/demo.gscbin differ diff --git a/data/s2/maps/mp/gametypes/dm.gscbin b/data/s2/maps/mp/gametypes/dm.gscbin new file mode 100644 index 00000000..47a267b5 Binary files /dev/null and b/data/s2/maps/mp/gametypes/dm.gscbin differ diff --git a/data/s2/maps/mp/gametypes/dogfight.gscbin b/data/s2/maps/mp/gametypes/dogfight.gscbin new file mode 100644 index 00000000..bd4cacfc Binary files /dev/null and b/data/s2/maps/mp/gametypes/dogfight.gscbin differ diff --git a/data/s2/maps/mp/gametypes/dogfight_common.gscbin b/data/s2/maps/mp/gametypes/dogfight_common.gscbin new file mode 100644 index 00000000..55d21423 Binary files /dev/null and b/data/s2/maps/mp/gametypes/dogfight_common.gscbin differ diff --git a/data/s2/maps/mp/gametypes/dogfight_common_aud.gscbin b/data/s2/maps/mp/gametypes/dogfight_common_aud.gscbin new file mode 100644 index 00000000..668d7606 Binary files /dev/null and b/data/s2/maps/mp/gametypes/dogfight_common_aud.gscbin differ diff --git a/data/s2/maps/mp/gametypes/dogfight_ffa.gscbin b/data/s2/maps/mp/gametypes/dogfight_ffa.gscbin new file mode 100644 index 00000000..0a0f842a Binary files /dev/null and b/data/s2/maps/mp/gametypes/dogfight_ffa.gscbin differ diff --git a/data/s2/maps/mp/gametypes/dogfight_scorestreaks.gscbin b/data/s2/maps/mp/gametypes/dogfight_scorestreaks.gscbin new file mode 100644 index 00000000..b794883e Binary files /dev/null and b/data/s2/maps/mp/gametypes/dogfight_scorestreaks.gscbin differ diff --git a/data/s2/maps/mp/gametypes/dom.gscbin b/data/s2/maps/mp/gametypes/dom.gscbin new file mode 100644 index 00000000..f8f9941d Binary files /dev/null and b/data/s2/maps/mp/gametypes/dom.gscbin differ diff --git a/data/s2/maps/mp/gametypes/gun.gscbin b/data/s2/maps/mp/gametypes/gun.gscbin new file mode 100644 index 00000000..d0f7e777 Binary files /dev/null and b/data/s2/maps/mp/gametypes/gun.gscbin differ diff --git a/data/s2/maps/mp/gametypes/hp.gscbin b/data/s2/maps/mp/gametypes/hp.gscbin new file mode 100644 index 00000000..3e995478 Binary files /dev/null and b/data/s2/maps/mp/gametypes/hp.gscbin differ diff --git a/data/s2/maps/mp/gametypes/hub.gscbin b/data/s2/maps/mp/gametypes/hub.gscbin new file mode 100644 index 00000000..5dc1e16f Binary files /dev/null and b/data/s2/maps/mp/gametypes/hub.gscbin differ diff --git a/data/s2/maps/mp/gametypes/infect.gscbin b/data/s2/maps/mp/gametypes/infect.gscbin new file mode 100644 index 00000000..ee0b8b3c Binary files /dev/null and b/data/s2/maps/mp/gametypes/infect.gscbin differ diff --git a/data/s2/maps/mp/gametypes/lockdown.gscbin b/data/s2/maps/mp/gametypes/lockdown.gscbin new file mode 100644 index 00000000..9766fd3e Binary files /dev/null and b/data/s2/maps/mp/gametypes/lockdown.gscbin differ diff --git a/data/s2/maps/mp/gametypes/oitc.gscbin b/data/s2/maps/mp/gametypes/oitc.gscbin new file mode 100644 index 00000000..e81efafd Binary files /dev/null and b/data/s2/maps/mp/gametypes/oitc.gscbin differ diff --git a/data/s2/maps/mp/gametypes/onevone.gscbin b/data/s2/maps/mp/gametypes/onevone.gscbin new file mode 100644 index 00000000..19d2efe1 Binary files /dev/null and b/data/s2/maps/mp/gametypes/onevone.gscbin differ diff --git a/data/s2/maps/mp/gametypes/prop.gscbin b/data/s2/maps/mp/gametypes/prop.gscbin new file mode 100644 index 00000000..2691f3fd Binary files /dev/null and b/data/s2/maps/mp/gametypes/prop.gscbin differ diff --git a/data/s2/maps/mp/gametypes/relic.gscbin b/data/s2/maps/mp/gametypes/relic.gscbin new file mode 100644 index 00000000..174a4648 Binary files /dev/null and b/data/s2/maps/mp/gametypes/relic.gscbin differ diff --git a/data/s2/maps/mp/gametypes/scorestreak_training.gscbin b/data/s2/maps/mp/gametypes/scorestreak_training.gscbin new file mode 100644 index 00000000..75f6b364 Binary files /dev/null and b/data/s2/maps/mp/gametypes/scorestreak_training.gscbin differ diff --git a/data/s2/maps/mp/gametypes/sd.gscbin b/data/s2/maps/mp/gametypes/sd.gscbin new file mode 100644 index 00000000..5a32255f Binary files /dev/null and b/data/s2/maps/mp/gametypes/sd.gscbin differ diff --git a/data/s2/maps/mp/gametypes/sr.gscbin b/data/s2/maps/mp/gametypes/sr.gscbin new file mode 100644 index 00000000..f90c1664 Binary files /dev/null and b/data/s2/maps/mp/gametypes/sr.gscbin differ diff --git a/data/s2/maps/mp/gametypes/twar.gscbin b/data/s2/maps/mp/gametypes/twar.gscbin new file mode 100644 index 00000000..1851e3fd Binary files /dev/null and b/data/s2/maps/mp/gametypes/twar.gscbin differ diff --git a/data/s2/maps/mp/gametypes/undead.gscbin b/data/s2/maps/mp/gametypes/undead.gscbin new file mode 100644 index 00000000..2df74ea0 Binary files /dev/null and b/data/s2/maps/mp/gametypes/undead.gscbin differ diff --git a/data/s2/maps/mp/gametypes/vlobby.gscbin b/data/s2/maps/mp/gametypes/vlobby.gscbin new file mode 100644 index 00000000..c997b7b1 Binary files /dev/null and b/data/s2/maps/mp/gametypes/vlobby.gscbin differ diff --git a/data/s2/maps/mp/gametypes/war.gscbin b/data/s2/maps/mp/gametypes/war.gscbin new file mode 100644 index 00000000..324755ce Binary files /dev/null and b/data/s2/maps/mp/gametypes/war.gscbin differ diff --git a/data/s2/maps/mp/gametypes/zombies.gscbin b/data/s2/maps/mp/gametypes/zombies.gscbin new file mode 100644 index 00000000..ecc2ba9a Binary files /dev/null and b/data/s2/maps/mp/gametypes/zombies.gscbin differ diff --git a/data/s2/maps/mp/killstreaks/_basic_training_serum.gscbin b/data/s2/maps/mp/killstreaks/_basic_training_serum.gscbin new file mode 100644 index 00000000..f0a78bc0 Binary files /dev/null and b/data/s2/maps/mp/killstreaks/_basic_training_serum.gscbin differ diff --git a/data/s2/maps/mp/killstreaks/_raid_ss_serum_util.gscbin b/data/s2/maps/mp/killstreaks/_raid_ss_serum_util.gscbin new file mode 100644 index 00000000..432e87ee Binary files /dev/null and b/data/s2/maps/mp/killstreaks/_raid_ss_serum_util.gscbin differ diff --git a/data/s2/maps/mp/perks/_medic.gscbin b/data/s2/maps/mp/perks/_medic.gscbin new file mode 100644 index 00000000..34187ae2 Binary files /dev/null and b/data/s2/maps/mp/perks/_medic.gscbin differ diff --git a/data/s2/maps/mp/zombies/_zombies_event_mtx7.gscbin b/data/s2/maps/mp/zombies/_zombies_event_mtx7.gscbin new file mode 100644 index 00000000..5fef8369 Binary files /dev/null and b/data/s2/maps/mp/zombies/_zombies_event_mtx7.gscbin differ diff --git a/data/s2/maps/mp/zombies/_zombies_progression.gscbin b/data/s2/maps/mp/zombies/_zombies_progression.gscbin new file mode 100644 index 00000000..5b205bb5 Binary files /dev/null and b/data/s2/maps/mp/zombies/_zombies_progression.gscbin differ diff --git a/data/s2/maps/mp/zombies/consumables/inv_armor.gscbin b/data/s2/maps/mp/zombies/consumables/inv_armor.gscbin new file mode 100644 index 00000000..dee9f0b4 Binary files /dev/null and b/data/s2/maps/mp/zombies/consumables/inv_armor.gscbin differ diff --git a/data/s2/maps/mp/zombies/consumables/inv_giest_shield.gscbin b/data/s2/maps/mp/zombies/consumables/inv_giest_shield.gscbin new file mode 100644 index 00000000..b46dc3d9 Binary files /dev/null and b/data/s2/maps/mp/zombies/consumables/inv_giest_shield.gscbin differ diff --git a/data/s2/maps/mp/zombies/consumables/inv_rng_ability.gscbin b/data/s2/maps/mp/zombies/consumables/inv_rng_ability.gscbin new file mode 100644 index 00000000..5d9fe8f5 Binary files /dev/null and b/data/s2/maps/mp/zombies/consumables/inv_rng_ability.gscbin differ diff --git a/data/s2/maps/mp/zombies/weapons/_zombie_aoe_grenade.gscbin b/data/s2/maps/mp/zombies/weapons/_zombie_aoe_grenade.gscbin new file mode 100644 index 00000000..9fad871b Binary files /dev/null and b/data/s2/maps/mp/zombies/weapons/_zombie_aoe_grenade.gscbin differ diff --git a/data/s2/maps/mp/zombies/weapons/_zombie_de_lisle_carbine.gscbin b/data/s2/maps/mp/zombies/weapons/_zombie_de_lisle_carbine.gscbin new file mode 100644 index 00000000..856905cf Binary files /dev/null and b/data/s2/maps/mp/zombies/weapons/_zombie_de_lisle_carbine.gscbin differ diff --git a/data/s2/maps/mp/zombies/weapons/_zombie_funderbuss.gscbin b/data/s2/maps/mp/zombies/weapons/_zombie_funderbuss.gscbin new file mode 100644 index 00000000..359a23b0 Binary files /dev/null and b/data/s2/maps/mp/zombies/weapons/_zombie_funderbuss.gscbin differ diff --git a/data/s2/maps/mp/zombies/weapons/_zombie_razer_gun.gscbin b/data/s2/maps/mp/zombies/weapons/_zombie_razer_gun.gscbin new file mode 100644 index 00000000..7e42c692 Binary files /dev/null and b/data/s2/maps/mp/zombies/weapons/_zombie_razer_gun.gscbin differ diff --git a/data/s2/maps/mp/zombies/weapons/_zombie_type_38.gscbin b/data/s2/maps/mp/zombies/weapons/_zombie_type_38.gscbin new file mode 100644 index 00000000..ef657ca8 Binary files /dev/null and b/data/s2/maps/mp/zombies/weapons/_zombie_type_38.gscbin differ diff --git a/data/s2/maps/mp/zombies/weapons/_zombies_scripted_lmg_upgrades.gscbin b/data/s2/maps/mp/zombies/weapons/_zombies_scripted_lmg_upgrades.gscbin new file mode 100644 index 00000000..e0f90618 Binary files /dev/null and b/data/s2/maps/mp/zombies/weapons/_zombies_scripted_lmg_upgrades.gscbin differ diff --git a/data/s2/maps/mp/zombies/weapons/_zombies_scripted_mtx_20_paps.gscbin b/data/s2/maps/mp/zombies/weapons/_zombies_scripted_mtx_20_paps.gscbin new file mode 100644 index 00000000..fb1def41 Binary files /dev/null and b/data/s2/maps/mp/zombies/weapons/_zombies_scripted_mtx_20_paps.gscbin differ diff --git a/data/s2/maps/mp/zombies/weapons/_zombies_scripted_mtx_9_paps.gscbin b/data/s2/maps/mp/zombies/weapons/_zombies_scripted_mtx_9_paps.gscbin new file mode 100644 index 00000000..eaed8ef8 Binary files /dev/null and b/data/s2/maps/mp/zombies/weapons/_zombies_scripted_mtx_9_paps.gscbin differ diff --git a/data/s2/maps/mp/zombies/zombie_weapon_kits_shared.gscbin b/data/s2/maps/mp/zombies/zombie_weapon_kits_shared.gscbin new file mode 100644 index 00000000..f7b85687 Binary files /dev/null and b/data/s2/maps/mp/zombies/zombie_weapon_kits_shared.gscbin differ diff --git a/deps/zlib b/deps/zlib new file mode 160000 index 00000000..53ce2713 --- /dev/null +++ b/deps/zlib @@ -0,0 +1 @@ +Subproject commit 53ce2713117ef2a8ed682d77b944df991c499252 diff --git a/deps/zlib.lua b/deps/zlib.lua new file mode 100644 index 00000000..9bba7722 --- /dev/null +++ b/deps/zlib.lua @@ -0,0 +1,34 @@ +zlib = { base = path.join(dependencies.base, "zlib") } + +function zlib:include() + includedirs { zlib.base } +end + +function zlib:link() + links { "zlib" } + self:include() +end + +function zlib:project() + project "zlib" + kind "StaticLib" + language "C" + warnings "off" + + self:include() + + files + { + path.join(zlib.base, "*.h"), + path.join(zlib.base, "*.c") + } + + defines + { + "_CRT_SECURE_NO_WARNINGS", + "_CRT_NONSTDC_NO_DEPRECATE", + "_CRT_SECURE_NO_DEPRECATE", + } +end + +table.insert(dependencies, zlib) diff --git a/gen/h1/Makefile b/gen/h1/Makefile new file mode 100644 index 00000000..b1f63ef8 --- /dev/null +++ b/gen/h1/Makefile @@ -0,0 +1,11 @@ +generate: H1 + +clean: + rm -rf ./parser.hpp + rm -rf ./parser.cpp + rm -rf ./lexer.hpp + rm -rf ./lexer.cpp + +H1: lexer.lpp parser.ypp + flex lexer.lpp + bison parser.ypp -Wcounterexamples diff --git a/gen/h1/lexer.lpp b/gen/h1/lexer.lpp new file mode 100644 index 00000000..3f4ab440 --- /dev/null +++ b/gen/h1/lexer.lpp @@ -0,0 +1,145 @@ +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ + +%option outfile="lexer.cpp" +%option header-file="lexer.hpp" +%option prefix="h1_" +%option reentrant +%option noyywrap batch nounput noinput +%option never-interactive +%option nounistd + +%top{ +#include "stdafx.hpp" +#include "h1.hpp" +#include "parser.hpp" +using namespace xsk::gsc; +} + +%{ +#define YY_USER_ACTION loc.columns(yyleng); +%} + +RGX_FILE ([_A-Za-z0-9]+\\)+[_A-Za-z0-9]+ +RGX_NAME [_A-Za-z][_A-Za-z0-9]* +RGX_STRING \"(?:\\.|[^\"])*?\"|\'(?:\\.|[^\'])*?\' +RGX_FLOAT [0-9]+\.(?:[0-9]*)?f?|\.[0-9]+f? +RGX_INTEGER [0-9]+ +RGX_DEFAULT (.|\n) + +%x COMMENT_BLOCK_STATE +%x DEVELOPER_BLOCK_STATE + +%% + +%{ + loc.step(); +%} + +[ \t\r] { loc.step(); } + +\n { loc.lines(yyleng); loc.step(); } + +"//".* + +"/*" { BEGIN(COMMENT_BLOCK_STATE); } +. +\n { loc.lines(yyleng); loc.step(); } +"*/" { BEGIN(INITIAL); } + +"/#" { BEGIN(DEVELOPER_BLOCK_STATE); } +. +\n { loc.lines(yyleng); loc.step(); } +"#/" { BEGIN(INITIAL); } + +"#include" { return h1::parser::make_INCLUDE(loc); } +"#using_animtree" { return h1::parser::make_USINGTREE(loc); } +"#animtree" { return h1::parser::make_ANIMTREE(loc); } +"endon" { return h1::parser::make_ENDON(loc); } +"notify" { return h1::parser::make_NOTIFY(loc); } +"wait" { return h1::parser::make_WAIT(loc); } +"waittill" { return h1::parser::make_WAITTILL(loc); } +"waittillmatch" { return h1::parser::make_WAITTILLMATCH(loc); } +"waittillframeend" { return h1::parser::make_WAITTILLFRAMEEND(loc); } +"waitframe" { return h1::parser::make_WAITFRAME(loc); } +"if" { return h1::parser::make_IF(loc); } +"else" { return h1::parser::make_ELSE(loc); } +"while" { return h1::parser::make_WHILE(loc); } +"for" { return h1::parser::make_FOR(loc); } +"foreach" { return h1::parser::make_FOREACH(loc); } +"in" { return h1::parser::make_IN(loc); } +"switch" { return h1::parser::make_SWITCH(loc); } +"case" { return h1::parser::make_CASE(loc); } +"default" { return h1::parser::make_DEFAULT(loc); } +"break" { return h1::parser::make_BREAK(loc); } +"continue" { return h1::parser::make_CONTINUE(loc); } +"return" { return h1::parser::make_RETURN(loc); } +"thread" { return h1::parser::make_THREAD(loc); } +"childthread" { return h1::parser::make_CHILDTHREAD(loc); } +"thisthread" { return h1::parser::make_THISTHREAD(loc); } +"call" { return h1::parser::make_CALL(loc); } +"true" { return h1::parser::make_TRUE(loc); } +"false" { return h1::parser::make_FALSE(loc); } +"undefined" { return h1::parser::make_UNDEFINED(loc); } +"size" { return h1::parser::make_SIZE(loc); } +"game" { return h1::parser::make_GAME(loc); } +"self" { return h1::parser::make_SELF(loc); } +"anim" { return h1::parser::make_ANIM(loc); } +"level" { return h1::parser::make_LEVEL(loc); } +\( { return h1::parser::make_LPAREN(loc); } +\) { return h1::parser::make_RPAREN(loc); } +\{ { return h1::parser::make_LBRACE(loc); } +\} { return h1::parser::make_RBRACE(loc); } +\[ { return h1::parser::make_LBRACKET(loc); } +\] { return h1::parser::make_RBRACKET(loc); } +\, { return h1::parser::make_COMMA(loc); } +\. { return h1::parser::make_DOT(loc); } +\:\: { return h1::parser::make_DOUBLECOLON(loc); } +\: { return h1::parser::make_COLON(loc); } +\; { return h1::parser::make_SEMICOLON(loc); } +\+\+ { return h1::parser::make_INCREMENT(loc); } +\-\- { return h1::parser::make_DECREMENT(loc); } +\<\<\= { return h1::parser::make_ASSIGN_LSHIFT(loc); } +\>\>\= { return h1::parser::make_ASSIGN_RSHIFT(loc); } +\<\< { return h1::parser::make_LSHIFT(loc); } +\>\> { return h1::parser::make_RSHIFT(loc); } +\|\| { return h1::parser::make_OR(loc); } +\&\& { return h1::parser::make_AND(loc); } +\=\= { return h1::parser::make_EQUALITY(loc); } +\!\= { return h1::parser::make_INEQUALITY(loc); } +\<\= { return h1::parser::make_LESS_EQUAL(loc); } +\>\= { return h1::parser::make_GREATER_EQUAL(loc); } +\< { return h1::parser::make_LESS(loc); } +\> { return h1::parser::make_GREATER(loc); } +\+\= { return h1::parser::make_ASSIGN_ADD(loc); } +\-\= { return h1::parser::make_ASSIGN_SUB(loc); } +\*\= { return h1::parser::make_ASSIGN_MULT(loc); } +\/\= { return h1::parser::make_ASSIGN_DIV(loc); } +\%\= { return h1::parser::make_ASSIGN_MOD(loc); } +\|\= { return h1::parser::make_ASSIGN_BITWISE_OR(loc); } +\&\= { return h1::parser::make_ASSIGN_BITWISE_AND(loc); } +\^\= { return h1::parser::make_ASSIGN_BITWISE_EXOR(loc); } +\= { return h1::parser::make_ASSIGN(loc); } +\+ { return h1::parser::make_ADD(loc); } +\- { return h1::parser::make_SUB(loc); } +\* { return h1::parser::make_MULT(loc); } +\/ { return h1::parser::make_DIV(loc); } +\% { return h1::parser::make_MOD(loc); } +\! { return h1::parser::make_NOT(loc); } +\~ { return h1::parser::make_COMPLEMENT(loc); } +\| { return h1::parser::make_BITWISE_OR(loc); } +\& { return h1::parser::make_BITWISE_AND(loc); } +\^ { return h1::parser::make_BITWISE_EXOR(loc); } +{RGX_FILE} { return h1::parser::make_FILE(utils::string::fordslash(yytext), loc); } +{RGX_NAME} { return h1::parser::make_NAME((std::string(yytext, 3) == "_ID") ? std::string(yytext) : utils::string::to_lower(yytext), loc); } +\&{RGX_STRING} { return h1::parser::make_ISTRING(std::string(yytext).substr(1), loc); } +{RGX_STRING} { return h1::parser::make_STRING(std::string(yytext), loc); } +{RGX_FLOAT} { return h1::parser::make_FLOAT(std::string(yytext), loc); } +{RGX_INTEGER} { return h1::parser::make_INTEGER(std::string(yytext), loc); } +<> { return h1::parser::make_H1EOF(loc); } +<*>{RGX_DEFAULT} { throw h1::parser::syntax_error(loc, "bad token: \'" + std::string(yytext) + "\'"); } + +%% diff --git a/gen/h1/parser.ypp b/gen/h1/parser.ypp new file mode 100644 index 00000000..6bfe8ba2 --- /dev/null +++ b/gen/h1/parser.ypp @@ -0,0 +1,644 @@ +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ + +%require "3.7" +%skeleton "lalr1.cc" +%language "c++" +%output "parser.cpp" +%defines "parser.hpp" +%define api.prefix {H1} +%define api.namespace {xsk::gsc::h1} +%define api.location.type {xsk::gsc::location} +%define api.value.type variant +%define api.token.constructor +%define api.token.raw +%define parse.assert +%define parse.trace +%define parse.error detailed +%define parse.lac full + +%locations + +%lex-param { yyscan_t yyscanner } +%lex-param { xsk::gsc::location& loc } + +%parse-param { yyscan_t yyscanner } +%parse-param { xsk::gsc::location& loc } +%parse-param { xsk::gsc::program_ptr& ast } + +%code requires +{ +#include "h1.hpp" +typedef void *yyscan_t; +#define YY_DECL xsk::gsc::h1::parser::symbol_type H1lex(yyscan_t yyscanner, xsk::gsc::location& loc) +} + +%code top +{ +#include "stdafx.hpp" +#include "parser.hpp" +#include "lexer.hpp" +using namespace xsk::gsc; +xsk::gsc::h1::parser::symbol_type H1lex(yyscan_t yyscanner, xsk::gsc::location& loc); +} + +%token INCLUDE "#include" +%token USINGTREE "#using_animtree" +%token ANIMTREE "#animtree" +%token ENDON "endon" +%token NOTIFY "notify" +%token WAIT "wait" +%token WAITTILL "waittill" +%token WAITTILLMATCH "waittillmatch" +%token WAITTILLFRAMEEND "waittillframeend" +%token WAITFRAME "waitframe" +%token IF "if" +%token ELSE "else" +%token WHILE "while" +%token FOR "for" +%token FOREACH "foreach" +%token IN "in" +%token SWITCH "switch" +%token CASE "case" +%token DEFAULT "default" +%token BREAK "break" +%token CONTINUE "continue" +%token RETURN "return" +%token THREAD "thread" +%token CHILDTHREAD "childthread" +%token THISTHREAD "thisthread" +%token CALL "call" +%token TRUE "true" +%token FALSE "false" +%token UNDEFINED "undefined" +%token SIZE "size" +%token GAME "game" +%token SELF "self" +%token ANIM "anim" +%token LEVEL "level" +%token LPAREN "(" +%token RPAREN ")" +%token LBRACE "{" +%token RBRACE "}" +%token LBRACKET "[" +%token RBRACKET "]" +%token COMMA "," +%token DOT "." +%token DOUBLECOLON "::" +%token COLON ":" +%token SEMICOLON ";" +%token INCREMENT "++" +%token DECREMENT "--" +%token LSHIFT "<<" +%token RSHIFT ">>" +%token OR "||" +%token AND "&&" +%token EQUALITY "==" +%token INEQUALITY "!=" +%token LESS_EQUAL "<=" +%token GREATER_EQUAL ">=" +%token LESS "<" +%token GREATER ">" +%token NOT "!" +%token COMPLEMENT "~" +%token ASSIGN "=" +%token ASSIGN_ADD "+=" +%token ASSIGN_SUB "-=" +%token ASSIGN_MULT "*=" +%token ASSIGN_DIV "/=" +%token ASSIGN_MOD "%=" +%token ASSIGN_BITWISE_OR "|=" +%token ASSIGN_BITWISE_AND "&=" +%token ASSIGN_BITWISE_EXOR "^=" +%token ASSIGN_RSHIFT ">>=" +%token ASSIGN_LSHIFT "<<=" +%token BITWISE_OR "|" +%token BITWISE_AND "&" +%token BITWISE_EXOR "^" +%token ADD "+" +%token SUB "-" +%token MULT "*" +%token DIV "/" +%token MOD "%" +%token FILE "file path" +%token NAME "identifier" +%token STRING "string literal" +%token ISTRING "localized string" +%token FLOAT "float" +%token INTEGER "int" + +%type program +%type include +%type define +%type usingtree +%type constant +%type thread +%type parameters +%type stmt +%type stmt_block +%type stmt_list +%type stmt_call +%type stmt_assign +%type stmt_endon +%type stmt_notify +%type stmt_wait +%type stmt_waittill +%type stmt_waittillmatch +%type stmt_waittillframeend +%type stmt_waitframe +%type stmt_if +%type stmt_ifelse +%type stmt_while +%type stmt_for +%type stmt_foreach +%type stmt_switch +%type stmt_case +%type stmt_default +%type stmt_break +%type stmt_continue +%type stmt_return +%type for_stmt +%type for_expr +%type expr_assign +%type expr +%type expr_compare +%type expr_binary +%type expr_primitive +%type expr_call +%type expr_call_thread +%type expr_call_childthread +%type expr_call_function +%type expr_call_pointer +%type expr_arguments +%type expr_arguments_filled +%type expr_arguments_empty +%type expr_function +%type expr_add_array +%type expr_array +%type expr_field +%type expr_size +%type object +%type thisthread +%type empty_array +%type undefined +%type game +%type self +%type anim +%type level +%type animation +%type animtree +%type name +%type file +%type istring +%type string +%type vector +%type neg_float +%type neg_integer +%type float +%type integer +%type false +%type true + +%nonassoc ADD_ARRAY +%nonassoc RBRACKET +%nonassoc THEN +%nonassoc ELSE +%nonassoc INCREMENT DECREMENT + +%left OR +%left AND +%left BITWISE_OR +%left BITWISE_AND +%left BITWISE_EXOR +%left EQUALITY INEQUALITY +%left LESS GREATER LESS_EQUAL GREATER_EQUAL +%left LSHIFT RSHIFT +%left ADD SUB +%left MULT DIV MOD +%right NOT COMPLEMENT + +%precedence NEG +%precedence ANIMREF +%precedence PREINC PREDEC +%precedence POSTINC POSTDEC + +%start root + +%% + +root + : program { ast = std::move($1); } + | { ast = std::make_unique(@$); } + ; + +program + : program include + { $$ = std::move($1); $$->includes.push_back(std::move($2)); } + | program define + { $$ = std::move($1); $$->definitions.push_back(std::move($2)); } + | include + { $$ = std::make_unique(@$); $$->includes.push_back(std::move($1)); } + | define + { $$ = std::make_unique(@$); $$->definitions.push_back(std::move($1)); } + ; + +include + : INCLUDE file SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + ; + +define + : usingtree { $$.as_usingtree = std::move($1); } + | constant { $$.as_constant = std::move($1); } + | thread { $$.as_thread = std::move($1); } + ; + +usingtree + : USINGTREE LPAREN string RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($3)); } + ; + +constant + : name ASSIGN expr SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +thread + : name LPAREN parameters RPAREN stmt_block + { $$ = std::make_unique(@$, std::move($1), std::move($3), std::move($5)); } + ; + +parameters + : parameters COMMA name + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | name + { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } + | + { $$ = std::make_unique(@$); } + ; + +stmt + : stmt_block { $$.as_list = std::move($1); } + | stmt_call { $$.as_call = std::move($1); } + | stmt_assign { $$.as_assign = std::move($1); } + | stmt_endon { $$.as_endon = std::move($1); } + | stmt_notify { $$.as_notify = std::move($1); } + | stmt_wait { $$.as_wait = std::move($1); } + | stmt_waittill { $$.as_waittill = std::move($1); } + | stmt_waittillmatch { $$.as_waittillmatch = std::move($1); } + | stmt_waittillframeend { $$.as_waittillframeend = std::move($1); } + | stmt_waitframe { $$.as_waitframe = std::move($1); } + | stmt_if { $$.as_if = std::move($1); } + | stmt_ifelse { $$.as_ifelse = std::move($1); } + | stmt_while { $$.as_while = std::move($1); } + | stmt_for { $$.as_for = std::move($1); } + | stmt_foreach { $$.as_foreach = std::move($1); } + | stmt_switch { $$.as_switch = std::move($1); } + | stmt_case { $$.as_case = std::move($1); } + | stmt_default { $$.as_default = std::move($1); } + | stmt_break { $$.as_break = std::move($1); } + | stmt_continue { $$.as_continue = std::move($1); } + | stmt_return { $$.as_return = std::move($1); } + ; + +stmt_block + : LBRACE stmt_list RBRACE { $$ = std::move($2); } + | LBRACE RBRACE { $$ = std::make_unique(@$); } + ; + +stmt_list + : stmt_list stmt + { $$ = std::move($1); $$->stmts.push_back(std::move($2)); } + | stmt + { $$ = std::make_unique(@$); $$->stmts.push_back(std::move($1)); } + ; + +stmt_call + : expr_call SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + | expr_call_thread SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + ; + +stmt_assign + : expr_assign SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + ; + +stmt_endon + : object ENDON LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4)); } + ; + +stmt_notify + : object NOTIFY LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object NOTIFY LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_wait + : WAIT expr SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + ; + +stmt_waittill + : object WAITTILL LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object WAITTILL LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_waittillmatch + : object WAITTILLMATCH LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object WAITTILLMATCH LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_waittillframeend + : WAITTILLFRAMEEND SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_waitframe + : WAITFRAME SEMICOLON + { $$ = std::make_unique(@$); } + | WAITFRAME LPAREN RPAREN SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_if + : IF LPAREN expr RPAREN stmt %prec THEN + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_ifelse + : IF LPAREN expr RPAREN stmt ELSE stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5), std::move($7)); } + ; + +stmt_while + : WHILE LPAREN expr RPAREN stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_for + : FOR LPAREN for_stmt SEMICOLON for_expr SEMICOLON for_stmt RPAREN stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5), std::move($7), std::move($9)); } + ; + +stmt_foreach + : FOREACH LPAREN name IN expr RPAREN stmt + { $$ = std::make_unique(@$, expr_ptr(std::move($3)), std::move($5), std::move($7)); } + | FOREACH LPAREN name COMMA name IN expr RPAREN stmt + { $$ = std::make_unique(@$, expr_ptr(std::move($3)), expr_ptr(std::move($5)), std::move($7), std::move($9)); } + ; + +stmt_switch + : SWITCH LPAREN expr RPAREN stmt_block + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_case + : CASE integer COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + | CASE neg_integer COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + | CASE string COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + ; + +stmt_default + : DEFAULT COLON + { $$ = std::make_unique(@$, std::make_unique(@$)); } + ; + +stmt_break + : BREAK SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_continue + : CONTINUE SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_return + : RETURN expr SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + | RETURN SEMICOLON + { $$ = std::make_unique(@$, std::make_unique(@$)); } + ; + +for_stmt + : expr_assign { $$.as_list = std::make_unique(@$); $$.as_list->stmts.push_back(stmt_ptr(std::make_unique(@$, std::move($1)))); } + | { $$.as_node = std::make_unique(@$); } + ; + +for_expr + : expr { $$ = std::move($1); } + | { $$.as_node = std::make_unique(@$); } + ; + +expr + : expr_compare { $$ = std::move($1); } + | expr_binary { $$ = std::move($1); } + | expr_primitive { $$ = std::move($1); } + ; + +expr_assign + : INCREMENT object %prec PREINC { $$ = std::make_unique(@$, std::move($2)); } + | DECREMENT object %prec PREDEC { $$ = std::make_unique(@$, std::move($2)); } + | object INCREMENT %prec POSTINC { $$ = std::make_unique(@$, std::move($1)); } + | object DECREMENT %prec POSTDEC { $$ = std::make_unique(@$, std::move($1)); } + | object ASSIGN expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_OR expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_AND expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_EXOR expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_LSHIFT expr { $$ = std::make_unique(@$, std::move($1),std::move( $3)); } + | object ASSIGN_RSHIFT expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_ADD expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_SUB expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_MULT expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_DIV expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_MOD expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_compare + : expr OR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr AND expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr EQUALITY expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr INEQUALITY expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LESS_EQUAL expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr GREATER_EQUAL expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LESS expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr GREATER expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_binary + : expr BITWISE_OR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr BITWISE_AND expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr BITWISE_EXOR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LSHIFT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr RSHIFT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr ADD expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr SUB expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr MULT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr DIV expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr MOD expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_primitive + : LPAREN expr RPAREN { $$ = std::move($2); } + | COMPLEMENT expr { $$.as_node = std::make_unique(@$, std::move($2)); } + | NOT expr { $$.as_node = std::make_unique(@$, std::move($2)); } + | expr_call { $$.as_node = std::move($1); } + | expr_call_thread { $$.as_node = std::move($1); } + | expr_call_childthread { $$.as_node = std::move($1); } + | expr_function { $$.as_node = std::move($1); } + | expr_add_array { $$.as_node = std::move($1); } + | expr_array { $$.as_node = std::move($1); } + | expr_field { $$.as_node = std::move($1); } + | expr_size { $$.as_node = std::move($1); } + | thisthread { $$.as_node = std::move($1); } + | empty_array { $$.as_node = std::move($1); } + | undefined { $$.as_node = std::move($1); } + | game { $$.as_node = std::move($1); } + | self { $$.as_node = std::move($1); } + | anim { $$.as_node = std::move($1); } + | level { $$.as_node = std::move($1); } + | animation { $$.as_node = std::move($1); } + | animtree { $$.as_node = std::move($1); } + | name { $$.as_node = std::move($1); } + | istring { $$.as_node = std::move($1); } + | string { $$.as_node = std::move($1); } + | vector { $$.as_node = std::move($1); } + | neg_float { $$.as_node = std::move($1); } + | neg_integer { $$.as_node = std::move($1); } + | float { $$.as_node = std::move($1); } + | integer { $$.as_node = std::move($1); } + | false { $$.as_node = std::move($1); } + | true { $$.as_node = std::move($1); } + ; + +expr_call + : expr_call_function { $$ = std::make_unique(@$, false, false, std::make_unique(@$), std::move($1)); } + | expr_call_pointer { $$ = std::make_unique(@$, false, false, std::make_unique(@$), std::move($1)); } + | object expr_call_function { $$ = std::make_unique(@$, false, false, std::move($1), std::move($2)); } + | object expr_call_pointer { $$ = std::make_unique(@$, false, false, std::move($1), std::move($2)); } + ; + +expr_call_thread + : THREAD expr_call_function { $$ = std::make_unique(@$, true, false, std::make_unique(@$), std::move($2)); } + | THREAD expr_call_pointer { $$ = std::make_unique(@$, true, false, std::make_unique(@$), std::move($2)); } + | object THREAD expr_call_function { $$ = std::make_unique(@$, true, false, std::move($1), std::move($3)); } + | object THREAD expr_call_pointer { $$ = std::make_unique(@$, true, false, std::move($1), std::move($3)); } + ; + +expr_call_childthread + : CHILDTHREAD expr_call_function { $$ = std::make_unique(@$, false, true, std::make_unique(@$), std::move($2)); } + | CHILDTHREAD expr_call_pointer { $$ = std::make_unique(@$, false, true, std::make_unique(@$), std::move($2)); } + | object CHILDTHREAD expr_call_function { $$ = std::make_unique(@$, false, true, std::move($1), std::move($3)); } + | object CHILDTHREAD expr_call_pointer { $$ = std::make_unique(@$, false, true, std::move($1), std::move($3)); } + ; + +expr_call_function + : name LPAREN expr_arguments RPAREN + {$$.as_func = std::make_unique(@$, std::make_unique(), std::move($1), std::move($3)); } + | file DOUBLECOLON name LPAREN expr_arguments RPAREN + { $$.as_func = std::make_unique(@$, std::move($1), std::move($3), std::move($5)); } + ; + +expr_call_pointer + : LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = std::make_unique(@$, false, std::move($3), std::move($7)); } + | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = std::make_unique(@$, true, std::move($4), std::move($8)); } + ; + +expr_arguments + : expr_arguments_filled { $$ = std::move($1); } + | expr_arguments_empty { $$ = std::move($1); } + ; + +expr_arguments_filled + : expr_arguments COMMA expr + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | expr %prec ADD_ARRAY + { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } + ; + +expr_arguments_empty + : + { $$ = std::make_unique(@$); } + ; + +expr_function + : DOUBLECOLON name + { $$ = std::make_unique(@$, std::make_unique(@$), std::move($2)); } + | file DOUBLECOLON name + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_add_array + : LBRACKET expr_arguments_filled RBRACKET + { $$ = std::make_unique(@$, std::move($2)); } + ; + +expr_array + : object LBRACKET expr RBRACKET + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_field + : object DOT name + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_size + : object DOT SIZE + { $$ = std::make_unique(@$, std::move($1)); } + ; + +object + : expr_call { $$ = std::move($1); } + | expr_array { $$ = std::move($1); } + | expr_field { $$ = std::move($1); } + | game { $$ = std::move($1); } + | self { $$ = std::move($1); } + | anim { $$ = std::move($1); } + | level { $$ = std::move($1); } + | name { $$ = std::move($1); } + ; + +thisthread : THISTHREAD { $$ = std::make_unique(@$); }; +empty_array : LBRACKET RBRACKET { $$ = std::make_unique(@$); }; +undefined : UNDEFINED { $$ = std::make_unique(@$); }; +game : GAME { $$ = std::make_unique(@$); }; +self : SELF { $$ = std::make_unique(@$); }; +anim : ANIM { $$ = std::make_unique(@$); }; +level : LEVEL { $$ = std::make_unique(@$); }; +animation : MOD NAME %prec ANIMREF { $$ = std::make_unique(@$, $2); }; +animtree : ANIMTREE { $$ = std::make_unique(@$); }; +name : NAME { $$ = std::make_unique(@$, $1); }; +file : FILE { $$ = std::make_unique(@$, $1); }; +istring : ISTRING { $$ = std::make_unique(@$, $1); }; +string : STRING { $$ = std::make_unique(@$, $1); }; +vector : LPAREN expr COMMA expr COMMA expr RPAREN { $$ = std::make_unique(@$, std::move($2), std::move($4), std::move($6)); }; +neg_float : SUB FLOAT %prec NEG { $$ = std::make_unique(@$, "-" + $2); }; +neg_integer : SUB INTEGER %prec NEG { $$ = std::make_unique(@$, "-" + $2); }; +float : FLOAT { $$ = std::make_unique(@$, $1); }; +integer : INTEGER { $$ = std::make_unique(@$, $1); }; +false : FALSE { $$ = std::make_unique(@$); }; +true : TRUE { $$ = std::make_unique(@$); }; + +%% + +void xsk::gsc::h1::parser::error(const xsk::gsc::location& loc, const std::string& msg) +{ + throw xsk::gsc::comp_error(loc, msg); +} diff --git a/gen/h2/Makefile b/gen/h2/Makefile new file mode 100644 index 00000000..ccaeb7a3 --- /dev/null +++ b/gen/h2/Makefile @@ -0,0 +1,11 @@ +generate: H2 + +clean: + rm -rf ./parser.hpp + rm -rf ./parser.cpp + rm -rf ./lexer.hpp + rm -rf ./lexer.cpp + +H2: lexer.lpp parser.ypp + flex lexer.lpp + bison parser.ypp -Wcounterexamples diff --git a/gen/h2/lexer.lpp b/gen/h2/lexer.lpp new file mode 100644 index 00000000..51a7654c --- /dev/null +++ b/gen/h2/lexer.lpp @@ -0,0 +1,145 @@ +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ + +%option outfile="lexer.cpp" +%option header-file="lexer.hpp" +%option prefix="h2_" +%option reentrant +%option noyywrap batch nounput noinput +%option never-interactive +%option nounistd + +%top{ +#include "stdafx.hpp" +#include "h2.hpp" +#include "parser.hpp" +using namespace xsk::gsc; +} + +%{ +#define YY_USER_ACTION loc.columns(yyleng); +%} + +RGX_FILE ([_A-Za-z0-9]+\\)+[_A-Za-z0-9]+ +RGX_NAME [_A-Za-z][_A-Za-z0-9]* +RGX_STRING \"(?:\\.|[^\"])*?\"|\'(?:\\.|[^\'])*?\' +RGX_FLOAT [0-9]+\.(?:[0-9]*)?f?|\.[0-9]+f? +RGX_INTEGER [0-9]+ +RGX_DEFAULT (.|\n) + +%x COMMENT_BLOCK_STATE +%x DEVELOPER_BLOCK_STATE + +%% + +%{ + loc.step(); +%} + +[ \t\r] { loc.step(); } + +\n { loc.lines(yyleng); loc.step(); } + +"//".* + +"/*" { BEGIN(COMMENT_BLOCK_STATE); } +. +\n { loc.lines(yyleng); loc.step(); } +"*/" { BEGIN(INITIAL); } + +"/#" { BEGIN(DEVELOPER_BLOCK_STATE); } +. +\n { loc.lines(yyleng); loc.step(); } +"#/" { BEGIN(INITIAL); } + +"#include" { return h2::parser::make_INCLUDE(loc); } +"#using_animtree" { return h2::parser::make_USINGTREE(loc); } +"#animtree" { return h2::parser::make_ANIMTREE(loc); } +"endon" { return h2::parser::make_ENDON(loc); } +"notify" { return h2::parser::make_NOTIFY(loc); } +"wait" { return h2::parser::make_WAIT(loc); } +"waittill" { return h2::parser::make_WAITTILL(loc); } +"waittillmatch" { return h2::parser::make_WAITTILLMATCH(loc); } +"waittillframeend" { return h2::parser::make_WAITTILLFRAMEEND(loc); } +"waitframe" { return h2::parser::make_WAITFRAME(loc); } +"if" { return h2::parser::make_IF(loc); } +"else" { return h2::parser::make_ELSE(loc); } +"while" { return h2::parser::make_WHILE(loc); } +"for" { return h2::parser::make_FOR(loc); } +"foreach" { return h2::parser::make_FOREACH(loc); } +"in" { return h2::parser::make_IN(loc); } +"switch" { return h2::parser::make_SWITCH(loc); } +"case" { return h2::parser::make_CASE(loc); } +"default" { return h2::parser::make_DEFAULT(loc); } +"break" { return h2::parser::make_BREAK(loc); } +"continue" { return h2::parser::make_CONTINUE(loc); } +"return" { return h2::parser::make_RETURN(loc); } +"thread" { return h2::parser::make_THREAD(loc); } +"childthread" { return h2::parser::make_CHILDTHREAD(loc); } +"thisthread" { return h2::parser::make_THISTHREAD(loc); } +"call" { return h2::parser::make_CALL(loc); } +"true" { return h2::parser::make_TRUE(loc); } +"false" { return h2::parser::make_FALSE(loc); } +"undefined" { return h2::parser::make_UNDEFINED(loc); } +"size" { return h2::parser::make_SIZE(loc); } +"game" { return h2::parser::make_GAME(loc); } +"self" { return h2::parser::make_SELF(loc); } +"anim" { return h2::parser::make_ANIM(loc); } +"level" { return h2::parser::make_LEVEL(loc); } +\( { return h2::parser::make_LPAREN(loc); } +\) { return h2::parser::make_RPAREN(loc); } +\{ { return h2::parser::make_LBRACE(loc); } +\} { return h2::parser::make_RBRACE(loc); } +\[ { return h2::parser::make_LBRACKET(loc); } +\] { return h2::parser::make_RBRACKET(loc); } +\, { return h2::parser::make_COMMA(loc); } +\. { return h2::parser::make_DOT(loc); } +\:\: { return h2::parser::make_DOUBLECOLON(loc); } +\: { return h2::parser::make_COLON(loc); } +\; { return h2::parser::make_SEMICOLON(loc); } +\+\+ { return h2::parser::make_INCREMENT(loc); } +\-\- { return h2::parser::make_DECREMENT(loc); } +\<\<\= { return h2::parser::make_ASSIGN_LSHIFT(loc); } +\>\>\= { return h2::parser::make_ASSIGN_RSHIFT(loc); } +\<\< { return h2::parser::make_LSHIFT(loc); } +\>\> { return h2::parser::make_RSHIFT(loc); } +\|\| { return h2::parser::make_OR(loc); } +\&\& { return h2::parser::make_AND(loc); } +\=\= { return h2::parser::make_EQUALITY(loc); } +\!\= { return h2::parser::make_INEQUALITY(loc); } +\<\= { return h2::parser::make_LESS_EQUAL(loc); } +\>\= { return h2::parser::make_GREATER_EQUAL(loc); } +\< { return h2::parser::make_LESS(loc); } +\> { return h2::parser::make_GREATER(loc); } +\+\= { return h2::parser::make_ASSIGN_ADD(loc); } +\-\= { return h2::parser::make_ASSIGN_SUB(loc); } +\*\= { return h2::parser::make_ASSIGN_MULT(loc); } +\/\= { return h2::parser::make_ASSIGN_DIV(loc); } +\%\= { return h2::parser::make_ASSIGN_MOD(loc); } +\|\= { return h2::parser::make_ASSIGN_BITWISE_OR(loc); } +\&\= { return h2::parser::make_ASSIGN_BITWISE_AND(loc); } +\^\= { return h2::parser::make_ASSIGN_BITWISE_EXOR(loc); } +\= { return h2::parser::make_ASSIGN(loc); } +\+ { return h2::parser::make_ADD(loc); } +\- { return h2::parser::make_SUB(loc); } +\* { return h2::parser::make_MULT(loc); } +\/ { return h2::parser::make_DIV(loc); } +\% { return h2::parser::make_MOD(loc); } +\! { return h2::parser::make_NOT(loc); } +\~ { return h2::parser::make_COMPLEMENT(loc); } +\| { return h2::parser::make_BITWISE_OR(loc); } +\& { return h2::parser::make_BITWISE_AND(loc); } +\^ { return h2::parser::make_BITWISE_EXOR(loc); } +{RGX_FILE} { return h2::parser::make_FILE(utils::string::fordslash(yytext), loc); } +{RGX_NAME} { return h2::parser::make_NAME((std::string(yytext, 3) == "_ID") ? std::string(yytext) : utils::string::to_lower(yytext), loc); } +\&{RGX_STRING} { return h2::parser::make_ISTRING(std::string(yytext).substr(1), loc); } +{RGX_STRING} { return h2::parser::make_STRING(std::string(yytext), loc); } +{RGX_FLOAT} { return h2::parser::make_FLOAT(std::string(yytext), loc); } +{RGX_INTEGER} { return h2::parser::make_INTEGER(std::string(yytext), loc); } +<> { return h2::parser::make_H2EOF(loc); } +<*>{RGX_DEFAULT} { throw h2::parser::syntax_error(loc, "bad token: \'" + std::string(yytext) + "\'"); } + +%% diff --git a/gen/h2/parser.ypp b/gen/h2/parser.ypp new file mode 100644 index 00000000..0faa38f3 --- /dev/null +++ b/gen/h2/parser.ypp @@ -0,0 +1,644 @@ +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ + +%require "3.7" +%skeleton "lalr1.cc" +%language "c++" +%output "parser.cpp" +%defines "parser.hpp" +%define api.prefix {H2} +%define api.namespace {xsk::gsc::h2} +%define api.location.type {xsk::gsc::location} +%define api.value.type variant +%define api.token.constructor +%define api.token.raw +%define parse.assert +%define parse.trace +%define parse.error detailed +%define parse.lac full + +%locations + +%lex-param { yyscan_t yyscanner } +%lex-param { xsk::gsc::location& loc } + +%parse-param { yyscan_t yyscanner } +%parse-param { xsk::gsc::location& loc } +%parse-param { xsk::gsc::program_ptr& ast } + +%code requires +{ +#include "h2.hpp" +typedef void *yyscan_t; +#define YY_DECL xsk::gsc::h2::parser::symbol_type H2lex(yyscan_t yyscanner, xsk::gsc::location& loc) +} + +%code top +{ +#include "stdafx.hpp" +#include "parser.hpp" +#include "lexer.hpp" +using namespace xsk::gsc; +xsk::gsc::h2::parser::symbol_type H2lex(yyscan_t yyscanner, xsk::gsc::location& loc); +} + +%token INCLUDE "#include" +%token USINGTREE "#using_animtree" +%token ANIMTREE "#animtree" +%token ENDON "endon" +%token NOTIFY "notify" +%token WAIT "wait" +%token WAITTILL "waittill" +%token WAITTILLMATCH "waittillmatch" +%token WAITTILLFRAMEEND "waittillframeend" +%token WAITFRAME "waitframe" +%token IF "if" +%token ELSE "else" +%token WHILE "while" +%token FOR "for" +%token FOREACH "foreach" +%token IN "in" +%token SWITCH "switch" +%token CASE "case" +%token DEFAULT "default" +%token BREAK "break" +%token CONTINUE "continue" +%token RETURN "return" +%token THREAD "thread" +%token CHILDTHREAD "childthread" +%token THISTHREAD "thisthread" +%token CALL "call" +%token TRUE "true" +%token FALSE "false" +%token UNDEFINED "undefined" +%token SIZE "size" +%token GAME "game" +%token SELF "self" +%token ANIM "anim" +%token LEVEL "level" +%token LPAREN "(" +%token RPAREN ")" +%token LBRACE "{" +%token RBRACE "}" +%token LBRACKET "[" +%token RBRACKET "]" +%token COMMA "," +%token DOT "." +%token DOUBLECOLON "::" +%token COLON ":" +%token SEMICOLON ";" +%token INCREMENT "++" +%token DECREMENT "--" +%token LSHIFT "<<" +%token RSHIFT ">>" +%token OR "||" +%token AND "&&" +%token EQUALITY "==" +%token INEQUALITY "!=" +%token LESS_EQUAL "<=" +%token GREATER_EQUAL ">=" +%token LESS "<" +%token GREATER ">" +%token NOT "!" +%token COMPLEMENT "~" +%token ASSIGN "=" +%token ASSIGN_ADD "+=" +%token ASSIGN_SUB "-=" +%token ASSIGN_MULT "*=" +%token ASSIGN_DIV "/=" +%token ASSIGN_MOD "%=" +%token ASSIGN_BITWISE_OR "|=" +%token ASSIGN_BITWISE_AND "&=" +%token ASSIGN_BITWISE_EXOR "^=" +%token ASSIGN_RSHIFT ">>=" +%token ASSIGN_LSHIFT "<<=" +%token BITWISE_OR "|" +%token BITWISE_AND "&" +%token BITWISE_EXOR "^" +%token ADD "+" +%token SUB "-" +%token MULT "*" +%token DIV "/" +%token MOD "%" +%token FILE "file path" +%token NAME "identifier" +%token STRING "string literal" +%token ISTRING "localized string" +%token FLOAT "float" +%token INTEGER "int" + +%type program +%type include +%type define +%type usingtree +%type constant +%type thread +%type parameters +%type stmt +%type stmt_block +%type stmt_list +%type stmt_call +%type stmt_assign +%type stmt_endon +%type stmt_notify +%type stmt_wait +%type stmt_waittill +%type stmt_waittillmatch +%type stmt_waittillframeend +%type stmt_waitframe +%type stmt_if +%type stmt_ifelse +%type stmt_while +%type stmt_for +%type stmt_foreach +%type stmt_switch +%type stmt_case +%type stmt_default +%type stmt_break +%type stmt_continue +%type stmt_return +%type for_stmt +%type for_expr +%type expr_assign +%type expr +%type expr_compare +%type expr_binary +%type expr_primitive +%type expr_call +%type expr_call_thread +%type expr_call_childthread +%type expr_call_function +%type expr_call_pointer +%type expr_arguments +%type expr_arguments_filled +%type expr_arguments_empty +%type expr_function +%type expr_add_array +%type expr_array +%type expr_field +%type expr_size +%type object +%type thisthread +%type empty_array +%type undefined +%type game +%type self +%type anim +%type level +%type animation +%type animtree +%type name +%type file +%type istring +%type string +%type vector +%type neg_float +%type neg_integer +%type float +%type integer +%type false +%type true + +%nonassoc ADD_ARRAY +%nonassoc RBRACKET +%nonassoc THEN +%nonassoc ELSE +%nonassoc INCREMENT DECREMENT + +%left OR +%left AND +%left BITWISE_OR +%left BITWISE_AND +%left BITWISE_EXOR +%left EQUALITY INEQUALITY +%left LESS GREATER LESS_EQUAL GREATER_EQUAL +%left LSHIFT RSHIFT +%left ADD SUB +%left MULT DIV MOD +%right NOT COMPLEMENT + +%precedence NEG +%precedence ANIMREF +%precedence PREINC PREDEC +%precedence POSTINC POSTDEC + +%start root + +%% + +root + : program { ast = std::move($1); } + | { ast = std::make_unique(@$); } + ; + +program + : program include + { $$ = std::move($1); $$->includes.push_back(std::move($2)); } + | program define + { $$ = std::move($1); $$->definitions.push_back(std::move($2)); } + | include + { $$ = std::make_unique(@$); $$->includes.push_back(std::move($1)); } + | define + { $$ = std::make_unique(@$); $$->definitions.push_back(std::move($1)); } + ; + +include + : INCLUDE file SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + ; + +define + : usingtree { $$.as_usingtree = std::move($1); } + | constant { $$.as_constant = std::move($1); } + | thread { $$.as_thread = std::move($1); } + ; + +usingtree + : USINGTREE LPAREN string RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($3)); } + ; + +constant + : name ASSIGN expr SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +thread + : name LPAREN parameters RPAREN stmt_block + { $$ = std::make_unique(@$, std::move($1), std::move($3), std::move($5)); } + ; + +parameters + : parameters COMMA name + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | name + { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } + | + { $$ = std::make_unique(@$); } + ; + +stmt + : stmt_block { $$.as_list = std::move($1); } + | stmt_call { $$.as_call = std::move($1); } + | stmt_assign { $$.as_assign = std::move($1); } + | stmt_endon { $$.as_endon = std::move($1); } + | stmt_notify { $$.as_notify = std::move($1); } + | stmt_wait { $$.as_wait = std::move($1); } + | stmt_waittill { $$.as_waittill = std::move($1); } + | stmt_waittillmatch { $$.as_waittillmatch = std::move($1); } + | stmt_waittillframeend { $$.as_waittillframeend = std::move($1); } + | stmt_waitframe { $$.as_waitframe = std::move($1); } + | stmt_if { $$.as_if = std::move($1); } + | stmt_ifelse { $$.as_ifelse = std::move($1); } + | stmt_while { $$.as_while = std::move($1); } + | stmt_for { $$.as_for = std::move($1); } + | stmt_foreach { $$.as_foreach = std::move($1); } + | stmt_switch { $$.as_switch = std::move($1); } + | stmt_case { $$.as_case = std::move($1); } + | stmt_default { $$.as_default = std::move($1); } + | stmt_break { $$.as_break = std::move($1); } + | stmt_continue { $$.as_continue = std::move($1); } + | stmt_return { $$.as_return = std::move($1); } + ; + +stmt_block + : LBRACE stmt_list RBRACE { $$ = std::move($2); } + | LBRACE RBRACE { $$ = std::make_unique(@$); } + ; + +stmt_list + : stmt_list stmt + { $$ = std::move($1); $$->stmts.push_back(std::move($2)); } + | stmt + { $$ = std::make_unique(@$); $$->stmts.push_back(std::move($1)); } + ; + +stmt_call + : expr_call SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + | expr_call_thread SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + ; + +stmt_assign + : expr_assign SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + ; + +stmt_endon + : object ENDON LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4)); } + ; + +stmt_notify + : object NOTIFY LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object NOTIFY LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_wait + : WAIT expr SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + ; + +stmt_waittill + : object WAITTILL LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object WAITTILL LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_waittillmatch + : object WAITTILLMATCH LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object WAITTILLMATCH LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_waittillframeend + : WAITTILLFRAMEEND SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_waitframe + : WAITFRAME SEMICOLON + { $$ = std::make_unique(@$); } + | WAITFRAME LPAREN RPAREN SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_if + : IF LPAREN expr RPAREN stmt %prec THEN + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_ifelse + : IF LPAREN expr RPAREN stmt ELSE stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5), std::move($7)); } + ; + +stmt_while + : WHILE LPAREN expr RPAREN stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_for + : FOR LPAREN for_stmt SEMICOLON for_expr SEMICOLON for_stmt RPAREN stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5), std::move($7), std::move($9)); } + ; + +stmt_foreach + : FOREACH LPAREN name IN expr RPAREN stmt + { $$ = std::make_unique(@$, expr_ptr(std::move($3)), std::move($5), std::move($7)); } + | FOREACH LPAREN name COMMA name IN expr RPAREN stmt + { $$ = std::make_unique(@$, expr_ptr(std::move($3)), expr_ptr(std::move($5)), std::move($7), std::move($9)); } + ; + +stmt_switch + : SWITCH LPAREN expr RPAREN stmt_block + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_case + : CASE integer COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + | CASE neg_integer COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + | CASE string COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + ; + +stmt_default + : DEFAULT COLON + { $$ = std::make_unique(@$, std::make_unique(@$)); } + ; + +stmt_break + : BREAK SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_continue + : CONTINUE SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_return + : RETURN expr SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + | RETURN SEMICOLON + { $$ = std::make_unique(@$, std::make_unique(@$)); } + ; + +for_stmt + : expr_assign { $$.as_list = std::make_unique(@$); $$.as_list->stmts.push_back(stmt_ptr(std::make_unique(@$, std::move($1)))); } + | { $$.as_node = std::make_unique(@$); } + ; + +for_expr + : expr { $$ = std::move($1); } + | { $$.as_node = std::make_unique(@$); } + ; + +expr + : expr_compare { $$ = std::move($1); } + | expr_binary { $$ = std::move($1); } + | expr_primitive { $$ = std::move($1); } + ; + +expr_assign + : INCREMENT object %prec PREINC { $$ = std::make_unique(@$, std::move($2)); } + | DECREMENT object %prec PREDEC { $$ = std::make_unique(@$, std::move($2)); } + | object INCREMENT %prec POSTINC { $$ = std::make_unique(@$, std::move($1)); } + | object DECREMENT %prec POSTDEC { $$ = std::make_unique(@$, std::move($1)); } + | object ASSIGN expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_OR expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_AND expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_EXOR expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_LSHIFT expr { $$ = std::make_unique(@$, std::move($1),std::move( $3)); } + | object ASSIGN_RSHIFT expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_ADD expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_SUB expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_MULT expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_DIV expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_MOD expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_compare + : expr OR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr AND expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr EQUALITY expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr INEQUALITY expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LESS_EQUAL expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr GREATER_EQUAL expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LESS expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr GREATER expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_binary + : expr BITWISE_OR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr BITWISE_AND expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr BITWISE_EXOR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LSHIFT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr RSHIFT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr ADD expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr SUB expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr MULT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr DIV expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr MOD expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_primitive + : LPAREN expr RPAREN { $$ = std::move($2); } + | COMPLEMENT expr { $$.as_node = std::make_unique(@$, std::move($2)); } + | NOT expr { $$.as_node = std::make_unique(@$, std::move($2)); } + | expr_call { $$.as_node = std::move($1); } + | expr_call_thread { $$.as_node = std::move($1); } + | expr_call_childthread { $$.as_node = std::move($1); } + | expr_function { $$.as_node = std::move($1); } + | expr_add_array { $$.as_node = std::move($1); } + | expr_array { $$.as_node = std::move($1); } + | expr_field { $$.as_node = std::move($1); } + | expr_size { $$.as_node = std::move($1); } + | thisthread { $$.as_node = std::move($1); } + | empty_array { $$.as_node = std::move($1); } + | undefined { $$.as_node = std::move($1); } + | game { $$.as_node = std::move($1); } + | self { $$.as_node = std::move($1); } + | anim { $$.as_node = std::move($1); } + | level { $$.as_node = std::move($1); } + | animation { $$.as_node = std::move($1); } + | animtree { $$.as_node = std::move($1); } + | name { $$.as_node = std::move($1); } + | istring { $$.as_node = std::move($1); } + | string { $$.as_node = std::move($1); } + | vector { $$.as_node = std::move($1); } + | neg_float { $$.as_node = std::move($1); } + | neg_integer { $$.as_node = std::move($1); } + | float { $$.as_node = std::move($1); } + | integer { $$.as_node = std::move($1); } + | false { $$.as_node = std::move($1); } + | true { $$.as_node = std::move($1); } + ; + +expr_call + : expr_call_function { $$ = std::make_unique(@$, false, false, std::make_unique(@$), std::move($1)); } + | expr_call_pointer { $$ = std::make_unique(@$, false, false, std::make_unique(@$), std::move($1)); } + | object expr_call_function { $$ = std::make_unique(@$, false, false, std::move($1), std::move($2)); } + | object expr_call_pointer { $$ = std::make_unique(@$, false, false, std::move($1), std::move($2)); } + ; + +expr_call_thread + : THREAD expr_call_function { $$ = std::make_unique(@$, true, false, std::make_unique(@$), std::move($2)); } + | THREAD expr_call_pointer { $$ = std::make_unique(@$, true, false, std::make_unique(@$), std::move($2)); } + | object THREAD expr_call_function { $$ = std::make_unique(@$, true, false, std::move($1), std::move($3)); } + | object THREAD expr_call_pointer { $$ = std::make_unique(@$, true, false, std::move($1), std::move($3)); } + ; + +expr_call_childthread + : CHILDTHREAD expr_call_function { $$ = std::make_unique(@$, false, true, std::make_unique(@$), std::move($2)); } + | CHILDTHREAD expr_call_pointer { $$ = std::make_unique(@$, false, true, std::make_unique(@$), std::move($2)); } + | object CHILDTHREAD expr_call_function { $$ = std::make_unique(@$, false, true, std::move($1), std::move($3)); } + | object CHILDTHREAD expr_call_pointer { $$ = std::make_unique(@$, false, true, std::move($1), std::move($3)); } + ; + +expr_call_function + : name LPAREN expr_arguments RPAREN + {$$.as_func = std::make_unique(@$, std::make_unique(), std::move($1), std::move($3)); } + | file DOUBLECOLON name LPAREN expr_arguments RPAREN + { $$.as_func = std::make_unique(@$, std::move($1), std::move($3), std::move($5)); } + ; + +expr_call_pointer + : LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = std::make_unique(@$, false, std::move($3), std::move($7)); } + | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = std::make_unique(@$, true, std::move($4), std::move($8)); } + ; + +expr_arguments + : expr_arguments_filled { $$ = std::move($1); } + | expr_arguments_empty { $$ = std::move($1); } + ; + +expr_arguments_filled + : expr_arguments COMMA expr + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | expr %prec ADD_ARRAY + { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } + ; + +expr_arguments_empty + : + { $$ = std::make_unique(@$); } + ; + +expr_function + : DOUBLECOLON name + { $$ = std::make_unique(@$, std::make_unique(@$), std::move($2)); } + | file DOUBLECOLON name + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_add_array + : LBRACKET expr_arguments_filled RBRACKET + { $$ = std::make_unique(@$, std::move($2)); } + ; + +expr_array + : object LBRACKET expr RBRACKET + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_field + : object DOT name + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_size + : object DOT SIZE + { $$ = std::make_unique(@$, std::move($1)); } + ; + +object + : expr_call { $$ = std::move($1); } + | expr_array { $$ = std::move($1); } + | expr_field { $$ = std::move($1); } + | game { $$ = std::move($1); } + | self { $$ = std::move($1); } + | anim { $$ = std::move($1); } + | level { $$ = std::move($1); } + | name { $$ = std::move($1); } + ; + +thisthread : THISTHREAD { $$ = std::make_unique(@$); }; +empty_array : LBRACKET RBRACKET { $$ = std::make_unique(@$); }; +undefined : UNDEFINED { $$ = std::make_unique(@$); }; +game : GAME { $$ = std::make_unique(@$); }; +self : SELF { $$ = std::make_unique(@$); }; +anim : ANIM { $$ = std::make_unique(@$); }; +level : LEVEL { $$ = std::make_unique(@$); }; +animation : MOD NAME %prec ANIMREF { $$ = std::make_unique(@$, $2); }; +animtree : ANIMTREE { $$ = std::make_unique(@$); }; +name : NAME { $$ = std::make_unique(@$, $1); }; +file : FILE { $$ = std::make_unique(@$, $1); }; +istring : ISTRING { $$ = std::make_unique(@$, $1); }; +string : STRING { $$ = std::make_unique(@$, $1); }; +vector : LPAREN expr COMMA expr COMMA expr RPAREN { $$ = std::make_unique(@$, std::move($2), std::move($4), std::move($6)); }; +neg_float : SUB FLOAT %prec NEG { $$ = std::make_unique(@$, "-" + $2); }; +neg_integer : SUB INTEGER %prec NEG { $$ = std::make_unique(@$, "-" + $2); }; +float : FLOAT { $$ = std::make_unique(@$, $1); }; +integer : INTEGER { $$ = std::make_unique(@$, $1); }; +false : FALSE { $$ = std::make_unique(@$); }; +true : TRUE { $$ = std::make_unique(@$); }; + +%% + +void xsk::gsc::h2::parser::error(const xsk::gsc::location& loc, const std::string& msg) +{ + throw xsk::gsc::comp_error(loc, msg); +} diff --git a/gen/iw5/Makefile b/gen/iw5/Makefile new file mode 100644 index 00000000..a8a260aa --- /dev/null +++ b/gen/iw5/Makefile @@ -0,0 +1,11 @@ +generate: IW5 + +clean: + rm -rf ./parser.hpp + rm -rf ./parser.cpp + rm -rf ./lexer.hpp + rm -rf ./lexer.cpp + +IW5: lexer.lpp parser.ypp + flex lexer.lpp + bison parser.ypp -Wcounterexamples diff --git a/gen/iw5/lexer.lpp b/gen/iw5/lexer.lpp new file mode 100644 index 00000000..878a04d7 --- /dev/null +++ b/gen/iw5/lexer.lpp @@ -0,0 +1,144 @@ +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ + +%option outfile="lexer.cpp" +%option header-file="lexer.hpp" +%option prefix="iw5_" +%option reentrant +%option noyywrap batch nounput noinput +%option never-interactive +%option nounistd + +%top{ +#include "stdafx.hpp" +#include "iw5.hpp" +#include "parser.hpp" +using namespace xsk::gsc; +} + +%{ +#define YY_USER_ACTION loc.columns(yyleng); +%} + +RGX_FILE ([_A-Za-z0-9]+\\)+[_A-Za-z0-9]+ +RGX_NAME [_A-Za-z][_A-Za-z0-9]* +RGX_STRING \"(?:\\.|[^\"])*?\"|\'(?:\\.|[^\'])*?\' +RGX_FLOAT [0-9]+\.(?:[0-9]*)?f?|\.[0-9]+f? +RGX_INTEGER [0-9]+ +RGX_DEFAULT (.|\n) + +%x COMMENT_BLOCK_STATE +%x DEVELOPER_BLOCK_STATE + +%% + +%{ + loc.step(); +%} + +[ \t\r] { loc.step(); } + +\n { loc.lines(yyleng); loc.step(); } + +"//".* + +"/*" { BEGIN(COMMENT_BLOCK_STATE); } +. +\n { loc.lines(yyleng); loc.step(); } +"*/" { BEGIN(INITIAL); } + +"/#" { BEGIN(DEVELOPER_BLOCK_STATE); } +. +\n { loc.lines(yyleng); loc.step(); } +"#/" { BEGIN(INITIAL); } + +"#include" { return iw5::parser::make_INCLUDE(loc); } +"#using_animtree" { return iw5::parser::make_USINGTREE(loc); } +"#animtree" { return iw5::parser::make_ANIMTREE(loc); } +"endon" { return iw5::parser::make_ENDON(loc); } +"notify" { return iw5::parser::make_NOTIFY(loc); } +"wait" { return iw5::parser::make_WAIT(loc); } +"waittill" { return iw5::parser::make_WAITTILL(loc); } +"waittillmatch" { return iw5::parser::make_WAITTILLMATCH(loc); } +"waittillframeend" { return iw5::parser::make_WAITTILLFRAMEEND(loc); } +"if" { return iw5::parser::make_IF(loc); } +"else" { return iw5::parser::make_ELSE(loc); } +"while" { return iw5::parser::make_WHILE(loc); } +"for" { return iw5::parser::make_FOR(loc); } +"foreach" { return iw5::parser::make_FOREACH(loc); } +"in" { return iw5::parser::make_IN(loc); } +"switch" { return iw5::parser::make_SWITCH(loc); } +"case" { return iw5::parser::make_CASE(loc); } +"default" { return iw5::parser::make_DEFAULT(loc); } +"break" { return iw5::parser::make_BREAK(loc); } +"continue" { return iw5::parser::make_CONTINUE(loc); } +"return" { return iw5::parser::make_RETURN(loc); } +"thread" { return iw5::parser::make_THREAD(loc); } +"childthread" { return iw5::parser::make_CHILDTHREAD(loc); } +"thisthread" { return iw5::parser::make_THISTHREAD(loc); } +"call" { return iw5::parser::make_CALL(loc); } +"true" { return iw5::parser::make_TRUE(loc); } +"false" { return iw5::parser::make_FALSE(loc); } +"undefined" { return iw5::parser::make_UNDEFINED(loc); } +"size" { return iw5::parser::make_SIZE(loc); } +"game" { return iw5::parser::make_GAME(loc); } +"self" { return iw5::parser::make_SELF(loc); } +"anim" { return iw5::parser::make_ANIM(loc); } +"level" { return iw5::parser::make_LEVEL(loc); } +\( { return iw5::parser::make_LPAREN(loc); } +\) { return iw5::parser::make_RPAREN(loc); } +\{ { return iw5::parser::make_LBRACE(loc); } +\} { return iw5::parser::make_RBRACE(loc); } +\[ { return iw5::parser::make_LBRACKET(loc); } +\] { return iw5::parser::make_RBRACKET(loc); } +\, { return iw5::parser::make_COMMA(loc); } +\. { return iw5::parser::make_DOT(loc); } +\:\: { return iw5::parser::make_DOUBLECOLON(loc); } +\: { return iw5::parser::make_COLON(loc); } +\; { return iw5::parser::make_SEMICOLON(loc); } +\+\+ { return iw5::parser::make_INCREMENT(loc); } +\-\- { return iw5::parser::make_DECREMENT(loc); } +\<\<\= { return iw5::parser::make_ASSIGN_LSHIFT(loc); } +\>\>\= { return iw5::parser::make_ASSIGN_RSHIFT(loc); } +\<\< { return iw5::parser::make_LSHIFT(loc); } +\>\> { return iw5::parser::make_RSHIFT(loc); } +\|\| { return iw5::parser::make_OR(loc); } +\&\& { return iw5::parser::make_AND(loc); } +\=\= { return iw5::parser::make_EQUALITY(loc); } +\!\= { return iw5::parser::make_INEQUALITY(loc); } +\<\= { return iw5::parser::make_LESS_EQUAL(loc); } +\>\= { return iw5::parser::make_GREATER_EQUAL(loc); } +\< { return iw5::parser::make_LESS(loc); } +\> { return iw5::parser::make_GREATER(loc); } +\+\= { return iw5::parser::make_ASSIGN_ADD(loc); } +\-\= { return iw5::parser::make_ASSIGN_SUB(loc); } +\*\= { return iw5::parser::make_ASSIGN_MULT(loc); } +\/\= { return iw5::parser::make_ASSIGN_DIV(loc); } +\%\= { return iw5::parser::make_ASSIGN_MOD(loc); } +\|\= { return iw5::parser::make_ASSIGN_BITWISE_OR(loc); } +\&\= { return iw5::parser::make_ASSIGN_BITWISE_AND(loc); } +\^\= { return iw5::parser::make_ASSIGN_BITWISE_EXOR(loc); } +\= { return iw5::parser::make_ASSIGN(loc); } +\+ { return iw5::parser::make_ADD(loc); } +\- { return iw5::parser::make_SUB(loc); } +\* { return iw5::parser::make_MULT(loc); } +\/ { return iw5::parser::make_DIV(loc); } +\% { return iw5::parser::make_MOD(loc); } +\! { return iw5::parser::make_NOT(loc); } +\~ { return iw5::parser::make_COMPLEMENT(loc); } +\| { return iw5::parser::make_BITWISE_OR(loc); } +\& { return iw5::parser::make_BITWISE_AND(loc); } +\^ { return iw5::parser::make_BITWISE_EXOR(loc); } +{RGX_FILE} { return iw5::parser::make_FILE(utils::string::fordslash(yytext), loc); } +{RGX_NAME} { return iw5::parser::make_NAME((std::string(yytext, 3) == "_ID") ? std::string(yytext) : utils::string::to_lower(yytext), loc); } +\&{RGX_STRING} { return iw5::parser::make_ISTRING(std::string(yytext).substr(1), loc); } +{RGX_STRING} { return iw5::parser::make_STRING(std::string(yytext), loc); } +{RGX_FLOAT} { return iw5::parser::make_FLOAT(std::string(yytext), loc); } +{RGX_INTEGER} { return iw5::parser::make_INTEGER(std::string(yytext), loc); } +<> { return iw5::parser::make_IW5EOF(loc); } +<*>{RGX_DEFAULT} { throw iw5::parser::syntax_error(loc, "bad token: '" + std::string(yytext) + "'"); } + +%% diff --git a/gen/iw5/parser.ypp b/gen/iw5/parser.ypp new file mode 100644 index 00000000..5e23ee8b --- /dev/null +++ b/gen/iw5/parser.ypp @@ -0,0 +1,634 @@ +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ + +%require "3.7" +%skeleton "lalr1.cc" +%language "c++" +%output "parser.cpp" +%defines "parser.hpp" +%define api.prefix {IW5} +%define api.namespace {xsk::gsc::iw5} +%define api.location.type {xsk::gsc::location} +%define api.value.type variant +%define api.token.constructor +%define api.token.raw +%define parse.assert +%define parse.trace +%define parse.error detailed +%define parse.lac full + +%locations + +%lex-param { yyscan_t yyscanner } +%lex-param { xsk::gsc::location& loc } + +%parse-param { yyscan_t yyscanner } +%parse-param { xsk::gsc::location& loc } +%parse-param { xsk::gsc::program_ptr& ast } + +%code requires +{ +#include "iw5.hpp" +typedef void *yyscan_t; +#define YY_DECL xsk::gsc::iw5::parser::symbol_type IW5lex(yyscan_t yyscanner, xsk::gsc::location& loc) +} + +%code top +{ +#include "stdafx.hpp" +#include "parser.hpp" +#include "lexer.hpp" +using namespace xsk::gsc; +xsk::gsc::iw5::parser::symbol_type IW5lex(yyscan_t yyscanner, xsk::gsc::location& loc); +} + +%token INCLUDE "#include" +%token USINGTREE "#using_animtree" +%token ANIMTREE "#animtree" +%token ENDON "endon" +%token NOTIFY "notify" +%token WAIT "wait" +%token WAITTILL "waittill" +%token WAITTILLMATCH "waittillmatch" +%token WAITTILLFRAMEEND "waittillframeend" +%token IF "if" +%token ELSE "else" +%token WHILE "while" +%token FOR "for" +%token FOREACH "foreach" +%token IN "in" +%token SWITCH "switch" +%token CASE "case" +%token DEFAULT "default" +%token BREAK "break" +%token CONTINUE "continue" +%token RETURN "return" +%token THREAD "thread" +%token CHILDTHREAD "childthread" +%token THISTHREAD "thisthread" +%token CALL "call" +%token TRUE "true" +%token FALSE "false" +%token UNDEFINED "undefined" +%token SIZE "size" +%token GAME "game" +%token SELF "self" +%token ANIM "anim" +%token LEVEL "level" +%token LPAREN "(" +%token RPAREN ")" +%token LBRACE "{" +%token RBRACE "}" +%token LBRACKET "[" +%token RBRACKET "]" +%token COMMA "," +%token DOT "." +%token DOUBLECOLON "::" +%token COLON ":" +%token SEMICOLON ";" +%token INCREMENT "++" +%token DECREMENT "--" +%token LSHIFT "<<" +%token RSHIFT ">>" +%token OR "||" +%token AND "&&" +%token EQUALITY "==" +%token INEQUALITY "!=" +%token LESS_EQUAL "<=" +%token GREATER_EQUAL ">=" +%token LESS "<" +%token GREATER ">" +%token NOT "!" +%token COMPLEMENT "~" +%token ASSIGN "=" +%token ASSIGN_ADD "+=" +%token ASSIGN_SUB "-=" +%token ASSIGN_MULT "*=" +%token ASSIGN_DIV "/=" +%token ASSIGN_MOD "%=" +%token ASSIGN_BITWISE_OR "|=" +%token ASSIGN_BITWISE_AND "&=" +%token ASSIGN_BITWISE_EXOR "^=" +%token ASSIGN_RSHIFT ">>=" +%token ASSIGN_LSHIFT "<<=" +%token BITWISE_OR "|" +%token BITWISE_AND "&" +%token BITWISE_EXOR "^" +%token ADD "+" +%token SUB "-" +%token MULT "*" +%token DIV "/" +%token MOD "%" +%token FILE "file path" +%token NAME "identifier" +%token STRING "string literal" +%token ISTRING "localized string" +%token FLOAT "float" +%token INTEGER "int" + +%type program +%type include +%type define +%type usingtree +%type constant +%type thread +%type parameters +%type stmt +%type stmt_block +%type stmt_list +%type stmt_call +%type stmt_assign +%type stmt_endon +%type stmt_notify +%type stmt_wait +%type stmt_waittill +%type stmt_waittillmatch +%type stmt_waittillframeend +%type stmt_if +%type stmt_ifelse +%type stmt_while +%type stmt_for +%type stmt_foreach +%type stmt_switch +%type stmt_case +%type stmt_default +%type stmt_break +%type stmt_continue +%type stmt_return +%type for_stmt +%type for_expr +%type expr_assign +%type expr +%type expr_compare +%type expr_binary +%type expr_primitive +%type expr_call +%type expr_call_thread +%type expr_call_childthread +%type expr_call_function +%type expr_call_pointer +%type expr_arguments +%type expr_arguments_filled +%type expr_arguments_empty +%type expr_function +%type expr_add_array +%type expr_array +%type expr_field +%type expr_size +%type object +%type thisthread +%type empty_array +%type undefined +%type game +%type self +%type anim +%type level +%type animation +%type animtree +%type name +%type file +%type istring +%type string +%type vector +%type neg_float +%type neg_integer +%type float +%type integer +%type false +%type true + +%nonassoc ADD_ARRAY +%nonassoc RBRACKET +%nonassoc THEN +%nonassoc ELSE +%nonassoc INCREMENT DECREMENT + +%left OR +%left AND +%left BITWISE_OR +%left BITWISE_AND +%left BITWISE_EXOR +%left EQUALITY INEQUALITY +%left LESS GREATER LESS_EQUAL GREATER_EQUAL +%left LSHIFT RSHIFT +%left ADD SUB +%left MULT DIV MOD +%right NOT COMPLEMENT + +%precedence NEG +%precedence ANIMREF +%precedence PREINC PREDEC +%precedence POSTINC POSTDEC + +%start root + +%% + +root + : program { ast = std::move($1); } + | { ast = std::make_unique(@$); } + ; + +program + : program include + { $$ = std::move($1); $$->includes.push_back(std::move($2)); } + | program define + { $$ = std::move($1); $$->definitions.push_back(std::move($2)); } + | include + { $$ = std::make_unique(@$); $$->includes.push_back(std::move($1)); } + | define + { $$ = std::make_unique(@$); $$->definitions.push_back(std::move($1)); } + ; + +include + : INCLUDE file SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + ; + +define + : usingtree { $$.as_usingtree = std::move($1); } + | constant { $$.as_constant = std::move($1); } + | thread { $$.as_thread = std::move($1); } + ; + +usingtree + : USINGTREE LPAREN string RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($3)); } + ; + +constant + : name ASSIGN expr SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +thread + : name LPAREN parameters RPAREN stmt_block + { $$ = std::make_unique(@$, std::move($1), std::move($3), std::move($5)); } + ; + +parameters + : parameters COMMA name + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | name + { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } + | + { $$ = std::make_unique(@$); } + ; + +stmt + : stmt_block { $$.as_list = std::move($1); } + | stmt_call { $$.as_call = std::move($1); } + | stmt_assign { $$.as_assign = std::move($1); } + | stmt_endon { $$.as_endon = std::move($1); } + | stmt_notify { $$.as_notify = std::move($1); } + | stmt_wait { $$.as_wait = std::move($1); } + | stmt_waittill { $$.as_waittill = std::move($1); } + | stmt_waittillmatch { $$.as_waittillmatch = std::move($1); } + | stmt_waittillframeend { $$.as_waittillframeend = std::move($1); } + | stmt_if { $$.as_if = std::move($1); } + | stmt_ifelse { $$.as_ifelse = std::move($1); } + | stmt_while { $$.as_while = std::move($1); } + | stmt_for { $$.as_for = std::move($1); } + | stmt_foreach { $$.as_foreach = std::move($1); } + | stmt_switch { $$.as_switch = std::move($1); } + | stmt_case { $$.as_case = std::move($1); } + | stmt_default { $$.as_default = std::move($1); } + | stmt_break { $$.as_break = std::move($1); } + | stmt_continue { $$.as_continue = std::move($1); } + | stmt_return { $$.as_return = std::move($1); } + ; + +stmt_block + : LBRACE stmt_list RBRACE { $$ = std::move($2); } + | LBRACE RBRACE { $$ = std::make_unique(@$); } + ; + +stmt_list + : stmt_list stmt + { $$ = std::move($1); $$->stmts.push_back(std::move($2)); } + | stmt + { $$ = std::make_unique(@$); $$->stmts.push_back(std::move($1)); } + ; + +stmt_call + : expr_call SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + | expr_call_thread SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + ; + +stmt_assign + : expr_assign SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + ; + +stmt_endon + : object ENDON LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4)); } + ; + +stmt_notify + : object NOTIFY LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object NOTIFY LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_wait + : WAIT expr SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + ; + +stmt_waittill + : object WAITTILL LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object WAITTILL LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_waittillmatch + : object WAITTILLMATCH LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object WAITTILLMATCH LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_waittillframeend + : WAITTILLFRAMEEND SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_if + : IF LPAREN expr RPAREN stmt %prec THEN + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_ifelse + : IF LPAREN expr RPAREN stmt ELSE stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5), std::move($7)); } + ; + +stmt_while + : WHILE LPAREN expr RPAREN stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_for + : FOR LPAREN for_stmt SEMICOLON for_expr SEMICOLON for_stmt RPAREN stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5), std::move($7), std::move($9)); } + ; + +stmt_foreach + : FOREACH LPAREN name IN expr RPAREN stmt + { $$ = std::make_unique(@$, expr_ptr(std::move($3)), std::move($5), std::move($7)); } + | FOREACH LPAREN name COMMA name IN expr RPAREN stmt + { $$ = std::make_unique(@$, expr_ptr(std::move($3)), expr_ptr(std::move($5)), std::move($7), std::move($9)); } + ; + +stmt_switch + : SWITCH LPAREN expr RPAREN stmt_block + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_case + : CASE integer COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + | CASE neg_integer COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + | CASE string COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + ; + +stmt_default + : DEFAULT COLON + { $$ = std::make_unique(@$, std::make_unique(@$)); } + ; + +stmt_break + : BREAK SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_continue + : CONTINUE SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_return + : RETURN expr SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + | RETURN SEMICOLON + { $$ = std::make_unique(@$, std::make_unique(@$)); } + ; + +for_stmt + : expr_assign { $$.as_list = std::make_unique(@$); $$.as_list->stmts.push_back(stmt_ptr(std::make_unique(@$, std::move($1)))); } + | { $$.as_node = std::make_unique(@$); } + ; + +for_expr + : expr { $$ = std::move($1); } + | { $$.as_node = std::make_unique(@$); } + ; + +expr + : expr_compare { $$ = std::move($1); } + | expr_binary { $$ = std::move($1); } + | expr_primitive { $$ = std::move($1); } + ; + +expr_assign + : INCREMENT object %prec PREINC { $$ = std::make_unique(@$, std::move($2)); } + | DECREMENT object %prec PREDEC { $$ = std::make_unique(@$, std::move($2)); } + | object INCREMENT %prec POSTINC { $$ = std::make_unique(@$, std::move($1)); } + | object DECREMENT %prec POSTDEC { $$ = std::make_unique(@$, std::move($1)); } + | object ASSIGN expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_OR expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_AND expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_EXOR expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_LSHIFT expr { $$ = std::make_unique(@$, std::move($1),std::move( $3)); } + | object ASSIGN_RSHIFT expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_ADD expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_SUB expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_MULT expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_DIV expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_MOD expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_compare + : expr OR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr AND expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr EQUALITY expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr INEQUALITY expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LESS_EQUAL expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr GREATER_EQUAL expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LESS expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr GREATER expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_binary + : expr BITWISE_OR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr BITWISE_AND expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr BITWISE_EXOR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LSHIFT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr RSHIFT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr ADD expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr SUB expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr MULT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr DIV expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr MOD expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_primitive + : LPAREN expr RPAREN { $$ = std::move($2); } + | COMPLEMENT expr { $$.as_node = std::make_unique(@$, std::move($2)); } + | NOT expr { $$.as_node = std::make_unique(@$, std::move($2)); } + | expr_call { $$.as_node = std::move($1); } + | expr_call_thread { $$.as_node = std::move($1); } + | expr_call_childthread { $$.as_node = std::move($1); } + | expr_function { $$.as_node = std::move($1); } + | expr_add_array { $$.as_node = std::move($1); } + | expr_array { $$.as_node = std::move($1); } + | expr_field { $$.as_node = std::move($1); } + | expr_size { $$.as_node = std::move($1); } + | thisthread { $$.as_node = std::move($1); } + | empty_array { $$.as_node = std::move($1); } + | undefined { $$.as_node = std::move($1); } + | game { $$.as_node = std::move($1); } + | self { $$.as_node = std::move($1); } + | anim { $$.as_node = std::move($1); } + | level { $$.as_node = std::move($1); } + | animation { $$.as_node = std::move($1); } + | animtree { $$.as_node = std::move($1); } + | name { $$.as_node = std::move($1); } + | istring { $$.as_node = std::move($1); } + | string { $$.as_node = std::move($1); } + | vector { $$.as_node = std::move($1); } + | neg_float { $$.as_node = std::move($1); } + | neg_integer { $$.as_node = std::move($1); } + | float { $$.as_node = std::move($1); } + | integer { $$.as_node = std::move($1); } + | false { $$.as_node = std::move($1); } + | true { $$.as_node = std::move($1); } + ; + +expr_call + : expr_call_function { $$ = std::make_unique(@$, false, false, std::make_unique(@$), std::move($1)); } + | expr_call_pointer { $$ = std::make_unique(@$, false, false, std::make_unique(@$), std::move($1)); } + | object expr_call_function { $$ = std::make_unique(@$, false, false, std::move($1), std::move($2)); } + | object expr_call_pointer { $$ = std::make_unique(@$, false, false, std::move($1), std::move($2)); } + ; + +expr_call_thread + : THREAD expr_call_function { $$ = std::make_unique(@$, true, false, std::make_unique(@$), std::move($2)); } + | THREAD expr_call_pointer { $$ = std::make_unique(@$, true, false, std::make_unique(@$), std::move($2)); } + | object THREAD expr_call_function { $$ = std::make_unique(@$, true, false, std::move($1), std::move($3)); } + | object THREAD expr_call_pointer { $$ = std::make_unique(@$, true, false, std::move($1), std::move($3)); } + ; + +expr_call_childthread + : CHILDTHREAD expr_call_function { $$ = std::make_unique(@$, false, true, std::make_unique(@$), std::move($2)); } + | CHILDTHREAD expr_call_pointer { $$ = std::make_unique(@$, false, true, std::make_unique(@$), std::move($2)); } + | object CHILDTHREAD expr_call_function { $$ = std::make_unique(@$, false, true, std::move($1), std::move($3)); } + | object CHILDTHREAD expr_call_pointer { $$ = std::make_unique(@$, false, true, std::move($1), std::move($3)); } + ; + +expr_call_function + : name LPAREN expr_arguments RPAREN + {$$.as_func = std::make_unique(@$, std::make_unique(), std::move($1), std::move($3)); } + | file DOUBLECOLON name LPAREN expr_arguments RPAREN + { $$.as_func = std::make_unique(@$, std::move($1), std::move($3), std::move($5)); } + ; + +expr_call_pointer + : LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = std::make_unique(@$, false, std::move($3), std::move($7)); } + | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = std::make_unique(@$, true, std::move($4), std::move($8)); } + ; + +expr_arguments + : expr_arguments_filled { $$ = std::move($1); } + | expr_arguments_empty { $$ = std::move($1); } + ; + +expr_arguments_filled + : expr_arguments_filled COMMA expr + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | expr %prec ADD_ARRAY + { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } + ; + +expr_arguments_empty + : + { $$ = std::make_unique(@$); } + ; + +expr_function + : DOUBLECOLON name + { $$ = std::make_unique(@$, std::make_unique(@$), std::move($2)); } + | file DOUBLECOLON name + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_add_array + : LBRACKET expr_arguments_filled RBRACKET + { $$ = std::make_unique(@$, std::move($2)); } + ; + +expr_array + : object LBRACKET expr RBRACKET + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_field + : object DOT name + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_size + : object DOT SIZE + { $$ = std::make_unique(@$, std::move($1)); } + ; + +object + : expr_call { $$ = std::move($1); } + | expr_array { $$ = std::move($1); } + | expr_field { $$ = std::move($1); } + | game { $$ = std::move($1); } + | self { $$ = std::move($1); } + | anim { $$ = std::move($1); } + | level { $$ = std::move($1); } + | name { $$ = std::move($1); } + ; + +thisthread : THISTHREAD { $$ = std::make_unique(@$); }; +empty_array : LBRACKET RBRACKET { $$ = std::make_unique(@$); }; +undefined : UNDEFINED { $$ = std::make_unique(@$); }; +game : GAME { $$ = std::make_unique(@$); }; +self : SELF { $$ = std::make_unique(@$); }; +anim : ANIM { $$ = std::make_unique(@$); }; +level : LEVEL { $$ = std::make_unique(@$); }; +animation : MOD NAME %prec ANIMREF { $$ = std::make_unique(@$, $2); }; +animtree : ANIMTREE { $$ = std::make_unique(@$); }; +name : NAME { $$ = std::make_unique(@$, $1); }; +file : FILE { $$ = std::make_unique(@$, $1); }; +istring : ISTRING { $$ = std::make_unique(@$, $1); }; +string : STRING { $$ = std::make_unique(@$, $1); }; +vector : LPAREN expr COMMA expr COMMA expr RPAREN { $$ = std::make_unique(@$, std::move($2), std::move($4), std::move($6)); }; +neg_float : SUB FLOAT %prec NEG { $$ = std::make_unique(@$, "-" + $2); }; +neg_integer : SUB INTEGER %prec NEG { $$ = std::make_unique(@$, "-" + $2); }; +float : FLOAT { $$ = std::make_unique(@$, $1); }; +integer : INTEGER { $$ = std::make_unique(@$, $1); }; +false : FALSE { $$ = std::make_unique(@$); }; +true : TRUE { $$ = std::make_unique(@$); }; + +%% + +void xsk::gsc::iw5::parser::error(const xsk::gsc::location& loc, const std::string& msg) +{ + throw xsk::gsc::comp_error(loc, msg); +} diff --git a/gen/iw6/Makefile b/gen/iw6/Makefile new file mode 100644 index 00000000..99e6ce53 --- /dev/null +++ b/gen/iw6/Makefile @@ -0,0 +1,11 @@ +generate: IW6 + +clean: + rm -rf ./parser.hpp + rm -rf ./parser.cpp + rm -rf ./lexer.hpp + rm -rf ./lexer.cpp + +IW6: lexer.lpp parser.ypp + flex lexer.lpp + bison parser.ypp -Wcounterexamples diff --git a/gen/iw6/lexer.lpp b/gen/iw6/lexer.lpp new file mode 100644 index 00000000..99899f9f --- /dev/null +++ b/gen/iw6/lexer.lpp @@ -0,0 +1,144 @@ +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ + +%option outfile="lexer.cpp" +%option header-file="lexer.hpp" +%option prefix="iw6_" +%option reentrant +%option noyywrap batch nounput noinput +%option never-interactive +%option nounistd + +%top{ +#include "stdafx.hpp" +#include "iw6.hpp" +#include "parser.hpp" +using namespace xsk::gsc; +} + +%{ +#define YY_USER_ACTION loc.columns(yyleng); +%} + +RGX_FILE ([_A-Za-z0-9]+\\)+[_A-Za-z0-9]+ +RGX_NAME [_A-Za-z][_A-Za-z0-9]* +RGX_STRING \"(?:\\.|[^\"])*?\"|\'(?:\\.|[^\'])*?\' +RGX_FLOAT [0-9]+\.(?:[0-9]*)?f?|\.[0-9]+f? +RGX_INTEGER [0-9]+ +RGX_DEFAULT (.|\n) + +%x COMMENT_BLOCK_STATE +%x DEVELOPER_BLOCK_STATE + +%% + +%{ + loc.step(); +%} + +[ \t\r] { loc.step(); } + +\n { loc.lines(yyleng); loc.step(); } + +"//".* + +"/*" { BEGIN(COMMENT_BLOCK_STATE); } +. +\n { loc.lines(yyleng); loc.step(); } +"*/" { BEGIN(INITIAL); } + +"/#" { BEGIN(DEVELOPER_BLOCK_STATE); } +. +\n { loc.lines(yyleng); loc.step(); } +"#/" { BEGIN(INITIAL); } + +"#include" { return iw6::parser::make_INCLUDE(loc); } +"#using_animtree" { return iw6::parser::make_USINGTREE(loc); } +"#animtree" { return iw6::parser::make_ANIMTREE(loc); } +"endon" { return iw6::parser::make_ENDON(loc); } +"notify" { return iw6::parser::make_NOTIFY(loc); } +"wait" { return iw6::parser::make_WAIT(loc); } +"waittill" { return iw6::parser::make_WAITTILL(loc); } +"waittillmatch" { return iw6::parser::make_WAITTILLMATCH(loc); } +"waittillframeend" { return iw6::parser::make_WAITTILLFRAMEEND(loc); } +"if" { return iw6::parser::make_IF(loc); } +"else" { return iw6::parser::make_ELSE(loc); } +"while" { return iw6::parser::make_WHILE(loc); } +"for" { return iw6::parser::make_FOR(loc); } +"foreach" { return iw6::parser::make_FOREACH(loc); } +"in" { return iw6::parser::make_IN(loc); } +"switch" { return iw6::parser::make_SWITCH(loc); } +"case" { return iw6::parser::make_CASE(loc); } +"default" { return iw6::parser::make_DEFAULT(loc); } +"break" { return iw6::parser::make_BREAK(loc); } +"continue" { return iw6::parser::make_CONTINUE(loc); } +"return" { return iw6::parser::make_RETURN(loc); } +"thread" { return iw6::parser::make_THREAD(loc); } +"childthread" { return iw6::parser::make_CHILDTHREAD(loc); } +"thisthread" { return iw6::parser::make_THISTHREAD(loc); } +"call" { return iw6::parser::make_CALL(loc); } +"true" { return iw6::parser::make_TRUE(loc); } +"false" { return iw6::parser::make_FALSE(loc); } +"undefined" { return iw6::parser::make_UNDEFINED(loc); } +"size" { return iw6::parser::make_SIZE(loc); } +"game" { return iw6::parser::make_GAME(loc); } +"self" { return iw6::parser::make_SELF(loc); } +"anim" { return iw6::parser::make_ANIM(loc); } +"level" { return iw6::parser::make_LEVEL(loc); } +\( { return iw6::parser::make_LPAREN(loc); } +\) { return iw6::parser::make_RPAREN(loc); } +\{ { return iw6::parser::make_LBRACE(loc); } +\} { return iw6::parser::make_RBRACE(loc); } +\[ { return iw6::parser::make_LBRACKET(loc); } +\] { return iw6::parser::make_RBRACKET(loc); } +\, { return iw6::parser::make_COMMA(loc); } +\. { return iw6::parser::make_DOT(loc); } +\:\: { return iw6::parser::make_DOUBLECOLON(loc); } +\: { return iw6::parser::make_COLON(loc); } +\; { return iw6::parser::make_SEMICOLON(loc); } +\+\+ { return iw6::parser::make_INCREMENT(loc); } +\-\- { return iw6::parser::make_DECREMENT(loc); } +\<\<\= { return iw6::parser::make_ASSIGN_LSHIFT(loc); } +\>\>\= { return iw6::parser::make_ASSIGN_RSHIFT(loc); } +\<\< { return iw6::parser::make_LSHIFT(loc); } +\>\> { return iw6::parser::make_RSHIFT(loc); } +\|\| { return iw6::parser::make_OR(loc); } +\&\& { return iw6::parser::make_AND(loc); } +\=\= { return iw6::parser::make_EQUALITY(loc); } +\!\= { return iw6::parser::make_INEQUALITY(loc); } +\<\= { return iw6::parser::make_LESS_EQUAL(loc); } +\>\= { return iw6::parser::make_GREATER_EQUAL(loc); } +\< { return iw6::parser::make_LESS(loc); } +\> { return iw6::parser::make_GREATER(loc); } +\+\= { return iw6::parser::make_ASSIGN_ADD(loc); } +\-\= { return iw6::parser::make_ASSIGN_SUB(loc); } +\*\= { return iw6::parser::make_ASSIGN_MULT(loc); } +\/\= { return iw6::parser::make_ASSIGN_DIV(loc); } +\%\= { return iw6::parser::make_ASSIGN_MOD(loc); } +\|\= { return iw6::parser::make_ASSIGN_BITWISE_OR(loc); } +\&\= { return iw6::parser::make_ASSIGN_BITWISE_AND(loc); } +\^\= { return iw6::parser::make_ASSIGN_BITWISE_EXOR(loc); } +\= { return iw6::parser::make_ASSIGN(loc); } +\+ { return iw6::parser::make_ADD(loc); } +\- { return iw6::parser::make_SUB(loc); } +\* { return iw6::parser::make_MULT(loc); } +\/ { return iw6::parser::make_DIV(loc); } +\% { return iw6::parser::make_MOD(loc); } +\! { return iw6::parser::make_NOT(loc); } +\~ { return iw6::parser::make_COMPLEMENT(loc); } +\| { return iw6::parser::make_BITWISE_OR(loc); } +\& { return iw6::parser::make_BITWISE_AND(loc); } +\^ { return iw6::parser::make_BITWISE_EXOR(loc); } +{RGX_FILE} { return iw6::parser::make_FILE(utils::string::fordslash(yytext), loc); } +{RGX_NAME} { return iw6::parser::make_NAME((std::string(yytext, 3) == "_ID") ? std::string(yytext) : utils::string::to_lower(yytext), loc); } +\&{RGX_STRING} { return iw6::parser::make_ISTRING(std::string(yytext).substr(1), loc); } +{RGX_STRING} { return iw6::parser::make_STRING(std::string(yytext), loc); } +{RGX_FLOAT} { return iw6::parser::make_FLOAT(std::string(yytext), loc); } +{RGX_INTEGER} { return iw6::parser::make_INTEGER(std::string(yytext), loc); } +<> { return iw6::parser::make_IW6EOF(loc); } +<*>{RGX_DEFAULT} { throw iw6::parser::syntax_error(loc, "bad token: \'" + std::string(yytext) + "\'"); } + +%% diff --git a/gen/iw6/parser.ypp b/gen/iw6/parser.ypp new file mode 100644 index 00000000..c0a197bb --- /dev/null +++ b/gen/iw6/parser.ypp @@ -0,0 +1,634 @@ +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ + +%require "3.7" +%skeleton "lalr1.cc" +%language "c++" +%output "parser.cpp" +%defines "parser.hpp" +%define api.prefix {IW6} +%define api.namespace {xsk::gsc::iw6} +%define api.location.type {xsk::gsc::location} +%define api.value.type variant +%define api.token.constructor +%define api.token.raw +%define parse.assert +%define parse.trace +%define parse.error detailed +%define parse.lac full + +%locations + +%lex-param { yyscan_t yyscanner } +%lex-param { xsk::gsc::location& loc } + +%parse-param { yyscan_t yyscanner } +%parse-param { xsk::gsc::location& loc } +%parse-param { xsk::gsc::program_ptr& ast } + +%code requires +{ +#include "iw6.hpp" +typedef void *yyscan_t; +#define YY_DECL xsk::gsc::iw6::parser::symbol_type IW6lex(yyscan_t yyscanner, xsk::gsc::location& loc) +} + +%code top +{ +#include "stdafx.hpp" +#include "parser.hpp" +#include "lexer.hpp" +using namespace xsk::gsc; +xsk::gsc::iw6::parser::symbol_type IW6lex(yyscan_t yyscanner, xsk::gsc::location& loc); +} + +%token INCLUDE "#include" +%token USINGTREE "#using_animtree" +%token ANIMTREE "#animtree" +%token ENDON "endon" +%token NOTIFY "notify" +%token WAIT "wait" +%token WAITTILL "waittill" +%token WAITTILLMATCH "waittillmatch" +%token WAITTILLFRAMEEND "waittillframeend" +%token IF "if" +%token ELSE "else" +%token WHILE "while" +%token FOR "for" +%token FOREACH "foreach" +%token IN "in" +%token SWITCH "switch" +%token CASE "case" +%token DEFAULT "default" +%token BREAK "break" +%token CONTINUE "continue" +%token RETURN "return" +%token THREAD "thread" +%token CHILDTHREAD "childthread" +%token THISTHREAD "thisthread" +%token CALL "call" +%token TRUE "true" +%token FALSE "false" +%token UNDEFINED "undefined" +%token SIZE "size" +%token GAME "game" +%token SELF "self" +%token ANIM "anim" +%token LEVEL "level" +%token LPAREN "(" +%token RPAREN ")" +%token LBRACE "{" +%token RBRACE "}" +%token LBRACKET "[" +%token RBRACKET "]" +%token COMMA "," +%token DOT "." +%token DOUBLECOLON "::" +%token COLON ":" +%token SEMICOLON ";" +%token INCREMENT "++" +%token DECREMENT "--" +%token LSHIFT "<<" +%token RSHIFT ">>" +%token OR "||" +%token AND "&&" +%token EQUALITY "==" +%token INEQUALITY "!=" +%token LESS_EQUAL "<=" +%token GREATER_EQUAL ">=" +%token LESS "<" +%token GREATER ">" +%token NOT "!" +%token COMPLEMENT "~" +%token ASSIGN "=" +%token ASSIGN_ADD "+=" +%token ASSIGN_SUB "-=" +%token ASSIGN_MULT "*=" +%token ASSIGN_DIV "/=" +%token ASSIGN_MOD "%=" +%token ASSIGN_BITWISE_OR "|=" +%token ASSIGN_BITWISE_AND "&=" +%token ASSIGN_BITWISE_EXOR "^=" +%token ASSIGN_RSHIFT ">>=" +%token ASSIGN_LSHIFT "<<=" +%token BITWISE_OR "|" +%token BITWISE_AND "&" +%token BITWISE_EXOR "^" +%token ADD "+" +%token SUB "-" +%token MULT "*" +%token DIV "/" +%token MOD "%" +%token FILE "file path" +%token NAME "identifier" +%token STRING "string literal" +%token ISTRING "localized string" +%token FLOAT "float" +%token INTEGER "int" + +%type program +%type include +%type define +%type usingtree +%type constant +%type thread +%type parameters +%type stmt +%type stmt_block +%type stmt_list +%type stmt_call +%type stmt_assign +%type stmt_endon +%type stmt_notify +%type stmt_wait +%type stmt_waittill +%type stmt_waittillmatch +%type stmt_waittillframeend +%type stmt_if +%type stmt_ifelse +%type stmt_while +%type stmt_for +%type stmt_foreach +%type stmt_switch +%type stmt_case +%type stmt_default +%type stmt_break +%type stmt_continue +%type stmt_return +%type for_stmt +%type for_expr +%type expr_assign +%type expr +%type expr_compare +%type expr_binary +%type expr_primitive +%type expr_call +%type expr_call_thread +%type expr_call_childthread +%type expr_call_function +%type expr_call_pointer +%type expr_arguments +%type expr_arguments_filled +%type expr_arguments_empty +%type expr_function +%type expr_add_array +%type expr_array +%type expr_field +%type expr_size +%type object +%type thisthread +%type empty_array +%type undefined +%type game +%type self +%type anim +%type level +%type animation +%type animtree +%type name +%type file +%type istring +%type string +%type vector +%type neg_float +%type neg_integer +%type float +%type integer +%type false +%type true + +%nonassoc ADD_ARRAY +%nonassoc RBRACKET +%nonassoc THEN +%nonassoc ELSE +%nonassoc INCREMENT DECREMENT + +%left OR +%left AND +%left BITWISE_OR +%left BITWISE_AND +%left BITWISE_EXOR +%left EQUALITY INEQUALITY +%left LESS GREATER LESS_EQUAL GREATER_EQUAL +%left LSHIFT RSHIFT +%left ADD SUB +%left MULT DIV MOD +%right NOT COMPLEMENT + +%precedence NEG +%precedence ANIMREF +%precedence PREINC PREDEC +%precedence POSTINC POSTDEC + +%start root + +%% + +root + : program { ast = std::move($1); } + | { ast = std::make_unique(@$); } + ; + +program + : program include + { $$ = std::move($1); $$->includes.push_back(std::move($2)); } + | program define + { $$ = std::move($1); $$->definitions.push_back(std::move($2)); } + | include + { $$ = std::make_unique(@$); $$->includes.push_back(std::move($1)); } + | define + { $$ = std::make_unique(@$); $$->definitions.push_back(std::move($1)); } + ; + +include + : INCLUDE file SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + ; + +define + : usingtree { $$.as_usingtree = std::move($1); } + | constant { $$.as_constant = std::move($1); } + | thread { $$.as_thread = std::move($1); } + ; + +usingtree + : USINGTREE LPAREN string RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($3)); } + ; + +constant + : name ASSIGN expr SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +thread + : name LPAREN parameters RPAREN stmt_block + { $$ = std::make_unique(@$, std::move($1), std::move($3), std::move($5)); } + ; + +parameters + : parameters COMMA name + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | name + { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } + | + { $$ = std::make_unique(@$); } + ; + +stmt + : stmt_block { $$.as_list = std::move($1); } + | stmt_call { $$.as_call = std::move($1); } + | stmt_assign { $$.as_assign = std::move($1); } + | stmt_endon { $$.as_endon = std::move($1); } + | stmt_notify { $$.as_notify = std::move($1); } + | stmt_wait { $$.as_wait = std::move($1); } + | stmt_waittill { $$.as_waittill = std::move($1); } + | stmt_waittillmatch { $$.as_waittillmatch = std::move($1); } + | stmt_waittillframeend { $$.as_waittillframeend = std::move($1); } + | stmt_if { $$.as_if = std::move($1); } + | stmt_ifelse { $$.as_ifelse = std::move($1); } + | stmt_while { $$.as_while = std::move($1); } + | stmt_for { $$.as_for = std::move($1); } + | stmt_foreach { $$.as_foreach = std::move($1); } + | stmt_switch { $$.as_switch = std::move($1); } + | stmt_case { $$.as_case = std::move($1); } + | stmt_default { $$.as_default = std::move($1); } + | stmt_break { $$.as_break = std::move($1); } + | stmt_continue { $$.as_continue = std::move($1); } + | stmt_return { $$.as_return = std::move($1); } + ; + +stmt_block + : LBRACE stmt_list RBRACE { $$ = std::move($2); } + | LBRACE RBRACE { $$ = std::make_unique(@$); } + ; + +stmt_list + : stmt_list stmt + { $$ = std::move($1); $$->stmts.push_back(std::move($2)); } + | stmt + { $$ = std::make_unique(@$); $$->stmts.push_back(std::move($1)); } + ; + +stmt_call + : expr_call SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + | expr_call_thread SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + ; + +stmt_assign + : expr_assign SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + ; + +stmt_endon + : object ENDON LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4)); } + ; + +stmt_notify + : object NOTIFY LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object NOTIFY LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_wait + : WAIT expr SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + ; + +stmt_waittill + : object WAITTILL LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object WAITTILL LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_waittillmatch + : object WAITTILLMATCH LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object WAITTILLMATCH LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_waittillframeend + : WAITTILLFRAMEEND SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_if + : IF LPAREN expr RPAREN stmt %prec THEN + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_ifelse + : IF LPAREN expr RPAREN stmt ELSE stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5), std::move($7)); } + ; + +stmt_while + : WHILE LPAREN expr RPAREN stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_for + : FOR LPAREN for_stmt SEMICOLON for_expr SEMICOLON for_stmt RPAREN stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5), std::move($7), std::move($9)); } + ; + +stmt_foreach + : FOREACH LPAREN name IN expr RPAREN stmt + { $$ = std::make_unique(@$, expr_ptr(std::move($3)), std::move($5), std::move($7)); } + | FOREACH LPAREN name COMMA name IN expr RPAREN stmt + { $$ = std::make_unique(@$, expr_ptr(std::move($3)), expr_ptr(std::move($5)), std::move($7), std::move($9)); } + ; + +stmt_switch + : SWITCH LPAREN expr RPAREN stmt_block + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_case + : CASE integer COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + | CASE neg_integer COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + | CASE string COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + ; + +stmt_default + : DEFAULT COLON + { $$ = std::make_unique(@$, std::make_unique(@$)); } + ; + +stmt_break + : BREAK SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_continue + : CONTINUE SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_return + : RETURN expr SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + | RETURN SEMICOLON + { $$ = std::make_unique(@$, std::make_unique(@$)); } + ; + +for_stmt + : expr_assign { $$.as_list = std::make_unique(@$); $$.as_list->stmts.push_back(stmt_ptr(std::make_unique(@$, std::move($1)))); } + | { $$.as_node = std::make_unique(@$); } + ; + +for_expr + : expr { $$ = std::move($1); } + | { $$.as_node = std::make_unique(@$); } + ; + +expr + : expr_compare { $$ = std::move($1); } + | expr_binary { $$ = std::move($1); } + | expr_primitive { $$ = std::move($1); } + ; + +expr_assign + : INCREMENT object %prec PREINC { $$ = std::make_unique(@$, std::move($2)); } + | DECREMENT object %prec PREDEC { $$ = std::make_unique(@$, std::move($2)); } + | object INCREMENT %prec POSTINC { $$ = std::make_unique(@$, std::move($1)); } + | object DECREMENT %prec POSTDEC { $$ = std::make_unique(@$, std::move($1)); } + | object ASSIGN expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_OR expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_AND expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_EXOR expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_LSHIFT expr { $$ = std::make_unique(@$, std::move($1),std::move( $3)); } + | object ASSIGN_RSHIFT expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_ADD expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_SUB expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_MULT expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_DIV expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_MOD expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_compare + : expr OR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr AND expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr EQUALITY expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr INEQUALITY expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LESS_EQUAL expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr GREATER_EQUAL expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LESS expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr GREATER expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_binary + : expr BITWISE_OR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr BITWISE_AND expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr BITWISE_EXOR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LSHIFT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr RSHIFT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr ADD expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr SUB expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr MULT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr DIV expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr MOD expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_primitive + : LPAREN expr RPAREN { $$ = std::move($2); } + | COMPLEMENT expr { $$.as_node = std::make_unique(@$, std::move($2)); } + | NOT expr { $$.as_node = std::make_unique(@$, std::move($2)); } + | expr_call { $$.as_node = std::move($1); } + | expr_call_thread { $$.as_node = std::move($1); } + | expr_call_childthread { $$.as_node = std::move($1); } + | expr_function { $$.as_node = std::move($1); } + | expr_add_array { $$.as_node = std::move($1); } + | expr_array { $$.as_node = std::move($1); } + | expr_field { $$.as_node = std::move($1); } + | expr_size { $$.as_node = std::move($1); } + | thisthread { $$.as_node = std::move($1); } + | empty_array { $$.as_node = std::move($1); } + | undefined { $$.as_node = std::move($1); } + | game { $$.as_node = std::move($1); } + | self { $$.as_node = std::move($1); } + | anim { $$.as_node = std::move($1); } + | level { $$.as_node = std::move($1); } + | animation { $$.as_node = std::move($1); } + | animtree { $$.as_node = std::move($1); } + | name { $$.as_node = std::move($1); } + | istring { $$.as_node = std::move($1); } + | string { $$.as_node = std::move($1); } + | vector { $$.as_node = std::move($1); } + | neg_float { $$.as_node = std::move($1); } + | neg_integer { $$.as_node = std::move($1); } + | float { $$.as_node = std::move($1); } + | integer { $$.as_node = std::move($1); } + | false { $$.as_node = std::move($1); } + | true { $$.as_node = std::move($1); } + ; + +expr_call + : expr_call_function { $$ = std::make_unique(@$, false, false, std::make_unique(@$), std::move($1)); } + | expr_call_pointer { $$ = std::make_unique(@$, false, false, std::make_unique(@$), std::move($1)); } + | object expr_call_function { $$ = std::make_unique(@$, false, false, std::move($1), std::move($2)); } + | object expr_call_pointer { $$ = std::make_unique(@$, false, false, std::move($1), std::move($2)); } + ; + +expr_call_thread + : THREAD expr_call_function { $$ = std::make_unique(@$, true, false, std::make_unique(@$), std::move($2)); } + | THREAD expr_call_pointer { $$ = std::make_unique(@$, true, false, std::make_unique(@$), std::move($2)); } + | object THREAD expr_call_function { $$ = std::make_unique(@$, true, false, std::move($1), std::move($3)); } + | object THREAD expr_call_pointer { $$ = std::make_unique(@$, true, false, std::move($1), std::move($3)); } + ; + +expr_call_childthread + : CHILDTHREAD expr_call_function { $$ = std::make_unique(@$, false, true, std::make_unique(@$), std::move($2)); } + | CHILDTHREAD expr_call_pointer { $$ = std::make_unique(@$, false, true, std::make_unique(@$), std::move($2)); } + | object CHILDTHREAD expr_call_function { $$ = std::make_unique(@$, false, true, std::move($1), std::move($3)); } + | object CHILDTHREAD expr_call_pointer { $$ = std::make_unique(@$, false, true, std::move($1), std::move($3)); } + ; + +expr_call_function + : name LPAREN expr_arguments RPAREN + {$$.as_func = std::make_unique(@$, std::make_unique(), std::move($1), std::move($3)); } + | file DOUBLECOLON name LPAREN expr_arguments RPAREN + { $$.as_func = std::make_unique(@$, std::move($1), std::move($3), std::move($5)); } + ; + +expr_call_pointer + : LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = std::make_unique(@$, false, std::move($3), std::move($7)); } + | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = std::make_unique(@$, true, std::move($4), std::move($8)); } + ; + +expr_arguments + : expr_arguments_filled { $$ = std::move($1); } + | expr_arguments_empty { $$ = std::move($1); } + ; + +expr_arguments_filled + : expr_arguments COMMA expr + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | expr %prec ADD_ARRAY + { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } + ; + +expr_arguments_empty + : + { $$ = std::make_unique(@$); } + ; + +expr_function + : DOUBLECOLON name + { $$ = std::make_unique(@$, std::make_unique(@$), std::move($2)); } + | file DOUBLECOLON name + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_add_array + : LBRACKET expr_arguments_filled RBRACKET + { $$ = std::make_unique(@$, std::move($2)); } + ; + +expr_array + : object LBRACKET expr RBRACKET + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_field + : object DOT name + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_size + : object DOT SIZE + { $$ = std::make_unique(@$, std::move($1)); } + ; + +object + : expr_call { $$ = std::move($1); } + | expr_array { $$ = std::move($1); } + | expr_field { $$ = std::move($1); } + | game { $$ = std::move($1); } + | self { $$ = std::move($1); } + | anim { $$ = std::move($1); } + | level { $$ = std::move($1); } + | name { $$ = std::move($1); } + ; + +thisthread : THISTHREAD { $$ = std::make_unique(@$); }; +empty_array : LBRACKET RBRACKET { $$ = std::make_unique(@$); }; +undefined : UNDEFINED { $$ = std::make_unique(@$); }; +game : GAME { $$ = std::make_unique(@$); }; +self : SELF { $$ = std::make_unique(@$); }; +anim : ANIM { $$ = std::make_unique(@$); }; +level : LEVEL { $$ = std::make_unique(@$); }; +animation : MOD NAME %prec ANIMREF { $$ = std::make_unique(@$, $2); }; +animtree : ANIMTREE { $$ = std::make_unique(@$); }; +name : NAME { $$ = std::make_unique(@$, $1); }; +file : FILE { $$ = std::make_unique(@$, $1); }; +istring : ISTRING { $$ = std::make_unique(@$, $1); }; +string : STRING { $$ = std::make_unique(@$, $1); }; +vector : LPAREN expr COMMA expr COMMA expr RPAREN { $$ = std::make_unique(@$, std::move($2), std::move($4), std::move($6)); }; +neg_float : SUB FLOAT %prec NEG { $$ = std::make_unique(@$, "-" + $2); }; +neg_integer : SUB INTEGER %prec NEG { $$ = std::make_unique(@$, "-" + $2); }; +float : FLOAT { $$ = std::make_unique(@$, $1); }; +integer : INTEGER { $$ = std::make_unique(@$, $1); }; +false : FALSE { $$ = std::make_unique(@$); }; +true : TRUE { $$ = std::make_unique(@$); }; + +%% + +void xsk::gsc::iw6::parser::error(const xsk::gsc::location& loc, const std::string& msg) +{ + throw xsk::gsc::comp_error(loc, msg); +} diff --git a/gen/iw7/Makefile b/gen/iw7/Makefile new file mode 100644 index 00000000..80caeea9 --- /dev/null +++ b/gen/iw7/Makefile @@ -0,0 +1,11 @@ +generate: IW7 + +clean: + rm -rf ./parser.hpp + rm -rf ./parser.cpp + rm -rf ./lexer.hpp + rm -rf ./lexer.cpp + +IW7: lexer.lpp parser.ypp + flex lexer.lpp + bison parser.ypp -Wcounterexamples diff --git a/gen/iw7/lexer.lpp b/gen/iw7/lexer.lpp new file mode 100644 index 00000000..94ef16c0 --- /dev/null +++ b/gen/iw7/lexer.lpp @@ -0,0 +1,144 @@ +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ + +%option outfile="lexer.cpp" +%option header-file="lexer.hpp" +%option prefix="iw7_" +%option reentrant +%option noyywrap batch nounput noinput +%option never-interactive +%option nounistd + +%top{ +#include "stdafx.hpp" +#include "iw7.hpp" +#include "parser.hpp" +using namespace xsk::gsc; +} + +%{ +#define YY_USER_ACTION loc.columns(yyleng); +%} + +RGX_FILE ([_A-Za-z0-9]+\\)+[_A-Za-z0-9]+ +RGX_NAME [_A-Za-z][_A-Za-z0-9]* +RGX_STRING \"(?:\\.|[^\"])*?\"|\'(?:\\.|[^\'])*?\' +RGX_FLOAT [0-9]+\.(?:[0-9]*)?f?|\.[0-9]+f? +RGX_INTEGER [0-9]+ +RGX_DEFAULT (.|\n) + +%x COMMENT_BLOCK_STATE +%x DEVELOPER_BLOCK_STATE + +%% + +%{ + loc.step(); +%} + +[ \t\r] { loc.step(); } + +\n { loc.lines(yyleng); loc.step(); } + +"//".* + +"/*" { BEGIN(COMMENT_BLOCK_STATE); } +. +\n { loc.lines(yyleng); loc.step(); } +"*/" { BEGIN(INITIAL); } + +"/#" { BEGIN(DEVELOPER_BLOCK_STATE); } +. +\n { loc.lines(yyleng); loc.step(); } +"#/" { BEGIN(INITIAL); } + +"#include" { return iw7::parser::make_INCLUDE(loc); } +"#using_animtree" { return iw7::parser::make_USINGTREE(loc); } +"#animtree" { return iw7::parser::make_ANIMTREE(loc); } +"endon" { return iw7::parser::make_ENDON(loc); } +"notify" { return iw7::parser::make_NOTIFY(loc); } +"wait" { return iw7::parser::make_WAIT(loc); } +"waittill" { return iw7::parser::make_WAITTILL(loc); } +"waittillmatch" { return iw7::parser::make_WAITTILLMATCH(loc); } +"waittillframeend" { return iw7::parser::make_WAITTILLFRAMEEND(loc); } +"if" { return iw7::parser::make_IF(loc); } +"else" { return iw7::parser::make_ELSE(loc); } +"while" { return iw7::parser::make_WHILE(loc); } +"for" { return iw7::parser::make_FOR(loc); } +"foreach" { return iw7::parser::make_FOREACH(loc); } +"in" { return iw7::parser::make_IN(loc); } +"switch" { return iw7::parser::make_SWITCH(loc); } +"case" { return iw7::parser::make_CASE(loc); } +"default" { return iw7::parser::make_DEFAULT(loc); } +"break" { return iw7::parser::make_BREAK(loc); } +"continue" { return iw7::parser::make_CONTINUE(loc); } +"return" { return iw7::parser::make_RETURN(loc); } +"thread" { return iw7::parser::make_THREAD(loc); } +"childthread" { return iw7::parser::make_CHILDTHREAD(loc); } +"thisthread" { return iw7::parser::make_THISTHREAD(loc); } +"call" { return iw7::parser::make_CALL(loc); } +"true" { return iw7::parser::make_TRUE(loc); } +"false" { return iw7::parser::make_FALSE(loc); } +"undefined" { return iw7::parser::make_UNDEFINED(loc); } +"size" { return iw7::parser::make_SIZE(loc); } +"game" { return iw7::parser::make_GAME(loc); } +"self" { return iw7::parser::make_SELF(loc); } +"anim" { return iw7::parser::make_ANIM(loc); } +"level" { return iw7::parser::make_LEVEL(loc); } +\( { return iw7::parser::make_LPAREN(loc); } +\) { return iw7::parser::make_RPAREN(loc); } +\{ { return iw7::parser::make_LBRACE(loc); } +\} { return iw7::parser::make_RBRACE(loc); } +\[ { return iw7::parser::make_LBRACKET(loc); } +\] { return iw7::parser::make_RBRACKET(loc); } +\, { return iw7::parser::make_COMMA(loc); } +\. { return iw7::parser::make_DOT(loc); } +\:\: { return iw7::parser::make_DOUBLECOLON(loc); } +\: { return iw7::parser::make_COLON(loc); } +\; { return iw7::parser::make_SEMICOLON(loc); } +\+\+ { return iw7::parser::make_INCREMENT(loc); } +\-\- { return iw7::parser::make_DECREMENT(loc); } +\<\<\= { return iw7::parser::make_ASSIGN_LSHIFT(loc); } +\>\>\= { return iw7::parser::make_ASSIGN_RSHIFT(loc); } +\<\< { return iw7::parser::make_LSHIFT(loc); } +\>\> { return iw7::parser::make_RSHIFT(loc); } +\|\| { return iw7::parser::make_OR(loc); } +\&\& { return iw7::parser::make_AND(loc); } +\=\= { return iw7::parser::make_EQUALITY(loc); } +\!\= { return iw7::parser::make_INEQUALITY(loc); } +\<\= { return iw7::parser::make_LESS_EQUAL(loc); } +\>\= { return iw7::parser::make_GREATER_EQUAL(loc); } +\< { return iw7::parser::make_LESS(loc); } +\> { return iw7::parser::make_GREATER(loc); } +\+\= { return iw7::parser::make_ASSIGN_ADD(loc); } +\-\= { return iw7::parser::make_ASSIGN_SUB(loc); } +\*\= { return iw7::parser::make_ASSIGN_MULT(loc); } +\/\= { return iw7::parser::make_ASSIGN_DIV(loc); } +\%\= { return iw7::parser::make_ASSIGN_MOD(loc); } +\|\= { return iw7::parser::make_ASSIGN_BITWISE_OR(loc); } +\&\= { return iw7::parser::make_ASSIGN_BITWISE_AND(loc); } +\^\= { return iw7::parser::make_ASSIGN_BITWISE_EXOR(loc); } +\= { return iw7::parser::make_ASSIGN(loc); } +\+ { return iw7::parser::make_ADD(loc); } +\- { return iw7::parser::make_SUB(loc); } +\* { return iw7::parser::make_MULT(loc); } +\/ { return iw7::parser::make_DIV(loc); } +\% { return iw7::parser::make_MOD(loc); } +\! { return iw7::parser::make_NOT(loc); } +\~ { return iw7::parser::make_COMPLEMENT(loc); } +\| { return iw7::parser::make_BITWISE_OR(loc); } +\& { return iw7::parser::make_BITWISE_AND(loc); } +\^ { return iw7::parser::make_BITWISE_EXOR(loc); } +{RGX_FILE} { return iw7::parser::make_FILE(utils::string::fordslash(yytext), loc); } +{RGX_NAME} { return iw7::parser::make_NAME((std::string(yytext, 3) == "_ID") ? std::string(yytext) : utils::string::to_lower(yytext), loc); } +\&{RGX_STRING} { return iw7::parser::make_ISTRING(std::string(yytext).substr(1), loc); } +{RGX_STRING} { return iw7::parser::make_STRING(std::string(yytext), loc); } +{RGX_FLOAT} { return iw7::parser::make_FLOAT(std::string(yytext), loc); } +{RGX_INTEGER} { return iw7::parser::make_INTEGER(std::string(yytext), loc); } +<> { return iw7::parser::make_IW7EOF(loc); } +<*>{RGX_DEFAULT} { throw iw7::parser::syntax_error(loc, "bad token: \'" + std::string(yytext) + "\'"); } + +%% diff --git a/gen/iw7/parser.ypp b/gen/iw7/parser.ypp new file mode 100644 index 00000000..b3f623a2 --- /dev/null +++ b/gen/iw7/parser.ypp @@ -0,0 +1,634 @@ +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ + +%require "3.7" +%skeleton "lalr1.cc" +%language "c++" +%output "parser.cpp" +%defines "parser.hpp" +%define api.prefix {IW7} +%define api.namespace {xsk::gsc::iw7} +%define api.location.type {xsk::gsc::location} +%define api.value.type variant +%define api.token.constructor +%define api.token.raw +%define parse.assert +%define parse.trace +%define parse.error detailed +%define parse.lac full + +%locations + +%lex-param { yyscan_t yyscanner } +%lex-param { xsk::gsc::location& loc } + +%parse-param { yyscan_t yyscanner } +%parse-param { xsk::gsc::location& loc } +%parse-param { xsk::gsc::program_ptr& ast } + +%code requires +{ +#include "iw7.hpp" +typedef void *yyscan_t; +#define YY_DECL xsk::gsc::iw7::parser::symbol_type IW7lex(yyscan_t yyscanner, xsk::gsc::location& loc) +} + +%code top +{ +#include "stdafx.hpp" +#include "parser.hpp" +#include "lexer.hpp" +using namespace xsk::gsc; +xsk::gsc::iw7::parser::symbol_type IW7lex(yyscan_t yyscanner, xsk::gsc::location& loc); +} + +%token INCLUDE "#include" +%token USINGTREE "#using_animtree" +%token ANIMTREE "#animtree" +%token ENDON "endon" +%token NOTIFY "notify" +%token WAIT "wait" +%token WAITTILL "waittill" +%token WAITTILLMATCH "waittillmatch" +%token WAITTILLFRAMEEND "waittillframeend" +%token IF "if" +%token ELSE "else" +%token WHILE "while" +%token FOR "for" +%token FOREACH "foreach" +%token IN "in" +%token SWITCH "switch" +%token CASE "case" +%token DEFAULT "default" +%token BREAK "break" +%token CONTINUE "continue" +%token RETURN "return" +%token THREAD "thread" +%token CHILDTHREAD "childthread" +%token THISTHREAD "thisthread" +%token CALL "call" +%token TRUE "true" +%token FALSE "false" +%token UNDEFINED "undefined" +%token SIZE "size" +%token GAME "game" +%token SELF "self" +%token ANIM "anim" +%token LEVEL "level" +%token LPAREN "(" +%token RPAREN ")" +%token LBRACE "{" +%token RBRACE "}" +%token LBRACKET "[" +%token RBRACKET "]" +%token COMMA "," +%token DOT "." +%token DOUBLECOLON "::" +%token COLON ":" +%token SEMICOLON ";" +%token INCREMENT "++" +%token DECREMENT "--" +%token LSHIFT "<<" +%token RSHIFT ">>" +%token OR "||" +%token AND "&&" +%token EQUALITY "==" +%token INEQUALITY "!=" +%token LESS_EQUAL "<=" +%token GREATER_EQUAL ">=" +%token LESS "<" +%token GREATER ">" +%token NOT "!" +%token COMPLEMENT "~" +%token ASSIGN "=" +%token ASSIGN_ADD "+=" +%token ASSIGN_SUB "-=" +%token ASSIGN_MULT "*=" +%token ASSIGN_DIV "/=" +%token ASSIGN_MOD "%=" +%token ASSIGN_BITWISE_OR "|=" +%token ASSIGN_BITWISE_AND "&=" +%token ASSIGN_BITWISE_EXOR "^=" +%token ASSIGN_RSHIFT ">>=" +%token ASSIGN_LSHIFT "<<=" +%token BITWISE_OR "|" +%token BITWISE_AND "&" +%token BITWISE_EXOR "^" +%token ADD "+" +%token SUB "-" +%token MULT "*" +%token DIV "/" +%token MOD "%" +%token FILE "file path" +%token NAME "identifier" +%token STRING "string literal" +%token ISTRING "localized string" +%token FLOAT "float" +%token INTEGER "int" + +%type program +%type include +%type define +%type usingtree +%type constant +%type thread +%type parameters +%type stmt +%type stmt_block +%type stmt_list +%type stmt_call +%type stmt_assign +%type stmt_endon +%type stmt_notify +%type stmt_wait +%type stmt_waittill +%type stmt_waittillmatch +%type stmt_waittillframeend +%type stmt_if +%type stmt_ifelse +%type stmt_while +%type stmt_for +%type stmt_foreach +%type stmt_switch +%type stmt_case +%type stmt_default +%type stmt_break +%type stmt_continue +%type stmt_return +%type for_stmt +%type for_expr +%type expr_assign +%type expr +%type expr_compare +%type expr_binary +%type expr_primitive +%type expr_call +%type expr_call_thread +%type expr_call_childthread +%type expr_call_function +%type expr_call_pointer +%type expr_arguments +%type expr_arguments_filled +%type expr_arguments_empty +%type expr_function +%type expr_add_array +%type expr_array +%type expr_field +%type expr_size +%type object +%type thisthread +%type empty_array +%type undefined +%type game +%type self +%type anim +%type level +%type animation +%type animtree +%type name +%type file +%type istring +%type string +%type vector +%type neg_float +%type neg_integer +%type float +%type integer +%type false +%type true + +%nonassoc ADD_ARRAY +%nonassoc RBRACKET +%nonassoc THEN +%nonassoc ELSE +%nonassoc INCREMENT DECREMENT + +%left OR +%left AND +%left BITWISE_OR +%left BITWISE_AND +%left BITWISE_EXOR +%left EQUALITY INEQUALITY +%left LESS GREATER LESS_EQUAL GREATER_EQUAL +%left LSHIFT RSHIFT +%left ADD SUB +%left MULT DIV MOD +%right NOT COMPLEMENT + +%precedence NEG +%precedence ANIMREF +%precedence PREINC PREDEC +%precedence POSTINC POSTDEC + +%start root + +%% + +root + : program { ast = std::move($1); } + | { ast = std::make_unique(@$); } + ; + +program + : program include + { $$ = std::move($1); $$->includes.push_back(std::move($2)); } + | program define + { $$ = std::move($1); $$->definitions.push_back(std::move($2)); } + | include + { $$ = std::make_unique(@$); $$->includes.push_back(std::move($1)); } + | define + { $$ = std::make_unique(@$); $$->definitions.push_back(std::move($1)); } + ; + +include + : INCLUDE file SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + ; + +define + : usingtree { $$.as_usingtree = std::move($1); } + | constant { $$.as_constant = std::move($1); } + | thread { $$.as_thread = std::move($1); } + ; + +usingtree + : USINGTREE LPAREN string RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($3)); } + ; + +constant + : name ASSIGN expr SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +thread + : name LPAREN parameters RPAREN stmt_block + { $$ = std::make_unique(@$, std::move($1), std::move($3), std::move($5)); } + ; + +parameters + : parameters COMMA name + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | name + { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } + | + { $$ = std::make_unique(@$); } + ; + +stmt + : stmt_block { $$.as_list = std::move($1); } + | stmt_call { $$.as_call = std::move($1); } + | stmt_assign { $$.as_assign = std::move($1); } + | stmt_endon { $$.as_endon = std::move($1); } + | stmt_notify { $$.as_notify = std::move($1); } + | stmt_wait { $$.as_wait = std::move($1); } + | stmt_waittill { $$.as_waittill = std::move($1); } + | stmt_waittillmatch { $$.as_waittillmatch = std::move($1); } + | stmt_waittillframeend { $$.as_waittillframeend = std::move($1); } + | stmt_if { $$.as_if = std::move($1); } + | stmt_ifelse { $$.as_ifelse = std::move($1); } + | stmt_while { $$.as_while = std::move($1); } + | stmt_for { $$.as_for = std::move($1); } + | stmt_foreach { $$.as_foreach = std::move($1); } + | stmt_switch { $$.as_switch = std::move($1); } + | stmt_case { $$.as_case = std::move($1); } + | stmt_default { $$.as_default = std::move($1); } + | stmt_break { $$.as_break = std::move($1); } + | stmt_continue { $$.as_continue = std::move($1); } + | stmt_return { $$.as_return = std::move($1); } + ; + +stmt_block + : LBRACE stmt_list RBRACE { $$ = std::move($2); } + | LBRACE RBRACE { $$ = std::make_unique(@$); } + ; + +stmt_list + : stmt_list stmt + { $$ = std::move($1); $$->stmts.push_back(std::move($2)); } + | stmt + { $$ = std::make_unique(@$); $$->stmts.push_back(std::move($1)); } + ; + +stmt_call + : expr_call SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + | expr_call_thread SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + ; + +stmt_assign + : expr_assign SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + ; + +stmt_endon + : object ENDON LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4)); } + ; + +stmt_notify + : object NOTIFY LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object NOTIFY LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_wait + : WAIT expr SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + ; + +stmt_waittill + : object WAITTILL LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object WAITTILL LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_waittillmatch + : object WAITTILLMATCH LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object WAITTILLMATCH LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_waittillframeend + : WAITTILLFRAMEEND SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_if + : IF LPAREN expr RPAREN stmt %prec THEN + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_ifelse + : IF LPAREN expr RPAREN stmt ELSE stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5), std::move($7)); } + ; + +stmt_while + : WHILE LPAREN expr RPAREN stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_for + : FOR LPAREN for_stmt SEMICOLON for_expr SEMICOLON for_stmt RPAREN stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5), std::move($7), std::move($9)); } + ; + +stmt_foreach + : FOREACH LPAREN name IN expr RPAREN stmt + { $$ = std::make_unique(@$, expr_ptr(std::move($3)), std::move($5), std::move($7)); } + | FOREACH LPAREN name COMMA name IN expr RPAREN stmt + { $$ = std::make_unique(@$, expr_ptr(std::move($3)), expr_ptr(std::move($5)), std::move($7), std::move($9)); } + ; + +stmt_switch + : SWITCH LPAREN expr RPAREN stmt_block + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_case + : CASE integer COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + | CASE neg_integer COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + | CASE string COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + ; + +stmt_default + : DEFAULT COLON + { $$ = std::make_unique(@$, std::make_unique(@$)); } + ; + +stmt_break + : BREAK SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_continue + : CONTINUE SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_return + : RETURN expr SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + | RETURN SEMICOLON + { $$ = std::make_unique(@$, std::make_unique(@$)); } + ; + +for_stmt + : expr_assign { $$.as_list = std::make_unique(@$); $$.as_list->stmts.push_back(stmt_ptr(std::make_unique(@$, std::move($1)))); } + | { $$.as_node = std::make_unique(@$); } + ; + +for_expr + : expr { $$ = std::move($1); } + | { $$.as_node = std::make_unique(@$); } + ; + +expr + : expr_compare { $$ = std::move($1); } + | expr_binary { $$ = std::move($1); } + | expr_primitive { $$ = std::move($1); } + ; + +expr_assign + : INCREMENT object %prec PREINC { $$ = std::make_unique(@$, std::move($2)); } + | DECREMENT object %prec PREDEC { $$ = std::make_unique(@$, std::move($2)); } + | object INCREMENT %prec POSTINC { $$ = std::make_unique(@$, std::move($1)); } + | object DECREMENT %prec POSTDEC { $$ = std::make_unique(@$, std::move($1)); } + | object ASSIGN expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_OR expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_AND expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_EXOR expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_LSHIFT expr { $$ = std::make_unique(@$, std::move($1),std::move( $3)); } + | object ASSIGN_RSHIFT expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_ADD expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_SUB expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_MULT expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_DIV expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_MOD expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_compare + : expr OR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr AND expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr EQUALITY expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr INEQUALITY expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LESS_EQUAL expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr GREATER_EQUAL expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LESS expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr GREATER expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_binary + : expr BITWISE_OR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr BITWISE_AND expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr BITWISE_EXOR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LSHIFT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr RSHIFT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr ADD expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr SUB expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr MULT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr DIV expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr MOD expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_primitive + : LPAREN expr RPAREN { $$ = std::move($2); } + | COMPLEMENT expr { $$.as_node = std::make_unique(@$, std::move($2)); } + | NOT expr { $$.as_node = std::make_unique(@$, std::move($2)); } + | expr_call { $$.as_node = std::move($1); } + | expr_call_thread { $$.as_node = std::move($1); } + | expr_call_childthread { $$.as_node = std::move($1); } + | expr_function { $$.as_node = std::move($1); } + | expr_add_array { $$.as_node = std::move($1); } + | expr_array { $$.as_node = std::move($1); } + | expr_field { $$.as_node = std::move($1); } + | expr_size { $$.as_node = std::move($1); } + | thisthread { $$.as_node = std::move($1); } + | empty_array { $$.as_node = std::move($1); } + | undefined { $$.as_node = std::move($1); } + | game { $$.as_node = std::move($1); } + | self { $$.as_node = std::move($1); } + | anim { $$.as_node = std::move($1); } + | level { $$.as_node = std::move($1); } + | animation { $$.as_node = std::move($1); } + | animtree { $$.as_node = std::move($1); } + | name { $$.as_node = std::move($1); } + | istring { $$.as_node = std::move($1); } + | string { $$.as_node = std::move($1); } + | vector { $$.as_node = std::move($1); } + | neg_float { $$.as_node = std::move($1); } + | neg_integer { $$.as_node = std::move($1); } + | float { $$.as_node = std::move($1); } + | integer { $$.as_node = std::move($1); } + | false { $$.as_node = std::move($1); } + | true { $$.as_node = std::move($1); } + ; + +expr_call + : expr_call_function { $$ = std::make_unique(@$, false, false, std::make_unique(@$), std::move($1)); } + | expr_call_pointer { $$ = std::make_unique(@$, false, false, std::make_unique(@$), std::move($1)); } + | object expr_call_function { $$ = std::make_unique(@$, false, false, std::move($1), std::move($2)); } + | object expr_call_pointer { $$ = std::make_unique(@$, false, false, std::move($1), std::move($2)); } + ; + +expr_call_thread + : THREAD expr_call_function { $$ = std::make_unique(@$, true, false, std::make_unique(@$), std::move($2)); } + | THREAD expr_call_pointer { $$ = std::make_unique(@$, true, false, std::make_unique(@$), std::move($2)); } + | object THREAD expr_call_function { $$ = std::make_unique(@$, true, false, std::move($1), std::move($3)); } + | object THREAD expr_call_pointer { $$ = std::make_unique(@$, true, false, std::move($1), std::move($3)); } + ; + +expr_call_childthread + : CHILDTHREAD expr_call_function { $$ = std::make_unique(@$, false, true, std::make_unique(@$), std::move($2)); } + | CHILDTHREAD expr_call_pointer { $$ = std::make_unique(@$, false, true, std::make_unique(@$), std::move($2)); } + | object CHILDTHREAD expr_call_function { $$ = std::make_unique(@$, false, true, std::move($1), std::move($3)); } + | object CHILDTHREAD expr_call_pointer { $$ = std::make_unique(@$, false, true, std::move($1), std::move($3)); } + ; + +expr_call_function + : name LPAREN expr_arguments RPAREN + {$$.as_func = std::make_unique(@$, std::make_unique(), std::move($1), std::move($3)); } + | file DOUBLECOLON name LPAREN expr_arguments RPAREN + { $$.as_func = std::make_unique(@$, std::move($1), std::move($3), std::move($5)); } + ; + +expr_call_pointer + : LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = std::make_unique(@$, false, std::move($3), std::move($7)); } + | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = std::make_unique(@$, true, std::move($4), std::move($8)); } + ; + +expr_arguments + : expr_arguments_filled { $$ = std::move($1); } + | expr_arguments_empty { $$ = std::move($1); } + ; + +expr_arguments_filled + : expr_arguments COMMA expr + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | expr %prec ADD_ARRAY + { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } + ; + +expr_arguments_empty + : + { $$ = std::make_unique(@$); } + ; + +expr_function + : DOUBLECOLON name + { $$ = std::make_unique(@$, std::make_unique(@$), std::move($2)); } + | file DOUBLECOLON name + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_add_array + : LBRACKET expr_arguments_filled RBRACKET + { $$ = std::make_unique(@$, std::move($2)); } + ; + +expr_array + : object LBRACKET expr RBRACKET + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_field + : object DOT name + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_size + : object DOT SIZE + { $$ = std::make_unique(@$, std::move($1)); } + ; + +object + : expr_call { $$ = std::move($1); } + | expr_array { $$ = std::move($1); } + | expr_field { $$ = std::move($1); } + | game { $$ = std::move($1); } + | self { $$ = std::move($1); } + | anim { $$ = std::move($1); } + | level { $$ = std::move($1); } + | name { $$ = std::move($1); } + ; + +thisthread : THISTHREAD { $$ = std::make_unique(@$); }; +empty_array : LBRACKET RBRACKET { $$ = std::make_unique(@$); }; +undefined : UNDEFINED { $$ = std::make_unique(@$); }; +game : GAME { $$ = std::make_unique(@$); }; +self : SELF { $$ = std::make_unique(@$); }; +anim : ANIM { $$ = std::make_unique(@$); }; +level : LEVEL { $$ = std::make_unique(@$); }; +animation : MOD NAME %prec ANIMREF { $$ = std::make_unique(@$, $2); }; +animtree : ANIMTREE { $$ = std::make_unique(@$); }; +name : NAME { $$ = std::make_unique(@$, $1); }; +file : FILE { $$ = std::make_unique(@$, $1); }; +istring : ISTRING { $$ = std::make_unique(@$, $1); }; +string : STRING { $$ = std::make_unique(@$, $1); }; +vector : LPAREN expr COMMA expr COMMA expr RPAREN { $$ = std::make_unique(@$, std::move($2), std::move($4), std::move($6)); }; +neg_float : SUB FLOAT %prec NEG { $$ = std::make_unique(@$, "-" + $2); }; +neg_integer : SUB INTEGER %prec NEG { $$ = std::make_unique(@$, "-" + $2); }; +float : FLOAT { $$ = std::make_unique(@$, $1); }; +integer : INTEGER { $$ = std::make_unique(@$, $1); }; +false : FALSE { $$ = std::make_unique(@$); }; +true : TRUE { $$ = std::make_unique(@$); }; + +%% + +void xsk::gsc::iw7::parser::error(const xsk::gsc::location& loc, const std::string& msg) +{ + throw xsk::gsc::comp_error(loc, msg); +} diff --git a/gen/s1/Makefile b/gen/s1/Makefile new file mode 100644 index 00000000..4b444225 --- /dev/null +++ b/gen/s1/Makefile @@ -0,0 +1,11 @@ +generate: S1 + +clean: + rm -rf ./parser.hpp + rm -rf ./parser.cpp + rm -rf ./lexer.hpp + rm -rf ./lexer.cpp + +S1: lexer.lpp parser.ypp + flex lexer.lpp + bison parser.ypp -Wcounterexamples diff --git a/gen/s1/lexer.lpp b/gen/s1/lexer.lpp new file mode 100644 index 00000000..0160c137 --- /dev/null +++ b/gen/s1/lexer.lpp @@ -0,0 +1,145 @@ +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ + +%option outfile="lexer.cpp" +%option header-file="lexer.hpp" +%option prefix="s1_" +%option reentrant +%option noyywrap batch nounput noinput +%option never-interactive +%option nounistd + +%top{ +#include "stdafx.hpp" +#include "s1.hpp" +#include "parser.hpp" +using namespace xsk::gsc; +} + +%{ +#define YY_USER_ACTION loc.columns(yyleng); +%} + +RGX_FILE ([_A-Za-z0-9]+\\)+[_A-Za-z0-9]+ +RGX_NAME [_A-Za-z][_A-Za-z0-9]* +RGX_STRING \"(?:\\.|[^\"])*?\"|\'(?:\\.|[^\'])*?\' +RGX_FLOAT [0-9]+\.(?:[0-9]*)?f?|\.[0-9]+f? +RGX_INTEGER [0-9]+ +RGX_DEFAULT (.|\n) + +%x COMMENT_BLOCK_STATE +%x DEVELOPER_BLOCK_STATE + +%% + +%{ + loc.step(); +%} + +[ \t\r] { loc.step(); } + +\n { loc.lines(yyleng); loc.step(); } + +"//".* + +"/*" { BEGIN(COMMENT_BLOCK_STATE); } +. +\n { loc.lines(yyleng); loc.step(); } +"*/" { BEGIN(INITIAL); } + +"/#" { BEGIN(DEVELOPER_BLOCK_STATE); } +. +\n { loc.lines(yyleng); loc.step(); } +"#/" { BEGIN(INITIAL); } + +"#include" { return s1::parser::make_INCLUDE(loc); } +"#using_animtree" { return s1::parser::make_USINGTREE(loc); } +"#animtree" { return s1::parser::make_ANIMTREE(loc); } +"endon" { return s1::parser::make_ENDON(loc); } +"notify" { return s1::parser::make_NOTIFY(loc); } +"wait" { return s1::parser::make_WAIT(loc); } +"waittill" { return s1::parser::make_WAITTILL(loc); } +"waittillmatch" { return s1::parser::make_WAITTILLMATCH(loc); } +"waittillframeend" { return s1::parser::make_WAITTILLFRAMEEND(loc); } +"waitframe" { return s1::parser::make_WAITFRAME(loc); } +"if" { return s1::parser::make_IF(loc); } +"else" { return s1::parser::make_ELSE(loc); } +"while" { return s1::parser::make_WHILE(loc); } +"for" { return s1::parser::make_FOR(loc); } +"foreach" { return s1::parser::make_FOREACH(loc); } +"in" { return s1::parser::make_IN(loc); } +"switch" { return s1::parser::make_SWITCH(loc); } +"case" { return s1::parser::make_CASE(loc); } +"default" { return s1::parser::make_DEFAULT(loc); } +"break" { return s1::parser::make_BREAK(loc); } +"continue" { return s1::parser::make_CONTINUE(loc); } +"return" { return s1::parser::make_RETURN(loc); } +"thread" { return s1::parser::make_THREAD(loc); } +"childthread" { return s1::parser::make_CHILDTHREAD(loc); } +"thisthread" { return s1::parser::make_THISTHREAD(loc); } +"call" { return s1::parser::make_CALL(loc); } +"true" { return s1::parser::make_TRUE(loc); } +"false" { return s1::parser::make_FALSE(loc); } +"undefined" { return s1::parser::make_UNDEFINED(loc); } +"size" { return s1::parser::make_SIZE(loc); } +"game" { return s1::parser::make_GAME(loc); } +"self" { return s1::parser::make_SELF(loc); } +"anim" { return s1::parser::make_ANIM(loc); } +"level" { return s1::parser::make_LEVEL(loc); } +\( { return s1::parser::make_LPAREN(loc); } +\) { return s1::parser::make_RPAREN(loc); } +\{ { return s1::parser::make_LBRACE(loc); } +\} { return s1::parser::make_RBRACE(loc); } +\[ { return s1::parser::make_LBRACKET(loc); } +\] { return s1::parser::make_RBRACKET(loc); } +\, { return s1::parser::make_COMMA(loc); } +\. { return s1::parser::make_DOT(loc); } +\:\: { return s1::parser::make_DOUBLECOLON(loc); } +\: { return s1::parser::make_COLON(loc); } +\; { return s1::parser::make_SEMICOLON(loc); } +\+\+ { return s1::parser::make_INCREMENT(loc); } +\-\- { return s1::parser::make_DECREMENT(loc); } +\<\<\= { return s1::parser::make_ASSIGN_LSHIFT(loc); } +\>\>\= { return s1::parser::make_ASSIGN_RSHIFT(loc); } +\<\< { return s1::parser::make_LSHIFT(loc); } +\>\> { return s1::parser::make_RSHIFT(loc); } +\|\| { return s1::parser::make_OR(loc); } +\&\& { return s1::parser::make_AND(loc); } +\=\= { return s1::parser::make_EQUALITY(loc); } +\!\= { return s1::parser::make_INEQUALITY(loc); } +\<\= { return s1::parser::make_LESS_EQUAL(loc); } +\>\= { return s1::parser::make_GREATER_EQUAL(loc); } +\< { return s1::parser::make_LESS(loc); } +\> { return s1::parser::make_GREATER(loc); } +\+\= { return s1::parser::make_ASSIGN_ADD(loc); } +\-\= { return s1::parser::make_ASSIGN_SUB(loc); } +\*\= { return s1::parser::make_ASSIGN_MULT(loc); } +\/\= { return s1::parser::make_ASSIGN_DIV(loc); } +\%\= { return s1::parser::make_ASSIGN_MOD(loc); } +\|\= { return s1::parser::make_ASSIGN_BITWISE_OR(loc); } +\&\= { return s1::parser::make_ASSIGN_BITWISE_AND(loc); } +\^\= { return s1::parser::make_ASSIGN_BITWISE_EXOR(loc); } +\= { return s1::parser::make_ASSIGN(loc); } +\+ { return s1::parser::make_ADD(loc); } +\- { return s1::parser::make_SUB(loc); } +\* { return s1::parser::make_MULT(loc); } +\/ { return s1::parser::make_DIV(loc); } +\% { return s1::parser::make_MOD(loc); } +\! { return s1::parser::make_NOT(loc); } +\~ { return s1::parser::make_COMPLEMENT(loc); } +\| { return s1::parser::make_BITWISE_OR(loc); } +\& { return s1::parser::make_BITWISE_AND(loc); } +\^ { return s1::parser::make_BITWISE_EXOR(loc); } +{RGX_FILE} { return s1::parser::make_FILE(utils::string::fordslash(yytext), loc); } +{RGX_NAME} { return s1::parser::make_NAME((std::string(yytext, 3) == "_ID") ? std::string(yytext) : utils::string::to_lower(yytext), loc); } +\&{RGX_STRING} { return s1::parser::make_ISTRING(std::string(yytext).substr(1), loc); } +{RGX_STRING} { return s1::parser::make_STRING(std::string(yytext), loc); } +{RGX_FLOAT} { return s1::parser::make_FLOAT(std::string(yytext), loc); } +{RGX_INTEGER} { return s1::parser::make_INTEGER(std::string(yytext), loc); } +<> { return s1::parser::make_S1EOF(loc); } +<*>{RGX_DEFAULT} { throw s1::parser::syntax_error(loc, "bad token: \'" + std::string(yytext) + "\'"); } + +%% diff --git a/gen/s1/parser.ypp b/gen/s1/parser.ypp new file mode 100644 index 00000000..fff572c1 --- /dev/null +++ b/gen/s1/parser.ypp @@ -0,0 +1,644 @@ +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ + +%require "3.7" +%skeleton "lalr1.cc" +%language "c++" +%output "parser.cpp" +%defines "parser.hpp" +%define api.prefix {S1} +%define api.namespace {xsk::gsc::s1} +%define api.location.type {xsk::gsc::location} +%define api.value.type variant +%define api.token.constructor +%define api.token.raw +%define parse.assert +%define parse.trace +%define parse.error detailed +%define parse.lac full + +%locations + +%lex-param { yyscan_t yyscanner } +%lex-param { xsk::gsc::location& loc } + +%parse-param { yyscan_t yyscanner } +%parse-param { xsk::gsc::location& loc } +%parse-param { xsk::gsc::program_ptr& ast } + +%code requires +{ +#include "s1.hpp" +typedef void *yyscan_t; +#define YY_DECL xsk::gsc::s1::parser::symbol_type S1lex(yyscan_t yyscanner, xsk::gsc::location& loc) +} + +%code top +{ +#include "stdafx.hpp" +#include "parser.hpp" +#include "lexer.hpp" +using namespace xsk::gsc; +xsk::gsc::s1::parser::symbol_type S1lex(yyscan_t yyscanner, xsk::gsc::location& loc); +} + +%token INCLUDE "#include" +%token USINGTREE "#using_animtree" +%token ANIMTREE "#animtree" +%token ENDON "endon" +%token NOTIFY "notify" +%token WAIT "wait" +%token WAITTILL "waittill" +%token WAITTILLMATCH "waittillmatch" +%token WAITTILLFRAMEEND "waittillframeend" +%token WAITFRAME "waitframe" +%token IF "if" +%token ELSE "else" +%token WHILE "while" +%token FOR "for" +%token FOREACH "foreach" +%token IN "in" +%token SWITCH "switch" +%token CASE "case" +%token DEFAULT "default" +%token BREAK "break" +%token CONTINUE "continue" +%token RETURN "return" +%token THREAD "thread" +%token CHILDTHREAD "childthread" +%token THISTHREAD "thisthread" +%token CALL "call" +%token TRUE "true" +%token FALSE "false" +%token UNDEFINED "undefined" +%token SIZE "size" +%token GAME "game" +%token SELF "self" +%token ANIM "anim" +%token LEVEL "level" +%token LPAREN "(" +%token RPAREN ")" +%token LBRACE "{" +%token RBRACE "}" +%token LBRACKET "[" +%token RBRACKET "]" +%token COMMA "," +%token DOT "." +%token DOUBLECOLON "::" +%token COLON ":" +%token SEMICOLON ";" +%token INCREMENT "++" +%token DECREMENT "--" +%token LSHIFT "<<" +%token RSHIFT ">>" +%token OR "||" +%token AND "&&" +%token EQUALITY "==" +%token INEQUALITY "!=" +%token LESS_EQUAL "<=" +%token GREATER_EQUAL ">=" +%token LESS "<" +%token GREATER ">" +%token NOT "!" +%token COMPLEMENT "~" +%token ASSIGN "=" +%token ASSIGN_ADD "+=" +%token ASSIGN_SUB "-=" +%token ASSIGN_MULT "*=" +%token ASSIGN_DIV "/=" +%token ASSIGN_MOD "%=" +%token ASSIGN_BITWISE_OR "|=" +%token ASSIGN_BITWISE_AND "&=" +%token ASSIGN_BITWISE_EXOR "^=" +%token ASSIGN_RSHIFT ">>=" +%token ASSIGN_LSHIFT "<<=" +%token BITWISE_OR "|" +%token BITWISE_AND "&" +%token BITWISE_EXOR "^" +%token ADD "+" +%token SUB "-" +%token MULT "*" +%token DIV "/" +%token MOD "%" +%token FILE "file path" +%token NAME "identifier" +%token STRING "string literal" +%token ISTRING "localized string" +%token FLOAT "float" +%token INTEGER "int" + +%type program +%type include +%type define +%type usingtree +%type constant +%type thread +%type parameters +%type stmt +%type stmt_block +%type stmt_list +%type stmt_call +%type stmt_assign +%type stmt_endon +%type stmt_notify +%type stmt_wait +%type stmt_waittill +%type stmt_waittillmatch +%type stmt_waittillframeend +%type stmt_waitframe +%type stmt_if +%type stmt_ifelse +%type stmt_while +%type stmt_for +%type stmt_foreach +%type stmt_switch +%type stmt_case +%type stmt_default +%type stmt_break +%type stmt_continue +%type stmt_return +%type for_stmt +%type for_expr +%type expr_assign +%type expr +%type expr_compare +%type expr_binary +%type expr_primitive +%type expr_call +%type expr_call_thread +%type expr_call_childthread +%type expr_call_function +%type expr_call_pointer +%type expr_arguments +%type expr_arguments_filled +%type expr_arguments_empty +%type expr_function +%type expr_add_array +%type expr_array +%type expr_field +%type expr_size +%type object +%type thisthread +%type empty_array +%type undefined +%type game +%type self +%type anim +%type level +%type animation +%type animtree +%type name +%type file +%type istring +%type string +%type vector +%type neg_float +%type neg_integer +%type float +%type integer +%type false +%type true + +%nonassoc ADD_ARRAY +%nonassoc RBRACKET +%nonassoc THEN +%nonassoc ELSE +%nonassoc INCREMENT DECREMENT + +%left OR +%left AND +%left BITWISE_OR +%left BITWISE_AND +%left BITWISE_EXOR +%left EQUALITY INEQUALITY +%left LESS GREATER LESS_EQUAL GREATER_EQUAL +%left LSHIFT RSHIFT +%left ADD SUB +%left MULT DIV MOD +%right NOT COMPLEMENT + +%precedence NEG +%precedence ANIMREF +%precedence PREINC PREDEC +%precedence POSTINC POSTDEC + +%start root + +%% + +root + : program { ast = std::move($1); } + | { ast = std::make_unique(@$); } + ; + +program + : program include + { $$ = std::move($1); $$->includes.push_back(std::move($2)); } + | program define + { $$ = std::move($1); $$->definitions.push_back(std::move($2)); } + | include + { $$ = std::make_unique(@$); $$->includes.push_back(std::move($1)); } + | define + { $$ = std::make_unique(@$); $$->definitions.push_back(std::move($1)); } + ; + +include + : INCLUDE file SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + ; + +define + : usingtree { $$.as_usingtree = std::move($1); } + | constant { $$.as_constant = std::move($1); } + | thread { $$.as_thread = std::move($1); } + ; + +usingtree + : USINGTREE LPAREN string RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($3)); } + ; + +constant + : name ASSIGN expr SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +thread + : name LPAREN parameters RPAREN stmt_block + { $$ = std::make_unique(@$, std::move($1), std::move($3), std::move($5)); } + ; + +parameters + : parameters COMMA name + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | name + { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } + | + { $$ = std::make_unique(@$); } + ; + +stmt + : stmt_block { $$.as_list = std::move($1); } + | stmt_call { $$.as_call = std::move($1); } + | stmt_assign { $$.as_assign = std::move($1); } + | stmt_endon { $$.as_endon = std::move($1); } + | stmt_notify { $$.as_notify = std::move($1); } + | stmt_wait { $$.as_wait = std::move($1); } + | stmt_waittill { $$.as_waittill = std::move($1); } + | stmt_waittillmatch { $$.as_waittillmatch = std::move($1); } + | stmt_waittillframeend { $$.as_waittillframeend = std::move($1); } + | stmt_waitframe { $$.as_waitframe = std::move($1); } + | stmt_if { $$.as_if = std::move($1); } + | stmt_ifelse { $$.as_ifelse = std::move($1); } + | stmt_while { $$.as_while = std::move($1); } + | stmt_for { $$.as_for = std::move($1); } + | stmt_foreach { $$.as_foreach = std::move($1); } + | stmt_switch { $$.as_switch = std::move($1); } + | stmt_case { $$.as_case = std::move($1); } + | stmt_default { $$.as_default = std::move($1); } + | stmt_break { $$.as_break = std::move($1); } + | stmt_continue { $$.as_continue = std::move($1); } + | stmt_return { $$.as_return = std::move($1); } + ; + +stmt_block + : LBRACE stmt_list RBRACE { $$ = std::move($2); } + | LBRACE RBRACE { $$ = std::make_unique(@$); } + ; + +stmt_list + : stmt_list stmt + { $$ = std::move($1); $$->stmts.push_back(std::move($2)); } + | stmt + { $$ = std::make_unique(@$); $$->stmts.push_back(std::move($1)); } + ; + +stmt_call + : expr_call SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + | expr_call_thread SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + ; + +stmt_assign + : expr_assign SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + ; + +stmt_endon + : object ENDON LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4)); } + ; + +stmt_notify + : object NOTIFY LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object NOTIFY LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_wait + : WAIT expr SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + ; + +stmt_waittill + : object WAITTILL LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object WAITTILL LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_waittillmatch + : object WAITTILLMATCH LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object WAITTILLMATCH LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_waittillframeend + : WAITTILLFRAMEEND SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_waitframe + : WAITFRAME SEMICOLON + { $$ = std::make_unique(@$); } + | WAITFRAME LPAREN RPAREN SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_if + : IF LPAREN expr RPAREN stmt %prec THEN + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_ifelse + : IF LPAREN expr RPAREN stmt ELSE stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5), std::move($7)); } + ; + +stmt_while + : WHILE LPAREN expr RPAREN stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_for + : FOR LPAREN for_stmt SEMICOLON for_expr SEMICOLON for_stmt RPAREN stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5), std::move($7), std::move($9)); } + ; + +stmt_foreach + : FOREACH LPAREN name IN expr RPAREN stmt + { $$ = std::make_unique(@$, expr_ptr(std::move($3)), std::move($5), std::move($7)); } + | FOREACH LPAREN name COMMA name IN expr RPAREN stmt + { $$ = std::make_unique(@$, expr_ptr(std::move($3)), expr_ptr(std::move($5)), std::move($7), std::move($9)); } + ; + +stmt_switch + : SWITCH LPAREN expr RPAREN stmt_block + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_case + : CASE integer COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + | CASE neg_integer COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + | CASE string COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + ; + +stmt_default + : DEFAULT COLON + { $$ = std::make_unique(@$, std::make_unique(@$)); } + ; + +stmt_break + : BREAK SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_continue + : CONTINUE SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_return + : RETURN expr SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + | RETURN SEMICOLON + { $$ = std::make_unique(@$, std::make_unique(@$)); } + ; + +for_stmt + : expr_assign { $$.as_list = std::make_unique(@$); $$.as_list->stmts.push_back(stmt_ptr(std::make_unique(@$, std::move($1)))); } + | { $$.as_node = std::make_unique(@$); } + ; + +for_expr + : expr { $$ = std::move($1); } + | { $$.as_node = std::make_unique(@$); } + ; + +expr + : expr_compare { $$ = std::move($1); } + | expr_binary { $$ = std::move($1); } + | expr_primitive { $$ = std::move($1); } + ; + +expr_assign + : INCREMENT object %prec PREINC { $$ = std::make_unique(@$, std::move($2)); } + | DECREMENT object %prec PREDEC { $$ = std::make_unique(@$, std::move($2)); } + | object INCREMENT %prec POSTINC { $$ = std::make_unique(@$, std::move($1)); } + | object DECREMENT %prec POSTDEC { $$ = std::make_unique(@$, std::move($1)); } + | object ASSIGN expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_OR expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_AND expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_EXOR expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_LSHIFT expr { $$ = std::make_unique(@$, std::move($1),std::move( $3)); } + | object ASSIGN_RSHIFT expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_ADD expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_SUB expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_MULT expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_DIV expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_MOD expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_compare + : expr OR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr AND expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr EQUALITY expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr INEQUALITY expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LESS_EQUAL expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr GREATER_EQUAL expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LESS expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr GREATER expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_binary + : expr BITWISE_OR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr BITWISE_AND expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr BITWISE_EXOR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LSHIFT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr RSHIFT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr ADD expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr SUB expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr MULT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr DIV expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr MOD expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_primitive + : LPAREN expr RPAREN { $$ = std::move($2); } + | COMPLEMENT expr { $$.as_node = std::make_unique(@$, std::move($2)); } + | NOT expr { $$.as_node = std::make_unique(@$, std::move($2)); } + | expr_call { $$.as_node = std::move($1); } + | expr_call_thread { $$.as_node = std::move($1); } + | expr_call_childthread { $$.as_node = std::move($1); } + | expr_function { $$.as_node = std::move($1); } + | expr_add_array { $$.as_node = std::move($1); } + | expr_array { $$.as_node = std::move($1); } + | expr_field { $$.as_node = std::move($1); } + | expr_size { $$.as_node = std::move($1); } + | thisthread { $$.as_node = std::move($1); } + | empty_array { $$.as_node = std::move($1); } + | undefined { $$.as_node = std::move($1); } + | game { $$.as_node = std::move($1); } + | self { $$.as_node = std::move($1); } + | anim { $$.as_node = std::move($1); } + | level { $$.as_node = std::move($1); } + | animation { $$.as_node = std::move($1); } + | animtree { $$.as_node = std::move($1); } + | name { $$.as_node = std::move($1); } + | istring { $$.as_node = std::move($1); } + | string { $$.as_node = std::move($1); } + | vector { $$.as_node = std::move($1); } + | neg_float { $$.as_node = std::move($1); } + | neg_integer { $$.as_node = std::move($1); } + | float { $$.as_node = std::move($1); } + | integer { $$.as_node = std::move($1); } + | false { $$.as_node = std::move($1); } + | true { $$.as_node = std::move($1); } + ; + +expr_call + : expr_call_function { $$ = std::make_unique(@$, false, false, std::make_unique(@$), std::move($1)); } + | expr_call_pointer { $$ = std::make_unique(@$, false, false, std::make_unique(@$), std::move($1)); } + | object expr_call_function { $$ = std::make_unique(@$, false, false, std::move($1), std::move($2)); } + | object expr_call_pointer { $$ = std::make_unique(@$, false, false, std::move($1), std::move($2)); } + ; + +expr_call_thread + : THREAD expr_call_function { $$ = std::make_unique(@$, true, false, std::make_unique(@$), std::move($2)); } + | THREAD expr_call_pointer { $$ = std::make_unique(@$, true, false, std::make_unique(@$), std::move($2)); } + | object THREAD expr_call_function { $$ = std::make_unique(@$, true, false, std::move($1), std::move($3)); } + | object THREAD expr_call_pointer { $$ = std::make_unique(@$, true, false, std::move($1), std::move($3)); } + ; + +expr_call_childthread + : CHILDTHREAD expr_call_function { $$ = std::make_unique(@$, false, true, std::make_unique(@$), std::move($2)); } + | CHILDTHREAD expr_call_pointer { $$ = std::make_unique(@$, false, true, std::make_unique(@$), std::move($2)); } + | object CHILDTHREAD expr_call_function { $$ = std::make_unique(@$, false, true, std::move($1), std::move($3)); } + | object CHILDTHREAD expr_call_pointer { $$ = std::make_unique(@$, false, true, std::move($1), std::move($3)); } + ; + +expr_call_function + : name LPAREN expr_arguments RPAREN + {$$.as_func = std::make_unique(@$, std::make_unique(), std::move($1), std::move($3)); } + | file DOUBLECOLON name LPAREN expr_arguments RPAREN + { $$.as_func = std::make_unique(@$, std::move($1), std::move($3), std::move($5)); } + ; + +expr_call_pointer + : LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = std::make_unique(@$, false, std::move($3), std::move($7)); } + | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = std::make_unique(@$, true, std::move($4), std::move($8)); } + ; + +expr_arguments + : expr_arguments_filled { $$ = std::move($1); } + | expr_arguments_empty { $$ = std::move($1); } + ; + +expr_arguments_filled + : expr_arguments COMMA expr + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | expr %prec ADD_ARRAY + { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } + ; + +expr_arguments_empty + : + { $$ = std::make_unique(@$); } + ; + +expr_function + : DOUBLECOLON name + { $$ = std::make_unique(@$, std::make_unique(@$), std::move($2)); } + | file DOUBLECOLON name + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_add_array + : LBRACKET expr_arguments_filled RBRACKET + { $$ = std::make_unique(@$, std::move($2)); } + ; + +expr_array + : object LBRACKET expr RBRACKET + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_field + : object DOT name + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_size + : object DOT SIZE + { $$ = std::make_unique(@$, std::move($1)); } + ; + +object + : expr_call { $$ = std::move($1); } + | expr_array { $$ = std::move($1); } + | expr_field { $$ = std::move($1); } + | game { $$ = std::move($1); } + | self { $$ = std::move($1); } + | anim { $$ = std::move($1); } + | level { $$ = std::move($1); } + | name { $$ = std::move($1); } + ; + +thisthread : THISTHREAD { $$ = std::make_unique(@$); }; +empty_array : LBRACKET RBRACKET { $$ = std::make_unique(@$); }; +undefined : UNDEFINED { $$ = std::make_unique(@$); }; +game : GAME { $$ = std::make_unique(@$); }; +self : SELF { $$ = std::make_unique(@$); }; +anim : ANIM { $$ = std::make_unique(@$); }; +level : LEVEL { $$ = std::make_unique(@$); }; +animation : MOD NAME %prec ANIMREF { $$ = std::make_unique(@$, $2); }; +animtree : ANIMTREE { $$ = std::make_unique(@$); }; +name : NAME { $$ = std::make_unique(@$, $1); }; +file : FILE { $$ = std::make_unique(@$, $1); }; +istring : ISTRING { $$ = std::make_unique(@$, $1); }; +string : STRING { $$ = std::make_unique(@$, $1); }; +vector : LPAREN expr COMMA expr COMMA expr RPAREN { $$ = std::make_unique(@$, std::move($2), std::move($4), std::move($6)); }; +neg_float : SUB FLOAT %prec NEG { $$ = std::make_unique(@$, "-" + $2); }; +neg_integer : SUB INTEGER %prec NEG { $$ = std::make_unique(@$, "-" + $2); }; +float : FLOAT { $$ = std::make_unique(@$, $1); }; +integer : INTEGER { $$ = std::make_unique(@$, $1); }; +false : FALSE { $$ = std::make_unique(@$); }; +true : TRUE { $$ = std::make_unique(@$); }; + +%% + +void xsk::gsc::s1::parser::error(const xsk::gsc::location& loc, const std::string& msg) +{ + throw xsk::gsc::comp_error(loc, msg); +} diff --git a/gen/s2/Makefile b/gen/s2/Makefile new file mode 100644 index 00000000..7e036f24 --- /dev/null +++ b/gen/s2/Makefile @@ -0,0 +1,11 @@ +generate: S2 + +clean: + rm -rf ./parser.hpp + rm -rf ./parser.cpp + rm -rf ./lexer.hpp + rm -rf ./lexer.cpp + +S2: lexer.lpp parser.ypp + flex lexer.lpp + bison parser.ypp -Wcounterexamples diff --git a/gen/s2/lexer.lpp b/gen/s2/lexer.lpp new file mode 100644 index 00000000..ca61937f --- /dev/null +++ b/gen/s2/lexer.lpp @@ -0,0 +1,145 @@ +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ + +%option outfile="lexer.cpp" +%option header-file="lexer.hpp" +%option prefix="s2_" +%option reentrant +%option noyywrap batch nounput noinput +%option never-interactive +%option nounistd + +%top{ +#include "stdafx.hpp" +#include "s2.hpp" +#include "parser.hpp" +using namespace xsk::gsc; +} + +%{ +#define YY_USER_ACTION loc.columns(yyleng); +%} + +RGX_FILE ([_A-Za-z0-9]+\\)+[_A-Za-z0-9]+ +RGX_NAME [_A-Za-z][_A-Za-z0-9]* +RGX_STRING \"(?:\\.|[^\"])*?\"|\'(?:\\.|[^\'])*?\' +RGX_FLOAT [0-9]+\.(?:[0-9]*)?f?|\.[0-9]+f? +RGX_INTEGER [0-9]+ +RGX_DEFAULT (.|\n) + +%x COMMENT_BLOCK_STATE +%x DEVELOPER_BLOCK_STATE + +%% + +%{ + loc.step(); +%} + +[ \t\r] { loc.step(); } + +\n { loc.lines(yyleng); loc.step(); } + +"//".* + +"/*" { BEGIN(COMMENT_BLOCK_STATE); } +. +\n { loc.lines(yyleng); loc.step(); } +"*/" { BEGIN(INITIAL); } + +"/#" { BEGIN(DEVELOPER_BLOCK_STATE); } +. +\n { loc.lines(yyleng); loc.step(); } +"#/" { BEGIN(INITIAL); } + +"#include" { return s2::parser::make_INCLUDE(loc); } +"#using_animtree" { return s2::parser::make_USINGTREE(loc); } +"#animtree" { return s2::parser::make_ANIMTREE(loc); } +"endon" { return s2::parser::make_ENDON(loc); } +"notify" { return s2::parser::make_NOTIFY(loc); } +"wait" { return s2::parser::make_WAIT(loc); } +"waittill" { return s2::parser::make_WAITTILL(loc); } +"waittillmatch" { return s2::parser::make_WAITTILLMATCH(loc); } +"waittillframeend" { return s2::parser::make_WAITTILLFRAMEEND(loc); } +"waitframe" { return s2::parser::make_WAITFRAME(loc); } +"if" { return s2::parser::make_IF(loc); } +"else" { return s2::parser::make_ELSE(loc); } +"while" { return s2::parser::make_WHILE(loc); } +"for" { return s2::parser::make_FOR(loc); } +"foreach" { return s2::parser::make_FOREACH(loc); } +"in" { return s2::parser::make_IN(loc); } +"switch" { return s2::parser::make_SWITCH(loc); } +"case" { return s2::parser::make_CASE(loc); } +"default" { return s2::parser::make_DEFAULT(loc); } +"break" { return s2::parser::make_BREAK(loc); } +"continue" { return s2::parser::make_CONTINUE(loc); } +"return" { return s2::parser::make_RETURN(loc); } +"thread" { return s2::parser::make_THREAD(loc); } +"childthread" { return s2::parser::make_CHILDTHREAD(loc); } +"thisthread" { return s2::parser::make_THISTHREAD(loc); } +"call" { return s2::parser::make_CALL(loc); } +"true" { return s2::parser::make_TRUE(loc); } +"false" { return s2::parser::make_FALSE(loc); } +"undefined" { return s2::parser::make_UNDEFINED(loc); } +"size" { return s2::parser::make_SIZE(loc); } +"game" { return s2::parser::make_GAME(loc); } +"self" { return s2::parser::make_SELF(loc); } +"anim" { return s2::parser::make_ANIM(loc); } +"level" { return s2::parser::make_LEVEL(loc); } +\( { return s2::parser::make_LPAREN(loc); } +\) { return s2::parser::make_RPAREN(loc); } +\{ { return s2::parser::make_LBRACE(loc); } +\} { return s2::parser::make_RBRACE(loc); } +\[ { return s2::parser::make_LBRACKET(loc); } +\] { return s2::parser::make_RBRACKET(loc); } +\, { return s2::parser::make_COMMA(loc); } +\. { return s2::parser::make_DOT(loc); } +\:\: { return s2::parser::make_DOUBLECOLON(loc); } +\: { return s2::parser::make_COLON(loc); } +\; { return s2::parser::make_SEMICOLON(loc); } +\+\+ { return s2::parser::make_INCREMENT(loc); } +\-\- { return s2::parser::make_DECREMENT(loc); } +\<\<\= { return s2::parser::make_ASSIGN_LSHIFT(loc); } +\>\>\= { return s2::parser::make_ASSIGN_RSHIFT(loc); } +\<\< { return s2::parser::make_LSHIFT(loc); } +\>\> { return s2::parser::make_RSHIFT(loc); } +\|\| { return s2::parser::make_OR(loc); } +\&\& { return s2::parser::make_AND(loc); } +\=\= { return s2::parser::make_EQUALITY(loc); } +\!\= { return s2::parser::make_INEQUALITY(loc); } +\<\= { return s2::parser::make_LESS_EQUAL(loc); } +\>\= { return s2::parser::make_GREATER_EQUAL(loc); } +\< { return s2::parser::make_LESS(loc); } +\> { return s2::parser::make_GREATER(loc); } +\+\= { return s2::parser::make_ASSIGN_ADD(loc); } +\-\= { return s2::parser::make_ASSIGN_SUB(loc); } +\*\= { return s2::parser::make_ASSIGN_MULT(loc); } +\/\= { return s2::parser::make_ASSIGN_DIV(loc); } +\%\= { return s2::parser::make_ASSIGN_MOD(loc); } +\|\= { return s2::parser::make_ASSIGN_BITWISE_OR(loc); } +\&\= { return s2::parser::make_ASSIGN_BITWISE_AND(loc); } +\^\= { return s2::parser::make_ASSIGN_BITWISE_EXOR(loc); } +\= { return s2::parser::make_ASSIGN(loc); } +\+ { return s2::parser::make_ADD(loc); } +\- { return s2::parser::make_SUB(loc); } +\* { return s2::parser::make_MULT(loc); } +\/ { return s2::parser::make_DIV(loc); } +\% { return s2::parser::make_MOD(loc); } +\! { return s2::parser::make_NOT(loc); } +\~ { return s2::parser::make_COMPLEMENT(loc); } +\| { return s2::parser::make_BITWISE_OR(loc); } +\& { return s2::parser::make_BITWISE_AND(loc); } +\^ { return s2::parser::make_BITWISE_EXOR(loc); } +{RGX_FILE} { return s2::parser::make_FILE(utils::string::fordslash(yytext), loc); } +{RGX_NAME} { return s2::parser::make_NAME((std::string(yytext, 3) == "_ID") ? std::string(yytext) : utils::string::to_lower(yytext), loc); } +\&{RGX_STRING} { return s2::parser::make_ISTRING(std::string(yytext).substr(1), loc); } +{RGX_STRING} { return s2::parser::make_STRING(std::string(yytext), loc); } +{RGX_FLOAT} { return s2::parser::make_FLOAT(std::string(yytext), loc); } +{RGX_INTEGER} { return s2::parser::make_INTEGER(std::string(yytext), loc); } +<> { return s2::parser::make_S2EOF(loc); } +<*>{RGX_DEFAULT} { throw s2::parser::syntax_error(loc, "bad token: \'" + std::string(yytext) + "\'"); } + +%% diff --git a/gen/s2/parser.ypp b/gen/s2/parser.ypp new file mode 100644 index 00000000..7d66485c --- /dev/null +++ b/gen/s2/parser.ypp @@ -0,0 +1,644 @@ +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ + +%require "3.7" +%skeleton "lalr1.cc" +%language "c++" +%output "parser.cpp" +%defines "parser.hpp" +%define api.prefix {S2} +%define api.namespace {xsk::gsc::s2} +%define api.location.type {xsk::gsc::location} +%define api.value.type variant +%define api.token.constructor +%define api.token.raw +%define parse.assert +%define parse.trace +%define parse.error detailed +%define parse.lac full + +%locations + +%lex-param { yyscan_t yyscanner } +%lex-param { xsk::gsc::location& loc } + +%parse-param { yyscan_t yyscanner } +%parse-param { xsk::gsc::location& loc } +%parse-param { xsk::gsc::program_ptr& ast } + +%code requires +{ +#include "s2.hpp" +typedef void *yyscan_t; +#define YY_DECL xsk::gsc::s2::parser::symbol_type S2lex(yyscan_t yyscanner, xsk::gsc::location& loc) +} + +%code top +{ +#include "stdafx.hpp" +#include "parser.hpp" +#include "lexer.hpp" +using namespace xsk::gsc; +xsk::gsc::s2::parser::symbol_type S2lex(yyscan_t yyscanner, xsk::gsc::location& loc); +} + +%token INCLUDE "#include" +%token USINGTREE "#using_animtree" +%token ANIMTREE "#animtree" +%token ENDON "endon" +%token NOTIFY "notify" +%token WAIT "wait" +%token WAITTILL "waittill" +%token WAITTILLMATCH "waittillmatch" +%token WAITTILLFRAMEEND "waittillframeend" +%token WAITFRAME "waitframe" +%token IF "if" +%token ELSE "else" +%token WHILE "while" +%token FOR "for" +%token FOREACH "foreach" +%token IN "in" +%token SWITCH "switch" +%token CASE "case" +%token DEFAULT "default" +%token BREAK "break" +%token CONTINUE "continue" +%token RETURN "return" +%token THREAD "thread" +%token CHILDTHREAD "childthread" +%token THISTHREAD "thisthread" +%token CALL "call" +%token TRUE "true" +%token FALSE "false" +%token UNDEFINED "undefined" +%token SIZE "size" +%token GAME "game" +%token SELF "self" +%token ANIM "anim" +%token LEVEL "level" +%token LPAREN "(" +%token RPAREN ")" +%token LBRACE "{" +%token RBRACE "}" +%token LBRACKET "[" +%token RBRACKET "]" +%token COMMA "," +%token DOT "." +%token DOUBLECOLON "::" +%token COLON ":" +%token SEMICOLON ";" +%token INCREMENT "++" +%token DECREMENT "--" +%token LSHIFT "<<" +%token RSHIFT ">>" +%token OR "||" +%token AND "&&" +%token EQUALITY "==" +%token INEQUALITY "!=" +%token LESS_EQUAL "<=" +%token GREATER_EQUAL ">=" +%token LESS "<" +%token GREATER ">" +%token NOT "!" +%token COMPLEMENT "~" +%token ASSIGN "=" +%token ASSIGN_ADD "+=" +%token ASSIGN_SUB "-=" +%token ASSIGN_MULT "*=" +%token ASSIGN_DIV "/=" +%token ASSIGN_MOD "%=" +%token ASSIGN_BITWISE_OR "|=" +%token ASSIGN_BITWISE_AND "&=" +%token ASSIGN_BITWISE_EXOR "^=" +%token ASSIGN_RSHIFT ">>=" +%token ASSIGN_LSHIFT "<<=" +%token BITWISE_OR "|" +%token BITWISE_AND "&" +%token BITWISE_EXOR "^" +%token ADD "+" +%token SUB "-" +%token MULT "*" +%token DIV "/" +%token MOD "%" +%token FILE "file path" +%token NAME "identifier" +%token STRING "string literal" +%token ISTRING "localized string" +%token FLOAT "float" +%token INTEGER "int" + +%type program +%type include +%type define +%type usingtree +%type constant +%type thread +%type parameters +%type stmt +%type stmt_block +%type stmt_list +%type stmt_call +%type stmt_assign +%type stmt_endon +%type stmt_notify +%type stmt_wait +%type stmt_waittill +%type stmt_waittillmatch +%type stmt_waittillframeend +%type stmt_waitframe +%type stmt_if +%type stmt_ifelse +%type stmt_while +%type stmt_for +%type stmt_foreach +%type stmt_switch +%type stmt_case +%type stmt_default +%type stmt_break +%type stmt_continue +%type stmt_return +%type for_stmt +%type for_expr +%type expr_assign +%type expr +%type expr_compare +%type expr_binary +%type expr_primitive +%type expr_call +%type expr_call_thread +%type expr_call_childthread +%type expr_call_function +%type expr_call_pointer +%type expr_arguments +%type expr_arguments_filled +%type expr_arguments_empty +%type expr_function +%type expr_add_array +%type expr_array +%type expr_field +%type expr_size +%type object +%type thisthread +%type empty_array +%type undefined +%type game +%type self +%type anim +%type level +%type animation +%type animtree +%type name +%type file +%type istring +%type string +%type vector +%type neg_float +%type neg_integer +%type float +%type integer +%type false +%type true + +%nonassoc ADD_ARRAY +%nonassoc RBRACKET +%nonassoc THEN +%nonassoc ELSE +%nonassoc INCREMENT DECREMENT + +%left OR +%left AND +%left BITWISE_OR +%left BITWISE_AND +%left BITWISE_EXOR +%left EQUALITY INEQUALITY +%left LESS GREATER LESS_EQUAL GREATER_EQUAL +%left LSHIFT RSHIFT +%left ADD SUB +%left MULT DIV MOD +%right NOT COMPLEMENT + +%precedence NEG +%precedence ANIMREF +%precedence PREINC PREDEC +%precedence POSTINC POSTDEC + +%start root + +%% + +root + : program { ast = std::move($1); } + | { ast = std::make_unique(@$); } + ; + +program + : program include + { $$ = std::move($1); $$->includes.push_back(std::move($2)); } + | program define + { $$ = std::move($1); $$->definitions.push_back(std::move($2)); } + | include + { $$ = std::make_unique(@$); $$->includes.push_back(std::move($1)); } + | define + { $$ = std::make_unique(@$); $$->definitions.push_back(std::move($1)); } + ; + +include + : INCLUDE file SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + ; + +define + : usingtree { $$.as_usingtree = std::move($1); } + | constant { $$.as_constant = std::move($1); } + | thread { $$.as_thread = std::move($1); } + ; + +usingtree + : USINGTREE LPAREN string RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($3)); } + ; + +constant + : name ASSIGN expr SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +thread + : name LPAREN parameters RPAREN stmt_block + { $$ = std::make_unique(@$, std::move($1), std::move($3), std::move($5)); } + ; + +parameters + : parameters COMMA name + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | name + { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } + | + { $$ = std::make_unique(@$); } + ; + +stmt + : stmt_block { $$.as_list = std::move($1); } + | stmt_call { $$.as_call = std::move($1); } + | stmt_assign { $$.as_assign = std::move($1); } + | stmt_endon { $$.as_endon = std::move($1); } + | stmt_notify { $$.as_notify = std::move($1); } + | stmt_wait { $$.as_wait = std::move($1); } + | stmt_waittill { $$.as_waittill = std::move($1); } + | stmt_waittillmatch { $$.as_waittillmatch = std::move($1); } + | stmt_waittillframeend { $$.as_waittillframeend = std::move($1); } + | stmt_waitframe { $$.as_waitframe = std::move($1); } + | stmt_if { $$.as_if = std::move($1); } + | stmt_ifelse { $$.as_ifelse = std::move($1); } + | stmt_while { $$.as_while = std::move($1); } + | stmt_for { $$.as_for = std::move($1); } + | stmt_foreach { $$.as_foreach = std::move($1); } + | stmt_switch { $$.as_switch = std::move($1); } + | stmt_case { $$.as_case = std::move($1); } + | stmt_default { $$.as_default = std::move($1); } + | stmt_break { $$.as_break = std::move($1); } + | stmt_continue { $$.as_continue = std::move($1); } + | stmt_return { $$.as_return = std::move($1); } + ; + +stmt_block + : LBRACE stmt_list RBRACE { $$ = std::move($2); } + | LBRACE RBRACE { $$ = std::make_unique(@$); } + ; + +stmt_list + : stmt_list stmt + { $$ = std::move($1); $$->stmts.push_back(std::move($2)); } + | stmt + { $$ = std::make_unique(@$); $$->stmts.push_back(std::move($1)); } + ; + +stmt_call + : expr_call SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + | expr_call_thread SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + ; + +stmt_assign + : expr_assign SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + ; + +stmt_endon + : object ENDON LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4)); } + ; + +stmt_notify + : object NOTIFY LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object NOTIFY LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_wait + : WAIT expr SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + ; + +stmt_waittill + : object WAITTILL LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object WAITTILL LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_waittillmatch + : object WAITTILLMATCH LPAREN expr COMMA expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | object WAITTILLMATCH LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_waittillframeend + : WAITTILLFRAMEEND SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_waitframe + : WAITFRAME SEMICOLON + { $$ = std::make_unique(@$); } + | WAITFRAME LPAREN RPAREN SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_if + : IF LPAREN expr RPAREN stmt %prec THEN + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_ifelse + : IF LPAREN expr RPAREN stmt ELSE stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5), std::move($7)); } + ; + +stmt_while + : WHILE LPAREN expr RPAREN stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_for + : FOR LPAREN for_stmt SEMICOLON for_expr SEMICOLON for_stmt RPAREN stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5), std::move($7), std::move($9)); } + ; + +stmt_foreach + : FOREACH LPAREN name IN expr RPAREN stmt + { $$ = std::make_unique(@$, expr_ptr(std::move($3)), std::move($5), std::move($7)); } + | FOREACH LPAREN name COMMA name IN expr RPAREN stmt + { $$ = std::make_unique(@$, expr_ptr(std::move($3)), expr_ptr(std::move($5)), std::move($7), std::move($9)); } + ; + +stmt_switch + : SWITCH LPAREN expr RPAREN stmt_block + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_case + : CASE integer COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + | CASE neg_integer COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + | CASE string COLON + { $$ = std::make_unique(@$, expr_ptr(std::move($2)), std::make_unique(@$)); } + ; + +stmt_default + : DEFAULT COLON + { $$ = std::make_unique(@$, std::make_unique(@$)); } + ; + +stmt_break + : BREAK SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_continue + : CONTINUE SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_return + : RETURN expr SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + | RETURN SEMICOLON + { $$ = std::make_unique(@$, std::make_unique(@$)); } + ; + +for_stmt + : expr_assign { $$.as_list = std::make_unique(@$); $$.as_list->stmts.push_back(stmt_ptr(std::make_unique(@$, std::move($1)))); } + | { $$.as_node = std::make_unique(@$); } + ; + +for_expr + : expr { $$ = std::move($1); } + | { $$.as_node = std::make_unique(@$); } + ; + +expr + : expr_compare { $$ = std::move($1); } + | expr_binary { $$ = std::move($1); } + | expr_primitive { $$ = std::move($1); } + ; + +expr_assign + : INCREMENT object %prec PREINC { $$ = std::make_unique(@$, std::move($2)); } + | DECREMENT object %prec PREDEC { $$ = std::make_unique(@$, std::move($2)); } + | object INCREMENT %prec POSTINC { $$ = std::make_unique(@$, std::move($1)); } + | object DECREMENT %prec POSTDEC { $$ = std::make_unique(@$, std::move($1)); } + | object ASSIGN expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_OR expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_AND expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_BITWISE_EXOR expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_LSHIFT expr { $$ = std::make_unique(@$, std::move($1),std::move( $3)); } + | object ASSIGN_RSHIFT expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_ADD expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_SUB expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_MULT expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_DIV expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | object ASSIGN_MOD expr { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_compare + : expr OR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr AND expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr EQUALITY expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr INEQUALITY expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LESS_EQUAL expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr GREATER_EQUAL expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LESS expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr GREATER expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_binary + : expr BITWISE_OR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr BITWISE_AND expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr BITWISE_EXOR expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LSHIFT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr RSHIFT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr ADD expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr SUB expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr MULT expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr DIV expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr MOD expr { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_primitive + : LPAREN expr RPAREN { $$ = std::move($2); } + | COMPLEMENT expr { $$.as_node = std::make_unique(@$, std::move($2)); } + | NOT expr { $$.as_node = std::make_unique(@$, std::move($2)); } + | expr_call { $$.as_node = std::move($1); } + | expr_call_thread { $$.as_node = std::move($1); } + | expr_call_childthread { $$.as_node = std::move($1); } + | expr_function { $$.as_node = std::move($1); } + | expr_add_array { $$.as_node = std::move($1); } + | expr_array { $$.as_node = std::move($1); } + | expr_field { $$.as_node = std::move($1); } + | expr_size { $$.as_node = std::move($1); } + | thisthread { $$.as_node = std::move($1); } + | empty_array { $$.as_node = std::move($1); } + | undefined { $$.as_node = std::move($1); } + | game { $$.as_node = std::move($1); } + | self { $$.as_node = std::move($1); } + | anim { $$.as_node = std::move($1); } + | level { $$.as_node = std::move($1); } + | animation { $$.as_node = std::move($1); } + | animtree { $$.as_node = std::move($1); } + | name { $$.as_node = std::move($1); } + | istring { $$.as_node = std::move($1); } + | string { $$.as_node = std::move($1); } + | vector { $$.as_node = std::move($1); } + | neg_float { $$.as_node = std::move($1); } + | neg_integer { $$.as_node = std::move($1); } + | float { $$.as_node = std::move($1); } + | integer { $$.as_node = std::move($1); } + | false { $$.as_node = std::move($1); } + | true { $$.as_node = std::move($1); } + ; + +expr_call + : expr_call_function { $$ = std::make_unique(@$, false, false, std::make_unique(@$), std::move($1)); } + | expr_call_pointer { $$ = std::make_unique(@$, false, false, std::make_unique(@$), std::move($1)); } + | object expr_call_function { $$ = std::make_unique(@$, false, false, std::move($1), std::move($2)); } + | object expr_call_pointer { $$ = std::make_unique(@$, false, false, std::move($1), std::move($2)); } + ; + +expr_call_thread + : THREAD expr_call_function { $$ = std::make_unique(@$, true, false, std::make_unique(@$), std::move($2)); } + | THREAD expr_call_pointer { $$ = std::make_unique(@$, true, false, std::make_unique(@$), std::move($2)); } + | object THREAD expr_call_function { $$ = std::make_unique(@$, true, false, std::move($1), std::move($3)); } + | object THREAD expr_call_pointer { $$ = std::make_unique(@$, true, false, std::move($1), std::move($3)); } + ; + +expr_call_childthread + : CHILDTHREAD expr_call_function { $$ = std::make_unique(@$, false, true, std::make_unique(@$), std::move($2)); } + | CHILDTHREAD expr_call_pointer { $$ = std::make_unique(@$, false, true, std::make_unique(@$), std::move($2)); } + | object CHILDTHREAD expr_call_function { $$ = std::make_unique(@$, false, true, std::move($1), std::move($3)); } + | object CHILDTHREAD expr_call_pointer { $$ = std::make_unique(@$, false, true, std::move($1), std::move($3)); } + ; + +expr_call_function + : name LPAREN expr_arguments RPAREN + {$$.as_func = std::make_unique(@$, std::make_unique(), std::move($1), std::move($3)); } + | file DOUBLECOLON name LPAREN expr_arguments RPAREN + { $$.as_func = std::make_unique(@$, std::move($1), std::move($3), std::move($5)); } + ; + +expr_call_pointer + : LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = std::make_unique(@$, false, std::move($3), std::move($7)); } + | CALL LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = std::make_unique(@$, true, std::move($4), std::move($8)); } + ; + +expr_arguments + : expr_arguments_filled { $$ = std::move($1); } + | expr_arguments_empty { $$ = std::move($1); } + ; + +expr_arguments_filled + : expr_arguments COMMA expr + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | expr %prec ADD_ARRAY + { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } + ; + +expr_arguments_empty + : + { $$ = std::make_unique(@$); } + ; + +expr_function + : DOUBLECOLON name + { $$ = std::make_unique(@$, std::make_unique(@$), std::move($2)); } + | file DOUBLECOLON name + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_add_array + : LBRACKET expr_arguments_filled RBRACKET + { $$ = std::make_unique(@$, std::move($2)); } + ; + +expr_array + : object LBRACKET expr RBRACKET + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_field + : object DOT name + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_size + : object DOT SIZE + { $$ = std::make_unique(@$, std::move($1)); } + ; + +object + : expr_call { $$ = std::move($1); } + | expr_array { $$ = std::move($1); } + | expr_field { $$ = std::move($1); } + | game { $$ = std::move($1); } + | self { $$ = std::move($1); } + | anim { $$ = std::move($1); } + | level { $$ = std::move($1); } + | name { $$ = std::move($1); } + ; + +thisthread : THISTHREAD { $$ = std::make_unique(@$); }; +empty_array : LBRACKET RBRACKET { $$ = std::make_unique(@$); }; +undefined : UNDEFINED { $$ = std::make_unique(@$); }; +game : GAME { $$ = std::make_unique(@$); }; +self : SELF { $$ = std::make_unique(@$); }; +anim : ANIM { $$ = std::make_unique(@$); }; +level : LEVEL { $$ = std::make_unique(@$); }; +animation : MOD NAME %prec ANIMREF { $$ = std::make_unique(@$, $2); }; +animtree : ANIMTREE { $$ = std::make_unique(@$); }; +name : NAME { $$ = std::make_unique(@$, $1); }; +file : FILE { $$ = std::make_unique(@$, $1); }; +istring : ISTRING { $$ = std::make_unique(@$, $1); }; +string : STRING { $$ = std::make_unique(@$, $1); }; +vector : LPAREN expr COMMA expr COMMA expr RPAREN { $$ = std::make_unique(@$, std::move($2), std::move($4), std::move($6)); }; +neg_float : SUB FLOAT %prec NEG { $$ = std::make_unique(@$, "-" + $2); }; +neg_integer : SUB INTEGER %prec NEG { $$ = std::make_unique(@$, "-" + $2); }; +float : FLOAT { $$ = std::make_unique(@$, $1); }; +integer : INTEGER { $$ = std::make_unique(@$, $1); }; +false : FALSE { $$ = std::make_unique(@$); }; +true : TRUE { $$ = std::make_unique(@$); }; + +%% + +void xsk::gsc::s2::parser::error(const xsk::gsc::location& loc, const std::string& msg) +{ + throw xsk::gsc::comp_error(loc, msg); +} diff --git a/prebuild-macos.sh b/prebuild-macos.sh new file mode 100755 index 00000000..cceac13a --- /dev/null +++ b/prebuild-macos.sh @@ -0,0 +1,3 @@ +#!/bin/sh +git submodule update --init --recursive +./tools/macos/premake5 gmake diff --git a/prebuild-windows.bat b/prebuild-windows.bat new file mode 100644 index 00000000..62971d28 --- /dev/null +++ b/prebuild-windows.bat @@ -0,0 +1,3 @@ +@echo off +git submodule update --init --recursive +tools\windows\premake5.exe vs2019 diff --git a/premake5.lua b/premake5.lua new file mode 100644 index 00000000..7ed6303c --- /dev/null +++ b/premake5.lua @@ -0,0 +1,234 @@ +dependencies = { base = path.getrelative(os.getcwd(), path.getabsolute("deps")) } + +function dependencies.load() + dir = path.join(dependencies.base, "*.lua") + deps = os.matchfiles(dir) + + for i, dep in pairs(deps) do + dep = dep:gsub(".lua", "") + require(dep) + end +end + +dependencies.load() +------------------------------------------------- +workspace "gsc-tool" + location "./build" + objdir "%{wks.location}/obj/%{cfg.buildcfg}/%{prj.name}" + targetdir "%{wks.location}/bin/%{cfg.buildcfg}" + targetname "%{prj.name}" + + language "C++" + cppdialect "C++17" + architecture "x86_64" + + filter "action:vs*" + buildoptions "/bigobj" + buildoptions "/Zc:__cplusplus" + filter{} + + configurations { "debug", "release", } + + symbols "On" + + configuration "release" + optimize "Full" + defines { "NDEBUG", "YY_NO_UNISTD_H"} + configuration{} + + configuration "debug" + optimize "Debug" + defines { "DEBUG", "_DEBUG", "YY_NO_UNISTD_H" } + configuration {} + + startproject "xsk-gsc-tool" + +project "xsk-gsc-tool" + kind "ConsoleApp" + language "C++" + targetname "gsc-tool" + + dependson "xsk-gsc-utils" + dependson "xsk-gsc-iw5" + dependson "xsk-gsc-iw6" + dependson "xsk-gsc-iw7" + dependson "xsk-gsc-s1" + dependson "xsk-gsc-s2" + dependson "xsk-gsc-h1" + dependson "xsk-gsc-h2" + + pchheader "stdafx.hpp" + pchsource "src/tool/stdafx.cpp" + + files { + "./src/tool/**.h", + "./src/tool/**.hpp", + "./src/tool/**.cpp" + } + + links { + "xsk-gsc-utils", + "xsk-gsc-iw5", + "xsk-gsc-iw6", + "xsk-gsc-iw7", + "xsk-gsc-s1", + "xsk-gsc-s2", + "xsk-gsc-h1", + "xsk-gsc-h2" + } + + includedirs { + "./src/tool", + "./src" + } + + zlib:link() + +project "xsk-gsc-utils" + kind "StaticLib" + language "C++" + + pchheader "stdafx.hpp" + pchsource "src/utils/stdafx.cpp" + + files { + "./src/utils/**.h", + "./src/utils/**.hpp", + "./src/utils/**.cpp" + } + + includedirs { + "./src/utils", + "./src" + } + + zlib:include() + +project "xsk-gsc-iw5" + kind "StaticLib" + language "C++" + + pchheader "stdafx.hpp" + pchsource "src/iw5/stdafx.cpp" + + files { + "./src/iw5/**.h", + "./src/iw5/**.hpp", + "./src/iw5/**.cpp" + } + + includedirs { + "./src/iw5", + "./src" + } + +project "xsk-gsc-iw6" + kind "StaticLib" + language "C++" + + pchheader "stdafx.hpp" + pchsource "src/iw6/stdafx.cpp" + + files { + "./src/iw6/**.h", + "./src/iw6/**.hpp", + "./src/iw6/**.cpp" + } + + includedirs { + "./src/iw6", + "./src" + } + +project "xsk-gsc-iw7" + kind "StaticLib" + language "C++" + + pchheader "stdafx.hpp" + pchsource "src/iw7/stdafx.cpp" + + files { + "./src/iw7/**.h", + "./src/iw7/**.hpp", + "./src/iw7/**.cpp" + } + + includedirs { + "./src/iw7", + "./src" + } + +project "xsk-gsc-s1" + kind "StaticLib" + language "C++" + + pchheader "stdafx.hpp" + pchsource "src/s1/stdafx.cpp" + + files { + "./src/s1/**.h", + "./src/s1/**.hpp", + "./src/s1/**.cpp" + } + + includedirs { + "./src/s1", + "./src" + } + +project "xsk-gsc-s2" + kind "StaticLib" + language "C++" + + pchheader "stdafx.hpp" + pchsource "src/s2/stdafx.cpp" + + files { + "./src/s2/**.h", + "./src/s2/**.hpp", + "./src/s2/**.cpp" + } + + includedirs { + "./src/s2", + "./src" + } + +project "xsk-gsc-h1" + kind "StaticLib" + language "C++" + + pchheader "stdafx.hpp" + pchsource "src/h1/stdafx.cpp" + + files { + "./src/h1/**.h", + "./src/h1/**.hpp", + "./src/h1/**.cpp" + } + + includedirs{ + "./src/h1", + "./src" + } + +project "xsk-gsc-h2" + kind "StaticLib" + language "C++" + + pchheader "stdafx.hpp" + pchsource "src/h2/stdafx.cpp" + + files { + "./src/h2/**.h", + "./src/h2/**.hpp", + "./src/h2/**.cpp" + } + + includedirs { + "./src/h2", + "./src" + } + +group "Dependencies" + zlib:project() diff --git a/src/experimental/iw5_console/stdafx.cpp b/src/experimental/iw5_console/stdafx.cpp new file mode 100644 index 00000000..0f0f08c2 --- /dev/null +++ b/src/experimental/iw5_console/stdafx.cpp @@ -0,0 +1,6 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" diff --git a/src/experimental/iw5_console/stdafx.hpp b/src/experimental/iw5_console/stdafx.hpp new file mode 100644 index 00000000..f40e1f92 --- /dev/null +++ b/src/experimental/iw5_console/stdafx.hpp @@ -0,0 +1,38 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +// Warnings +#ifdef _WIN32 +#pragma warning(disable:4244) +#pragma warning(disable:4267) +#pragma warning(disable:4005) +#pragma warning(disable:4065) +#define _CRT_SECURE_NO_WARNINGS +#endif + +// C/C++ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Ext +using namespace std::literals; + +#include "xsk/iw5_console.hpp" diff --git a/src/experimental/iw5_console/xsk/iw5_console.cpp b/src/experimental/iw5_console/xsk/iw5_console.cpp new file mode 100644 index 00000000..79cdc03c --- /dev/null +++ b/src/experimental/iw5_console/xsk/iw5_console.cpp @@ -0,0 +1,179 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw5_console.hpp" + +namespace xsk::gsc::iw5_console +{ + +auto opcode_size(std::uint8_t id) -> std::uint32_t +{ + switch (opcode(id)) + { + case opcode::OP_End: + case opcode::OP_Return: + case opcode::OP_GetUndefined: + case opcode::OP_GetZero: + case opcode::OP_waittillFrameEnd: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_EvalArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_ClearArray: + case opcode::OP_EmptyArray: + case opcode::OP_AddArray: + case opcode::OP_PreScriptCall: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_GetLevelObject: + case opcode::OP_GetAnimObject: + case opcode::OP_GetSelf: + case opcode::OP_GetThisthread: + case opcode::OP_GetLevel: + case opcode::OP_GetGame: + case opcode::OP_GetAnim: + case opcode::OP_GetGameRef: + case opcode::OP_inc: + case opcode::OP_dec: + case opcode::OP_bit_or: + case opcode::OP_bit_ex_or: + case opcode::OP_bit_and: + case opcode::OP_equality: + case opcode::OP_inequality: + case opcode::OP_less: + case opcode::OP_greater: + case opcode::OP_less_equal: + case opcode::OP_waittillmatch2: + case opcode::OP_waittill: + case opcode::OP_notify: + case opcode::OP_endon: + case opcode::OP_voidCodepos: + case opcode::OP_vector: + case opcode::OP_greater_equal: + case opcode::OP_shift_left: + case opcode::OP_shift_right: + case opcode::OP_plus: + case opcode::OP_minus: + case opcode::OP_multiply: + case opcode::OP_divide: + case opcode::OP_mod: + case opcode::OP_size: + case opcode::OP_GetSelfObject: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_clearparams: + case opcode::OP_checkclearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_SetVariableField: + case opcode::OP_ClearVariableField: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_wait: + case opcode::OP_DecTop: + case opcode::OP_CastFieldObject: + case opcode::OP_CastBool: + case opcode::OP_BoolNot: + case opcode::OP_BoolComplement: + return 1; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + case opcode::OP_CreateLocalVariable: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_EvalLocalArrayCached: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_GetAnimTree: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_EvalLocalVariableObjectCached: + return 2; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + case opcode::OP_GetBuiltinFunction: + case opcode::OP_GetBuiltinMethod: + case opcode::OP_GetString: + case opcode::OP_GetIString: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_jumpback: + case opcode::OP_endswitch: + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_waittillmatch: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalSelfFieldVariableRef: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_ClearFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + return 3; + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_GetLocalFunction: + case opcode::OP_CallBuiltin: + case opcode::OP_CallBuiltinMethod: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + case opcode::OP_GetFarFunction: + return 4; + case opcode::OP_GetInteger: + case opcode::OP_GetFloat: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + case opcode::OP_GetAnimation: + case opcode::OP_switch: + case opcode::OP_jump: + return 5; + case opcode::OP_GetVector: + return 13; + default: + throw std::runtime_error("Couldn't resolve instruction size for " + std::to_string(id)); + } +} + +} // namespace xsk::gsc::iw5_console diff --git a/src/experimental/iw5_console/xsk/iw5_console.hpp b/src/experimental/iw5_console/xsk/iw5_console.hpp new file mode 100644 index 00000000..aa09216e --- /dev/null +++ b/src/experimental/iw5_console/xsk/iw5_console.hpp @@ -0,0 +1,173 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "utils/xsk/utils.hpp" + +namespace xsk::gsc::iw5_console +{ + +enum class opcode : std::uint8_t +{ + OP_End = 0, + OP_Return = 1, + OP_GetUndefined = 2, + OP_GetZero = 3, + OP_GetByte = 4, + OP_GetAnimTree = 5, + OP_GetNegByte = 6, + OP_GetUnsignedShort = 7, + OP_GetNegUnsignedShort = 8, + OP_GetInteger = 9, + OP_GetBuiltinFunction = 0xA, + OP_GetBuiltinMethod = 0xB, + OP_GetFloat = 0xC, + OP_GetString = 0xD, + OP_GetIString = 0xE, + OP_GetVector = 0xF, + OP_GetLevelObject = 0x10, + OP_GetAnimObject = 0x11, + OP_GetSelf = 0x12, + OP_GetThisthread = 0x13, + OP_GetLevel = 0x14, + OP_GetGame = 0x15, + OP_GetAnim = 0x16, + OP_GetAnimation = 0x17, + OP_GetGameRef = 0x18, + OP_GetLocalFunction = 0x19, + OP_GetFarFunction = 0x1A, + OP_CreateLocalVariable = 0x1B, + OP_RemoveLocalVariables = 0x1C, + OP_EvalLocalVariableCached0 = 0x1D, + OP_EvalLocalVariableCached1 = 0x1E, + OP_EvalLocalVariableCached2 = 0x1F, + OP_EvalLocalVariableCached3 = 0x20, + OP_EvalLocalVariableCached4 = 0x21, + OP_EvalLocalVariableCached5 = 0x22, + OP_EvalLocalVariableCached = 0x23, + OP_EvalLocalArrayCached = 0x24, + OP_EvalArray = 0x25, + OP_EvalLocalArrayRefCached0 = 0x26, + OP_EvalNewLocalArrayRefCached0 = 0x27, + OP_EvalLocalArrayRefCached = 0x28, + OP_EvalArrayRef = 0x29, + OP_ClearArray = 0x2A, + OP_EmptyArray = 0x2B, + OP_AddArray = 0x2C, + OP_GetSelfObject = 0x2D, + OP_EvalLevelFieldVariable = 0x2E, + OP_EvalAnimFieldVariable = 0x2F, + OP_EvalSelfFieldVariable = 0x30, + OP_EvalFieldVariable = 0x31, + OP_EvalLevelFieldVariableRef = 0x32, + OP_EvalAnimFieldVariableRef = 0x33, + OP_EvalSelfFieldVariableRef = 0x34, + OP_EvalFieldVariableRef = 0x35, + OP_ClearFieldVariable = 0x36, + OP_SafeCreateVariableFieldCached = 0x37, + OP_SafeSetVariableFieldCached0 = 0x38, + OP_SafeSetVariableFieldCached = 0x39, + OP_SafeSetWaittillVariableFieldCached = 0x3A, + OP_clearparams = 0x3B, + OP_checkclearparams = 0x3C, + OP_EvalLocalVariableRefCached0 = 0x3D, + OP_EvalNewLocalVariableRefCached0 = 0x3E, + OP_EvalLocalVariableRefCached = 0x3F, + OP_SetLevelFieldVariableField = 0x40, + OP_SetVariableField = 0x41, + OP_ClearVariableField = 0x42, + OP_SetAnimFieldVariableField = 0x43, + OP_SetSelfFieldVariableField = 0x44, + OP_SetLocalVariableFieldCached0 = 0x45, + OP_SetNewLocalVariableFieldCached0 = 0x46, + OP_SetLocalVariableFieldCached = 0x47, + OP_ClearLocalVariableFieldCached = 0x48, + OP_ClearLocalVariableFieldCached0 = 0x49, + OP_CallBuiltin0 = 0x4A, + OP_CallBuiltin1 = 0x4B, + OP_CallBuiltin2 = 0x4C, + OP_CallBuiltin3 = 0x4D, + OP_CallBuiltin4 = 0x4E, + OP_CallBuiltin5 = 0x4F, + OP_CallBuiltin = 0x50, + OP_CallBuiltinMethod0 = 0x51, + OP_CallBuiltinMethod1 = 0x52, + OP_CallBuiltinMethod2 = 0x53, + OP_CallBuiltinMethod3 = 0x54, + OP_CallBuiltinMethod4 = 0x55, + OP_CallBuiltinMethod5 = 0x56, + OP_CallBuiltinMethod = 0x57, + OP_wait = 0x58, + OP_waittillFrameEnd = 0x59, + OP_PreScriptCall = 0x5A, + OP_ScriptLocalFunctionCall2 = 0x5B, + OP_ScriptLocalFunctionCall = 0x5C, + OP_ScriptLocalMethodCall = 0x5D, + OP_ScriptLocalThreadCall = 0x5E, + OP_ScriptLocalChildThreadCall = 0x5F, + OP_ScriptLocalMethodThreadCall = 0x60, + OP_ScriptLocalMethodChildThreadCall = 0x61, + OP_ScriptFarFunctionCall2 = 0x62, + OP_ScriptFarFunctionCall = 0x63, + OP_ScriptFarMethodCall = 0x64, + OP_ScriptFarThreadCall = 0x65, + OP_ScriptFarChildThreadCall = 0x66, + OP_ScriptFarMethodThreadCall = 0x67, + OP_ScriptFarMethodChildThreadCall = 0x68, + OP_ScriptFunctionCallPointer = 0x69, + OP_ScriptMethodCallPointer = 0x6A, + OP_ScriptThreadCallPointer = 0x6B, + OP_ScriptMethodChildThreadCallPointer = 0x6C, + OP_ScriptMethodThreadCallPointer = 0x6D, + OP_ScriptMethodChildThreadCallPointer = 0x6E, + OP_CallBuiltinPointer = 0x6F, + OP_CallBuiltinMethodPointer = 0x70, + OP_DecTop = 0x71, + OP_CastFieldObject = 0x72, + OP_EvalLocalVariableObjectCached = 0x73, + OP_CastBool = 0x74, + OP_BoolNot = 0x75, + OP_BoolComplement = 0x76, + OP_JumpOnFalse = 0x77, + OP_JumpOnTrue = 0x78, + OP_JumpOnFalseExpr = 0x79, + OP_JumpOnTrueExpr = 0x7A, + OP_jump = 0x7B, + OP_jumpback = 0x7C, + OP_inc = 0x7D, + OP_dec = 0x7E, + OP_bit_or = 0x7F, + OP_bit_ex_or = 0x80, + OP_bit_and = 0x81, + OP_equality = 0x82, + OP_inequality = 0x83, + OP_less = 0x84, + OP_greater = 0x85, + OP_less_equal = 0x86, + OP_greater_equal = 0x87, + OP_shift_left = 0x88, + OP_shift_right = 0x89, + OP_plus = 0x8A, + OP_minus = 0x8B, + OP_multiply = 0x8C, + OP_divide = 0x8F, + OP_mod = 0x8E, + OP_size = 0x8F, + OP_waittillmatch = 0x90, + OP_waittillmatch2 = 0x91, + OP_waittill = 0x92, + OP_notify = 0x93, + OP_endon = 0x94, + OP_voidCodepos = 0x95, + OP_switch = 0x96, + OP_endswitch = 0x97, + OP_vector = 0x98, + OP_Count = 0x99, +}; + +auto opcode_size(std::uint8_t id) -> std::uint32_t; + +} // namespace xsk::gsc::iw5_console diff --git a/src/experimental/iw6_console/stdafx.cpp b/src/experimental/iw6_console/stdafx.cpp new file mode 100644 index 00000000..0f0f08c2 --- /dev/null +++ b/src/experimental/iw6_console/stdafx.cpp @@ -0,0 +1,6 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" diff --git a/src/experimental/iw6_console/stdafx.hpp b/src/experimental/iw6_console/stdafx.hpp new file mode 100644 index 00000000..e0582d7f --- /dev/null +++ b/src/experimental/iw6_console/stdafx.hpp @@ -0,0 +1,38 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +// Warnings +#ifdef _WIN32 +#pragma warning(disable:4244) +#pragma warning(disable:4267) +#pragma warning(disable:4005) +#pragma warning(disable:4065) +#define _CRT_SECURE_NO_WARNINGS +#endif + +// C/C++ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Ext +using namespace std::literals; + +#include "xsk/iw6_console.hpp" diff --git a/src/experimental/iw6_console/xsk/iw6_console.cpp b/src/experimental/iw6_console/xsk/iw6_console.cpp new file mode 100644 index 00000000..282c7d4c --- /dev/null +++ b/src/experimental/iw6_console/xsk/iw6_console.cpp @@ -0,0 +1,179 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw6_console.hpp" + +namespace xsk::gsc::iw6_console +{ + +auto opcode_size(std::uint8_t id) -> std::uint32_t +{ + switch (opcode(id)) + { + case opcode::OP_End: + case opcode::OP_Return: + case opcode::OP_GetUndefined: + case opcode::OP_GetZero: + case opcode::OP_waittillFrameEnd: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_EvalArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_ClearArray: + case opcode::OP_EmptyArray: + case opcode::OP_AddArray: + case opcode::OP_PreScriptCall: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_GetLevelObject: + case opcode::OP_GetAnimObject: + case opcode::OP_GetSelf: + case opcode::OP_GetThisthread: + case opcode::OP_GetLevel: + case opcode::OP_GetGame: + case opcode::OP_GetAnim: + case opcode::OP_GetGameRef: + case opcode::OP_inc: + case opcode::OP_dec: + case opcode::OP_bit_or: + case opcode::OP_bit_ex_or: + case opcode::OP_bit_and: + case opcode::OP_equality: + case opcode::OP_inequality: + case opcode::OP_less: + case opcode::OP_greater: + case opcode::OP_less_equal: +// case opcode::OP_waittillmatch2: + case opcode::OP_waittill: + case opcode::OP_notify: + case opcode::OP_endon: + case opcode::OP_voidCodepos: + case opcode::OP_vector: + case opcode::OP_greater_equal: + case opcode::OP_shift_left: + case opcode::OP_shift_right: + case opcode::OP_plus: + case opcode::OP_minus: + case opcode::OP_multiply: + case opcode::OP_divide: + case opcode::OP_mod: + case opcode::OP_size: + case opcode::OP_GetSelfObject: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_clearparams: + case opcode::OP_checkclearparams: + case opcode::OP_EvalLocalVariableRefCached0: +// case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_SetVariableField: +// case opcode::OP_ClearVariableField: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_wait: + case opcode::OP_DecTop: + case opcode::OP_CastFieldObject: + case opcode::OP_CastBool: + case opcode::OP_BoolNot: + case opcode::OP_BoolComplement: + return 1; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + case opcode::OP_CreateLocalVariable: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_EvalLocalArrayCached: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_GetAnimTree: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_EvalLocalVariableObjectCached: + return 2; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + case opcode::OP_GetBuiltinFunction: + case opcode::OP_GetBuiltinMethod: + case opcode::OP_GetString: + case opcode::OP_GetIString: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_jumpback: + case opcode::OP_endswitch: + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_waittillmatch: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalSelfFieldVariableRef: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_ClearFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + return 3; + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_GetLocalFunction: + case opcode::OP_CallBuiltin: + case opcode::OP_CallBuiltinMethod: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + case opcode::OP_GetFarFunction: + return 4; + case opcode::OP_GetInteger: + case opcode::OP_GetFloat: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + case opcode::OP_GetAnimation: + case opcode::OP_switch: + case opcode::OP_jump: + return 5; + case opcode::OP_GetVector: + return 13; + default: + throw std::runtime_error("Couldn't resolve instruction size for " + std::to_string(id)); + } +} + +} // namespace xsk::gsc::iw6_console diff --git a/src/experimental/iw6_console/xsk/iw6_console.hpp b/src/experimental/iw6_console/xsk/iw6_console.hpp new file mode 100644 index 00000000..3721612d --- /dev/null +++ b/src/experimental/iw6_console/xsk/iw6_console.hpp @@ -0,0 +1,172 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "utils/xsk/utils.hpp" + +namespace xsk::gsc::iw6_console +{ + +enum class opcode : std::uint8_t +{ + OP_CastFieldObject = 0x1D, + OP_SetLocalVariableFieldCached = 0x1E, + OP_plus = 0x1F, + OP_RemoveLocalVariables = 0x20, + OP_EvalSelfFieldVariableRef = 0x21, + OP_ScriptFarMethodChildThreadCall = 0x22, + OP_GetGameRef = 0x23, + OP_EvalAnimFieldVariable = 0x24, + OP_EvalLevelFieldVariableRef = 0x25, + OP_GetThisthread = 0x26, + OP_greater = 0x27, + OP_waittillmatch = 0x28, + OP_shift_right = 0x29, + OP_dec = 0x2A, + OP_JumpOnTrue = 0x2B, + OP_bit_or = 0x2C, + OP_equality = 0x2D, + OP_ClearLocalVariableFieldCached0 = 0x2E, + OP_notify = 0x2F, + OP_GetVector = 0x30, + OP_ScriptMethodChildThreadCallPointer = 0x31, + OP_voidCodepos = 0x32, + OP_GetByte = 0x33, + OP_ScriptFarMethodThreadCall = 0x34, + OP_SetSelfFieldVariableField = 0x35, + OP_JumpOnFalseExpr = 0x36, + OP_GetUndefined = 0x37, + OP_jumpback = 0x38, + OP_JumpOnTrueExpr = 0x39, + OP_CallBuiltin0 = 0x3A, + OP_CallBuiltin1 = 0x3B, + OP_CallBuiltin2 = 0x3C, + OP_CallBuiltin3 = 0x3D, + OP_CallBuiltin4 = 0x3E, + OP_CallBuiltin5 = 0x3F, + OP_CallBuiltin = 0x40, + OP_SetLocalVariableFieldCached0 = 0x41, + OP_ClearFieldVariable = 0x42, + OP_GetLevel = 0x43, + OP_size = 0x44, + OP_SafeSetWaittillVariableFieldCached = 0x45, + OP_ScriptLocalThreadCall = 0x46, + OP_AddArray = 0x47, + OP_endon = 0x48, + OP_EvalFieldVariable = 0x49, + OP_shift_left = 0x4A, + OP_EvalLocalArrayRefCached0 = 0x4B, + OP_Return = 0x4C, + OP_CreateLocalVariable = 0x4D, + OP_SafeSetVariableFieldCached0 = 0x4E, + OP_GetBuiltinFunction = 0x4F, + OP_ScriptLocalMethodCall = 0x50, + OP_CallBuiltinMethodPointer = 0x51, + OP_ScriptLocalChildThreadCall = 0x52, + OP_GetSelfObject = 0x53, + OP_GetGame = 0x54, + OP_SetLevelFieldVariableField = 0x55, + OP_EvalArray = 0x56, + OP_GetSelf = 0x57, + OP_End = 0x58, + OP_EvalSelfFieldVariable = 0x59, + OP_less_equal = 0x5A, + OP_EvalLocalVariableCached0 = 0x5B, + OP_EvalLocalVariableCached1 = 0x5C, + OP_EvalLocalVariableCached2 = 0x5D, + OP_EvalLocalVariableCached3 = 0x5E, + OP_EvalLocalVariableCached4 = 0x5F, + OP_EvalLocalVariableCached5 = 0x60, + OP_EvalLocalVariableCached = 0x61, + OP_EvalNewLocalArrayRefCached0 = 0x62, + OP_ScriptMethodChildThreadCallPointer = 0x63, + OP_EvalLocalVariableObjectCached = 0x64, + OP_ScriptLocalMethodThreadCall = 0x65, + OP_GetInteger = 0x66, + OP_ScriptMethodCallPointer = 0x67, + OP_checkclearparams = 0x68, + OP_SetAnimFieldVariableField = 0x69, + // ---- = 0x6A, + OP_minus = 0x6B, + OP_ScriptLocalFunctionCall2 = 0x6C, + OP_GetNegUnsignedShort = 0x6D, + OP_GetNegByte = 0x6E, + OP_SafeCreateVariableFieldCached = 0x6F, + OP_greater_equal = 0x70, + OP_vector = 0x71, + OP_GetBuiltinMethod = 0x72, + OP_endswitch = 0x73, + OP_ClearArray = 0x74, + OP_DecTop = 0x75, + OP_CastBool = 0x76, + OP_EvalArrayRef = 0x77, + OP_SetNewLocalVariableFieldCached0 = 0x78, + OP_GetZero = 0x79, + OP_wait = 0x7A, + OP_waittill = 0x7B, + OP_GetIString = 0x7C, + OP_ScriptFarFunctionCall = 0x7D, + OP_GetAnimObject = 0x7E, + OP_GetAnimTree = 0x7F, + OP_EvalLocalArrayCached = 0x80, + OP_mod = 0x81, + OP_ScriptFarThreadCall = 0x82, + OP_GetUnsignedShort = 0x83, + OP_clearparams = 0x84, + OP_ScriptMethodThreadCallPointer = 0x85, + OP_ScriptFunctionCallPointer = 0x86, + OP_EmptyArray = 0x87, + OP_SafeSetVariableFieldCached = 0x88, + // ---- = 0x89, + OP_EvalFieldVariableRef = 0x8A, + OP_ScriptLocalMethodChildThreadCall = 0x8B, + // ---- = 0x8C, + OP_GetFloat = 0x8D, + OP_EvalLocalVariableRefCached = 0x8E, + OP_JumpOnFalse = 0x8F, + OP_BoolComplement = 0x90, + OP_ScriptThreadCallPointer = 0x91, + OP_ScriptFarFunctionCall2 = 0x92, + OP_less = 0x93, + OP_BoolNot = 0x94, + OP_waittillFrameEnd = 0x95, + OP_GetString = 0x96, + OP_EvalLevelFieldVariable = 0x97, + OP_GetLevelObject = 0x98, + OP_inc = 0x99, + OP_CallBuiltinMethod0 = 0x9A, + OP_CallBuiltinMethod1 = 0x9B, + OP_CallBuiltinMethod2 = 0x9C, + OP_CallBuiltinMethod3 = 0x9D, + OP_CallBuiltinMethod4 = 0x9E, + OP_CallBuiltinMethod5 = 0x9F, + OP_CallBuiltinMethod = 0xA0, + OP_GetAnim = 0xA1, + OP_switch = 0xA2, + OP_SetVariableField = 0xA3, + OP_divide = 0xA4, + OP_GetLocalFunction = 0xA5, + OP_ScriptFarChildThreadCall = 0xA6, + OP_multiply = 0xA7, + OP_ClearLocalVariableFieldCached = 0xA8, + OP_EvalAnimFieldVariableRef = 0xA9, + OP_EvalLocalArrayRefCached = 0xAA, + OP_EvalLocalVariableRefCached0 = 0xAB, + OP_bit_and = 0xAC, + OP_GetAnimation = 0xAD, + OP_GetFarFunction = 0xAE, + OP_CallBuiltinPointer = 0xAF, + OP_jump = 0xB0, + OP_PreScriptCall = 0xB1, + OP_ScriptFarMethodCall = 0xB2, + OP_inequality = 0xB3, + OP_ScriptLocalFunctionCall = 0xB4, + OP_bit_ex_or = 0xB5, +}; + +auto opcode_size(std::uint8_t id) -> std::uint32_t; + +} // namespace xsk::gsc::iw6_console diff --git a/src/experimental/s1_console/stdafx.cpp b/src/experimental/s1_console/stdafx.cpp new file mode 100644 index 00000000..0f0f08c2 --- /dev/null +++ b/src/experimental/s1_console/stdafx.cpp @@ -0,0 +1,6 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" diff --git a/src/experimental/s1_console/stdafx.hpp b/src/experimental/s1_console/stdafx.hpp new file mode 100644 index 00000000..e4892bcb --- /dev/null +++ b/src/experimental/s1_console/stdafx.hpp @@ -0,0 +1,38 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +// Warnings +#ifdef _WIN32 +#pragma warning(disable:4244) +#pragma warning(disable:4267) +#pragma warning(disable:4005) +#pragma warning(disable:4065) +#define _CRT_SECURE_NO_WARNINGS +#endif + +// C/C++ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Ext +using namespace std::literals; + +#include "xsk/s1_console.hpp" diff --git a/src/experimental/s1_console/xsk/s1_console.cpp b/src/experimental/s1_console/xsk/s1_console.cpp new file mode 100644 index 00000000..fb535a94 --- /dev/null +++ b/src/experimental/s1_console/xsk/s1_console.cpp @@ -0,0 +1,179 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "s1_console.hpp" + +namespace xsk::gsc::s1_console +{ + +auto opcode_size(std::uint8_t id) -> std::uint32_t +{ + switch (opcode(id)) + { + case opcode::OP_End: + case opcode::OP_Return: + case opcode::OP_GetUndefined: + case opcode::OP_GetZero: + case opcode::OP_waittillFrameEnd: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_EvalArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_ClearArray: + case opcode::OP_EmptyArray: + case opcode::OP_AddArray: + case opcode::OP_PreScriptCall: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_GetLevelObject: + case opcode::OP_GetAnimObject: + case opcode::OP_GetSelf: + case opcode::OP_GetThisthread: + case opcode::OP_GetLevel: + case opcode::OP_GetGame: + case opcode::OP_GetAnim: + case opcode::OP_GetGameRef: + case opcode::OP_inc: + case opcode::OP_dec: + case opcode::OP_bit_or: + case opcode::OP_bit_ex_or: + case opcode::OP_bit_and: + case opcode::OP_equality: + case opcode::OP_inequality: + case opcode::OP_less: + case opcode::OP_greater: + case opcode::OP_less_equal: +// case opcode::OP_waittillmatch2: + case opcode::OP_waittill: + case opcode::OP_notify: + case opcode::OP_endon: + case opcode::OP_voidCodepos: + case opcode::OP_vector: + case opcode::OP_greater_equal: + case opcode::OP_shift_left: + case opcode::OP_shift_right: + case opcode::OP_plus: + case opcode::OP_minus: + case opcode::OP_multiply: + case opcode::OP_divide: + case opcode::OP_mod: + case opcode::OP_size: + case opcode::OP_GetSelfObject: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_clearparams: + case opcode::OP_checkclearparams: + case opcode::OP_EvalLocalVariableRefCached0: +// case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_SetVariableField: +// case opcode::OP_ClearVariableField: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_wait: + case opcode::OP_DecTop: + case opcode::OP_CastFieldObject: + case opcode::OP_CastBool: + case opcode::OP_BoolNot: + case opcode::OP_BoolComplement: + return 1; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + case opcode::OP_CreateLocalVariable: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_EvalLocalArrayCached: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_GetAnimTree: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_EvalLocalVariableObjectCached: + return 2; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + case opcode::OP_GetBuiltinFunction: + case opcode::OP_GetBuiltinMethod: + case opcode::OP_GetString: + case opcode::OP_GetIString: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_jumpback: + case opcode::OP_endswitch: + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_waittillmatch: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalSelfFieldVariableRef: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_ClearFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + return 3; + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_GetLocalFunction: + case opcode::OP_CallBuiltin: + case opcode::OP_CallBuiltinMethod: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + case opcode::OP_GetFarFunction: + return 4; + case opcode::OP_GetInteger: + case opcode::OP_GetFloat: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + case opcode::OP_GetAnimation: + case opcode::OP_switch: + case opcode::OP_jump: + return 5; + case opcode::OP_GetVector: + return 13; + default: + throw std::runtime_error("Couldn't resolve instruction size for " + std::to_string(id)); + } +} + +} // namespace xsk::gsc::s1_console diff --git a/src/experimental/s1_console/xsk/s1_console.hpp b/src/experimental/s1_console/xsk/s1_console.hpp new file mode 100644 index 00000000..528c08be --- /dev/null +++ b/src/experimental/s1_console/xsk/s1_console.hpp @@ -0,0 +1,173 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "utils/xsk/utils.hpp" + +namespace xsk::gsc::s1_console +{ + +enum class opcode : std::uint8_t +{ + OP_CastFieldObject = 0x1D, + OP_SetLocalVariableFieldCached = 0x1E, + OP_plus = 0x1F, + OP_RemoveLocalVariables = 0x20, + OP_EvalSelfFieldVariableRef = 0x21, + OP_ScriptFarMethodChildThreadCall = 0x22, + OP_GetGameRef = 0x23, + OP_EvalAnimFieldVariable = 0x24, + OP_EvalLevelFieldVariableRef = 0x25, + OP_GetThisthread = 0x26, + OP_greater = 0x27, + OP_waittillmatch = 0x28, + OP_shift_right = 0x29, + OP_dec = 0x2A, + OP_JumpOnTrue = 0x2B, + OP_bit_or = 0x2C, + OP_equality = 0x2D, + OP_ClearLocalVariableFieldCached0 = 0x2E, + OP_notify = 0x2F, + OP_GetVector = 0x30, + OP_ScriptMethodChildThreadCallPointer = 0x31, + OP_PreScriptCall = 0x32, + OP_GetByte = 0x33, + OP_ScriptFarMethodThreadCall = 0x34, + OP_SetSelfFieldVariableField = 0x35, + OP_JumpOnFalseExpr = 0x36, + OP_GetUndefined = 0x37, + OP_jumpback = 0x38, + OP_JumpOnTrueExpr = 0x39, + OP_CallBuiltin0 = 0x3A, + OP_CallBuiltin1 = 0x3B, + OP_CallBuiltin2 = 0x3C, + OP_CallBuiltin3 = 0x3D, + OP_CallBuiltin4 = 0x3E, + OP_CallBuiltin5 = 0x3F, + OP_CallBuiltin = 0x40, + OP_SetLocalVariableFieldCached0 = 0x41, + OP_ClearFieldVariable = 0x42, + OP_GetLevel = 0x43, + OP_size = 0x44, + OP_SafeSetWaittillVariableFieldCached = 0x45, + OP_ScriptLocalThreadCall = 0x46, + OP_AddArray = 0x47, + OP_endon = 0x48, + OP_EvalFieldVariable = 0x49, + OP_shift_left = 0x4A, + OP_EvalLocalArrayRefCached0 = 0x4B, + OP_Return = 0x4C, + OP_CreateLocalVariable = 0x4D, + OP_SafeSetVariableFieldCached0 = 0x4E, + OP_GetBuiltinFunction = 0x4F, + OP_ScriptLocalMethodCall = 0x50, + OP_CallBuiltinMethodPointer = 0x51, + OP_ScriptLocalChildThreadCall = 0x52, + OP_GetSelfObject = 0x53, + OP_GetGame = 0x54, + OP_SetLevelFieldVariableField = 0x55, + OP_EvalArray = 0x56, + OP_GetSelf = 0x57, + OP_End = 0x58, + OP_EvalSelfFieldVariable = 0x59, + OP_less_equal = 0x5A, + OP_EvalLocalVariableCached0 = 0x5B, + OP_EvalLocalVariableCached1 = 0x5C, + OP_EvalLocalVariableCached2 = 0x5D, + OP_EvalLocalVariableCached3 = 0x5E, + OP_EvalLocalVariableCached4 = 0x5F, + OP_EvalLocalVariableCached5 = 0x60, + OP_EvalLocalVariableCached = 0x61, + OP_EvalNewLocalArrayRefCached0 = 0x62, + OP_ScriptMethodChildThreadCallPointer = 0x63, + OP_EvalLocalVariableObjectCached = 0x64, + OP_ScriptLocalMethodThreadCall = 0x65, + OP_GetInteger = 0x66, + OP_ScriptMethodCallPointer = 0x67, + OP_checkclearparams = 0x68, + OP_SetAnimFieldVariableField = 0x69, + // ---- = 0x6A, + OP_minus = 0x6B, + OP_ScriptLocalFunctionCall2 = 0x6C, + OP_GetNegUnsignedShort = 0x6D, + OP_GetNegByte = 0x6E, + OP_SafeCreateVariableFieldCached = 0x6F, + OP_greater_equal = 0x70, + OP_vector = 0x71, + OP_GetBuiltinMethod = 0x72, + OP_endswitch = 0x73, + OP_ClearArray = 0x74, + OP_DecTop = 0x75, + OP_CastBool = 0x76, + OP_EvalArrayRef = 0x77, + OP_SetNewLocalVariableFieldCached0 = 0x78, + OP_GetZero = 0x79, + OP_wait = 0x7A, + OP_waittill = 0x7B, + OP_GetIString = 0x7C, + OP_ScriptFarFunctionCall = 0x7D, + OP_GetAnimObject = 0x7E, + OP_GetAnimTree = 0x7F, + OP_EvalLocalArrayCached = 0x80, + OP_mod = 0x81, + OP_ScriptFarThreadCall = 0x82, + OP_GetUnsignedShort = 0x83, + OP_clearparams = 0x84, + OP_ScriptMethodThreadCallPointer = 0x85, + OP_ScriptFunctionCallPointer = 0x86, + OP_EmptyArray = 0x87, + OP_SafeSetVariableFieldCached = 0x88, + // ---- = 0x89, + OP_EvalFieldVariableRef = 0x8A, + OP_ScriptLocalMethodChildThreadCall = 0x8B, + // ---- = 0x8C, + OP_GetFloat = 0x8D, + OP_EvalLocalVariableRefCached = 0x8E, + OP_JumpOnFalse = 0x8F, + OP_BoolComplement = 0x90, + OP_ScriptThreadCallPointer = 0x91, + OP_ScriptFarFunctionCall2 = 0x92, + OP_less = 0x93, + OP_BoolNot = 0x94, + OP_waittillFrameEnd = 0x95, + OP_waitFrame = 0x96, + OP_GetString = 0x97, + OP_EvalLevelFieldVariable = 0x98, + OP_GetLevelObject = 0x99, + OP_inc = 0x9A, + OP_CallBuiltinMethod0 = 0x9B, + OP_CallBuiltinMethod1 = 0x9C, + OP_CallBuiltinMethod2 = 0x9D, + OP_CallBuiltinMethod3 = 0x9E, + OP_CallBuiltinMethod4 = 0x9F, + OP_CallBuiltinMethod5 = 0xA0, + OP_CallBuiltinMethod = 0xA1, + OP_GetAnim = 0xA2, + OP_switch = 0xA3, + OP_SetVariableField = 0xA4, + OP_divide = 0xA5, + OP_GetLocalFunction = 0xA6, + OP_ScriptFarChildThreadCall = 0xA7, + OP_multiply = 0xA8, + OP_ClearLocalVariableFieldCached = 0xA9, + OP_EvalAnimFieldVariableRef = 0xAA, + OP_EvalLocalArrayRefCached = 0xAB, + OP_EvalLocalVariableRefCached0 = 0xAC, + OP_bit_and = 0xAD, + OP_GetAnimation = 0xAE, + OP_GetFarFunction = 0xAF, + OP_CallBuiltinPointer = 0xB0, + OP_jump = 0xB1, + OP_voidCodepos = 0xB2, + OP_ScriptFarMethodCall = 0xB3, + OP_inequality = 0xB4, + OP_ScriptLocalFunctionCall = 0xB5, + OP_bit_ex_or = 0xB6, +}; + +auto opcode_size(std::uint8_t id) -> std::uint32_t; + +} // namespace xsk::gsc::s1_console diff --git a/src/h1/stdafx.cpp b/src/h1/stdafx.cpp new file mode 100644 index 00000000..0f0f08c2 --- /dev/null +++ b/src/h1/stdafx.cpp @@ -0,0 +1,6 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" diff --git a/src/h1/stdafx.hpp b/src/h1/stdafx.hpp new file mode 100644 index 00000000..1db66b70 --- /dev/null +++ b/src/h1/stdafx.hpp @@ -0,0 +1,38 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +// Warnings +#ifdef _WIN32 +#pragma warning(disable:4244) +#pragma warning(disable:4267) +#pragma warning(disable:4005) +#pragma warning(disable:4065) +#define _CRT_SECURE_NO_WARNINGS +#endif + +// C/C++ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Ext +using namespace std::literals; + +#include "xsk/h1.hpp" diff --git a/src/h1/xsk/assembler.cpp b/src/h1/xsk/assembler.cpp new file mode 100644 index 00000000..106c22d1 --- /dev/null +++ b/src/h1/xsk/assembler.cpp @@ -0,0 +1,604 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "h1.hpp" + +namespace xsk::gsc::h1 +{ + +auto assembler::output_script() -> std::vector +{ + std::vector script; + + if(script_ == nullptr) return script; + + script.resize(script_->pos()); + memcpy(script.data(), script_->buffer().data(), script.size()); + + return script; +} + +auto assembler::output_stack() -> std::vector +{ + std::vector stack; + + if(stack_ == nullptr) return stack; + + stack.resize(stack_->pos()); + memcpy(stack.data(), stack_->buffer().data(), stack.size()); + + return stack; +} + +void assembler::assemble(const std::string& file, std::vector& data) +{ + std::vector assembly = utils::string::clean_buffer_lines(data); + std::vector functions; + gsc::function_ptr func = nullptr; + std::uint32_t index = 1; + std::uint16_t switchnum = 0; + + for (auto& line : assembly) + { + if (line == "" || line.substr(0, 2) == "//") + { + continue; + } + else if (line.substr(0, 4) == "sub_") + { + func = std::make_unique(); + func->index = index; + func->name = line.substr(4); + } + else if (line.substr(0, 4) == "end_") + { + if (func != nullptr) + { + func->size = index - func->index; + functions.push_back(std::move(func)); + } + } + else if (line.substr(0, 4) == "loc_") + { + func->labels[index] = line; + } + else + { + auto data = utils::string::parse_code(line); + + if (switchnum) + { + if (data[0] == "case" || data[0] == "default") + { + for (auto& entry : data) + { + func->instructions.back()->data.push_back(entry); + } + switchnum--; + continue; + } + + throw gsc::asm_error("invalid instruction inside endswitch \""s + line + "\"!"); + } + else + { + auto inst = std::make_unique(); + inst->index = index; + inst->opcode = static_cast(resolver::opcode_id(data[0])); + inst->size = opcode_size(inst->opcode); + data.erase(data.begin()); + inst->data = std::move(data); + + if (opcode(inst->opcode) == opcode::OP_endswitch) + { + switchnum = static_cast(std::stoul(inst->data[0])); + inst->size += 7 * switchnum; + } + + index += inst->size; + func->instructions.push_back(std::move(inst)); + } + } + } + + this->assemble(file, functions); +} + +void assembler::assemble(const std::string& file, std::vector& functions) +{ + script_ = std::make_unique(0x100000); + stack_ = std::make_unique(0x100000); + filename_ = file; + functions_ = std::move(functions); + + script_->write(static_cast(opcode::OP_End)); + stack_->write(0x69773630); + + for (const auto& func : functions_) + { + this->assemble_function(func); + } +} + +void assembler::assemble_function(const gsc::function_ptr& func) +{ + labels_ = func->labels; + + stack_->write(func->size); + + func->id = func->name.substr(0, 3) == "_ID" ? std::stoul(func->name.substr(3)) : resolver::token_id(func->name); + stack_->write(func->id); + + if (func->id == 0) + { + stack_->write_c_string(func->name); + } + + for (const auto& inst : func->instructions) + { + this->assemble_instruction(inst); + } +} + +void assembler::assemble_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_Return: + case opcode::OP_BoolNot: + case opcode::OP_CastBool: + case opcode::OP_inequality: + case opcode::OP_GetThisthread: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_checkclearparams: + case opcode::OP_CastFieldObject: + case opcode::OP_End: + case opcode::OP_size: + case opcode::OP_EmptyArray: + case opcode::OP_bit_and: + case opcode::OP_less_equal: + case opcode::OP_voidCodepos: + case opcode::OP_ClearVariableField: + case opcode::OP_divide: + case opcode::OP_GetSelf: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_plus: + case opcode::OP_BoolComplement: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_inc: + case opcode::OP_clearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_endon: + case opcode::OP_greater_equal: + case opcode::OP_GetSelfObject: + case opcode::OP_SetVariableField: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_less: + case opcode::OP_GetGameRef: + case opcode::OP_waitFrame: + case opcode::OP_waittillFrameEnd: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_notify: + case opcode::OP_DecTop: + case opcode::OP_shift_left: + case opcode::OP_greater: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_minus: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_multiply: + case opcode::OP_mod: + case opcode::OP_GetGame: + case opcode::OP_waittill: + case opcode::OP_dec: + case opcode::OP_PreScriptCall: + case opcode::OP_GetAnim: + case opcode::OP_GetUndefined: + case opcode::OP_GetAnimObject: + case opcode::OP_GetLevelObject: + case opcode::OP_bit_ex_or: + case opcode::OP_equality: + case opcode::OP_ClearArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalArray: + case opcode::OP_vector: + case opcode::OP_bit_or: + case opcode::OP_AddArray: + case opcode::OP_waittillmatch2: + case opcode::OP_shift_right: + script_->write(static_cast(inst->opcode)); + break; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetInteger: + script_->write(static_cast(inst->opcode)); + script_->write(std::stoi(inst->data[0])); + break; + case opcode::OP_GetFloat: + script_->write(static_cast(inst->opcode)); + script_->write(std::stof(inst->data[0])); + break; + case opcode::OP_GetVector: + script_->write(static_cast(inst->opcode)); + script_->write(std::stof(inst->data[0])); + script_->write(std::stof(inst->data[1])); + script_->write(std::stof(inst->data[2])); + break; + case opcode::OP_GetString: + case opcode::OP_GetIString: + script_->write(static_cast(inst->opcode)); + script_->write(0); + stack_->write_c_string(utils::string::to_code(inst->data[0])); + break; + case opcode::OP_GetAnimation: + script_->write(static_cast(inst->opcode)); + script_->write(0); + script_->write(0); + stack_->write_c_string(utils::string::unquote(inst->data[0])); + stack_->write_c_string(utils::string::unquote(inst->data[1])); + break; + case opcode::OP_GetAnimTree: + script_->write(static_cast(inst->opcode)); + script_->write(0); + stack_->write_c_string(utils::string::unquote(inst->data[0])); + break; + case opcode::OP_waittillmatch: + script_->write(static_cast(inst->opcode)); + script_->write(0); + break; + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_EvalLocalArrayCached: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + this->assemble_field_variable(inst); + break; + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + this->assemble_local_call(inst, false); + break; + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + this->assemble_local_call(inst, true); + break; + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + this->assemble_far_call(inst, false); + break; + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + this->assemble_far_call(inst, true); + break; + case opcode::OP_CallBuiltin: + this->assemble_builtin_call(inst, false, true); + break; + case opcode::OP_CallBuiltinMethod: + this->assemble_builtin_call(inst, true, true); + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + this->assemble_builtin_call(inst, false, false); + break; + case opcode::OP_GetBuiltinMethod: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + this->assemble_builtin_call(inst, true, false); + break; + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + this->assemble_jump(inst, true, false); + break; + case opcode::OP_jumpback: + this->assemble_jump(inst, false, true); + break; + case opcode::OP_jump: + this->assemble_jump(inst, false, false); + break; + case opcode::OP_switch: + this->assemble_switch(inst); + break; + case opcode::OP_endswitch: + this->assemble_end_switch(inst); + break; + default: + throw gsc::asm_error(utils::string::va("Unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); + } +} + +void assembler::assemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num) +{ + script_->write(static_cast(inst->opcode)); + + std::uint16_t id = 0; + + if (arg_num) + { + script_->write(static_cast(std::stol(inst->data[0]))); + + if (method) + id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::method_id(inst->data[1]); + else + id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::function_id(inst->data[1]); + } + else + { + if (method) + id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::method_id(inst->data[0]); + else + id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::function_id(inst->data[0]); + } + + script_->write(id); +} + +void assembler::assemble_local_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_function(inst->data[0]); + + std::int32_t offset = addr - inst->index - 1; + + this->assemble_offset(offset); + + if (thread) + { + script_->write(static_cast(std::stol(inst->data[1]))); + } +} + +void assembler::assemble_far_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->write(static_cast(inst->opcode)); + script_->write(0); + script_->write(0); + + std::uint16_t file_id = 0; + std::uint16_t func_id = 0; + + if (thread) + { + script_->write(static_cast(std::stol(inst->data[0]))); + + file_id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::file_id(inst->data[1]); + func_id = inst->data[2].substr(0, 3) == "_ID" ? std::stol(inst->data[2].substr(3)) : resolver::token_id(inst->data[2]); + } + else + { + file_id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::file_id(inst->data[0]); + func_id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::token_id(inst->data[1]); + } + + stack_->write(file_id); + if (file_id == 0) stack_->write_c_string(thread ? inst->data[1] : inst->data[0]); + stack_->write(func_id); + if (func_id == 0) stack_->write_c_string(thread ? inst->data[2] : inst->data[1]); +} + +void assembler::assemble_switch(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_label(inst->data[0]); + + script_->write(addr - inst->index - 4); +} + +void assembler::assemble_end_switch(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::uint16_t casenum = 0; + + if (utils::string::is_number(inst->data[0])) + { + casenum = std::stol(inst->data[0]); + } + else + { + throw gsc::asm_error("invalid endswitch number!"); + } + + script_->write(casenum); + + std::uint32_t internal_index = inst->index + 3; + + for (std::uint16_t i = 0; i < casenum; i++) + { + if (inst->data[1 + (3 * i)] == "case") + { + if (utils::string::is_number(inst->data[1 + (3 * i) + 1])) + { + script_->write((std::stol(inst->data[1 + (3 * i) + 1]) & 0xFFFFFF) + 0x800000); + } + else + { + script_->write(i + 1); + stack_->write_c_string(utils::string::unquote(inst->data[1 + (3 * i) + 1])); + } + + internal_index += 4; + + std::int32_t addr = this->resolve_label(inst->data[1 + (3 * i) + 2]); + + this->assemble_offset(addr - internal_index); + + internal_index += 3; + } + else if (inst->data[1 + (3 * i)] == "default") + { + script_->write(0); + stack_->write_c_string("\x01"); + + internal_index += 4; + std::int32_t addr = this->resolve_label(inst->data[1 + (3 * i) + 1]); + + this->assemble_offset(addr - internal_index); + + internal_index += 3; + } + } +} + +void assembler::assemble_field_variable(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::uint16_t field_id = 0; + + if (inst->data[0].substr(0, 3) == "_ID") + { + field_id = (std::uint16_t)std::stol(inst->data[0].substr(3)); + } + else + { + field_id = resolver::token_id(inst->data[0]); + + if (field_id == 0) + { + field_id = 0xFFFF; + } + } + + script_->write(field_id); + + if (field_id > 0xA7ED) + { + stack_->write(0); + stack_->write_c_string(inst->data[0]); + } +} + +void assembler::assemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_label(inst->data[0]); + + if (expr) + { + script_->write(addr - inst->index - 3); + } + else if (back) + { + script_->write((inst->index + 3) - addr); + } + else + { + script_->write(addr - inst->index - 5); + } +} + +void assembler::assemble_offset(std::int32_t offset) +{ + std::array bytes = {}; + + offset = (offset << 10) >> 8; + + *reinterpret_cast(bytes.data()) = offset; + + script_->write(bytes[0]); + script_->write(bytes[1]); + script_->write(bytes[2]); +} + +auto assembler::resolve_function(const std::string& name) -> std::uint32_t +{ + auto temp = name.substr(0, 4) == "sub_" ? name.substr(4) : name; + + for (const auto& func : functions_) + { + if (func->name == temp) + { + return func->index; + } + } + + throw gsc::asm_error("Couldn't resolve local function address of '" + temp + "'!"); +} + +auto assembler::resolve_label(const std::string& name) -> std::uint32_t +{ + for (auto& func : labels_) + { + if (func.second == name) + { + return func.first; + } + } + + throw gsc::asm_error("Couldn't resolve label address of '" + name + "'!"); +} + +} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/assembler.hpp b/src/h1/xsk/assembler.hpp new file mode 100644 index 00000000..c964aa24 --- /dev/null +++ b/src/h1/xsk/assembler.hpp @@ -0,0 +1,40 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::h1 +{ + +class assembler : public gsc::assembler +{ + std::string filename_; + utils::byte_buffer_ptr script_; + utils::byte_buffer_ptr stack_; + std::vector functions_; + std::unordered_map labels_; + +public: + auto output_script() -> std::vector; + auto output_stack() -> std::vector; + void assemble(const std::string& file, std::vector& data); + void assemble(const std::string& file, std::vector& functions); + +private: + void assemble_function(const gsc::function_ptr& func); + void assemble_instruction(const gsc::instruction_ptr& inst); + void assemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num); + void assemble_local_call(const gsc::instruction_ptr& inst, bool thread); + void assemble_far_call(const gsc::instruction_ptr& inst, bool thread); + void assemble_switch(const gsc::instruction_ptr& inst); + void assemble_end_switch(const gsc::instruction_ptr& inst); + void assemble_field_variable(const gsc::instruction_ptr& inst); + void assemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back); + void assemble_offset(std::int32_t offset); + auto resolve_function(const std::string& name) -> std::uint32_t; + auto resolve_label(const std::string& name) -> std::uint32_t; +}; + +} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/compiler.cpp b/src/h1/xsk/compiler.cpp new file mode 100644 index 00000000..cf5b1601 --- /dev/null +++ b/src/h1/xsk/compiler.cpp @@ -0,0 +1,2295 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "h1.hpp" +#include "parser.hpp" +#include "lexer.hpp" + +namespace xsk::gsc::h1 +{ + +auto compiler::output() -> std::vector +{ + return std::move(assembly_); +} + +void compiler::compile(const std::string& file, std::vector& data) +{ + filename_ = file; + + auto result = parse_buffer(filename_, data); + + compile_program(result); +} + +void compiler::set_readf_callback(std::function(const std::string&)> func) +{ + callback_readf_ = func; +} + +auto compiler::parse_buffer(const std::string& file, std::vector& data) -> gsc::program_ptr +{ + yyscan_t scanner; + gsc::location loc; + gsc::program_ptr result(nullptr); + + loc.initialize(&file); + // Add the two NULL terminators, required by flex. + data.push_back(0); + data.push_back(0); + + if (h1_lex_init(&scanner)) + exit(1); + + YY_BUFFER_STATE yybuffer = h1__scan_buffer(reinterpret_cast(data.data()), data.size(), scanner); + + parser parser(scanner, loc, result); + + if(parser.parse() || result == nullptr) + { + throw gsc::comp_error(loc, "An unknown error ocurred while parsing gsc file."); + } + + h1__delete_buffer(yybuffer, scanner); + h1_lex_destroy(scanner); + + return result; +} + +auto compiler::parse_file(const std::string& file) -> gsc::program_ptr +{ + auto buffer = callback_readf_(file); + auto result = parse_buffer(file, buffer); + + return result; +} + +void compiler::compile_program(const gsc::program_ptr& program) +{ + assembly_.clear(); + includes_.clear(); + animtrees_.clear(); + constants_.clear(); + local_functions_.clear(); + index_ = 1; + + for(const auto& def : program->definitions) + { + if(def.as_node->type == gsc::node_t::thread) + { + local_functions_.push_back(def.as_thread->name->value); + } + } + + for(const auto& include : program->includes) + { + emit_include(include); + } + + for(const auto& def : program->definitions) + { + emit_define(def); + } + +#ifdef DEBUG_GSC_COMPILER + print_debug_info(); +#endif +} + +void compiler::emit_include(const gsc::include_ptr& include) +{ + const auto& path = include->file->value; + + for(const auto& inc : includes_) + { + if(inc.name == path) + { + throw gsc::comp_error(include->loc, "error duplicated include file '" + path + "'."); + } + } + + if(map_known_includes(path)) return; + + try + { + auto program = parse_file(path); + + std::vector funcs; + + for(const auto& def : program->definitions) + { + if(def.as_node->type == gsc::node_t::thread) + { + funcs.push_back(def.as_thread->name->value); + } + } + + if(funcs.size() == 0) + { + throw gsc::comp_error(include->loc, "error empty include file '" + path + "'."); + } + + includes_.push_back(include_t(path, funcs)); + } + catch(const std::exception& e) + { + throw gsc::comp_error(include->loc, "error parsing include file '" + path + "': " + e.what()); + } +} + +void compiler::emit_define(const gsc::define_ptr& define) +{ + switch(define.as_node->type) + { + case gsc::node_t::usingtree: emit_usingtree(define.as_usingtree); break; + case gsc::node_t::constant: emit_constant(define.as_constant); break; + case gsc::node_t::thread: emit_thread(define.as_thread); break; + default: break; + } +} + +void compiler::emit_usingtree(const gsc::usingtree_ptr& animtree) +{ + animtrees_.push_back({ animtree->animtree->value, false }); +} + +void compiler::emit_constant(const gsc::constant_ptr& constant) +{ + constants_.insert({ constant->name->value, std::move(constant->value) }); +} + +void compiler::emit_thread(const gsc::thread_ptr& thread) +{ + function_ = std::make_unique(); + function_->index = index_; + function_->name = thread->name->value; + + auto ctx = std::make_unique(); + stack_idx_ = 0; + label_idx_ = 0; + can_break_ = false; + can_continue_ = false; + local_stack_.clear(); + break_ctxs_.clear(); + continue_ctxs_.clear(); + + process_thread(ctx, thread); + + emit_parameters(ctx, thread->params); + emit_stmt_list(ctx, thread->block, true); + emit_opcode(ctx, opcode::OP_End); + + function_->size = index_ - function_->index; + assembly_.push_back(std::move(function_)); +} + +void compiler::emit_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + initialize_variable(ctx, param); + emit_opcode(ctx, opcode::OP_SafeCreateVariableFieldCached, variable_create_index(ctx, param)); + } + + emit_opcode(ctx, opcode::OP_checkclearparams); +} + +void compiler::emit_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt, bool last) +{ + switch(stmt.as_node->type) + { + case gsc::node_t::stmt_list: emit_stmt_list(ctx, stmt.as_list, last); break; + case gsc::node_t::stmt_call: emit_stmt_call(ctx, stmt.as_call); break; + case gsc::node_t::stmt_assign: emit_stmt_assign(ctx, stmt.as_assign); break; + case gsc::node_t::stmt_endon: emit_stmt_endon(ctx, stmt.as_endon); break; + case gsc::node_t::stmt_notify: emit_stmt_notify(ctx, stmt.as_notify); break; + case gsc::node_t::stmt_wait: emit_stmt_wait(ctx, stmt.as_wait); break; + case gsc::node_t::stmt_waittill: emit_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_waittillmatch: emit_stmt_waittillmatch(ctx, stmt.as_waittillmatch); break; + case gsc::node_t::stmt_waittillframeend: emit_stmt_waittillframeend(ctx, stmt.as_waittillframeend); break; + case gsc::node_t::stmt_waitframe: emit_stmt_waitframe(ctx, stmt.as_waitframe); break; + case gsc::node_t::stmt_if: emit_stmt_if(ctx, stmt.as_if, last); break; + case gsc::node_t::stmt_ifelse: emit_stmt_ifelse(ctx, stmt.as_ifelse, last); break; + case gsc::node_t::stmt_while: emit_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: emit_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: emit_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: emit_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_case: emit_stmt_case(ctx, stmt.as_case); break; + case gsc::node_t::stmt_default: emit_stmt_default(ctx, stmt.as_default); break; + case gsc::node_t::stmt_break: emit_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_continue: emit_stmt_continue(ctx, stmt.as_continue); break; + case gsc::node_t::stmt_return: emit_stmt_return(ctx, stmt.as_return); break; + default: break; + } +} + +void compiler::emit_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt, bool last) +{ + for (const auto& entry : stmt->stmts) + { + bool last_ = (&entry == &stmt->stmts.back() && last) ? true : false; + emit_stmt(ctx, entry, last_); + } +} + +void compiler::emit_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt) +{ + if(stmt->expr->func.as_node->type == gsc::node_t::expr_call_function) + { + const auto& name = stmt->expr->func.as_func->name->value; + + if(name == "assert" || name == "assertex" || name == "assertmsg") return; + } + + emit_expr_call(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_DecTop); +} + +void compiler::emit_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt) +{ + emit_expr_assign(ctx, stmt->expr); +} + +void compiler::emit_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_endon); +} + +void compiler::emit_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt) +{ + emit_opcode(ctx, opcode::OP_voidCodepos); + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + emit_expr(ctx, arg); + } + + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_notify); +} + +void compiler::emit_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_wait); +} + +void compiler::emit_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_waittill); + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + create_variable(ctx, arg.as_name); + emit_opcode(ctx, opcode::OP_SafeSetWaittillVariableFieldCached, variable_access_index(ctx, arg.as_name)); + } + + emit_opcode(ctx, opcode::OP_clearparams); +} + +void compiler::emit_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt) +{ + emit_expr_arguments(ctx, stmt->args); + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_waittillmatch); + emit_opcode(ctx, opcode::OP_clearparams); +} + +void compiler::emit_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt) +{ + emit_opcode(ctx, opcode::OP_waittillFrameEnd); +} + +void compiler::emit_stmt_waitframe(const gsc::context_ptr& ctx, const gsc::stmt_waitframe_ptr& stmt) +{ + emit_opcode(ctx, opcode::OP_waitFrame); +} + +void compiler::emit_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt, bool last) +{ + auto end_loc = create_label(); + + if(stmt->expr.as_node->type == gsc::node_t::expr_not) + { + emit_expr(ctx, stmt->expr.as_not->rvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrue, end_loc); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, end_loc); + } + + ctx->transfer(stmt->ctx); + stmt->ctx->is_last = last; + + emit_stmt(stmt->ctx, stmt->stmt, last); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_remove_local_vars(stmt->ctx); + + insert_label(end_loc); +} + +void compiler::emit_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt, bool last) +{ + std::vector childs; + auto else_loc = create_label(); + auto end_loc = create_label(); + + if(stmt->expr.as_node->type == gsc::node_t::expr_not) + { + emit_expr(ctx, stmt->expr.as_not->rvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrue, else_loc); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, else_loc); + } + + ctx->transfer(stmt->ctx_if); + stmt->ctx_if->is_last = last; + + emit_stmt(stmt->ctx_if, stmt->stmt_if, last); + + emit_remove_local_vars(stmt->ctx_if); + + if(stmt->ctx_if->abort == abort_t::abort_none) + childs.push_back(stmt->ctx_if.get()); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_opcode(ctx, opcode::OP_jump, end_loc); + + insert_label(else_loc); + + ctx->transfer(stmt->ctx_else); + stmt->ctx_else->is_last = last; + + emit_stmt(stmt->ctx_else, stmt->stmt_else, last); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_remove_local_vars(stmt->ctx_else); + + if(stmt->ctx_else->abort == abort_t::abort_none) + childs.push_back(stmt->ctx_else.get()); + + insert_label(end_loc); + + ctx->init_from_child(childs); +} + +void compiler::emit_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = true; + can_continue_ = true; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + + auto begin_loc = insert_label(); + + bool const_cond = is_constant_condition(stmt->expr); + + if(!const_cond) + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + } + + emit_stmt(stmt->ctx, stmt->stmt, false); + + insert_label(continue_loc); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + + if(const_cond) + ctx->init_from_child(break_ctxs_); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = false; + can_continue_ = false; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + emit_stmt(ctx, stmt->pre_expr, false); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + ctx->transfer(stmt->ctx_post); + + auto begin_loc = insert_label(); + + bool const_cond = is_constant_condition(stmt->expr); + + if(!const_cond) + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + } + + can_break_ = true; + can_continue_ = true; + + emit_stmt(stmt->ctx, stmt->stmt, false); + + if(stmt->ctx->abort == abort_t::abort_none) + continue_ctxs_.push_back(stmt->ctx.get()); + + can_break_ = false; + can_continue_ = false; + + insert_label(continue_loc); + + stmt->ctx_post->init_from_child(continue_ctxs_); + + emit_stmt(stmt->ctx_post, stmt->post_expr, false); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + + if(const_cond) + ctx->init_from_child(break_ctxs_); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = false; + can_continue_ = false; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + emit_expr(ctx, stmt->array_expr); + emit_variable_ref(ctx, stmt->array, true); + emit_variable(ctx, stmt->array); + emit_opcode(ctx, opcode::OP_CallBuiltin1, "getfirstarraykey"); + emit_variable_ref(ctx, stmt->key_expr, true); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + + ctx->transfer(stmt->ctx_post); + + auto begin_loc = insert_label(); + + emit_variable(ctx, stmt->key_expr); + emit_opcode(ctx, opcode::OP_CallBuiltin1, "isdefined"); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + + can_break_ = true; + can_continue_ = true; + + emit_variable(stmt->ctx, stmt->key_expr); + emit_opcode(stmt->ctx, opcode::OP_EvalLocalArrayCached, variable_access_index(stmt->ctx, stmt->array.as_name)); + emit_variable_ref(stmt->ctx, stmt->value_expr, true); + emit_stmt(stmt->ctx, stmt->stmt, false); + + if(stmt->ctx->abort == abort_t::abort_none) + continue_ctxs_.push_back(stmt->ctx.get()); + + can_break_ = false; + can_continue_ = false; + + insert_label(continue_loc); + + stmt->ctx_post->init_from_child(continue_ctxs_); + + emit_variable(stmt->ctx_post, stmt->key_expr); + emit_variable(stmt->ctx_post, stmt->array); + emit_opcode(stmt->ctx_post, opcode::OP_CallBuiltin2, "getnextarraykey"); + emit_variable_ref(stmt->ctx_post, stmt->key_expr, true); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + emit_clear_local_variable(ctx, stmt->array.as_name); + if(!stmt->use_key) emit_clear_local_variable(ctx, stmt->key_expr.as_name); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_break = can_break_; + break_ctxs_.clear(); + can_break_ = false; + + auto jmptable_loc = create_label(); + auto break_loc = create_label(); + + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_switch, jmptable_loc); + + can_break_ = true; + + std::vector data; + data.push_back(utils::string::va("%d", stmt->stmt->stmts.size())); + + bool has_default = false; + gsc::context* default_ctx = nullptr; + + for(auto i = 0; i < stmt->stmt->stmts.size(); i++) + { + auto& entry = stmt->stmt->stmts[i]; + + if(entry.as_node->type == gsc::node_t::stmt_case) + { + auto& case_ = entry.as_case; + if(case_->value.as_node->type == gsc::node_t::data_integer) + { + auto loc = insert_label(); + data.push_back("case"); + data.push_back(case_->value.as_integer->value); + data.push_back(loc); + } + else if(case_->value.as_node->type == gsc::node_t::data_string) + { + auto loc = insert_label(); + data.push_back("case"); + data.push_back(case_->value.as_string->value); + data.push_back(loc); + } + else + { + throw gsc::comp_error(stmt->loc, "case type must be int or string"); + } + + ctx->transfer(case_->ctx); + case_->ctx->loc_break = break_loc; + emit_stmt_list(case_->ctx, case_->stmt, false); + if(case_->stmt->stmts.size() > 0) + emit_remove_local_vars(case_->ctx); + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + auto loc = insert_label(); + data.push_back("default"); + data.push_back(loc); + + has_default = true; + default_ctx = entry.as_default->ctx.get(); + + ctx->transfer(entry.as_default->ctx); + entry.as_default->ctx->loc_break = break_loc; + emit_stmt_list(entry.as_default->ctx, entry.as_default->stmt, false); + if(entry.as_default->stmt->stmts.size() > 0) + emit_remove_local_vars(entry.as_default->ctx); + } + else + { + throw gsc::comp_error(entry.as_node->loc, "missing case statement"); + } + } + + if(has_default) + { + if(default_ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(default_ctx); + } + ctx->init_from_child(break_ctxs_); + } + + insert_label(jmptable_loc); + + emit_opcode(ctx, opcode::OP_endswitch, data); + + auto offset = 7 * stmt->stmt->stmts.size(); + function_->instructions.back()->size += offset; + index_ += offset; + + insert_label(break_loc); + + can_break_ = old_break; + break_ctxs_ = old_breaks; +} + +void compiler::emit_stmt_case(const gsc::context_ptr& ctx, const gsc::stmt_case_ptr& stmt) +{ + throw gsc::comp_error(stmt->loc, "illegal case statement"); +} + +void compiler::emit_stmt_default(const gsc::context_ptr& ctx, const gsc::stmt_default_ptr& stmt) +{ + throw gsc::comp_error(stmt->loc, "illegal default statement"); +} + +void compiler::emit_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + if(can_break_ && ctx->abort == abort_t::abort_none && ctx->loc_break != "") + { + break_ctxs_.push_back(ctx.get()); + emit_remove_local_vars(ctx); + ctx->abort = abort_t::abort_break; + emit_opcode(ctx, opcode::OP_jump, ctx->loc_break); + } + else + { + throw gsc::comp_error(stmt->loc, "illegal break statement"); + } +} + +void compiler::emit_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt) +{ + if(can_break_ && ctx->abort == abort_t::abort_none && ctx->loc_continue != "") + { + continue_ctxs_.push_back(ctx.get()); + emit_remove_local_vars(ctx); + ctx->abort = abort_t::abort_continue; + emit_opcode(ctx, opcode::OP_jump, ctx->loc_continue); + } + else + { + throw gsc::comp_error(stmt->loc, "illegal continue statement"); + } +} + +void compiler::emit_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + ctx->abort = abort_t::abort_return; + } + + if(stmt->expr.as_node->type == gsc::node_t::null) + { + emit_opcode(ctx, opcode::OP_End); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_Return); + } +} + +void compiler::emit_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_and: emit_expr_and(ctx, expr.as_and); break; + case gsc::node_t::expr_or: emit_expr_or(ctx, expr.as_or); break; + case gsc::node_t::expr_equality: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_inequality: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less_equal: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater_equal: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_or: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_and: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_exor: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_left: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_right: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_add: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_sub: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mult: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_div: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mod: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_complement: emit_expr_complement(ctx, expr.as_complement); break; + case gsc::node_t::expr_not: emit_expr_not(ctx, expr.as_not); break; + case gsc::node_t::expr_call: emit_expr_call(ctx, expr.as_call); break; + case gsc::node_t::expr_function: emit_expr_function(ctx, expr.as_function); break; + case gsc::node_t::expr_add_array: emit_expr_add_array(ctx, expr.as_add_array); break; + case gsc::node_t::expr_array: emit_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: emit_field_variable(ctx, expr.as_field); break; + case gsc::node_t::expr_size: emit_expr_size(ctx, expr.as_size); break; + case gsc::node_t::data_thisthread: emit_opcode(ctx, opcode::OP_GetThisthread); break; + case gsc::node_t::data_empty_array: emit_opcode(ctx, opcode::OP_EmptyArray); break; + case gsc::node_t::data_undefined: emit_opcode(ctx, opcode::OP_GetUndefined); break; + case gsc::node_t::data_game: emit_opcode(ctx, opcode::OP_GetGame); break; + case gsc::node_t::data_self: emit_opcode(ctx, opcode::OP_GetSelf); break; + case gsc::node_t::data_anim: emit_opcode(ctx, opcode::OP_GetAnim); break; + case gsc::node_t::data_level: emit_opcode(ctx, opcode::OP_GetLevel); break; + case gsc::node_t::data_animation: emit_animation(ctx, expr.as_animation); break; + case gsc::node_t::data_animtree: emit_animtree(ctx, expr.as_animtree); break; + case gsc::node_t::data_name: emit_local_variable(ctx, expr.as_name); break; + case gsc::node_t::data_istring: emit_istring(ctx, expr.as_istring); break; + case gsc::node_t::data_string: emit_string(ctx, expr.as_string); break; + case gsc::node_t::data_vector: emit_vector(ctx, expr.as_vector); break; + case gsc::node_t::data_float: emit_float(ctx, expr.as_float); break; + case gsc::node_t::data_integer: emit_integer(ctx, expr.as_integer); break; + case gsc::node_t::data_false: emit_false(ctx, expr.as_false); break; + case gsc::node_t::data_true: emit_true(ctx, expr.as_true); break; + default: throw gsc::comp_error(expr.as_node->loc, "unknown expression"); break; + } +} + +void compiler::emit_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr) +{ + if(expr->type == gsc::node_t::expr_increment) + { + emit_variable_ref(ctx, expr->lvalue, false); + emit_opcode(ctx, opcode::OP_inc); + emit_opcode(ctx, opcode::OP_SetVariableField); + } + else if(expr->type == gsc::node_t::expr_decrement) + { + emit_variable_ref(ctx, expr->lvalue, false); + emit_opcode(ctx, opcode::OP_dec); + emit_opcode(ctx, opcode::OP_SetVariableField); + } + else if(expr->type == gsc::node_t::expr_assign_equal) + { + if(expr->rvalue.as_node->type == gsc::node_t::data_undefined) + { + emit_expr_clear_variable(ctx, expr->lvalue); + } + else + { + emit_expr(ctx, expr->rvalue); + emit_variable_ref(ctx, expr->lvalue, true); + } + } + else + { + emit_expr(ctx, expr->lvalue); + emit_expr(ctx, expr->rvalue); + + switch(expr->type) + { + case gsc::node_t::expr_assign_add: emit_opcode(ctx, opcode::OP_plus); break; + case gsc::node_t::expr_assign_sub: emit_opcode(ctx, opcode::OP_minus); break; + case gsc::node_t::expr_assign_mult: emit_opcode(ctx, opcode::OP_multiply); break; + case gsc::node_t::expr_assign_div: emit_opcode(ctx, opcode::OP_divide); break; + case gsc::node_t::expr_assign_mod: emit_opcode(ctx, opcode::OP_mod); break; + case gsc::node_t::expr_assign_shift_left: emit_opcode(ctx, opcode::OP_shift_left); break; + case gsc::node_t::expr_assign_shift_right: emit_opcode(ctx, opcode::OP_shift_right); break; + case gsc::node_t::expr_assign_bitwise_or: emit_opcode(ctx, opcode::OP_bit_or); break; + case gsc::node_t::expr_assign_bitwise_and: emit_opcode(ctx, opcode::OP_bit_and); break; + case gsc::node_t::expr_assign_bitwise_exor: emit_opcode(ctx, opcode::OP_bit_ex_or); break; + default: throw gsc::comp_error(expr->loc, "unknown assign operation"); break; + } + + emit_variable_ref(ctx, expr->lvalue, true); + } +} + +void compiler::emit_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr) +{ + emit_expr(ctx, expr->lvalue); + emit_expr(ctx, expr->rvalue); + + switch(expr->type) + { + case gsc::node_t::expr_equality: emit_opcode(ctx, opcode::OP_equality); break; + case gsc::node_t::expr_inequality: emit_opcode(ctx, opcode::OP_inequality); break; + case gsc::node_t::expr_less: emit_opcode(ctx, opcode::OP_less); break; + case gsc::node_t::expr_greater: emit_opcode(ctx, opcode::OP_greater); break; + case gsc::node_t::expr_less_equal: emit_opcode(ctx, opcode::OP_less_equal); break; + case gsc::node_t::expr_greater_equal: emit_opcode(ctx, opcode::OP_greater_equal); break; + case gsc::node_t::expr_bitwise_or: emit_opcode(ctx, opcode::OP_bit_or); break; + case gsc::node_t::expr_bitwise_and: emit_opcode(ctx, opcode::OP_bit_and); break; + case gsc::node_t::expr_bitwise_exor: emit_opcode(ctx, opcode::OP_bit_ex_or); break; + case gsc::node_t::expr_shift_left: emit_opcode(ctx, opcode::OP_shift_left); break; + case gsc::node_t::expr_shift_right: emit_opcode(ctx, opcode::OP_shift_right); break; + case gsc::node_t::expr_add: emit_opcode(ctx, opcode::OP_plus); break; + case gsc::node_t::expr_sub: emit_opcode(ctx, opcode::OP_minus); break; + case gsc::node_t::expr_mult: emit_opcode(ctx, opcode::OP_multiply); break; + case gsc::node_t::expr_div: emit_opcode(ctx, opcode::OP_divide); break; + case gsc::node_t::expr_mod: emit_opcode(ctx, opcode::OP_mod); break; + default: throw gsc::comp_error(expr->loc, "unknown binary expression"); break; + } +} + +void compiler::emit_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr) +{ + auto label = create_label(); + + emit_expr(ctx, expr->lvalue); + emit_opcode(ctx, opcode::OP_JumpOnFalseExpr, label); + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_CastBool); + + insert_label(label); +} + +void compiler::emit_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr) +{ + auto label = create_label(); + + emit_expr(ctx, expr->lvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrueExpr, label); + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_CastBool); + + insert_label(label); +} + +void compiler::emit_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr) +{ + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_BoolComplement); +} + +void compiler::emit_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr) +{ + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_BoolNot); +} + +void compiler::emit_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + if(expr->func.as_node->type == gsc::node_t::expr_call_pointer) + { + emit_expr_call_pointer(ctx, expr); + } + else + { + emit_expr_call_function(ctx, expr); + } +} + +void compiler::emit_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + bool thread = expr->thread; + bool child = expr->child; + bool method = expr->obj.as_node->type != gsc::node_t::null ? true : false; + bool builtin = builtin = expr->func.as_pointer->builtin; + std::uint32_t args = expr->func.as_pointer->args->list.size(); + + if(thread && child || thread && builtin || child && builtin) + throw gsc::comp_error(expr->loc, "function call have more than 1 type (thread, childthread, builtin)"); + + if(!thread && !child && !builtin) emit_opcode(ctx, opcode::OP_PreScriptCall); + + emit_expr_arguments(ctx, expr->func.as_pointer->args); + + if(method) emit_expr(ctx, expr->obj); + + emit_expr(ctx, expr->func.as_pointer->expr); + emit_expr_call_pointer_type(ctx, args, builtin, method, thread, child); +} + +void compiler::emit_expr_call_pointer_type(const gsc::context_ptr& ctx, int args, bool builtin, bool method, bool thread, bool child) +{ + if(builtin && !method) + { + emit_opcode(ctx, opcode::OP_CallBuiltinPointer, utils::string::va("%d", args)); + } + else if(builtin && method) + { + emit_opcode(ctx, opcode::OP_CallBuiltinMethodPointer, utils::string::va("%d", args)); + } + else if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptThreadCallPointer, utils::string::va("%d", args)); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptMethodThreadCallPointer, utils::string::va("%d", args)); + } + else if (child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptChildThreadCallPointer, utils::string::va("%d", args)); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptMethodChildThreadCallPointer, utils::string::va("%d", args)); + } + else + { + method ? emit_opcode(ctx, opcode::OP_ScriptMethodCallPointer) : emit_opcode(ctx, opcode::OP_ScriptFunctionCallPointer); + } +} + +void compiler::emit_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + bool thread = expr->thread; + bool child = expr->child; + bool method = expr->obj.as_node->type != gsc::node_t::null ? true : false; + std::uint32_t args = expr->func.as_func->args->list.size(); + auto name = expr->func.as_func->name->value; + auto file = expr->func.as_func->file->value; + + bool builtin = false, far = false, local = false; + + if(file != "") far = true; + else + { + if(is_local_call(name)) local = true; + else if(method && is_builtin_method(name)) builtin = true; + else if(!method && is_builtin_func(name)) builtin = true; + else + { + for(const auto& inc : includes_) + { + for(const auto& fun : inc.funcs) + { + if(name == fun) + { + far = true; + file = inc.name; + break; + } + } + } + + if(!builtin && !far && !local) + throw gsc::comp_error(expr->loc, "unknown function call " + name); + } + } + + if(thread && child || thread && builtin || child && builtin) + throw gsc::comp_error(expr->loc, "function call have more than 1 type (thread, childthread, builtin)"); + + if(!thread && !child && !builtin && !(!method && args == 0)) + emit_opcode(ctx, opcode::OP_PreScriptCall); + + emit_expr_arguments(ctx, expr->func.as_func->args); + + if(method) emit_expr(ctx, expr->obj); + + if(builtin) emit_expr_call_function_builtin(ctx, name, args, method); + else if(local) emit_expr_call_function_local(ctx, name, args, method, thread, child); + else if(far) emit_expr_call_function_far(ctx, file, name, args, method, thread, child); +} + +void compiler::emit_expr_call_function_builtin(const gsc::context_ptr& ctx, const std::string& func, int args, bool method) +{ + if(method) + { + switch(args) + { + case 0: emit_opcode(ctx, opcode::OP_CallBuiltinMethod0, func); break; + case 1: emit_opcode(ctx, opcode::OP_CallBuiltinMethod1, func); break; + case 2: emit_opcode(ctx, opcode::OP_CallBuiltinMethod2, func); break; + case 3: emit_opcode(ctx, opcode::OP_CallBuiltinMethod3, func); break; + case 4: emit_opcode(ctx, opcode::OP_CallBuiltinMethod4, func); break; + case 5: emit_opcode(ctx, opcode::OP_CallBuiltinMethod5, func); break; + default: emit_opcode(ctx, opcode::OP_CallBuiltinMethod, { utils::string::va("%d", args), func }); break; + } + } + else + { + switch(args) + { + case 0: emit_opcode(ctx, opcode::OP_CallBuiltin0, func); break; + case 1: emit_opcode(ctx, opcode::OP_CallBuiltin1, func); break; + case 2: emit_opcode(ctx, opcode::OP_CallBuiltin2, func); break; + case 3: emit_opcode(ctx, opcode::OP_CallBuiltin3, func); break; + case 4: emit_opcode(ctx, opcode::OP_CallBuiltin4, func); break; + case 5: emit_opcode(ctx, opcode::OP_CallBuiltin5, func); break; + default: emit_opcode(ctx, opcode::OP_CallBuiltin, { utils::string::va("%d", args), func }); break; + } + } +} + +void compiler::emit_expr_call_function_local(const gsc::context_ptr& ctx, const std::string& func, int args, bool method, bool thread, bool child) +{ + if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalThreadCall, { func, utils::string::va("%d", args) }); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodThreadCall, { func, utils::string::va("%d", args) }); + } + else if(child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptLocalChildThreadCall, { func, utils::string::va("%d", args) }); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodChildThreadCall, { func, utils::string::va("%d", args) }); + } + else if(method && !thread && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodCall, func); + } + else if(!thread && !child && !method && args == 0) + { + emit_opcode(ctx, opcode::OP_ScriptLocalFunctionCall2, func); + } + else if(!thread && !child && !method && args != 0) + { + emit_opcode(ctx, opcode::OP_ScriptLocalFunctionCall, func); + } +} + +void compiler::emit_expr_call_function_far(const gsc::context_ptr& ctx, const std::string& file, const std::string& func, int args, bool method, bool thread, bool child) +{ + if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptFarThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptFarChildThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodChildThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(!thread && !child && method) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodCall, { file, func }); + } + else if(!thread && !child && !method && args == 0) + { + emit_opcode(ctx, opcode::OP_ScriptFarFunctionCall2, { file, func }); + } + else if(!thread && !child && !method && args != 0) + { + emit_opcode(ctx, opcode::OP_ScriptFarFunctionCall, { file, func }); + } +} + +void compiler::emit_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& args) +{ + std::reverse(args->list.begin(), args->list.end()); + + for(auto& arg : args->list) + { + emit_expr(ctx, arg); + } +} + +void compiler::emit_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& expr) +{ + bool far = false, local = false, builtin = false, method = false; + auto name = expr->name->value; + auto file = expr->file->value; + + if(file != "") + { + far = true; + } + else if(is_builtin_method(name)) + { + builtin = true; + method = true; + } + else if(is_builtin_func(name)) + { + builtin = true; + } + else if(is_local_call(name)) + { + local = true; + } + + if(local) + { + emit_opcode(ctx, opcode::OP_GetLocalFunction, name); + } + else if(far) + { + emit_opcode(ctx, opcode::OP_GetFarFunction, { file, name } ); + } + else if(builtin && method) + { + emit_opcode(ctx, opcode::OP_GetBuiltinMethod, name); + } + else if(builtin && !method) + { + emit_opcode(ctx, opcode::OP_GetBuiltinFunction, name); + } +} + +void compiler::emit_expr_clear_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& lvalue) +{ + switch(lvalue.as_node->type) + { + case gsc::node_t::expr_array: + emit_expr(ctx, lvalue.as_array->key); + lvalue.as_array->obj.as_node->type == gsc::node_t::data_game ? emit_opcode(ctx, opcode::OP_GetGameRef) : emit_variable_ref(ctx, lvalue.as_array->obj, false); + emit_opcode(ctx, opcode::OP_ClearArray); + break; + case gsc::node_t::expr_field: + emit_object(ctx, lvalue.as_field->obj); + emit_opcode(ctx, opcode::OP_ClearFieldVariable,lvalue.as_field->field->value); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_GetUndefined); + emit_local_variable_ref(ctx, lvalue.as_name, true); + break; + default: + throw gsc::comp_error(lvalue.as_node->loc, "unknown clear variable lvalue"); + break; + } +} + +void compiler::emit_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr) +{ + if(expr->args->list.size() <= 0) + { + throw gsc::comp_error(expr->loc, "invalid empty add array. did u mean '[]' ?"); + } + + emit_opcode(ctx, opcode::OP_EmptyArray); + + for(const auto& arg : expr->args->list) + { + emit_expr(ctx, arg); + emit_opcode(ctx, opcode::OP_AddArray); + } +} + +void compiler::emit_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr) +{ + emit_variable(ctx, expr->obj); + emit_opcode(ctx, opcode::OP_size); +} + +void compiler::emit_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr, bool set) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_array: emit_array_variable_ref(ctx, expr.as_array, set); break; + case gsc::node_t::expr_field: emit_field_variable_ref(ctx, expr.as_field, set); break; + case gsc::node_t::data_name: emit_local_variable_ref(ctx, expr.as_name, set); break; + default: throw gsc::comp_error(expr.as_node->loc, "invalid variable reference type."); break; + } +} + +void compiler::emit_array_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr, bool set) +{ + emit_expr(ctx, expr->key); + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_game: + emit_opcode(ctx, opcode::OP_GetGameRef); + emit_opcode(ctx, opcode::OP_EvalArrayRef); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_array: + case gsc::node_t::expr_field: + emit_variable_ref(ctx, expr->obj, false); + emit_opcode(ctx, opcode::OP_EvalArrayRef); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::data_name: + { + if(!variable_initialized(ctx, expr->obj.as_name)) + { + initialize_variable(ctx, expr->obj.as_name); + emit_opcode(ctx, opcode::OP_EvalNewLocalArrayRefCached0, variable_create_index(ctx, expr->obj.as_name)); + + if(!set) + { + throw gsc::comp_error(expr->loc, "INTERNAL: VAR CREATED BUT NOT SET!"); + } + } + else if(variable_stack_index(ctx, expr->obj.as_name) == 0) + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayRefCached0); + } + else + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayRefCached, variable_access_index(ctx, expr->obj.as_name)); + } + + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + } + break; + case gsc::node_t::expr_call: + throw gsc::comp_error(expr->loc, "call result can't be referenced."); + break; + default: + throw gsc::comp_error(expr->loc, "unknown array object type"); + break; + } +} + +void compiler::emit_field_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr, bool set) +{ + const auto& field = expr->field->value; + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_level: + set ? emit_opcode(ctx, opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalLevelFieldVariableRef, field); + break; + case gsc::node_t::data_anim: + set ? emit_opcode(ctx, opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalAnimFieldVariableRef, field); + break; + case gsc::node_t::data_self: + set ? emit_opcode(ctx, opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalSelfFieldVariableRef, field); + break; + case gsc::node_t::expr_array: + emit_array_variable(ctx, expr->obj.as_array); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_field: + emit_field_variable(ctx, expr->obj.as_field); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr->obj.as_name)); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_call: + throw gsc::comp_error(expr->loc, "function call result can't be referenced"); + break; + default: + throw gsc::comp_error(expr->loc, "unknown field variable object type"); + break; + } +} + +void compiler::emit_local_variable_ref(const gsc::context_ptr& ctx, const gsc::name_ptr& expr, bool set) +{ + const auto itr = constants_.find(expr->value); + + if (itr != constants_.end()) + { + throw gsc::comp_error(expr->loc, "variable name already defined as constant " + expr->value); + } + + if(set) + { + if(!variable_initialized(ctx, expr)) + { + initialize_variable(ctx, expr); + emit_opcode(ctx, opcode::OP_SetNewLocalVariableFieldCached0, variable_create_index(ctx, expr)); + } + else if(variable_stack_index(ctx, expr) == 0) + { + emit_opcode(ctx, opcode::OP_SetLocalVariableFieldCached0); + } + else + { + emit_opcode(ctx, opcode::OP_SetLocalVariableFieldCached, variable_access_index(ctx, expr)); + } + } + else + { + auto index = variable_stack_index(ctx, expr); + + if(index == 0) + emit_opcode(ctx, opcode::OP_EvalLocalVariableRefCached0); + else + emit_opcode(ctx, opcode::OP_EvalLocalVariableRefCached, variable_access_index(ctx, expr)); + } +} + +void compiler::emit_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + // for obj.size + switch(expr.as_node->type) + { + case gsc::node_t::expr_array: emit_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: emit_field_variable(ctx, expr.as_field); break; + case gsc::node_t::data_name: emit_local_variable(ctx, expr.as_name); break; + case gsc::node_t::expr_call: emit_expr_call(ctx, expr.as_call); break; + default: throw gsc::comp_error(expr.as_node->loc, "invalid variable type."); break; + } +} + +void compiler::emit_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr) +{ + emit_expr(ctx, expr->key); + + if(expr->obj.as_node->type == gsc::node_t::data_name) + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayCached, variable_access_index(ctx, expr->obj.as_name)); + } + else + { + emit_expr(ctx, expr->obj); + emit_opcode(ctx, opcode::OP_EvalArray); + } +} + +void compiler::emit_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr) +{ + const auto& field = expr->field->value; + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_level: + emit_opcode(ctx, opcode::OP_EvalLevelFieldVariable, field); + break; + case gsc::node_t::data_anim: + emit_opcode(ctx, opcode::OP_EvalAnimFieldVariable, field); + break; + case gsc::node_t::data_self: + emit_opcode(ctx, opcode::OP_EvalSelfFieldVariable, field); + break; + case gsc::node_t::expr_array: + emit_array_variable(ctx, expr->obj.as_array); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::expr_field: + emit_field_variable(ctx, expr->obj.as_field); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::expr_call: + emit_expr_call(ctx, expr->obj.as_call); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr->obj.as_name)); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + default: + throw gsc::comp_error(expr->loc, "unknown field variable object type"); + break; + } +} + +void compiler::emit_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + // is constant ( should only allow: string, loc string, number, vector) + const auto itr = constants_.find(expr->value); + + if (itr != constants_.end()) + { + const auto& value = itr->second; + emit_expr(ctx, value); + return; + } + + // is local var + auto index = variable_stack_index(ctx, expr); + + switch(index) + { + case 0: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached0); break; + case 1: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached1); break; + case 2: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached2); break; + case 3: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached3); break; + case 4: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached4); break; + case 5: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached5); break; + default: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached, variable_access_index(ctx, expr)); break; + } +} + +void compiler::emit_clear_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + auto index = variable_stack_index(ctx, expr); + + if(index == 0) + { + emit_opcode(ctx, opcode::OP_ClearLocalVariableFieldCached0); + } + else + { + emit_opcode(ctx, opcode::OP_ClearLocalVariableFieldCached, variable_access_index(ctx, expr)); + } +} + +void compiler::emit_create_local_vars(const gsc::context_ptr& ctx) +{ + if ( ctx->local_vars_create_count != ctx->local_vars_public_count ) + { + for(auto i = ctx->local_vars_create_count; i < ctx->local_vars_public_count; i++) + { + auto data = utils::string::va("%d", ctx->local_vars.at(i).create); + emit_opcode(ctx, opcode::OP_CreateLocalVariable, data); + ctx->local_vars.at(i).init = true; + } + ctx->local_vars_create_count = ctx->local_vars_public_count; + } +} + +void compiler::emit_remove_local_vars(const gsc::context_ptr& ctx) +{ + if(ctx->abort == abort_t::abort_none) + { + auto count = ctx->local_vars_create_count - ctx->local_vars_public_count; + + if(count > 0) + { + auto data = utils::string::va("%d", count); + emit_opcode(ctx, opcode::OP_RemoveLocalVariables, data); + } + } +} + +void compiler::emit_object(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + // need revision used for clear variable + switch(expr.as_node->type) + { + case gsc::node_t::data_level: + emit_opcode(ctx, opcode::OP_GetLevelObject); + break; + case gsc::node_t::data_anim: + emit_opcode(ctx, opcode::OP_GetAnimObject); + break; + case gsc::node_t::data_self: + emit_opcode(ctx, opcode::OP_GetSelfObject); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr.as_name)); + break; + case gsc::node_t::expr_call: + emit_expr_call(ctx, expr.as_call); + emit_opcode(ctx, opcode::OP_CastFieldObject); + break; + // array ? + // field ? + default: + throw gsc::comp_error(expr.as_node->loc, "unknown object type"); + break; + } +} + +void compiler::emit_animtree(const gsc::context_ptr& ctx, const gsc::animtree_ptr& animtree) +{ + if(animtrees_.size() == 0) + { + throw gsc::comp_error( animtree->loc, "trying to use animtree without specified using animtree"); + } + + auto& tree = animtrees_.back(); + + if(tree.loaded) + { + emit_opcode(ctx, opcode::OP_GetAnimTree, "''"); + } + else + { + emit_opcode(ctx, opcode::OP_GetAnimTree, tree.name); + tree.loaded = true; + } +} + +void compiler::emit_animation(const gsc::context_ptr& ctx, const gsc::animation_ptr& animation) +{ + if(animtrees_.size() == 0) + { + throw gsc::comp_error(animation->loc, "trying to use animation without specified using animtree"); + } + + auto& tree = animtrees_.back(); + + if(tree.loaded) + { + emit_opcode(ctx, opcode::OP_GetAnimation, { "''", animation->value }); + } + else + { + emit_opcode(ctx, opcode::OP_GetAnimation, { tree.name, animation->value }); + tree.loaded = true; + } +} + +void compiler::emit_istring(const gsc::context_ptr& ctx, const gsc::istring_ptr& str) +{ + emit_opcode(ctx, opcode::OP_GetIString, str->value); +} + +void compiler::emit_string(const gsc::context_ptr& ctx, const gsc::string_ptr& str) +{ + emit_opcode(ctx, opcode::OP_GetString, str->value); +} + +void compiler::emit_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec) +{ + std::vector data; + + bool expr = false; + + if(vec->x.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->x.as_integer->value); + else if(vec->x.as_node->type == gsc::node_t::data_float) + data.push_back(vec->x.as_float->value); + else expr = true; + + if(vec->y.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->y.as_integer->value); + else if(vec->y.as_node->type == gsc::node_t::data_float) + data.push_back(vec->y.as_float->value); + else expr = true; + + if(vec->z.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->z.as_integer->value); + else if(vec->z.as_node->type == gsc::node_t::data_float) + data.push_back(vec->z.as_float->value); + else expr = true; + + if(!expr) + { + emit_opcode(ctx, opcode::OP_GetVector, data); + } + else + { + emit_expr(ctx, vec->z); + emit_expr(ctx, vec->y); + emit_expr(ctx, vec->x); + emit_opcode(ctx, opcode::OP_vector); + } +} + +void compiler::emit_float(const gsc::context_ptr& ctx, const gsc::float_ptr& num) +{ + emit_opcode(ctx, opcode::OP_GetFloat, num->value); +} + +void compiler::emit_integer(const gsc::context_ptr& ctx, const gsc::integer_ptr& num) +{ + auto value = std::atoi(num->value.data()); + + if(value == 0) + { + emit_opcode(ctx, opcode::OP_GetZero); + } + else if(value > 0 && value < 256) + { + emit_opcode(ctx, opcode::OP_GetByte, num->value); + } + else if(value < 0 && value > -256) + { + emit_opcode(ctx, opcode::OP_GetNegByte, num->value.substr(1)); + } + else if(value < 65536) + { + emit_opcode(ctx, opcode::OP_GetUnsignedShort, num->value); + } + else if(value < 0 && value > -65536) + { + emit_opcode(ctx, opcode::OP_GetNegUnsignedShort, num->value.substr(1)); + } + else + { + emit_opcode(ctx, opcode::OP_GetInteger, num->value); + } +} + +void compiler::emit_false(const gsc::context_ptr& ctx, const gsc::false_ptr& expr) +{ + emit_opcode(ctx, opcode::OP_GetZero); +} + +void compiler::emit_true(const gsc::context_ptr& ctx, const gsc::true_ptr& expr) +{ + emit_opcode(ctx, opcode::OP_GetByte, "1"); +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + + index_ += inst->size; +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::string& data) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + inst->data.push_back(data); + + index_ += inst->size; +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::vector& data) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + inst->data = data; + + index_ += inst->size; +} + +void compiler::process_thread(const gsc::context_ptr& ctx, const gsc::thread_ptr& thread) +{ + process_parameters(ctx, thread->params); + process_stmt_list(ctx, thread->block); +} + +void compiler::process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + register_variable(ctx, param->value); + } +} + +void compiler::process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt) +{ + switch (stmt.as_node->type) + { + case gsc::node_t::stmt_list: process_stmt_list(ctx, stmt.as_list); break; + case gsc::node_t::stmt_assign: process_expr(ctx, stmt.as_assign->expr->lvalue); break; + case gsc::node_t::stmt_waittill: process_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_if: process_stmt_if(ctx, stmt.as_if); break; + case gsc::node_t::stmt_ifelse: process_stmt_ifelse(ctx, stmt.as_ifelse); break; + case gsc::node_t::stmt_while: process_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: process_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: process_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: process_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_break: process_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_continue: process_stmt_continue(ctx, stmt.as_continue); break; + case gsc::node_t::stmt_return: process_stmt_return(ctx, stmt.as_return); break; + default: break; + } +} + +void compiler::process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + for (const auto& entry : stmt->stmts) + { + process_stmt(ctx, entry); + } +} + +void compiler::process_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + if(expr.as_node->type == gsc::node_t::data_name) + { + register_variable(ctx, expr.as_name->value); + } + else if(expr.as_node->type == gsc::node_t::expr_array) + { + process_expr(ctx, expr.as_array->obj); + } +} + +void compiler::process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + register_variable(ctx, arg.as_name->value); + } + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); +} + +void compiler::process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt) +{ + stmt->ctx = std::make_unique(); + + ctx->copy(stmt->ctx); + process_stmt(stmt->ctx, stmt->stmt); + + std::vector childs({ stmt->ctx.get() }); + ctx->merge(childs); +} + +void compiler::process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt) +{ + std::vector childs; + auto abort = abort_t::abort_return; + + stmt->ctx_if = std::make_unique(); + stmt->ctx_else = std::make_unique(); + + ctx->copy(stmt->ctx_if); + process_stmt(stmt->ctx_if, stmt->stmt_if); + + if(stmt->ctx_if->abort <= abort_t::abort_return) + { + abort = stmt->ctx_if->abort; + if(abort == abort_t::abort_none) + childs.push_back(stmt->ctx_if.get()); + } + + ctx->copy(stmt->ctx_else); + process_stmt(stmt->ctx_else, stmt->stmt_else); + + if(stmt->ctx_else->abort <= abort) + { + abort = stmt->ctx_else->abort; + if(abort == abort_t::abort_none) + childs.push_back(stmt->ctx_else.get()); + } + + if(ctx->abort == abort_t::abort_none) + ctx->abort = abort; + + ctx->append(childs); + ctx->merge(childs); +} + +void compiler::process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + bool const_cond = is_constant_condition(stmt->expr); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + stmt->ctx = std::make_unique(); + + ctx->copy(stmt->ctx); + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + if(const_cond) ctx->append(break_ctxs_); + + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + bool const_cond = is_constant_condition(stmt->expr); + + stmt->ctx = std::make_unique(); + stmt->ctx_post = std::make_unique(); + + process_stmt(ctx, stmt->pre_expr); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + ctx->copy(stmt->ctx); + ctx->copy(stmt->ctx_post); + + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + process_stmt(stmt->ctx_post, stmt->post_expr); + + ctx->append({ stmt->ctx_post.get() }); + ctx->merge({ stmt->ctx_post.get() }); + + if(const_cond) ctx->append(break_ctxs_); + + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + auto array_name = utils::string::va("temp_%d", ++label_idx_); + auto key_name = utils::string::va("temp_%d", ++label_idx_); + + stmt->array = expr_ptr(std::make_unique(stmt->loc, array_name)); + + if(!stmt->use_key) + stmt->key_expr = expr_ptr(std::make_unique(stmt->loc, key_name)); + + key_name = stmt->key_expr.as_name->value; + + // calculate variables + + stmt->ctx = std::make_unique(); + stmt->ctx_post = std::make_unique(); + + // calculate pre_expr variables + process_expr(ctx, stmt->array); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + ctx->copy(stmt->ctx); + ctx->copy(stmt->ctx_post); + + // calculate stmt variables & add missing array access as first stmt + process_expr(stmt->ctx, stmt->value_expr); + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + process_expr(stmt->ctx_post, stmt->key_expr); + + ctx->append({ stmt->ctx_post.get() }); + ctx->merge({ stmt->ctx_post.get() }); + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + auto stmt_list = std::make_unique(stmt->stmt->loc); + auto current_case = gsc::stmt_ptr(std::make_unique()); + + auto num = stmt->stmt->stmts.size(); + + for(auto i = 0; i < num; i++) + { + auto& entry = stmt->stmt->stmts[0]; + + if(entry.as_node->type == gsc::node_t::stmt_case || entry.as_node->type == gsc::node_t::stmt_default) + { + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + current_case = std::move(stmt->stmt->stmts[0]); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + else + { + if(current_case.as_node->type != gsc::node_t::null) + { + if(current_case.as_node->type == gsc::node_t::stmt_case) + { + current_case.as_case->stmt->stmts.push_back(std::move(entry)); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + else + { + current_case.as_default->stmt->stmts.push_back(std::move(entry)); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + } + else + { + gsc::comp_error(entry.as_node->loc, "missing case statement"); + } + } + } + + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + // calculate variables + stmt->ctx = std::make_unique(); + std::vector childs; + auto abort = abort_t::abort_return; + bool has_default = false; + gsc::context* default_ctx = nullptr; + auto old_breaks = break_ctxs_; + break_ctxs_.clear(); + + for(auto i = 0; i < stmt_list->stmts.size(); i++) + { + auto& entry = stmt_list->stmts[i]; + + if(entry.as_node->type == gsc::node_t::stmt_case) + { + entry.as_case->ctx = std::make_unique(); + ctx->copy(entry.as_case->ctx); + process_stmt_list(entry.as_case->ctx, entry.as_case->stmt); + + if (entry.as_case->ctx->abort != abort_t::abort_none) + { + if (entry.as_case->ctx->abort == abort_t::abort_break ) + { + entry.as_case->ctx->abort = abort_t::abort_none; + abort = abort_t::abort_none; + childs.push_back(entry.as_case->ctx.get()); + } + else if (entry.as_case->ctx->abort <= abort ) + { + abort = entry.as_case->ctx->abort; + } + } + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + entry.as_default->ctx = std::make_unique(); + ctx->copy(entry.as_default->ctx); + process_stmt_list(entry.as_default->ctx, entry.as_default->stmt); + has_default = true; + default_ctx = entry.as_default->ctx.get(); + + if (entry.as_default->ctx->abort != abort_t::abort_none) + { + if (entry.as_default->ctx->abort == abort_t::abort_break ) + { + entry.as_default->ctx->abort = abort_t::abort_none; + abort = abort_t::abort_none; + childs.push_back(entry.as_default->ctx.get()); + } + else if (entry.as_default->ctx->abort <= abort ) + { + abort = entry.as_default->ctx->abort; + } + } + } + } + + stmt->stmt =std::move(stmt_list); + + if(has_default) + { + if(default_ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(default_ctx); + + if(ctx->abort == abort_t::abort_none) + ctx->abort = abort; + } + + ctx->append(break_ctxs_); + ctx->merge(childs); + } + + break_ctxs_ = old_breaks; +} + +void compiler::process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(ctx.get()); + ctx->abort = abort_t::abort_break; + } +} + +void compiler::process_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + continue_ctxs_.push_back(ctx.get()); + ctx->abort = abort_t::abort_continue; + } +} + +void compiler::process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + ctx->abort = abort_t::abort_return; + } +} + +void compiler::register_variable(const gsc::context_ptr& ctx, const std::string& name) +{ + auto it = std::find_if(ctx->local_vars.begin(), ctx->local_vars.end(), + [&](const gsc::local_var& v) { return v.name == name; }); + + if(it == ctx->local_vars.end()) + { + auto found = false; + for(std::size_t i = 0; i < local_stack_.size(); i++) + { + if(local_stack_[i] == name) + { + ctx->local_vars.push_back({ name, static_cast(i), false }); + found = true; + break; + } + } + + if(!found) + { + ctx->local_vars.push_back({ name, stack_idx_, false }); + local_stack_.push_back(name); + stack_idx_++; + } + } +} + +void compiler::initialize_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name) +{ + for(std::uint32_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(!ctx->local_vars[i].init) + { + for(std::uint32_t j = 0; j < i; j++) + { + if(!ctx->local_vars[j].init) + { + emit_opcode(ctx, opcode::OP_CreateLocalVariable, utils::string::va("%d", ctx->local_vars[j].create)); + ctx->local_vars[j].init = true; + //ctx->local_vars_create_count++; + } + } + ctx->local_vars[i].init = true; + ctx->local_vars_create_count = i + 1; + return; + } + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +void compiler::create_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name) +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + auto& var = ctx->local_vars.at(i); + if(var.name == name->value) + { + if(!var.init) + { + emit_opcode(ctx, opcode::OP_CreateLocalVariable, utils::string::va("%d", var.create)); + var.init = true; + ctx->local_vars_create_count++; + } + return; + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_stack_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::uint8_t +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(ctx->local_vars.at(i).init) + { + return ctx->local_vars_create_count - 1 - i; + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not initialized."); + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_create_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + return utils::string::va("%d", ctx->local_vars[i].create); + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_access_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(ctx->local_vars.at(i).init) + { + return utils::string::va("%d", ctx->local_vars_create_count - 1 - i); + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not initialized."); + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_initialized(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> bool +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + return ctx->local_vars.at(i).init; + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::is_local_call(const std::string& name) -> bool +{ + for(const auto& f : local_functions_) + { + if(f == name) return true; + } + + return false; +} + +auto compiler::is_builtin_call(const std::string& name) -> bool +{ + if(is_builtin_func(name)) return true; + + if(is_builtin_method(name)) return true; + + return false; +} + +auto compiler::is_builtin_func(const std::string& name) -> bool +{ + return resolver::find_function(name); +} +auto compiler::is_builtin_method(const std::string& name) -> bool +{ + return resolver::find_method(name); +} + +auto compiler::is_constant_condition(const gsc::expr_ptr& expr) -> bool +{ + switch(expr.as_node->type) + { + case gsc::node_t::null: + case gsc::node_t::data_true: + return true; + case gsc::node_t::data_false: + throw gsc::comp_error(expr.as_node->loc, "condition can't be always false!"); + case gsc::node_t::data_integer: + { + auto num = std::stoi(expr.as_integer->value); + if(num != 0) + return true; + else + throw gsc::comp_error(expr.as_node->loc, "condition can't be always false!"); + } + default: + break; + } + + return false; +} + +auto compiler::create_label() -> std::string +{ + label_idx_++; + auto name = utils::string::va("loc_%d", label_idx_); + return name; +} + +auto compiler::insert_label() -> std::string +{ + const auto itr = function_->labels.find(index_); + + if (itr != function_->labels.end()) + { + return itr->second; + } + else + { + label_idx_++; + auto name = utils::string::va("loc_%d", label_idx_); + function_->labels.insert({index_, name}); + return name; + } +} + +void compiler::insert_label(const std::string& name) +{ + const auto itr = function_->labels.find(index_); + + if (itr != function_->labels.end()) + { + for(auto& inst : function_->instructions) + { + switch (opcode(inst->opcode)) + { + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_jump: + case opcode::OP_jumpback: + case opcode::OP_switch: + if(inst->data[0] == name) + inst->data[0] = itr->second; + break; + case opcode::OP_endswitch: + default: + break; + } + } + } + else + { + function_->labels.insert({index_, name}); + } +} + +auto compiler::map_known_includes(const std::string& include) -> bool +{ + return false; +} + +} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/compiler.hpp b/src/h1/xsk/compiler.hpp new file mode 100644 index 00000000..cdf6c4c1 --- /dev/null +++ b/src/h1/xsk/compiler.hpp @@ -0,0 +1,146 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::h1 +{ + +enum class opcode : std::uint8_t; + +class compiler : public gsc::compiler +{ + std::string filename_; + std::vector assembly_; + gsc::function_ptr function_; + std::uint32_t index_; + std::uint32_t label_idx_; + std::uint8_t stack_idx_; + std::vector local_stack_; + std::vector local_functions_; + std::vector includes_; + std::vector animtrees_; + std::unordered_map constants_; + std::function(const std::string&)> callback_readf_; + std::vector break_ctxs_; + std::vector continue_ctxs_; + bool can_break_; + bool can_continue_; + +public: + auto output() -> std::vector; + void compile(const std::string& file, std::vector& data); + void set_readf_callback(std::function(const std::string&)> func); + +private: + auto parse_buffer(const std::string& file, std::vector& data) -> gsc::program_ptr; + auto parse_file(const std::string& file) -> gsc::program_ptr; + void compile_program(const gsc::program_ptr& program); + void emit_include(const gsc::include_ptr& include); + void emit_define(const gsc::define_ptr& define); + void emit_usingtree(const gsc::usingtree_ptr& animtree); + void emit_constant(const gsc::constant_ptr& constant); + void emit_thread(const gsc::thread_ptr& thread); + void emit_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void emit_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt, bool last); + void emit_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt, bool last); + void emit_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt); + void emit_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt); + void emit_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt); + void emit_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt); + void emit_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt); + void emit_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void emit_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt); + void emit_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt); + void emit_stmt_waitframe(const gsc::context_ptr& ctx, const gsc::stmt_waitframe_ptr& stmt); + void emit_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt, bool last); + void emit_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt, bool last); + void emit_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void emit_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void emit_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void emit_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void emit_stmt_case(const gsc::context_ptr& ctx, const gsc::stmt_case_ptr& stmt); + void emit_stmt_default(const gsc::context_ptr& ctx, const gsc::stmt_default_ptr& stmt); + void emit_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void emit_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt); + void emit_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void emit_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr); + void emit_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr); + void emit_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr); + void emit_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr); + void emit_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr); + void emit_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr); + void emit_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_pointer_type(const gsc::context_ptr& ctx, int args, bool builtin, bool method, bool thread, bool child); + void emit_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_function_builtin(const gsc::context_ptr& ctx, const std::string& func, int args, bool method); + void emit_expr_call_function_local(const gsc::context_ptr& ctx, const std::string& func, int args, bool method, bool thread, bool child); + void emit_expr_call_function_far(const gsc::context_ptr& ctx, const std::string& file, const std::string& func, int args, bool method, bool thread, bool child); + void emit_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& arg_list); + void emit_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& node); + void emit_expr_clear_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& lvalue); + void emit_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr); + void emit_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr); + void emit_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr, bool set); + void emit_array_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr, bool set); + void emit_field_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr, bool set); + void emit_local_variable_ref(const gsc::context_ptr& ctx, const gsc::name_ptr& expr, bool set); + void emit_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr); + void emit_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr); + void emit_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void emit_clear_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void emit_create_local_vars(const gsc::context_ptr& ctx); + void emit_remove_local_vars(const gsc::context_ptr& ctx); + void emit_object(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_animtree(const gsc::context_ptr& ctx, const gsc::animtree_ptr& animtree); + void emit_animation(const gsc::context_ptr& ctx, const gsc::animation_ptr& animation); + void emit_istring(const gsc::context_ptr& ctx, const gsc::istring_ptr& str); + void emit_string(const gsc::context_ptr& ctx, const gsc::string_ptr& str); + void emit_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec); + void emit_float(const gsc::context_ptr& ctx, const gsc::float_ptr& num); + void emit_integer(const gsc::context_ptr& ctx, const gsc::integer_ptr& num); + void emit_false(const gsc::context_ptr& ctx, const gsc::false_ptr& expr); + void emit_true(const gsc::context_ptr& ctx, const gsc::true_ptr& expr); + void emit_opcode(const gsc::context_ptr& ctx, opcode op); + void emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::string& data); + void emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::vector& data); + void process_thread(const gsc::context_ptr& ctx, const gsc::thread_ptr& thread); + void process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt); + void process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt); + void process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt); + void process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void process_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt); + void process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void register_variable(const gsc::context_ptr& ctx, const std::string& name); + void initialize_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name); + void create_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name); + auto variable_stack_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::uint8_t; + auto variable_create_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string; + auto variable_access_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string; + auto variable_initialized(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> bool; + auto is_local_call(const std::string& name) -> bool; + auto is_builtin_call(const std::string& name) -> bool; + auto is_builtin_func(const std::string& name) -> bool; + auto is_builtin_method(const std::string& name) -> bool; + auto is_constant_condition(const gsc::expr_ptr& expr) -> bool; + auto create_label() -> std::string; + auto insert_label() -> std::string; + void insert_label(const std::string& label); + + auto map_known_includes(const std::string& include) -> bool; +}; + +} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/decompiler.cpp b/src/h1/xsk/decompiler.cpp new file mode 100644 index 00000000..1c5057d3 --- /dev/null +++ b/src/h1/xsk/decompiler.cpp @@ -0,0 +1,3160 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "h1.hpp" + +namespace xsk::gsc::h1 +{ + +auto decompiler::output() -> std::vector +{ + std::vector output; + + auto data = std::make_unique(0x100000); + data->write_string("// H1 PC GSC\n// Decompiled by https://github.com/xensik/gsc-tool\n"); + data->write_string(program_->print()); + + output.resize(data->pos()); + std::memcpy(output.data(), data->buffer().data(), output.size()); + + return output; +} + +void decompiler::decompile(const std::string& file, std::vector& functions) +{ + filename_ = file; + program_ = std::make_unique(); + + for (auto& func : functions) + { + auto name = std::make_unique(func->name.substr(4)); + auto params = std::make_unique(); + auto block = std::make_unique(); + func_ = std::make_unique(std::move(name),std::move(params),std::move(block)); + + labels_ = func->labels; + expr_labels_.clear(); + stack_ = std::stack(); + + this->decompile_function(func); + + this->process_stack(func_); + + program_->definitions.push_back(gsc::define_ptr(std::move(func_))); + } +} + +void decompiler::decompile_function(const gsc::function_ptr& func) +{ + this->decompile_statements(func); + + if(stack_.size() > 0) + { + throw gsc::decomp_error("stack not emty at function end"); + } + + auto& block = func_->block; + + gsc::context ctx; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.back().as_node->loc.begin.line); + + // remove last return + block->stmts.pop_back(); + + // hotfix empty else block at func end + if(block->stmts.size() > 0 && block->stmts.back().as_node->type == gsc::node_t::asm_jump) + { + if(block->stmts.back().as_jump->value == ctx.loc_end) + block->stmts.pop_back(); + } + + blocks_.push_back(ctx); + this->decompile_block(block); + blocks_.pop_back(); +} + +void decompiler::decompile_statements(const gsc::function_ptr& func) +{ + std::uint32_t last_null_loc = 0; + + for (auto& inst : func->instructions) + { + auto loc = gsc::location(&filename_, inst->index); + + const auto itr = func->labels.find(inst->index); + + if (itr != func->labels.end()) + { + for(auto& entry : expr_labels_) + { + if(entry == itr->second) + { + decompile_expr(); + } + } + } + + switch (opcode(inst->opcode)) + { + case opcode::OP_End: + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::make_unique())); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_Return: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + auto stmt = gsc::stmt_ptr(std::make_unique(expr->loc, std::move(expr))); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_GetZero: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetByte: + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetInteger: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetNegByte: + case opcode::OP_GetNegUnsignedShort: + { + auto node = std::make_unique(loc, "-" + inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetFloat: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetVector: + { + auto x = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto y = gsc::expr_ptr(std::make_unique(loc, inst->data[1])); + auto z = gsc::expr_ptr(std::make_unique(loc, inst->data[2])); + auto node = std::make_unique(loc, std::move(x), std::move(y), std::move(z)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetString: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetIString: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetUndefined: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EmptyArray: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetLevel: + case opcode::OP_GetLevelObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnim: + case opcode::OP_GetAnimObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetSelf: + case opcode::OP_GetSelfObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetGame: + case opcode::OP_GetGameRef: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnimation: + { + auto tree = utils::string::unquote(inst->data[0]); + + if(tree != "") + { + auto treename = std::make_unique(loc, inst->data[0]); + auto animtree = std::make_unique(loc, std::move(treename)); + program_->definitions.push_back(gsc::define_ptr(std::move(animtree))); + } + + auto node = std::make_unique(loc, utils::string::unquote(inst->data[1])); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnimTree: + { + auto tree = utils::string::unquote(inst->data[0]); + + if(tree != "") + { + auto treename = std::make_unique(loc, inst->data[0]); + auto animtree = std::make_unique(loc, std::move(treename)); + program_->definitions.push_back(gsc::define_ptr(std::move(animtree))); + } + + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetThisthread: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_GetBuiltinMethod: + { + auto file = std::make_unique(loc); + auto func = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_GetLocalFunction: + { + auto file = std::make_unique(loc); + auto func = std::make_unique(loc, inst->data[0].substr(4)); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_GetFarFunction: + { + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + auto func = std::make_unique(loc, inst->data[1]); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + }; + break; + case opcode::OP_CreateLocalVariable: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_RemoveLocalVariables: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_EvalLocalVariableCached0: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached1: + { + auto node = std::make_unique(loc, "1"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached2: + { + auto node = std::make_unique(loc, "2"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached3: + { + auto node = std::make_unique(loc, "3"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached4: + { + auto node = std::make_unique(loc, "4"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached5: + { + auto node = std::make_unique(loc, "5"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayCached: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalArray: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalNewLocalArrayRefCached0: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayRefCached0: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, "0")); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayRefCached: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalArrayRef: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_ClearArray: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = key.as_node->loc; + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(key))); + auto rvalue = gsc::expr_ptr(std::make_unique(loc)); + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr))); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_AddArray: + { + auto var = std::move(stack_.top()); + stack_.pop(); + auto array = std::move(stack_.top()); + stack_.pop(); + + if (array->type == gsc::node_t::data_empty_array) + { + auto args = std::make_unique(loc); + args->list.push_back(std::move(var)); + auto expr = std::make_unique(array->loc, std::move(args)); + stack_.push(std::move(expr)); + } + else if (array->type == gsc::node_t::expr_add_array) + { + (*(gsc::expr_add_array_ptr*)&array)->args->list.push_back(std::move(var)); + stack_.push(std::move(array)); + } + else + { + throw gsc::decomp_error("unknown add array type (could be an array variable name?)"); + } + } + break; + case opcode::OP_PreScriptCall: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_ScriptLocalFunctionCall2: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalFunctionCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalChildThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodThreadCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodChildThreadCall: + { + // TODO: child things... + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarFunctionCall2: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarFunctionCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarMethodCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[2]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[1])); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarMethodThreadCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[2]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[1])); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFunctionCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodCallPointer: + { + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptChildThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodChildThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto obj = gsc::expr_ptr(std::make_unique()); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, true, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethodPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, true, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin0: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin1: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 1; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin2: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 2; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin3: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 3; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin4: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 4; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin5: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 5; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod0: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod1: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 1; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod2: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 2; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod3: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 3; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod4: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 4; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod5: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 5; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_DecTop: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + loc = expr->loc; + auto stmt = std::make_unique(loc, std::move(*(gsc::expr_call_ptr*)&expr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_inc: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_dec: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_or: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_ex_or: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_and: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_equality: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_inequality: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_less: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_greater: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_less_equal: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_greater_equal: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_shift_left: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_shift_right: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_plus: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_minus: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_multiply: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_divide: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_mod: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_wait: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + loc = expr->loc; + auto stmt = std::make_unique(loc, std::move(expr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_waittillFrameEnd: + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_waitFrame: + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_waittill: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = nstr.as_node->loc; + auto args = std::make_unique(loc); + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr), std::move(args)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_waittillmatch: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto expr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = expr.as_node->loc; + + gsc::expr_arguments_ptr args = std::make_unique(); + args->loc = loc; + + while(stack_.size() > 0) + { + auto node = std::move(stack_.top()); + stack_.pop(); + args->loc = node->loc; + args->list.push_back(std::move(node)); + + } + loc = args->loc; + + auto stmt = std::make_unique(loc, std::move(obj), std::move(expr), std::move(args)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_clearparams: + { + auto args = std::make_unique(loc); + auto var = std::move(stack_.top()); + stack_.pop(); + + while(var->type != gsc::node_t::stmt_waittill && var->type != gsc::node_t::stmt_waittillmatch) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + } + + if(var->type == gsc::node_t::stmt_waittill) + { + (*(gsc::stmt_waittill_ptr*)&var)->args = std::move(args); + } + + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(var))); + } + break; + case opcode::OP_checkclearparams: + { + // no needed + } + break; + case opcode::OP_notify: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_voidcodepos) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr), std::move(args)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_endon: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = nstr.as_node->loc; + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_voidCodepos: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_vector: + { + auto x = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto y = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto z = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = z.as_node->loc; + auto expr = std::make_unique(loc, std::move(x), std::move(y), std::move(z)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_size: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_EvalLevelFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalAnimFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalSelfFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalFieldVariable: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalLevelFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalAnimFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalSelfFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_ClearFieldVariable: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto expr = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto undef = gsc::expr_ptr(std::make_unique(loc)); + auto e = std::make_unique(loc, std::move(expr), std::move(undef)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::make_unique(loc, std::move(e)))); + } + break; + case opcode::OP_SafeCreateVariableFieldCached: + { + func_->params->list.push_back(std::make_unique(loc, "var_" + inst->data[0])); + } + break; + case opcode::OP_SafeSetWaittillVariableFieldCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableRefCached0: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableRefCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_SetLevelFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc,std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetVariableField: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + + if(lvalue.as_node->type == gsc::node_t::expr_increment) + { + auto stmt = std::make_unique(loc, std::move(lvalue.as_increment)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + else if(lvalue.as_node->type == gsc::node_t::expr_decrement) + { + auto stmt = std::make_unique(loc, std::move(lvalue.as_decrement)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + else + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + } + break; + case opcode::OP_SetAnimFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetSelfFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetLocalVariableFieldCached0: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, "0")); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetNewLocalVariableFieldCached0: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + + if(func_->block->stmts.size() > 0) + { + std::vector creates; + + while(func_->block->stmts.back().as_node->type == gsc::node_t::asm_create) + { + auto& entry = func_->block->stmts.back(); + if(loc.begin.line < entry.as_node->loc.begin.line) + { + creates.push_back(entry.as_asm_create->index); + func_->block->stmts.pop_back(); + continue; + } + break; + } + + std::reverse(creates.begin(), creates.end()); + lvalue.as_asm_create->vars = creates; + } + + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetLocalVariableFieldCached: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_ClearLocalVariableFieldCached: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_ClearLocalVariableFieldCached0: + { + auto stmt = std::make_unique(loc,"0"); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_EvalLocalVariableObjectCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_CastFieldObject: + case opcode::OP_CastBool: + { + //continue; + } + break; + case opcode::OP_BoolNot: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_BoolComplement: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_switch: + { + auto expr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = expr.as_node->loc; + auto sw = std::make_unique(loc, std::move(expr), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(sw))); + } + break; + case opcode::OP_endswitch: + { + auto count = inst->data[0]; + inst->data.erase(inst->data.begin()); + auto data = inst->data; + auto end = std::make_unique(loc, data, count); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(end))); + } + break; + case opcode::OP_jump: + { + auto expr = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + + } + break; + case opcode::OP_jumpback: + { + auto expr = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnTrue: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto e_not = gsc::expr_ptr(std::make_unique(loc, std::move(lvalue))); + auto expr = std::make_unique(loc, std::move(e_not), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnFalse: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnTrueExpr: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + stack_.push(std::move(expr)); + expr_labels_.push_back(inst->data[0]); + } + break; + case opcode::OP_JumpOnFalseExpr: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + stack_.push(std::move(expr)); + expr_labels_.push_back(inst->data[0]); + } + break; + default: + throw gsc::decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); + break; + } + } +} + +void decompiler::decompile_expr() +{ + auto expr = std::move(stack_.top()); + stack_.pop(); + + auto jump_expr = std::move(stack_.top()); + stack_.pop(); + auto loc = jump_expr->loc; + + if(jump_expr->type == gsc::node_t::asm_jump_true_expr) + { + auto lvalue = std::move((*(gsc::asm_jump_true_expr_ptr*)&jump_expr)->expr); + auto rvalue = gsc::expr_ptr(std::move(expr)); + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(e)); + } + else if(jump_expr->type == gsc::node_t::asm_jump_false_expr) + { + auto lvalue = std::move((*(gsc::asm_jump_false_expr_ptr*)&jump_expr)->expr); + auto rvalue = gsc::expr_ptr(std::move(expr)); + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(e)); + } + else + { + throw gsc::decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); + } +} + +void decompiler::decompile_block(const gsc::stmt_list_ptr& block) +{ + this->decompile_search_infinite(block); + this->decompile_search_loop(block); + this->decompile_search_switch(block); + this->decompile_search_ifelse(block); + this->decompile_break_continue(block); + this->decompile_nulls(block); +} + +void decompiler::decompile_nulls(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::null) + { + block->stmts.erase(block->stmts.begin() + index); + } + else index++; + } +} + +void decompiler::decompile_search_infinite(const gsc::stmt_list_ptr& block) +{ + std::int32_t index = block->stmts.size() - 1; + + while(index >= 0) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_jump_back) + { + auto break_loc = last_location_index(block, index) ? blocks_.back().loc_end : utils::string::va("loc_%X", block->stmts.at(index+1).as_node->loc.begin.line); + auto begin_loc = block->stmts.at(index).as_jump_back->value; + auto start = find_location_index(block, begin_loc); + + if(block->stmts.at(start).as_node->type != gsc::node_t::asm_jump_cond) + { + decompile_infinite(block, start, index); + index = start; + } + else if (block->stmts.at(start).as_cond->value != break_loc) + { + decompile_infinite(block, start, index); + index = start; + } + } + + index--; + } +} + +void decompiler::decompile_search_loop(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + auto& stmt = block->stmts.at(index); + + if(stmt.as_node->type == gsc::node_t::asm_jump_cond) + { + std::uint32_t end; + if(stmt.as_cond->value == blocks_.back().loc_end) + { + end = block->stmts.size() - 1; + } + else + { + end = find_location_index(block, stmt.as_cond->value) - 1; + } + + if(block->stmts.at(end).as_node->type == gsc::node_t::asm_jump_back + && utils::string::va("loc_%X", block->stmts.at(index).as_node->loc.begin.line) == block->stmts.at(end).as_jump_back->value) + { + decompile_loop(block, index, end); + index = 0; + } + } + index++; + } +} + +void decompiler::decompile_search_switch(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_switch) + { + decompile_switch(block, index); + } + + index++; + } +} + +void decompiler::decompile_search_ifelse(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + auto& stmt = block->stmts.at(index); + + if(stmt.as_node->type == gsc::node_t::asm_jump_cond) + { + std::uint32_t end; + if(stmt.as_cond->value == blocks_.back().loc_end) + { + end = block->stmts.size() - 1; + } + else + { + end = find_location_index(block, stmt.as_cond->value) - 1; + } + + auto last_loc = blocks_.back().loc_end; + + if(block->stmts.at(end).as_node->type == gsc::node_t::asm_jump) + { + // if block is a loop check break, continue + if(block->stmts.at(end).as_jump->value == blocks_.back().loc_continue) + { + // last if/else inside a loop still trigger this :( + decompile_if(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == blocks_.back().loc_break) + { + decompile_if(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == blocks_.back().loc_end) + { + decompile_ifelse(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == stmt.as_cond->value) + { + decompile_if(block, index, end); // if block, have a last empty else inside + } + else + { + decompile_ifelse(block, index, end); // TODO: if else block is empty, convert it to only if! + } + } + else if(block->stmts.at(end).as_node->type == gsc::node_t::stmt_return + && block->stmts.at(end).as_return->expr.as_node->type == gsc::node_t::null) + { + if(blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") + { + decompile_if(block, index, end); // inside a loop cant be last + } + else if(end - index == 1) + { + decompile_if(block, index, end); // only one explicit return + } + else if(block->stmts.back().as_node->type != gsc::node_t::stmt_return) + { + decompile_if(block, index, end); // block end is not a last return + } + else if(blocks_.back().is_last && block->stmts.back().as_node->type != gsc::node_t::stmt_return) + { + decompile_if(block, index, end); // inside a last block but is not and inner last + } + else if(find_location_reference(block, end, block->stmts.size(), last_loc)) + { + decompile_if(block, index, end); // reference to func end after the if + } + else if(blocks_.size() > 1 && !blocks_.back().is_last) + { + decompile_if(block, index, end); // fake last ifelse + } + else + { + decompile_last_ifelse(block, index, end); // special case + } + } + else + { + decompile_if(block, index, end); + } + } + index++; + } +} + +void decompiler::decompile_break_continue(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_jump) + { + auto loc = block->stmts.at(index).as_node->loc; + auto jump_loc = block->stmts.at(index).as_jump->value; + + if(jump_loc == blocks_.back().loc_continue) + { + block->stmts.erase(block->stmts.begin() + index); + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + block->stmts.insert(block->stmts.begin() + index, std::move(stmt)); + } + else if(jump_loc == blocks_.back().loc_break) + { + block->stmts.erase(block->stmts.begin() + index); + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + block->stmts.insert(block->stmts.begin() + index, std::move(stmt)); + } + } + + index++; + } +} + +void decompiler::decompile_if(const gsc::stmt_list_ptr& block, std::uint32_t begin, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_end = block->stmts.at(begin).as_cond->value; + ctx.loc_break = blocks_.back().loc_break; + ctx.loc_continue = blocks_.back().loc_continue; + + auto loc = block->stmts.at(begin).as_node->loc; + auto expr = std::move(block->stmts.at(begin).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + begin); // remove condition + + auto if_block = std::make_unique(loc); + + for(auto i = begin; i < end; i++) + { + if_block->stmts.push_back(std::move(block->stmts[begin])); + block->stmts.erase(block->stmts.begin() + begin); + } + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)))); + block->stmts.insert(block->stmts.begin() + begin, std::move(stmt)); +} + +void decompiler::decompile_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_break = blocks_.back().loc_break; + ctx.loc_continue = blocks_.back().loc_continue; + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto if_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) // skip the jump + { + if_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + auto end_loc = block->stmts.at(start).as_jump->value; + + block->stmts.erase(block->stmts.begin() + start); // remove jump + + std::uint32_t end_index; + + if(end_loc == blocks_.back().loc_end) + { + end_index = block->stmts.size(); + } + else + { + end_index = find_location_index(block, end_loc); + } + + gsc::context ctx2; + ctx2.loc_end = end_loc; + ctx2.loc_break = blocks_.back().loc_break; + ctx2.loc_continue = blocks_.back().loc_continue; + + auto else_block = std::make_unique(loc); + + for(auto i = start; i < end_index; i++) + { + else_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx2); + decompile_block(else_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)), gsc::stmt_ptr(std::move(else_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_last_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.is_last = true; + + auto inner_end = find_location_index(block, block->stmts.at(start).as_cond->value) - 1; + ctx.loc_end = utils::string::va("loc_%X",block->stmts.at(inner_end).as_node->loc.begin.line); + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto if_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + if_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + block->stmts.erase(block->stmts.begin() + start); // remove if block return; + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + if(start == block->stmts.size()) + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); + } + else + { + gsc::context ctx2; + ctx2.is_last = true; + + auto else_block = std::make_unique(loc); + + end = block->stmts.size(); + ctx2.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); // return is the block end + + for(auto i = start; i < end; i++) + { + else_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + else_block->stmts.pop_back(); // remove else return; + + blocks_.push_back(ctx2); + decompile_block(else_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)), gsc::stmt_ptr(std::move(else_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); + } +} + +void decompiler::decompile_infinite(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = last_location_index(block, end) ? blocks_.back().loc_end : utils::string::va("loc_%X", block->stmts.at(end+1).as_node->loc.begin.line); + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + + auto loc = block->stmts.at(start).as_node->loc; + + block->stmts.erase(block->stmts.begin() + end); // remove jump back + + auto for_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + for_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(for_block); + blocks_.pop_back(); + + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + auto expr = gsc::expr_ptr(std::make_unique()); + auto post_expr = gsc::stmt_ptr(std::make_unique()); + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(pre_expr), std::move(expr), std::move(post_expr), gsc::stmt_ptr(std::move(for_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + auto& last_stmt = block->stmts.at(end-1); + if(last_stmt.as_node->type == gsc::node_t::stmt_assign) + { + if(last_stmt.as_assign->expr->type == gsc::node_t::expr_assign_equal) + { + auto& rval = last_stmt.as_assign->expr->rvalue; + if(rval.as_node->type == gsc::node_t::expr_call) + { + if(rval.as_call->func.as_node->type == gsc::node_t::expr_call_function) + { + if(utils::string::to_lower(rval.as_call->func.as_func->name->value) == "getnextarraykey") + { + auto ref2 = utils::string::va("loc_%X", block->stmts.at(start).as_node->loc.begin.line); + if(find_location_reference(block, 0, start, ref2)) + { + // begin is at condition, not pre-expr + //decompile_while(block, start, end); + //return; + } + else + { + decompile_foreach(block, start, end); + return; + } + } + } + } + } + + if(start > 0) // while at func start + { + auto index = 1; + while(block->stmts.at(start - index).as_node->type == gsc::node_t::asm_create) + { + if(start - index > 0) + index++; + } + + if(block->stmts.at(start - index).as_node->type == gsc::node_t::stmt_assign) + { + auto ref = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + auto ref2 = utils::string::va("loc_%X", block->stmts.at(start).as_node->loc.begin.line); + + if(find_location_reference(block, start, end, ref)) + { + // continue is at jumpback, not post-expr + decompile_while(block, start, end); + return; + } + else if(find_location_reference(block, 0, start, ref2)) + { + // begin is at condition, not pre-expr + decompile_while(block, start, end); + return; + } + else + { + decompile_for(block, start, end); + return; + } + } + } + } + + decompile_while(block, start, end); +} + +void decompiler::decompile_while(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(start).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X",block->stmts.at(end).as_node->loc.begin.line); + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + end); // remove jump back + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto while_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + while_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(while_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(while_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_for(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(start).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + + // remove emit local var_creates + std::vector creates; + while(block->stmts.at(start - 1).as_node->type == gsc::node_t::asm_create) + { + creates.push_back(block->stmts.at(start - 1).as_asm_create->index); + block->stmts.erase(block->stmts.begin() + start - 1); + start--; + end--; + } + + std::reverse(creates.begin(), creates.end()); + + auto loc = block->stmts.at(start - 1).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + pre_expr.as_list->stmts.push_back(std::move(block->stmts.at(start - 1))); + pre_expr.as_list->is_expr = true; + auto post_expr = gsc::stmt_ptr(std::make_unique()); + post_expr.as_list->stmts.push_back(std::move(block->stmts.at(end - 1))); + post_expr.as_list->is_expr = true; + + start = start - 1; + end = end - 2; + for(auto i = start; i < start + 2; i++) // remove prologue (pre-expr, condition) + { + block->stmts.erase(block->stmts.begin() + start); + } + + end = end - 1; // set end in post-expr + for(auto i = end; i < end + 2; i++) // remove epilogue (post-expr, jump back) + { + block->stmts.erase(block->stmts.begin() + end); + } + + auto for_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + for_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(for_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(pre_expr), std::move(expr), std::move(post_expr), gsc::stmt_ptr(std::move(for_block)))); + stmt.as_for->vars = creates; + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_foreach(const gsc::stmt_list_ptr& block, std::uint32_t begin, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(begin).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + + // remove local var_creates + std::vector creates; + while(block->stmts.at(begin - 1).as_node->type == gsc::node_t::asm_create) + { + creates.push_back(block->stmts.at(begin - 1).as_asm_create->index); + block->stmts.erase(block->stmts.begin() + begin - 1); + begin--; + end--; + } + + std::reverse(creates.begin(), creates.end()); + + auto loc = block->stmts.at(begin - 2).as_node->loc; + + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + pre_expr.as_list->stmts.push_back(std::move(block->stmts[begin-2])); + pre_expr.as_list->stmts.push_back(std::move(block->stmts[begin-1])); + auto stmt0 = std::move(block->stmts[begin+1]); + + begin = begin - 2; + end = end - 4; + for(auto i = begin; i < begin + 4; i++) // remove prologue ( array, elem, cond, elemRef) + { + block->stmts.erase(block->stmts.begin() + begin); + } + + end = end - 1; // set end to post-expr + + for(auto i = end; i < end + 2; i++) // remove epilogue ( post-expr, jump back) + { + block->stmts.erase(block->stmts.begin() + end); + } + + if(block->stmts.size() > end && block->stmts.at(end).as_node->type == gsc::node_t::asm_clear) + { + block->stmts.erase(block->stmts.begin() + end); + } + + auto use_key = true; + + if(block->stmts.size() > end && block->stmts.at(end).as_node->type == gsc::node_t::asm_clear) + { + block->stmts.erase(block->stmts.begin() + end); + use_key = false; + } + + auto foreach_block = std::make_unique(loc); + + for(auto i = begin; i < end; i++) + { + foreach_block->stmts.push_back(std::move(block->stmts[begin])); + block->stmts.erase(block->stmts.begin() + begin); + } + + blocks_.push_back(ctx); + decompile_block(foreach_block); + blocks_.pop_back(); + + auto foreach_stmt = gsc::stmt_ptr(std::make_unique(loc, gsc::stmt_ptr(std::move(foreach_block)), use_key)); + foreach_stmt.as_foreach->vars = creates; + foreach_stmt.as_foreach->pre_expr = std::move(pre_expr); + foreach_stmt.as_foreach->stmt0 = std::move(stmt0); + + block->stmts.insert(block->stmts.begin() + begin, std::move(foreach_stmt)); +} + +void decompiler::decompile_switch(const gsc::stmt_list_ptr& block, std::uint32_t start) +{ + gsc::context ctx; + ctx.loc_continue = blocks_.back().loc_continue; + ctx.loc_end = block->stmts.at(start).as_asm_switch->value; + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_asm_switch->expr); + auto end_loc = block->stmts.at(start).as_asm_switch->value; + auto end = find_location_index(block, end_loc); + + if(end == block->stmts.size() - 1) + { + ctx.loc_break = blocks_.back().loc_end; + } + else + { + ctx.loc_break = utils::string::va("loc_%X", block->stmts.at(end + 1).as_node->loc.begin.line); + } + + // collect cases + auto casenum = std::atol(block->stmts.at(end).as_asm_endswitch->count.data()); + auto data = block->stmts.at(end).as_asm_endswitch->data; + auto idx = 0; + + for(auto i = 0; i < casenum; i++) + { + if(data.at(idx) == "case") + { + auto loc_str = data.at(idx+2); + auto loc_idx = find_location_index(block, loc_str); + auto loc_pos = gsc::location(&filename_, std::stol(loc_str.substr(4), 0, 16)); + auto value = gsc::expr_ptr(std::make_unique(loc_pos, data.at(idx+1))); + auto list = std::make_unique(loc); + list->is_case = true; + auto stmt = gsc::stmt_ptr(std::make_unique(loc_pos, std::move(value), std::move(list))); + block->stmts.insert(block->stmts.begin() + loc_idx, std::move(stmt)); + idx += 3; + } + else if(data.at(idx) == "default") + { + auto loc_str = data.at(idx+1); + auto loc_idx = find_location_index(block, loc_str); + auto loc_pos = gsc::location(&filename_, std::stol(loc_str.substr(4), 0, 16)); + auto list = std::make_unique(loc); + list->is_case = true; + auto stmt = gsc::stmt_ptr(std::make_unique(loc_pos, std::move(list))); + block->stmts.insert(block->stmts.begin() + loc_idx, std::move(stmt)); + idx += 2; + } + } + + end = find_location_index(block, end_loc) - 1; // update end; + block->stmts.erase(block->stmts.begin() + start); // remove switch + block->stmts.erase(block->stmts.begin() + end); // remove endswitch + + //decompile block + auto sw_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + sw_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(sw_block); + blocks_.pop_back(); + + auto stmt_list = std::make_unique(loc); + gsc::stmt_ptr current_case = gsc::stmt_ptr(std::make_unique()); + + auto num = sw_block->stmts.size(); + for(auto i = 0; i < num; i++) + { + auto& entry = sw_block->stmts[0]; + + if(entry.as_node->type == gsc::node_t::stmt_case || entry.as_node->type == gsc::node_t::stmt_default) + { + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + current_case = std::move(sw_block->stmts[0]); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + else + { + if(current_case.as_node->type != gsc::node_t::null) + { + if(current_case.as_node->type == gsc::node_t::stmt_case) + { + current_case.as_case->stmt->stmts.push_back(std::move(sw_block->stmts[0])); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + else + { + current_case.as_default->stmt->stmts.push_back(std::move(sw_block->stmts[0])); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + } + else + { + gsc::decomp_error("missing case before stmt inside switch!"); + } + } + } + + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), std::move(stmt_list))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +auto decompiler::find_location_reference(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end, const std::string& location) -> bool +{ + for(auto i = start; i < end; i++) + { + if(block->stmts.at(i).as_node->type == gsc::node_t::asm_jump_cond) + { + if(block->stmts.at(i).as_cond->value == location) + return true; + } + else if(block->stmts.at(i).as_node->type == gsc::node_t::asm_jump) + { + if(block->stmts.at(i).as_jump->value == location) + return true; + } + } + + return false; +} + +auto decompiler::find_location_index(const gsc::stmt_list_ptr& block, const std::string& location) -> std::uint32_t +{ + auto index = 0; + + if(location == blocks_.back().loc_end) + return block->stmts.size(); + + for(auto& stmt : block->stmts) + { + if(stmt.as_node->loc.begin.line == std::stol(location.substr(4), 0, 16)) + return index; + + index++; + } + + throw gsc::decomp_error("LOCATION NOT FOUND! (" + location + ")"); +} + +auto decompiler::last_location_index(const gsc::stmt_list_ptr& block, std::uint32_t index) -> bool +{ + if(index == block->stmts.size() - 1) + return true; + + return false; +} + +void decompiler::process_stack(const gsc::thread_ptr& thread) +{ + auto ctx = std::make_unique(); + + process_parameters(ctx, thread->params); + process_stmt_list(ctx, thread->block); + +} + +void decompiler::process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + ctx->local_vars.push_back({ param->value, static_cast(std::stoi(param->value.substr(4))), true }); + ctx->local_vars_create_count++; + } +} + +void decompiler::process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt) +{ + switch(stmt.as_node->type) + { + case gsc::node_t::stmt_list: process_stmt_list(ctx, stmt.as_list); break; + case gsc::node_t::stmt_call: process_stmt_call(ctx, stmt.as_call); break; + case gsc::node_t::stmt_assign: process_stmt_assign(ctx, stmt.as_assign); break; + case gsc::node_t::stmt_endon: process_stmt_endon(ctx, stmt.as_endon); break; + case gsc::node_t::stmt_notify: process_stmt_notify(ctx, stmt.as_notify); break; + case gsc::node_t::stmt_wait: process_stmt_wait(ctx, stmt.as_wait); break; + case gsc::node_t::stmt_waittill: process_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_waittillmatch: process_stmt_waittillmatch(ctx, stmt.as_waittillmatch); break; + case gsc::node_t::stmt_if: process_stmt_if(ctx, stmt.as_if); break; + case gsc::node_t::stmt_ifelse: process_stmt_ifelse(ctx, stmt.as_ifelse); break; + case gsc::node_t::stmt_while: process_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: process_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: process_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: process_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_break: process_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_return: process_stmt_return(ctx, stmt.as_return); break; + case gsc::node_t::asm_remove: process_var_remove(ctx, stmt.as_asm_remove); break; + case gsc::node_t::asm_create: + { + auto expr = gsc::expr_ptr(std::make_unique(stmt.as_asm_create->index)); + process_var_create(ctx, expr, true); + } + break; + default: break; + } +} + +void decompiler::process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + for (const auto& entry : stmt->stmts) + { + process_stmt(ctx, entry); + } + + for(auto i = 0; i < stmt->stmts.size(); i++) + { + auto type = stmt->stmts.at(i).as_node->type; + + if(type == gsc::node_t::asm_create || type == gsc::node_t::asm_remove) + { + stmt->stmts.erase(stmt->stmts.begin() + i); + i--; + } + } +} + +void decompiler::process_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt) +{ + process_expr_call(ctx, stmt->expr); +} + +void decompiler::process_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt) +{ + process_expr_assign(ctx, stmt->expr); +} + +void decompiler::process_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt) +{ + process_expr_arguments(ctx, stmt->args); + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt) +{ + process_expr(ctx, stmt->expr); +} + +void decompiler::process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); + process_expr_arguments(ctx, stmt->args); +} + +void decompiler::process_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt) +{ + process_expr_arguments(ctx, stmt->args); + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx_if = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx_if); + + process_stmt(stmt->ctx_if, stmt->stmt_if); + + stmt->ctx_else = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx_else); + + process_stmt(stmt->ctx_else, stmt->stmt_else); + + std::vector childs({stmt->ctx_if.get(), stmt->ctx_else.get()}); + ctx->append(childs); + + if(stmt->stmt_if.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt_if.as_list->stmts.at(0))) + { + stmt->stmt_if = std::move(stmt->stmt_if.as_list->stmts.back()); + } + + if(stmt->stmt_else.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt_noif(stmt->stmt_else.as_list->stmts.at(0))) + { + stmt->stmt_else = std::move(stmt->stmt_else.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt); + + std::vector childs({ stmt->ctx.get() }); + + if(stmt->expr.as_node->type == gsc::node_t::null) + ctx->append_decompiler(stmt->ctx); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + process_stmt(ctx, stmt->pre_expr); + + for(auto& index : stmt->vars) + { + auto var = utils::string::va("var_%d", std::stoi(index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(index)), true }); + ctx->local_vars_create_count++; + } + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_expr(ctx, stmt->expr); + + process_stmt(stmt->ctx, stmt->stmt); + + process_stmt(ctx, stmt->post_expr); + + if(stmt->expr.as_node->type == gsc::node_t::null) + ctx->append_decompiler(stmt->ctx); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + process_stmt(ctx, stmt->pre_expr); + + for(auto& index : stmt->vars) + { + auto var1 = utils::string::va("var_%d", std::stoi(index)); + ctx->local_vars.push_back({ var1, static_cast(std::stoi(index)), true }); + ctx->local_vars_create_count++; + } + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt0); + process_stmt(stmt->ctx, stmt->stmt); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } + + stmt->array_expr = std::move(stmt->pre_expr.as_list->stmts[0].as_assign->expr->rvalue); + stmt->value_expr = std::move(stmt->stmt0.as_assign->expr->lvalue); + stmt->key_expr = std::move(stmt->pre_expr.as_list->stmts[1].as_assign->expr->lvalue); +} + +void decompiler::process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt_cases(stmt->ctx, stmt->stmt); + + ctx->append_decompiler(stmt->ctx, true); +} + +void decompiler::process_stmt_cases(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + std::vector childs; + + for(auto& entry : stmt->stmts) + { + if(entry.as_node->type == gsc::node_t::stmt_case) + { + entry.as_case->ctx = std::make_unique(); + ctx->transfer_decompiler(entry.as_case->ctx); + + process_stmt_list(entry.as_case->ctx, entry.as_case->stmt); + + if(entry.as_case->ctx->abort == gsc::abort_t::abort_break) + { + childs.push_back(entry.as_case->ctx.get()); + } + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + entry.as_default->ctx = std::make_unique(); + ctx->transfer_decompiler(entry.as_default->ctx); + + process_stmt_list(entry.as_default->ctx, entry.as_default->stmt); + + if(entry.as_default->ctx->abort == gsc::abort_t::abort_break) + { + childs.push_back(entry.as_default->ctx.get()); + } + } + } + + ctx->append(childs); +} + +void decompiler::process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + ctx->abort = gsc::abort_t::abort_break; +} + +void decompiler::process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(stmt->expr.as_node->type == gsc::node_t::null) + { + return; + } + + process_expr(ctx, stmt->expr); +} + +void decompiler::process_expr(const gsc::context_ptr& ctx, gsc::expr_ptr& expr) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_increment: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_decrement: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_equal: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_add: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_sub: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_mult: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_div: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_mod: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_shift_left: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_shift_right: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_or: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_and: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_exor: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_and: process_expr_and(ctx, expr.as_and); break; + case gsc::node_t::expr_or: process_expr_or(ctx, expr.as_or); break; + case gsc::node_t::expr_equality: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_inequality: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less_equal: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater_equal: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_or: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_and: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_exor: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_left: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_right: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_add: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_sub: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mult: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_div: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mod: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_complement: process_expr_complement(ctx, expr.as_complement); break; + case gsc::node_t::expr_not: process_expr_not(ctx, expr.as_not); break; + case gsc::node_t::expr_call: process_expr_call(ctx, expr.as_call); break; + case gsc::node_t::expr_function: process_expr_function(ctx, expr.as_function); break; + case gsc::node_t::expr_add_array: process_expr_add_array(ctx, expr.as_add_array); break; + case gsc::node_t::expr_array: process_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: process_field_variable(ctx, expr.as_field); break; + case gsc::node_t::expr_size: process_expr_size(ctx, expr.as_size); break; + case gsc::node_t::data_name: process_local_variable(ctx, expr.as_name); break; + case gsc::node_t::data_vector: process_vector(ctx, expr.as_vector); break; + case gsc::node_t::asm_create: process_var_create(ctx, expr); break; + case gsc::node_t::asm_access: process_var_access(ctx, expr); break; + default: break; + } +} + +void decompiler::process_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr) +{ + if(expr->type == gsc::node_t::expr_increment) + { + process_expr(ctx, expr->lvalue); + } + else if(expr->type == gsc::node_t::expr_decrement) + { + process_expr(ctx, expr->lvalue); + } + else + { + process_expr(ctx, expr->rvalue); + process_expr(ctx, expr->lvalue); + } +} + +void decompiler::process_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr) +{ + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr) +{ + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + if(expr->func.as_node->type == gsc::node_t::expr_call_pointer) + { + process_expr_call_pointer(ctx, expr); + } + else + { + process_expr_call_function(ctx, expr); + } +} + +void decompiler::process_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + process_expr_arguments(ctx, expr->func.as_pointer->args); + + if(expr->obj.as_node->type != gsc::node_t::null) + process_expr(ctx, expr->obj); + + process_expr(ctx, expr->func.as_pointer->expr); +} + +void decompiler::process_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + process_expr_arguments(ctx, expr->func.as_func->args); + + if(expr->obj.as_node->type != gsc::node_t::null) + process_expr(ctx, expr->obj); +} + +void decompiler::process_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& args) +{ + for(auto i = args->list.size(); i > 0; i--) + { + process_expr(ctx, args->list.at(i - 1)); + } +} + +void decompiler::process_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& expr) +{ + return; +} + +void decompiler::process_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr) +{ + for(auto& arg : expr->args->list) + { + process_expr(ctx, arg); + } +} + +void decompiler::process_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr) +{ + process_expr(ctx, expr->obj); +} + +void decompiler::process_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr) +{ + process_expr(ctx, expr->key); + process_expr(ctx, expr->obj); +} + +void decompiler::process_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr) +{ + process_expr(ctx, expr->obj); +} + +void decompiler::process_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + return; +} + +void decompiler::process_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec) +{ + process_expr(ctx, vec->z); + process_expr(ctx, vec->y); + process_expr(ctx, vec->x); +} + +void decompiler::process_var_create(const gsc::context_ptr& ctx, gsc::expr_ptr& expr, bool fromstmt) +{ + if(fromstmt) + { + auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); + ctx->local_vars_create_count++; + } + else + { + for(auto& entry : expr.as_asm_create->vars) + { + ctx->local_vars.push_back({ utils::string::va("var_%d", std::stoi(entry)), static_cast(std::stoi(entry)), true }); + ctx->local_vars_create_count++; + } + + auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); + ctx->local_vars_create_count++; + + expr = gsc::expr_ptr(std::make_unique(var)); + } +} + +void decompiler::process_var_access(const gsc::context_ptr& ctx, gsc::expr_ptr& expr) +{ + if(ctx->local_vars.size() <= std::stoi(expr.as_asm_access->index)) + { + printf("WARNING: bad local var access\n"); + } + else + { + auto var = ctx->local_vars.at(ctx->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; + expr = gsc::expr_ptr(std::make_unique(var)); + } +} + +void decompiler::process_var_remove(const gsc::context_ptr& ctx, const gsc::asm_remove_ptr& expr) +{ + ctx->local_vars_public_count = ctx->local_vars.size() - std::stoi(expr->index); +} + +} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/decompiler.hpp b/src/h1/xsk/decompiler.hpp new file mode 100644 index 00000000..f5a8dde1 --- /dev/null +++ b/src/h1/xsk/decompiler.hpp @@ -0,0 +1,93 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::h1 +{ + +class decompiler : public gsc::decompiler +{ + std::string filename_; + std::unique_ptr output_; + gsc::program_ptr program_; + gsc::thread_ptr func_; + std::unordered_map labels_; + std::vector expr_labels_; + std::stack stack_; + std::vector blocks_; + +public: + auto output() -> std::vector; + void decompile(const std::string& file, std::vector& functions); + +private: + void decompile_function(const gsc::function_ptr& func); + void decompile_statements(const gsc::function_ptr& func); + void decompile_expr(); + void decompile_block(const gsc::stmt_list_ptr& block); + void decompile_nulls(const gsc::stmt_list_ptr& block); + void decompile_search_infinite(const gsc::stmt_list_ptr& block); + void decompile_search_loop(const gsc::stmt_list_ptr& block); + void decompile_search_switch(const gsc::stmt_list_ptr& block); + void decompile_search_ifelse(const gsc::stmt_list_ptr& block); + void decompile_break_continue(const gsc::stmt_list_ptr& block); + void decompile_if(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_last_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_infinite(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_while(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_for(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_foreach(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_switch(const gsc::stmt_list_ptr& block, std::uint32_t start); + auto find_location_reference(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end, const std::string& location) -> bool; + auto find_location_index(const gsc::stmt_list_ptr& block, const std::string& location) -> std::uint32_t; + auto last_location_index(const gsc::stmt_list_ptr& block, std::uint32_t index) -> bool; + void process_stack(const gsc::thread_ptr& thread); + void process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt); + void process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt); + void process_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt); + void process_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt); + void process_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt); + void process_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt); + void process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void process_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt); + void process_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt); + void process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt); + void process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt); + void process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void process_stmt_cases(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void process_expr(const gsc::context_ptr& ctx, gsc::expr_ptr& expr); + void process_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr); + void process_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr); + void process_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr); + void process_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr); + void process_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr); + void process_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr); + void process_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& arg_list); + void process_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& node); + void process_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr); + void process_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr); + void process_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr); + void process_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr); + void process_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void process_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec); + void process_var_create(const gsc::context_ptr& ctx, gsc::expr_ptr& expr, bool fromstmt = false); + void process_var_access(const gsc::context_ptr& ctx, gsc::expr_ptr& expr); + void process_var_remove(const gsc::context_ptr& ctx, const gsc::asm_remove_ptr& expr); +}; + +} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/disassembler.cpp b/src/h1/xsk/disassembler.cpp new file mode 100644 index 00000000..a4c7c9f5 --- /dev/null +++ b/src/h1/xsk/disassembler.cpp @@ -0,0 +1,573 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "h1.hpp" + +namespace xsk::gsc::h1 +{ + +auto disassembler::output() -> std::vector +{ + return std::move(functions_); +} + +auto disassembler::output_data() -> std::vector +{ + output_ = std::make_unique(0x100000); + + output_->write_string("// H1 PC GSCASM\n"); + output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); + + for (auto& func : functions_) + { + this->print_function(func); + } + + std::vector output; + + output.resize(output_->pos()); + memcpy(output.data(), output_->buffer().data(), output.size()); + + return output; +} + +void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) +{ + filename_ = file; + script_ = std::make_unique(script); + stack_ = std::make_unique(stack); + functions_.clear(); + + script_->seek(1); + + while (stack_->is_avail() && script_->is_avail()) + { + functions_.push_back(std::make_unique()); + auto& func = functions_.back(); + + func->index = static_cast(script_->pos()); + func->size = stack_->read(); + func->id = stack_->read(); + func->name = "sub_"s + (func->id == 0 ? stack_->read_c_string() : resolver::token_name(func->id)); + + this->dissasemble_function(func); + + func->labels = labels_; + labels_.clear(); + } + + this->resolve_local_functions(); +} + +void disassembler::dissasemble_function(const gsc::function_ptr& func) +{ + auto size = func->size; + + while (size > 0) + { + func->instructions.push_back(std::make_unique()); + + auto& inst = func->instructions.back(); + inst->index = static_cast(script_->pos()); + inst->opcode = script_->read(); + inst->size = opcode_size(inst->opcode); + + this->dissasemble_instruction(inst); + + size -= inst->size; + } +} + + +void disassembler::dissasemble_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_Return: + case opcode::OP_BoolNot: + case opcode::OP_CastBool: + case opcode::OP_inequality: + case opcode::OP_GetThisthread: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_checkclearparams: + case opcode::OP_CastFieldObject: + case opcode::OP_End: + case opcode::OP_size: + case opcode::OP_EmptyArray: + case opcode::OP_bit_and: + case opcode::OP_less_equal: + case opcode::OP_voidCodepos: + case opcode::OP_ClearVariableField: + case opcode::OP_divide: + case opcode::OP_GetSelf: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_plus: + case opcode::OP_BoolComplement: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_inc: + case opcode::OP_clearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_endon: + case opcode::OP_greater_equal: + case opcode::OP_GetSelfObject: + case opcode::OP_SetVariableField: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_less: + case opcode::OP_GetGameRef: + case opcode::OP_waitFrame: + case opcode::OP_waittillFrameEnd: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_notify: + case opcode::OP_DecTop: + case opcode::OP_shift_left: + case opcode::OP_greater: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_minus: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_multiply: + case opcode::OP_mod: + case opcode::OP_GetGame: + case opcode::OP_waittill: + case opcode::OP_dec: + case opcode::OP_PreScriptCall: + case opcode::OP_GetAnim: + case opcode::OP_GetUndefined: + case opcode::OP_GetAnimObject: + case opcode::OP_GetLevelObject: + case opcode::OP_bit_ex_or: + case opcode::OP_equality: + case opcode::OP_ClearArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalArray: + case opcode::OP_vector: + case opcode::OP_bit_or: + case opcode::OP_AddArray: + case opcode::OP_waittillmatch2: + case opcode::OP_shift_right: + break; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetInteger: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetFloat: + inst->data.push_back(utils::string::va("%g", script_->read())); + break; + case opcode::OP_GetVector: + inst->data.push_back(utils::string::va("%g", script_->read())); + inst->data.push_back(utils::string::va("%g", script_->read())); + inst->data.push_back(utils::string::va("%g", script_->read())); + break; + case opcode::OP_GetString: + case opcode::OP_GetIString: + script_->seek(4); + inst->data.push_back(utils::string::to_literal(stack_->read_c_string())); + break; + case opcode::OP_GetAnimation: + script_->seek(8); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + break; + case opcode::OP_GetAnimTree: + script_->seek(1); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + break; + case opcode::OP_waittillmatch: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_EvalLocalArrayCached: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + this->disassemble_field_variable(inst); + break; + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + this->disassemble_local_call(inst, false); + break; + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + this->disassemble_local_call(inst, true); + break; + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + this->disassemble_far_call(inst, false); + break; + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + this->disassemble_far_call(inst, true); + break; + case opcode::OP_CallBuiltin: + this->disassemble_builtin_call(inst, false, true); + break; + case opcode::OP_CallBuiltinMethod: + this->disassemble_builtin_call(inst, true, true); + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + this->disassemble_builtin_call(inst, false, false); + break; + case opcode::OP_GetBuiltinMethod: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + this->disassemble_builtin_call(inst, true, false); + break; + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + this->disassemble_jump(inst, true, false); + break; + case opcode::OP_jumpback: + this->disassemble_jump(inst, false, true); + break; + case opcode::OP_jump: + this->disassemble_jump(inst, false, false); + break; + case opcode::OP_switch: + this->disassemble_switch(inst); + break; + case opcode::OP_endswitch: + this->disassemble_end_switch(inst); + break; + default: + throw gsc::disasm_error(utils::string::va("Unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); + } +} + +void disassembler::disassemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num) +{ + if (arg_num) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } + + if (method) + { + inst->data.push_back(resolver::method_name(script_->read())); + } + else + { + inst->data.push_back(resolver::function_name(script_->read())); + } +} + +void disassembler::disassemble_local_call(const gsc::instruction_ptr& inst, bool thread) +{ + std::int32_t offset = this->disassemble_offset(); + + inst->data.push_back(utils::string::va("%X", offset + inst->index + 1)); + + if (thread) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } +} + +void disassembler::disassemble_far_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->seek(3); + + if (thread) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } + + auto file_id = stack_->read(); + auto file_name = file_id == 0 ? stack_->read_c_string() : resolver::file_name(file_id); + auto func_id = stack_->read(); + auto func_name = func_id == 0 ? stack_->read_c_string() : resolver::token_name(func_id); + + inst->data.push_back(file_name != "" ? file_name : utils::string::va("_ID%i", file_id)); + inst->data.push_back(func_name != "" ? func_name : utils::string::va("_ID%i", func_id)); +} + +void disassembler::disassemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back) +{ + std::int32_t addr; + std::string label; + + if (expr) + { + addr = inst->index + 3 + script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + else if (back) + { + addr = inst->index + 3 - script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + else + { + addr = inst->index + 5 + script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + + labels_.insert({addr, label}); +} + +void disassembler::disassemble_field_variable(const gsc::instruction_ptr& inst) +{ + std::uint16_t field_id = script_->read(); + std::string field_name; + + if(field_id > 0xA7ED) + { + auto temp = stack_->read(); + field_name = temp == 0 ? stack_->read_c_string() : std::to_string(temp); + } + else + { + field_name = resolver::token_name(field_id); + } + + inst->data.push_back(field_name != "" ? field_name : utils::string::va("_ID%i", field_id)); +} + +void disassembler::disassemble_switch(const gsc::instruction_ptr& inst) +{ + std::int32_t addr = inst->index + 4 + script_->read(); + std::string label = utils::string::va("loc_%X", addr); + + inst->data.push_back(label); + labels_.insert({addr, label}); +} + +void disassembler::disassemble_end_switch(const gsc::instruction_ptr& inst) +{ + std::uint16_t case_num = script_->read(); + inst->data.push_back(utils::string::va("%i", case_num)); + + std::uint32_t internal_index = inst->index + 3; + + if (case_num) + { + for (auto i = case_num; i > 0; i--) + { + std::uint32_t case_label = script_->read(); + + if (case_label < 0x40000 && case_label > 0) + { + inst->data.push_back("case"); + inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); + } + else if (case_label == 0) + { + inst->data.push_back("default"); + stack_->read(); + } + else + { + inst->data.push_back("case"); + inst->data.push_back(utils::string::va("%i", (case_label - 0x800000) & 0xFFFFFF)); + } + + inst->size += 4; + internal_index += 4; + + auto addr = this->disassemble_offset() + internal_index; + std::string label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + + labels_.insert({addr, label}); + + inst->size += 3; + internal_index += 3; + } + } +} + +auto disassembler::disassemble_offset() -> std::int32_t +{ + std::array bytes = {}; + + for (auto i = 0; i < 3; i++) + { + bytes[i] = script_->read(); + } + + std::int32_t offset = *reinterpret_cast(bytes.data()); + + offset = (offset << 8) >> 10; + + return offset; +} + +void disassembler::resolve_local_functions() +{ + for (auto& func : functions_) + { + for (auto& inst : func->instructions) + { + switch (opcode(inst->opcode)) + { + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + inst->data.at(0) = this->resolve_function(inst->data[0]); + break; + default: + break; + } + } + } +} + +auto disassembler::resolve_function(const std::string& index) -> std::string +{ + if (utils::string::is_hex_number(index)) + { + std::uint32_t idx = std::stoul(index, nullptr, 16); + + for (auto& func : functions_) + { + if (func->index == idx) + { + return func->name; + } + } + + throw gsc::disasm_error(utils::string::va("Couldn't resolve function name at index '0x%04X'!", idx)); + } + + throw gsc::disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); +} + +void disassembler::print_function(const gsc::function_ptr& func) +{ + output_->write_string("\n"); + output_->write_string(utils::string::va("%s\n", func->name.data())); + + for (auto& inst : func->instructions) + { + const auto itr = func->labels.find(inst->index); + + if (itr != func->labels.end()) + { + output_->write_string(utils::string::va("\t%s\n", itr->second.data())); + } + + this->print_instruction(inst); + } + + output_->write_string("\n"); + output_->write_string(utils::string::va("end_%s\n", func->name.substr(4).data())); +} + +void disassembler::print_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_endswitch: + output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); + output_->write_string(utils::string::va(" %s\n", inst->data[0].data())); + { + std::uint32_t totalcase = std::stoul(inst->data[0]); + auto index = 0; + for (auto casenum = 0u; casenum < totalcase; casenum++) + { + if (inst->data[1 + index] == "case") + { + output_->write_string(utils::string::va("\t\t\t%s %s %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data(), inst->data[1 + index + 2].data())); + index += 3; + } + else if (inst->data[1 + index] == "default") + { + output_->write_string(utils::string::va("\t\t\t%s %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data())); + index += 2; + } + if (casenum != totalcase - 1) + { + output_->write_string("\n"); + } + } + } + break; + default: + output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); + for (auto& d : inst->data) + { + output_->write_string(utils::string::va(" %s", d.data())); + } + break; + } + + output_->write_string("\n"); +} + +} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/disassembler.hpp b/src/h1/xsk/disassembler.hpp new file mode 100644 index 00000000..032b81d7 --- /dev/null +++ b/src/h1/xsk/disassembler.hpp @@ -0,0 +1,42 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::h1 +{ + +class disassembler : public gsc::disassembler +{ + std::string filename_; + utils::byte_buffer_ptr script_; + utils::byte_buffer_ptr stack_; + utils::byte_buffer_ptr output_; + std::vector functions_; + std::unordered_map labels_; + +public: + auto output() -> std::vector; + auto output_data() -> std::vector; + void disassemble(const std::string& file, std::vector& script, std::vector& stack); + +private: + void dissasemble_function(const gsc::function_ptr& func); + void dissasemble_instruction(const gsc::instruction_ptr& inst); + void disassemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num); + void disassemble_local_call(const gsc::instruction_ptr& inst, bool thread); + void disassemble_far_call(const gsc::instruction_ptr& inst, bool thread); + void disassemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back); + void disassemble_field_variable(const gsc::instruction_ptr& inst); + void disassemble_switch(const gsc::instruction_ptr& inst); + void disassemble_end_switch(const gsc::instruction_ptr& inst); + auto disassemble_offset() -> std::int32_t; + void resolve_local_functions(); + auto resolve_function(const std::string& index) -> std::string; + void print_function(const gsc::function_ptr& func); + void print_instruction(const gsc::instruction_ptr& inst); +}; + +} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/h1.cpp b/src/h1/xsk/h1.cpp new file mode 100644 index 00000000..9a29073d --- /dev/null +++ b/src/h1/xsk/h1.cpp @@ -0,0 +1,182 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "h1.hpp" + +namespace xsk::gsc::h1 +{ + +auto opcode_size(std::uint8_t id) -> std::uint32_t +{ + switch (opcode(id)) + { + case opcode::OP_Return: + case opcode::OP_BoolNot: + case opcode::OP_CastBool: + case opcode::OP_inequality: + case opcode::OP_GetThisthread: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_checkclearparams: + case opcode::OP_CastFieldObject: + case opcode::OP_End: + case opcode::OP_size: + case opcode::OP_EmptyArray: + case opcode::OP_bit_and: + case opcode::OP_less_equal: + case opcode::OP_voidCodepos: + case opcode::OP_ClearVariableField: + case opcode::OP_divide: + case opcode::OP_GetSelf: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_plus: + case opcode::OP_BoolComplement: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_inc: + case opcode::OP_clearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_endon: + case opcode::OP_greater_equal: + case opcode::OP_GetSelfObject: + case opcode::OP_SetVariableField: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_less: + case opcode::OP_GetGameRef: + case opcode::OP_waitFrame: + case opcode::OP_waittillFrameEnd: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_notify: + case opcode::OP_DecTop: + case opcode::OP_shift_left: + case opcode::OP_greater: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_minus: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_multiply: + case opcode::OP_mod: + case opcode::OP_GetGame: + case opcode::OP_waittill: + case opcode::OP_dec: + case opcode::OP_PreScriptCall: + case opcode::OP_GetAnim: + case opcode::OP_GetUndefined: + case opcode::OP_GetAnimObject: + case opcode::OP_GetLevelObject: + case opcode::OP_bit_ex_or: + case opcode::OP_equality: + case opcode::OP_ClearArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalArray: + case opcode::OP_vector: + case opcode::OP_bit_or: + case opcode::OP_AddArray: + case opcode::OP_waittillmatch2: + case opcode::OP_shift_right: + return 1; + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_CallBuiltinPointer: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_ScriptMethodChildThreadCallPointer: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_GetNegByte: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_EvalLocalArrayCached: + case opcode::OP_GetByte: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_GetAnimTree: + return 2; + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_GetUnsignedShort: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_GetBuiltinFunction: + case opcode::OP_jumpback: + case opcode::OP_GetBuiltinMethod: + case opcode::OP_waittillmatch: + case opcode::OP_GetNegUnsignedShort: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + case opcode::OP_JumpOnFalse: + case opcode::OP_endswitch: + return 3; + case opcode::OP_CallBuiltin: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_GetLocalFunction: + case opcode::OP_CallBuiltinMethod: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarMethodCall: + return 4; + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_GetFloat: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_switch: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + case opcode::OP_jump: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_GetInteger: + case opcode::OP_GetString: + case opcode::OP_GetIString: + return 5; + case opcode::OP_GetAnimation: + return 9; + case opcode::OP_GetVector: + return 13; + default: + throw std::runtime_error("Couldn't resolve instruction size for " + std::to_string(id)); + } +} + +} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/h1.hpp b/src/h1/xsk/h1.hpp new file mode 100644 index 00000000..72e4c945 --- /dev/null +++ b/src/h1/xsk/h1.hpp @@ -0,0 +1,180 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "utils/xsk/utils.hpp" + +#include "assembler.hpp" +#include "disassembler.hpp" +#include "compiler.hpp" +#include "decompiler.hpp" +#include "resolver.hpp" + +namespace xsk::gsc::h1 +{ + +enum class opcode : std::uint8_t +{ + OP_SetNewLocalVariableFieldCached0 = 0x17, + OP_EvalSelfFieldVariable = 0x18, + OP_Return = 0x19, + OP_CallBuiltin0 = 0x1A, + OP_CallBuiltin1 = 0x1B, + OP_CallBuiltin2 = 0x1C, + OP_CallBuiltin3 = 0x1D, + OP_CallBuiltin4 = 0x1E, + OP_CallBuiltin5 = 0x1F, + OP_CallBuiltin = 0x20, + OP_BoolNot = 0x21, + OP_ScriptFarMethodThreadCall = 0x22, + OP_JumpOnTrueExpr = 0x23, + OP_SetLevelFieldVariableField = 0x24, + OP_CastBool = 0x25, + OP_EvalNewLocalArrayRefCached0 = 0x26, + OP_CallBuiltinPointer = 0x27, + OP_inequality = 0x28, + OP_GetThisthread = 0x29, + OP_ClearFieldVariable = 0x2A, + OP_GetFloat = 0x2B, + OP_SafeCreateVariableFieldCached = 0x2C, + OP_ScriptFarFunctionCall2 = 0x2D, + OP_ScriptFarFunctionCall = 0x2E, + OP_ScriptFarChildThreadCall = 0x2F, + OP_ClearLocalVariableFieldCached0 = 0x30, + OP_ClearLocalVariableFieldCached = 0x31, + OP_checkclearparams = 0x32, + OP_CastFieldObject = 0x33, + OP_End = 0x34, + OP_size = 0x35, + OP_EmptyArray = 0x36, + OP_bit_and = 0x37, + OP_less_equal = 0x38, + OP_voidCodepos = 0x39, + OP_ScriptMethodThreadCallPointer = 0x3A, + OP_endswitch = 0x3B, + OP_ClearVariableField = 0x3C, + OP_divide = 0x3D, + OP_ScriptFarMethodChildThreadCall = 0x3E, + OP_GetUnsignedShort = 0x3F, + OP_JumpOnTrue = 0x40, + OP_GetSelf = 0x41, + OP_ScriptFarThreadCall = 0x42, + OP_ScriptLocalThreadCall = 0x43, + OP_SetLocalVariableFieldCached0 = 0x44, + OP_SetLocalVariableFieldCached = 0x45, + OP_plus = 0x46, + OP_BoolComplement = 0x47, + OP_ScriptMethodCallPointer = 0x48, + OP_inc = 0x49, + OP_RemoveLocalVariables = 0x4A, + OP_JumpOnFalseExpr = 0x4B, + OP_switch = 0x4C, + OP_clearparams = 0x4D, + OP_EvalLocalVariableRefCached0 = 0x4E, + OP_EvalLocalVariableRefCached = 0x4F, + OP_ScriptLocalMethodCall = 0x50, + OP_EvalFieldVariable = 0x51, + OP_EvalFieldVariableRef = 0x52, + OP_GetString = 0x53, + OP_ScriptFunctionCallPointer = 0x54, + OP_EvalLevelFieldVariable = 0x55, + OP_GetVector = 0x56, + OP_endon = 0x57, + OP_greater_equal = 0x58, + OP_GetSelfObject = 0x59, + OP_SetAnimFieldVariableField = 0x5A, + OP_SetVariableField = 0x5B, + OP_ScriptLocalFunctionCall2 = 0x5C, + OP_ScriptLocalFunctionCall = 0x5D, + OP_EvalLocalArrayRefCached0 = 0x5E, + OP_EvalLocalArrayRefCached = 0x5F, + OP_GetFarFunction = 0x60, + OP_less = 0x61, + OP_GetGameRef = 0x62, + OP_waitFrame = 0x63, + OP_waittillFrameEnd = 0x64, + OP_SafeSetVariableFieldCached0 = 0x65, + OP_SafeSetVariableFieldCached = 0x66, + OP_ScriptMethodChildThreadCallPointer = 0x67, + OP_GetLevel = 0x68, + OP_notify = 0x69, + OP_DecTop = 0x6A, + OP_shift_left = 0x6B, + OP_ScriptLocalMethodThreadCall = 0x6C, + OP_ScriptLocalMethodChildThreadCall = 0x6D, + OP_greater = 0x6E, + OP_EvalLocalVariableCached0 = 0x6F, + OP_EvalLocalVariableCached1 = 0x70, + OP_EvalLocalVariableCached2 = 0x71, + OP_EvalLocalVariableCached3 = 0x72, + OP_EvalLocalVariableCached4 = 0x73, + OP_EvalLocalVariableCached5 = 0x74, + OP_EvalLocalVariableCached = 0x75, + OP_SafeSetWaittillVariableFieldCached = 0x76, + OP_jump = 0x77, + OP_ScriptThreadCallPointer = 0x78, + OP_GetZero = 0x79, + OP_wait = 0x7A, + OP_minus = 0x7B, + OP_SetSelfFieldVariableField = 0x7C, + OP_EvalNewLocalVariableRefCached0 = 0x7D, + OP_multiply = 0x7E, + OP_CreateLocalVariable = 0x7F, + OP_ScriptLocalChildThreadCall = 0x80, + OP_GetInteger = 0x81, + OP_mod = 0x82, + OP_EvalAnimFieldVariableRef = 0x83, + OP_GetBuiltinFunction = 0x84, + OP_GetGame = 0x85, + OP_waittill = 0x86, + OP_dec = 0x87, + OP_EvalLocalVariableObjectCached = 0x88, + OP_PreScriptCall = 0x89, + OP_GetAnim = 0x8A, + OP_GetUndefined = 0x8B, + OP_EvalLevelFieldVariableRef = 0x8C, + OP_GetAnimObject = 0x8D, + OP_GetLevelObject = 0x8E, + OP_bit_ex_or = 0x8F, + OP_equality = 0x90, + OP_ClearArray = 0x91, + OP_jumpback = 0x92, + OP_GetAnimation = 0x93, + OP_EvalAnimFieldVariable = 0x94, + OP_GetAnimTree = 0x95, + OP_GetIString = 0x96, + OP_EvalArrayRef = 0x97, + OP_EvalSelfFieldVariableRef = 0x98, + OP_GetNegByte = 0x99, + OP_GetBuiltinMethod = 0x9A, + OP_CallBuiltinMethodPointer = 0x9B, + OP_EvalArray = 0x9C, + OP_vector = 0x9D, + OP_ScriptFarMethodCall = 0x9E, + OP_EvalLocalArrayCached = 0x9F, + OP_GetByte = 0xA0, + OP_ScriptChildThreadCallPointer = 0xA1, + OP_bit_or = 0xA2, + OP_AddArray = 0xA3, + OP_waittillmatch2 = 0xA4, + OP_waittillmatch = 0xA5, + OP_GetLocalFunction = 0xA6, + OP_GetNegUnsignedShort = 0xA7, + OP_shift_right = 0xA8, + OP_CallBuiltinMethod0 = 0xA9, + OP_CallBuiltinMethod1 = 0xAA, + OP_CallBuiltinMethod2 = 0xAB, + OP_CallBuiltinMethod3 = 0xAC, + OP_CallBuiltinMethod4 = 0xAD, + OP_CallBuiltinMethod5 = 0xAE, + OP_CallBuiltinMethod = 0xAF, + OP_JumpOnFalse = 0xB0, + OP_Count = 0xB1, +}; + +auto opcode_size(std::uint8_t op) -> std::uint32_t; + +} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/lexer.cpp b/src/h1/xsk/lexer.cpp new file mode 100644 index 00000000..57e31a66 --- /dev/null +++ b/src/h1/xsk/lexer.cpp @@ -0,0 +1,2826 @@ +#line 1 "lexer.cpp" +#include "stdafx.hpp" +#include "h1.hpp" +#include "parser.hpp" +using namespace xsk::gsc; + +#line 7 "lexer.cpp" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define h1__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer h1__create_buffer +#endif + +#ifdef yy_delete_buffer +#define h1__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer h1__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define h1__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer h1__scan_buffer +#endif + +#ifdef yy_scan_string +#define h1__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string h1__scan_string +#endif + +#ifdef yy_scan_bytes +#define h1__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes h1__scan_bytes +#endif + +#ifdef yy_init_buffer +#define h1__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer h1__init_buffer +#endif + +#ifdef yy_flush_buffer +#define h1__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer h1__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define h1__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state h1__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define h1__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer h1__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define h1_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state h1_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define h1_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state h1_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define h1_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack h1_ensure_buffer_stack +#endif + +#ifdef yylex +#define h1_lex_ALREADY_DEFINED +#else +#define yylex h1_lex +#endif + +#ifdef yyrestart +#define h1_restart_ALREADY_DEFINED +#else +#define yyrestart h1_restart +#endif + +#ifdef yylex_init +#define h1_lex_init_ALREADY_DEFINED +#else +#define yylex_init h1_lex_init +#endif + +#ifdef yylex_init_extra +#define h1_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra h1_lex_init_extra +#endif + +#ifdef yylex_destroy +#define h1_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy h1_lex_destroy +#endif + +#ifdef yyget_debug +#define h1_get_debug_ALREADY_DEFINED +#else +#define yyget_debug h1_get_debug +#endif + +#ifdef yyset_debug +#define h1_set_debug_ALREADY_DEFINED +#else +#define yyset_debug h1_set_debug +#endif + +#ifdef yyget_extra +#define h1_get_extra_ALREADY_DEFINED +#else +#define yyget_extra h1_get_extra +#endif + +#ifdef yyset_extra +#define h1_set_extra_ALREADY_DEFINED +#else +#define yyset_extra h1_set_extra +#endif + +#ifdef yyget_in +#define h1_get_in_ALREADY_DEFINED +#else +#define yyget_in h1_get_in +#endif + +#ifdef yyset_in +#define h1_set_in_ALREADY_DEFINED +#else +#define yyset_in h1_set_in +#endif + +#ifdef yyget_out +#define h1_get_out_ALREADY_DEFINED +#else +#define yyget_out h1_get_out +#endif + +#ifdef yyset_out +#define h1_set_out_ALREADY_DEFINED +#else +#define yyset_out h1_set_out +#endif + +#ifdef yyget_leng +#define h1_get_leng_ALREADY_DEFINED +#else +#define yyget_leng h1_get_leng +#endif + +#ifdef yyget_text +#define h1_get_text_ALREADY_DEFINED +#else +#define yyget_text h1_get_text +#endif + +#ifdef yyget_lineno +#define h1_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno h1_get_lineno +#endif + +#ifdef yyset_lineno +#define h1_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno h1_set_lineno +#endif + +#ifdef yyget_column +#define h1_get_column_ALREADY_DEFINED +#else +#define yyget_column h1_get_column +#endif + +#ifdef yyset_column +#define h1_set_column_ALREADY_DEFINED +#else +#define yyset_column h1_set_column +#endif + +#ifdef yywrap +#define h1_wrap_ALREADY_DEFINED +#else +#define yywrap h1_wrap +#endif + +#ifdef yyalloc +#define h1_alloc_ALREADY_DEFINED +#else +#define yyalloc h1_alloc +#endif + +#ifdef yyrealloc +#define h1_realloc_ALREADY_DEFINED +#else +#define yyrealloc h1_realloc +#endif + +#ifdef yyfree +#define h1_free_ALREADY_DEFINED +#else +#define yyfree h1_free +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. + */ +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yyg->yy_start = 1 + 2 * +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yyg->yy_start - 1) / 2) +#define YYSTATE YY_START +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +#define yy_new_buffer yy_create_buffer +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define h1_wrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; + +typedef int yy_state_type; + +#define yytext_ptr yytext_r + +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yyg->yy_c_buf_p = yy_cp; +#define YY_NUM_RULES 97 +#define YY_END_OF_BUFFER 98 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[286] = + { 0, + 0, 0, 0, 0, 0, 0, 98, 96, 1, 2, + 85, 96, 96, 84, 88, 96, 46, 47, 82, 80, + 52, 81, 53, 83, 95, 55, 56, 69, 79, 70, + 91, 50, 51, 89, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 48, + 87, 49, 86, 5, 6, 5, 9, 10, 9, 66, + 0, 93, 0, 0, 0, 0, 75, 0, 64, 0, + 77, 0, 0, 73, 57, 71, 58, 72, 94, 8, + 4, 3, 74, 94, 95, 0, 0, 54, 61, 67, + 65, 68, 62, 91, 78, 91, 91, 91, 91, 91, + + 91, 91, 91, 91, 91, 91, 22, 27, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 76, + 63, 7, 11, 0, 93, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 0, 93, 0, 94, 3, 94, + 94, 90, 59, 60, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 25, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 0, 0, + 0, 0, 92, 0, 0, 92, 0, 44, 91, 37, + 29, 91, 91, 91, 23, 91, 91, 91, 42, 91, + 91, 91, 43, 41, 91, 91, 91, 38, 91, 17, + + 91, 0, 0, 0, 31, 91, 91, 91, 15, 39, + 91, 45, 91, 91, 91, 91, 91, 91, 91, 91, + 24, 0, 0, 0, 91, 91, 91, 91, 16, 33, + 28, 91, 34, 91, 91, 91, 0, 0, 0, 91, + 91, 30, 26, 91, 91, 91, 91, 0, 12, 0, + 91, 32, 91, 91, 91, 18, 14, 0, 91, 91, + 40, 21, 91, 91, 0, 91, 36, 91, 91, 0, + 35, 91, 91, 0, 91, 91, 0, 91, 19, 0, + 91, 13, 91, 20, 0 + } ; + +static const YY_CHAR yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 5, 6, 1, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, + 22, 23, 1, 1, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 25, 26, 27, 28, 29, 1, 30, 31, 32, 33, + + 34, 35, 36, 37, 38, 24, 39, 40, 41, 42, + 43, 24, 24, 44, 45, 46, 47, 48, 49, 24, + 50, 51, 52, 53, 54, 55, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static const YY_CHAR yy_meta[56] = + { 0, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 1, 4, 1, 1, + 1, 1, 1, 4, 1, 5, 1, 1, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 1, 1, 1, 1 + } ; + +static const flex_int16_t yy_base[300] = + { 0, + 0, 0, 53, 54, 55, 56, 540, 541, 541, 541, + 517, 55, 33, 516, 64, 58, 541, 541, 515, 55, + 541, 60, 518, 73, 71, 516, 541, 70, 512, 71, + 507, 541, 541, 510, 57, 44, 70, 72, 75, 78, + 48, 76, 86, 79, 90, 93, 88, 84, 103, 541, + 81, 541, 541, 541, 541, 514, 541, 541, 513, 541, + 104, 541, 132, 487, 486, 482, 541, 118, 541, 119, + 541, 127, 138, 541, 541, 541, 541, 541, 120, 541, + 541, 0, 541, 121, 133, 134, 0, 541, 504, 541, + 541, 541, 503, 498, 541, 38, 120, 117, 135, 126, + + 137, 122, 143, 139, 140, 144, 497, 496, 145, 148, + 149, 151, 152, 154, 160, 155, 156, 161, 162, 541, + 541, 541, 541, 185, 191, 202, 483, 488, 481, 192, + 541, 203, 200, 207, 204, 205, 212, 541, 0, 201, + 541, 492, 541, 541, 186, 194, 197, 206, 199, 196, + 215, 209, 208, 218, 220, 221, 222, 223, 224, 227, + 226, 231, 233, 232, 238, 239, 241, 242, 476, 476, + 473, 264, 265, 271, 266, 270, 277, 488, 255, 487, + 486, 262, 263, 257, 485, 258, 259, 272, 484, 273, + 279, 157, 483, 482, 280, 281, 285, 481, 282, 283, + + 290, 460, 458, 468, 477, 284, 293, 294, 476, 475, + 296, 474, 295, 297, 299, 300, 305, 306, 307, 314, + 473, 454, 464, 467, 316, 315, 317, 320, 469, 468, + 467, 321, 466, 322, 324, 329, 457, 456, 459, 323, + 332, 462, 461, 334, 344, 330, 333, 452, 541, 443, + 346, 458, 349, 348, 350, 351, 541, 445, 357, 356, + 456, 455, 359, 364, 426, 362, 393, 367, 365, 372, + 391, 372, 370, 371, 373, 375, 380, 374, 384, 372, + 378, 541, 383, 379, 541, 420, 425, 430, 435, 438, + 440, 445, 450, 455, 460, 465, 357, 470, 475 + + } ; + +static const flex_int16_t yy_def[300] = + { 0, + 285, 1, 286, 286, 287, 287, 285, 285, 285, 285, + 285, 288, 285, 285, 285, 289, 285, 285, 285, 285, + 285, 285, 285, 285, 290, 285, 285, 285, 285, 285, + 291, 285, 285, 285, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 288, 285, 292, 285, 285, 285, 285, 293, 285, 294, + 285, 289, 295, 285, 285, 285, 285, 285, 285, 285, + 285, 296, 285, 285, 290, 290, 297, 285, 285, 285, + 285, 285, 285, 291, 285, 291, 291, 291, 291, 291, + + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 285, + 285, 285, 285, 288, 288, 292, 285, 285, 285, 293, + 285, 298, 294, 299, 289, 289, 295, 285, 296, 285, + 285, 297, 285, 285, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 285, 285, + 285, 293, 293, 298, 294, 294, 299, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + + 291, 285, 285, 285, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 285, 285, 285, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 285, 285, 285, 291, + 291, 291, 291, 291, 291, 291, 291, 285, 285, 285, + 291, 291, 291, 291, 291, 291, 285, 285, 291, 291, + 291, 291, 291, 291, 285, 291, 291, 291, 291, 285, + 291, 291, 291, 285, 291, 291, 285, 291, 291, 285, + 291, 285, 291, 291, 0, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285 + + } ; + +static const flex_int16_t yy_nxt[597] = + { 0, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 8, 33, 34, 31, 35, + 36, 37, 38, 39, 40, 41, 31, 42, 31, 43, + 31, 44, 31, 45, 46, 47, 48, 31, 49, 31, + 31, 50, 51, 52, 53, 55, 55, 58, 58, 62, + 59, 59, 64, 87, 56, 56, 62, 75, 68, 87, + 65, 69, 70, 87, 77, 145, 76, 106, 80, 66, + 63, 78, 87, 73, 81, 71, 84, 97, 85, 82, + 89, 90, 92, 93, 83, 87, 87, 87, 96, 98, + + 87, 87, 120, 87, 87, 101, 99, 104, 62, 87, + 107, 87, 100, 87, 102, 87, 103, 108, 87, 109, + 105, 110, 131, 111, 115, 117, 112, 131, 87, 63, + 113, 116, 118, 121, 61, 62, 125, 79, 140, 119, + 72, 114, 87, 132, 134, 87, 136, 87, 84, 285, + 85, 87, 73, 146, 138, 141, 147, 126, 87, 87, + 87, 148, 87, 137, 87, 87, 152, 150, 87, 87, + 87, 151, 149, 87, 87, 153, 87, 87, 154, 87, + 87, 87, 87, 155, 156, 87, 87, 87, 166, 62, + 160, 162, 157, 158, 159, 62, 131, 163, 167, 168, + + 214, 165, 161, 164, 61, 130, 125, 173, 131, 133, + 63, 87, 62, 62, 72, 176, 63, 132, 140, 87, + 136, 87, 87, 179, 87, 134, 178, 126, 174, 73, + 73, 87, 177, 87, 87, 141, 180, 137, 182, 181, + 87, 183, 185, 87, 184, 87, 87, 87, 87, 87, + 186, 87, 87, 188, 189, 190, 87, 87, 87, 194, + 191, 193, 187, 87, 87, 197, 87, 87, 131, 131, + 192, 198, 199, 130, 131, 173, 195, 196, 131, 133, + 87, 201, 87, 87, 87, 176, 200, 87, 87, 132, + 132, 134, 210, 205, 206, 134, 174, 87, 87, 209, + + 207, 211, 177, 208, 87, 87, 87, 87, 87, 87, + 87, 215, 212, 213, 217, 87, 218, 219, 87, 87, + 87, 87, 87, 221, 87, 87, 216, 228, 220, 225, + 87, 87, 87, 227, 226, 231, 232, 233, 230, 87, + 87, 87, 87, 234, 229, 87, 87, 87, 87, 87, + 235, 236, 240, 246, 87, 87, 243, 87, 87, 87, + 142, 241, 242, 245, 244, 252, 251, 253, 247, 87, + 255, 87, 256, 87, 87, 87, 87, 254, 260, 259, + 261, 87, 87, 262, 87, 263, 266, 87, 267, 87, + 87, 264, 87, 269, 271, 87, 272, 87, 87, 87, + + 87, 276, 268, 87, 87, 282, 278, 281, 87, 87, + 273, 279, 275, 280, 277, 284, 87, 274, 87, 283, + 54, 54, 54, 54, 54, 57, 57, 57, 57, 57, + 61, 61, 61, 61, 61, 72, 72, 72, 72, 72, + 86, 86, 86, 94, 94, 124, 124, 124, 124, 124, + 130, 130, 130, 130, 130, 133, 133, 133, 133, 133, + 135, 135, 135, 135, 135, 139, 270, 139, 139, 139, + 172, 172, 172, 172, 172, 175, 175, 175, 175, 175, + 87, 87, 265, 87, 258, 257, 87, 87, 250, 249, + 248, 87, 87, 87, 87, 239, 238, 237, 87, 87, + + 87, 87, 87, 224, 223, 222, 87, 87, 87, 87, + 87, 87, 87, 87, 204, 203, 202, 87, 171, 170, + 169, 87, 87, 87, 144, 143, 129, 128, 127, 123, + 122, 95, 87, 91, 88, 79, 74, 67, 60, 285, + 7, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285 + + } ; + +static const flex_int16_t yy_chk[597] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 4, 5, 6, 12, + 5, 6, 13, 96, 3, 4, 16, 20, 15, 36, + 13, 15, 15, 41, 22, 96, 20, 41, 24, 13, + 12, 22, 35, 16, 24, 15, 25, 36, 25, 24, + 28, 28, 30, 30, 24, 37, 25, 38, 35, 37, + + 39, 42, 51, 40, 44, 38, 37, 40, 61, 48, + 42, 43, 37, 47, 39, 45, 39, 42, 46, 43, + 40, 44, 68, 45, 47, 48, 46, 70, 49, 61, + 46, 47, 49, 51, 63, 72, 63, 79, 84, 49, + 73, 46, 98, 68, 70, 97, 73, 102, 85, 86, + 85, 100, 72, 97, 79, 84, 98, 63, 85, 86, + 99, 98, 101, 73, 104, 105, 102, 100, 103, 106, + 109, 101, 99, 110, 111, 103, 112, 113, 104, 114, + 116, 117, 192, 105, 106, 115, 118, 119, 117, 124, + 112, 114, 109, 110, 111, 125, 130, 115, 118, 119, + + 192, 116, 113, 115, 126, 132, 126, 132, 133, 134, + 124, 145, 135, 136, 137, 134, 125, 130, 140, 146, + 137, 150, 147, 146, 149, 133, 145, 126, 132, 135, + 136, 148, 134, 153, 152, 140, 147, 137, 149, 148, + 151, 150, 152, 154, 151, 155, 156, 157, 158, 159, + 153, 161, 160, 155, 156, 157, 162, 164, 163, 161, + 158, 160, 154, 165, 166, 164, 167, 168, 172, 173, + 159, 165, 166, 174, 175, 174, 162, 163, 176, 177, + 179, 168, 184, 186, 187, 177, 167, 182, 183, 172, + 173, 175, 187, 179, 182, 176, 174, 188, 190, 186, + + 183, 188, 177, 184, 191, 195, 196, 199, 200, 206, + 197, 195, 190, 191, 197, 201, 199, 200, 207, 208, + 213, 211, 214, 201, 215, 216, 196, 211, 200, 206, + 217, 218, 219, 208, 207, 215, 216, 217, 214, 220, + 226, 225, 227, 218, 213, 228, 232, 234, 240, 235, + 219, 220, 225, 235, 236, 246, 228, 241, 247, 244, + 297, 226, 227, 234, 232, 241, 240, 244, 236, 245, + 246, 251, 247, 254, 253, 255, 256, 245, 253, 251, + 254, 260, 259, 255, 263, 256, 259, 266, 260, 264, + 269, 256, 268, 264, 266, 273, 268, 272, 275, 278, + + 276, 273, 263, 281, 284, 280, 275, 278, 283, 279, + 269, 276, 272, 277, 274, 283, 271, 270, 267, 281, + 286, 286, 286, 286, 286, 287, 287, 287, 287, 287, + 288, 288, 288, 288, 288, 289, 289, 289, 289, 289, + 290, 290, 290, 291, 291, 292, 292, 292, 292, 292, + 293, 293, 293, 293, 293, 294, 294, 294, 294, 294, + 295, 295, 295, 295, 295, 296, 265, 296, 296, 296, + 298, 298, 298, 298, 298, 299, 299, 299, 299, 299, + 262, 261, 258, 252, 250, 248, 243, 242, 239, 238, + 237, 233, 231, 230, 229, 224, 223, 222, 221, 212, + + 210, 209, 205, 204, 203, 202, 198, 194, 193, 189, + 185, 181, 180, 178, 171, 170, 169, 142, 129, 128, + 127, 108, 107, 94, 93, 89, 66, 65, 64, 59, + 56, 34, 31, 29, 26, 23, 19, 14, 11, 7, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285 + + } ; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +#line 1 "lexer.lpp" +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ +#define YY_NO_INPUT 1 +#define YY_NO_UNISTD_H 1 + +#line 23 "lexer.lpp" +#define YY_USER_ACTION loc.columns(yyleng); +#line 874 "lexer.cpp" + +#line 876 "lexer.cpp" + +#define INITIAL 0 +#define COMMENT_BLOCK_STATE 1 +#define DEVELOPER_BLOCK_STATE 2 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +/* Holds the entire state of the reentrant scanner. */ +struct yyguts_t + { + + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; + + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + int yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + int yylineno_r; + int yy_flex_debug_r; + + char *yytext_r; + int yy_more_flag; + int yy_more_len; + + }; /* end struct yyguts_t */ + +static int yy_init_globals ( yyscan_t yyscanner ); + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput ( yyscan_t yyscanner ); +#else +static int input ( yyscan_t yyscanner ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + int n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK /*LINTED*/break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_load_buffer_state( yyscanner ); + } + + { +#line 36 "lexer.lpp" + + + +#line 40 "lexer.lpp" + loc.step(); + + +#line 1144 "lexer.cpp" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yyg->yy_start; +yy_match: + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 286 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + ++yy_cp; + } + while ( yy_current_state != 285 ); + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 43 "lexer.lpp" +{ loc.step(); } + YY_BREAK +case 2: +/* rule 2 can match eol */ +YY_RULE_SETUP +#line 45 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 47 "lexer.lpp" + + YY_BREAK +case 4: +YY_RULE_SETUP +#line 49 "lexer.lpp" +{ BEGIN(COMMENT_BLOCK_STATE); } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 50 "lexer.lpp" + + YY_BREAK +case 6: +/* rule 6 can match eol */ +YY_RULE_SETUP +#line 51 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 52 "lexer.lpp" +{ BEGIN(INITIAL); } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 54 "lexer.lpp" +{ BEGIN(DEVELOPER_BLOCK_STATE); } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 55 "lexer.lpp" + + YY_BREAK +case 10: +/* rule 10 can match eol */ +YY_RULE_SETUP +#line 56 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 57 "lexer.lpp" +{ BEGIN(INITIAL); } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 59 "lexer.lpp" +{ return h1::parser::make_INCLUDE(loc); } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 60 "lexer.lpp" +{ return h1::parser::make_USINGTREE(loc); } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 61 "lexer.lpp" +{ return h1::parser::make_ANIMTREE(loc); } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 62 "lexer.lpp" +{ return h1::parser::make_ENDON(loc); } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 63 "lexer.lpp" +{ return h1::parser::make_NOTIFY(loc); } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 64 "lexer.lpp" +{ return h1::parser::make_WAIT(loc); } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 65 "lexer.lpp" +{ return h1::parser::make_WAITTILL(loc); } + YY_BREAK +case 19: +YY_RULE_SETUP +#line 66 "lexer.lpp" +{ return h1::parser::make_WAITTILLMATCH(loc); } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 67 "lexer.lpp" +{ return h1::parser::make_WAITTILLFRAMEEND(loc); } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 68 "lexer.lpp" +{ return h1::parser::make_WAITFRAME(loc); } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 69 "lexer.lpp" +{ return h1::parser::make_IF(loc); } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 70 "lexer.lpp" +{ return h1::parser::make_ELSE(loc); } + YY_BREAK +case 24: +YY_RULE_SETUP +#line 71 "lexer.lpp" +{ return h1::parser::make_WHILE(loc); } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 72 "lexer.lpp" +{ return h1::parser::make_FOR(loc); } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 73 "lexer.lpp" +{ return h1::parser::make_FOREACH(loc); } + YY_BREAK +case 27: +YY_RULE_SETUP +#line 74 "lexer.lpp" +{ return h1::parser::make_IN(loc); } + YY_BREAK +case 28: +YY_RULE_SETUP +#line 75 "lexer.lpp" +{ return h1::parser::make_SWITCH(loc); } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 76 "lexer.lpp" +{ return h1::parser::make_CASE(loc); } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 77 "lexer.lpp" +{ return h1::parser::make_DEFAULT(loc); } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 78 "lexer.lpp" +{ return h1::parser::make_BREAK(loc); } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 79 "lexer.lpp" +{ return h1::parser::make_CONTINUE(loc); } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 80 "lexer.lpp" +{ return h1::parser::make_RETURN(loc); } + YY_BREAK +case 34: +YY_RULE_SETUP +#line 81 "lexer.lpp" +{ return h1::parser::make_THREAD(loc); } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 82 "lexer.lpp" +{ return h1::parser::make_CHILDTHREAD(loc); } + YY_BREAK +case 36: +YY_RULE_SETUP +#line 83 "lexer.lpp" +{ return h1::parser::make_THISTHREAD(loc); } + YY_BREAK +case 37: +YY_RULE_SETUP +#line 84 "lexer.lpp" +{ return h1::parser::make_CALL(loc); } + YY_BREAK +case 38: +YY_RULE_SETUP +#line 85 "lexer.lpp" +{ return h1::parser::make_TRUE(loc); } + YY_BREAK +case 39: +YY_RULE_SETUP +#line 86 "lexer.lpp" +{ return h1::parser::make_FALSE(loc); } + YY_BREAK +case 40: +YY_RULE_SETUP +#line 87 "lexer.lpp" +{ return h1::parser::make_UNDEFINED(loc); } + YY_BREAK +case 41: +YY_RULE_SETUP +#line 88 "lexer.lpp" +{ return h1::parser::make_SIZE(loc); } + YY_BREAK +case 42: +YY_RULE_SETUP +#line 89 "lexer.lpp" +{ return h1::parser::make_GAME(loc); } + YY_BREAK +case 43: +YY_RULE_SETUP +#line 90 "lexer.lpp" +{ return h1::parser::make_SELF(loc); } + YY_BREAK +case 44: +YY_RULE_SETUP +#line 91 "lexer.lpp" +{ return h1::parser::make_ANIM(loc); } + YY_BREAK +case 45: +YY_RULE_SETUP +#line 92 "lexer.lpp" +{ return h1::parser::make_LEVEL(loc); } + YY_BREAK +case 46: +YY_RULE_SETUP +#line 93 "lexer.lpp" +{ return h1::parser::make_LPAREN(loc); } + YY_BREAK +case 47: +YY_RULE_SETUP +#line 94 "lexer.lpp" +{ return h1::parser::make_RPAREN(loc); } + YY_BREAK +case 48: +YY_RULE_SETUP +#line 95 "lexer.lpp" +{ return h1::parser::make_LBRACE(loc); } + YY_BREAK +case 49: +YY_RULE_SETUP +#line 96 "lexer.lpp" +{ return h1::parser::make_RBRACE(loc); } + YY_BREAK +case 50: +YY_RULE_SETUP +#line 97 "lexer.lpp" +{ return h1::parser::make_LBRACKET(loc); } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 98 "lexer.lpp" +{ return h1::parser::make_RBRACKET(loc); } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 99 "lexer.lpp" +{ return h1::parser::make_COMMA(loc); } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 100 "lexer.lpp" +{ return h1::parser::make_DOT(loc); } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 101 "lexer.lpp" +{ return h1::parser::make_DOUBLECOLON(loc); } + YY_BREAK +case 55: +YY_RULE_SETUP +#line 102 "lexer.lpp" +{ return h1::parser::make_COLON(loc); } + YY_BREAK +case 56: +YY_RULE_SETUP +#line 103 "lexer.lpp" +{ return h1::parser::make_SEMICOLON(loc); } + YY_BREAK +case 57: +YY_RULE_SETUP +#line 104 "lexer.lpp" +{ return h1::parser::make_INCREMENT(loc); } + YY_BREAK +case 58: +YY_RULE_SETUP +#line 105 "lexer.lpp" +{ return h1::parser::make_DECREMENT(loc); } + YY_BREAK +case 59: +YY_RULE_SETUP +#line 106 "lexer.lpp" +{ return h1::parser::make_ASSIGN_LSHIFT(loc); } + YY_BREAK +case 60: +YY_RULE_SETUP +#line 107 "lexer.lpp" +{ return h1::parser::make_ASSIGN_RSHIFT(loc); } + YY_BREAK +case 61: +YY_RULE_SETUP +#line 108 "lexer.lpp" +{ return h1::parser::make_LSHIFT(loc); } + YY_BREAK +case 62: +YY_RULE_SETUP +#line 109 "lexer.lpp" +{ return h1::parser::make_RSHIFT(loc); } + YY_BREAK +case 63: +YY_RULE_SETUP +#line 110 "lexer.lpp" +{ return h1::parser::make_OR(loc); } + YY_BREAK +case 64: +YY_RULE_SETUP +#line 111 "lexer.lpp" +{ return h1::parser::make_AND(loc); } + YY_BREAK +case 65: +YY_RULE_SETUP +#line 112 "lexer.lpp" +{ return h1::parser::make_EQUALITY(loc); } + YY_BREAK +case 66: +YY_RULE_SETUP +#line 113 "lexer.lpp" +{ return h1::parser::make_INEQUALITY(loc); } + YY_BREAK +case 67: +YY_RULE_SETUP +#line 114 "lexer.lpp" +{ return h1::parser::make_LESS_EQUAL(loc); } + YY_BREAK +case 68: +YY_RULE_SETUP +#line 115 "lexer.lpp" +{ return h1::parser::make_GREATER_EQUAL(loc); } + YY_BREAK +case 69: +YY_RULE_SETUP +#line 116 "lexer.lpp" +{ return h1::parser::make_LESS(loc); } + YY_BREAK +case 70: +YY_RULE_SETUP +#line 117 "lexer.lpp" +{ return h1::parser::make_GREATER(loc); } + YY_BREAK +case 71: +YY_RULE_SETUP +#line 118 "lexer.lpp" +{ return h1::parser::make_ASSIGN_ADD(loc); } + YY_BREAK +case 72: +YY_RULE_SETUP +#line 119 "lexer.lpp" +{ return h1::parser::make_ASSIGN_SUB(loc); } + YY_BREAK +case 73: +YY_RULE_SETUP +#line 120 "lexer.lpp" +{ return h1::parser::make_ASSIGN_MULT(loc); } + YY_BREAK +case 74: +YY_RULE_SETUP +#line 121 "lexer.lpp" +{ return h1::parser::make_ASSIGN_DIV(loc); } + YY_BREAK +case 75: +YY_RULE_SETUP +#line 122 "lexer.lpp" +{ return h1::parser::make_ASSIGN_MOD(loc); } + YY_BREAK +case 76: +YY_RULE_SETUP +#line 123 "lexer.lpp" +{ return h1::parser::make_ASSIGN_BITWISE_OR(loc); } + YY_BREAK +case 77: +YY_RULE_SETUP +#line 124 "lexer.lpp" +{ return h1::parser::make_ASSIGN_BITWISE_AND(loc); } + YY_BREAK +case 78: +YY_RULE_SETUP +#line 125 "lexer.lpp" +{ return h1::parser::make_ASSIGN_BITWISE_EXOR(loc); } + YY_BREAK +case 79: +YY_RULE_SETUP +#line 126 "lexer.lpp" +{ return h1::parser::make_ASSIGN(loc); } + YY_BREAK +case 80: +YY_RULE_SETUP +#line 127 "lexer.lpp" +{ return h1::parser::make_ADD(loc); } + YY_BREAK +case 81: +YY_RULE_SETUP +#line 128 "lexer.lpp" +{ return h1::parser::make_SUB(loc); } + YY_BREAK +case 82: +YY_RULE_SETUP +#line 129 "lexer.lpp" +{ return h1::parser::make_MULT(loc); } + YY_BREAK +case 83: +YY_RULE_SETUP +#line 130 "lexer.lpp" +{ return h1::parser::make_DIV(loc); } + YY_BREAK +case 84: +YY_RULE_SETUP +#line 131 "lexer.lpp" +{ return h1::parser::make_MOD(loc); } + YY_BREAK +case 85: +YY_RULE_SETUP +#line 132 "lexer.lpp" +{ return h1::parser::make_NOT(loc); } + YY_BREAK +case 86: +YY_RULE_SETUP +#line 133 "lexer.lpp" +{ return h1::parser::make_COMPLEMENT(loc); } + YY_BREAK +case 87: +YY_RULE_SETUP +#line 134 "lexer.lpp" +{ return h1::parser::make_BITWISE_OR(loc); } + YY_BREAK +case 88: +YY_RULE_SETUP +#line 135 "lexer.lpp" +{ return h1::parser::make_BITWISE_AND(loc); } + YY_BREAK +case 89: +YY_RULE_SETUP +#line 136 "lexer.lpp" +{ return h1::parser::make_BITWISE_EXOR(loc); } + YY_BREAK +case 90: +YY_RULE_SETUP +#line 137 "lexer.lpp" +{ return h1::parser::make_FILE(utils::string::fordslash(yytext), loc); } + YY_BREAK +case 91: +YY_RULE_SETUP +#line 138 "lexer.lpp" +{ return h1::parser::make_NAME((std::string(yytext, 3) == "_ID") ? std::string(yytext) : utils::string::to_lower(yytext), loc); } + YY_BREAK +case 92: +/* rule 92 can match eol */ +YY_RULE_SETUP +#line 139 "lexer.lpp" +{ return h1::parser::make_ISTRING(std::string(yytext).substr(1), loc); } + YY_BREAK +case 93: +/* rule 93 can match eol */ +YY_RULE_SETUP +#line 140 "lexer.lpp" +{ return h1::parser::make_STRING(std::string(yytext), loc); } + YY_BREAK +case 94: +YY_RULE_SETUP +#line 141 "lexer.lpp" +{ return h1::parser::make_FLOAT(std::string(yytext), loc); } + YY_BREAK +case 95: +YY_RULE_SETUP +#line 142 "lexer.lpp" +{ return h1::parser::make_INTEGER(std::string(yytext), loc); } + YY_BREAK +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(COMMENT_BLOCK_STATE): +case YY_STATE_EOF(DEVELOPER_BLOCK_STATE): +#line 143 "lexer.lpp" +{ return h1::parser::make_H1EOF(loc); } + YY_BREAK +case 96: +/* rule 96 can match eol */ +YY_RULE_SETUP +#line 144 "lexer.lpp" +{ throw h1::parser::syntax_error(loc, "bad token: \'" + std::string(yytext) + "\'"); } + YY_BREAK +case 97: +YY_RULE_SETUP +#line 146 "lexer.lpp" +ECHO; + YY_BREAK +#line 1694 "lexer.cpp" + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( yywrap( yyscanner ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + yyg->yy_n_chars, num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin , yyscanner); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) +{ + yy_state_type yy_current_state; + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_current_state = yyg->yy_start; + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 286 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) +{ + int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + char *yy_cp = yyg->yy_c_buf_p; + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 286 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 285); + + (void)yyg; + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (yyscan_t yyscanner) +#else + static int input (yyscan_t yyscanner) +#endif + +{ + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin , yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( yyscanner ) ) + return 0; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(yyscanner); +#else + return input(yyscanner); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * @param yyscanner The scanner object. + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * @param yyscanner The scanner object. + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( yyscanner ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yyg->yy_did_buffer_switch_on_eof = 1; +} + +static void yy_load_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyg->yy_hold_char = *yyg->yy_c_buf_p; +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * @param yyscanner The scanner object. + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file , yyscanner); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * @param yyscanner The scanner object. + */ + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf , yyscanner ); + + yyfree( (void *) b , yyscanner ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + +{ + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_flush_buffer( b , yyscanner); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param yyscanner The scanner object. + */ + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( yyscanner ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * @param yyscanner The scanner object. + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(yyscanner); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * @param yyscanner The scanner object. + */ +void yypop_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (yyscan_t yyscanner) +{ + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (!yyg->yy_buffer_stack) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->yy_buffer_stack_max = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b , yyscanner ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n , yyscanner); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the user-defined data for this scanner. + * @param yyscanner The scanner object. + */ +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; +} + +/** Get the current line number. + * @param yyscanner The scanner object. + */ +int yyget_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; +} + +/** Get the current column number. + * @param yyscanner The scanner object. + */ +int yyget_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; +} + +/** Get the input stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; +} + +/** Get the output stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; +} + +/** Get the length of the current token. + * @param yyscanner The scanner object. + */ +int yyget_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; +} + +/** Get the current token. + * @param yyscanner The scanner object. + */ + +char *yyget_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; +} + +/** Set the user-defined data. This data is never touched by the scanner. + * @param user_defined The data to be associated with this scanner. + * @param yyscanner The scanner object. + */ +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; +} + +/** Set the current line number. + * @param _line_number line number + * @param yyscanner The scanner object. + */ +void yyset_lineno (int _line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + + yylineno = _line_number; +} + +/** Set the current column. + * @param _column_no column number + * @param yyscanner The scanner object. + */ +void yyset_column (int _column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + + yycolumn = _column_no; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * @param yyscanner The scanner object. + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * _in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; +} + +void yyset_out (FILE * _out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; +} + +int yyget_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; +} + +void yyset_debug (int _bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; +} + +/* Accessor methods for yylval and yylloc */ + +/* User-visible API */ + +/* yylex_init is special because it creates the scanner itself, so it is + * the ONLY reentrant function that doesn't take the scanner as the last argument. + * That's why we explicitly handle the declaration, instead of using our macros. + */ +int yylex_init(yyscan_t* ptr_yy_globals) +{ + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + return yy_init_globals ( *ptr_yy_globals ); +} + +/* yylex_init_extra has the same functionality as yylex_init, but follows the + * convention of taking the scanner as the last argument. Note however, that + * this is a *pointer* to a scanner, as it will be allocated by this call (and + * is the reason, too, why this function also must handle its own declaration). + * The user defined value in the first argument will be available to yyalloc in + * the yyextra field. + */ +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) +{ + struct yyguts_t dummy_yyguts; + + yyset_extra (yy_user_defined, &dummy_yyguts); + + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + yyset_extra (yy_user_defined, *ptr_yy_globals); + + return yy_init_globals ( *ptr_yy_globals ); +} + +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + yyg->yy_buffer_stack = NULL; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = NULL; + yyg->yy_init = 0; + yyg->yy_start = 0; + + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = NULL; + yyout = NULL; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(yyscanner); + } + + /* Destroy the stack itself. */ + yyfree(yyg->yy_buffer_stack , yyscanner); + yyg->yy_buffer_stack = NULL; + + /* Destroy the start condition stack. */ + yyfree( yyg->yy_start_stack , yyscanner ); + yyg->yy_start_stack = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( yyscanner); + + /* Destroy the main struct (reentrant only). */ + yyfree ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); +} + +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); +} + +void yyfree (void * ptr , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 146 "lexer.lpp" + + diff --git a/src/h1/xsk/lexer.hpp b/src/h1/xsk/lexer.hpp new file mode 100644 index 00000000..13d4a348 --- /dev/null +++ b/src/h1/xsk/lexer.hpp @@ -0,0 +1,708 @@ +#ifndef h1_HEADER_H +#define h1_HEADER_H 1 +#define h1_IN_HEADER 1 + +#line 5 "lexer.hpp" +#include "stdafx.hpp" +#include "h1.hpp" +#include "parser.hpp" +using namespace xsk::gsc; + +#line 11 "lexer.hpp" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define h1__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer h1__create_buffer +#endif + +#ifdef yy_delete_buffer +#define h1__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer h1__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define h1__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer h1__scan_buffer +#endif + +#ifdef yy_scan_string +#define h1__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string h1__scan_string +#endif + +#ifdef yy_scan_bytes +#define h1__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes h1__scan_bytes +#endif + +#ifdef yy_init_buffer +#define h1__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer h1__init_buffer +#endif + +#ifdef yy_flush_buffer +#define h1__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer h1__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define h1__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state h1__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define h1__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer h1__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define h1_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state h1_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define h1_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state h1_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define h1_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack h1_ensure_buffer_stack +#endif + +#ifdef yylex +#define h1_lex_ALREADY_DEFINED +#else +#define yylex h1_lex +#endif + +#ifdef yyrestart +#define h1_restart_ALREADY_DEFINED +#else +#define yyrestart h1_restart +#endif + +#ifdef yylex_init +#define h1_lex_init_ALREADY_DEFINED +#else +#define yylex_init h1_lex_init +#endif + +#ifdef yylex_init_extra +#define h1_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra h1_lex_init_extra +#endif + +#ifdef yylex_destroy +#define h1_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy h1_lex_destroy +#endif + +#ifdef yyget_debug +#define h1_get_debug_ALREADY_DEFINED +#else +#define yyget_debug h1_get_debug +#endif + +#ifdef yyset_debug +#define h1_set_debug_ALREADY_DEFINED +#else +#define yyset_debug h1_set_debug +#endif + +#ifdef yyget_extra +#define h1_get_extra_ALREADY_DEFINED +#else +#define yyget_extra h1_get_extra +#endif + +#ifdef yyset_extra +#define h1_set_extra_ALREADY_DEFINED +#else +#define yyset_extra h1_set_extra +#endif + +#ifdef yyget_in +#define h1_get_in_ALREADY_DEFINED +#else +#define yyget_in h1_get_in +#endif + +#ifdef yyset_in +#define h1_set_in_ALREADY_DEFINED +#else +#define yyset_in h1_set_in +#endif + +#ifdef yyget_out +#define h1_get_out_ALREADY_DEFINED +#else +#define yyget_out h1_get_out +#endif + +#ifdef yyset_out +#define h1_set_out_ALREADY_DEFINED +#else +#define yyset_out h1_set_out +#endif + +#ifdef yyget_leng +#define h1_get_leng_ALREADY_DEFINED +#else +#define yyget_leng h1_get_leng +#endif + +#ifdef yyget_text +#define h1_get_text_ALREADY_DEFINED +#else +#define yyget_text h1_get_text +#endif + +#ifdef yyget_lineno +#define h1_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno h1_get_lineno +#endif + +#ifdef yyset_lineno +#define h1_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno h1_set_lineno +#endif + +#ifdef yyget_column +#define h1_get_column_ALREADY_DEFINED +#else +#define yyget_column h1_get_column +#endif + +#ifdef yyset_column +#define h1_set_column_ALREADY_DEFINED +#else +#define yyset_column h1_set_column +#endif + +#ifdef yywrap +#define h1_wrap_ALREADY_DEFINED +#else +#define yywrap h1_wrap +#endif + +#ifdef yyalloc +#define h1_alloc_ALREADY_DEFINED +#else +#define yyalloc h1_alloc +#endif + +#ifdef yyrealloc +#define h1_realloc_ALREADY_DEFINED +#else +#define yyrealloc h1_realloc +#endif + +#ifdef yyfree +#define h1_free_ALREADY_DEFINED +#else +#define yyfree h1_free +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +/* Begin user sect3 */ + +#define h1_wrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP + +#define yytext_ptr yytext_r + +#ifdef YY_HEADER_EXPORT_START_CONDITIONS +#define INITIAL 0 +#define COMMENT_BLOCK_STATE 1 +#define DEVELOPER_BLOCK_STATE 2 + +#endif + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +#undef YY_NEW_FILE +#undef YY_FLUSH_BUFFER +#undef yy_set_bol +#undef yy_new_buffer +#undef yy_set_interactive +#undef YY_DO_BEFORE_ACTION + +#ifdef YY_DECL_IS_OURS +#undef YY_DECL_IS_OURS +#undef YY_DECL +#endif + +#ifndef h1__create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef h1__delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef h1__scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef h1__scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef h1__scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef h1__init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef h1__flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef h1__load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef h1__switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef h1_push_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef h1_pop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef h1_ensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef h1_lex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef h1_restart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef h1_lex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef h1_lex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef h1_lex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef h1_get_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef h1_set_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef h1_get_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef h1_set_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef h1_get_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef h1_set_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef h1_get_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef h1_set_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef h1_get_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef h1_get_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef h1_get_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef h1_set_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef h1_get_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef h1_set_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef h1_wrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef h1_get_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef h1_set_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef h1_get_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef h1_set_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef h1_alloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef h1_realloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef h1_free_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef h1_text_ALREADY_DEFINED +#undef yytext +#endif +#ifndef h1_leng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef h1_in_ALREADY_DEFINED +#undef yyin +#endif +#ifndef h1_out_ALREADY_DEFINED +#undef yyout +#endif +#ifndef h1__flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef h1_lineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef h1_tables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef h1_tables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef h1_TABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + +#line 146 "lexer.lpp" + + +#line 706 "lexer.hpp" +#undef h1_IN_HEADER +#endif /* h1_HEADER_H */ diff --git a/src/h1/xsk/parser.cpp b/src/h1/xsk/parser.cpp new file mode 100644 index 00000000..77f9d909 --- /dev/null +++ b/src/h1/xsk/parser.cpp @@ -0,0 +1,3994 @@ +// A Bison parser, made by GNU Bison 3.7.5. + +// Skeleton implementation for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. + +// 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 . + +// As a special exception, you may create a larger work that contains +// part or all of the Bison parser skeleton and distribute that work +// under terms of your choice, so long as that work isn't itself a +// parser generator using the skeleton or a modified version thereof +// as a parser skeleton. Alternatively, if you modify or redistribute +// the parser skeleton itself, you may (at your option) remove this +// special exception, which will cause the skeleton and the resulting +// Bison output files to be licensed under the GNU General Public +// License without this special exception. + +// This special exception was added by the Free Software Foundation in +// version 2.2 of Bison. + +// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, +// especially those whose name start with YY_ or yy_. They are +// private implementation details that can be changed or removed. + +// "%code top" blocks. +#line 40 "parser.ypp" + +#include "stdafx.hpp" +#include "parser.hpp" +#include "lexer.hpp" +using namespace xsk::gsc; +xsk::gsc::h1::parser::symbol_type H1lex(yyscan_t yyscanner, xsk::gsc::location& loc); + +#line 47 "parser.cpp" + +// Take the name prefix into account. +#define yylex H1lex + + + +#include "parser.hpp" + + + + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include // FIXME: INFRINGES ON USER NAME SPACE. +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + + +// Whether we are compiled with exception support. +#ifndef YY_EXCEPTIONS +# if defined __GNUC__ && !defined __EXCEPTIONS +# define YY_EXCEPTIONS 0 +# else +# define YY_EXCEPTIONS 1 +# endif +#endif + +#define YYRHSLOC(Rhs, K) ((Rhs)[K].location) +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +# ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).begin = YYRHSLOC (Rhs, 1).begin; \ + (Current).end = YYRHSLOC (Rhs, N).end; \ + } \ + else \ + { \ + (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ + } \ + while (false) +# endif + + +// Enable debugging if requested. +#if H1DEBUG + +// A pseudo ostream that takes yydebug_ into account. +# define YYCDEBUG if (yydebug_) (*yycdebug_) + +# define YY_SYMBOL_PRINT(Title, Symbol) \ + do { \ + if (yydebug_) \ + { \ + *yycdebug_ << Title << ' '; \ + yy_print_ (*yycdebug_, Symbol); \ + *yycdebug_ << '\n'; \ + } \ + } while (false) + +# define YY_REDUCE_PRINT(Rule) \ + do { \ + if (yydebug_) \ + yy_reduce_print_ (Rule); \ + } while (false) + +# define YY_STACK_PRINT() \ + do { \ + if (yydebug_) \ + yy_stack_print_ (); \ + } while (false) + +#else // !H1DEBUG + +# define YYCDEBUG if (false) std::cerr +# define YY_SYMBOL_PRINT(Title, Symbol) YY_USE (Symbol) +# define YY_REDUCE_PRINT(Rule) static_cast (0) +# define YY_STACK_PRINT() static_cast (0) + +#endif // !H1DEBUG + +#define yyerrok (yyerrstatus_ = 0) +#define yyclearin (yyla.clear ()) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYRECOVERING() (!!yyerrstatus_) + +#line 13 "parser.ypp" +namespace xsk { namespace gsc { namespace h1 { +#line 149 "parser.cpp" + + /// Build a parser object. + parser::parser (yyscan_t yyscanner_yyarg, xsk::gsc::location& loc_yyarg, xsk::gsc::program_ptr& ast_yyarg) +#if H1DEBUG + : yydebug_ (false), + yycdebug_ (&std::cerr), +#else + : +#endif + yy_lac_established_ (false), + yyscanner (yyscanner_yyarg), + loc (loc_yyarg), + ast (ast_yyarg) + {} + + parser::~parser () + {} + + parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW + {} + + /*---------------. + | symbol kinds. | + `---------------*/ + + + + // by_state. + parser::by_state::by_state () YY_NOEXCEPT + : state (empty_state) + {} + + parser::by_state::by_state (const by_state& that) YY_NOEXCEPT + : state (that.state) + {} + + void + parser::by_state::clear () YY_NOEXCEPT + { + state = empty_state; + } + + void + parser::by_state::move (by_state& that) + { + state = that.state; + that.clear (); + } + + parser::by_state::by_state (state_type s) YY_NOEXCEPT + : state (s) + {} + + parser::symbol_kind_type + parser::by_state::kind () const YY_NOEXCEPT + { + if (state == empty_state) + return symbol_kind::S_YYEMPTY; + else + return YY_CAST (symbol_kind_type, yystos_[+state]); + } + + parser::stack_symbol_type::stack_symbol_type () + {} + + parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) + : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.YY_MOVE_OR_COPY< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.YY_MOVE_OR_COPY< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.YY_MOVE_OR_COPY< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.YY_MOVE_OR_COPY< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.YY_MOVE_OR_COPY< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.YY_MOVE_OR_COPY< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.YY_MOVE_OR_COPY< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.YY_MOVE_OR_COPY< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.YY_MOVE_OR_COPY< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.YY_MOVE_OR_COPY< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.YY_MOVE_OR_COPY< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.YY_MOVE_OR_COPY< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.YY_MOVE_OR_COPY< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.YY_MOVE_OR_COPY< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.YY_MOVE_OR_COPY< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.YY_MOVE_OR_COPY< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.YY_MOVE_OR_COPY< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.YY_MOVE_OR_COPY< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.YY_MOVE_OR_COPY< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.YY_MOVE_OR_COPY< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.YY_MOVE_OR_COPY< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.YY_MOVE_OR_COPY< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.YY_MOVE_OR_COPY< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.YY_MOVE_OR_COPY< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.YY_MOVE_OR_COPY< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.YY_MOVE_OR_COPY< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.YY_MOVE_OR_COPY< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.YY_MOVE_OR_COPY< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.YY_MOVE_OR_COPY< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.YY_MOVE_OR_COPY< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.YY_MOVE_OR_COPY< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.YY_MOVE_OR_COPY< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.YY_MOVE_OR_COPY< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.YY_MOVE_OR_COPY< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.YY_MOVE_OR_COPY< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.YY_MOVE_OR_COPY< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.YY_MOVE_OR_COPY< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.YY_MOVE_OR_COPY< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.YY_MOVE_OR_COPY< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.YY_MOVE_OR_COPY< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.YY_MOVE_OR_COPY< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.YY_MOVE_OR_COPY< stmt_waitframe_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.YY_MOVE_OR_COPY< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.YY_MOVE_OR_COPY< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.YY_MOVE_OR_COPY< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.YY_MOVE_OR_COPY< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.YY_MOVE_OR_COPY< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.YY_MOVE_OR_COPY< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.YY_MOVE_OR_COPY< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.YY_MOVE_OR_COPY< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.YY_MOVE_OR_COPY< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.YY_MOVE_OR_COPY< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.YY_MOVE_OR_COPY< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + +#if 201103L <= YY_CPLUSPLUS + // that is emptied. + that.state = empty_state; +#endif + } + + parser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that) + : super_type (s, YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + + // that is emptied. + that.kind_ = symbol_kind::S_YYEMPTY; + } + +#if YY_CPLUSPLUS < 201103L + parser::stack_symbol_type& + parser::stack_symbol_type::operator= (const stack_symbol_type& that) + { + state = that.state; + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.copy< anim_ptr > (that.value); + break; + + case symbol_kind::S_animation: // animation + value.copy< animation_ptr > (that.value); + break; + + case symbol_kind::S_animtree: // animtree + value.copy< animtree_ptr > (that.value); + break; + + case symbol_kind::S_constant: // constant + value.copy< constant_ptr > (that.value); + break; + + case symbol_kind::S_define: // define + value.copy< define_ptr > (that.value); + break; + + case symbol_kind::S_empty_array: // empty_array + value.copy< empty_array_ptr > (that.value); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.copy< expr_arguments_ptr > (that.value); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.copy< expr_assign_ptr > (that.value); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.copy< expr_call_ptr > (that.value); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.copy< expr_call_type_ptr > (that.value); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.copy< expr_ptr > (that.value); + break; + + case symbol_kind::S_false: // false + value.copy< false_ptr > (that.value); + break; + + case symbol_kind::S_file: // file + value.copy< file_ptr > (that.value); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.copy< float_ptr > (that.value); + break; + + case symbol_kind::S_game: // game + value.copy< game_ptr > (that.value); + break; + + case symbol_kind::S_include: // include + value.copy< include_ptr > (that.value); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.copy< integer_ptr > (that.value); + break; + + case symbol_kind::S_istring: // istring + value.copy< istring_ptr > (that.value); + break; + + case symbol_kind::S_level: // level + value.copy< level_ptr > (that.value); + break; + + case symbol_kind::S_name: // name + value.copy< name_ptr > (that.value); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.copy< node_ptr > (that.value); + break; + + case symbol_kind::S_parameters: // parameters + value.copy< parameters_ptr > (that.value); + break; + + case symbol_kind::S_program: // program + value.copy< program_ptr > (that.value); + break; + + case symbol_kind::S_self: // self + value.copy< self_ptr > (that.value); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.copy< std::string > (that.value); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.copy< stmt_assign_ptr > (that.value); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.copy< stmt_break_ptr > (that.value); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.copy< stmt_call_ptr > (that.value); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.copy< stmt_case_ptr > (that.value); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.copy< stmt_continue_ptr > (that.value); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.copy< stmt_default_ptr > (that.value); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.copy< stmt_endon_ptr > (that.value); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.copy< stmt_for_ptr > (that.value); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.copy< stmt_foreach_ptr > (that.value); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.copy< stmt_if_ptr > (that.value); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.copy< stmt_ifelse_ptr > (that.value); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.copy< stmt_list_ptr > (that.value); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.copy< stmt_notify_ptr > (that.value); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.copy< stmt_ptr > (that.value); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.copy< stmt_return_ptr > (that.value); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.copy< stmt_switch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.copy< stmt_wait_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.copy< stmt_waitframe_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.copy< stmt_waittill_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.copy< stmt_waittillframeend_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.copy< stmt_waittillmatch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.copy< stmt_while_ptr > (that.value); + break; + + case symbol_kind::S_string: // string + value.copy< string_ptr > (that.value); + break; + + case symbol_kind::S_thisthread: // thisthread + value.copy< thisthread_ptr > (that.value); + break; + + case symbol_kind::S_thread: // thread + value.copy< thread_ptr > (that.value); + break; + + case symbol_kind::S_true: // true + value.copy< true_ptr > (that.value); + break; + + case symbol_kind::S_undefined: // undefined + value.copy< undefined_ptr > (that.value); + break; + + case symbol_kind::S_usingtree: // usingtree + value.copy< usingtree_ptr > (that.value); + break; + + case symbol_kind::S_vector: // vector + value.copy< vector_ptr > (that.value); + break; + + default: + break; + } + + location = that.location; + return *this; + } + + parser::stack_symbol_type& + parser::stack_symbol_type::operator= (stack_symbol_type& that) + { + state = that.state; + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (that.value); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (that.value); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (that.value); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (that.value); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (that.value); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (that.value); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (that.value); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (that.value); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (that.value); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (that.value); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (that.value); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (that.value); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (that.value); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (that.value); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (that.value); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (that.value); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (that.value); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (that.value); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (that.value); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (that.value); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (that.value); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (that.value); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (that.value); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (that.value); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (that.value); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (that.value); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (that.value); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (that.value); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (that.value); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (that.value); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (that.value); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (that.value); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (that.value); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (that.value); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (that.value); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (that.value); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (that.value); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (that.value); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (that.value); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (that.value); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (that.value); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (that.value); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (that.value); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (that.value); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (that.value); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (that.value); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (that.value); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (that.value); + break; + + default: + break; + } + + location = that.location; + // that is emptied. + that.state = empty_state; + return *this; + } +#endif + + template + void + parser::yy_destroy_ (const char* yymsg, basic_symbol& yysym) const + { + if (yymsg) + YY_SYMBOL_PRINT (yymsg, yysym); + } + +#if H1DEBUG + template + void + parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const + { + std::ostream& yyoutput = yyo; + YY_USE (yyoutput); + if (yysym.empty ()) + yyo << "empty symbol"; + else + { + symbol_kind_type yykind = yysym.kind (); + yyo << (yykind < YYNTOKENS ? "token" : "nterm") + << ' ' << yysym.name () << " (" + << yysym.location << ": "; + YY_USE (yykind); + yyo << ')'; + } + } +#endif + + void + parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) + { + if (m) + YY_SYMBOL_PRINT (m, sym); + yystack_.push (YY_MOVE (sym)); + } + + void + parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) + { +#if 201103L <= YY_CPLUSPLUS + yypush_ (m, stack_symbol_type (s, std::move (sym))); +#else + stack_symbol_type ss (s, sym); + yypush_ (m, ss); +#endif + } + + void + parser::yypop_ (int n) + { + yystack_.pop (n); + } + +#if H1DEBUG + std::ostream& + parser::debug_stream () const + { + return *yycdebug_; + } + + void + parser::set_debug_stream (std::ostream& o) + { + yycdebug_ = &o; + } + + + parser::debug_level_type + parser::debug_level () const + { + return yydebug_; + } + + void + parser::set_debug_level (debug_level_type l) + { + yydebug_ = l; + } +#endif // H1DEBUG + + parser::state_type + parser::yy_lr_goto_state_ (state_type yystate, int yysym) + { + int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; + if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) + return yytable_[yyr]; + else + return yydefgoto_[yysym - YYNTOKENS]; + } + + bool + parser::yy_pact_value_is_default_ (int yyvalue) + { + return yyvalue == yypact_ninf_; + } + + bool + parser::yy_table_value_is_error_ (int yyvalue) + { + return yyvalue == yytable_ninf_; + } + + int + parser::operator() () + { + return parse (); + } + + int + parser::parse () + { + int yyn; + /// Length of the RHS of the rule being reduced. + int yylen = 0; + + // Error handling. + int yynerrs_ = 0; + int yyerrstatus_ = 0; + + /// The lookahead symbol. + symbol_type yyla; + + /// The locations where the error started and ended. + stack_symbol_type yyerror_range[3]; + + /// The return value of parse (). + int yyresult; + + /// Discard the LAC context in case there still is one left from a + /// previous invocation. + yy_lac_discard_ ("init"); + +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + YYCDEBUG << "Starting parse\n"; + + + /* Initialize the stack. The initial state will be set in + yynewstate, since the latter expects the semantical and the + location values to have been already stored, initialize these + stacks with a primary value. */ + yystack_.clear (); + yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); + + /*-----------------------------------------------. + | yynewstate -- push a new symbol on the stack. | + `-----------------------------------------------*/ + yynewstate: + YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; + YY_STACK_PRINT (); + + // Accept? + if (yystack_[0].state == yyfinal_) + YYACCEPT; + + goto yybackup; + + + /*-----------. + | yybackup. | + `-----------*/ + yybackup: + // Try to take a decision without lookahead. + yyn = yypact_[+yystack_[0].state]; + if (yy_pact_value_is_default_ (yyn)) + goto yydefault; + + // Read a lookahead token. + if (yyla.empty ()) + { + YYCDEBUG << "Reading a token\n"; +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + symbol_type yylookahead (yylex (yyscanner, loc)); + yyla.move (yylookahead); + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + goto yyerrlab1; + } +#endif // YY_EXCEPTIONS + } + YY_SYMBOL_PRINT ("Next token is", yyla); + + if (yyla.kind () == symbol_kind::S_YYerror) + { + // The scanner already issued an error message, process directly + // to error recovery. But do not keep the error token as + // lookahead, it is too special and may lead us to an endless + // loop in error recovery. */ + yyla.kind_ = symbol_kind::S_YYUNDEF; + goto yyerrlab1; + } + + /* If the proper action on seeing token YYLA.TYPE is to reduce or + to detect an error, take that action. */ + yyn += yyla.kind (); + if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) + { + if (!yy_lac_establish_ (yyla.kind ())) + goto yyerrlab; + goto yydefault; + } + + // Reduce or error. + yyn = yytable_[yyn]; + if (yyn <= 0) + { + if (yy_table_value_is_error_ (yyn)) + goto yyerrlab; + if (!yy_lac_establish_ (yyla.kind ())) + goto yyerrlab; + + yyn = -yyn; + goto yyreduce; + } + + // Count tokens shifted since error; after three, turn off error status. + if (yyerrstatus_) + --yyerrstatus_; + + // Shift the lookahead token. + yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); + yy_lac_discard_ ("shift"); + goto yynewstate; + + + /*-----------------------------------------------------------. + | yydefault -- do the default action for the current state. | + `-----------------------------------------------------------*/ + yydefault: + yyn = yydefact_[+yystack_[0].state]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + + /*-----------------------------. + | yyreduce -- do a reduction. | + `-----------------------------*/ + yyreduce: + yylen = yyr2_[yyn]; + { + stack_symbol_type yylhs; + yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); + /* Variants are always initialized to an empty instance of the + correct type. The default '$$ = $1' action is NOT applied + when using variants. */ + switch (yyr1_[yyn]) + { + case symbol_kind::S_anim: // anim + yylhs.value.emplace< anim_ptr > (); + break; + + case symbol_kind::S_animation: // animation + yylhs.value.emplace< animation_ptr > (); + break; + + case symbol_kind::S_animtree: // animtree + yylhs.value.emplace< animtree_ptr > (); + break; + + case symbol_kind::S_constant: // constant + yylhs.value.emplace< constant_ptr > (); + break; + + case symbol_kind::S_define: // define + yylhs.value.emplace< define_ptr > (); + break; + + case symbol_kind::S_empty_array: // empty_array + yylhs.value.emplace< empty_array_ptr > (); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + yylhs.value.emplace< expr_arguments_ptr > (); + break; + + case symbol_kind::S_expr_assign: // expr_assign + yylhs.value.emplace< expr_assign_ptr > (); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + yylhs.value.emplace< expr_call_ptr > (); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + yylhs.value.emplace< expr_call_type_ptr > (); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + yylhs.value.emplace< expr_ptr > (); + break; + + case symbol_kind::S_false: // false + yylhs.value.emplace< false_ptr > (); + break; + + case symbol_kind::S_file: // file + yylhs.value.emplace< file_ptr > (); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + yylhs.value.emplace< float_ptr > (); + break; + + case symbol_kind::S_game: // game + yylhs.value.emplace< game_ptr > (); + break; + + case symbol_kind::S_include: // include + yylhs.value.emplace< include_ptr > (); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + yylhs.value.emplace< integer_ptr > (); + break; + + case symbol_kind::S_istring: // istring + yylhs.value.emplace< istring_ptr > (); + break; + + case symbol_kind::S_level: // level + yylhs.value.emplace< level_ptr > (); + break; + + case symbol_kind::S_name: // name + yylhs.value.emplace< name_ptr > (); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + yylhs.value.emplace< node_ptr > (); + break; + + case symbol_kind::S_parameters: // parameters + yylhs.value.emplace< parameters_ptr > (); + break; + + case symbol_kind::S_program: // program + yylhs.value.emplace< program_ptr > (); + break; + + case symbol_kind::S_self: // self + yylhs.value.emplace< self_ptr > (); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + yylhs.value.emplace< std::string > (); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + yylhs.value.emplace< stmt_assign_ptr > (); + break; + + case symbol_kind::S_stmt_break: // stmt_break + yylhs.value.emplace< stmt_break_ptr > (); + break; + + case symbol_kind::S_stmt_call: // stmt_call + yylhs.value.emplace< stmt_call_ptr > (); + break; + + case symbol_kind::S_stmt_case: // stmt_case + yylhs.value.emplace< stmt_case_ptr > (); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + yylhs.value.emplace< stmt_continue_ptr > (); + break; + + case symbol_kind::S_stmt_default: // stmt_default + yylhs.value.emplace< stmt_default_ptr > (); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + yylhs.value.emplace< stmt_endon_ptr > (); + break; + + case symbol_kind::S_stmt_for: // stmt_for + yylhs.value.emplace< stmt_for_ptr > (); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + yylhs.value.emplace< stmt_foreach_ptr > (); + break; + + case symbol_kind::S_stmt_if: // stmt_if + yylhs.value.emplace< stmt_if_ptr > (); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + yylhs.value.emplace< stmt_ifelse_ptr > (); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + yylhs.value.emplace< stmt_list_ptr > (); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + yylhs.value.emplace< stmt_notify_ptr > (); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + yylhs.value.emplace< stmt_ptr > (); + break; + + case symbol_kind::S_stmt_return: // stmt_return + yylhs.value.emplace< stmt_return_ptr > (); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + yylhs.value.emplace< stmt_switch_ptr > (); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + yylhs.value.emplace< stmt_wait_ptr > (); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + yylhs.value.emplace< stmt_waitframe_ptr > (); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + yylhs.value.emplace< stmt_waittill_ptr > (); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + yylhs.value.emplace< stmt_waittillframeend_ptr > (); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + yylhs.value.emplace< stmt_waittillmatch_ptr > (); + break; + + case symbol_kind::S_stmt_while: // stmt_while + yylhs.value.emplace< stmt_while_ptr > (); + break; + + case symbol_kind::S_string: // string + yylhs.value.emplace< string_ptr > (); + break; + + case symbol_kind::S_thisthread: // thisthread + yylhs.value.emplace< thisthread_ptr > (); + break; + + case symbol_kind::S_thread: // thread + yylhs.value.emplace< thread_ptr > (); + break; + + case symbol_kind::S_true: // true + yylhs.value.emplace< true_ptr > (); + break; + + case symbol_kind::S_undefined: // undefined + yylhs.value.emplace< undefined_ptr > (); + break; + + case symbol_kind::S_usingtree: // usingtree + yylhs.value.emplace< usingtree_ptr > (); + break; + + case symbol_kind::S_vector: // vector + yylhs.value.emplace< vector_ptr > (); + break; + + default: + break; + } + + + // Default location. + { + stack_type::slice range (yystack_, yylen); + YYLLOC_DEFAULT (yylhs.location, range, yylen); + yyerror_range[1].location = yylhs.location; + } + + // Perform the reduction. + YY_REDUCE_PRINT (yyn); +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + switch (yyn) + { + case 2: // root: program +#line 233 "parser.ypp" + { ast = std::move(yystack_[0].value.as < program_ptr > ()); } +#line 1751 "parser.cpp" + break; + + case 3: // root: %empty +#line 234 "parser.ypp" + { ast = std::make_unique(yylhs.location); } +#line 1757 "parser.cpp" + break; + + case 4: // program: program include +#line 239 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::move(yystack_[1].value.as < program_ptr > ()); yylhs.value.as < program_ptr > ()->includes.push_back(std::move(yystack_[0].value.as < include_ptr > ())); } +#line 1763 "parser.cpp" + break; + + case 5: // program: program define +#line 241 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::move(yystack_[1].value.as < program_ptr > ()); yylhs.value.as < program_ptr > ()->definitions.push_back(std::move(yystack_[0].value.as < define_ptr > ())); } +#line 1769 "parser.cpp" + break; + + case 6: // program: include +#line 243 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < program_ptr > ()->includes.push_back(std::move(yystack_[0].value.as < include_ptr > ())); } +#line 1775 "parser.cpp" + break; + + case 7: // program: define +#line 245 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < program_ptr > ()->definitions.push_back(std::move(yystack_[0].value.as < define_ptr > ())); } +#line 1781 "parser.cpp" + break; + + case 8: // include: "#include" file ";" +#line 250 "parser.ypp" + { yylhs.value.as < include_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < file_ptr > ())); } +#line 1787 "parser.cpp" + break; + + case 9: // define: usingtree +#line 254 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_usingtree = std::move(yystack_[0].value.as < usingtree_ptr > ()); } +#line 1793 "parser.cpp" + break; + + case 10: // define: constant +#line 255 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_constant = std::move(yystack_[0].value.as < constant_ptr > ()); } +#line 1799 "parser.cpp" + break; + + case 11: // define: thread +#line 256 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_thread = std::move(yystack_[0].value.as < thread_ptr > ()); } +#line 1805 "parser.cpp" + break; + + case 12: // usingtree: "#using_animtree" "(" string ")" ";" +#line 261 "parser.ypp" + { yylhs.value.as < usingtree_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < string_ptr > ())); } +#line 1811 "parser.cpp" + break; + + case 13: // constant: name "=" expr ";" +#line 266 "parser.ypp" + { yylhs.value.as < constant_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 1817 "parser.cpp" + break; + + case 14: // thread: name "(" parameters ")" stmt_block +#line 271 "parser.ypp" + { yylhs.value.as < thread_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < name_ptr > ()), std::move(yystack_[2].value.as < parameters_ptr > ()), std::move(yystack_[0].value.as < stmt_list_ptr > ())); } +#line 1823 "parser.cpp" + break; + + case 15: // parameters: parameters "," name +#line 276 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::move(yystack_[2].value.as < parameters_ptr > ()); yylhs.value.as < parameters_ptr > ()->list.push_back(std::move(yystack_[0].value.as < name_ptr > ())); } +#line 1829 "parser.cpp" + break; + + case 16: // parameters: name +#line 278 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < parameters_ptr > ()->list.push_back(std::move(yystack_[0].value.as < name_ptr > ())); } +#line 1835 "parser.cpp" + break; + + case 17: // parameters: %empty +#line 280 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::make_unique(yylhs.location); } +#line 1841 "parser.cpp" + break; + + case 18: // stmt: stmt_block +#line 284 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_list = std::move(yystack_[0].value.as < stmt_list_ptr > ()); } +#line 1847 "parser.cpp" + break; + + case 19: // stmt: stmt_call +#line 285 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_call = std::move(yystack_[0].value.as < stmt_call_ptr > ()); } +#line 1853 "parser.cpp" + break; + + case 20: // stmt: stmt_assign +#line 286 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_assign = std::move(yystack_[0].value.as < stmt_assign_ptr > ()); } +#line 1859 "parser.cpp" + break; + + case 21: // stmt: stmt_endon +#line 287 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_endon = std::move(yystack_[0].value.as < stmt_endon_ptr > ()); } +#line 1865 "parser.cpp" + break; + + case 22: // stmt: stmt_notify +#line 288 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_notify = std::move(yystack_[0].value.as < stmt_notify_ptr > ()); } +#line 1871 "parser.cpp" + break; + + case 23: // stmt: stmt_wait +#line 289 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_wait = std::move(yystack_[0].value.as < stmt_wait_ptr > ()); } +#line 1877 "parser.cpp" + break; + + case 24: // stmt: stmt_waittill +#line 290 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittill = std::move(yystack_[0].value.as < stmt_waittill_ptr > ()); } +#line 1883 "parser.cpp" + break; + + case 25: // stmt: stmt_waittillmatch +#line 291 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittillmatch = std::move(yystack_[0].value.as < stmt_waittillmatch_ptr > ()); } +#line 1889 "parser.cpp" + break; + + case 26: // stmt: stmt_waittillframeend +#line 292 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittillframeend = std::move(yystack_[0].value.as < stmt_waittillframeend_ptr > ()); } +#line 1895 "parser.cpp" + break; + + case 27: // stmt: stmt_waitframe +#line 293 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waitframe = std::move(yystack_[0].value.as < stmt_waitframe_ptr > ()); } +#line 1901 "parser.cpp" + break; + + case 28: // stmt: stmt_if +#line 294 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_if = std::move(yystack_[0].value.as < stmt_if_ptr > ()); } +#line 1907 "parser.cpp" + break; + + case 29: // stmt: stmt_ifelse +#line 295 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_ifelse = std::move(yystack_[0].value.as < stmt_ifelse_ptr > ()); } +#line 1913 "parser.cpp" + break; + + case 30: // stmt: stmt_while +#line 296 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_while = std::move(yystack_[0].value.as < stmt_while_ptr > ()); } +#line 1919 "parser.cpp" + break; + + case 31: // stmt: stmt_for +#line 297 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_for = std::move(yystack_[0].value.as < stmt_for_ptr > ()); } +#line 1925 "parser.cpp" + break; + + case 32: // stmt: stmt_foreach +#line 298 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_foreach = std::move(yystack_[0].value.as < stmt_foreach_ptr > ()); } +#line 1931 "parser.cpp" + break; + + case 33: // stmt: stmt_switch +#line 299 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_switch = std::move(yystack_[0].value.as < stmt_switch_ptr > ()); } +#line 1937 "parser.cpp" + break; + + case 34: // stmt: stmt_case +#line 300 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_case = std::move(yystack_[0].value.as < stmt_case_ptr > ()); } +#line 1943 "parser.cpp" + break; + + case 35: // stmt: stmt_default +#line 301 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_default = std::move(yystack_[0].value.as < stmt_default_ptr > ()); } +#line 1949 "parser.cpp" + break; + + case 36: // stmt: stmt_break +#line 302 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_break = std::move(yystack_[0].value.as < stmt_break_ptr > ()); } +#line 1955 "parser.cpp" + break; + + case 37: // stmt: stmt_continue +#line 303 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_continue = std::move(yystack_[0].value.as < stmt_continue_ptr > ()); } +#line 1961 "parser.cpp" + break; + + case 38: // stmt: stmt_return +#line 304 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_return = std::move(yystack_[0].value.as < stmt_return_ptr > ()); } +#line 1967 "parser.cpp" + break; + + case 39: // stmt_block: "{" stmt_list "}" +#line 308 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::move(yystack_[1].value.as < stmt_list_ptr > ()); } +#line 1973 "parser.cpp" + break; + + case 40: // stmt_block: "{" "}" +#line 309 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::make_unique(yylhs.location); } +#line 1979 "parser.cpp" + break; + + case 41: // stmt_list: stmt_list stmt +#line 314 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::move(yystack_[1].value.as < stmt_list_ptr > ()); yylhs.value.as < stmt_list_ptr > ()->stmts.push_back(std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 1985 "parser.cpp" + break; + + case 42: // stmt_list: stmt +#line 316 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < stmt_list_ptr > ()->stmts.push_back(std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 1991 "parser.cpp" + break; + + case 43: // stmt_call: expr_call ";" +#line 321 "parser.ypp" + { yylhs.value.as < stmt_call_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_call_ptr > ())); } +#line 1997 "parser.cpp" + break; + + case 44: // stmt_call: expr_call_thread ";" +#line 323 "parser.ypp" + { yylhs.value.as < stmt_call_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_call_ptr > ())); } +#line 2003 "parser.cpp" + break; + + case 45: // stmt_assign: expr_assign ";" +#line 328 "parser.ypp" + { yylhs.value.as < stmt_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_assign_ptr > ())); } +#line 2009 "parser.cpp" + break; + + case 46: // stmt_endon: object "endon" "(" expr ")" ";" +#line 333 "parser.ypp" + { yylhs.value.as < stmt_endon_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ())); } +#line 2015 "parser.cpp" + break; + + case 47: // stmt_notify: object "notify" "(" expr "," expr_arguments ")" ";" +#line 338 "parser.ypp" + { yylhs.value.as < stmt_notify_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 2021 "parser.cpp" + break; + + case 48: // stmt_notify: object "notify" "(" expr ")" ";" +#line 340 "parser.ypp" + { yylhs.value.as < stmt_notify_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2027 "parser.cpp" + break; + + case 49: // stmt_wait: "wait" expr ";" +#line 345 "parser.ypp" + { yylhs.value.as < stmt_wait_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2033 "parser.cpp" + break; + + case 50: // stmt_waittill: object "waittill" "(" expr "," expr_arguments ")" ";" +#line 350 "parser.ypp" + { yylhs.value.as < stmt_waittill_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 2039 "parser.cpp" + break; + + case 51: // stmt_waittill: object "waittill" "(" expr ")" ";" +#line 352 "parser.ypp" + { yylhs.value.as < stmt_waittill_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2045 "parser.cpp" + break; + + case 52: // stmt_waittillmatch: object "waittillmatch" "(" expr "," expr_arguments ")" ";" +#line 357 "parser.ypp" + { yylhs.value.as < stmt_waittillmatch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 2051 "parser.cpp" + break; + + case 53: // stmt_waittillmatch: object "waittillmatch" "(" expr ")" ";" +#line 359 "parser.ypp" + { yylhs.value.as < stmt_waittillmatch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2057 "parser.cpp" + break; + + case 54: // stmt_waittillframeend: "waittillframeend" ";" +#line 364 "parser.ypp" + { yylhs.value.as < stmt_waittillframeend_ptr > () = std::make_unique(yylhs.location); } +#line 2063 "parser.cpp" + break; + + case 55: // stmt_waitframe: "waitframe" ";" +#line 369 "parser.ypp" + { yylhs.value.as < stmt_waitframe_ptr > () = std::make_unique(yylhs.location); } +#line 2069 "parser.cpp" + break; + + case 56: // stmt_waitframe: "waitframe" "(" ")" ";" +#line 371 "parser.ypp" + { yylhs.value.as < stmt_waitframe_ptr > () = std::make_unique(yylhs.location); } +#line 2075 "parser.cpp" + break; + + case 57: // stmt_if: "if" "(" expr ")" stmt +#line 376 "parser.ypp" + { yylhs.value.as < stmt_if_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2081 "parser.cpp" + break; + + case 58: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt +#line 381 "parser.ypp" + { yylhs.value.as < stmt_ifelse_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < stmt_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2087 "parser.cpp" + break; + + case 59: // stmt_while: "while" "(" expr ")" stmt +#line 386 "parser.ypp" + { yylhs.value.as < stmt_while_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2093 "parser.cpp" + break; + + case 60: // stmt_for: "for" "(" for_stmt ";" for_expr ";" for_stmt ")" stmt +#line 391 "parser.ypp" + { yylhs.value.as < stmt_for_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[6].value.as < stmt_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < stmt_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2099 "parser.cpp" + break; + + case 61: // stmt_foreach: "foreach" "(" name "in" expr ")" stmt +#line 396 "parser.ypp" + { yylhs.value.as < stmt_foreach_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[4].value.as < name_ptr > ())), std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2105 "parser.cpp" + break; + + case 62: // stmt_foreach: "foreach" "(" name "," name "in" expr ")" stmt +#line 398 "parser.ypp" + { yylhs.value.as < stmt_foreach_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[6].value.as < name_ptr > ())), expr_ptr(std::move(yystack_[4].value.as < name_ptr > ())), std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2111 "parser.cpp" + break; + + case 63: // stmt_switch: "switch" "(" expr ")" stmt_block +#line 403 "parser.ypp" + { yylhs.value.as < stmt_switch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_list_ptr > ())); } +#line 2117 "parser.cpp" + break; + + case 64: // stmt_case: "case" integer ":" +#line 408 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < integer_ptr > ())), std::make_unique(yylhs.location)); } +#line 2123 "parser.cpp" + break; + + case 65: // stmt_case: "case" neg_integer ":" +#line 410 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < integer_ptr > ())), std::make_unique(yylhs.location)); } +#line 2129 "parser.cpp" + break; + + case 66: // stmt_case: "case" string ":" +#line 412 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < string_ptr > ())), std::make_unique(yylhs.location)); } +#line 2135 "parser.cpp" + break; + + case 67: // stmt_default: "default" ":" +#line 417 "parser.ypp" + { yylhs.value.as < stmt_default_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } +#line 2141 "parser.cpp" + break; + + case 68: // stmt_break: "break" ";" +#line 422 "parser.ypp" + { yylhs.value.as < stmt_break_ptr > () = std::make_unique(yylhs.location); } +#line 2147 "parser.cpp" + break; + + case 69: // stmt_continue: "continue" ";" +#line 427 "parser.ypp" + { yylhs.value.as < stmt_continue_ptr > () = std::make_unique(yylhs.location); } +#line 2153 "parser.cpp" + break; + + case 70: // stmt_return: "return" expr ";" +#line 432 "parser.ypp" + { yylhs.value.as < stmt_return_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2159 "parser.cpp" + break; + + case 71: // stmt_return: "return" ";" +#line 434 "parser.ypp" + { yylhs.value.as < stmt_return_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } +#line 2165 "parser.cpp" + break; + + case 72: // for_stmt: expr_assign +#line 438 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_list = std::make_unique(yylhs.location); yylhs.value.as < stmt_ptr > ().as_list->stmts.push_back(stmt_ptr(std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_assign_ptr > ())))); } +#line 2171 "parser.cpp" + break; + + case 73: // for_stmt: %empty +#line 439 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_node = std::make_unique(yylhs.location); } +#line 2177 "parser.cpp" + break; + + case 74: // for_expr: expr +#line 443 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2183 "parser.cpp" + break; + + case 75: // for_expr: %empty +#line 444 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location); } +#line 2189 "parser.cpp" + break; + + case 76: // expr: expr_compare +#line 448 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2195 "parser.cpp" + break; + + case 77: // expr: expr_binary +#line 449 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2201 "parser.cpp" + break; + + case 78: // expr: expr_primitive +#line 450 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2207 "parser.cpp" + break; + + case 79: // expr_assign: "++" object +#line 454 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < node_ptr > ())); } +#line 2213 "parser.cpp" + break; + + case 80: // expr_assign: "--" object +#line 455 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < node_ptr > ())); } +#line 2219 "parser.cpp" + break; + + case 81: // expr_assign: object "++" +#line 456 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < node_ptr > ())); } +#line 2225 "parser.cpp" + break; + + case 82: // expr_assign: object "--" +#line 457 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < node_ptr > ())); } +#line 2231 "parser.cpp" + break; + + case 83: // expr_assign: object "=" expr +#line 458 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2237 "parser.cpp" + break; + + case 84: // expr_assign: object "|=" expr +#line 459 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2243 "parser.cpp" + break; + + case 85: // expr_assign: object "&=" expr +#line 460 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2249 "parser.cpp" + break; + + case 86: // expr_assign: object "^=" expr +#line 461 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2255 "parser.cpp" + break; + + case 87: // expr_assign: object "<<=" expr +#line 462 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()),std::move( yystack_[0].value.as < expr_ptr > ())); } +#line 2261 "parser.cpp" + break; + + case 88: // expr_assign: object ">>=" expr +#line 463 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2267 "parser.cpp" + break; + + case 89: // expr_assign: object "+=" expr +#line 464 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2273 "parser.cpp" + break; + + case 90: // expr_assign: object "-=" expr +#line 465 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2279 "parser.cpp" + break; + + case 91: // expr_assign: object "*=" expr +#line 466 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2285 "parser.cpp" + break; + + case 92: // expr_assign: object "/=" expr +#line 467 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2291 "parser.cpp" + break; + + case 93: // expr_assign: object "%=" expr +#line 468 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2297 "parser.cpp" + break; + + case 94: // expr_compare: expr "||" expr +#line 472 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2303 "parser.cpp" + break; + + case 95: // expr_compare: expr "&&" expr +#line 473 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2309 "parser.cpp" + break; + + case 96: // expr_compare: expr "==" expr +#line 474 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2315 "parser.cpp" + break; + + case 97: // expr_compare: expr "!=" expr +#line 475 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2321 "parser.cpp" + break; + + case 98: // expr_compare: expr "<=" expr +#line 476 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2327 "parser.cpp" + break; + + case 99: // expr_compare: expr ">=" expr +#line 477 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2333 "parser.cpp" + break; + + case 100: // expr_compare: expr "<" expr +#line 478 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2339 "parser.cpp" + break; + + case 101: // expr_compare: expr ">" expr +#line 479 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2345 "parser.cpp" + break; + + case 102: // expr_binary: expr "|" expr +#line 483 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2351 "parser.cpp" + break; + + case 103: // expr_binary: expr "&" expr +#line 484 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2357 "parser.cpp" + break; + + case 104: // expr_binary: expr "^" expr +#line 485 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2363 "parser.cpp" + break; + + case 105: // expr_binary: expr "<<" expr +#line 486 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2369 "parser.cpp" + break; + + case 106: // expr_binary: expr ">>" expr +#line 487 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2375 "parser.cpp" + break; + + case 107: // expr_binary: expr "+" expr +#line 488 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2381 "parser.cpp" + break; + + case 108: // expr_binary: expr "-" expr +#line 489 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2387 "parser.cpp" + break; + + case 109: // expr_binary: expr "*" expr +#line 490 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2393 "parser.cpp" + break; + + case 110: // expr_binary: expr "/" expr +#line 491 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2399 "parser.cpp" + break; + + case 111: // expr_binary: expr "%" expr +#line 492 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2405 "parser.cpp" + break; + + case 112: // expr_primitive: "(" expr ")" +#line 496 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[1].value.as < expr_ptr > ()); } +#line 2411 "parser.cpp" + break; + + case 113: // expr_primitive: "~" expr +#line 497 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2417 "parser.cpp" + break; + + case 114: // expr_primitive: "!" expr +#line 498 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2423 "parser.cpp" + break; + + case 115: // expr_primitive: expr_call +#line 499 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2429 "parser.cpp" + break; + + case 116: // expr_primitive: expr_call_thread +#line 500 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2435 "parser.cpp" + break; + + case 117: // expr_primitive: expr_call_childthread +#line 501 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2441 "parser.cpp" + break; + + case 118: // expr_primitive: expr_function +#line 502 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2447 "parser.cpp" + break; + + case 119: // expr_primitive: expr_add_array +#line 503 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2453 "parser.cpp" + break; + + case 120: // expr_primitive: expr_array +#line 504 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2459 "parser.cpp" + break; + + case 121: // expr_primitive: expr_field +#line 505 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2465 "parser.cpp" + break; + + case 122: // expr_primitive: expr_size +#line 506 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2471 "parser.cpp" + break; + + case 123: // expr_primitive: thisthread +#line 507 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < thisthread_ptr > ()); } +#line 2477 "parser.cpp" + break; + + case 124: // expr_primitive: empty_array +#line 508 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < empty_array_ptr > ()); } +#line 2483 "parser.cpp" + break; + + case 125: // expr_primitive: undefined +#line 509 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < undefined_ptr > ()); } +#line 2489 "parser.cpp" + break; + + case 126: // expr_primitive: game +#line 510 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < game_ptr > ()); } +#line 2495 "parser.cpp" + break; + + case 127: // expr_primitive: self +#line 511 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < self_ptr > ()); } +#line 2501 "parser.cpp" + break; + + case 128: // expr_primitive: anim +#line 512 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < anim_ptr > ()); } +#line 2507 "parser.cpp" + break; + + case 129: // expr_primitive: level +#line 513 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < level_ptr > ()); } +#line 2513 "parser.cpp" + break; + + case 130: // expr_primitive: animation +#line 514 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < animation_ptr > ()); } +#line 2519 "parser.cpp" + break; + + case 131: // expr_primitive: animtree +#line 515 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < animtree_ptr > ()); } +#line 2525 "parser.cpp" + break; + + case 132: // expr_primitive: name +#line 516 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < name_ptr > ()); } +#line 2531 "parser.cpp" + break; + + case 133: // expr_primitive: istring +#line 517 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < istring_ptr > ()); } +#line 2537 "parser.cpp" + break; + + case 134: // expr_primitive: string +#line 518 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < string_ptr > ()); } +#line 2543 "parser.cpp" + break; + + case 135: // expr_primitive: vector +#line 519 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < vector_ptr > ()); } +#line 2549 "parser.cpp" + break; + + case 136: // expr_primitive: neg_float +#line 520 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < float_ptr > ()); } +#line 2555 "parser.cpp" + break; + + case 137: // expr_primitive: neg_integer +#line 521 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < integer_ptr > ()); } +#line 2561 "parser.cpp" + break; + + case 138: // expr_primitive: float +#line 522 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < float_ptr > ()); } +#line 2567 "parser.cpp" + break; + + case 139: // expr_primitive: integer +#line 523 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < integer_ptr > ()); } +#line 2573 "parser.cpp" + break; + + case 140: // expr_primitive: false +#line 524 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < false_ptr > ()); } +#line 2579 "parser.cpp" + break; + + case 141: // expr_primitive: true +#line 525 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < true_ptr > ()); } +#line 2585 "parser.cpp" + break; + + case 142: // expr_call: expr_call_function +#line 529 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2591 "parser.cpp" + break; + + case 143: // expr_call: expr_call_pointer +#line 530 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2597 "parser.cpp" + break; + + case 144: // expr_call: object expr_call_function +#line 531 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::move(yystack_[1].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2603 "parser.cpp" + break; + + case 145: // expr_call: object expr_call_pointer +#line 532 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::move(yystack_[1].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2609 "parser.cpp" + break; + + case 146: // expr_call_thread: "thread" expr_call_function +#line 536 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2615 "parser.cpp" + break; + + case 147: // expr_call_thread: "thread" expr_call_pointer +#line 537 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2621 "parser.cpp" + break; + + case 148: // expr_call_thread: object "thread" expr_call_function +#line 538 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2627 "parser.cpp" + break; + + case 149: // expr_call_thread: object "thread" expr_call_pointer +#line 539 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2633 "parser.cpp" + break; + + case 150: // expr_call_childthread: "childthread" expr_call_function +#line 543 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2639 "parser.cpp" + break; + + case 151: // expr_call_childthread: "childthread" expr_call_pointer +#line 544 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2645 "parser.cpp" + break; + + case 152: // expr_call_childthread: object "childthread" expr_call_function +#line 545 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2651 "parser.cpp" + break; + + case 153: // expr_call_childthread: object "childthread" expr_call_pointer +#line 546 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2657 "parser.cpp" + break; + + case 154: // expr_call_function: name "(" expr_arguments ")" +#line 551 "parser.ypp" + {yylhs.value.as < expr_call_type_ptr > ().as_func = std::make_unique(yylhs.location, std::make_unique(), std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2663 "parser.cpp" + break; + + case 155: // expr_call_function: file "::" name "(" expr_arguments ")" +#line 553 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_func = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < file_ptr > ()), std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2669 "parser.cpp" + break; + + case 156: // expr_call_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 558 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_pointer = std::make_unique(yylhs.location, false, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2675 "parser.cpp" + break; + + case 157: // expr_call_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 560 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_pointer = std::make_unique(yylhs.location, true, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2681 "parser.cpp" + break; + + case 158: // expr_arguments: expr_arguments_filled +#line 564 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[0].value.as < expr_arguments_ptr > ()); } +#line 2687 "parser.cpp" + break; + + case 159: // expr_arguments: expr_arguments_empty +#line 565 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[0].value.as < expr_arguments_ptr > ()); } +#line 2693 "parser.cpp" + break; + + case 160: // expr_arguments_filled: expr_arguments "," expr +#line 570 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[2].value.as < expr_arguments_ptr > ()); yylhs.value.as < expr_arguments_ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2699 "parser.cpp" + break; + + case 161: // expr_arguments_filled: expr +#line 572 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < expr_arguments_ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2705 "parser.cpp" + break; + + case 162: // expr_arguments_empty: %empty +#line 577 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::make_unique(yylhs.location); } +#line 2711 "parser.cpp" + break; + + case 163: // expr_function: "::" name +#line 582 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2717 "parser.cpp" + break; + + case 164: // expr_function: file "::" name +#line 584 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < file_ptr > ()), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2723 "parser.cpp" + break; + + case 165: // expr_add_array: "[" expr_arguments_filled "]" +#line 589 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2729 "parser.cpp" + break; + + case 166: // expr_array: object "[" expr "]" +#line 594 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < node_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2735 "parser.cpp" + break; + + case 167: // expr_field: object "." name +#line 599 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2741 "parser.cpp" + break; + + case 168: // expr_size: object "." "size" +#line 604 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ())); } +#line 2747 "parser.cpp" + break; + + case 169: // object: expr_call +#line 608 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2753 "parser.cpp" + break; + + case 170: // object: expr_array +#line 609 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2759 "parser.cpp" + break; + + case 171: // object: expr_field +#line 610 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2765 "parser.cpp" + break; + + case 172: // object: game +#line 611 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < game_ptr > ()); } +#line 2771 "parser.cpp" + break; + + case 173: // object: self +#line 612 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < self_ptr > ()); } +#line 2777 "parser.cpp" + break; + + case 174: // object: anim +#line 613 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < anim_ptr > ()); } +#line 2783 "parser.cpp" + break; + + case 175: // object: level +#line 614 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < level_ptr > ()); } +#line 2789 "parser.cpp" + break; + + case 176: // object: name +#line 615 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < name_ptr > ()); } +#line 2795 "parser.cpp" + break; + + case 177: // thisthread: "thisthread" +#line 618 "parser.ypp" + { yylhs.value.as < thisthread_ptr > () = std::make_unique(yylhs.location); } +#line 2801 "parser.cpp" + break; + + case 178: // empty_array: "[" "]" +#line 619 "parser.ypp" + { yylhs.value.as < empty_array_ptr > () = std::make_unique(yylhs.location); } +#line 2807 "parser.cpp" + break; + + case 179: // undefined: "undefined" +#line 620 "parser.ypp" + { yylhs.value.as < undefined_ptr > () = std::make_unique(yylhs.location); } +#line 2813 "parser.cpp" + break; + + case 180: // game: "game" +#line 621 "parser.ypp" + { yylhs.value.as < game_ptr > () = std::make_unique(yylhs.location); } +#line 2819 "parser.cpp" + break; + + case 181: // self: "self" +#line 622 "parser.ypp" + { yylhs.value.as < self_ptr > () = std::make_unique(yylhs.location); } +#line 2825 "parser.cpp" + break; + + case 182: // anim: "anim" +#line 623 "parser.ypp" + { yylhs.value.as < anim_ptr > () = std::make_unique(yylhs.location); } +#line 2831 "parser.cpp" + break; + + case 183: // level: "level" +#line 624 "parser.ypp" + { yylhs.value.as < level_ptr > () = std::make_unique(yylhs.location); } +#line 2837 "parser.cpp" + break; + + case 184: // animation: "%" "identifier" +#line 625 "parser.ypp" + { yylhs.value.as < animation_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2843 "parser.cpp" + break; + + case 185: // animtree: "#animtree" +#line 626 "parser.ypp" + { yylhs.value.as < animtree_ptr > () = std::make_unique(yylhs.location); } +#line 2849 "parser.cpp" + break; + + case 186: // name: "identifier" +#line 627 "parser.ypp" + { yylhs.value.as < name_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2855 "parser.cpp" + break; + + case 187: // file: "file path" +#line 628 "parser.ypp" + { yylhs.value.as < file_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2861 "parser.cpp" + break; + + case 188: // istring: "localized string" +#line 629 "parser.ypp" + { yylhs.value.as < istring_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2867 "parser.cpp" + break; + + case 189: // string: "string literal" +#line 630 "parser.ypp" + { yylhs.value.as < string_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2873 "parser.cpp" + break; + + case 190: // vector: "(" expr "," expr "," expr ")" +#line 631 "parser.ypp" + { yylhs.value.as < vector_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[3].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2879 "parser.cpp" + break; + + case 191: // neg_float: "-" "float" +#line 632 "parser.ypp" + { yylhs.value.as < float_ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 2885 "parser.cpp" + break; + + case 192: // neg_integer: "-" "int" +#line 633 "parser.ypp" + { yylhs.value.as < integer_ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 2891 "parser.cpp" + break; + + case 193: // float: "float" +#line 634 "parser.ypp" + { yylhs.value.as < float_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2897 "parser.cpp" + break; + + case 194: // integer: "int" +#line 635 "parser.ypp" + { yylhs.value.as < integer_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2903 "parser.cpp" + break; + + case 195: // false: "false" +#line 636 "parser.ypp" + { yylhs.value.as < false_ptr > () = std::make_unique(yylhs.location); } +#line 2909 "parser.cpp" + break; + + case 196: // true: "true" +#line 637 "parser.ypp" + { yylhs.value.as < true_ptr > () = std::make_unique(yylhs.location); } +#line 2915 "parser.cpp" + break; + + +#line 2919 "parser.cpp" + + default: + break; + } + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + YYERROR; + } +#endif // YY_EXCEPTIONS + YY_SYMBOL_PRINT ("-> $$ =", yylhs); + yypop_ (yylen); + yylen = 0; + + // Shift the result of the reduction. + yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); + } + goto yynewstate; + + + /*--------------------------------------. + | yyerrlab -- here on detecting error. | + `--------------------------------------*/ + yyerrlab: + // If not already recovering from an error, report this error. + if (!yyerrstatus_) + { + ++yynerrs_; + context yyctx (*this, yyla); + std::string msg = yysyntax_error_ (yyctx); + error (yyla.location, YY_MOVE (msg)); + } + + + yyerror_range[1].location = yyla.location; + if (yyerrstatus_ == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + // Return failure if at end of input. + if (yyla.kind () == symbol_kind::S_YYEOF) + YYABORT; + else if (!yyla.empty ()) + { + yy_destroy_ ("Error: discarding", yyla); + yyla.clear (); + } + } + + // Else will try to reuse lookahead token after shifting the error token. + goto yyerrlab1; + + + /*---------------------------------------------------. + | yyerrorlab -- error raised explicitly by YYERROR. | + `---------------------------------------------------*/ + yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and + the label yyerrorlab therefore never appears in user code. */ + if (false) + YYERROR; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + yypop_ (yylen); + yylen = 0; + YY_STACK_PRINT (); + goto yyerrlab1; + + + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ + yyerrlab1: + yyerrstatus_ = 3; // Each real token shifted decrements this. + // Pop stack until we find a state that shifts the error token. + for (;;) + { + yyn = yypact_[+yystack_[0].state]; + if (!yy_pact_value_is_default_ (yyn)) + { + yyn += symbol_kind::S_YYerror; + if (0 <= yyn && yyn <= yylast_ + && yycheck_[yyn] == symbol_kind::S_YYerror) + { + yyn = yytable_[yyn]; + if (0 < yyn) + break; + } + } + + // Pop the current state because it cannot handle the error token. + if (yystack_.size () == 1) + YYABORT; + + yyerror_range[1].location = yystack_[0].location; + yy_destroy_ ("Error: popping", yystack_[0]); + yypop_ (); + YY_STACK_PRINT (); + } + { + stack_symbol_type error_token; + + yyerror_range[2].location = yyla.location; + YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); + + // Shift the error token. + yy_lac_discard_ ("error recovery"); + error_token.state = state_type (yyn); + yypush_ ("Shifting", YY_MOVE (error_token)); + } + goto yynewstate; + + + /*-------------------------------------. + | yyacceptlab -- YYACCEPT comes here. | + `-------------------------------------*/ + yyacceptlab: + yyresult = 0; + goto yyreturn; + + + /*-----------------------------------. + | yyabortlab -- YYABORT comes here. | + `-----------------------------------*/ + yyabortlab: + yyresult = 1; + goto yyreturn; + + + /*-----------------------------------------------------. + | yyreturn -- parsing is finished, return the result. | + `-----------------------------------------------------*/ + yyreturn: + if (!yyla.empty ()) + yy_destroy_ ("Cleanup: discarding lookahead", yyla); + + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + yypop_ (yylen); + YY_STACK_PRINT (); + while (1 < yystack_.size ()) + { + yy_destroy_ ("Cleanup: popping", yystack_[0]); + yypop_ (); + } + + return yyresult; + } +#if YY_EXCEPTIONS + catch (...) + { + YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; + // Do not try to display the values of the reclaimed symbols, + // as their printers might throw an exception. + if (!yyla.empty ()) + yy_destroy_ (YY_NULLPTR, yyla); + + while (1 < yystack_.size ()) + { + yy_destroy_ (YY_NULLPTR, yystack_[0]); + yypop_ (); + } + throw; + } +#endif // YY_EXCEPTIONS + } + + void + parser::error (const syntax_error& yyexc) + { + error (yyexc.location, yyexc.what ()); + } + + const char * + parser::symbol_name (symbol_kind_type yysymbol) + { + static const char *const yy_sname[] = + { + "end of file", "error", "invalid token", "#include", "#using_animtree", + "#animtree", "endon", "notify", "wait", "waittill", "waittillmatch", + "waittillframeend", "waitframe", "if", "else", "while", "for", "foreach", + "in", "switch", "case", "default", "break", "continue", "return", + "thread", "childthread", "thisthread", "call", "true", "false", + "undefined", "size", "game", "self", "anim", "level", "(", ")", "{", "}", + "[", "]", ",", ".", "::", ":", ";", "++", "--", "<<", ">>", "||", "&&", + "==", "!=", "<=", ">=", "<", ">", "!", "~", "=", "+=", "-=", "*=", "/=", + "%=", "|=", "&=", "^=", ">>=", "<<=", "|", "&", "^", "+", "-", "*", "/", + "%", "file path", "identifier", "string literal", "localized string", + "float", "int", "ADD_ARRAY", "THEN", "NEG", "ANIMREF", "PREINC", + "PREDEC", "POSTINC", "POSTDEC", "$accept", "root", "program", "include", + "define", "usingtree", "constant", "thread", "parameters", "stmt", + "stmt_block", "stmt_list", "stmt_call", "stmt_assign", "stmt_endon", + "stmt_notify", "stmt_wait", "stmt_waittill", "stmt_waittillmatch", + "stmt_waittillframeend", "stmt_waitframe", "stmt_if", "stmt_ifelse", + "stmt_while", "stmt_for", "stmt_foreach", "stmt_switch", "stmt_case", + "stmt_default", "stmt_break", "stmt_continue", "stmt_return", "for_stmt", + "for_expr", "expr", "expr_assign", "expr_compare", "expr_binary", + "expr_primitive", "expr_call", "expr_call_thread", + "expr_call_childthread", "expr_call_function", "expr_call_pointer", + "expr_arguments", "expr_arguments_filled", "expr_arguments_empty", + "expr_function", "expr_add_array", "expr_array", "expr_field", + "expr_size", "object", "thisthread", "empty_array", "undefined", "game", + "self", "anim", "level", "animation", "animtree", "name", "file", + "istring", "string", "vector", "neg_float", "neg_integer", "float", + "integer", "false", "true", YY_NULLPTR + }; + return yy_sname[yysymbol]; + } + + + + // parser::context. + parser::context::context (const parser& yyparser, const symbol_type& yyla) + : yyparser_ (yyparser) + , yyla_ (yyla) + {} + + int + parser::context::expected_tokens (symbol_kind_type yyarg[], int yyargn) const + { + // Actual number of expected tokens + int yycount = 0; + +#if H1DEBUG + // Execute LAC once. We don't care if it is successful, we + // only do it for the sake of debugging output. + if (!yyparser_.yy_lac_established_) + yyparser_.yy_lac_check_ (yyla_.kind ()); +#endif + + for (int yyx = 0; yyx < YYNTOKENS; ++yyx) + { + symbol_kind_type yysym = YY_CAST (symbol_kind_type, yyx); + if (yysym != symbol_kind::S_YYerror + && yysym != symbol_kind::S_YYUNDEF + && yyparser_.yy_lac_check_ (yysym)) + { + if (!yyarg) + ++yycount; + else if (yycount == yyargn) + return 0; + else + yyarg[yycount++] = yysym; + } + } + if (yyarg && yycount == 0 && 0 < yyargn) + yyarg[0] = symbol_kind::S_YYEMPTY; + return yycount; + } + + + bool + parser::yy_lac_check_ (symbol_kind_type yytoken) const + { + // Logically, the yylac_stack's lifetime is confined to this function. + // Clear it, to get rid of potential left-overs from previous call. + yylac_stack_.clear (); + // Reduce until we encounter a shift and thereby accept the token. +#if H1DEBUG + YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; +#endif + std::ptrdiff_t lac_top = 0; + while (true) + { + state_type top_state = (yylac_stack_.empty () + ? yystack_[lac_top].state + : yylac_stack_.back ()); + int yyrule = yypact_[+top_state]; + if (yy_pact_value_is_default_ (yyrule) + || (yyrule += yytoken) < 0 || yylast_ < yyrule + || yycheck_[yyrule] != yytoken) + { + // Use the default action. + yyrule = yydefact_[+top_state]; + if (yyrule == 0) + { + YYCDEBUG << " Err\n"; + return false; + } + } + else + { + // Use the action from yytable. + yyrule = yytable_[yyrule]; + if (yy_table_value_is_error_ (yyrule)) + { + YYCDEBUG << " Err\n"; + return false; + } + if (0 < yyrule) + { + YYCDEBUG << " S" << yyrule << '\n'; + return true; + } + yyrule = -yyrule; + } + // By now we know we have to simulate a reduce. + YYCDEBUG << " R" << yyrule - 1; + // Pop the corresponding number of values from the stack. + { + std::ptrdiff_t yylen = yyr2_[yyrule]; + // First pop from the LAC stack as many tokens as possible. + std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); + if (yylen < lac_size) + { + yylac_stack_.resize (std::size_t (lac_size - yylen)); + yylen = 0; + } + else if (lac_size) + { + yylac_stack_.clear (); + yylen -= lac_size; + } + // Only afterwards look at the main stack. + // We simulate popping elements by incrementing lac_top. + lac_top += yylen; + } + // Keep top_state in sync with the updated stack. + top_state = (yylac_stack_.empty () + ? yystack_[lac_top].state + : yylac_stack_.back ()); + // Push the resulting state of the reduction. + state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); + YYCDEBUG << " G" << int (state); + yylac_stack_.push_back (state); + } + } + + // Establish the initial context if no initial context currently exists. + bool + parser::yy_lac_establish_ (symbol_kind_type yytoken) + { + /* Establish the initial context for the current lookahead if no initial + context is currently established. + + We define a context as a snapshot of the parser stacks. We define + the initial context for a lookahead as the context in which the + parser initially examines that lookahead in order to select a + syntactic action. Thus, if the lookahead eventually proves + syntactically unacceptable (possibly in a later context reached via a + series of reductions), the initial context can be used to determine + the exact set of tokens that would be syntactically acceptable in the + lookahead's place. Moreover, it is the context after which any + further semantic actions would be erroneous because they would be + determined by a syntactically unacceptable token. + + yy_lac_establish_ should be invoked when a reduction is about to be + performed in an inconsistent state (which, for the purposes of LAC, + includes consistent states that don't know they're consistent because + their default reductions have been disabled). + + For parse.lac=full, the implementation of yy_lac_establish_ is as + follows. If no initial context is currently established for the + current lookahead, then check if that lookahead can eventually be + shifted if syntactic actions continue from the current context. */ + if (!yy_lac_established_) + { +#if H1DEBUG + YYCDEBUG << "LAC: initial context established for " + << symbol_name (yytoken) << '\n'; +#endif + yy_lac_established_ = true; + return yy_lac_check_ (yytoken); + } + return true; + } + + // Discard any previous initial lookahead context. + void + parser::yy_lac_discard_ (const char* evt) + { + /* Discard any previous initial lookahead context because of Event, + which may be a lookahead change or an invalidation of the currently + established initial context for the current lookahead. + + The most common example of a lookahead change is a shift. An example + of both cases is syntax error recovery. That is, a syntax error + occurs when the lookahead is syntactically erroneous for the + currently established initial context, so error recovery manipulates + the parser stacks to try to find a new initial context in which the + current lookahead is syntactically acceptable. If it fails to find + such a context, it discards the lookahead. */ + if (yy_lac_established_) + { + YYCDEBUG << "LAC: initial context discarded due to " + << evt << '\n'; + yy_lac_established_ = false; + } + } + + int + parser::yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const + { + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yyla) is + if this state is a consistent state with a default action. + Thus, detecting the absence of a lookahead is sufficient to + determine that there is no unexpected or expected token to + report. In that case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is + a consistent state with a default action. There might have + been a previous inconsistent state, consistent state with a + non-default action, or user semantic action that manipulated + yyla. (However, yyla is currently not documented for users.) + In the first two cases, it might appear that the current syntax + error should have been detected in the previous state when + yy_lac_check was invoked. However, at that time, there might + have been a different syntax error that discarded a different + initial context during error recovery, leaving behind the + current lookahead. + */ + + if (!yyctx.lookahead ().empty ()) + { + if (yyarg) + yyarg[0] = yyctx.token (); + int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); + return yyn + 1; + } + return 0; + } + + // Generate an error message. + std::string + parser::yysyntax_error_ (const context& yyctx) const + { + // Its maximum. + enum { YYARGS_MAX = 5 }; + // Arguments of yyformat. + symbol_kind_type yyarg[YYARGS_MAX]; + int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); + + char const* yyformat = YY_NULLPTR; + switch (yycount) + { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + default: // Avoid compiler warnings. + YYCASE_ (0, YY_("syntax error")); + YYCASE_ (1, YY_("syntax error, unexpected %s")); + YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +#undef YYCASE_ + } + + std::string yyres; + // Argument number. + std::ptrdiff_t yyi = 0; + for (char const* yyp = yyformat; *yyp; ++yyp) + if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) + { + yyres += symbol_name (yyarg[yyi++]); + ++yyp; + } + else + yyres += *yyp; + return yyres; + } + + + const short parser::yypact_ninf_ = -230; + + const short parser::yytable_ninf_ = -177; + + const short + parser::yypact_[] = + { + 7, -67, -20, -230, 53, 7, -230, -230, -230, -230, + -230, -21, -230, 13, -10, -230, -230, -230, -3, 607, + -230, -230, 25, -15, -230, -230, 41, 41, -230, 29, + -230, -230, -230, -230, -230, -230, -230, 607, 480, -3, + 607, 607, -50, -1, -230, -230, -230, 1341, -230, -230, + -230, 18, -230, -230, -230, -230, -230, -230, 23, 30, + -230, 332, -230, -230, -230, 446, 507, 569, 573, -230, + -230, -4, 38, -230, -230, -230, -230, -230, -230, -230, + -230, -230, 47, 85, -3, 56, -230, -230, 84, 64, + -230, -230, 86, 905, 480, -230, 1419, 90, 95, -230, + -230, -230, -230, -230, -230, -230, -230, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 41, 41, 669, -17, -230, + -230, 607, -3, -230, 787, -230, -230, 607, -3, 607, + -230, 607, 1212, 607, -230, 124, 124, 1429, 938, 1501, + 1501, 40, 40, 40, 40, 981, 1460, 1470, 101, 101, + -230, -230, -230, -230, -230, -230, -230, 1251, -230, -230, + -13, -230, 103, 607, 94, -18, 123, 126, 128, 130, + 131, 9, 125, 135, 138, 545, -230, 732, 732, -230, + -230, 826, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, 139, 143, 148, -230, -230, 715, -230, -230, + -230, -230, 84, 1212, 103, 1290, 1328, 133, 1419, -230, + -230, 607, 1375, -230, 132, -230, 607, 607, 630, -3, + 607, 91, 151, 159, 160, -230, -230, -230, -230, 1388, + -230, 6, 6, -230, -230, -230, -230, -230, 152, 172, + 173, 174, -3, -230, -230, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 170, 607, 176, 14, + -230, 177, 1044, 1077, 178, -230, 868, 2, 1087, -230, + -230, -230, -230, 607, 607, 607, 607, 1419, 1419, 1419, + 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 182, 1120, + 607, -230, -230, 865, 865, 607, 607, -3, 85, 1130, + 948, 991, 1034, 607, -230, 42, 207, -230, 187, 1419, + 1163, 205, -230, 188, 190, 607, 193, 607, 195, 607, + 55, -230, 865, 630, 865, 607, -230, -230, 58, -230, + 70, -230, 72, -230, -230, 206, -230, 1173, 198, 199, + 200, 865, 865, -230, -230, -230, -230, -230 + }; + + const unsigned char + parser::yydefact_[] = + { + 3, 0, 0, 186, 0, 2, 6, 7, 9, 10, + 11, 0, 187, 0, 0, 1, 4, 5, 17, 0, + 8, 189, 0, 0, 16, 185, 0, 0, 177, 0, + 196, 195, 179, 180, 181, 182, 183, 0, 162, 0, + 0, 0, 0, 0, 188, 193, 194, 0, 76, 77, + 78, 115, 116, 117, 142, 143, 118, 119, 120, 121, + 122, 0, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 0, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 0, 0, 0, 0, 146, 147, 0, 0, + 150, 151, 0, 0, 162, 178, 161, 0, 158, 159, + 163, 114, 113, 191, 192, 184, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, + 145, 162, 0, 12, 0, 14, 15, 0, 0, 0, + 112, 0, 161, 0, 165, 105, 106, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 107, 108, + 109, 110, 111, 148, 149, 152, 153, 0, 168, 167, + 0, 158, 164, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 40, 0, 0, 42, + 18, 0, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 0, 169, 0, 170, 171, 0, 172, 173, + 174, 175, 176, 0, 0, 0, 0, 0, 160, 166, + 154, 162, 0, 54, 0, 55, 0, 0, 73, 0, + 0, 0, 0, 0, 0, 67, 68, 69, 71, 0, + 169, 79, 80, 39, 41, 45, 43, 44, 0, 0, + 0, 0, 0, 81, 82, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 0, 72, 0, 0, 0, 66, + 65, 64, 70, 0, 0, 0, 0, 83, 89, 90, + 91, 92, 93, 84, 85, 86, 88, 87, 0, 0, + 162, 155, 56, 0, 0, 75, 0, 0, 0, 0, + 0, 0, 0, 162, 190, 0, 57, 59, 0, 74, + 0, 0, 63, 0, 0, 162, 0, 162, 0, 162, + 0, 156, 0, 73, 0, 0, 46, 48, 0, 51, + 0, 53, 0, 157, 58, 0, 61, 0, 0, 0, + 0, 0, 0, 47, 50, 52, 60, 62 + }; + + const short + parser::yypgoto_[] = + { + -230, -230, -230, 243, 244, -230, -230, -230, -230, -178, + -82, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -93, -230, 35, -229, -230, -230, -230, 27, + 142, -230, -23, -19, 68, -26, -230, -230, -230, 39, + 73, -230, 82, -230, -230, -230, 97, 107, 134, 241, + -230, -230, 0, 5, -230, -12, -230, -230, 74, -230, + 77, -230, -230 + }; + + const short + parser::yydefgoto_[] = + { + 0, 4, 5, 6, 7, 8, 9, 10, 23, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 284, 328, 96, 212, 48, 49, 50, 51, + 52, 53, 54, 55, 97, 171, 99, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81 + }; + + const short + parser::yytable_[] = + { + 11, 135, 22, 86, 90, 11, 13, 87, 91, 285, + 1, 2, 98, 254, 12, 168, 18, 14, 24, 234, + 316, -176, -176, 83, -176, 230, 88, 88, 84, 235, + 143, 89, 89, 131, 29, 103, 104, -176, 129, 100, + -176, 19, 130, -169, -169, 317, -169, 127, -170, -170, + 262, -170, 311, 15, 47, -171, -171, 143, -171, -169, + 20, 88, -169, 82, -170, 3, 89, -170, 98, 29, + 92, -171, 93, 21, -171, 101, 102, -176, -176, 3, + 341, 105, 85, 132, 136, 143, 241, 12, 3, 3, + 107, 108, 21, 353, 133, 46, 358, 137, 143, -169, + -169, 143, 163, 165, -170, -170, 164, 166, 359, 138, + 360, -171, -171, 143, 285, 143, 120, 121, 122, 123, + 124, 131, 12, 3, 134, 88, 88, 139, 169, 142, + 89, 89, 172, 143, 222, 326, 327, 144, 224, 89, + 231, 233, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 236, 213, 167, 237, 354, 238, 356, 239, 240, 242, + 281, 245, 223, 215, 225, 278, 226, 104, 228, 122, + 123, 124, 246, 366, 367, 247, 255, 222, 222, 293, + 256, 222, 89, 89, 129, 257, 89, 289, 130, 170, + 120, 121, 122, 123, 124, 290, 291, 216, 232, 294, + 295, 296, 308, 310, 250, 250, 217, 88, 213, 323, + 249, 342, 89, 345, 312, 315, 215, 215, 129, 129, + 215, 218, 130, 130, 343, 346, 332, 347, 222, 287, + 349, 219, 351, 89, 361, 363, 364, 365, 16, 17, + 355, 88, 88, 0, 0, 243, 89, 89, 244, 0, + 216, 216, 169, 129, 216, 250, 0, 130, 220, 251, + 252, 282, 283, 217, 0, 288, 214, 215, 0, 0, + 0, 0, 0, 0, 218, 218, 88, 0, 218, 0, + 0, 89, 0, 0, 219, 219, 0, 0, 219, 279, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 216, 309, 222, 222, 0, 0, 331, 89, 89, + 286, 220, 220, 0, 0, 220, 0, 0, 319, 320, + 321, 322, 0, 214, 0, 218, 0, 0, 0, 0, + 213, 213, 222, 222, 222, 219, 0, 89, 89, 89, + 329, 330, 215, 215, 0, 0, 0, 125, 126, 0, + 29, 222, 222, 0, 0, 0, 89, 89, 0, 213, + 250, 213, 220, 127, 0, 221, 128, 0, 325, 0, + 357, 215, 215, 215, 0, 0, 216, 216, 213, 213, + 0, 340, 0, 0, 0, 217, 217, 0, 0, 0, + 215, 215, 0, 348, 0, 350, 0, 352, 0, 0, + 218, 218, 0, 12, 3, 216, 216, 216, 0, 0, + 219, 219, 0, 0, 217, 286, 217, 0, 221, 221, + 0, 0, 221, 0, 216, 216, 0, 0, 0, 218, + 218, 218, 0, 217, 217, 0, 0, 220, 220, 219, + 219, 219, 0, 0, 0, 214, 214, 0, 218, 218, + 0, 0, 0, 0, 0, 0, 0, 0, 219, 219, + 0, -172, -172, 0, -172, 0, 220, 220, 220, 221, + 0, 0, 0, 0, 214, 25, 214, -172, 0, 0, + -172, 0, 0, 0, 0, 220, 220, 0, 0, 0, + 0, 0, 0, 214, 214, 26, 27, 28, 29, 30, + 31, 32, 0, 33, 34, 35, 36, 37, 0, 0, + 0, 94, 95, 0, 0, 39, 0, -172, -172, 0, + 0, 0, -173, -173, 0, -173, 0, 0, 0, 0, + 40, 41, 0, 0, 0, 0, 0, 0, -173, 0, + 25, -173, 0, 0, 221, 221, 0, 42, 0, 0, + 43, 12, 3, 21, 44, 45, 46, 0, 0, 0, + 26, 27, 28, 29, 30, 31, 32, 0, 33, 34, + 35, 36, 37, 221, 221, 221, 38, 0, -173, -173, + 39, 0, 248, 0, -174, -174, 0, -174, -175, -175, + 0, -175, 221, 221, 0, 40, 41, 0, 0, 0, + -174, 0, 25, -174, -175, 0, 0, -175, 0, 0, + 0, 0, 42, 0, 0, 43, 12, 3, 21, 44, + 45, 46, 26, 27, 28, 29, 30, 31, 32, 0, + 33, 34, 35, 36, 37, 0, 0, 0, 38, 0, + -174, -174, 39, 0, -175, -175, 0, 0, 29, 0, + 0, 0, 0, 33, 34, 35, 36, 40, 41, 0, + 0, 85, 0, 0, 25, 0, 0, 0, 187, 188, + 0, 0, 0, 0, 42, 0, 0, 43, 12, 3, + 21, 44, 45, 46, 26, 27, 28, 29, 30, 31, + 32, 0, 33, 34, 35, 36, 37, 0, 0, 0, + 94, 12, 3, 0, 39, 0, 0, 0, 0, 0, + 0, 258, 259, 0, 260, 261, 0, 0, 0, 40, + 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 29, 0, 0, 42, 0, 0, 43, + 12, 3, 21, 44, 45, 46, 127, 0, 0, 262, + 29, 0, 0, 263, 264, 33, 34, 35, 36, 0, + 0, 0, 0, 85, 0, 0, 0, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 0, 0, + 0, 0, 0, 0, 0, 173, 12, 3, 174, 175, + 176, 0, 177, 178, 179, 0, 180, 181, 182, 183, + 184, 185, 26, 12, 3, 29, 0, 0, 0, 0, + 33, 34, 35, 36, 0, 0, 134, 186, 85, 0, + 0, 0, 0, 0, 173, 187, 188, 174, 175, 176, + 0, 177, 178, 179, 0, 180, 181, 182, 183, 184, + 185, 26, 0, 0, 29, 0, 0, 0, 0, 33, + 34, 35, 36, 0, 0, 134, 253, 85, 12, 3, + 0, 0, 0, 173, 187, 188, 174, 175, 176, 0, + 177, 178, 179, 0, 180, 181, 182, 183, 184, 185, + 26, 0, 0, 29, 0, 0, 29, 0, 33, 34, + 35, 36, 0, 0, 134, 0, 85, 12, 3, 127, + 0, 0, 262, 187, 188, 0, 263, 264, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 0, 0, 140, 0, 0, 12, 3, 141, 12, + 3, 0, 0, 0, 0, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, + 119, 120, 121, 122, 123, 124, 334, 0, 107, 108, + 0, 335, 111, 112, 113, 114, 115, 116, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 0, 0, + 0, 117, 118, 119, 120, 121, 122, 123, 124, 0, + 0, 117, 118, 119, 120, 121, 122, 123, 124, 336, + 0, 107, 108, 0, 337, 111, 112, 113, 114, 115, + 116, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 0, 0, 117, 118, 119, 120, 121, 122, + 123, 124, 338, 0, 0, 0, 0, 339, 0, 0, + 0, 0, 313, 0, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 0, 0, 0, 117, 118, 119, + 120, 121, 122, 123, 124, 314, 0, 117, 118, 119, + 120, 121, 122, 123, 124, 318, 0, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 0, 0, 0, + 117, 118, 119, 120, 121, 122, 123, 124, 324, 0, + 117, 118, 119, 120, 121, 122, 123, 124, 333, 0, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, + 124, 344, 0, 117, 118, 119, 120, 121, 122, 123, + 124, 362, 0, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 0, 0, 0, 117, 118, 119, 120, + 121, 122, 123, 124, 0, 0, 117, 118, 119, 120, + 121, 122, 123, 124, 227, 0, 0, 0, 0, 0, + 0, 0, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 117, 118, 119, 120, 121, + 122, 123, 124, 229, 0, 0, 0, 0, 0, 0, + 0, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 117, 118, 119, 120, 121, 122, + 123, 124, 276, 0, 0, 0, 0, 0, 0, 0, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, + 124, 277, 0, 0, 0, 0, 0, 0, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 106, 0, + 0, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 0, + 0, 0, 0, 0, 117, 118, 119, 120, 121, 122, + 123, 124, 280, 0, 0, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 292, 0, 0, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 0, 0, 0, 0, + 0, 117, 118, 119, 120, 121, 122, 123, 124, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 107, + 108, 0, 110, 111, 112, 113, 114, 115, 116, 0, + 0, 0, 117, 118, 119, 120, 121, 122, 123, 124, + 0, 0, 117, 118, 119, 120, 121, 122, 123, 124, + 107, 108, 0, 0, 111, 112, 113, 114, 115, 116, + 107, 108, 0, 0, 111, 112, 113, 114, 115, 116, + 0, 0, 0, 0, 0, 119, 120, 121, 122, 123, + 124, 0, 0, 0, 0, 0, 120, 121, 122, 123, + 124, 107, 108, 0, 0, 0, 0, 113, 114, 115, + 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 120, 121, 122, + 123, 124 + }; + + const short + parser::yycheck_[] = + { + 0, 83, 14, 26, 27, 5, 1, 26, 27, 238, + 3, 4, 38, 191, 81, 32, 37, 37, 18, 37, + 18, 25, 26, 38, 28, 38, 26, 27, 43, 47, + 43, 26, 27, 37, 28, 85, 86, 41, 61, 39, + 44, 62, 61, 25, 26, 43, 28, 41, 25, 26, + 44, 28, 38, 0, 19, 25, 26, 43, 28, 41, + 47, 61, 44, 38, 41, 82, 61, 44, 94, 28, + 41, 41, 37, 83, 44, 40, 41, 81, 82, 82, + 38, 82, 41, 45, 84, 43, 77, 81, 82, 82, + 50, 51, 83, 38, 47, 86, 38, 41, 43, 81, + 82, 43, 125, 126, 81, 82, 125, 126, 38, 45, + 38, 81, 82, 43, 343, 43, 76, 77, 78, 79, + 80, 37, 81, 82, 39, 125, 126, 41, 128, 94, + 125, 126, 132, 43, 134, 313, 314, 42, 138, 134, + 37, 47, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 37, 134, 127, 37, 342, 37, 344, 37, 37, 181, + 38, 46, 137, 134, 139, 42, 141, 86, 143, 78, + 79, 80, 47, 361, 362, 47, 47, 187, 188, 37, + 47, 191, 187, 188, 217, 47, 191, 46, 217, 131, + 76, 77, 78, 79, 80, 46, 46, 134, 173, 37, + 37, 37, 42, 37, 187, 188, 134, 217, 191, 37, + 185, 14, 217, 18, 47, 47, 187, 188, 251, 252, + 191, 134, 251, 252, 47, 47, 318, 47, 238, 239, + 47, 134, 47, 238, 38, 47, 47, 47, 5, 5, + 343, 251, 252, -1, -1, 181, 251, 252, 181, -1, + 187, 188, 262, 286, 191, 238, -1, 286, 134, 187, + 188, 236, 237, 191, -1, 240, 134, 238, -1, -1, + -1, -1, -1, -1, 187, 188, 286, -1, 191, -1, + -1, 286, -1, -1, 187, 188, -1, -1, 191, 231, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 238, 277, 313, 314, -1, -1, 317, 313, 314, + 238, 187, 188, -1, -1, 191, -1, -1, 293, 294, + 295, 296, -1, 191, -1, 238, -1, -1, -1, -1, + 313, 314, 342, 343, 344, 238, -1, 342, 343, 344, + 315, 316, 313, 314, -1, -1, -1, 25, 26, -1, + 28, 361, 362, -1, -1, -1, 361, 362, -1, 342, + 343, 344, 238, 41, -1, 134, 44, -1, 310, -1, + 345, 342, 343, 344, -1, -1, 313, 314, 361, 362, + -1, 323, -1, -1, -1, 313, 314, -1, -1, -1, + 361, 362, -1, 335, -1, 337, -1, 339, -1, -1, + 313, 314, -1, 81, 82, 342, 343, 344, -1, -1, + 313, 314, -1, -1, 342, 343, 344, -1, 187, 188, + -1, -1, 191, -1, 361, 362, -1, -1, -1, 342, + 343, 344, -1, 361, 362, -1, -1, 313, 314, 342, + 343, 344, -1, -1, -1, 313, 314, -1, 361, 362, + -1, -1, -1, -1, -1, -1, -1, -1, 361, 362, + -1, 25, 26, -1, 28, -1, 342, 343, 344, 238, + -1, -1, -1, -1, 342, 5, 344, 41, -1, -1, + 44, -1, -1, -1, -1, 361, 362, -1, -1, -1, + -1, -1, -1, 361, 362, 25, 26, 27, 28, 29, + 30, 31, -1, 33, 34, 35, 36, 37, -1, -1, + -1, 41, 42, -1, -1, 45, -1, 81, 82, -1, + -1, -1, 25, 26, -1, 28, -1, -1, -1, -1, + 60, 61, -1, -1, -1, -1, -1, -1, 41, -1, + 5, 44, -1, -1, 313, 314, -1, 77, -1, -1, + 80, 81, 82, 83, 84, 85, 86, -1, -1, -1, + 25, 26, 27, 28, 29, 30, 31, -1, 33, 34, + 35, 36, 37, 342, 343, 344, 41, -1, 81, 82, + 45, -1, 47, -1, 25, 26, -1, 28, 25, 26, + -1, 28, 361, 362, -1, 60, 61, -1, -1, -1, + 41, -1, 5, 44, 41, -1, -1, 44, -1, -1, + -1, -1, 77, -1, -1, 80, 81, 82, 83, 84, + 85, 86, 25, 26, 27, 28, 29, 30, 31, -1, + 33, 34, 35, 36, 37, -1, -1, -1, 41, -1, + 81, 82, 45, -1, 81, 82, -1, -1, 28, -1, + -1, -1, -1, 33, 34, 35, 36, 60, 61, -1, + -1, 41, -1, -1, 5, -1, -1, -1, 48, 49, + -1, -1, -1, -1, 77, -1, -1, 80, 81, 82, + 83, 84, 85, 86, 25, 26, 27, 28, 29, 30, + 31, -1, 33, 34, 35, 36, 37, -1, -1, -1, + 41, 81, 82, -1, 45, -1, -1, -1, -1, -1, + -1, 6, 7, -1, 9, 10, -1, -1, -1, 60, + 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 25, -1, -1, 28, -1, -1, 77, -1, -1, 80, + 81, 82, 83, 84, 85, 86, 41, -1, -1, 44, + 28, -1, -1, 48, 49, 33, 34, 35, 36, -1, + -1, -1, -1, 41, -1, -1, -1, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, -1, -1, + -1, -1, -1, -1, -1, 8, 81, 82, 11, 12, + 13, -1, 15, 16, 17, -1, 19, 20, 21, 22, + 23, 24, 25, 81, 82, 28, -1, -1, -1, -1, + 33, 34, 35, 36, -1, -1, 39, 40, 41, -1, + -1, -1, -1, -1, 8, 48, 49, 11, 12, 13, + -1, 15, 16, 17, -1, 19, 20, 21, 22, 23, + 24, 25, -1, -1, 28, -1, -1, -1, -1, 33, + 34, 35, 36, -1, -1, 39, 40, 41, 81, 82, + -1, -1, -1, 8, 48, 49, 11, 12, 13, -1, + 15, 16, 17, -1, 19, 20, 21, 22, 23, 24, + 25, -1, -1, 28, -1, -1, 28, -1, 33, 34, + 35, 36, -1, -1, 39, -1, 41, 81, 82, 41, + -1, -1, 44, 48, 49, -1, 48, 49, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, -1, -1, 38, -1, -1, 81, 82, 43, 81, + 82, -1, -1, -1, -1, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 73, 74, + 75, 76, 77, 78, 79, 80, 38, -1, 50, 51, + -1, 43, 54, 55, 56, 57, 58, 59, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, -1, -1, + -1, 73, 74, 75, 76, 77, 78, 79, 80, -1, + -1, 73, 74, 75, 76, 77, 78, 79, 80, 38, + -1, 50, 51, -1, 43, 54, 55, 56, 57, 58, + 59, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, -1, -1, -1, -1, 74, 75, 76, 77, 78, + 79, 80, -1, -1, 73, 74, 75, 76, 77, 78, + 79, 80, 38, -1, -1, -1, -1, 43, -1, -1, + -1, -1, 38, -1, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, -1, -1, -1, 73, 74, 75, + 76, 77, 78, 79, 80, 38, -1, 73, 74, 75, + 76, 77, 78, 79, 80, 38, -1, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, -1, -1, -1, + 73, 74, 75, 76, 77, 78, 79, 80, 38, -1, + 73, 74, 75, 76, 77, 78, 79, 80, 38, -1, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + -1, -1, -1, 73, 74, 75, 76, 77, 78, 79, + 80, 38, -1, 73, 74, 75, 76, 77, 78, 79, + 80, 38, -1, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, -1, -1, -1, 73, 74, 75, 76, + 77, 78, 79, 80, -1, -1, 73, 74, 75, 76, + 77, 78, 79, 80, 42, -1, -1, -1, -1, -1, + -1, -1, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 73, 74, 75, 76, 77, + 78, 79, 80, 42, -1, -1, -1, -1, -1, -1, + -1, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 73, 74, 75, 76, 77, 78, + 79, 80, 42, -1, -1, -1, -1, -1, -1, -1, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 73, 74, 75, 76, 77, 78, 79, + 80, 43, -1, -1, -1, -1, -1, -1, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 47, -1, + -1, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 73, 74, 75, 76, 77, 78, 79, 80, -1, + -1, -1, -1, -1, 73, 74, 75, 76, 77, 78, + 79, 80, 47, -1, -1, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 47, -1, -1, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 73, 74, + 75, 76, 77, 78, 79, 80, -1, -1, -1, -1, + -1, 73, 74, 75, 76, 77, 78, 79, 80, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 50, + 51, -1, 53, 54, 55, 56, 57, 58, 59, -1, + -1, -1, 73, 74, 75, 76, 77, 78, 79, 80, + -1, -1, 73, 74, 75, 76, 77, 78, 79, 80, + 50, 51, -1, -1, 54, 55, 56, 57, 58, 59, + 50, 51, -1, -1, 54, 55, 56, 57, 58, 59, + -1, -1, -1, -1, -1, 75, 76, 77, 78, 79, + 80, -1, -1, -1, -1, -1, 76, 77, 78, 79, + 80, 50, 51, -1, -1, -1, -1, 56, 57, 58, + 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 76, 77, 78, + 79, 80 + }; + + const unsigned char + parser::yystos_[] = + { + 0, 3, 4, 82, 96, 97, 98, 99, 100, 101, + 102, 157, 81, 158, 37, 0, 98, 99, 37, 62, + 47, 83, 160, 103, 157, 5, 25, 26, 27, 28, + 29, 30, 31, 33, 34, 35, 36, 37, 41, 45, + 60, 61, 77, 80, 84, 85, 86, 129, 131, 132, + 133, 134, 135, 136, 137, 138, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 38, 38, 43, 41, 137, 138, 157, 158, + 137, 138, 41, 129, 41, 42, 129, 139, 140, 141, + 157, 129, 129, 85, 86, 82, 47, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 73, 74, 75, + 76, 77, 78, 79, 80, 25, 26, 41, 44, 137, + 138, 37, 45, 47, 39, 105, 157, 41, 45, 41, + 38, 43, 129, 43, 42, 129, 129, 129, 129, 129, + 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, + 129, 129, 129, 137, 138, 137, 138, 129, 32, 157, + 139, 140, 157, 8, 11, 12, 13, 15, 16, 17, + 19, 20, 21, 22, 23, 24, 40, 48, 49, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 130, 134, 135, 144, 145, 147, 151, 152, + 153, 154, 157, 129, 157, 129, 129, 42, 129, 42, + 38, 37, 129, 47, 37, 47, 37, 37, 37, 37, + 37, 77, 160, 163, 165, 46, 47, 47, 47, 129, + 134, 147, 147, 40, 104, 47, 47, 47, 6, 7, + 9, 10, 44, 48, 49, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 42, 43, 42, 139, + 47, 38, 129, 129, 127, 130, 147, 157, 129, 46, + 46, 46, 47, 37, 37, 37, 37, 129, 129, 129, + 129, 129, 129, 129, 129, 129, 129, 129, 42, 129, + 37, 38, 47, 38, 38, 47, 18, 43, 38, 129, + 129, 129, 129, 37, 38, 139, 104, 104, 128, 129, + 129, 157, 105, 38, 38, 43, 38, 43, 38, 43, + 139, 38, 14, 47, 38, 18, 47, 47, 139, 47, + 139, 47, 139, 38, 104, 127, 104, 129, 38, 38, + 38, 38, 38, 47, 47, 47, 104, 104 + }; + + const unsigned char + parser::yyr1_[] = + { + 0, 95, 96, 96, 97, 97, 97, 97, 98, 99, + 99, 99, 100, 101, 102, 103, 103, 103, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 105, + 105, 106, 106, 107, 107, 108, 109, 110, 110, 111, + 112, 112, 113, 113, 114, 115, 115, 116, 117, 118, + 119, 120, 120, 121, 122, 122, 122, 123, 124, 125, + 126, 126, 127, 127, 128, 128, 129, 129, 129, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 131, 131, 131, 131, 131, 131, + 131, 131, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 133, 133, 133, 133, 133, 133, 133, 133, + 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, + 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, + 133, 133, 134, 134, 134, 134, 135, 135, 135, 135, + 136, 136, 136, 136, 137, 137, 138, 138, 139, 139, + 140, 140, 141, 142, 142, 143, 144, 145, 146, 147, + 147, 147, 147, 147, 147, 147, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167 + }; + + const signed char + parser::yyr2_[] = + { + 0, 2, 1, 0, 2, 2, 1, 1, 3, 1, + 1, 1, 5, 4, 5, 3, 1, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 2, 2, 1, 2, 2, 2, 6, 8, 6, 3, + 8, 6, 8, 6, 2, 2, 4, 5, 7, 5, + 9, 7, 9, 5, 3, 3, 3, 2, 2, 2, + 3, 2, 1, 0, 1, 0, 1, 1, 1, 2, + 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 2, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, + 2, 2, 3, 3, 4, 6, 8, 9, 1, 1, + 3, 1, 0, 2, 3, 3, 4, 3, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, + 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, + 7, 2, 2, 1, 1, 1, 1 + }; + + + + +#if H1DEBUG + const short + parser::yyrline_[] = + { + 0, 233, 233, 234, 238, 240, 242, 244, 249, 254, + 255, 256, 260, 265, 270, 275, 277, 280, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 308, + 309, 313, 315, 320, 322, 327, 332, 337, 339, 344, + 349, 351, 356, 358, 363, 368, 370, 375, 380, 385, + 390, 395, 397, 402, 407, 409, 411, 416, 421, 426, + 431, 433, 438, 439, 443, 444, 448, 449, 450, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 472, 473, 474, 475, 476, 477, + 478, 479, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 496, 497, 498, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, + 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, + 524, 525, 529, 530, 531, 532, 536, 537, 538, 539, + 543, 544, 545, 546, 550, 552, 557, 559, 564, 565, + 569, 571, 577, 581, 583, 588, 593, 598, 603, 608, + 609, 610, 611, 612, 613, 614, 615, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637 + }; + + void + parser::yy_stack_print_ () const + { + *yycdebug_ << "Stack now"; + for (stack_type::const_iterator + i = yystack_.begin (), + i_end = yystack_.end (); + i != i_end; ++i) + *yycdebug_ << ' ' << int (i->state); + *yycdebug_ << '\n'; + } + + void + parser::yy_reduce_print_ (int yyrule) const + { + int yylno = yyrline_[yyrule]; + int yynrhs = yyr2_[yyrule]; + // Print the symbols being reduced, and their result. + *yycdebug_ << "Reducing stack by rule " << yyrule - 1 + << " (line " << yylno << "):\n"; + // The symbols being reduced. + for (int yyi = 0; yyi < yynrhs; yyi++) + YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", + yystack_[(yynrhs) - (yyi + 1)]); + } +#endif // H1DEBUG + + +#line 13 "parser.ypp" +} } } // xsk::gsc::h1 +#line 3987 "parser.cpp" + +#line 639 "parser.ypp" + + +void xsk::gsc::h1::parser::error(const xsk::gsc::location& loc, const std::string& msg) +{ + throw xsk::gsc::comp_error(loc, msg); +} diff --git a/src/h1/xsk/parser.hpp b/src/h1/xsk/parser.hpp new file mode 100644 index 00000000..d2311ec3 --- /dev/null +++ b/src/h1/xsk/parser.hpp @@ -0,0 +1,4768 @@ +// A Bison parser, made by GNU Bison 3.7.5. + +// Skeleton interface for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. + +// 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 . + +// As a special exception, you may create a larger work that contains +// part or all of the Bison parser skeleton and distribute that work +// under terms of your choice, so long as that work isn't itself a +// parser generator using the skeleton or a modified version thereof +// as a parser skeleton. Alternatively, if you modify or redistribute +// the parser skeleton itself, you may (at your option) remove this +// special exception, which will cause the skeleton and the resulting +// Bison output files to be licensed under the GNU General Public +// License without this special exception. + +// This special exception was added by the Free Software Foundation in +// version 2.2 of Bison. + + +/** + ** \file parser.hpp + ** Define the xsk::gsc::h1::parser class. + */ + +// C++ LALR(1) parser skeleton written by Akim Demaille. + +// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, +// especially those whose name start with YY_ or yy_. They are +// private implementation details that can be changed or removed. + +#ifndef YY_H1_PARSER_HPP_INCLUDED +# define YY_H1_PARSER_HPP_INCLUDED +// "%code requires" blocks. +#line 33 "parser.ypp" + +#include "h1.hpp" +typedef void *yyscan_t; +#define YY_DECL xsk::gsc::h1::parser::symbol_type H1lex(yyscan_t yyscanner, xsk::gsc::location& loc) + +#line 55 "parser.hpp" + +# include +# include // std::abort +# include +# include +# include +# include + +#if defined __cplusplus +# define YY_CPLUSPLUS __cplusplus +#else +# define YY_CPLUSPLUS 199711L +#endif + +// Support move semantics when possible. +#if 201103L <= YY_CPLUSPLUS +# define YY_MOVE std::move +# define YY_MOVE_OR_COPY move +# define YY_MOVE_REF(Type) Type&& +# define YY_RVREF(Type) Type&& +# define YY_COPY(Type) Type +#else +# define YY_MOVE +# define YY_MOVE_OR_COPY copy +# define YY_MOVE_REF(Type) Type& +# define YY_RVREF(Type) const Type& +# define YY_COPY(Type) const Type& +#endif + +// Support noexcept when possible. +#if 201103L <= YY_CPLUSPLUS +# define YY_NOEXCEPT noexcept +# define YY_NOTHROW +#else +# define YY_NOEXCEPT +# define YY_NOTHROW throw () +#endif + +// Support constexpr when possible. +#if 201703 <= YY_CPLUSPLUS +# define YY_CONSTEXPR constexpr +#else +# define YY_CONSTEXPR +#endif + +#include +#ifndef H1_ASSERT +# include +# define H1_ASSERT assert +#endif + + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YY_USE(E) ((void) (E)) +#else +# define YY_USE(E) /* empty */ +#endif + +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +/* Debug traces. */ +#ifndef H1DEBUG +# if defined YYDEBUG +#if YYDEBUG +# define H1DEBUG 1 +# else +# define H1DEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define H1DEBUG 1 +# endif /* ! defined YYDEBUG */ +#endif /* ! defined H1DEBUG */ + +#line 13 "parser.ypp" +namespace xsk { namespace gsc { namespace h1 { +#line 198 "parser.hpp" + + + + + /// A Bison parser. + class parser + { + public: +#ifndef H1STYPE + /// A buffer to store and retrieve objects. + /// + /// Sort of a variant, but does not keep track of the nature + /// of the stored data, since that knowledge is available + /// via the current parser state. + class semantic_type + { + public: + /// Type of *this. + typedef semantic_type self_type; + + /// Empty construction. + semantic_type () YY_NOEXCEPT + : yybuffer_ () + , yytypeid_ (YY_NULLPTR) + {} + + /// Construct and fill. + template + semantic_type (YY_RVREF (T) t) + : yytypeid_ (&typeid (T)) + { + H1_ASSERT (sizeof (T) <= size); + new (yyas_ ()) T (YY_MOVE (t)); + } + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + semantic_type (const self_type&) = delete; + /// Non copyable. + self_type& operator= (const self_type&) = delete; +#endif + + /// Destruction, allowed only if empty. + ~semantic_type () YY_NOEXCEPT + { + H1_ASSERT (!yytypeid_); + } + +# if 201103L <= YY_CPLUSPLUS + /// Instantiate a \a T in here from \a t. + template + T& + emplace (U&&... u) + { + H1_ASSERT (!yytypeid_); + H1_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (std::forward (u)...); + } +# else + /// Instantiate an empty \a T in here. + template + T& + emplace () + { + H1_ASSERT (!yytypeid_); + H1_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (); + } + + /// Instantiate a \a T in here from \a t. + template + T& + emplace (const T& t) + { + H1_ASSERT (!yytypeid_); + H1_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (t); + } +# endif + + /// Instantiate an empty \a T in here. + /// Obsolete, use emplace. + template + T& + build () + { + return emplace (); + } + + /// Instantiate a \a T in here from \a t. + /// Obsolete, use emplace. + template + T& + build (const T& t) + { + return emplace (t); + } + + /// Accessor to a built \a T. + template + T& + as () YY_NOEXCEPT + { + H1_ASSERT (yytypeid_); + H1_ASSERT (*yytypeid_ == typeid (T)); + H1_ASSERT (sizeof (T) <= size); + return *yyas_ (); + } + + /// Const accessor to a built \a T (for %printer). + template + const T& + as () const YY_NOEXCEPT + { + H1_ASSERT (yytypeid_); + H1_ASSERT (*yytypeid_ == typeid (T)); + H1_ASSERT (sizeof (T) <= size); + return *yyas_ (); + } + + /// Swap the content with \a that, of same type. + /// + /// Both variants must be built beforehand, because swapping the actual + /// data requires reading it (with as()), and this is not possible on + /// unconstructed variants: it would require some dynamic testing, which + /// should not be the variant's responsibility. + /// Swapping between built and (possibly) non-built is done with + /// self_type::move (). + template + void + swap (self_type& that) YY_NOEXCEPT + { + H1_ASSERT (yytypeid_); + H1_ASSERT (*yytypeid_ == *that.yytypeid_); + std::swap (as (), that.as ()); + } + + /// Move the content of \a that to this. + /// + /// Destroys \a that. + template + void + move (self_type& that) + { +# if 201103L <= YY_CPLUSPLUS + emplace (std::move (that.as ())); +# else + emplace (); + swap (that); +# endif + that.destroy (); + } + +# if 201103L <= YY_CPLUSPLUS + /// Move the content of \a that to this. + template + void + move (self_type&& that) + { + emplace (std::move (that.as ())); + that.destroy (); + } +#endif + + /// Copy the content of \a that to this. + template + void + copy (const self_type& that) + { + emplace (that.as ()); + } + + /// Destroy the stored \a T. + template + void + destroy () + { + as ().~T (); + yytypeid_ = YY_NULLPTR; + } + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + semantic_type (const self_type&); + /// Non copyable. + self_type& operator= (const self_type&); +#endif + + /// Accessor to raw memory as \a T. + template + T* + yyas_ () YY_NOEXCEPT + { + void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + /// Const accessor to raw memory as \a T. + template + const T* + yyas_ () const YY_NOEXCEPT + { + const void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + /// An auxiliary type to compute the largest semantic type. + union union_type + { + // anim + char dummy1[sizeof (anim_ptr)]; + + // animation + char dummy2[sizeof (animation_ptr)]; + + // animtree + char dummy3[sizeof (animtree_ptr)]; + + // constant + char dummy4[sizeof (constant_ptr)]; + + // define + char dummy5[sizeof (define_ptr)]; + + // empty_array + char dummy6[sizeof (empty_array_ptr)]; + + // expr_arguments + // expr_arguments_filled + // expr_arguments_empty + char dummy7[sizeof (expr_arguments_ptr)]; + + // expr_assign + char dummy8[sizeof (expr_assign_ptr)]; + + // expr_call + // expr_call_thread + // expr_call_childthread + char dummy9[sizeof (expr_call_ptr)]; + + // expr_call_function + // expr_call_pointer + char dummy10[sizeof (expr_call_type_ptr)]; + + // for_expr + // expr + // expr_compare + // expr_binary + // expr_primitive + char dummy11[sizeof (expr_ptr)]; + + // false + char dummy12[sizeof (false_ptr)]; + + // file + char dummy13[sizeof (file_ptr)]; + + // neg_float + // float + char dummy14[sizeof (float_ptr)]; + + // game + char dummy15[sizeof (game_ptr)]; + + // include + char dummy16[sizeof (include_ptr)]; + + // neg_integer + // integer + char dummy17[sizeof (integer_ptr)]; + + // istring + char dummy18[sizeof (istring_ptr)]; + + // level + char dummy19[sizeof (level_ptr)]; + + // name + char dummy20[sizeof (name_ptr)]; + + // expr_function + // expr_add_array + // expr_array + // expr_field + // expr_size + // object + char dummy21[sizeof (node_ptr)]; + + // parameters + char dummy22[sizeof (parameters_ptr)]; + + // program + char dummy23[sizeof (program_ptr)]; + + // self + char dummy24[sizeof (self_ptr)]; + + // "file path" + // "identifier" + // "string literal" + // "localized string" + // "float" + // "int" + char dummy25[sizeof (std::string)]; + + // stmt_assign + char dummy26[sizeof (stmt_assign_ptr)]; + + // stmt_break + char dummy27[sizeof (stmt_break_ptr)]; + + // stmt_call + char dummy28[sizeof (stmt_call_ptr)]; + + // stmt_case + char dummy29[sizeof (stmt_case_ptr)]; + + // stmt_continue + char dummy30[sizeof (stmt_continue_ptr)]; + + // stmt_default + char dummy31[sizeof (stmt_default_ptr)]; + + // stmt_endon + char dummy32[sizeof (stmt_endon_ptr)]; + + // stmt_for + char dummy33[sizeof (stmt_for_ptr)]; + + // stmt_foreach + char dummy34[sizeof (stmt_foreach_ptr)]; + + // stmt_if + char dummy35[sizeof (stmt_if_ptr)]; + + // stmt_ifelse + char dummy36[sizeof (stmt_ifelse_ptr)]; + + // stmt_block + // stmt_list + char dummy37[sizeof (stmt_list_ptr)]; + + // stmt_notify + char dummy38[sizeof (stmt_notify_ptr)]; + + // stmt + // for_stmt + char dummy39[sizeof (stmt_ptr)]; + + // stmt_return + char dummy40[sizeof (stmt_return_ptr)]; + + // stmt_switch + char dummy41[sizeof (stmt_switch_ptr)]; + + // stmt_wait + char dummy42[sizeof (stmt_wait_ptr)]; + + // stmt_waitframe + char dummy43[sizeof (stmt_waitframe_ptr)]; + + // stmt_waittill + char dummy44[sizeof (stmt_waittill_ptr)]; + + // stmt_waittillframeend + char dummy45[sizeof (stmt_waittillframeend_ptr)]; + + // stmt_waittillmatch + char dummy46[sizeof (stmt_waittillmatch_ptr)]; + + // stmt_while + char dummy47[sizeof (stmt_while_ptr)]; + + // string + char dummy48[sizeof (string_ptr)]; + + // thisthread + char dummy49[sizeof (thisthread_ptr)]; + + // thread + char dummy50[sizeof (thread_ptr)]; + + // true + char dummy51[sizeof (true_ptr)]; + + // undefined + char dummy52[sizeof (undefined_ptr)]; + + // usingtree + char dummy53[sizeof (usingtree_ptr)]; + + // vector + char dummy54[sizeof (vector_ptr)]; + }; + + /// The size of the largest semantic type. + enum { size = sizeof (union_type) }; + + /// A buffer to store semantic values. + union + { + /// Strongest alignment constraints. + long double yyalign_me; + /// A buffer large enough to store any of the semantic values. + char yyraw[size]; + } yybuffer_; + + /// Whether the content is built: if defined, the name of the stored type. + const std::type_info *yytypeid_; + }; + +#else + typedef H1STYPE semantic_type; +#endif + /// Symbol locations. + typedef xsk::gsc::location location_type; + + /// Syntax errors thrown from user actions. + struct syntax_error : std::runtime_error + { + syntax_error (const location_type& l, const std::string& m) + : std::runtime_error (m) + , location (l) + {} + + syntax_error (const syntax_error& s) + : std::runtime_error (s.what ()) + , location (s.location) + {} + + ~syntax_error () YY_NOEXCEPT YY_NOTHROW; + + location_type location; + }; + + /// Token kinds. + struct token + { + enum token_kind_type + { + H1EMPTY = -2, + H1EOF = 0, // "end of file" + H1error = 1, // error + H1UNDEF = 2, // "invalid token" + INCLUDE = 3, // "#include" + USINGTREE = 4, // "#using_animtree" + ANIMTREE = 5, // "#animtree" + ENDON = 6, // "endon" + NOTIFY = 7, // "notify" + WAIT = 8, // "wait" + WAITTILL = 9, // "waittill" + WAITTILLMATCH = 10, // "waittillmatch" + WAITTILLFRAMEEND = 11, // "waittillframeend" + WAITFRAME = 12, // "waitframe" + IF = 13, // "if" + ELSE = 14, // "else" + WHILE = 15, // "while" + FOR = 16, // "for" + FOREACH = 17, // "foreach" + IN = 18, // "in" + SWITCH = 19, // "switch" + CASE = 20, // "case" + DEFAULT = 21, // "default" + BREAK = 22, // "break" + CONTINUE = 23, // "continue" + RETURN = 24, // "return" + THREAD = 25, // "thread" + CHILDTHREAD = 26, // "childthread" + THISTHREAD = 27, // "thisthread" + CALL = 28, // "call" + TRUE = 29, // "true" + FALSE = 30, // "false" + UNDEFINED = 31, // "undefined" + SIZE = 32, // "size" + GAME = 33, // "game" + SELF = 34, // "self" + ANIM = 35, // "anim" + LEVEL = 36, // "level" + LPAREN = 37, // "(" + RPAREN = 38, // ")" + LBRACE = 39, // "{" + RBRACE = 40, // "}" + LBRACKET = 41, // "[" + RBRACKET = 42, // "]" + COMMA = 43, // "," + DOT = 44, // "." + DOUBLECOLON = 45, // "::" + COLON = 46, // ":" + SEMICOLON = 47, // ";" + INCREMENT = 48, // "++" + DECREMENT = 49, // "--" + LSHIFT = 50, // "<<" + RSHIFT = 51, // ">>" + OR = 52, // "||" + AND = 53, // "&&" + EQUALITY = 54, // "==" + INEQUALITY = 55, // "!=" + LESS_EQUAL = 56, // "<=" + GREATER_EQUAL = 57, // ">=" + LESS = 58, // "<" + GREATER = 59, // ">" + NOT = 60, // "!" + COMPLEMENT = 61, // "~" + ASSIGN = 62, // "=" + ASSIGN_ADD = 63, // "+=" + ASSIGN_SUB = 64, // "-=" + ASSIGN_MULT = 65, // "*=" + ASSIGN_DIV = 66, // "/=" + ASSIGN_MOD = 67, // "%=" + ASSIGN_BITWISE_OR = 68, // "|=" + ASSIGN_BITWISE_AND = 69, // "&=" + ASSIGN_BITWISE_EXOR = 70, // "^=" + ASSIGN_RSHIFT = 71, // ">>=" + ASSIGN_LSHIFT = 72, // "<<=" + BITWISE_OR = 73, // "|" + BITWISE_AND = 74, // "&" + BITWISE_EXOR = 75, // "^" + ADD = 76, // "+" + SUB = 77, // "-" + MULT = 78, // "*" + DIV = 79, // "/" + MOD = 80, // "%" + FILE = 81, // "file path" + NAME = 82, // "identifier" + STRING = 83, // "string literal" + ISTRING = 84, // "localized string" + FLOAT = 85, // "float" + INTEGER = 86, // "int" + ADD_ARRAY = 87, // ADD_ARRAY + THEN = 88, // THEN + NEG = 89, // NEG + ANIMREF = 90, // ANIMREF + PREINC = 91, // PREINC + PREDEC = 92, // PREDEC + POSTINC = 93, // POSTINC + POSTDEC = 94 // POSTDEC + }; + /// Backward compatibility alias (Bison 3.6). + typedef token_kind_type yytokentype; + }; + + /// Token kind, as returned by yylex. + typedef token::yytokentype token_kind_type; + + /// Backward compatibility alias (Bison 3.6). + typedef token_kind_type token_type; + + /// Symbol kinds. + struct symbol_kind + { + enum symbol_kind_type + { + YYNTOKENS = 95, ///< Number of tokens. + S_YYEMPTY = -2, + S_YYEOF = 0, // "end of file" + S_YYerror = 1, // error + S_YYUNDEF = 2, // "invalid token" + S_INCLUDE = 3, // "#include" + S_USINGTREE = 4, // "#using_animtree" + S_ANIMTREE = 5, // "#animtree" + S_ENDON = 6, // "endon" + S_NOTIFY = 7, // "notify" + S_WAIT = 8, // "wait" + S_WAITTILL = 9, // "waittill" + S_WAITTILLMATCH = 10, // "waittillmatch" + S_WAITTILLFRAMEEND = 11, // "waittillframeend" + S_WAITFRAME = 12, // "waitframe" + S_IF = 13, // "if" + S_ELSE = 14, // "else" + S_WHILE = 15, // "while" + S_FOR = 16, // "for" + S_FOREACH = 17, // "foreach" + S_IN = 18, // "in" + S_SWITCH = 19, // "switch" + S_CASE = 20, // "case" + S_DEFAULT = 21, // "default" + S_BREAK = 22, // "break" + S_CONTINUE = 23, // "continue" + S_RETURN = 24, // "return" + S_THREAD = 25, // "thread" + S_CHILDTHREAD = 26, // "childthread" + S_THISTHREAD = 27, // "thisthread" + S_CALL = 28, // "call" + S_TRUE = 29, // "true" + S_FALSE = 30, // "false" + S_UNDEFINED = 31, // "undefined" + S_SIZE = 32, // "size" + S_GAME = 33, // "game" + S_SELF = 34, // "self" + S_ANIM = 35, // "anim" + S_LEVEL = 36, // "level" + S_LPAREN = 37, // "(" + S_RPAREN = 38, // ")" + S_LBRACE = 39, // "{" + S_RBRACE = 40, // "}" + S_LBRACKET = 41, // "[" + S_RBRACKET = 42, // "]" + S_COMMA = 43, // "," + S_DOT = 44, // "." + S_DOUBLECOLON = 45, // "::" + S_COLON = 46, // ":" + S_SEMICOLON = 47, // ";" + S_INCREMENT = 48, // "++" + S_DECREMENT = 49, // "--" + S_LSHIFT = 50, // "<<" + S_RSHIFT = 51, // ">>" + S_OR = 52, // "||" + S_AND = 53, // "&&" + S_EQUALITY = 54, // "==" + S_INEQUALITY = 55, // "!=" + S_LESS_EQUAL = 56, // "<=" + S_GREATER_EQUAL = 57, // ">=" + S_LESS = 58, // "<" + S_GREATER = 59, // ">" + S_NOT = 60, // "!" + S_COMPLEMENT = 61, // "~" + S_ASSIGN = 62, // "=" + S_ASSIGN_ADD = 63, // "+=" + S_ASSIGN_SUB = 64, // "-=" + S_ASSIGN_MULT = 65, // "*=" + S_ASSIGN_DIV = 66, // "/=" + S_ASSIGN_MOD = 67, // "%=" + S_ASSIGN_BITWISE_OR = 68, // "|=" + S_ASSIGN_BITWISE_AND = 69, // "&=" + S_ASSIGN_BITWISE_EXOR = 70, // "^=" + S_ASSIGN_RSHIFT = 71, // ">>=" + S_ASSIGN_LSHIFT = 72, // "<<=" + S_BITWISE_OR = 73, // "|" + S_BITWISE_AND = 74, // "&" + S_BITWISE_EXOR = 75, // "^" + S_ADD = 76, // "+" + S_SUB = 77, // "-" + S_MULT = 78, // "*" + S_DIV = 79, // "/" + S_MOD = 80, // "%" + S_FILE = 81, // "file path" + S_NAME = 82, // "identifier" + S_STRING = 83, // "string literal" + S_ISTRING = 84, // "localized string" + S_FLOAT = 85, // "float" + S_INTEGER = 86, // "int" + S_ADD_ARRAY = 87, // ADD_ARRAY + S_THEN = 88, // THEN + S_NEG = 89, // NEG + S_ANIMREF = 90, // ANIMREF + S_PREINC = 91, // PREINC + S_PREDEC = 92, // PREDEC + S_POSTINC = 93, // POSTINC + S_POSTDEC = 94, // POSTDEC + S_YYACCEPT = 95, // $accept + S_root = 96, // root + S_program = 97, // program + S_include = 98, // include + S_define = 99, // define + S_usingtree = 100, // usingtree + S_constant = 101, // constant + S_thread = 102, // thread + S_parameters = 103, // parameters + S_stmt = 104, // stmt + S_stmt_block = 105, // stmt_block + S_stmt_list = 106, // stmt_list + S_stmt_call = 107, // stmt_call + S_stmt_assign = 108, // stmt_assign + S_stmt_endon = 109, // stmt_endon + S_stmt_notify = 110, // stmt_notify + S_stmt_wait = 111, // stmt_wait + S_stmt_waittill = 112, // stmt_waittill + S_stmt_waittillmatch = 113, // stmt_waittillmatch + S_stmt_waittillframeend = 114, // stmt_waittillframeend + S_stmt_waitframe = 115, // stmt_waitframe + S_stmt_if = 116, // stmt_if + S_stmt_ifelse = 117, // stmt_ifelse + S_stmt_while = 118, // stmt_while + S_stmt_for = 119, // stmt_for + S_stmt_foreach = 120, // stmt_foreach + S_stmt_switch = 121, // stmt_switch + S_stmt_case = 122, // stmt_case + S_stmt_default = 123, // stmt_default + S_stmt_break = 124, // stmt_break + S_stmt_continue = 125, // stmt_continue + S_stmt_return = 126, // stmt_return + S_for_stmt = 127, // for_stmt + S_for_expr = 128, // for_expr + S_expr = 129, // expr + S_expr_assign = 130, // expr_assign + S_expr_compare = 131, // expr_compare + S_expr_binary = 132, // expr_binary + S_expr_primitive = 133, // expr_primitive + S_expr_call = 134, // expr_call + S_expr_call_thread = 135, // expr_call_thread + S_expr_call_childthread = 136, // expr_call_childthread + S_expr_call_function = 137, // expr_call_function + S_expr_call_pointer = 138, // expr_call_pointer + S_expr_arguments = 139, // expr_arguments + S_expr_arguments_filled = 140, // expr_arguments_filled + S_expr_arguments_empty = 141, // expr_arguments_empty + S_expr_function = 142, // expr_function + S_expr_add_array = 143, // expr_add_array + S_expr_array = 144, // expr_array + S_expr_field = 145, // expr_field + S_expr_size = 146, // expr_size + S_object = 147, // object + S_thisthread = 148, // thisthread + S_empty_array = 149, // empty_array + S_undefined = 150, // undefined + S_game = 151, // game + S_self = 152, // self + S_anim = 153, // anim + S_level = 154, // level + S_animation = 155, // animation + S_animtree = 156, // animtree + S_name = 157, // name + S_file = 158, // file + S_istring = 159, // istring + S_string = 160, // string + S_vector = 161, // vector + S_neg_float = 162, // neg_float + S_neg_integer = 163, // neg_integer + S_float = 164, // float + S_integer = 165, // integer + S_false = 166, // false + S_true = 167 // true + }; + }; + + /// (Internal) symbol kind. + typedef symbol_kind::symbol_kind_type symbol_kind_type; + + /// The number of tokens. + static const symbol_kind_type YYNTOKENS = symbol_kind::YYNTOKENS; + + /// A complete symbol. + /// + /// Expects its Base type to provide access to the symbol kind + /// via kind (). + /// + /// Provide access to semantic value and location. + template + struct basic_symbol : Base + { + /// Alias to Base. + typedef Base super_type; + + /// Default constructor. + basic_symbol () + : value () + , location () + {} + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + basic_symbol (basic_symbol&& that) + : Base (std::move (that)) + , value () + , location (std::move (that.location)) + { + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (std::move (that.value)); + break; + + default: + break; + } + + } +#endif + + /// Copy constructor. + basic_symbol (const basic_symbol& that); + + /// Constructors for typed symbols. +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, location_type&& l) + : Base (t) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const location_type& l) + : Base (t) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, anim_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const anim_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, animation_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const animation_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, animtree_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const animtree_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, constant_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const constant_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, define_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const define_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, empty_array_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const empty_array_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_arguments_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_arguments_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_assign_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_assign_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_call_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_call_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_call_type_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_call_type_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, false_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const false_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, file_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const file_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, float_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const float_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, game_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const game_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, include_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const include_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, integer_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const integer_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, istring_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const istring_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, level_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const level_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, name_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const name_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, node_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const node_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, parameters_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const parameters_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, program_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const program_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, self_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const self_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_assign_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_assign_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_break_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_break_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_call_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_call_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_case_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_case_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_continue_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_continue_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_default_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_default_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_endon_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_endon_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_for_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_for_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_foreach_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_foreach_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_if_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_if_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_ifelse_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_ifelse_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_list_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_list_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_notify_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_notify_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_return_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_return_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_switch_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_switch_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_wait_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_wait_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waitframe_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waitframe_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittill_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittill_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittillframeend_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittillframeend_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittillmatch_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittillmatch_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_while_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_while_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, string_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const string_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, thisthread_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const thisthread_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, thread_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const thread_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, true_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const true_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, undefined_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const undefined_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, usingtree_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const usingtree_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, vector_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const vector_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + + /// Destroy the symbol. + ~basic_symbol () + { + clear (); + } + + /// Destroy contents, and record that is empty. + void clear () YY_NOEXCEPT + { + // User destructor. + symbol_kind_type yykind = this->kind (); + basic_symbol& yysym = *this; + (void) yysym; + switch (yykind) + { + default: + break; + } + + // Value type destructor. +switch (yykind) + { + case symbol_kind::S_anim: // anim + value.template destroy< anim_ptr > (); + break; + + case symbol_kind::S_animation: // animation + value.template destroy< animation_ptr > (); + break; + + case symbol_kind::S_animtree: // animtree + value.template destroy< animtree_ptr > (); + break; + + case symbol_kind::S_constant: // constant + value.template destroy< constant_ptr > (); + break; + + case symbol_kind::S_define: // define + value.template destroy< define_ptr > (); + break; + + case symbol_kind::S_empty_array: // empty_array + value.template destroy< empty_array_ptr > (); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.template destroy< expr_arguments_ptr > (); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.template destroy< expr_assign_ptr > (); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.template destroy< expr_call_ptr > (); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.template destroy< expr_call_type_ptr > (); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.template destroy< expr_ptr > (); + break; + + case symbol_kind::S_false: // false + value.template destroy< false_ptr > (); + break; + + case symbol_kind::S_file: // file + value.template destroy< file_ptr > (); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.template destroy< float_ptr > (); + break; + + case symbol_kind::S_game: // game + value.template destroy< game_ptr > (); + break; + + case symbol_kind::S_include: // include + value.template destroy< include_ptr > (); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.template destroy< integer_ptr > (); + break; + + case symbol_kind::S_istring: // istring + value.template destroy< istring_ptr > (); + break; + + case symbol_kind::S_level: // level + value.template destroy< level_ptr > (); + break; + + case symbol_kind::S_name: // name + value.template destroy< name_ptr > (); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.template destroy< node_ptr > (); + break; + + case symbol_kind::S_parameters: // parameters + value.template destroy< parameters_ptr > (); + break; + + case symbol_kind::S_program: // program + value.template destroy< program_ptr > (); + break; + + case symbol_kind::S_self: // self + value.template destroy< self_ptr > (); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.template destroy< std::string > (); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.template destroy< stmt_assign_ptr > (); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.template destroy< stmt_break_ptr > (); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.template destroy< stmt_call_ptr > (); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.template destroy< stmt_case_ptr > (); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.template destroy< stmt_continue_ptr > (); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.template destroy< stmt_default_ptr > (); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.template destroy< stmt_endon_ptr > (); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.template destroy< stmt_for_ptr > (); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.template destroy< stmt_foreach_ptr > (); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.template destroy< stmt_if_ptr > (); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.template destroy< stmt_ifelse_ptr > (); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.template destroy< stmt_list_ptr > (); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.template destroy< stmt_notify_ptr > (); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.template destroy< stmt_ptr > (); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.template destroy< stmt_return_ptr > (); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.template destroy< stmt_switch_ptr > (); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.template destroy< stmt_wait_ptr > (); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.template destroy< stmt_waitframe_ptr > (); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.template destroy< stmt_waittill_ptr > (); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.template destroy< stmt_waittillframeend_ptr > (); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.template destroy< stmt_waittillmatch_ptr > (); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.template destroy< stmt_while_ptr > (); + break; + + case symbol_kind::S_string: // string + value.template destroy< string_ptr > (); + break; + + case symbol_kind::S_thisthread: // thisthread + value.template destroy< thisthread_ptr > (); + break; + + case symbol_kind::S_thread: // thread + value.template destroy< thread_ptr > (); + break; + + case symbol_kind::S_true: // true + value.template destroy< true_ptr > (); + break; + + case symbol_kind::S_undefined: // undefined + value.template destroy< undefined_ptr > (); + break; + + case symbol_kind::S_usingtree: // usingtree + value.template destroy< usingtree_ptr > (); + break; + + case symbol_kind::S_vector: // vector + value.template destroy< vector_ptr > (); + break; + + default: + break; + } + + Base::clear (); + } + + /// The user-facing name of this symbol. + const char *name () const YY_NOEXCEPT + { + return parser::symbol_name (this->kind ()); + } + + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; + + /// Whether empty. + bool empty () const YY_NOEXCEPT; + + /// Destructive move, \a s is emptied into this. + void move (basic_symbol& s); + + /// The semantic value. + semantic_type value; + + /// The location. + location_type location; + + private: +#if YY_CPLUSPLUS < 201103L + /// Assignment operator. + basic_symbol& operator= (const basic_symbol& that); +#endif + }; + + /// Type access provider for token (enum) based symbols. + struct by_kind + { + /// Default constructor. + by_kind (); + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + by_kind (by_kind&& that); +#endif + + /// Copy constructor. + by_kind (const by_kind& that); + + /// The symbol kind as needed by the constructor. + typedef token_kind_type kind_type; + + /// Constructor from (external) token numbers. + by_kind (kind_type t); + + /// Record that this symbol is empty. + void clear () YY_NOEXCEPT; + + /// Steal the symbol kind from \a that. + void move (by_kind& that); + + /// The (internal) type number (corresponding to \a type). + /// \a empty when empty. + symbol_kind_type kind () const YY_NOEXCEPT; + + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; + + /// The symbol kind. + /// \a S_YYEMPTY when empty. + symbol_kind_type kind_; + }; + + /// Backward compatibility for a private implementation detail (Bison 3.6). + typedef by_kind by_type; + + /// "External" symbols: returned by the scanner. + struct symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + + /// Empty symbol. + symbol_type () {} + + /// Constructor for valueless symbols, and symbols from each type. +#if 201103L <= YY_CPLUSPLUS + symbol_type (int tok, location_type l) + : super_type(token_type (tok), std::move (l)) +#else + symbol_type (int tok, const location_type& l) + : super_type(token_type (tok), l) +#endif + { + H1_ASSERT (tok == token::H1EOF + || (token::H1error <= tok && tok <= token::MOD) + || (token::ADD_ARRAY <= tok && tok <= token::POSTDEC)); + } +#if 201103L <= YY_CPLUSPLUS + symbol_type (int tok, std::string v, location_type l) + : super_type(token_type (tok), std::move (v), std::move (l)) +#else + symbol_type (int tok, const std::string& v, const location_type& l) + : super_type(token_type (tok), v, l) +#endif + { + H1_ASSERT ((token::FILE <= tok && tok <= token::INTEGER)); + } + }; + + /// Build a parser object. + parser (yyscan_t yyscanner_yyarg, xsk::gsc::location& loc_yyarg, xsk::gsc::program_ptr& ast_yyarg); + virtual ~parser (); + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + parser (const parser&) = delete; + /// Non copyable. + parser& operator= (const parser&) = delete; +#endif + + /// Parse. An alias for parse (). + /// \returns 0 iff parsing succeeded. + int operator() (); + + /// Parse. + /// \returns 0 iff parsing succeeded. + virtual int parse (); + +#if H1DEBUG + /// The current debugging stream. + std::ostream& debug_stream () const YY_ATTRIBUTE_PURE; + /// Set the current debugging stream. + void set_debug_stream (std::ostream &); + + /// Type for debugging levels. + typedef int debug_level_type; + /// The current debugging level. + debug_level_type debug_level () const YY_ATTRIBUTE_PURE; + /// Set the current debugging level. + void set_debug_level (debug_level_type l); +#endif + + /// Report a syntax error. + /// \param loc where the syntax error is found. + /// \param msg a description of the syntax error. + virtual void error (const location_type& loc, const std::string& msg); + + /// Report a syntax error. + void error (const syntax_error& err); + + /// The user-facing name of the symbol whose (internal) number is + /// YYSYMBOL. No bounds checking. + static const char *symbol_name (symbol_kind_type yysymbol); + + // Implementation of make_symbol for each symbol type. +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_H1EOF (location_type l) + { + return symbol_type (token::H1EOF, std::move (l)); + } +#else + static + symbol_type + make_H1EOF (const location_type& l) + { + return symbol_type (token::H1EOF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_H1error (location_type l) + { + return symbol_type (token::H1error, std::move (l)); + } +#else + static + symbol_type + make_H1error (const location_type& l) + { + return symbol_type (token::H1error, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_H1UNDEF (location_type l) + { + return symbol_type (token::H1UNDEF, std::move (l)); + } +#else + static + symbol_type + make_H1UNDEF (const location_type& l) + { + return symbol_type (token::H1UNDEF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INCLUDE (location_type l) + { + return symbol_type (token::INCLUDE, std::move (l)); + } +#else + static + symbol_type + make_INCLUDE (const location_type& l) + { + return symbol_type (token::INCLUDE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_USINGTREE (location_type l) + { + return symbol_type (token::USINGTREE, std::move (l)); + } +#else + static + symbol_type + make_USINGTREE (const location_type& l) + { + return symbol_type (token::USINGTREE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIMTREE (location_type l) + { + return symbol_type (token::ANIMTREE, std::move (l)); + } +#else + static + symbol_type + make_ANIMTREE (const location_type& l) + { + return symbol_type (token::ANIMTREE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ENDON (location_type l) + { + return symbol_type (token::ENDON, std::move (l)); + } +#else + static + symbol_type + make_ENDON (const location_type& l) + { + return symbol_type (token::ENDON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NOTIFY (location_type l) + { + return symbol_type (token::NOTIFY, std::move (l)); + } +#else + static + symbol_type + make_NOTIFY (const location_type& l) + { + return symbol_type (token::NOTIFY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAIT (location_type l) + { + return symbol_type (token::WAIT, std::move (l)); + } +#else + static + symbol_type + make_WAIT (const location_type& l) + { + return symbol_type (token::WAIT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILL (location_type l) + { + return symbol_type (token::WAITTILL, std::move (l)); + } +#else + static + symbol_type + make_WAITTILL (const location_type& l) + { + return symbol_type (token::WAITTILL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILLMATCH (location_type l) + { + return symbol_type (token::WAITTILLMATCH, std::move (l)); + } +#else + static + symbol_type + make_WAITTILLMATCH (const location_type& l) + { + return symbol_type (token::WAITTILLMATCH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILLFRAMEEND (location_type l) + { + return symbol_type (token::WAITTILLFRAMEEND, std::move (l)); + } +#else + static + symbol_type + make_WAITTILLFRAMEEND (const location_type& l) + { + return symbol_type (token::WAITTILLFRAMEEND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITFRAME (location_type l) + { + return symbol_type (token::WAITFRAME, std::move (l)); + } +#else + static + symbol_type + make_WAITFRAME (const location_type& l) + { + return symbol_type (token::WAITFRAME, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IF (location_type l) + { + return symbol_type (token::IF, std::move (l)); + } +#else + static + symbol_type + make_IF (const location_type& l) + { + return symbol_type (token::IF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ELSE (location_type l) + { + return symbol_type (token::ELSE, std::move (l)); + } +#else + static + symbol_type + make_ELSE (const location_type& l) + { + return symbol_type (token::ELSE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WHILE (location_type l) + { + return symbol_type (token::WHILE, std::move (l)); + } +#else + static + symbol_type + make_WHILE (const location_type& l) + { + return symbol_type (token::WHILE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FOR (location_type l) + { + return symbol_type (token::FOR, std::move (l)); + } +#else + static + symbol_type + make_FOR (const location_type& l) + { + return symbol_type (token::FOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FOREACH (location_type l) + { + return symbol_type (token::FOREACH, std::move (l)); + } +#else + static + symbol_type + make_FOREACH (const location_type& l) + { + return symbol_type (token::FOREACH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IN (location_type l) + { + return symbol_type (token::IN, std::move (l)); + } +#else + static + symbol_type + make_IN (const location_type& l) + { + return symbol_type (token::IN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SWITCH (location_type l) + { + return symbol_type (token::SWITCH, std::move (l)); + } +#else + static + symbol_type + make_SWITCH (const location_type& l) + { + return symbol_type (token::SWITCH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CASE (location_type l) + { + return symbol_type (token::CASE, std::move (l)); + } +#else + static + symbol_type + make_CASE (const location_type& l) + { + return symbol_type (token::CASE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DEFAULT (location_type l) + { + return symbol_type (token::DEFAULT, std::move (l)); + } +#else + static + symbol_type + make_DEFAULT (const location_type& l) + { + return symbol_type (token::DEFAULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BREAK (location_type l) + { + return symbol_type (token::BREAK, std::move (l)); + } +#else + static + symbol_type + make_BREAK (const location_type& l) + { + return symbol_type (token::BREAK, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CONTINUE (location_type l) + { + return symbol_type (token::CONTINUE, std::move (l)); + } +#else + static + symbol_type + make_CONTINUE (const location_type& l) + { + return symbol_type (token::CONTINUE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RETURN (location_type l) + { + return symbol_type (token::RETURN, std::move (l)); + } +#else + static + symbol_type + make_RETURN (const location_type& l) + { + return symbol_type (token::RETURN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THREAD (location_type l) + { + return symbol_type (token::THREAD, std::move (l)); + } +#else + static + symbol_type + make_THREAD (const location_type& l) + { + return symbol_type (token::THREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CHILDTHREAD (location_type l) + { + return symbol_type (token::CHILDTHREAD, std::move (l)); + } +#else + static + symbol_type + make_CHILDTHREAD (const location_type& l) + { + return symbol_type (token::CHILDTHREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THISTHREAD (location_type l) + { + return symbol_type (token::THISTHREAD, std::move (l)); + } +#else + static + symbol_type + make_THISTHREAD (const location_type& l) + { + return symbol_type (token::THISTHREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CALL (location_type l) + { + return symbol_type (token::CALL, std::move (l)); + } +#else + static + symbol_type + make_CALL (const location_type& l) + { + return symbol_type (token::CALL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_TRUE (location_type l) + { + return symbol_type (token::TRUE, std::move (l)); + } +#else + static + symbol_type + make_TRUE (const location_type& l) + { + return symbol_type (token::TRUE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FALSE (location_type l) + { + return symbol_type (token::FALSE, std::move (l)); + } +#else + static + symbol_type + make_FALSE (const location_type& l) + { + return symbol_type (token::FALSE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_UNDEFINED (location_type l) + { + return symbol_type (token::UNDEFINED, std::move (l)); + } +#else + static + symbol_type + make_UNDEFINED (const location_type& l) + { + return symbol_type (token::UNDEFINED, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SIZE (location_type l) + { + return symbol_type (token::SIZE, std::move (l)); + } +#else + static + symbol_type + make_SIZE (const location_type& l) + { + return symbol_type (token::SIZE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GAME (location_type l) + { + return symbol_type (token::GAME, std::move (l)); + } +#else + static + symbol_type + make_GAME (const location_type& l) + { + return symbol_type (token::GAME, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SELF (location_type l) + { + return symbol_type (token::SELF, std::move (l)); + } +#else + static + symbol_type + make_SELF (const location_type& l) + { + return symbol_type (token::SELF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIM (location_type l) + { + return symbol_type (token::ANIM, std::move (l)); + } +#else + static + symbol_type + make_ANIM (const location_type& l) + { + return symbol_type (token::ANIM, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LEVEL (location_type l) + { + return symbol_type (token::LEVEL, std::move (l)); + } +#else + static + symbol_type + make_LEVEL (const location_type& l) + { + return symbol_type (token::LEVEL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LPAREN (location_type l) + { + return symbol_type (token::LPAREN, std::move (l)); + } +#else + static + symbol_type + make_LPAREN (const location_type& l) + { + return symbol_type (token::LPAREN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RPAREN (location_type l) + { + return symbol_type (token::RPAREN, std::move (l)); + } +#else + static + symbol_type + make_RPAREN (const location_type& l) + { + return symbol_type (token::RPAREN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LBRACE (location_type l) + { + return symbol_type (token::LBRACE, std::move (l)); + } +#else + static + symbol_type + make_LBRACE (const location_type& l) + { + return symbol_type (token::LBRACE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RBRACE (location_type l) + { + return symbol_type (token::RBRACE, std::move (l)); + } +#else + static + symbol_type + make_RBRACE (const location_type& l) + { + return symbol_type (token::RBRACE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LBRACKET (location_type l) + { + return symbol_type (token::LBRACKET, std::move (l)); + } +#else + static + symbol_type + make_LBRACKET (const location_type& l) + { + return symbol_type (token::LBRACKET, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RBRACKET (location_type l) + { + return symbol_type (token::RBRACKET, std::move (l)); + } +#else + static + symbol_type + make_RBRACKET (const location_type& l) + { + return symbol_type (token::RBRACKET, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COMMA (location_type l) + { + return symbol_type (token::COMMA, std::move (l)); + } +#else + static + symbol_type + make_COMMA (const location_type& l) + { + return symbol_type (token::COMMA, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DOT (location_type l) + { + return symbol_type (token::DOT, std::move (l)); + } +#else + static + symbol_type + make_DOT (const location_type& l) + { + return symbol_type (token::DOT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DOUBLECOLON (location_type l) + { + return symbol_type (token::DOUBLECOLON, std::move (l)); + } +#else + static + symbol_type + make_DOUBLECOLON (const location_type& l) + { + return symbol_type (token::DOUBLECOLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COLON (location_type l) + { + return symbol_type (token::COLON, std::move (l)); + } +#else + static + symbol_type + make_COLON (const location_type& l) + { + return symbol_type (token::COLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SEMICOLON (location_type l) + { + return symbol_type (token::SEMICOLON, std::move (l)); + } +#else + static + symbol_type + make_SEMICOLON (const location_type& l) + { + return symbol_type (token::SEMICOLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INCREMENT (location_type l) + { + return symbol_type (token::INCREMENT, std::move (l)); + } +#else + static + symbol_type + make_INCREMENT (const location_type& l) + { + return symbol_type (token::INCREMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DECREMENT (location_type l) + { + return symbol_type (token::DECREMENT, std::move (l)); + } +#else + static + symbol_type + make_DECREMENT (const location_type& l) + { + return symbol_type (token::DECREMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LSHIFT (location_type l) + { + return symbol_type (token::LSHIFT, std::move (l)); + } +#else + static + symbol_type + make_LSHIFT (const location_type& l) + { + return symbol_type (token::LSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RSHIFT (location_type l) + { + return symbol_type (token::RSHIFT, std::move (l)); + } +#else + static + symbol_type + make_RSHIFT (const location_type& l) + { + return symbol_type (token::RSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_OR (location_type l) + { + return symbol_type (token::OR, std::move (l)); + } +#else + static + symbol_type + make_OR (const location_type& l) + { + return symbol_type (token::OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_AND (location_type l) + { + return symbol_type (token::AND, std::move (l)); + } +#else + static + symbol_type + make_AND (const location_type& l) + { + return symbol_type (token::AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_EQUALITY (location_type l) + { + return symbol_type (token::EQUALITY, std::move (l)); + } +#else + static + symbol_type + make_EQUALITY (const location_type& l) + { + return symbol_type (token::EQUALITY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INEQUALITY (location_type l) + { + return symbol_type (token::INEQUALITY, std::move (l)); + } +#else + static + symbol_type + make_INEQUALITY (const location_type& l) + { + return symbol_type (token::INEQUALITY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LESS_EQUAL (location_type l) + { + return symbol_type (token::LESS_EQUAL, std::move (l)); + } +#else + static + symbol_type + make_LESS_EQUAL (const location_type& l) + { + return symbol_type (token::LESS_EQUAL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GREATER_EQUAL (location_type l) + { + return symbol_type (token::GREATER_EQUAL, std::move (l)); + } +#else + static + symbol_type + make_GREATER_EQUAL (const location_type& l) + { + return symbol_type (token::GREATER_EQUAL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LESS (location_type l) + { + return symbol_type (token::LESS, std::move (l)); + } +#else + static + symbol_type + make_LESS (const location_type& l) + { + return symbol_type (token::LESS, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GREATER (location_type l) + { + return symbol_type (token::GREATER, std::move (l)); + } +#else + static + symbol_type + make_GREATER (const location_type& l) + { + return symbol_type (token::GREATER, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NOT (location_type l) + { + return symbol_type (token::NOT, std::move (l)); + } +#else + static + symbol_type + make_NOT (const location_type& l) + { + return symbol_type (token::NOT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COMPLEMENT (location_type l) + { + return symbol_type (token::COMPLEMENT, std::move (l)); + } +#else + static + symbol_type + make_COMPLEMENT (const location_type& l) + { + return symbol_type (token::COMPLEMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN (location_type l) + { + return symbol_type (token::ASSIGN, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN (const location_type& l) + { + return symbol_type (token::ASSIGN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_ADD (location_type l) + { + return symbol_type (token::ASSIGN_ADD, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_ADD (const location_type& l) + { + return symbol_type (token::ASSIGN_ADD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_SUB (location_type l) + { + return symbol_type (token::ASSIGN_SUB, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_SUB (const location_type& l) + { + return symbol_type (token::ASSIGN_SUB, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_MULT (location_type l) + { + return symbol_type (token::ASSIGN_MULT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_MULT (const location_type& l) + { + return symbol_type (token::ASSIGN_MULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_DIV (location_type l) + { + return symbol_type (token::ASSIGN_DIV, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_DIV (const location_type& l) + { + return symbol_type (token::ASSIGN_DIV, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_MOD (location_type l) + { + return symbol_type (token::ASSIGN_MOD, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_MOD (const location_type& l) + { + return symbol_type (token::ASSIGN_MOD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_OR (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_OR, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_OR (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_AND (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_AND, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_AND (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_EXOR (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_EXOR, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_EXOR (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_EXOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_RSHIFT (location_type l) + { + return symbol_type (token::ASSIGN_RSHIFT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_RSHIFT (const location_type& l) + { + return symbol_type (token::ASSIGN_RSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_LSHIFT (location_type l) + { + return symbol_type (token::ASSIGN_LSHIFT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_LSHIFT (const location_type& l) + { + return symbol_type (token::ASSIGN_LSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_OR (location_type l) + { + return symbol_type (token::BITWISE_OR, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_OR (const location_type& l) + { + return symbol_type (token::BITWISE_OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_AND (location_type l) + { + return symbol_type (token::BITWISE_AND, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_AND (const location_type& l) + { + return symbol_type (token::BITWISE_AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_EXOR (location_type l) + { + return symbol_type (token::BITWISE_EXOR, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_EXOR (const location_type& l) + { + return symbol_type (token::BITWISE_EXOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ADD (location_type l) + { + return symbol_type (token::ADD, std::move (l)); + } +#else + static + symbol_type + make_ADD (const location_type& l) + { + return symbol_type (token::ADD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SUB (location_type l) + { + return symbol_type (token::SUB, std::move (l)); + } +#else + static + symbol_type + make_SUB (const location_type& l) + { + return symbol_type (token::SUB, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_MULT (location_type l) + { + return symbol_type (token::MULT, std::move (l)); + } +#else + static + symbol_type + make_MULT (const location_type& l) + { + return symbol_type (token::MULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DIV (location_type l) + { + return symbol_type (token::DIV, std::move (l)); + } +#else + static + symbol_type + make_DIV (const location_type& l) + { + return symbol_type (token::DIV, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_MOD (location_type l) + { + return symbol_type (token::MOD, std::move (l)); + } +#else + static + symbol_type + make_MOD (const location_type& l) + { + return symbol_type (token::MOD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FILE (std::string v, location_type l) + { + return symbol_type (token::FILE, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_FILE (const std::string& v, const location_type& l) + { + return symbol_type (token::FILE, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NAME (std::string v, location_type l) + { + return symbol_type (token::NAME, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_NAME (const std::string& v, const location_type& l) + { + return symbol_type (token::NAME, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_STRING (std::string v, location_type l) + { + return symbol_type (token::STRING, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_STRING (const std::string& v, const location_type& l) + { + return symbol_type (token::STRING, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ISTRING (std::string v, location_type l) + { + return symbol_type (token::ISTRING, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_ISTRING (const std::string& v, const location_type& l) + { + return symbol_type (token::ISTRING, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FLOAT (std::string v, location_type l) + { + return symbol_type (token::FLOAT, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_FLOAT (const std::string& v, const location_type& l) + { + return symbol_type (token::FLOAT, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INTEGER (std::string v, location_type l) + { + return symbol_type (token::INTEGER, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_INTEGER (const std::string& v, const location_type& l) + { + return symbol_type (token::INTEGER, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ADD_ARRAY (location_type l) + { + return symbol_type (token::ADD_ARRAY, std::move (l)); + } +#else + static + symbol_type + make_ADD_ARRAY (const location_type& l) + { + return symbol_type (token::ADD_ARRAY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THEN (location_type l) + { + return symbol_type (token::THEN, std::move (l)); + } +#else + static + symbol_type + make_THEN (const location_type& l) + { + return symbol_type (token::THEN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NEG (location_type l) + { + return symbol_type (token::NEG, std::move (l)); + } +#else + static + symbol_type + make_NEG (const location_type& l) + { + return symbol_type (token::NEG, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIMREF (location_type l) + { + return symbol_type (token::ANIMREF, std::move (l)); + } +#else + static + symbol_type + make_ANIMREF (const location_type& l) + { + return symbol_type (token::ANIMREF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_PREINC (location_type l) + { + return symbol_type (token::PREINC, std::move (l)); + } +#else + static + symbol_type + make_PREINC (const location_type& l) + { + return symbol_type (token::PREINC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_PREDEC (location_type l) + { + return symbol_type (token::PREDEC, std::move (l)); + } +#else + static + symbol_type + make_PREDEC (const location_type& l) + { + return symbol_type (token::PREDEC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_POSTINC (location_type l) + { + return symbol_type (token::POSTINC, std::move (l)); + } +#else + static + symbol_type + make_POSTINC (const location_type& l) + { + return symbol_type (token::POSTINC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_POSTDEC (location_type l) + { + return symbol_type (token::POSTDEC, std::move (l)); + } +#else + static + symbol_type + make_POSTDEC (const location_type& l) + { + return symbol_type (token::POSTDEC, l); + } +#endif + + + class context + { + public: + context (const parser& yyparser, const symbol_type& yyla); + const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; } + symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); } + const location_type& location () const YY_NOEXCEPT { return yyla_.location; } + + /// Put in YYARG at most YYARGN of the expected tokens, and return the + /// number of tokens stored in YYARG. If YYARG is null, return the + /// number of expected tokens (guaranteed to be less than YYNTOKENS). + int expected_tokens (symbol_kind_type yyarg[], int yyargn) const; + + private: + const parser& yyparser_; + const symbol_type& yyla_; + }; + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + parser (const parser&); + /// Non copyable. + parser& operator= (const parser&); +#endif + + /// Check the lookahead yytoken. + /// \returns true iff the token will be eventually shifted. + bool yy_lac_check_ (symbol_kind_type yytoken) const; + /// Establish the initial context if no initial context currently exists. + /// \returns true iff the token will be eventually shifted. + bool yy_lac_establish_ (symbol_kind_type yytoken); + /// Discard any previous initial lookahead context because of event. + /// \param event the event which caused the lookahead to be discarded. + /// Only used for debbuging output. + void yy_lac_discard_ (const char* event); + + /// Stored state numbers (used for stacks). + typedef short state_type; + + /// The arguments of the error message. + int yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const; + + /// Generate an error message. + /// \param yyctx the context in which the error occurred. + virtual std::string yysyntax_error_ (const context& yyctx) const; + /// Compute post-reduction state. + /// \param yystate the current state + /// \param yysym the nonterminal to push on the stack + static state_type yy_lr_goto_state_ (state_type yystate, int yysym); + + /// Whether the given \c yypact_ value indicates a defaulted state. + /// \param yyvalue the value to check + static bool yy_pact_value_is_default_ (int yyvalue); + + /// Whether the given \c yytable_ value indicates a syntax error. + /// \param yyvalue the value to check + static bool yy_table_value_is_error_ (int yyvalue); + + static const short yypact_ninf_; + static const short yytable_ninf_; + + /// Convert a scanner token kind \a t to a symbol kind. + /// In theory \a t should be a token_kind_type, but character literals + /// are valid, yet not members of the token_type enum. + static symbol_kind_type yytranslate_ (int t); + + + + // Tables. + // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + // STATE-NUM. + static const short yypact_[]; + + // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + // Performed when YYTABLE does not specify something else to do. Zero + // means the default is an error. + static const unsigned char yydefact_[]; + + // YYPGOTO[NTERM-NUM]. + static const short yypgoto_[]; + + // YYDEFGOTO[NTERM-NUM]. + static const short yydefgoto_[]; + + // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + // positive, shift that token. If negative, reduce the rule whose + // number is the opposite. If YYTABLE_NINF, syntax error. + static const short yytable_[]; + + static const short yycheck_[]; + + // YYSTOS[STATE-NUM] -- The (internal number of the) accessing + // symbol of state STATE-NUM. + static const unsigned char yystos_[]; + + // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + static const unsigned char yyr1_[]; + + // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + static const signed char yyr2_[]; + + +#if H1DEBUG + // YYRLINE[YYN] -- Source line where rule number YYN was defined. + static const short yyrline_[]; + /// Report on the debug stream that the rule \a r is going to be reduced. + virtual void yy_reduce_print_ (int r) const; + /// Print the state stack on the debug stream. + virtual void yy_stack_print_ () const; + + /// Debugging level. + int yydebug_; + /// Debug stream. + std::ostream* yycdebug_; + + /// \brief Display a symbol kind, value and location. + /// \param yyo The output stream. + /// \param yysym The symbol. + template + void yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const; +#endif + + /// \brief Reclaim the memory associated to a symbol. + /// \param yymsg Why this token is reclaimed. + /// If null, print nothing. + /// \param yysym The symbol. + template + void yy_destroy_ (const char* yymsg, basic_symbol& yysym) const; + + private: + /// Type access provider for state based symbols. + struct by_state + { + /// Default constructor. + by_state () YY_NOEXCEPT; + + /// The symbol kind as needed by the constructor. + typedef state_type kind_type; + + /// Constructor. + by_state (kind_type s) YY_NOEXCEPT; + + /// Copy constructor. + by_state (const by_state& that) YY_NOEXCEPT; + + /// Record that this symbol is empty. + void clear () YY_NOEXCEPT; + + /// Steal the symbol kind from \a that. + void move (by_state& that); + + /// The symbol kind (corresponding to \a state). + /// \a symbol_kind::S_YYEMPTY when empty. + symbol_kind_type kind () const YY_NOEXCEPT; + + /// The state number used to denote an empty symbol. + /// We use the initial state, as it does not have a value. + enum { empty_state = 0 }; + + /// The state. + /// \a empty when empty. + state_type state; + }; + + /// "Internal" symbol: element of the stack. + struct stack_symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + /// Construct an empty symbol. + stack_symbol_type (); + /// Move or copy construction. + stack_symbol_type (YY_RVREF (stack_symbol_type) that); + /// Steal the contents from \a sym to build this. + stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym); +#if YY_CPLUSPLUS < 201103L + /// Assignment, needed by push_back by some old implementations. + /// Moves the contents of that. + stack_symbol_type& operator= (stack_symbol_type& that); + + /// Assignment, needed by push_back by other implementations. + /// Needed by some other old implementations. + stack_symbol_type& operator= (const stack_symbol_type& that); +#endif + }; + + /// A stack with random access from its top. + template > + class stack + { + public: + // Hide our reversed order. + typedef typename S::iterator iterator; + typedef typename S::const_iterator const_iterator; + typedef typename S::size_type size_type; + typedef typename std::ptrdiff_t index_type; + + stack (size_type n = 200) + : seq_ (n) + {} + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + stack (const stack&) = delete; + /// Non copyable. + stack& operator= (const stack&) = delete; +#endif + + /// Random access. + /// + /// Index 0 returns the topmost element. + const T& + operator[] (index_type i) const + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Random access. + /// + /// Index 0 returns the topmost element. + T& + operator[] (index_type i) + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Steal the contents of \a t. + /// + /// Close to move-semantics. + void + push (YY_MOVE_REF (T) t) + { + seq_.push_back (T ()); + operator[] (0).move (t); + } + + /// Pop elements from the stack. + void + pop (std::ptrdiff_t n = 1) YY_NOEXCEPT + { + for (; 0 < n; --n) + seq_.pop_back (); + } + + /// Pop all elements from the stack. + void + clear () YY_NOEXCEPT + { + seq_.clear (); + } + + /// Number of elements on the stack. + index_type + size () const YY_NOEXCEPT + { + return index_type (seq_.size ()); + } + + /// Iterator on top of the stack (going downwards). + const_iterator + begin () const YY_NOEXCEPT + { + return seq_.begin (); + } + + /// Bottom of the stack. + const_iterator + end () const YY_NOEXCEPT + { + return seq_.end (); + } + + /// Present a slice of the top of a stack. + class slice + { + public: + slice (const stack& stack, index_type range) + : stack_ (stack) + , range_ (range) + {} + + const T& + operator[] (index_type i) const + { + return stack_[range_ - i]; + } + + private: + const stack& stack_; + index_type range_; + }; + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + stack (const stack&); + /// Non copyable. + stack& operator= (const stack&); +#endif + /// The wrapped container. + S seq_; + }; + + + /// Stack type. + typedef stack stack_type; + + /// The stack. + stack_type yystack_; + /// The stack for LAC. + /// Logically, the yy_lac_stack's lifetime is confined to the function + /// yy_lac_check_. We just store it as a member of this class to hold + /// on to the memory and to avoid frequent reallocations. + /// Since yy_lac_check_ is const, this member must be mutable. + mutable std::vector yylac_stack_; + /// Whether an initial LAC context was established. + bool yy_lac_established_; + + + /// Push a new state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param sym the symbol + /// \warning the contents of \a s.value is stolen. + void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym); + + /// Push a new look ahead token on the state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param s the state + /// \param sym the symbol (for its value and location). + /// \warning the contents of \a sym.value is stolen. + void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); + + /// Pop \a n symbols from the stack. + void yypop_ (int n = 1); + + /// Constants. + enum + { + yylast_ = 1581, ///< Last index in yytable_. + yynnts_ = 73, ///< Number of nonterminal symbols. + yyfinal_ = 15 ///< Termination state number. + }; + + + // User arguments. + yyscan_t yyscanner; + xsk::gsc::location& loc; + xsk::gsc::program_ptr& ast; + + }; + + inline + parser::symbol_kind_type + parser::yytranslate_ (int t) + { + return static_cast (t); + } + + // basic_symbol. + template + parser::basic_symbol::basic_symbol (const basic_symbol& that) + : Base (that) + , value () + , location (that.location) + { + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.copy< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.copy< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.copy< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.copy< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.copy< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.copy< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.copy< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.copy< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.copy< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.copy< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.copy< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.copy< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.copy< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.copy< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.copy< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.copy< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.copy< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.copy< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.copy< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.copy< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.copy< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.copy< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.copy< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.copy< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.copy< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.copy< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.copy< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.copy< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.copy< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.copy< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.copy< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.copy< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.copy< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.copy< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.copy< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.copy< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.copy< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.copy< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.copy< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.copy< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.copy< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.copy< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.copy< stmt_waitframe_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.copy< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.copy< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.copy< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.copy< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.copy< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.copy< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.copy< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.copy< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.copy< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.copy< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.copy< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + + } + + + + template + parser::symbol_kind_type + parser::basic_symbol::type_get () const YY_NOEXCEPT + { + return this->kind (); + } + + template + bool + parser::basic_symbol::empty () const YY_NOEXCEPT + { + return this->kind () == symbol_kind::S_YYEMPTY; + } + + template + void + parser::basic_symbol::move (basic_symbol& s) + { + super_type::move (s); + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (YY_MOVE (s.value)); + break; + + default: + break; + } + + location = YY_MOVE (s.location); + } + + // by_kind. + inline + parser::by_kind::by_kind () + : kind_ (symbol_kind::S_YYEMPTY) + {} + +#if 201103L <= YY_CPLUSPLUS + inline + parser::by_kind::by_kind (by_kind&& that) + : kind_ (that.kind_) + { + that.clear (); + } +#endif + + inline + parser::by_kind::by_kind (const by_kind& that) + : kind_ (that.kind_) + {} + + inline + parser::by_kind::by_kind (token_kind_type t) + : kind_ (yytranslate_ (t)) + {} + + inline + void + parser::by_kind::clear () YY_NOEXCEPT + { + kind_ = symbol_kind::S_YYEMPTY; + } + + inline + void + parser::by_kind::move (by_kind& that) + { + kind_ = that.kind_; + that.clear (); + } + + inline + parser::symbol_kind_type + parser::by_kind::kind () const YY_NOEXCEPT + { + return kind_; + } + + inline + parser::symbol_kind_type + parser::by_kind::type_get () const YY_NOEXCEPT + { + return this->kind (); + } + +#line 13 "parser.ypp" +} } } // xsk::gsc::h1 +#line 4764 "parser.hpp" + + + + +#endif // !YY_H1_PARSER_HPP_INCLUDED diff --git a/src/h1/xsk/resolver.cpp b/src/h1/xsk/resolver.cpp new file mode 100644 index 00000000..93b28c10 --- /dev/null +++ b/src/h1/xsk/resolver.cpp @@ -0,0 +1,2574 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "h1.hpp" + +namespace xsk::gsc::h1 +{ + +std::unordered_map opcode_map; +std::unordered_map function_map; +std::unordered_map method_map; +std::unordered_map file_map; +std::unordered_map token_map; +std::unordered_map opcode_map_rev; +std::unordered_map function_map_rev; +std::unordered_map method_map_rev; +std::unordered_map file_map_rev; +std::unordered_map token_map_rev; + +auto resolver::opcode_id(const std::string& name) -> std::uint8_t +{ + const auto itr = opcode_map_rev.find(name); + + if (itr != opcode_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve opcode id for name '%s'!", name.data())); +} + +auto resolver::opcode_name(std::uint8_t id) -> std::string +{ + const auto itr = opcode_map.find(id); + + if (itr != opcode_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve opcode name for id '0x%hhX'!", id)); +} + +auto resolver::function_id(const std::string& name) -> std::uint16_t +{ + const auto itr = function_map_rev.find(name); + + if (itr != function_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin function id for name '%s'!", name.data())); +} + +auto resolver::function_name(std::uint16_t id) -> std::string +{ + const auto itr = function_map.find(id); + + if (itr != function_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin function name for id '%i'!", id)); +} + +auto resolver::method_id(const std::string& name) -> std::uint16_t +{ + const auto itr = method_map_rev.find(name); + + if (itr != method_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin method id for name '%s'!", name.data())); +} + +auto resolver::method_name(std::uint16_t id) -> std::string +{ + const auto itr = method_map.find(id); + + if (itr != method_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin method name for id '%i'!", id)); +} + +auto resolver::file_id(const std::string& name) -> std::uint16_t +{ + const auto itr = file_map_rev.find(name); + + if (itr != file_map_rev.end()) + { + return itr->second; + } + + return 0; +} + +auto resolver::file_name(std::uint16_t id) -> std::string +{ + const auto itr = file_map.find(id); + + if (itr != file_map.end()) + { + return itr->second; + } + + return utils::string::va("_ID%i", id); +} + +auto resolver::token_id(const std::string& name) -> std::uint16_t +{ + const auto itr = token_map_rev.find(name); + + if (itr != token_map_rev.end()) + { + return itr->second; + } + + return 0; +} + +auto resolver::token_name(std::uint16_t id) -> std::string +{ + const auto itr = token_map.find(id); + + if (itr != token_map.end()) + { + return itr->second; + } + + return utils::string::va("_ID%i", id); +} + +auto resolver::find_function(const std::string& name) -> bool +{ + const auto itr = function_map_rev.find(name); + + if (itr != function_map_rev.end()) + { + return true; + } + + return false; +} + +auto resolver::find_method(const std::string& name) -> bool +{ + const auto itr = method_map_rev.find(name); + + if (itr != method_map_rev.end()) + { + return true; + } + + return false; +} + +const std::array opcode_list +{{ + { std::uint8_t(opcode::OP_End),"END" }, + { std::uint8_t(opcode::OP_Return),"RETN" }, + { std::uint8_t(opcode::OP_GetByte),"GET_BYTE" }, + { std::uint8_t(opcode::OP_GetNegByte),"GET_NBYTE" }, + { std::uint8_t(opcode::OP_GetUnsignedShort),"GET_USHORT" }, + { std::uint8_t(opcode::OP_GetNegUnsignedShort),"GET_NUSHORT" }, + { std::uint8_t(opcode::OP_GetInteger),"GET_INT" }, + { std::uint8_t(opcode::OP_GetBuiltinFunction),"GET_BUILTIN_FUNC" }, + { std::uint8_t(opcode::OP_GetBuiltinMethod),"GET_BUILTIN_METHOD" }, + { std::uint8_t(opcode::OP_GetFloat),"GET_FLOAT" }, + { std::uint8_t(opcode::OP_GetString),"GET_STRING" }, + { std::uint8_t(opcode::OP_GetUndefined),"GET_UNDEFINED" }, + { std::uint8_t(opcode::OP_GetZero),"GET_ZERO" }, + { std::uint8_t(opcode::OP_waittillFrameEnd),"WAITTILLFRAMEEND" }, + { std::uint8_t(opcode::OP_CreateLocalVariable),"CREATE_LOCAL_VARIABLE" }, + { std::uint8_t(opcode::OP_RemoveLocalVariables),"REMOVE_LOCAL_VARIABLES" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached0),"EVAL_LOCAL_VARIABLE_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached1),"EVAL_LOCAL_VARIABLE_CACHED1" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached2),"EVAL_LOCAL_VARIABLE_CACHED2" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached3),"EVAL_LOCAL_VARIABLE_CACHED3" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached4),"EVAL_LOCAL_VARIABLE_CACHED4" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached5),"EVAL_LOCAL_VARIABLE_CACHED5" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached),"EVAL_LOCAL_VARIABLE_CACHED" }, + { std::uint8_t(opcode::OP_EvalLocalArrayCached),"EVAL_LOCAL_ARRAY_CACHED" }, + { std::uint8_t(opcode::OP_EvalArray),"EVAL_ARRAY" }, + { std::uint8_t(opcode::OP_EvalNewLocalArrayRefCached0),"EVAL_NEW_LOCAL_ARRAY_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalArrayRefCached0),"EVAL_LOCAL_ARRAY_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalArrayRefCached),"EVAL_LOCAL_ARRAY_REF_CACHED" }, + { std::uint8_t(opcode::OP_EvalArrayRef),"EVAL_ARRAY_REF" }, + { std::uint8_t(opcode::OP_ClearArray),"CLEAR_ARRAY" }, + { std::uint8_t(opcode::OP_EmptyArray),"EMPTY_ARRAY" }, + { std::uint8_t(opcode::OP_AddArray),"ADD_ARRAY" }, + { std::uint8_t(opcode::OP_PreScriptCall),"PRE_CALL" }, + { std::uint8_t(opcode::OP_ScriptLocalFunctionCall2),"CALL_LOCAL_FUNC2" }, + { std::uint8_t(opcode::OP_ScriptLocalFunctionCall),"CALL_LOCAL_FUNC" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodCall),"CALL_LOCAL_METHOD" }, + { std::uint8_t(opcode::OP_ScriptLocalThreadCall),"CALL_LOCAL_FUNC_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalChildThreadCall),"CALL_LOCAL_FUNC_CHILD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodThreadCall),"CALL_LOCAL_METHOD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodChildThreadCall),"CALL_LOCAL_METHOD_CHILD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptFarFunctionCall2),"CALL_FAR_FUNC2" }, + { std::uint8_t(opcode::OP_ScriptFarFunctionCall),"CALL_FAR_FUNC" }, + { std::uint8_t(opcode::OP_ScriptFarMethodCall),"CALL_FAR_METHOD" }, + { std::uint8_t(opcode::OP_ScriptFarThreadCall),"CALL_FAR_FUNC_THREAD" }, + { std::uint8_t(opcode::OP_ScriptFarChildThreadCall),"CALL_FAR_FUNC_CHILD_THREAD"}, + { std::uint8_t(opcode::OP_ScriptFarMethodThreadCall),"CALL_FAR_METHOD_THEAD" }, + { std::uint8_t(opcode::OP_ScriptFarMethodChildThreadCall),"CALL_FAR_METHOD_CHILD_THEAD" }, + { std::uint8_t(opcode::OP_ScriptFunctionCallPointer),"CALL_FUNC_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodCallPointer),"CALL_METHOD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptThreadCallPointer),"CALL_FUNC_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptChildThreadCallPointer),"CALL_FUNC_CHILD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodThreadCallPointer),"CALL_METHOD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodChildThreadCallPointer),"CALL_METHOD_CHILD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_CallBuiltinPointer),"CALL_BUILTIN_FUNC_POINTER" }, + { std::uint8_t(opcode::OP_CallBuiltinMethodPointer),"CALL_BUILTIN_METHOD_POINTER" }, + { std::uint8_t(opcode::OP_GetIString),"GET_ISTRING" }, + { std::uint8_t(opcode::OP_GetVector),"GET_VECTOR" }, + { std::uint8_t(opcode::OP_GetLevelObject),"GET_LEVEL_OBJ" }, + { std::uint8_t(opcode::OP_GetAnimObject),"GET_ANIM_OBJ" }, + { std::uint8_t(opcode::OP_GetSelf),"GET_SELF" }, + { std::uint8_t(opcode::OP_GetThisthread),"GET_THISTHREAD" }, + { std::uint8_t(opcode::OP_GetLevel),"GET_LEVEL" }, + { std::uint8_t(opcode::OP_GetGame),"GET_GAME" }, + { std::uint8_t(opcode::OP_GetAnim),"GET_ANIM" }, + { std::uint8_t(opcode::OP_GetAnimation),"GET_ANIMATION" }, + { std::uint8_t(opcode::OP_GetGameRef),"GET_GAME_REF" }, + { std::uint8_t(opcode::OP_inc),"INC" }, + { std::uint8_t(opcode::OP_dec),"DEC" }, + { std::uint8_t(opcode::OP_bit_or),"BIT_OR" }, + { std::uint8_t(opcode::OP_JumpOnFalseExpr),"JMP_EXPR_FALSE" }, + { std::uint8_t(opcode::OP_bit_ex_or),"BIT_EXOR" }, + { std::uint8_t(opcode::OP_bit_and),"BIT_AND" }, + { std::uint8_t(opcode::OP_equality),"EQUALITY" }, + { std::uint8_t(opcode::OP_inequality),"INEQUALITY" }, + { std::uint8_t(opcode::OP_less),"LESS" }, + { std::uint8_t(opcode::OP_greater),"GREATER" }, + { std::uint8_t(opcode::OP_JumpOnTrueExpr),"JMP_EXPR_TRUE" }, + { std::uint8_t(opcode::OP_less_equal),"LESSEQUAL" }, + { std::uint8_t(opcode::OP_jumpback),"JMP_BACK" }, + { std::uint8_t(opcode::OP_waittillmatch2),"WAITTILLMATCH2" }, + { std::uint8_t(opcode::OP_waittill),"WAITTILL" }, + { std::uint8_t(opcode::OP_notify),"NOTIFY" }, + { std::uint8_t(opcode::OP_endon),"ENDON" }, + { std::uint8_t(opcode::OP_voidCodepos),"VOIDCODEPOS" }, + { std::uint8_t(opcode::OP_switch),"SWITCH" }, + { std::uint8_t(opcode::OP_endswitch),"ENDSWITCH" }, + { std::uint8_t(opcode::OP_vector),"VECTOR" }, + { std::uint8_t(opcode::OP_JumpOnFalse),"JMP_FALSE" }, + { std::uint8_t(opcode::OP_greater_equal),"GREATEREQUAL" }, + { std::uint8_t(opcode::OP_shift_left),"SHIFT_LEFT" }, + { std::uint8_t(opcode::OP_shift_right),"SHIFT_RIGHT" }, + { std::uint8_t(opcode::OP_plus),"PLUS" }, + { std::uint8_t(opcode::OP_jump),"JMP" }, + { std::uint8_t(opcode::OP_minus),"MINUS" }, + { std::uint8_t(opcode::OP_multiply),"MULT" }, + { std::uint8_t(opcode::OP_divide),"DIV" }, + { std::uint8_t(opcode::OP_mod),"MOD" }, + { std::uint8_t(opcode::OP_JumpOnTrue),"JMP_TRUE" }, + { std::uint8_t(opcode::OP_size),"SIZE" }, + { std::uint8_t(opcode::OP_waittillmatch),"WAITTILLMATCH" }, + { std::uint8_t(opcode::OP_GetLocalFunction),"GET_LOCAL_FUNC" }, + { std::uint8_t(opcode::OP_GetFarFunction),"GET_FAR_FUNC" }, + { std::uint8_t(opcode::OP_GetSelfObject),"GET_SELF_OBJ" }, + { std::uint8_t(opcode::OP_EvalLevelFieldVariable),"EVAL_LEVEL_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalAnimFieldVariable),"EVAL_ANIM_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalSelfFieldVariable),"EVAL_SELF_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalFieldVariable),"EVAL_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalLevelFieldVariableRef),"EVAL_LEVEL_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalAnimFieldVariableRef),"EVAL_ANIM_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalSelfFieldVariableRef),"EVAL_SELF_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalFieldVariableRef),"EVAL_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_ClearFieldVariable),"CLEAR_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_SafeCreateVariableFieldCached),"SAFE_CREATE_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_SafeSetVariableFieldCached0),"SAFE_SET_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SafeSetVariableFieldCached),"SAFE_SET_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_SafeSetWaittillVariableFieldCached),"SAFE_SET_WAITTILL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_GetAnimTree),"GET_ANIMTREE" }, + { std::uint8_t(opcode::OP_clearparams),"CLEAR_PARAMS" }, + { std::uint8_t(opcode::OP_checkclearparams),"CHECK_CLEAR_PARAMS" }, + { std::uint8_t(opcode::OP_EvalLocalVariableRefCached0),"EVAL_LOCAL_VARIABLE_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalNewLocalVariableRefCached0),"EVAL_NEW_LOCAL_VARIABLE_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalVariableRefCached),"EVAL_LOCAL_VARIABLE_REF_CACHED" }, + { std::uint8_t(opcode::OP_SetLevelFieldVariableField),"SET_LEVEL_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetVariableField),"SET_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_ClearVariableField),"CLEAR_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetAnimFieldVariableField),"SET_ANIM_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetSelfFieldVariableField),"SET_SELF_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetLocalVariableFieldCached0),"SET_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SetNewLocalVariableFieldCached0),"SET_NEW_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SetLocalVariableFieldCached),"SET_LOCAL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_ClearLocalVariableFieldCached),"CLEAR_LOCAL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_ClearLocalVariableFieldCached0),"CLEAR_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_CallBuiltin0),"CALL_BUILTIN_FUNC_0" }, + { std::uint8_t(opcode::OP_CallBuiltin1),"CALL_BUILTIN_FUNC_1" }, + { std::uint8_t(opcode::OP_CallBuiltin2),"CALL_BUILTIN_FUNC_2" }, + { std::uint8_t(opcode::OP_CallBuiltin3),"CALL_BUILTIN_FUNC_3" }, + { std::uint8_t(opcode::OP_CallBuiltin4),"CALL_BUILTIN_FUNC_4" }, + { std::uint8_t(opcode::OP_CallBuiltin5),"CALL_BUILTIN_FUNC_5" }, + { std::uint8_t(opcode::OP_CallBuiltin),"CALL_BUILTIN_FUNC" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod0),"CALL_BUILTIN_METHOD_0" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod1),"CALL_BUILTIN_METHOD_1" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod2),"CALL_BUILTIN_METHOD_2" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod3),"CALL_BUILTIN_METHOD_3" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod4),"CALL_BUILTIN_METHOD_4" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod5),"CALL_BUILTIN_METHOD_5" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod),"CALL_BUILTIN_METHOD" }, + { std::uint8_t(opcode::OP_wait),"WAIT" }, + { std::uint8_t(opcode::OP_DecTop),"DEC_TOP" }, + { std::uint8_t(opcode::OP_CastFieldObject),"CAST_FIELD_OBJ" }, + { std::uint8_t(opcode::OP_EvalLocalVariableObjectCached),"EVAL_LOCAL_VARIABLE_OBJECT_CACHED" }, + { std::uint8_t(opcode::OP_CastBool),"CAST_BOOL" }, + { std::uint8_t(opcode::OP_BoolNot),"BOOL_NOT" }, + { std::uint8_t(opcode::OP_BoolComplement),"BOOL_COMPLEMENT" }, + { std::uint8_t(opcode::OP_waitFrame), "WAITFRAME" }, +}}; + +const std::array function_list +{{ + { 0x001, "_func_001" }, + { 0x002, "_func_002" }, + { 0x003, "_func_003" }, + { 0x004, "_func_004" }, + { 0x005, "_func_005" }, + { 0x006, "_func_006" }, + { 0x007, "_func_007" }, + { 0x008, "_func_008" }, + { 0x009, "_func_009" }, + { 0x00A, "_func_00A" }, + { 0x00B, "_func_00B" }, + { 0x00C, "_func_00C" }, + { 0x00D, "_func_00D" }, + { 0x00E, "_func_00E" }, + { 0x00F, "_func_00F" }, + { 0x010, "_func_010" }, + { 0x011, "_func_011" }, + { 0x012, "_func_012" }, + { 0x013, "_func_013" }, + { 0x014, "_func_014" }, + { 0x015, "_func_015" }, + { 0x016, "_func_016" }, + { 0x017, "_func_017" }, + { 0x018, "_func_018" }, + { 0x019, "_func_019" }, + { 0x01A, "_func_01A" }, + { 0x01B, "_func_01B" }, + { 0x01C, "_func_01C" }, + { 0x01D, "_func_01D" }, + { 0x01E, "_func_01E" }, + { 0x01F, "_func_01F" }, + { 0x020, "_func_020" }, + { 0x021, "_func_021" }, + { 0x022, "_func_022" }, + { 0x023, "_func_023" }, + { 0x024, "_func_024" }, + { 0x025, "_func_025" }, + { 0x026, "_func_026" }, + { 0x027, "_func_027" }, + { 0x028, "_func_028" }, + { 0x029, "_func_029" }, + { 0x02A, "_func_02A" }, + { 0x02B, "_func_02B" }, + { 0x02C, "_func_02C" }, + { 0x02D, "_func_02D" }, + { 0x02E, "_func_02E" }, + { 0x02F, "_func_02F" }, + { 0x030, "_func_030" }, + { 0x031, "_func_031" }, + { 0x032, "_func_032" }, + { 0x033, "_func_033" }, + { 0x034, "_func_034" }, + { 0x035, "_func_035" }, + { 0x036, "_func_036" }, + { 0x037, "_func_037" }, + { 0x038, "_func_038" }, + { 0x039, "_func_039" }, + { 0x03A, "_func_03A" }, + { 0x03B, "_func_03B" }, + { 0x03C, "_func_03C" }, + { 0x03D, "_func_03D" }, + { 0x03E, "_func_03E" }, + { 0x03F, "_func_03F" }, + { 0x040, "_func_040" }, + { 0x041, "_func_041" }, + { 0x042, "_func_042" }, + { 0x043, "_func_043" }, + { 0x044, "_func_044" }, + { 0x045, "_func_045" }, + { 0x046, "_func_046" }, + { 0x047, "_func_047" }, + { 0x048, "_func_048" }, + { 0x049, "_func_049" }, + { 0x04A, "_func_04A" }, + { 0x04B, "_func_04B" }, + { 0x04C, "_func_04C" }, + { 0x04D, "_func_04D" }, + { 0x04E, "_func_04E" }, + { 0x04F, "_func_04F" }, + { 0x050, "_func_050" }, + { 0x051, "_func_051" }, + { 0x052, "_func_052" }, + { 0x053, "_func_053" }, + { 0x054, "_func_054" }, + { 0x055, "_func_055" }, + { 0x056, "_func_056" }, + { 0x057, "_func_057" }, + { 0x058, "_func_058" }, + { 0x059, "_func_059" }, + { 0x05A, "_func_05A" }, + { 0x05B, "_func_05B" }, + { 0x05C, "_func_05C" }, + { 0x05D, "_func_05D" }, + { 0x05E, "_func_05E" }, + { 0x05F, "_func_05F" }, + { 0x060, "_func_060" }, + { 0x061, "_func_061" }, + { 0x062, "_func_062" }, + { 0x063, "_func_063" }, + { 0x064, "_func_064" }, + { 0x065, "_func_065" }, + { 0x066, "_func_066" }, + { 0x067, "_func_067" }, + { 0x068, "_func_068" }, + { 0x069, "_func_069" }, + { 0x06A, "_func_06A" }, + { 0x06B, "_func_06B" }, + { 0x06C, "_func_06C" }, + { 0x06D, "_func_06D" }, + { 0x06E, "_func_06E" }, + { 0x06F, "_func_06F" }, + { 0x070, "_func_070" }, + { 0x071, "_func_071" }, + { 0x072, "_func_072" }, + { 0x073, "_func_073" }, + { 0x074, "_func_074" }, + { 0x075, "_func_075" }, + { 0x076, "_func_076" }, + { 0x077, "_func_077" }, + { 0x078, "_func_078" }, + { 0x079, "_func_079" }, + { 0x07A, "_func_07A" }, + { 0x07B, "_func_07B" }, + { 0x07C, "_func_07C" }, + { 0x07D, "_func_07D" }, + { 0x07E, "_func_07E" }, + { 0x07F, "_func_07F" }, + { 0x080, "_func_080" }, + { 0x081, "_func_081" }, + { 0x082, "_func_082" }, + { 0x083, "_func_083" }, + { 0x084, "_func_084" }, + { 0x085, "_func_085" }, + { 0x086, "_func_086" }, + { 0x087, "_func_087" }, + { 0x088, "_func_088" }, + { 0x089, "_func_089" }, + { 0x08A, "_func_08A" }, + { 0x08B, "_func_08B" }, + { 0x08C, "_func_08C" }, + { 0x08D, "_func_08D" }, + { 0x08E, "_func_08E" }, + { 0x08F, "_func_08F" }, + { 0x090, "_func_090" }, + { 0x091, "_func_091" }, + { 0x092, "_func_092" }, + { 0x093, "_func_093" }, + { 0x094, "_func_094" }, + { 0x095, "_func_095" }, + { 0x096, "_func_096" }, + { 0x097, "_func_097" }, + { 0x098, "_func_098" }, + { 0x099, "_func_099" }, + { 0x09A, "_func_09A" }, + { 0x09B, "_func_09B" }, + { 0x09C, "_func_09C" }, + { 0x09D, "_func_09D" }, + { 0x09E, "_func_09E" }, + { 0x09F, "_func_09F" }, + { 0x0A0, "_func_0A0" }, + { 0x0A1, "_func_0A1" }, + { 0x0A2, "_func_0A2" }, + { 0x0A3, "_func_0A3" }, + { 0x0A4, "_func_0A4" }, + { 0x0A5, "_func_0A5" }, + { 0x0A6, "_func_0A6" }, + { 0x0A7, "_func_0A7" }, + { 0x0A8, "_func_0A8" }, + { 0x0A9, "_func_0A9" }, + { 0x0AA, "_func_0AA" }, + { 0x0AB, "_func_0AB" }, + { 0x0AC, "_func_0AC" }, + { 0x0AD, "_func_0AD" }, + { 0x0AE, "_func_0AE" }, + { 0x0AF, "_func_0AF" }, + { 0x0B0, "_func_0B0" }, + { 0x0B1, "_func_0B1" }, + { 0x0B2, "_func_0B2" }, + { 0x0B3, "_func_0B3" }, + { 0x0B4, "_func_0B4" }, + { 0x0B5, "_func_0B5" }, + { 0x0B6, "_func_0B6" }, + { 0x0B7, "_func_0B7" }, + { 0x0B8, "_func_0B8" }, + { 0x0B9, "_func_0B9" }, + { 0x0BA, "_func_0BA" }, + { 0x0BB, "_func_0BB" }, + { 0x0BC, "_func_0BC" }, + { 0x0BD, "_func_0BD" }, + { 0x0BE, "_func_0BE" }, + { 0x0BF, "_func_0BF" }, + { 0x0C0, "_func_0C0" }, + { 0x0C1, "_func_0C1" }, + { 0x0C2, "_func_0C2" }, + { 0x0C3, "_func_0C3" }, + { 0x0C4, "_func_0C4" }, + { 0x0C5, "_func_0C5" }, + { 0x0C6, "_func_0C6" }, + { 0x0C7, "_func_0C7" }, + { 0x0C8, "_func_0C8" }, + { 0x0C9, "_func_0C9" }, + { 0x0CA, "_func_0CA" }, + { 0x0CB, "_func_0CB" }, + { 0x0CC, "_func_0CC" }, + { 0x0CD, "_func_0CD" }, + { 0x0CE, "_func_0CE" }, + { 0x0CF, "_func_0CF" }, + { 0x0D0, "_func_0D0" }, + { 0x0D1, "_func_0D1" }, + { 0x0D2, "_func_0D2" }, + { 0x0D3, "_func_0D3" }, + { 0x0D4, "_func_0D4" }, + { 0x0D5, "_func_0D5" }, + { 0x0D6, "_func_0D6" }, + { 0x0D7, "_func_0D7" }, + { 0x0D8, "_func_0D8" }, + { 0x0D9, "_func_0D9" }, + { 0x0DA, "_func_0DA" }, + { 0x0DB, "_func_0DB" }, + { 0x0DC, "_func_0DC" }, + { 0x0DD, "_func_0DD" }, + { 0x0DE, "_func_0DE" }, + { 0x0DF, "_func_0DF" }, + { 0x0E0, "_func_0E0" }, + { 0x0E1, "_func_0E1" }, + { 0x0E2, "_func_0E2" }, + { 0x0E3, "_func_0E3" }, + { 0x0E4, "_func_0E4" }, + { 0x0E5, "_func_0E5" }, + { 0x0E6, "_func_0E6" }, + { 0x0E7, "_func_0E7" }, + { 0x0E8, "_func_0E8" }, + { 0x0E9, "_func_0E9" }, + { 0x0EA, "_func_0EA" }, + { 0x0EB, "_func_0EB" }, + { 0x0EC, "_func_0EC" }, + { 0x0ED, "_func_0ED" }, + { 0x0EE, "_func_0EE" }, + { 0x0EF, "_func_0EF" }, + { 0x0F0, "_func_0F0" }, + { 0x0F1, "_func_0F1" }, + { 0x0F2, "_func_0F2" }, + { 0x0F3, "_func_0F3" }, + { 0x0F4, "_func_0F4" }, + { 0x0F5, "_func_0F5" }, + { 0x0F6, "_func_0F6" }, + { 0x0F7, "_func_0F7" }, + { 0x0F8, "_func_0F8" }, + { 0x0F9, "_func_0F9" }, + { 0x0FA, "_func_0FA" }, + { 0x0FB, "_func_0FB" }, + { 0x0FC, "_func_0FC" }, + { 0x0FD, "_func_0FD" }, + { 0x0FE, "_func_0FE" }, + { 0x0FF, "_func_0FF" }, + { 0x100, "_func_100" }, + { 0x101, "_func_101" }, + { 0x102, "_func_102" }, + { 0x103, "_func_103" }, + { 0x104, "_func_104" }, + { 0x105, "_func_105" }, + { 0x106, "_func_106" }, + { 0x107, "_func_107" }, + { 0x108, "_func_108" }, + { 0x109, "_func_109" }, + { 0x10A, "_func_10A" }, + { 0x10B, "_func_10B" }, + { 0x10C, "_func_10C" }, + { 0x10D, "_func_10D" }, + { 0x10E, "_func_10E" }, + { 0x10F, "_func_10F" }, + { 0x110, "_func_110" }, + { 0x111, "_func_111" }, + { 0x112, "_func_112" }, + { 0x113, "_func_113" }, + { 0x114, "_func_114" }, + { 0x115, "_func_115" }, + { 0x116, "_func_116" }, + { 0x117, "_func_117" }, + { 0x118, "_func_118" }, + { 0x119, "_func_119" }, + { 0x11A, "_func_11A" }, + { 0x11B, "_func_11B" }, + { 0x11C, "_func_11C" }, + { 0x11D, "_func_11D" }, + { 0x11E, "_func_11E" }, + { 0x11F, "_func_11F" }, + { 0x120, "_func_120" }, + { 0x121, "_func_121" }, + { 0x122, "_func_122" }, + { 0x123, "_func_123" }, + { 0x124, "_func_124" }, + { 0x125, "_func_125" }, + { 0x126, "_func_126" }, + { 0x127, "_func_127" }, + { 0x128, "_func_128" }, + { 0x129, "_func_129" }, + { 0x12A, "_func_12A" }, + { 0x12B, "_func_12B" }, + { 0x12C, "_func_12C" }, + { 0x12D, "_func_12D" }, + { 0x12E, "_func_12E" }, + { 0x12F, "_func_12F" }, + { 0x130, "_func_130" }, + { 0x131, "_func_131" }, + { 0x132, "_func_132" }, + { 0x133, "_func_133" }, + { 0x134, "_func_134" }, + { 0x135, "_func_135" }, + { 0x136, "_func_136" }, + { 0x137, "_func_137" }, + { 0x138, "_func_138" }, + { 0x139, "_func_139" }, + { 0x13A, "_func_13A" }, + { 0x13B, "_func_13B" }, + { 0x13C, "_func_13C" }, + { 0x13D, "_func_13D" }, + { 0x13E, "_func_13E" }, + { 0x13F, "_func_13F" }, + { 0x140, "_func_140" }, + { 0x141, "_func_141" }, + { 0x142, "_func_142" }, + { 0x143, "_func_143" }, + { 0x144, "_func_144" }, + { 0x145, "_func_145" }, + { 0x146, "_func_146" }, + { 0x147, "_func_147" }, + { 0x148, "_func_148" }, + { 0x149, "_func_149" }, + { 0x14A, "_func_14A" }, + { 0x14B, "_func_14B" }, + { 0x14C, "_func_14C" }, + { 0x14D, "_func_14D" }, + { 0x14E, "_func_14E" }, + { 0x14F, "_func_14F" }, + { 0x150, "_func_150" }, + { 0x151, "_func_151" }, + { 0x152, "_func_152" }, + { 0x153, "_func_153" }, + { 0x154, "_func_154" }, + { 0x155, "_func_155" }, + { 0x156, "_func_156" }, + { 0x157, "_func_157" }, + { 0x158, "_func_158" }, + { 0x159, "_func_159" }, + { 0x15A, "_func_15A" }, + { 0x15B, "_func_15B" }, + { 0x15C, "_func_15C" }, + { 0x15D, "_func_15D" }, + { 0x15E, "_func_15E" }, + { 0x15F, "_func_15F" }, + { 0x160, "_func_160" }, + { 0x161, "_func_161" }, + { 0x162, "_func_162" }, + { 0x163, "_func_163" }, + { 0x164, "_func_164" }, + { 0x165, "_func_165" }, + { 0x166, "_func_166" }, + { 0x167, "_func_167" }, + { 0x168, "_func_168" }, + { 0x169, "_func_169" }, + { 0x16A, "_func_16A" }, + { 0x16B, "_func_16B" }, + { 0x16C, "_func_16C" }, + { 0x16D, "_func_16D" }, + { 0x16E, "_func_16E" }, + { 0x16F, "_func_16F" }, + { 0x170, "_func_170" }, + { 0x171, "_func_171" }, + { 0x172, "_func_172" }, + { 0x173, "_func_173" }, + { 0x174, "_func_174" }, + { 0x175, "_func_175" }, + { 0x176, "_func_176" }, + { 0x177, "_func_177" }, + { 0x178, "_func_178" }, + { 0x179, "_func_179" }, + { 0x17A, "_func_17A" }, + { 0x17B, "_func_17B" }, + { 0x17C, "_func_17C" }, + { 0x17D, "_func_17D" }, + { 0x17E, "_func_17E" }, + { 0x17F, "_func_17F" }, + { 0x180, "_func_180" }, + { 0x181, "_func_181" }, + { 0x182, "_func_182" }, + { 0x183, "_func_183" }, + { 0x184, "_func_184" }, + { 0x185, "_func_185" }, + { 0x186, "_func_186" }, + { 0x187, "_func_187" }, + { 0x188, "_func_188" }, + { 0x189, "_func_189" }, + { 0x18A, "_func_18A" }, + { 0x18B, "_func_18B" }, + { 0x18C, "_func_18C" }, + { 0x18D, "_func_18D" }, + { 0x18E, "_func_18E" }, + { 0x18F, "_func_18F" }, + { 0x190, "_func_190" }, + { 0x191, "_func_191" }, + { 0x192, "_func_192" }, + { 0x193, "_func_193" }, + { 0x194, "_func_194" }, + { 0x195, "_func_195" }, + { 0x196, "_func_196" }, + { 0x197, "_func_197" }, + { 0x198, "_func_198" }, + { 0x199, "_func_199" }, + { 0x19A, "_func_19A" }, + { 0x19B, "_func_19B" }, + { 0x19C, "_func_19C" }, + { 0x19D, "_func_19D" }, + { 0x19E, "_func_19E" }, + { 0x19F, "_func_19F" }, + { 0x1A0, "_func_1A0" }, + { 0x1A1, "_func_1A1" }, + { 0x1A2, "_func_1A2" }, + { 0x1A3, "_func_1A3" }, + { 0x1A4, "_func_1A4" }, + { 0x1A5, "_func_1A5" }, + { 0x1A6, "_func_1A6" }, + { 0x1A7, "_func_1A7" }, + { 0x1A8, "_func_1A8" }, + { 0x1A9, "_func_1A9" }, + { 0x1AA, "_func_1AA" }, + { 0x1AB, "_func_1AB" }, + { 0x1AC, "_func_1AC" }, + { 0x1AD, "_func_1AD" }, + { 0x1AE, "_func_1AE" }, + { 0x1AF, "_func_1AF" }, + { 0x1B0, "_func_1B0" }, + { 0x1B1, "_func_1B1" }, + { 0x1B2, "_func_1B2" }, + { 0x1B3, "_func_1B3" }, + { 0x1B4, "_func_1B4" }, + { 0x1B5, "_func_1B5" }, + { 0x1B6, "_func_1B6" }, + { 0x1B7, "_func_1B7" }, + { 0x1B8, "_func_1B8" }, + { 0x1B9, "_func_1B9" }, + { 0x1BA, "_func_1BA" }, + { 0x1BB, "_func_1BB" }, + { 0x1BC, "_func_1BC" }, + { 0x1BD, "_func_1BD" }, + { 0x1BE, "_func_1BE" }, + { 0x1BF, "_func_1BF" }, + { 0x1C0, "_func_1C0" }, + { 0x1C1, "_func_1C1" }, + { 0x1C2, "_func_1C2" }, + { 0x1C3, "_func_1C3" }, + { 0x1C4, "_func_1C4" }, + { 0x1C5, "_func_1C5" }, + { 0x1C6, "_func_1C6" }, + { 0x1C7, "_func_1C7" }, + { 0x1C8, "_func_1C8" }, + { 0x1C9, "_func_1C9" }, + { 0x1CA, "_func_1CA" }, + { 0x1CB, "_func_1CB" }, + { 0x1CC, "_func_1CC" }, + { 0x1CD, "_func_1CD" }, + { 0x1CE, "_func_1CE" }, + { 0x1CF, "_func_1CF" }, + { 0x1D0, "_func_1D0" }, + { 0x1D1, "_func_1D1" }, + { 0x1D2, "_func_1D2" }, + { 0x1D3, "_func_1D3" }, + { 0x1D4, "_func_1D4" }, + { 0x1D5, "_func_1D5" }, + { 0x1D6, "_func_1D6" }, + { 0x1D7, "_func_1D7" }, + { 0x1D8, "_func_1D8" }, + { 0x1D9, "_func_1D9" }, + { 0x1DA, "_func_1DA" }, + { 0x1DB, "_func_1DB" }, + { 0x1DC, "_func_1DC" }, + { 0x1DD, "_func_1DD" }, + { 0x1DE, "_func_1DE" }, + { 0x1DF, "_func_1DF" }, + { 0x1E0, "_func_1E0" }, + { 0x1E1, "_func_1E1" }, + { 0x1E2, "_func_1E2" }, + { 0x1E3, "_func_1E3" }, + { 0x1E4, "_func_1E4" }, + { 0x1E5, "_func_1E5" }, + { 0x1E6, "_func_1E6" }, + { 0x1E7, "_func_1E7" }, + { 0x1E8, "_func_1E8" }, + { 0x1E9, "_func_1E9" }, + { 0x1EA, "_func_1EA" }, + { 0x1EB, "_func_1EB" }, + { 0x1EC, "_func_1EC" }, + { 0x1ED, "_func_1ED" }, + { 0x1EE, "_func_1EE" }, + { 0x1EF, "_func_1EF" }, + { 0x1F0, "_func_1F0" }, + { 0x1F1, "_func_1F1" }, + { 0x1F2, "_func_1F2" }, + { 0x1F3, "_func_1F3" }, + { 0x1F4, "_func_1F4" }, + { 0x1F5, "_func_1F5" }, + { 0x1F6, "_func_1F6" }, + { 0x1F7, "_func_1F7" }, + { 0x1F8, "_func_1F8" }, + { 0x1F9, "_func_1F9" }, + { 0x1FA, "_func_1FA" }, + { 0x1FB, "_func_1FB" }, + { 0x1FC, "_func_1FC" }, + { 0x1FD, "_func_1FD" }, + { 0x1FE, "_func_1FE" }, + { 0x1FF, "_func_1FF" }, + { 0x200, "_func_200" }, + { 0x201, "_func_201" }, + { 0x202, "_func_202" }, + { 0x203, "_func_203" }, + { 0x204, "_func_204" }, + { 0x205, "_func_205" }, + { 0x206, "_func_206" }, + { 0x207, "_func_207" }, + { 0x208, "_func_208" }, + { 0x209, "_func_209" }, + { 0x20A, "_func_20A" }, + { 0x20B, "_func_20B" }, + { 0x20C, "_func_20C" }, + { 0x20D, "_func_20D" }, + { 0x20E, "_func_20E" }, + { 0x20F, "_func_20F" }, + { 0x210, "_func_210" }, + { 0x211, "_func_211" }, + { 0x212, "_func_212" }, + { 0x213, "_func_213" }, + { 0x214, "_func_214" }, + { 0x215, "_func_215" }, + { 0x216, "_func_216" }, + { 0x217, "_func_217" }, + { 0x218, "_func_218" }, + { 0x219, "_func_219" }, + { 0x21A, "_func_21A" }, + { 0x21B, "_func_21B" }, + { 0x21C, "_func_21C" }, + { 0x21D, "_func_21D" }, + { 0x21E, "_func_21E" }, + { 0x21F, "_func_21F" }, + { 0x220, "_func_220" }, + { 0x221, "_func_221" }, + { 0x222, "_func_222" }, + { 0x223, "_func_223" }, + { 0x224, "_func_224" }, + { 0x225, "_func_225" }, + { 0x226, "_func_226" }, + { 0x227, "_func_227" }, + { 0x228, "_func_228" }, + { 0x229, "_func_229" }, + { 0x22A, "_func_22A" }, + { 0x22B, "_func_22B" }, + { 0x22C, "_func_22C" }, + { 0x22D, "_func_22D" }, + { 0x22E, "_func_22E" }, + { 0x22F, "_func_22F" }, + { 0x230, "_func_230" }, + { 0x231, "_func_231" }, + { 0x232, "_func_232" }, + { 0x233, "_func_233" }, + { 0x234, "_func_234" }, + { 0x235, "_func_235" }, + { 0x236, "_func_236" }, + { 0x237, "_func_237" }, + { 0x238, "_func_238" }, + { 0x239, "_func_239" }, + { 0x23A, "_func_23A" }, + { 0x23B, "_func_23B" }, + { 0x23C, "_func_23C" }, + { 0x23D, "_func_23D" }, + { 0x23E, "_func_23E" }, + { 0x23F, "_func_23F" }, + { 0x240, "_func_240" }, + { 0x241, "_func_241" }, + { 0x242, "_func_242" }, + { 0x243, "_func_243" }, + { 0x244, "_func_244" }, + { 0x245, "_func_245" }, + { 0x246, "_func_246" }, + { 0x247, "_func_247" }, + { 0x248, "_func_248" }, + { 0x249, "_func_249" }, + { 0x24A, "_func_24A" }, + { 0x24B, "_func_24B" }, + { 0x24C, "_func_24C" }, + { 0x24D, "_func_24D" }, + { 0x24E, "_func_24E" }, + { 0x24F, "_func_24F" }, + { 0x250, "_func_250" }, + { 0x251, "_func_251" }, + { 0x252, "_func_252" }, + { 0x253, "_func_253" }, + { 0x254, "_func_254" }, + { 0x255, "_func_255" }, + { 0x256, "_func_256" }, + { 0x257, "_func_257" }, + { 0x258, "_func_258" }, + { 0x259, "_func_259" }, + { 0x25A, "_func_25A" }, + { 0x25B, "_func_25B" }, + { 0x25C, "_func_25C" }, + { 0x25D, "_func_25D" }, + { 0x25E, "_func_25E" }, + { 0x25F, "_func_25F" }, + { 0x260, "_func_260" }, + { 0x261, "_func_261" }, + { 0x262, "_func_262" }, + { 0x263, "_func_263" }, + { 0x264, "_func_264" }, + { 0x265, "_func_265" }, + { 0x266, "_func_266" }, + { 0x267, "_func_267" }, + { 0x268, "_func_268" }, + { 0x269, "_func_269" }, + { 0x26A, "_func_26A" }, + { 0x26B, "_func_26B" }, + { 0x26C, "_func_26C" }, + { 0x26D, "_func_26D" }, + { 0x26E, "_func_26E" }, + { 0x26F, "_func_26F" }, + { 0x270, "_func_270" }, + { 0x271, "_func_271" }, + { 0x272, "_func_272" }, + { 0x273, "_func_273" }, + { 0x274, "_func_274" }, + { 0x275, "_func_275" }, + { 0x276, "_func_276" }, + { 0x277, "_func_277" }, + { 0x278, "_func_278" }, + { 0x279, "_func_279" }, + { 0x27A, "_func_27A" }, + { 0x27B, "_func_27B" }, + { 0x27C, "_func_27C" }, + { 0x27D, "_func_27D" }, + { 0x27E, "_func_27E" }, + { 0x27F, "_func_27F" }, + { 0x280, "_func_280" }, + { 0x281, "_func_281" }, + { 0x282, "_func_282" }, + { 0x283, "_func_283" }, + { 0x284, "_func_284" }, + { 0x285, "_func_285" }, + { 0x286, "_func_286" }, + { 0x287, "_func_287" }, + { 0x288, "_func_288" }, + { 0x289, "_func_289" }, + { 0x28A, "_func_28A" }, + { 0x28B, "_func_28B" }, + { 0x28C, "_func_28C" }, + { 0x28D, "_func_28D" }, + { 0x28E, "_func_28E" }, + { 0x28F, "_func_28F" }, + { 0x290, "_func_290" }, + { 0x291, "_func_291" }, + { 0x292, "_func_292" }, + { 0x293, "_func_293" }, + { 0x294, "_func_294" }, + { 0x295, "_func_295" }, + { 0x296, "_func_296" }, + { 0x297, "_func_297" }, + { 0x298, "_func_298" }, + { 0x299, "_func_299" }, + { 0x29A, "_func_29A" }, + { 0x29B, "_func_29B" }, + { 0x29C, "_func_29C" }, + { 0x29D, "_func_29D" }, + { 0x29E, "_func_29E" }, + { 0x29F, "_func_29F" }, + { 0x2A0, "_func_2A0" }, + { 0x2A1, "_func_2A1" }, + { 0x2A2, "_func_2A2" }, + { 0x2A3, "_func_2A3" }, + { 0x2A4, "_func_2A4" }, + { 0x2A5, "_func_2A5" }, + { 0x2A6, "_func_2A6" }, + { 0x2A7, "_func_2A7" }, + { 0x2A8, "_func_2A8" }, + { 0x2A9, "_func_2A9" }, + { 0x2AA, "_func_2AA" }, + { 0x2AB, "_func_2AB" }, + { 0x2AC, "_func_2AC" }, + { 0x2AD, "_func_2AD" }, + { 0x2AE, "_func_2AE" }, + { 0x2AF, "_func_2AF" }, + { 0x2B0, "_func_2B0" }, + { 0x2B1, "_func_2B1" }, + { 0x2B2, "_func_2B2" }, + { 0x2B3, "_func_2B3" }, + { 0x2B4, "_func_2B4" }, + { 0x2B5, "_func_2B5" }, + { 0x2B6, "_func_2B6" }, + { 0x2B7, "_func_2B7" }, + { 0x2B8, "_func_2B8" }, + { 0x2B9, "_func_2B9" }, + { 0x2BA, "_func_2BA" }, + { 0x2BB, "_func_2BB" }, + { 0x2BC, "_func_2BC" }, + { 0x2BD, "_func_2BD" }, + { 0x2BE, "_func_2BE" }, + { 0x2BF, "_func_2BF" }, + { 0x2C0, "_func_2C0" }, + { 0x2C1, "_func_2C1" }, + { 0x2C2, "_func_2C2" }, + { 0x2C3, "_func_2C3" }, + { 0x2C4, "_func_2C4" }, + { 0x2C5, "_func_2C5" }, + { 0x2C6, "_func_2C6" }, + { 0x2C7, "_func_2C7" }, + { 0x2C8, "_func_2C8" }, + { 0x2C9, "_func_2C9" }, + { 0x2CA, "_func_2CA" }, + { 0x2CB, "_func_2CB" }, + { 0x2CC, "_func_2CC" }, + { 0x2CD, "_func_2CD" }, + { 0x2CE, "_func_2CE" }, + { 0x2CF, "_func_2CF" }, + { 0x2D0, "_func_2D0" }, + { 0x2D1, "_func_2D1" }, + { 0x2D2, "_func_2D2" }, + { 0x2D3, "_func_2D3" }, + { 0x2D4, "_func_2D4" }, + { 0x2D5, "_func_2D5" }, + { 0x2D6, "_func_2D6" }, + { 0x2D7, "_func_2D7" }, + { 0x2D8, "_func_2D8" }, + { 0x2D9, "_func_2D9" }, + { 0x2DA, "_func_2DA" }, + { 0x2DB, "_func_2DB" }, + { 0x2DC, "_func_2DC" }, + { 0x2DD, "_func_2DD" }, + { 0x2DE, "_func_2DE" }, + { 0x2DF, "_func_2DF" }, + { 0x2E0, "_func_2E0" }, + { 0x2E1, "_func_2E1" }, + { 0x2E2, "_func_2E2" }, + { 0x2E3, "_func_2E3" }, + { 0x2E4, "_func_2E4" }, + { 0x2E5, "_func_2E5" }, + { 0x2E6, "_func_2E6" }, + { 0x2E7, "_func_2E7" }, + { 0x2E8, "_func_2E8" }, + { 0x2E9, "_func_2E9" }, + { 0x2EA, "_func_2EA" }, + { 0x2EB, "_func_2EB" }, + { 0x2EC, "_func_2EC" }, + { 0x2ED, "_func_2ED" }, + { 0x2EE, "_func_2EE" }, + { 0x2EF, "_func_2EF" }, + { 0x2F0, "_func_2F0" }, + { 0x2F1, "_func_2F1" }, + { 0x2F2, "_func_2F2" }, + { 0x2F3, "_func_2F3" }, + { 0x2F4, "_func_2F4" }, + { 0x2F5, "_func_2F5" }, + { 0x2F6, "_func_2F6" }, + { 0x2F7, "_func_2F7" }, + { 0x2F8, "_func_2F8" }, + { 0x2F9, "_func_2F9" }, + { 0x2FA, "_func_2FA" }, + { 0x2FB, "_func_2FB" }, + { 0x2FC, "_func_2FC" }, + { 0x2FD, "_func_2FD" }, + { 0x2FE, "_func_2FE" }, + { 0x2FF, "_func_2FF" }, + { 0x300, "_func_300" }, + { 0x301, "_func_301" }, + { 0x302, "_func_302" }, +}}; + +const std::array method_list +{{ + { 0x8000, "_meth_8000" }, + { 0x8001, "_meth_8001" }, + { 0x8002, "_meth_8002" }, + { 0x8003, "_meth_8003" }, + { 0x8004, "_meth_8004" }, + { 0x8005, "_meth_8005" }, + { 0x8006, "_meth_8006" }, + { 0x8007, "_meth_8007" }, + { 0x8008, "_meth_8008" }, + { 0x8009, "_meth_8009" }, + { 0x800A, "_meth_800A" }, + { 0x800B, "_meth_800B" }, + { 0x800C, "_meth_800C" }, + { 0x800D, "_meth_800D" }, + { 0x800E, "_meth_800E" }, + { 0x800F, "_meth_800F" }, + { 0x8010, "_meth_8010" }, + { 0x8011, "_meth_8011" }, + { 0x8012, "_meth_8012" }, + { 0x8013, "_meth_8013" }, + { 0x8014, "_meth_8014" }, + { 0x8015, "_meth_8015" }, + { 0x8016, "_meth_8016" }, + { 0x8017, "_meth_8017" }, + { 0x8018, "_meth_8018" }, + { 0x8019, "_meth_8019" }, + { 0x801A, "_meth_801A" }, + { 0x801B, "_meth_801B" }, + { 0x801C, "_meth_801C" }, + { 0x801D, "_meth_801D" }, + { 0x801E, "_meth_801E" }, + { 0x801F, "_meth_801F" }, + { 0x8020, "_meth_8020" }, + { 0x8021, "_meth_8021" }, + { 0x8022, "_meth_8022" }, + { 0x8023, "_meth_8023" }, + { 0x8024, "_meth_8024" }, + { 0x8025, "_meth_8025" }, + { 0x8026, "_meth_8026" }, + { 0x8027, "_meth_8027" }, + { 0x8028, "_meth_8028" }, + { 0x8029, "_meth_8029" }, + { 0x802A, "_meth_802A" }, + { 0x802B, "_meth_802B" }, + { 0x802C, "_meth_802C" }, + { 0x802D, "_meth_802D" }, + { 0x802E, "_meth_802E" }, + { 0x802F, "_meth_802F" }, + { 0x8030, "_meth_8030" }, + { 0x8031, "_meth_8031" }, + { 0x8032, "_meth_8032" }, + { 0x8033, "_meth_8033" }, + { 0x8034, "_meth_8034" }, + { 0x8035, "_meth_8035" }, + { 0x8036, "_meth_8036" }, + { 0x8037, "_meth_8037" }, + { 0x8038, "_meth_8038" }, + { 0x8039, "_meth_8039" }, + { 0x803A, "_meth_803A" }, + { 0x803B, "_meth_803B" }, + { 0x803C, "_meth_803C" }, + { 0x803D, "_meth_803D" }, + { 0x803E, "_meth_803E" }, + { 0x803F, "_meth_803F" }, + { 0x8040, "_meth_8040" }, + { 0x8041, "_meth_8041" }, + { 0x8042, "_meth_8042" }, + { 0x8043, "_meth_8043" }, + { 0x8044, "_meth_8044" }, + { 0x8045, "_meth_8045" }, + { 0x8046, "_meth_8046" }, + { 0x8047, "_meth_8047" }, + { 0x8048, "_meth_8048" }, + { 0x8049, "_meth_8049" }, + { 0x804A, "_meth_804A" }, + { 0x804B, "_meth_804B" }, + { 0x804C, "_meth_804C" }, + { 0x804D, "_meth_804D" }, + { 0x804E, "_meth_804E" }, + { 0x804F, "_meth_804F" }, + { 0x8050, "_meth_8050" }, + { 0x8051, "_meth_8051" }, + { 0x8052, "_meth_8052" }, + { 0x8053, "_meth_8053" }, + { 0x8054, "_meth_8054" }, + { 0x8055, "_meth_8055" }, + { 0x8056, "_meth_8056" }, + { 0x8057, "_meth_8057" }, + { 0x8058, "_meth_8058" }, + { 0x8059, "_meth_8059" }, + { 0x805A, "_meth_805A" }, + { 0x805B, "_meth_805B" }, + { 0x805C, "_meth_805C" }, + { 0x805D, "_meth_805D" }, + { 0x805E, "_meth_805E" }, + { 0x805F, "_meth_805F" }, + { 0x8060, "_meth_8060" }, + { 0x8061, "_meth_8061" }, + { 0x8062, "_meth_8062" }, + { 0x8063, "_meth_8063" }, + { 0x8064, "_meth_8064" }, + { 0x8065, "_meth_8065" }, + { 0x8066, "_meth_8066" }, + { 0x8067, "_meth_8067" }, + { 0x8068, "_meth_8068" }, + { 0x8069, "_meth_8069" }, + { 0x806A, "_meth_806A" }, + { 0x806B, "_meth_806B" }, + { 0x806C, "_meth_806C" }, + { 0x806D, "_meth_806D" }, + { 0x806E, "_meth_806E" }, + { 0x806F, "_meth_806F" }, + { 0x8070, "_meth_8070" }, + { 0x8071, "_meth_8071" }, + { 0x8072, "_meth_8072" }, + { 0x8073, "_meth_8073" }, + { 0x8074, "_meth_8074" }, + { 0x8075, "_meth_8075" }, + { 0x8076, "_meth_8076" }, + { 0x8077, "_meth_8077" }, + { 0x8078, "_meth_8078" }, + { 0x8079, "_meth_8079" }, + { 0x807A, "_meth_807A" }, + { 0x807B, "_meth_807B" }, + { 0x807C, "_meth_807C" }, + { 0x807D, "_meth_807D" }, + { 0x807E, "_meth_807E" }, + { 0x807F, "_meth_807F" }, + { 0x8080, "_meth_8080" }, + { 0x8081, "_meth_8081" }, + { 0x8082, "_meth_8082" }, + { 0x8083, "_meth_8083" }, + { 0x8084, "_meth_8084" }, + { 0x8085, "_meth_8085" }, + { 0x8086, "_meth_8086" }, + { 0x8087, "_meth_8087" }, + { 0x8088, "_meth_8088" }, + { 0x8089, "_meth_8089" }, + { 0x808A, "_meth_808A" }, + { 0x808B, "_meth_808B" }, + { 0x808C, "_meth_808C" }, + { 0x808D, "_meth_808D" }, + { 0x808E, "_meth_808E" }, + { 0x808F, "_meth_808F" }, + { 0x8090, "_meth_8090" }, + { 0x8091, "_meth_8091" }, + { 0x8092, "_meth_8092" }, + { 0x8093, "_meth_8093" }, + { 0x8094, "_meth_8094" }, + { 0x8095, "_meth_8095" }, + { 0x8096, "_meth_8096" }, + { 0x8097, "_meth_8097" }, + { 0x8098, "_meth_8098" }, + { 0x8099, "_meth_8099" }, + { 0x809A, "_meth_809A" }, + { 0x809B, "_meth_809B" }, + { 0x809C, "_meth_809C" }, + { 0x809D, "_meth_809D" }, + { 0x809E, "_meth_809E" }, + { 0x809F, "_meth_809F" }, + { 0x80A0, "_meth_80A0" }, + { 0x80A1, "_meth_80A1" }, + { 0x80A2, "_meth_80A2" }, + { 0x80A3, "_meth_80A3" }, + { 0x80A4, "_meth_80A4" }, + { 0x80A5, "_meth_80A5" }, + { 0x80A6, "_meth_80A6" }, + { 0x80A7, "_meth_80A7" }, + { 0x80A8, "_meth_80A8" }, + { 0x80A9, "_meth_80A9" }, + { 0x80AA, "_meth_80AA" }, + { 0x80AB, "_meth_80AB" }, + { 0x80AC, "_meth_80AC" }, + { 0x80AD, "_meth_80AD" }, + { 0x80AE, "_meth_80AE" }, + { 0x80AF, "_meth_80AF" }, + { 0x80B0, "_meth_80B0" }, + { 0x80B1, "_meth_80B1" }, + { 0x80B2, "_meth_80B2" }, + { 0x80B3, "_meth_80B3" }, + { 0x80B4, "_meth_80B4" }, + { 0x80B5, "_meth_80B5" }, + { 0x80B6, "_meth_80B6" }, + { 0x80B7, "_meth_80B7" }, + { 0x80B8, "_meth_80B8" }, + { 0x80B9, "_meth_80B9" }, + { 0x80BA, "_meth_80BA" }, + { 0x80BB, "_meth_80BB" }, + { 0x80BC, "_meth_80BC" }, + { 0x80BD, "_meth_80BD" }, + { 0x80BE, "_meth_80BE" }, + { 0x80BF, "_meth_80BF" }, + { 0x80C0, "_meth_80C0" }, + { 0x80C1, "_meth_80C1" }, + { 0x80C2, "_meth_80C2" }, + { 0x80C3, "_meth_80C3" }, + { 0x80C4, "_meth_80C4" }, + { 0x80C5, "_meth_80C5" }, + { 0x80C6, "_meth_80C6" }, + { 0x80C7, "_meth_80C7" }, + { 0x80C8, "_meth_80C8" }, + { 0x80C9, "_meth_80C9" }, + { 0x80CA, "_meth_80CA" }, + { 0x80CB, "_meth_80CB" }, + { 0x80CC, "_meth_80CC" }, + { 0x80CD, "_meth_80CD" }, + { 0x80CE, "_meth_80CE" }, + { 0x80CF, "_meth_80CF" }, + { 0x80D0, "_meth_80D0" }, + { 0x80D1, "_meth_80D1" }, + { 0x80D2, "_meth_80D2" }, + { 0x80D3, "_meth_80D3" }, + { 0x80D4, "_meth_80D4" }, + { 0x80D5, "_meth_80D5" }, + { 0x80D6, "_meth_80D6" }, + { 0x80D7, "_meth_80D7" }, + { 0x80D8, "_meth_80D8" }, + { 0x80D9, "_meth_80D9" }, + { 0x80DA, "_meth_80DA" }, + { 0x80DB, "_meth_80DB" }, + { 0x80DC, "_meth_80DC" }, + { 0x80DD, "_meth_80DD" }, + { 0x80DE, "_meth_80DE" }, + { 0x80DF, "_meth_80DF" }, + { 0x80E0, "_meth_80E0" }, + { 0x80E1, "_meth_80E1" }, + { 0x80E2, "_meth_80E2" }, + { 0x80E3, "_meth_80E3" }, + { 0x80E4, "_meth_80E4" }, + { 0x80E5, "_meth_80E5" }, + { 0x80E6, "_meth_80E6" }, + { 0x80E7, "_meth_80E7" }, + { 0x80E8, "_meth_80E8" }, + { 0x80E9, "_meth_80E9" }, + { 0x80EA, "_meth_80EA" }, + { 0x80EB, "_meth_80EB" }, + { 0x80EC, "_meth_80EC" }, + { 0x80ED, "_meth_80ED" }, + { 0x80EE, "_meth_80EE" }, + { 0x80EF, "_meth_80EF" }, + { 0x80F0, "_meth_80F0" }, + { 0x80F1, "_meth_80F1" }, + { 0x80F2, "_meth_80F2" }, + { 0x80F3, "_meth_80F3" }, + { 0x80F4, "_meth_80F4" }, + { 0x80F5, "_meth_80F5" }, + { 0x80F6, "_meth_80F6" }, + { 0x80F7, "_meth_80F7" }, + { 0x80F8, "_meth_80F8" }, + { 0x80F9, "_meth_80F9" }, + { 0x80FA, "_meth_80FA" }, + { 0x80FB, "_meth_80FB" }, + { 0x80FC, "_meth_80FC" }, + { 0x80FD, "_meth_80FD" }, + { 0x80FE, "_meth_80FE" }, + { 0x80FF, "_meth_80FF" }, + { 0x8100, "_meth_8100" }, + { 0x8101, "_meth_8101" }, + { 0x8102, "_meth_8102" }, + { 0x8103, "_meth_8103" }, + { 0x8104, "_meth_8104" }, + { 0x8105, "_meth_8105" }, + { 0x8106, "_meth_8106" }, + { 0x8107, "_meth_8107" }, + { 0x8108, "_meth_8108" }, + { 0x8109, "_meth_8109" }, + { 0x810A, "_meth_810A" }, + { 0x810B, "_meth_810B" }, + { 0x810C, "_meth_810C" }, + { 0x810D, "_meth_810D" }, + { 0x810E, "_meth_810E" }, + { 0x810F, "_meth_810F" }, + { 0x8110, "_meth_8110" }, + { 0x8111, "_meth_8111" }, + { 0x8112, "_meth_8112" }, + { 0x8113, "_meth_8113" }, + { 0x8114, "_meth_8114" }, + { 0x8115, "_meth_8115" }, + { 0x8116, "_meth_8116" }, + { 0x8117, "_meth_8117" }, + { 0x8118, "_meth_8118" }, + { 0x8119, "_meth_8119" }, + { 0x811A, "_meth_811A" }, + { 0x811B, "_meth_811B" }, + { 0x811C, "_meth_811C" }, + { 0x811D, "_meth_811D" }, + { 0x811E, "_meth_811E" }, + { 0x811F, "_meth_811F" }, + { 0x8120, "_meth_8120" }, + { 0x8121, "_meth_8121" }, + { 0x8122, "_meth_8122" }, + { 0x8123, "_meth_8123" }, + { 0x8124, "_meth_8124" }, + { 0x8125, "_meth_8125" }, + { 0x8126, "_meth_8126" }, + { 0x8127, "_meth_8127" }, + { 0x8128, "_meth_8128" }, + { 0x8129, "_meth_8129" }, + { 0x812A, "_meth_812A" }, + { 0x812B, "_meth_812B" }, + { 0x812C, "_meth_812C" }, + { 0x812D, "_meth_812D" }, + { 0x812E, "_meth_812E" }, + { 0x812F, "_meth_812F" }, + { 0x8130, "_meth_8130" }, + { 0x8131, "_meth_8131" }, + { 0x8132, "_meth_8132" }, + { 0x8133, "_meth_8133" }, + { 0x8134, "_meth_8134" }, + { 0x8135, "_meth_8135" }, + { 0x8136, "_meth_8136" }, + { 0x8137, "_meth_8137" }, + { 0x8138, "_meth_8138" }, + { 0x8139, "_meth_8139" }, + { 0x813A, "_meth_813A" }, + { 0x813B, "_meth_813B" }, + { 0x813C, "_meth_813C" }, + { 0x813D, "_meth_813D" }, + { 0x813E, "_meth_813E" }, + { 0x813F, "_meth_813F" }, + { 0x8140, "_meth_8140" }, + { 0x8141, "_meth_8141" }, + { 0x8142, "_meth_8142" }, + { 0x8143, "_meth_8143" }, + { 0x8144, "_meth_8144" }, + { 0x8145, "_meth_8145" }, + { 0x8146, "_meth_8146" }, + { 0x8147, "_meth_8147" }, + { 0x8148, "_meth_8148" }, + { 0x8149, "_meth_8149" }, + { 0x814A, "_meth_814A" }, + { 0x814B, "_meth_814B" }, + { 0x814C, "_meth_814C" }, + { 0x814D, "_meth_814D" }, + { 0x814E, "_meth_814E" }, + { 0x814F, "_meth_814F" }, + { 0x8150, "_meth_8150" }, + { 0x8151, "_meth_8151" }, + { 0x8152, "_meth_8152" }, + { 0x8153, "_meth_8153" }, + { 0x8154, "_meth_8154" }, + { 0x8155, "_meth_8155" }, + { 0x8156, "_meth_8156" }, + { 0x8157, "_meth_8157" }, + { 0x8158, "_meth_8158" }, + { 0x8159, "_meth_8159" }, + { 0x815A, "_meth_815A" }, + { 0x815B, "_meth_815B" }, + { 0x815C, "_meth_815C" }, + { 0x815D, "_meth_815D" }, + { 0x815E, "_meth_815E" }, + { 0x815F, "_meth_815F" }, + { 0x8160, "_meth_8160" }, + { 0x8161, "_meth_8161" }, + { 0x8162, "_meth_8162" }, + { 0x8163, "_meth_8163" }, + { 0x8164, "_meth_8164" }, + { 0x8165, "_meth_8165" }, + { 0x8166, "_meth_8166" }, + { 0x8167, "_meth_8167" }, + { 0x8168, "_meth_8168" }, + { 0x8169, "_meth_8169" }, + { 0x816A, "_meth_816A" }, + { 0x816B, "_meth_816B" }, + { 0x816C, "_meth_816C" }, + { 0x816D, "_meth_816D" }, + { 0x816E, "_meth_816E" }, + { 0x816F, "_meth_816F" }, + { 0x8170, "_meth_8170" }, + { 0x8171, "_meth_8171" }, + { 0x8172, "_meth_8172" }, + { 0x8173, "_meth_8173" }, + { 0x8174, "_meth_8174" }, + { 0x8175, "_meth_8175" }, + { 0x8176, "_meth_8176" }, + { 0x8177, "_meth_8177" }, + { 0x8178, "_meth_8178" }, + { 0x8179, "_meth_8179" }, + { 0x817A, "_meth_817A" }, + { 0x817B, "_meth_817B" }, + { 0x817C, "_meth_817C" }, + { 0x817D, "_meth_817D" }, + { 0x817E, "_meth_817E" }, + { 0x817F, "_meth_817F" }, + { 0x8180, "_meth_8180" }, + { 0x8181, "_meth_8181" }, + { 0x8182, "_meth_8182" }, + { 0x8183, "_meth_8183" }, + { 0x8184, "_meth_8184" }, + { 0x8185, "_meth_8185" }, + { 0x8186, "_meth_8186" }, + { 0x8187, "_meth_8187" }, + { 0x8188, "_meth_8188" }, + { 0x8189, "_meth_8189" }, + { 0x818A, "_meth_818A" }, + { 0x818B, "_meth_818B" }, + { 0x818C, "_meth_818C" }, + { 0x818D, "_meth_818D" }, + { 0x818E, "_meth_818E" }, + { 0x818F, "_meth_818F" }, + { 0x8190, "_meth_8190" }, + { 0x8191, "_meth_8191" }, + { 0x8192, "_meth_8192" }, + { 0x8193, "_meth_8193" }, + { 0x8194, "_meth_8194" }, + { 0x8195, "_meth_8195" }, + { 0x8196, "_meth_8196" }, + { 0x8197, "_meth_8197" }, + { 0x8198, "_meth_8198" }, + { 0x8199, "_meth_8199" }, + { 0x819A, "_meth_819A" }, + { 0x819B, "_meth_819B" }, + { 0x819C, "_meth_819C" }, + { 0x819D, "_meth_819D" }, + { 0x819E, "_meth_819E" }, + { 0x819F, "_meth_819F" }, + { 0x81A0, "_meth_81A0" }, + { 0x81A1, "_meth_81A1" }, + { 0x81A2, "_meth_81A2" }, + { 0x81A3, "_meth_81A3" }, + { 0x81A4, "_meth_81A4" }, + { 0x81A5, "_meth_81A5" }, + { 0x81A6, "_meth_81A6" }, + { 0x81A7, "_meth_81A7" }, + { 0x81A8, "_meth_81A8" }, + { 0x81A9, "_meth_81A9" }, + { 0x81AA, "_meth_81AA" }, + { 0x81AB, "_meth_81AB" }, + { 0x81AC, "_meth_81AC" }, + { 0x81AD, "_meth_81AD" }, + { 0x81AE, "_meth_81AE" }, + { 0x81AF, "_meth_81AF" }, + { 0x81B0, "_meth_81B0" }, + { 0x81B1, "_meth_81B1" }, + { 0x81B2, "_meth_81B2" }, + { 0x81B3, "_meth_81B3" }, + { 0x81B4, "_meth_81B4" }, + { 0x81B5, "_meth_81B5" }, + { 0x81B6, "_meth_81B6" }, + { 0x81B7, "_meth_81B7" }, + { 0x81B8, "_meth_81B8" }, + { 0x81B9, "_meth_81B9" }, + { 0x81BA, "_meth_81BA" }, + { 0x81BB, "_meth_81BB" }, + { 0x81BC, "_meth_81BC" }, + { 0x81BD, "_meth_81BD" }, + { 0x81BE, "_meth_81BE" }, + { 0x81BF, "_meth_81BF" }, + { 0x81C0, "_meth_81C0" }, + { 0x81C1, "_meth_81C1" }, + { 0x81C2, "_meth_81C2" }, + { 0x81C3, "_meth_81C3" }, + { 0x81C4, "_meth_81C4" }, + { 0x81C5, "_meth_81C5" }, + { 0x81C6, "_meth_81C6" }, + { 0x81C7, "_meth_81C7" }, + { 0x81C8, "_meth_81C8" }, + { 0x81C9, "_meth_81C9" }, + { 0x81CA, "_meth_81CA" }, + { 0x81CB, "_meth_81CB" }, + { 0x81CC, "_meth_81CC" }, + { 0x81CD, "_meth_81CD" }, + { 0x81CE, "_meth_81CE" }, + { 0x81CF, "_meth_81CF" }, + { 0x81D0, "_meth_81D0" }, + { 0x81D1, "_meth_81D1" }, + { 0x81D2, "_meth_81D2" }, + { 0x81D3, "_meth_81D3" }, + { 0x81D4, "_meth_81D4" }, + { 0x81D5, "_meth_81D5" }, + { 0x81D6, "_meth_81D6" }, + { 0x81D7, "_meth_81D7" }, + { 0x81D8, "_meth_81D8" }, + { 0x81D9, "_meth_81D9" }, + { 0x81DA, "_meth_81DA" }, + { 0x81DB, "_meth_81DB" }, + { 0x81DC, "_meth_81DC" }, + { 0x81DD, "_meth_81DD" }, + { 0x81DE, "_meth_81DE" }, + { 0x81DF, "_meth_81DF" }, + { 0x81E0, "_meth_81E0" }, + { 0x81E1, "_meth_81E1" }, + { 0x81E2, "_meth_81E2" }, + { 0x81E3, "_meth_81E3" }, + { 0x81E4, "_meth_81E4" }, + { 0x81E5, "_meth_81E5" }, + { 0x81E6, "_meth_81E6" }, + { 0x81E7, "_meth_81E7" }, + { 0x81E8, "_meth_81E8" }, + { 0x81E9, "_meth_81E9" }, + { 0x81EA, "_meth_81EA" }, + { 0x81EB, "_meth_81EB" }, + { 0x81EC, "_meth_81EC" }, + { 0x81ED, "_meth_81ED" }, + { 0x81EE, "_meth_81EE" }, + { 0x81EF, "_meth_81EF" }, + { 0x81F0, "_meth_81F0" }, + { 0x81F1, "_meth_81F1" }, + { 0x81F2, "_meth_81F2" }, + { 0x81F3, "_meth_81F3" }, + { 0x81F4, "_meth_81F4" }, + { 0x81F5, "_meth_81F5" }, + { 0x81F6, "_meth_81F6" }, + { 0x81F7, "_meth_81F7" }, + { 0x81F8, "_meth_81F8" }, + { 0x81F9, "_meth_81F9" }, + { 0x81FA, "_meth_81FA" }, + { 0x81FB, "_meth_81FB" }, + { 0x81FC, "_meth_81FC" }, + { 0x81FD, "_meth_81FD" }, + { 0x81FE, "_meth_81FE" }, + { 0x81FF, "_meth_81FF" }, + { 0x8200, "_meth_8200" }, + { 0x8201, "_meth_8201" }, + { 0x8202, "_meth_8202" }, + { 0x8203, "_meth_8203" }, + { 0x8204, "_meth_8204" }, + { 0x8205, "_meth_8205" }, + { 0x8206, "_meth_8206" }, + { 0x8207, "_meth_8207" }, + { 0x8208, "_meth_8208" }, + { 0x8209, "_meth_8209" }, + { 0x820A, "_meth_820A" }, + { 0x820B, "_meth_820B" }, + { 0x820C, "_meth_820C" }, + { 0x820D, "_meth_820D" }, + { 0x820E, "_meth_820E" }, + { 0x820F, "_meth_820F" }, + { 0x8210, "_meth_8210" }, + { 0x8211, "_meth_8211" }, + { 0x8212, "_meth_8212" }, + { 0x8213, "_meth_8213" }, + { 0x8214, "_meth_8214" }, + { 0x8215, "_meth_8215" }, + { 0x8216, "_meth_8216" }, + { 0x8217, "_meth_8217" }, + { 0x8218, "_meth_8218" }, + { 0x8219, "_meth_8219" }, + { 0x821A, "_meth_821A" }, + { 0x821B, "_meth_821B" }, + { 0x821C, "_meth_821C" }, + { 0x821D, "_meth_821D" }, + { 0x821E, "_meth_821E" }, + { 0x821F, "_meth_821F" }, + { 0x8220, "_meth_8220" }, + { 0x8221, "_meth_8221" }, + { 0x8222, "_meth_8222" }, + { 0x8223, "_meth_8223" }, + { 0x8224, "_meth_8224" }, + { 0x8225, "_meth_8225" }, + { 0x8226, "_meth_8226" }, + { 0x8227, "_meth_8227" }, + { 0x8228, "_meth_8228" }, + { 0x8229, "_meth_8229" }, + { 0x822A, "_meth_822A" }, + { 0x822B, "_meth_822B" }, + { 0x822C, "_meth_822C" }, + { 0x822D, "_meth_822D" }, + { 0x822E, "_meth_822E" }, + { 0x822F, "_meth_822F" }, + { 0x8230, "_meth_8230" }, + { 0x8231, "_meth_8231" }, + { 0x8232, "_meth_8232" }, + { 0x8233, "_meth_8233" }, + { 0x8234, "_meth_8234" }, + { 0x8235, "_meth_8235" }, + { 0x8236, "_meth_8236" }, + { 0x8237, "_meth_8237" }, + { 0x8238, "_meth_8238" }, + { 0x8239, "_meth_8239" }, + { 0x823A, "_meth_823A" }, + { 0x823B, "_meth_823B" }, + { 0x823C, "_meth_823C" }, + { 0x823D, "_meth_823D" }, + { 0x823E, "_meth_823E" }, + { 0x823F, "_meth_823F" }, + { 0x8240, "_meth_8240" }, + { 0x8241, "_meth_8241" }, + { 0x8242, "_meth_8242" }, + { 0x8243, "_meth_8243" }, + { 0x8244, "_meth_8244" }, + { 0x8245, "_meth_8245" }, + { 0x8246, "_meth_8246" }, + { 0x8247, "_meth_8247" }, + { 0x8248, "_meth_8248" }, + { 0x8249, "_meth_8249" }, + { 0x824A, "_meth_824A" }, + { 0x824B, "_meth_824B" }, + { 0x824C, "_meth_824C" }, + { 0x824D, "_meth_824D" }, + { 0x824E, "_meth_824E" }, + { 0x824F, "_meth_824F" }, + { 0x8250, "_meth_8250" }, + { 0x8251, "_meth_8251" }, + { 0x8252, "_meth_8252" }, + { 0x8253, "_meth_8253" }, + { 0x8254, "_meth_8254" }, + { 0x8255, "_meth_8255" }, + { 0x8256, "_meth_8256" }, + { 0x8257, "_meth_8257" }, + { 0x8258, "_meth_8258" }, + { 0x8259, "_meth_8259" }, + { 0x825A, "_meth_825A" }, + { 0x825B, "_meth_825B" }, + { 0x825C, "_meth_825C" }, + { 0x825D, "_meth_825D" }, + { 0x825E, "_meth_825E" }, + { 0x825F, "_meth_825F" }, + { 0x8260, "_meth_8260" }, + { 0x8261, "_meth_8261" }, + { 0x8262, "_meth_8262" }, + { 0x8263, "_meth_8263" }, + { 0x8264, "_meth_8264" }, + { 0x8265, "_meth_8265" }, + { 0x8266, "_meth_8266" }, + { 0x8267, "_meth_8267" }, + { 0x8268, "_meth_8268" }, + { 0x8269, "_meth_8269" }, + { 0x826A, "_meth_826A" }, + { 0x826B, "_meth_826B" }, + { 0x826C, "_meth_826C" }, + { 0x826D, "_meth_826D" }, + { 0x826E, "_meth_826E" }, + { 0x826F, "_meth_826F" }, + { 0x8270, "_meth_8270" }, + { 0x8271, "_meth_8271" }, + { 0x8272, "_meth_8272" }, + { 0x8273, "_meth_8273" }, + { 0x8274, "_meth_8274" }, + { 0x8275, "_meth_8275" }, + { 0x8276, "_meth_8276" }, + { 0x8277, "_meth_8277" }, + { 0x8278, "_meth_8278" }, + { 0x8279, "_meth_8279" }, + { 0x827A, "_meth_827A" }, + { 0x827B, "_meth_827B" }, + { 0x827C, "_meth_827C" }, + { 0x827D, "_meth_827D" }, + { 0x827E, "_meth_827E" }, + { 0x827F, "_meth_827F" }, + { 0x8280, "_meth_8280" }, + { 0x8281, "_meth_8281" }, + { 0x8282, "_meth_8282" }, + { 0x8283, "_meth_8283" }, + { 0x8284, "_meth_8284" }, + { 0x8285, "_meth_8285" }, + { 0x8286, "_meth_8286" }, + { 0x8287, "_meth_8287" }, + { 0x8288, "_meth_8288" }, + { 0x8289, "_meth_8289" }, + { 0x828A, "_meth_828A" }, + { 0x828B, "_meth_828B" }, + { 0x828C, "_meth_828C" }, + { 0x828D, "_meth_828D" }, + { 0x828E, "_meth_828E" }, + { 0x828F, "_meth_828F" }, + { 0x8290, "_meth_8290" }, + { 0x8291, "_meth_8291" }, + { 0x8292, "_meth_8292" }, + { 0x8293, "_meth_8293" }, + { 0x8294, "_meth_8294" }, + { 0x8295, "_meth_8295" }, + { 0x8296, "_meth_8296" }, + { 0x8297, "_meth_8297" }, + { 0x8298, "_meth_8298" }, + { 0x8299, "_meth_8299" }, + { 0x829A, "_meth_829A" }, + { 0x829B, "_meth_829B" }, + { 0x829C, "_meth_829C" }, + { 0x829D, "_meth_829D" }, + { 0x829E, "_meth_829E" }, + { 0x829F, "_meth_829F" }, + { 0x82A0, "_meth_82A0" }, + { 0x82A1, "_meth_82A1" }, + { 0x82A2, "_meth_82A2" }, + { 0x82A3, "_meth_82A3" }, + { 0x82A4, "_meth_82A4" }, + { 0x82A5, "_meth_82A5" }, + { 0x82A6, "_meth_82A6" }, + { 0x82A7, "_meth_82A7" }, + { 0x82A8, "_meth_82A8" }, + { 0x82A9, "_meth_82A9" }, + { 0x82AA, "_meth_82AA" }, + { 0x82AB, "_meth_82AB" }, + { 0x82AC, "_meth_82AC" }, + { 0x82AD, "_meth_82AD" }, + { 0x82AE, "_meth_82AE" }, + { 0x82AF, "_meth_82AF" }, + { 0x82B0, "_meth_82B0" }, + { 0x82B1, "_meth_82B1" }, + { 0x82B2, "_meth_82B2" }, + { 0x82B3, "_meth_82B3" }, + { 0x82B4, "_meth_82B4" }, + { 0x82B5, "_meth_82B5" }, + { 0x82B6, "_meth_82B6" }, + { 0x82B7, "_meth_82B7" }, + { 0x82B8, "_meth_82B8" }, + { 0x82B9, "_meth_82B9" }, + { 0x82BA, "_meth_82BA" }, + { 0x82BB, "_meth_82BB" }, + { 0x82BC, "_meth_82BC" }, + { 0x82BD, "_meth_82BD" }, + { 0x82BE, "_meth_82BE" }, + { 0x82BF, "_meth_82BF" }, + { 0x82C0, "_meth_82C0" }, + { 0x82C1, "_meth_82C1" }, + { 0x82C2, "_meth_82C2" }, + { 0x82C3, "_meth_82C3" }, + { 0x82C4, "_meth_82C4" }, + { 0x82C5, "_meth_82C5" }, + { 0x82C6, "_meth_82C6" }, + { 0x82C7, "_meth_82C7" }, + { 0x82C8, "_meth_82C8" }, + { 0x82C9, "_meth_82C9" }, + { 0x82CA, "_meth_82CA" }, + { 0x82CB, "_meth_82CB" }, + { 0x82CC, "_meth_82CC" }, + { 0x82CD, "_meth_82CD" }, + { 0x82CE, "_meth_82CE" }, + { 0x82CF, "_meth_82CF" }, + { 0x82D0, "_meth_82D0" }, + { 0x82D1, "_meth_82D1" }, + { 0x82D2, "_meth_82D2" }, + { 0x82D3, "_meth_82D3" }, + { 0x82D4, "_meth_82D4" }, + { 0x82D5, "_meth_82D5" }, + { 0x82D6, "_meth_82D6" }, + { 0x82D7, "_meth_82D7" }, + { 0x82D8, "_meth_82D8" }, + { 0x82D9, "_meth_82D9" }, + { 0x82DA, "_meth_82DA" }, + { 0x82DB, "_meth_82DB" }, + { 0x82DC, "_meth_82DC" }, + { 0x82DD, "_meth_82DD" }, + { 0x82DE, "_meth_82DE" }, + { 0x82DF, "_meth_82DF" }, + { 0x82E0, "_meth_82E0" }, + { 0x82E1, "_meth_82E1" }, + { 0x82E2, "_meth_82E2" }, + { 0x82E3, "_meth_82E3" }, + { 0x82E4, "_meth_82E4" }, + { 0x82E5, "_meth_82E5" }, + { 0x82E6, "_meth_82E6" }, + { 0x82E7, "_meth_82E7" }, + { 0x82E8, "_meth_82E8" }, + { 0x82E9, "_meth_82E9" }, + { 0x82EA, "_meth_82EA" }, + { 0x82EB, "_meth_82EB" }, + { 0x82EC, "_meth_82EC" }, + { 0x82ED, "_meth_82ED" }, + { 0x82EE, "_meth_82EE" }, + { 0x82EF, "_meth_82EF" }, + { 0x82F0, "_meth_82F0" }, + { 0x82F1, "_meth_82F1" }, + { 0x82F2, "_meth_82F2" }, + { 0x82F3, "_meth_82F3" }, + { 0x82F4, "_meth_82F4" }, + { 0x82F5, "_meth_82F5" }, + { 0x82F6, "_meth_82F6" }, + { 0x82F7, "_meth_82F7" }, + { 0x82F8, "_meth_82F8" }, + { 0x82F9, "_meth_82F9" }, + { 0x82FA, "_meth_82FA" }, + { 0x82FB, "_meth_82FB" }, + { 0x82FC, "_meth_82FC" }, + { 0x82FD, "_meth_82FD" }, + { 0x82FE, "_meth_82FE" }, + { 0x82FF, "_meth_82FF" }, + { 0x8300, "_meth_8300" }, + { 0x8301, "_meth_8301" }, + { 0x8302, "_meth_8302" }, + { 0x8303, "_meth_8303" }, + { 0x8304, "_meth_8304" }, + { 0x8305, "_meth_8305" }, + { 0x8306, "_meth_8306" }, + { 0x8307, "_meth_8307" }, + { 0x8308, "_meth_8308" }, + { 0x8309, "_meth_8309" }, + { 0x830A, "_meth_830A" }, + { 0x830B, "_meth_830B" }, + { 0x830C, "_meth_830C" }, + { 0x830D, "_meth_830D" }, + { 0x830E, "_meth_830E" }, + { 0x830F, "_meth_830F" }, + { 0x8310, "_meth_8310" }, + { 0x8311, "_meth_8311" }, + { 0x8312, "_meth_8312" }, + { 0x8313, "_meth_8313" }, + { 0x8314, "_meth_8314" }, + { 0x8315, "_meth_8315" }, + { 0x8316, "_meth_8316" }, + { 0x8317, "_meth_8317" }, + { 0x8318, "_meth_8318" }, + { 0x8319, "_meth_8319" }, + { 0x831A, "_meth_831A" }, + { 0x831B, "_meth_831B" }, + { 0x831C, "_meth_831C" }, + { 0x831D, "_meth_831D" }, + { 0x831E, "_meth_831E" }, + { 0x831F, "_meth_831F" }, + { 0x8320, "_meth_8320" }, + { 0x8321, "_meth_8321" }, + { 0x8322, "_meth_8322" }, + { 0x8323, "_meth_8323" }, + { 0x8324, "_meth_8324" }, + { 0x8325, "_meth_8325" }, + { 0x8326, "_meth_8326" }, + { 0x8327, "_meth_8327" }, + { 0x8328, "_meth_8328" }, + { 0x8329, "_meth_8329" }, + { 0x832A, "_meth_832A" }, + { 0x832B, "_meth_832B" }, + { 0x832C, "_meth_832C" }, + { 0x832D, "_meth_832D" }, + { 0x832E, "_meth_832E" }, + { 0x832F, "_meth_832F" }, + { 0x8330, "_meth_8330" }, + { 0x8331, "_meth_8331" }, + { 0x8332, "_meth_8332" }, + { 0x8333, "_meth_8333" }, + { 0x8334, "_meth_8334" }, + { 0x8335, "_meth_8335" }, + { 0x8336, "_meth_8336" }, + { 0x8337, "_meth_8337" }, + { 0x8338, "_meth_8338" }, + { 0x8339, "_meth_8339" }, + { 0x833A, "_meth_833A" }, + { 0x833B, "_meth_833B" }, + { 0x833C, "_meth_833C" }, + { 0x833D, "_meth_833D" }, + { 0x833E, "_meth_833E" }, + { 0x833F, "_meth_833F" }, + { 0x8340, "_meth_8340" }, + { 0x8341, "_meth_8341" }, + { 0x8342, "_meth_8342" }, + { 0x8343, "_meth_8343" }, + { 0x8344, "_meth_8344" }, + { 0x8345, "_meth_8345" }, + { 0x8346, "_meth_8346" }, + { 0x8347, "_meth_8347" }, + { 0x8348, "_meth_8348" }, + { 0x8349, "_meth_8349" }, + { 0x834A, "_meth_834A" }, + { 0x834B, "_meth_834B" }, + { 0x834C, "_meth_834C" }, + { 0x834D, "_meth_834D" }, + { 0x834E, "_meth_834E" }, + { 0x834F, "_meth_834F" }, + { 0x8350, "_meth_8350" }, + { 0x8351, "_meth_8351" }, + { 0x8352, "_meth_8352" }, + { 0x8353, "_meth_8353" }, + { 0x8354, "_meth_8354" }, + { 0x8355, "_meth_8355" }, + { 0x8356, "_meth_8356" }, + { 0x8357, "_meth_8357" }, + { 0x8358, "_meth_8358" }, + { 0x8359, "_meth_8359" }, + { 0x835A, "_meth_835A" }, + { 0x835B, "_meth_835B" }, + { 0x835C, "_meth_835C" }, + { 0x835D, "_meth_835D" }, + { 0x835E, "_meth_835E" }, + { 0x835F, "_meth_835F" }, + { 0x8360, "_meth_8360" }, + { 0x8361, "_meth_8361" }, + { 0x8362, "_meth_8362" }, + { 0x8363, "_meth_8363" }, + { 0x8364, "_meth_8364" }, + { 0x8365, "_meth_8365" }, + { 0x8366, "_meth_8366" }, + { 0x8367, "_meth_8367" }, + { 0x8368, "_meth_8368" }, + { 0x8369, "_meth_8369" }, + { 0x836A, "_meth_836A" }, + { 0x836B, "_meth_836B" }, + { 0x836C, "_meth_836C" }, + { 0x836D, "_meth_836D" }, + { 0x836E, "_meth_836E" }, + { 0x836F, "_meth_836F" }, + { 0x8370, "_meth_8370" }, + { 0x8371, "_meth_8371" }, + { 0x8372, "_meth_8372" }, + { 0x8373, "_meth_8373" }, + { 0x8374, "_meth_8374" }, + { 0x8375, "_meth_8375" }, + { 0x8376, "_meth_8376" }, + { 0x8377, "_meth_8377" }, + { 0x8378, "_meth_8378" }, + { 0x8379, "_meth_8379" }, + { 0x837A, "_meth_837A" }, + { 0x837B, "_meth_837B" }, + { 0x837C, "_meth_837C" }, + { 0x837D, "_meth_837D" }, + { 0x837E, "_meth_837E" }, + { 0x837F, "_meth_837F" }, + { 0x8380, "_meth_8380" }, + { 0x8381, "_meth_8381" }, + { 0x8382, "_meth_8382" }, + { 0x8383, "_meth_8383" }, + { 0x8384, "_meth_8384" }, + { 0x8385, "_meth_8385" }, + { 0x8386, "_meth_8386" }, + { 0x8387, "_meth_8387" }, + { 0x8388, "_meth_8388" }, + { 0x8389, "_meth_8389" }, + { 0x838A, "_meth_838A" }, + { 0x838B, "_meth_838B" }, + { 0x838C, "_meth_838C" }, + { 0x838D, "_meth_838D" }, + { 0x838E, "_meth_838E" }, + { 0x838F, "_meth_838F" }, + { 0x8390, "_meth_8390" }, + { 0x8391, "_meth_8391" }, + { 0x8392, "_meth_8392" }, + { 0x8393, "_meth_8393" }, + { 0x8394, "_meth_8394" }, + { 0x8395, "_meth_8395" }, + { 0x8396, "_meth_8396" }, + { 0x8397, "_meth_8397" }, + { 0x8398, "_meth_8398" }, + { 0x8399, "_meth_8399" }, + { 0x839A, "_meth_839A" }, + { 0x839B, "_meth_839B" }, + { 0x839C, "_meth_839C" }, + { 0x839D, "_meth_839D" }, + { 0x839E, "_meth_839E" }, + { 0x839F, "_meth_839F" }, + { 0x83A0, "_meth_83A0" }, + { 0x83A1, "_meth_83A1" }, + { 0x83A2, "_meth_83A2" }, + { 0x83A3, "_meth_83A3" }, + { 0x83A4, "_meth_83A4" }, + { 0x83A5, "_meth_83A5" }, + { 0x83A6, "_meth_83A6" }, + { 0x83A7, "_meth_83A7" }, + { 0x83A8, "_meth_83A8" }, + { 0x83A9, "_meth_83A9" }, + { 0x83AA, "_meth_83AA" }, + { 0x83AB, "_meth_83AB" }, + { 0x83AC, "_meth_83AC" }, + { 0x83AD, "_meth_83AD" }, + { 0x83AE, "_meth_83AE" }, + { 0x83AF, "_meth_83AF" }, + { 0x83B0, "_meth_83B0" }, + { 0x83B1, "_meth_83B1" }, + { 0x83B2, "_meth_83B2" }, + { 0x83B3, "_meth_83B3" }, + { 0x83B4, "_meth_83B4" }, + { 0x83B5, "_meth_83B5" }, + { 0x83B6, "_meth_83B6" }, + { 0x83B7, "_meth_83B7" }, + { 0x83B8, "_meth_83B8" }, + { 0x83B9, "_meth_83B9" }, + { 0x83BA, "_meth_83BA" }, + { 0x83BB, "_meth_83BB" }, + { 0x83BC, "_meth_83BC" }, + { 0x83BD, "_meth_83BD" }, + { 0x83BE, "_meth_83BE" }, + { 0x83BF, "_meth_83BF" }, + { 0x83C0, "_meth_83C0" }, + { 0x83C1, "_meth_83C1" }, + { 0x83C2, "_meth_83C2" }, + { 0x83C3, "_meth_83C3" }, + { 0x83C4, "_meth_83C4" }, + { 0x83C5, "_meth_83C5" }, + { 0x83C6, "_meth_83C6" }, + { 0x83C7, "_meth_83C7" }, + { 0x83C8, "_meth_83C8" }, + { 0x83C9, "_meth_83C9" }, + { 0x83CA, "_meth_83CA" }, + { 0x83CB, "_meth_83CB" }, + { 0x83CC, "_meth_83CC" }, + { 0x83CD, "_meth_83CD" }, + { 0x83CE, "_meth_83CE" }, + { 0x83CF, "_meth_83CF" }, + { 0x83D0, "_meth_83D0" }, + { 0x83D1, "_meth_83D1" }, + { 0x83D2, "_meth_83D2" }, + { 0x83D3, "_meth_83D3" }, + { 0x83D4, "_meth_83D4" }, + { 0x83D5, "_meth_83D5" }, + { 0x83D6, "_meth_83D6" }, + { 0x83D7, "_meth_83D7" }, + { 0x83D8, "_meth_83D8" }, + { 0x83D9, "_meth_83D9" }, + { 0x83DA, "_meth_83DA" }, + { 0x83DB, "_meth_83DB" }, + { 0x83DC, "_meth_83DC" }, + { 0x83DD, "_meth_83DD" }, + { 0x83DE, "_meth_83DE" }, + { 0x83DF, "_meth_83DF" }, + { 0x83E0, "_meth_83E0" }, + { 0x83E1, "_meth_83E1" }, + { 0x83E2, "_meth_83E2" }, + { 0x83E3, "_meth_83E3" }, + { 0x83E4, "_meth_83E4" }, + { 0x83E5, "_meth_83E5" }, + { 0x83E6, "_meth_83E6" }, + { 0x83E7, "_meth_83E7" }, + { 0x83E8, "_meth_83E8" }, + { 0x83E9, "_meth_83E9" }, + { 0x83EA, "_meth_83EA" }, + { 0x83EB, "_meth_83EB" }, + { 0x83EC, "_meth_83EC" }, + { 0x83ED, "_meth_83ED" }, + { 0x83EE, "_meth_83EE" }, + { 0x83EF, "_meth_83EF" }, + { 0x83F0, "_meth_83F0" }, + { 0x83F1, "_meth_83F1" }, + { 0x83F2, "_meth_83F2" }, + { 0x83F3, "_meth_83F3" }, + { 0x83F4, "_meth_83F4" }, + { 0x83F5, "_meth_83F5" }, + { 0x83F6, "_meth_83F6" }, + { 0x83F7, "_meth_83F7" }, + { 0x83F8, "_meth_83F8" }, + { 0x83F9, "_meth_83F9" }, + { 0x83FA, "_meth_83FA" }, + { 0x83FB, "_meth_83FB" }, + { 0x83FC, "_meth_83FC" }, + { 0x83FD, "_meth_83FD" }, + { 0x83FE, "_meth_83FE" }, + { 0x83FF, "_meth_83FF" }, + { 0x8400, "_meth_8400" }, + { 0x8401, "_meth_8401" }, + { 0x8402, "_meth_8402" }, + { 0x8403, "_meth_8403" }, + { 0x8404, "_meth_8404" }, + { 0x8405, "_meth_8405" }, + { 0x8406, "_meth_8406" }, + { 0x8407, "_meth_8407" }, + { 0x8408, "_meth_8408" }, + { 0x8409, "_meth_8409" }, + { 0x840A, "_meth_840A" }, + { 0x840B, "_meth_840B" }, + { 0x840C, "_meth_840C" }, + { 0x840D, "_meth_840D" }, + { 0x840E, "_meth_840E" }, + { 0x840F, "_meth_840F" }, + { 0x8410, "_meth_8410" }, + { 0x8411, "_meth_8411" }, + { 0x8412, "_meth_8412" }, + { 0x8413, "_meth_8413" }, + { 0x8414, "_meth_8414" }, + { 0x8415, "_meth_8415" }, + { 0x8416, "_meth_8416" }, + { 0x8417, "_meth_8417" }, + { 0x8418, "_meth_8418" }, + { 0x8419, "_meth_8419" }, + { 0x841A, "_meth_841A" }, + { 0x841B, "_meth_841B" }, + { 0x841C, "_meth_841C" }, + { 0x841D, "_meth_841D" }, + { 0x841E, "_meth_841E" }, + { 0x841F, "_meth_841F" }, + { 0x8420, "_meth_8420" }, + { 0x8421, "_meth_8421" }, + { 0x8422, "_meth_8422" }, + { 0x8423, "_meth_8423" }, + { 0x8424, "_meth_8424" }, + { 0x8425, "_meth_8425" }, + { 0x8426, "_meth_8426" }, + { 0x8427, "_meth_8427" }, + { 0x8428, "_meth_8428" }, + { 0x8429, "_meth_8429" }, + { 0x842A, "_meth_842A" }, + { 0x842B, "_meth_842B" }, + { 0x842C, "_meth_842C" }, + { 0x842D, "_meth_842D" }, + { 0x842E, "_meth_842E" }, + { 0x842F, "_meth_842F" }, + { 0x8430, "_meth_8430" }, + { 0x8431, "_meth_8431" }, + { 0x8432, "_meth_8432" }, + { 0x8433, "_meth_8433" }, + { 0x8434, "_meth_8434" }, + { 0x8435, "_meth_8435" }, + { 0x8436, "_meth_8436" }, + { 0x8437, "_meth_8437" }, + { 0x8438, "_meth_8438" }, + { 0x8439, "_meth_8439" }, + { 0x843A, "_meth_843A" }, + { 0x843B, "_meth_843B" }, + { 0x843C, "_meth_843C" }, + { 0x843D, "_meth_843D" }, + { 0x843E, "_meth_843E" }, + { 0x843F, "_meth_843F" }, + { 0x8440, "_meth_8440" }, + { 0x8441, "_meth_8441" }, + { 0x8442, "_meth_8442" }, + { 0x8443, "_meth_8443" }, + { 0x8444, "_meth_8444" }, + { 0x8445, "_meth_8445" }, + { 0x8446, "_meth_8446" }, + { 0x8447, "_meth_8447" }, + { 0x8448, "_meth_8448" }, + { 0x8449, "_meth_8449" }, + { 0x844A, "_meth_844A" }, + { 0x844B, "_meth_844B" }, + { 0x844C, "_meth_844C" }, + { 0x844D, "_meth_844D" }, + { 0x844E, "_meth_844E" }, + { 0x844F, "_meth_844F" }, + { 0x8450, "_meth_8450" }, + { 0x8451, "_meth_8451" }, + { 0x8452, "_meth_8452" }, + { 0x8453, "_meth_8453" }, + { 0x8454, "_meth_8454" }, + { 0x8455, "_meth_8455" }, + { 0x8456, "_meth_8456" }, + { 0x8457, "_meth_8457" }, + { 0x8458, "_meth_8458" }, + { 0x8459, "_meth_8459" }, + { 0x845A, "_meth_845A" }, + { 0x845B, "_meth_845B" }, + { 0x845C, "_meth_845C" }, + { 0x845D, "_meth_845D" }, + { 0x845E, "_meth_845E" }, + { 0x845F, "_meth_845F" }, + { 0x8460, "_meth_8460" }, + { 0x8461, "_meth_8461" }, + { 0x8462, "_meth_8462" }, + { 0x8463, "_meth_8463" }, + { 0x8464, "_meth_8464" }, + { 0x8465, "_meth_8465" }, + { 0x8466, "_meth_8466" }, + { 0x8467, "_meth_8467" }, + { 0x8468, "_meth_8468" }, + { 0x8469, "_meth_8469" }, + { 0x846A, "_meth_846A" }, + { 0x846B, "_meth_846B" }, + { 0x846C, "_meth_846C" }, + { 0x846D, "_meth_846D" }, + { 0x846E, "_meth_846E" }, + { 0x846F, "_meth_846F" }, + { 0x8470, "_meth_8470" }, + { 0x8471, "_meth_8471" }, + { 0x8472, "_meth_8472" }, + { 0x8473, "_meth_8473" }, + { 0x8474, "_meth_8474" }, + { 0x8475, "_meth_8475" }, + { 0x8476, "_meth_8476" }, + { 0x8477, "_meth_8477" }, + { 0x8478, "_meth_8478" }, + { 0x8479, "_meth_8479" }, + { 0x847A, "_meth_847A" }, + { 0x847B, "_meth_847B" }, + { 0x847C, "_meth_847C" }, + { 0x847D, "_meth_847D" }, + { 0x847E, "_meth_847E" }, + { 0x847F, "_meth_847F" }, + { 0x8480, "_meth_8480" }, + { 0x8481, "_meth_8481" }, + { 0x8482, "_meth_8482" }, + { 0x8483, "_meth_8483" }, + { 0x8484, "_meth_8484" }, + { 0x8485, "_meth_8485" }, + { 0x8486, "_meth_8486" }, + { 0x8487, "_meth_8487" }, + { 0x8488, "_meth_8488" }, + { 0x8489, "_meth_8489" }, + { 0x848A, "_meth_848A" }, + { 0x848B, "_meth_848B" }, + { 0x848C, "_meth_848C" }, + { 0x848D, "_meth_848D" }, + { 0x848E, "_meth_848E" }, + { 0x848F, "_meth_848F" }, + { 0x8490, "_meth_8490" }, + { 0x8491, "_meth_8491" }, + { 0x8492, "_meth_8492" }, + { 0x8493, "_meth_8493" }, + { 0x8494, "_meth_8494" }, + { 0x8495, "_meth_8495" }, + { 0x8496, "_meth_8496" }, + { 0x8497, "_meth_8497" }, + { 0x8498, "_meth_8498" }, + { 0x8499, "_meth_8499" }, + { 0x849A, "_meth_849A" }, + { 0x849B, "_meth_849B" }, + { 0x849C, "_meth_849C" }, + { 0x849D, "_meth_849D" }, + { 0x849E, "_meth_849E" }, + { 0x849F, "_meth_849F" }, + { 0x84A0, "_meth_84A0" }, + { 0x84A1, "_meth_84A1" }, + { 0x84A2, "_meth_84A2" }, + { 0x84A3, "_meth_84A3" }, + { 0x84A4, "_meth_84A4" }, + { 0x84A5, "_meth_84A5" }, + { 0x84A6, "_meth_84A6" }, + { 0x84A7, "_meth_84A7" }, + { 0x84A8, "_meth_84A8" }, + { 0x84A9, "_meth_84A9" }, + { 0x84AA, "_meth_84AA" }, + { 0x84AB, "_meth_84AB" }, + { 0x84AC, "_meth_84AC" }, + { 0x84AD, "_meth_84AD" }, + { 0x84AE, "_meth_84AE" }, + { 0x84AF, "_meth_84AF" }, + { 0x84B0, "_meth_84B0" }, + { 0x84B1, "_meth_84B1" }, + { 0x84B2, "_meth_84B2" }, + { 0x84B3, "_meth_84B3" }, + { 0x84B4, "_meth_84B4" }, + { 0x84B5, "_meth_84B5" }, + { 0x84B6, "_meth_84B6" }, + { 0x84B7, "_meth_84B7" }, + { 0x84B8, "_meth_84B8" }, + { 0x84B9, "_meth_84B9" }, + { 0x84BA, "_meth_84BA" }, + { 0x84BB, "_meth_84BB" }, + { 0x84BC, "_meth_84BC" }, + { 0x84BD, "_meth_84BD" }, + { 0x84BE, "_meth_84BE" }, + { 0x84BF, "_meth_84BF" }, + { 0x84C0, "_meth_84C0" }, + { 0x84C1, "_meth_84C1" }, + { 0x84C2, "_meth_84C2" }, + { 0x84C3, "_meth_84C3" }, + { 0x84C4, "_meth_84C4" }, + { 0x84C5, "_meth_84C5" }, + { 0x84C6, "_meth_84C6" }, + { 0x84C7, "_meth_84C7" }, + { 0x84C8, "_meth_84C8" }, + { 0x84C9, "_meth_84C9" }, + { 0x84CA, "_meth_84CA" }, + { 0x84CB, "_meth_84CB" }, + { 0x84CC, "_meth_84CC" }, + { 0x84CD, "_meth_84CD" }, + { 0x84CE, "_meth_84CE" }, + { 0x84CF, "_meth_84CF" }, + { 0x84D0, "_meth_84D0" }, + { 0x84D1, "_meth_84D1" }, + { 0x84D2, "_meth_84D2" }, + { 0x84D3, "_meth_84D3" }, + { 0x84D4, "_meth_84D4" }, + { 0x84D5, "_meth_84D5" }, + { 0x84D6, "_meth_84D6" }, + { 0x84D7, "_meth_84D7" }, + { 0x84D8, "_meth_84D8" }, + { 0x84D9, "_meth_84D9" }, + { 0x84DA, "_meth_84DA" }, + { 0x84DB, "_meth_84DB" }, + { 0x84DC, "_meth_84DC" }, + { 0x84DD, "_meth_84DD" }, + { 0x84DE, "_meth_84DE" }, + { 0x84DF, "_meth_84DF" }, + { 0x84E0, "_meth_84E0" }, + { 0x84E1, "_meth_84E1" }, + { 0x84E2, "_meth_84E2" }, + { 0x84E3, "_meth_84E3" }, + { 0x84E4, "_meth_84E4" }, + { 0x84E5, "_meth_84E5" }, + { 0x84E6, "_meth_84E6" }, + { 0x84E7, "_meth_84E7" }, + { 0x84E8, "_meth_84E8" }, + { 0x84E9, "_meth_84E9" }, + { 0x84EA, "_meth_84EA" }, + { 0x84EB, "_meth_84EB" }, + { 0x84EC, "_meth_84EC" }, + { 0x84ED, "_meth_84ED" }, + { 0x84EE, "_meth_84EE" }, + { 0x84EF, "_meth_84EF" }, + { 0x84F0, "_meth_84F0" }, + { 0x84F1, "_meth_84F1" }, + { 0x84F2, "_meth_84F2" }, + { 0x84F3, "_meth_84F3" }, + { 0x84F4, "_meth_84F4" }, + { 0x84F5, "_meth_84F5" }, + { 0x84F6, "_meth_84F6" }, + { 0x84F7, "_meth_84F7" }, + { 0x84F8, "_meth_84F8" }, + { 0x84F9, "_meth_84F9" }, + { 0x84FA, "_meth_84FA" }, + { 0x84FB, "_meth_84FB" }, + { 0x84FC, "_meth_84FC" }, + { 0x84FD, "_meth_84FD" }, + { 0x84FE, "_meth_84FE" }, + { 0x84FF, "_meth_84FF" }, + { 0x8500, "_meth_8500" }, + { 0x8501, "_meth_8501" }, + { 0x8502, "_meth_8502" }, + { 0x8503, "_meth_8503" }, + { 0x8504, "_meth_8504" }, + { 0x8505, "_meth_8505" }, + { 0x8506, "_meth_8506" }, + { 0x8507, "_meth_8507" }, + { 0x8508, "_meth_8508" }, + { 0x8509, "_meth_8509" }, + { 0x850A, "_meth_850A" }, + { 0x850B, "_meth_850B" }, + { 0x850C, "_meth_850C" }, + { 0x850D, "_meth_850D" }, + { 0x850E, "_meth_850E" }, + { 0x850F, "_meth_850F" }, + { 0x8510, "_meth_8510" }, + { 0x8511, "_meth_8511" }, + { 0x8512, "_meth_8512" }, + { 0x8513, "_meth_8513" }, + { 0x8514, "_meth_8514" }, + { 0x8515, "_meth_8515" }, + { 0x8516, "_meth_8516" }, + { 0x8517, "_meth_8517" }, + { 0x8518, "_meth_8518" }, + { 0x8519, "_meth_8519" }, + { 0x851A, "_meth_851A" }, + { 0x851B, "_meth_851B" }, + { 0x851C, "_meth_851C" }, + { 0x851D, "_meth_851D" }, + { 0x851E, "_meth_851E" }, + { 0x851F, "_meth_851F" }, + { 0x8520, "_meth_8520" }, + { 0x8521, "_meth_8521" }, + { 0x8522, "_meth_8522" }, + { 0x8523, "_meth_8523" }, + { 0x8524, "_meth_8524" }, + { 0x8525, "_meth_8525" }, + { 0x8526, "_meth_8526" }, + { 0x8527, "_meth_8527" }, + { 0x8528, "_meth_8528" }, + { 0x8529, "_meth_8529" }, + { 0x852A, "_meth_852A" }, + { 0x852B, "_meth_852B" }, + { 0x852C, "_meth_852C" }, + { 0x852D, "_meth_852D" }, + { 0x852E, "_meth_852E" }, + { 0x852F, "_meth_852F" }, + { 0x8530, "_meth_8530" }, + { 0x8531, "_meth_8531" }, + { 0x8532, "_meth_8532" }, + { 0x8533, "_meth_8533" }, + { 0x8534, "_meth_8534" }, + { 0x8535, "_meth_8535" }, + { 0x8536, "_meth_8536" }, + { 0x8537, "_meth_8537" }, + { 0x8538, "_meth_8538" }, + { 0x8539, "_meth_8539" }, + { 0x853A, "_meth_853A" }, + { 0x853B, "_meth_853B" }, + { 0x853C, "_meth_853C" }, + { 0x853D, "_meth_853D" }, + { 0x853E, "_meth_853E" }, + { 0x853F, "_meth_853F" }, + { 0x8540, "_meth_8540" }, + { 0x8541, "_meth_8541" }, + { 0x8542, "_meth_8542" }, + { 0x8543, "_meth_8543" }, + { 0x8544, "_meth_8544" }, + { 0x8545, "_meth_8545" }, + { 0x8546, "_meth_8546" }, + { 0x8547, "_meth_8547" }, + { 0x8548, "_meth_8548" }, + { 0x8549, "_meth_8549" }, + { 0x854A, "_meth_854A" }, + { 0x854B, "_meth_854B" }, + { 0x854C, "_meth_854C" }, + { 0x854D, "_meth_854D" }, + { 0x854E, "_meth_854E" }, + { 0x854F, "_meth_854F" }, + { 0x8550, "_meth_8550" }, + { 0x8551, "_meth_8551" }, + { 0x8552, "_meth_8552" }, + { 0x8553, "_meth_8553" }, + { 0x8554, "_meth_8554" }, + { 0x8555, "_meth_8555" }, + { 0x8556, "_meth_8556" }, + { 0x8557, "_meth_8557" }, + { 0x8558, "_meth_8558" }, + { 0x8559, "_meth_8559" }, + { 0x855A, "_meth_855A" }, + { 0x855B, "_meth_855B" }, + { 0x855C, "_meth_855C" }, + { 0x855D, "_meth_855D" }, + { 0x855E, "_meth_855E" }, + { 0x855F, "_meth_855F" }, + { 0x8560, "_meth_8560" }, + { 0x8561, "_meth_8561" }, + { 0x8562, "_meth_8562" }, + { 0x8563, "_meth_8563" }, + { 0x8564, "_meth_8564" }, + { 0x8565, "_meth_8565" }, + { 0x8566, "_meth_8566" }, + { 0x8567, "_meth_8567" }, + { 0x8568, "_meth_8568" }, + { 0x8569, "_meth_8569" }, + { 0x856A, "_meth_856A" }, + { 0x856B, "_meth_856B" }, + { 0x856C, "_meth_856C" }, + { 0x856D, "_meth_856D" }, + { 0x856E, "_meth_856E" }, + { 0x856F, "_meth_856F" }, + { 0x8570, "_meth_8570" }, + { 0x8571, "_meth_8571" }, + { 0x8572, "_meth_8572" }, + { 0x8573, "_meth_8573" }, + { 0x8574, "_meth_8574" }, + { 0x8575, "_meth_8575" }, + { 0x8576, "_meth_8576" }, + { 0x8577, "_meth_8577" }, + { 0x8578, "_meth_8578" }, + { 0x8579, "_meth_8579" }, + { 0x857A, "_meth_857A" }, + { 0x857B, "_meth_857B" }, + { 0x857C, "_meth_857C" }, + { 0x857D, "_meth_857D" }, + { 0x857E, "_meth_857E" }, + { 0x857F, "_meth_857F" }, +}}; + +const std::array file_list +{{ + { 0, "DUMMY" }, +}}; + +const std::array token_list +{{ + { 0, "DUMMY" }, +}}; + +struct __init__ +{ + __init__() + { + static bool init = false; + if(init) return; + init = true; + + opcode_map.reserve(opcode_list.size()); + opcode_map_rev.reserve(opcode_list.size()); + function_map.reserve(function_list.size()); + function_map_rev.reserve(function_list.size()); + method_map.reserve(method_list.size()); + method_map_rev.reserve(method_list.size()); + file_map.reserve(file_list.size()); + file_map_rev.reserve(file_list.size()); + token_map.reserve(token_list.size()); + token_map_rev.reserve(token_list.size()); + + for(const auto& entry : opcode_list) + { + opcode_map.insert({ entry.key, entry.value }); + opcode_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : function_list) + { + function_map.insert({ entry.key, entry.value }); + function_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : method_list) + { + method_map.insert({ entry.key, entry.value }); + method_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : file_list) + { + file_map.insert({ entry.key, entry.value }); + file_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : token_list) + { + token_map.insert({ entry.key, entry.value }); + token_map_rev.insert({ utils::string::to_lower(entry.value), entry.key }); + } + } +}; + +__init__ _; + +} // namespace xsk::gsc::h1 diff --git a/src/h1/xsk/resolver.hpp b/src/h1/xsk/resolver.hpp new file mode 100644 index 00000000..d2fb26ac --- /dev/null +++ b/src/h1/xsk/resolver.hpp @@ -0,0 +1,33 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::h1 +{ + +class resolver +{ +public: + static auto opcode_id(const std::string& name) -> std::uint8_t; + static auto opcode_name(std::uint8_t id) -> std::string; + + static auto function_id(const std::string& name) -> std::uint16_t; + static auto function_name(std::uint16_t id) -> std::string; + + static auto method_id(const std::string& name) -> std::uint16_t; + static auto method_name(std::uint16_t id) -> std::string; + + static auto file_id(const std::string& name) -> std::uint16_t; + static auto file_name(std::uint16_t id) -> std::string; + + static auto token_id(const std::string& name) -> std::uint16_t; + static auto token_name(std::uint16_t id) -> std::string; + + static auto find_function(const std::string& name) -> bool; + static auto find_method(const std::string& name) -> bool; +}; + +} // namespace xsk::gsc::h1 diff --git a/src/h2/stdafx.cpp b/src/h2/stdafx.cpp new file mode 100644 index 00000000..0f0f08c2 --- /dev/null +++ b/src/h2/stdafx.cpp @@ -0,0 +1,6 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" diff --git a/src/h2/stdafx.hpp b/src/h2/stdafx.hpp new file mode 100644 index 00000000..d4f3dd6d --- /dev/null +++ b/src/h2/stdafx.hpp @@ -0,0 +1,38 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +// Warnings +#ifdef _WIN32 +#pragma warning(disable:4244) +#pragma warning(disable:4267) +#pragma warning(disable:4005) +#pragma warning(disable:4065) +#define _CRT_SECURE_NO_WARNINGS +#endif + +// C/C++ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Ext +using namespace std::literals; + +#include "xsk/h2.hpp" diff --git a/src/h2/xsk/assembler.cpp b/src/h2/xsk/assembler.cpp new file mode 100644 index 00000000..e328d9cd --- /dev/null +++ b/src/h2/xsk/assembler.cpp @@ -0,0 +1,604 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "h2.hpp" + +namespace xsk::gsc::h2 +{ + +auto assembler::output_script() -> std::vector +{ + std::vector script; + + if(script_ == nullptr) return script; + + script.resize(script_->pos()); + memcpy(script.data(), script_->buffer().data(), script.size()); + + return script; +} + +auto assembler::output_stack() -> std::vector +{ + std::vector stack; + + if(stack_ == nullptr) return stack; + + stack.resize(stack_->pos()); + memcpy(stack.data(), stack_->buffer().data(), stack.size()); + + return stack; +} + +void assembler::assemble(const std::string& file, std::vector& data) +{ + std::vector assembly = utils::string::clean_buffer_lines(data); + std::vector functions; + gsc::function_ptr func = nullptr; + std::uint32_t index = 1; + std::uint16_t switchnum = 0; + + for (auto& line : assembly) + { + if (line == "" || line.substr(0, 2) == "//") + { + continue; + } + else if (line.substr(0, 4) == "sub_") + { + func = std::make_unique(); + func->index = index; + func->name = line.substr(4); + } + else if (line.substr(0, 4) == "end_") + { + if (func != nullptr) + { + func->size = index - func->index; + functions.push_back(std::move(func)); + } + } + else if (line.substr(0, 4) == "loc_") + { + func->labels[index] = line; + } + else + { + auto data = utils::string::parse_code(line); + + if (switchnum) + { + if (data[0] == "case" || data[0] == "default") + { + for (auto& entry : data) + { + func->instructions.back()->data.push_back(entry); + } + switchnum--; + continue; + } + + throw gsc::asm_error("invalid instruction inside endswitch \""s + line + "\"!"); + } + else + { + auto inst = std::make_unique(); + inst->index = index; + inst->opcode = static_cast(resolver::opcode_id(data[0])); + inst->size = opcode_size(inst->opcode); + data.erase(data.begin()); + inst->data = std::move(data); + + if (opcode(inst->opcode) == opcode::OP_endswitch) + { + switchnum = static_cast(std::stoul(inst->data[0])); + inst->size += 7 * switchnum; + } + + index += inst->size; + func->instructions.push_back(std::move(inst)); + } + } + } + + this->assemble(file, functions); +} + +void assembler::assemble(const std::string& file, std::vector& functions) +{ + script_ = std::make_unique(0x100000); + stack_ = std::make_unique(0x100000); + filename_ = file; + functions_ = std::move(functions); + + script_->write(static_cast(opcode::OP_End)); + stack_->write(0x69773630); + + for (const auto& func : functions_) + { + this->assemble_function(func); + } +} + +void assembler::assemble_function(const gsc::function_ptr& func) +{ + labels_ = func->labels; + + stack_->write(func->size); + + func->id = func->name.substr(0, 3) == "_ID" ? std::stoul(func->name.substr(3)) : resolver::token_id(func->name); + stack_->write(func->id); + + if (func->id == 0) + { + stack_->write_c_string(func->name); + } + + for (const auto& inst : func->instructions) + { + this->assemble_instruction(inst); + } +} + +void assembler::assemble_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_Return: + case opcode::OP_BoolNot: + case opcode::OP_CastBool: + case opcode::OP_inequality: + case opcode::OP_GetThisthread: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_checkclearparams: + case opcode::OP_CastFieldObject: + case opcode::OP_End: + case opcode::OP_size: + case opcode::OP_EmptyArray: + case opcode::OP_bit_and: + case opcode::OP_less_equal: + case opcode::OP_voidCodepos: + case opcode::OP_ClearVariableField: + case opcode::OP_divide: + case opcode::OP_GetSelf: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_plus: + case opcode::OP_BoolComplement: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_inc: + case opcode::OP_clearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_endon: + case opcode::OP_greater_equal: + case opcode::OP_GetSelfObject: + case opcode::OP_SetVariableField: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_less: + case opcode::OP_GetGameRef: + case opcode::OP_waitFrame: + case opcode::OP_waittillFrameEnd: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_notify: + case opcode::OP_DecTop: + case opcode::OP_shift_left: + case opcode::OP_greater: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_minus: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_multiply: + case opcode::OP_mod: + case opcode::OP_GetGame: + case opcode::OP_waittill: + case opcode::OP_dec: + case opcode::OP_PreScriptCall: + case opcode::OP_GetAnim: + case opcode::OP_GetUndefined: + case opcode::OP_GetAnimObject: + case opcode::OP_GetLevelObject: + case opcode::OP_bit_ex_or: + case opcode::OP_equality: + case opcode::OP_ClearArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalArray: + case opcode::OP_vector: + case opcode::OP_bit_or: + case opcode::OP_AddArray: + case opcode::OP_waittillmatch2: + case opcode::OP_shift_right: + script_->write(static_cast(inst->opcode)); + break; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetInteger: + script_->write(static_cast(inst->opcode)); + script_->write(std::stoi(inst->data[0])); + break; + case opcode::OP_GetFloat: + script_->write(static_cast(inst->opcode)); + script_->write(std::stof(inst->data[0])); + break; + case opcode::OP_GetVector: + script_->write(static_cast(inst->opcode)); + script_->write(std::stof(inst->data[0])); + script_->write(std::stof(inst->data[1])); + script_->write(std::stof(inst->data[2])); + break; + case opcode::OP_GetString: + case opcode::OP_GetIString: + script_->write(static_cast(inst->opcode)); + script_->write(0); + stack_->write_c_string(utils::string::to_code(inst->data[0])); + break; + case opcode::OP_GetAnimation: + script_->write(static_cast(inst->opcode)); + script_->write(0); + script_->write(0); + stack_->write_c_string(utils::string::unquote(inst->data[0])); + stack_->write_c_string(utils::string::unquote(inst->data[1])); + break; + case opcode::OP_GetAnimTree: + script_->write(static_cast(inst->opcode)); + script_->write(0); + stack_->write_c_string(utils::string::unquote(inst->data[0])); + break; + case opcode::OP_waittillmatch: + script_->write(static_cast(inst->opcode)); + script_->write(0); + break; + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_EvalLocalArrayCached: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + this->assemble_field_variable(inst); + break; + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + this->assemble_local_call(inst, false); + break; + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + this->assemble_local_call(inst, true); + break; + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + this->assemble_far_call(inst, false); + break; + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + this->assemble_far_call(inst, true); + break; + case opcode::OP_CallBuiltin: + this->assemble_builtin_call(inst, false, true); + break; + case opcode::OP_CallBuiltinMethod: + this->assemble_builtin_call(inst, true, true); + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + this->assemble_builtin_call(inst, false, false); + break; + case opcode::OP_GetBuiltinMethod: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + this->assemble_builtin_call(inst, true, false); + break; + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + this->assemble_jump(inst, true, false); + break; + case opcode::OP_jumpback: + this->assemble_jump(inst, false, true); + break; + case opcode::OP_jump: + this->assemble_jump(inst, false, false); + break; + case opcode::OP_switch: + this->assemble_switch(inst); + break; + case opcode::OP_endswitch: + this->assemble_end_switch(inst); + break; + default: + throw gsc::asm_error(utils::string::va("Unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); + } +} + +void assembler::assemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num) +{ + script_->write(static_cast(inst->opcode)); + + std::uint16_t id = 0; + + if (arg_num) + { + script_->write(static_cast(std::stol(inst->data[0]))); + + if (method) + id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::method_id(inst->data[1]); + else + id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::function_id(inst->data[1]); + } + else + { + if (method) + id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::method_id(inst->data[0]); + else + id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::function_id(inst->data[0]); + } + + script_->write(id); +} + +void assembler::assemble_local_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_function(inst->data[0]); + + std::int32_t offset = addr - inst->index - 1; + + this->assemble_offset(offset); + + if (thread) + { + script_->write(static_cast(std::stol(inst->data[1]))); + } +} + +void assembler::assemble_far_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->write(static_cast(inst->opcode)); + script_->write(0); + script_->write(0); + + std::uint16_t file_id = 0; + std::uint16_t func_id = 0; + + if (thread) + { + script_->write(static_cast(std::stol(inst->data[0]))); + + file_id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::file_id(inst->data[1]); + func_id = inst->data[2].substr(0, 3) == "_ID" ? std::stol(inst->data[2].substr(3)) : resolver::token_id(inst->data[2]); + } + else + { + file_id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::file_id(inst->data[0]); + func_id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::token_id(inst->data[1]); + } + + stack_->write(file_id); + if (file_id == 0) stack_->write_c_string(thread ? inst->data[1] : inst->data[0]); + stack_->write(func_id); + if (func_id == 0) stack_->write_c_string(thread ? inst->data[2] : inst->data[1]); +} + +void assembler::assemble_switch(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_label(inst->data[0]); + + script_->write(addr - inst->index - 4); +} + +void assembler::assemble_end_switch(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::uint16_t casenum = 0; + + if (utils::string::is_number(inst->data[0])) + { + casenum = std::stol(inst->data[0]); + } + else + { + throw gsc::asm_error("invalid endswitch number!"); + } + + script_->write(casenum); + + std::uint32_t internal_index = inst->index + 3; + + for (std::uint16_t i = 0; i < casenum; i++) + { + if (inst->data[1 + (3 * i)] == "case") + { + if (utils::string::is_number(inst->data[1 + (3 * i) + 1])) + { + script_->write((std::stol(inst->data[1 + (3 * i) + 1]) & 0xFFFFFF) + 0x800000); + } + else + { + script_->write(i + 1); + stack_->write_c_string(utils::string::unquote(inst->data[1 + (3 * i) + 1])); + } + + internal_index += 4; + + std::int32_t addr = this->resolve_label(inst->data[1 + (3 * i) + 2]); + + this->assemble_offset(addr - internal_index); + + internal_index += 3; + } + else if (inst->data[1 + (3 * i)] == "default") + { + script_->write(0); + stack_->write_c_string("\x01"); + + internal_index += 4; + std::int32_t addr = this->resolve_label(inst->data[1 + (3 * i) + 1]); + + this->assemble_offset(addr - internal_index); + + internal_index += 3; + } + } +} + +void assembler::assemble_field_variable(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::uint16_t field_id = 0; + + if (inst->data[0].substr(0, 3) == "_ID") + { + field_id = (std::uint16_t)std::stol(inst->data[0].substr(3)); + } + else + { + field_id = resolver::token_id(inst->data[0]); + + if (field_id == 0) + { + field_id = 0xFFFF; + } + } + + script_->write(field_id); + + if (field_id > 0xD5D7) + { + stack_->write(0); + stack_->write_c_string(inst->data[0]); + } +} + +void assembler::assemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_label(inst->data[0]); + + if (expr) + { + script_->write(addr - inst->index - 3); + } + else if (back) + { + script_->write((inst->index + 3) - addr); + } + else + { + script_->write(addr - inst->index - 5); + } +} + +void assembler::assemble_offset(std::int32_t offset) +{ + std::array bytes = {}; + + offset = (offset << 10) >> 8; + + *reinterpret_cast(bytes.data()) = offset; + + script_->write(bytes[0]); + script_->write(bytes[1]); + script_->write(bytes[2]); +} + +auto assembler::resolve_function(const std::string& name) -> std::uint32_t +{ + auto temp = name.substr(0, 4) == "sub_" ? name.substr(4) : name; + + for (const auto& func : functions_) + { + if (func->name == temp) + { + return func->index; + } + } + + throw gsc::asm_error("Couldn't resolve local function address of '" + temp + "'!"); +} + +auto assembler::resolve_label(const std::string& name) -> std::uint32_t +{ + for (auto& func : labels_) + { + if (func.second == name) + { + return func.first; + } + } + + throw gsc::asm_error("Couldn't resolve label address of '" + name + "'!"); +} + +} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/assembler.hpp b/src/h2/xsk/assembler.hpp new file mode 100644 index 00000000..887f6306 --- /dev/null +++ b/src/h2/xsk/assembler.hpp @@ -0,0 +1,40 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::h2 +{ + +class assembler : public gsc::assembler +{ + std::string filename_; + utils::byte_buffer_ptr script_; + utils::byte_buffer_ptr stack_; + std::vector functions_; + std::unordered_map labels_; + +public: + auto output_script() -> std::vector; + auto output_stack() -> std::vector; + void assemble(const std::string& file, std::vector& data); + void assemble(const std::string& file, std::vector& functions); + +private: + void assemble_function(const gsc::function_ptr& func); + void assemble_instruction(const gsc::instruction_ptr& inst); + void assemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num); + void assemble_local_call(const gsc::instruction_ptr& inst, bool thread); + void assemble_far_call(const gsc::instruction_ptr& inst, bool thread); + void assemble_switch(const gsc::instruction_ptr& inst); + void assemble_end_switch(const gsc::instruction_ptr& inst); + void assemble_field_variable(const gsc::instruction_ptr& inst); + void assemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back); + void assemble_offset(std::int32_t offset); + auto resolve_function(const std::string& name) -> std::uint32_t; + auto resolve_label(const std::string& name) -> std::uint32_t; +}; + +} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/compiler.cpp b/src/h2/xsk/compiler.cpp new file mode 100644 index 00000000..8f8ce90f --- /dev/null +++ b/src/h2/xsk/compiler.cpp @@ -0,0 +1,2295 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "h2.hpp" +#include "parser.hpp" +#include "lexer.hpp" + +namespace xsk::gsc::h2 +{ + +auto compiler::output() -> std::vector +{ + return std::move(assembly_); +} + +void compiler::compile(const std::string& file, std::vector& data) +{ + filename_ = file; + + auto result = parse_buffer(filename_, data); + + compile_program(result); +} + +void compiler::set_readf_callback(std::function(const std::string&)> func) +{ + callback_readf_ = func; +} + +auto compiler::parse_buffer(const std::string& file, std::vector& data) -> gsc::program_ptr +{ + yyscan_t scanner; + gsc::location loc; + gsc::program_ptr result(nullptr); + + loc.initialize(&file); + // Add the two NULL terminators, required by flex. + data.push_back(0); + data.push_back(0); + + if (h2_lex_init(&scanner)) + exit(1); + + YY_BUFFER_STATE yybuffer = h2__scan_buffer(reinterpret_cast(data.data()), data.size(), scanner); + + parser parser(scanner, loc, result); + + if(parser.parse() || result == nullptr) + { + throw gsc::comp_error(loc, "An unknown error ocurred while parsing gsc file."); + } + + h2__delete_buffer(yybuffer, scanner); + h2_lex_destroy(scanner); + + return result; +} + +auto compiler::parse_file(const std::string& file) -> gsc::program_ptr +{ + auto buffer = callback_readf_(file); + auto result = parse_buffer(file, buffer); + + return result; +} + +void compiler::compile_program(const gsc::program_ptr& program) +{ + assembly_.clear(); + includes_.clear(); + animtrees_.clear(); + constants_.clear(); + local_functions_.clear(); + index_ = 1; + + for(const auto& def : program->definitions) + { + if(def.as_node->type == gsc::node_t::thread) + { + local_functions_.push_back(def.as_thread->name->value); + } + } + + for(const auto& include : program->includes) + { + emit_include(include); + } + + for(const auto& def : program->definitions) + { + emit_define(def); + } + +#ifdef DEBUG_GSC_COMPILER + print_debug_info(); +#endif +} + +void compiler::emit_include(const gsc::include_ptr& include) +{ + const auto& path = include->file->value; + + for(const auto& inc : includes_) + { + if(inc.name == path) + { + throw gsc::comp_error(include->loc, "error duplicated include file '" + path + "'."); + } + } + + if(map_known_includes(path)) return; + + try + { + auto program = parse_file(path); + + std::vector funcs; + + for(const auto& def : program->definitions) + { + if(def.as_node->type == gsc::node_t::thread) + { + funcs.push_back(def.as_thread->name->value); + } + } + + if(funcs.size() == 0) + { + throw gsc::comp_error(include->loc, "error empty include file '" + path + "'."); + } + + includes_.push_back(include_t(path, funcs)); + } + catch(const std::exception& e) + { + throw gsc::comp_error(include->loc, "error parsing include file '" + path + "': " + e.what()); + } +} + +void compiler::emit_define(const gsc::define_ptr& define) +{ + switch(define.as_node->type) + { + case gsc::node_t::usingtree: emit_usingtree(define.as_usingtree); break; + case gsc::node_t::constant: emit_constant(define.as_constant); break; + case gsc::node_t::thread: emit_thread(define.as_thread); break; + default: break; + } +} + +void compiler::emit_usingtree(const gsc::usingtree_ptr& animtree) +{ + animtrees_.push_back({ animtree->animtree->value, false }); +} + +void compiler::emit_constant(const gsc::constant_ptr& constant) +{ + constants_.insert({ constant->name->value, std::move(constant->value) }); +} + +void compiler::emit_thread(const gsc::thread_ptr& thread) +{ + function_ = std::make_unique(); + function_->index = index_; + function_->name = thread->name->value; + + auto ctx = std::make_unique(); + stack_idx_ = 0; + label_idx_ = 0; + can_break_ = false; + can_continue_ = false; + local_stack_.clear(); + break_ctxs_.clear(); + continue_ctxs_.clear(); + + process_thread(ctx, thread); + + emit_parameters(ctx, thread->params); + emit_stmt_list(ctx, thread->block, true); + emit_opcode(ctx, opcode::OP_End); + + function_->size = index_ - function_->index; + assembly_.push_back(std::move(function_)); +} + +void compiler::emit_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + initialize_variable(ctx, param); + emit_opcode(ctx, opcode::OP_SafeCreateVariableFieldCached, variable_create_index(ctx, param)); + } + + emit_opcode(ctx, opcode::OP_checkclearparams); +} + +void compiler::emit_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt, bool last) +{ + switch(stmt.as_node->type) + { + case gsc::node_t::stmt_list: emit_stmt_list(ctx, stmt.as_list, last); break; + case gsc::node_t::stmt_call: emit_stmt_call(ctx, stmt.as_call); break; + case gsc::node_t::stmt_assign: emit_stmt_assign(ctx, stmt.as_assign); break; + case gsc::node_t::stmt_endon: emit_stmt_endon(ctx, stmt.as_endon); break; + case gsc::node_t::stmt_notify: emit_stmt_notify(ctx, stmt.as_notify); break; + case gsc::node_t::stmt_wait: emit_stmt_wait(ctx, stmt.as_wait); break; + case gsc::node_t::stmt_waittill: emit_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_waittillmatch: emit_stmt_waittillmatch(ctx, stmt.as_waittillmatch); break; + case gsc::node_t::stmt_waittillframeend: emit_stmt_waittillframeend(ctx, stmt.as_waittillframeend); break; + case gsc::node_t::stmt_waitframe: emit_stmt_waitframe(ctx, stmt.as_waitframe); break; + case gsc::node_t::stmt_if: emit_stmt_if(ctx, stmt.as_if, last); break; + case gsc::node_t::stmt_ifelse: emit_stmt_ifelse(ctx, stmt.as_ifelse, last); break; + case gsc::node_t::stmt_while: emit_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: emit_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: emit_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: emit_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_case: emit_stmt_case(ctx, stmt.as_case); break; + case gsc::node_t::stmt_default: emit_stmt_default(ctx, stmt.as_default); break; + case gsc::node_t::stmt_break: emit_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_continue: emit_stmt_continue(ctx, stmt.as_continue); break; + case gsc::node_t::stmt_return: emit_stmt_return(ctx, stmt.as_return); break; + default: break; + } +} + +void compiler::emit_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt, bool last) +{ + for (const auto& entry : stmt->stmts) + { + bool last_ = (&entry == &stmt->stmts.back() && last) ? true : false; + emit_stmt(ctx, entry, last_); + } +} + +void compiler::emit_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt) +{ + if(stmt->expr->func.as_node->type == gsc::node_t::expr_call_function) + { + const auto& name = stmt->expr->func.as_func->name->value; + + if(name == "assert" || name == "assertex" || name == "assertmsg") return; + } + + emit_expr_call(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_DecTop); +} + +void compiler::emit_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt) +{ + emit_expr_assign(ctx, stmt->expr); +} + +void compiler::emit_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_endon); +} + +void compiler::emit_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt) +{ + emit_opcode(ctx, opcode::OP_voidCodepos); + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + emit_expr(ctx, arg); + } + + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_notify); +} + +void compiler::emit_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_wait); +} + +void compiler::emit_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_waittill); + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + create_variable(ctx, arg.as_name); + emit_opcode(ctx, opcode::OP_SafeSetWaittillVariableFieldCached, variable_access_index(ctx, arg.as_name)); + } + + emit_opcode(ctx, opcode::OP_clearparams); +} + +void compiler::emit_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt) +{ + emit_expr_arguments(ctx, stmt->args); + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_waittillmatch); + emit_opcode(ctx, opcode::OP_clearparams); +} + +void compiler::emit_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt) +{ + emit_opcode(ctx, opcode::OP_waittillFrameEnd); +} + +void compiler::emit_stmt_waitframe(const gsc::context_ptr& ctx, const gsc::stmt_waitframe_ptr& stmt) +{ + emit_opcode(ctx, opcode::OP_waitFrame); +} + +void compiler::emit_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt, bool last) +{ + auto end_loc = create_label(); + + if(stmt->expr.as_node->type == gsc::node_t::expr_not) + { + emit_expr(ctx, stmt->expr.as_not->rvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrue, end_loc); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, end_loc); + } + + ctx->transfer(stmt->ctx); + stmt->ctx->is_last = last; + + emit_stmt(stmt->ctx, stmt->stmt, last); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_remove_local_vars(stmt->ctx); + + insert_label(end_loc); +} + +void compiler::emit_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt, bool last) +{ + std::vector childs; + auto else_loc = create_label(); + auto end_loc = create_label(); + + if(stmt->expr.as_node->type == gsc::node_t::expr_not) + { + emit_expr(ctx, stmt->expr.as_not->rvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrue, else_loc); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, else_loc); + } + + ctx->transfer(stmt->ctx_if); + stmt->ctx_if->is_last = last; + + emit_stmt(stmt->ctx_if, stmt->stmt_if, last); + + emit_remove_local_vars(stmt->ctx_if); + + if(stmt->ctx_if->abort == abort_t::abort_none) + childs.push_back(stmt->ctx_if.get()); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_opcode(ctx, opcode::OP_jump, end_loc); + + insert_label(else_loc); + + ctx->transfer(stmt->ctx_else); + stmt->ctx_else->is_last = last; + + emit_stmt(stmt->ctx_else, stmt->stmt_else, last); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_remove_local_vars(stmt->ctx_else); + + if(stmt->ctx_else->abort == abort_t::abort_none) + childs.push_back(stmt->ctx_else.get()); + + insert_label(end_loc); + + ctx->init_from_child(childs); +} + +void compiler::emit_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = true; + can_continue_ = true; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + + auto begin_loc = insert_label(); + + bool const_cond = is_constant_condition(stmt->expr); + + if(!const_cond) + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + } + + emit_stmt(stmt->ctx, stmt->stmt, false); + + insert_label(continue_loc); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + + if(const_cond) + ctx->init_from_child(break_ctxs_); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = false; + can_continue_ = false; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + emit_stmt(ctx, stmt->pre_expr, false); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + ctx->transfer(stmt->ctx_post); + + auto begin_loc = insert_label(); + + bool const_cond = is_constant_condition(stmt->expr); + + if(!const_cond) + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + } + + can_break_ = true; + can_continue_ = true; + + emit_stmt(stmt->ctx, stmt->stmt, false); + + if(stmt->ctx->abort == abort_t::abort_none) + continue_ctxs_.push_back(stmt->ctx.get()); + + can_break_ = false; + can_continue_ = false; + + insert_label(continue_loc); + + stmt->ctx_post->init_from_child(continue_ctxs_); + + emit_stmt(stmt->ctx_post, stmt->post_expr, false); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + + if(const_cond) + ctx->init_from_child(break_ctxs_); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = false; + can_continue_ = false; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + emit_expr(ctx, stmt->array_expr); + emit_variable_ref(ctx, stmt->array, true); + emit_variable(ctx, stmt->array); + emit_opcode(ctx, opcode::OP_CallBuiltin1, "getfirstarraykey"); + emit_variable_ref(ctx, stmt->key_expr, true); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + + ctx->transfer(stmt->ctx_post); + + auto begin_loc = insert_label(); + + emit_variable(ctx, stmt->key_expr); + emit_opcode(ctx, opcode::OP_CallBuiltin1, "isdefined"); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + + can_break_ = true; + can_continue_ = true; + + emit_variable(stmt->ctx, stmt->key_expr); + emit_opcode(stmt->ctx, opcode::OP_EvalLocalArrayCached, variable_access_index(stmt->ctx, stmt->array.as_name)); + emit_variable_ref(stmt->ctx, stmt->value_expr, true); + emit_stmt(stmt->ctx, stmt->stmt, false); + + if(stmt->ctx->abort == abort_t::abort_none) + continue_ctxs_.push_back(stmt->ctx.get()); + + can_break_ = false; + can_continue_ = false; + + insert_label(continue_loc); + + stmt->ctx_post->init_from_child(continue_ctxs_); + + emit_variable(stmt->ctx_post, stmt->key_expr); + emit_variable(stmt->ctx_post, stmt->array); + emit_opcode(stmt->ctx_post, opcode::OP_CallBuiltin2, "getnextarraykey"); + emit_variable_ref(stmt->ctx_post, stmt->key_expr, true); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + emit_clear_local_variable(ctx, stmt->array.as_name); + if(!stmt->use_key) emit_clear_local_variable(ctx, stmt->key_expr.as_name); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_break = can_break_; + break_ctxs_.clear(); + can_break_ = false; + + auto jmptable_loc = create_label(); + auto break_loc = create_label(); + + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_switch, jmptable_loc); + + can_break_ = true; + + std::vector data; + data.push_back(utils::string::va("%d", stmt->stmt->stmts.size())); + + bool has_default = false; + gsc::context* default_ctx = nullptr; + + for(auto i = 0; i < stmt->stmt->stmts.size(); i++) + { + auto& entry = stmt->stmt->stmts[i]; + + if(entry.as_node->type == gsc::node_t::stmt_case) + { + auto& case_ = entry.as_case; + if(case_->value.as_node->type == gsc::node_t::data_integer) + { + auto loc = insert_label(); + data.push_back("case"); + data.push_back(case_->value.as_integer->value); + data.push_back(loc); + } + else if(case_->value.as_node->type == gsc::node_t::data_string) + { + auto loc = insert_label(); + data.push_back("case"); + data.push_back(case_->value.as_string->value); + data.push_back(loc); + } + else + { + throw gsc::comp_error(stmt->loc, "case type must be int or string"); + } + + ctx->transfer(case_->ctx); + case_->ctx->loc_break = break_loc; + emit_stmt_list(case_->ctx, case_->stmt, false); + if(case_->stmt->stmts.size() > 0) + emit_remove_local_vars(case_->ctx); + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + auto loc = insert_label(); + data.push_back("default"); + data.push_back(loc); + + has_default = true; + default_ctx = entry.as_default->ctx.get(); + + ctx->transfer(entry.as_default->ctx); + entry.as_default->ctx->loc_break = break_loc; + emit_stmt_list(entry.as_default->ctx, entry.as_default->stmt, false); + if(entry.as_default->stmt->stmts.size() > 0) + emit_remove_local_vars(entry.as_default->ctx); + } + else + { + throw gsc::comp_error(entry.as_node->loc, "missing case statement"); + } + } + + if(has_default) + { + if(default_ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(default_ctx); + } + ctx->init_from_child(break_ctxs_); + } + + insert_label(jmptable_loc); + + emit_opcode(ctx, opcode::OP_endswitch, data); + + auto offset = 7 * stmt->stmt->stmts.size(); + function_->instructions.back()->size += offset; + index_ += offset; + + insert_label(break_loc); + + can_break_ = old_break; + break_ctxs_ = old_breaks; +} + +void compiler::emit_stmt_case(const gsc::context_ptr& ctx, const gsc::stmt_case_ptr& stmt) +{ + throw gsc::comp_error(stmt->loc, "illegal case statement"); +} + +void compiler::emit_stmt_default(const gsc::context_ptr& ctx, const gsc::stmt_default_ptr& stmt) +{ + throw gsc::comp_error(stmt->loc, "illegal default statement"); +} + +void compiler::emit_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + if(can_break_ && ctx->abort == abort_t::abort_none && ctx->loc_break != "") + { + break_ctxs_.push_back(ctx.get()); + emit_remove_local_vars(ctx); + ctx->abort = abort_t::abort_break; + emit_opcode(ctx, opcode::OP_jump, ctx->loc_break); + } + else + { + throw gsc::comp_error(stmt->loc, "illegal break statement"); + } +} + +void compiler::emit_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt) +{ + if(can_break_ && ctx->abort == abort_t::abort_none && ctx->loc_continue != "") + { + continue_ctxs_.push_back(ctx.get()); + emit_remove_local_vars(ctx); + ctx->abort = abort_t::abort_continue; + emit_opcode(ctx, opcode::OP_jump, ctx->loc_continue); + } + else + { + throw gsc::comp_error(stmt->loc, "illegal continue statement"); + } +} + +void compiler::emit_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + ctx->abort = abort_t::abort_return; + } + + if(stmt->expr.as_node->type == gsc::node_t::null) + { + emit_opcode(ctx, opcode::OP_End); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_Return); + } +} + +void compiler::emit_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_and: emit_expr_and(ctx, expr.as_and); break; + case gsc::node_t::expr_or: emit_expr_or(ctx, expr.as_or); break; + case gsc::node_t::expr_equality: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_inequality: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less_equal: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater_equal: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_or: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_and: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_exor: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_left: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_right: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_add: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_sub: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mult: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_div: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mod: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_complement: emit_expr_complement(ctx, expr.as_complement); break; + case gsc::node_t::expr_not: emit_expr_not(ctx, expr.as_not); break; + case gsc::node_t::expr_call: emit_expr_call(ctx, expr.as_call); break; + case gsc::node_t::expr_function: emit_expr_function(ctx, expr.as_function); break; + case gsc::node_t::expr_add_array: emit_expr_add_array(ctx, expr.as_add_array); break; + case gsc::node_t::expr_array: emit_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: emit_field_variable(ctx, expr.as_field); break; + case gsc::node_t::expr_size: emit_expr_size(ctx, expr.as_size); break; + case gsc::node_t::data_thisthread: emit_opcode(ctx, opcode::OP_GetThisthread); break; + case gsc::node_t::data_empty_array: emit_opcode(ctx, opcode::OP_EmptyArray); break; + case gsc::node_t::data_undefined: emit_opcode(ctx, opcode::OP_GetUndefined); break; + case gsc::node_t::data_game: emit_opcode(ctx, opcode::OP_GetGame); break; + case gsc::node_t::data_self: emit_opcode(ctx, opcode::OP_GetSelf); break; + case gsc::node_t::data_anim: emit_opcode(ctx, opcode::OP_GetAnim); break; + case gsc::node_t::data_level: emit_opcode(ctx, opcode::OP_GetLevel); break; + case gsc::node_t::data_animation: emit_animation(ctx, expr.as_animation); break; + case gsc::node_t::data_animtree: emit_animtree(ctx, expr.as_animtree); break; + case gsc::node_t::data_name: emit_local_variable(ctx, expr.as_name); break; + case gsc::node_t::data_istring: emit_istring(ctx, expr.as_istring); break; + case gsc::node_t::data_string: emit_string(ctx, expr.as_string); break; + case gsc::node_t::data_vector: emit_vector(ctx, expr.as_vector); break; + case gsc::node_t::data_float: emit_float(ctx, expr.as_float); break; + case gsc::node_t::data_integer: emit_integer(ctx, expr.as_integer); break; + case gsc::node_t::data_false: emit_false(ctx, expr.as_false); break; + case gsc::node_t::data_true: emit_true(ctx, expr.as_true); break; + default: throw gsc::comp_error(expr.as_node->loc, "unknown expression"); break; + } +} + +void compiler::emit_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr) +{ + if(expr->type == gsc::node_t::expr_increment) + { + emit_variable_ref(ctx, expr->lvalue, false); + emit_opcode(ctx, opcode::OP_inc); + emit_opcode(ctx, opcode::OP_SetVariableField); + } + else if(expr->type == gsc::node_t::expr_decrement) + { + emit_variable_ref(ctx, expr->lvalue, false); + emit_opcode(ctx, opcode::OP_dec); + emit_opcode(ctx, opcode::OP_SetVariableField); + } + else if(expr->type == gsc::node_t::expr_assign_equal) + { + if(expr->rvalue.as_node->type == gsc::node_t::data_undefined) + { + emit_expr_clear_variable(ctx, expr->lvalue); + } + else + { + emit_expr(ctx, expr->rvalue); + emit_variable_ref(ctx, expr->lvalue, true); + } + } + else + { + emit_expr(ctx, expr->lvalue); + emit_expr(ctx, expr->rvalue); + + switch(expr->type) + { + case gsc::node_t::expr_assign_add: emit_opcode(ctx, opcode::OP_plus); break; + case gsc::node_t::expr_assign_sub: emit_opcode(ctx, opcode::OP_minus); break; + case gsc::node_t::expr_assign_mult: emit_opcode(ctx, opcode::OP_multiply); break; + case gsc::node_t::expr_assign_div: emit_opcode(ctx, opcode::OP_divide); break; + case gsc::node_t::expr_assign_mod: emit_opcode(ctx, opcode::OP_mod); break; + case gsc::node_t::expr_assign_shift_left: emit_opcode(ctx, opcode::OP_shift_left); break; + case gsc::node_t::expr_assign_shift_right: emit_opcode(ctx, opcode::OP_shift_right); break; + case gsc::node_t::expr_assign_bitwise_or: emit_opcode(ctx, opcode::OP_bit_or); break; + case gsc::node_t::expr_assign_bitwise_and: emit_opcode(ctx, opcode::OP_bit_and); break; + case gsc::node_t::expr_assign_bitwise_exor: emit_opcode(ctx, opcode::OP_bit_ex_or); break; + default: throw gsc::comp_error(expr->loc, "unknown assign operation"); break; + } + + emit_variable_ref(ctx, expr->lvalue, true); + } +} + +void compiler::emit_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr) +{ + emit_expr(ctx, expr->lvalue); + emit_expr(ctx, expr->rvalue); + + switch(expr->type) + { + case gsc::node_t::expr_equality: emit_opcode(ctx, opcode::OP_equality); break; + case gsc::node_t::expr_inequality: emit_opcode(ctx, opcode::OP_inequality); break; + case gsc::node_t::expr_less: emit_opcode(ctx, opcode::OP_less); break; + case gsc::node_t::expr_greater: emit_opcode(ctx, opcode::OP_greater); break; + case gsc::node_t::expr_less_equal: emit_opcode(ctx, opcode::OP_less_equal); break; + case gsc::node_t::expr_greater_equal: emit_opcode(ctx, opcode::OP_greater_equal); break; + case gsc::node_t::expr_bitwise_or: emit_opcode(ctx, opcode::OP_bit_or); break; + case gsc::node_t::expr_bitwise_and: emit_opcode(ctx, opcode::OP_bit_and); break; + case gsc::node_t::expr_bitwise_exor: emit_opcode(ctx, opcode::OP_bit_ex_or); break; + case gsc::node_t::expr_shift_left: emit_opcode(ctx, opcode::OP_shift_left); break; + case gsc::node_t::expr_shift_right: emit_opcode(ctx, opcode::OP_shift_right); break; + case gsc::node_t::expr_add: emit_opcode(ctx, opcode::OP_plus); break; + case gsc::node_t::expr_sub: emit_opcode(ctx, opcode::OP_minus); break; + case gsc::node_t::expr_mult: emit_opcode(ctx, opcode::OP_multiply); break; + case gsc::node_t::expr_div: emit_opcode(ctx, opcode::OP_divide); break; + case gsc::node_t::expr_mod: emit_opcode(ctx, opcode::OP_mod); break; + default: throw gsc::comp_error(expr->loc, "unknown binary expression"); break; + } +} + +void compiler::emit_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr) +{ + auto label = create_label(); + + emit_expr(ctx, expr->lvalue); + emit_opcode(ctx, opcode::OP_JumpOnFalseExpr, label); + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_CastBool); + + insert_label(label); +} + +void compiler::emit_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr) +{ + auto label = create_label(); + + emit_expr(ctx, expr->lvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrueExpr, label); + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_CastBool); + + insert_label(label); +} + +void compiler::emit_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr) +{ + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_BoolComplement); +} + +void compiler::emit_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr) +{ + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_BoolNot); +} + +void compiler::emit_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + if(expr->func.as_node->type == gsc::node_t::expr_call_pointer) + { + emit_expr_call_pointer(ctx, expr); + } + else + { + emit_expr_call_function(ctx, expr); + } +} + +void compiler::emit_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + bool thread = expr->thread; + bool child = expr->child; + bool method = expr->obj.as_node->type != gsc::node_t::null ? true : false; + bool builtin = builtin = expr->func.as_pointer->builtin; + std::uint32_t args = expr->func.as_pointer->args->list.size(); + + if(thread && child || thread && builtin || child && builtin) + throw gsc::comp_error(expr->loc, "function call have more than 1 type (thread, childthread, builtin)"); + + if(!thread && !child && !builtin) emit_opcode(ctx, opcode::OP_PreScriptCall); + + emit_expr_arguments(ctx, expr->func.as_pointer->args); + + if(method) emit_expr(ctx, expr->obj); + + emit_expr(ctx, expr->func.as_pointer->expr); + emit_expr_call_pointer_type(ctx, args, builtin, method, thread, child); +} + +void compiler::emit_expr_call_pointer_type(const gsc::context_ptr& ctx, int args, bool builtin, bool method, bool thread, bool child) +{ + if(builtin && !method) + { + emit_opcode(ctx, opcode::OP_CallBuiltinPointer, utils::string::va("%d", args)); + } + else if(builtin && method) + { + emit_opcode(ctx, opcode::OP_CallBuiltinMethodPointer, utils::string::va("%d", args)); + } + else if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptThreadCallPointer, utils::string::va("%d", args)); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptMethodThreadCallPointer, utils::string::va("%d", args)); + } + else if (child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptChildThreadCallPointer, utils::string::va("%d", args)); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptMethodChildThreadCallPointer, utils::string::va("%d", args)); + } + else + { + method ? emit_opcode(ctx, opcode::OP_ScriptMethodCallPointer) : emit_opcode(ctx, opcode::OP_ScriptFunctionCallPointer); + } +} + +void compiler::emit_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + bool thread = expr->thread; + bool child = expr->child; + bool method = expr->obj.as_node->type != gsc::node_t::null ? true : false; + std::uint32_t args = expr->func.as_func->args->list.size(); + auto name = expr->func.as_func->name->value; + auto file = expr->func.as_func->file->value; + + bool builtin = false, far = false, local = false; + + if(file != "") far = true; + else + { + if(is_local_call(name)) local = true; + else if(method && is_builtin_method(name)) builtin = true; + else if(!method && is_builtin_func(name)) builtin = true; + else + { + for(const auto& inc : includes_) + { + for(const auto& fun : inc.funcs) + { + if(name == fun) + { + far = true; + file = inc.name; + break; + } + } + } + + if(!builtin && !far && !local) + throw gsc::comp_error(expr->loc, "unknown function call " + name); + } + } + + if(thread && child || thread && builtin || child && builtin) + throw gsc::comp_error(expr->loc, "function call have more than 1 type (thread, childthread, builtin)"); + + if(!thread && !child && !builtin && !(!method && args == 0)) + emit_opcode(ctx, opcode::OP_PreScriptCall); + + emit_expr_arguments(ctx, expr->func.as_func->args); + + if(method) emit_expr(ctx, expr->obj); + + if(builtin) emit_expr_call_function_builtin(ctx, name, args, method); + else if(local) emit_expr_call_function_local(ctx, name, args, method, thread, child); + else if(far) emit_expr_call_function_far(ctx, file, name, args, method, thread, child); +} + +void compiler::emit_expr_call_function_builtin(const gsc::context_ptr& ctx, const std::string& func, int args, bool method) +{ + if(method) + { + switch(args) + { + case 0: emit_opcode(ctx, opcode::OP_CallBuiltinMethod0, func); break; + case 1: emit_opcode(ctx, opcode::OP_CallBuiltinMethod1, func); break; + case 2: emit_opcode(ctx, opcode::OP_CallBuiltinMethod2, func); break; + case 3: emit_opcode(ctx, opcode::OP_CallBuiltinMethod3, func); break; + case 4: emit_opcode(ctx, opcode::OP_CallBuiltinMethod4, func); break; + case 5: emit_opcode(ctx, opcode::OP_CallBuiltinMethod5, func); break; + default: emit_opcode(ctx, opcode::OP_CallBuiltinMethod, { utils::string::va("%d", args), func }); break; + } + } + else + { + switch(args) + { + case 0: emit_opcode(ctx, opcode::OP_CallBuiltin0, func); break; + case 1: emit_opcode(ctx, opcode::OP_CallBuiltin1, func); break; + case 2: emit_opcode(ctx, opcode::OP_CallBuiltin2, func); break; + case 3: emit_opcode(ctx, opcode::OP_CallBuiltin3, func); break; + case 4: emit_opcode(ctx, opcode::OP_CallBuiltin4, func); break; + case 5: emit_opcode(ctx, opcode::OP_CallBuiltin5, func); break; + default: emit_opcode(ctx, opcode::OP_CallBuiltin, { utils::string::va("%d", args), func }); break; + } + } +} + +void compiler::emit_expr_call_function_local(const gsc::context_ptr& ctx, const std::string& func, int args, bool method, bool thread, bool child) +{ + if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalThreadCall, { func, utils::string::va("%d", args) }); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodThreadCall, { func, utils::string::va("%d", args) }); + } + else if(child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptLocalChildThreadCall, { func, utils::string::va("%d", args) }); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodChildThreadCall, { func, utils::string::va("%d", args) }); + } + else if(method && !thread && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodCall, func); + } + else if(!thread && !child && !method && args == 0) + { + emit_opcode(ctx, opcode::OP_ScriptLocalFunctionCall2, func); + } + else if(!thread && !child && !method && args != 0) + { + emit_opcode(ctx, opcode::OP_ScriptLocalFunctionCall, func); + } +} + +void compiler::emit_expr_call_function_far(const gsc::context_ptr& ctx, const std::string& file, const std::string& func, int args, bool method, bool thread, bool child) +{ + if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptFarThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptFarChildThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodChildThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(!thread && !child && method) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodCall, { file, func }); + } + else if(!thread && !child && !method && args == 0) + { + emit_opcode(ctx, opcode::OP_ScriptFarFunctionCall2, { file, func }); + } + else if(!thread && !child && !method && args != 0) + { + emit_opcode(ctx, opcode::OP_ScriptFarFunctionCall, { file, func }); + } +} + +void compiler::emit_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& args) +{ + std::reverse(args->list.begin(), args->list.end()); + + for(auto& arg : args->list) + { + emit_expr(ctx, arg); + } +} + +void compiler::emit_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& expr) +{ + bool far = false, local = false, builtin = false, method = false; + auto name = expr->name->value; + auto file = expr->file->value; + + if(file != "") + { + far = true; + } + else if(is_builtin_method(name)) + { + builtin = true; + method = true; + } + else if(is_builtin_func(name)) + { + builtin = true; + } + else if(is_local_call(name)) + { + local = true; + } + + if(local) + { + emit_opcode(ctx, opcode::OP_GetLocalFunction, name); + } + else if(far) + { + emit_opcode(ctx, opcode::OP_GetFarFunction, { file, name } ); + } + else if(builtin && method) + { + emit_opcode(ctx, opcode::OP_GetBuiltinMethod, name); + } + else if(builtin && !method) + { + emit_opcode(ctx, opcode::OP_GetBuiltinFunction, name); + } +} + +void compiler::emit_expr_clear_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& lvalue) +{ + switch(lvalue.as_node->type) + { + case gsc::node_t::expr_array: + emit_expr(ctx, lvalue.as_array->key); + lvalue.as_array->obj.as_node->type == gsc::node_t::data_game ? emit_opcode(ctx, opcode::OP_GetGameRef) : emit_variable_ref(ctx, lvalue.as_array->obj, false); + emit_opcode(ctx, opcode::OP_ClearArray); + break; + case gsc::node_t::expr_field: + emit_object(ctx, lvalue.as_field->obj); + emit_opcode(ctx, opcode::OP_ClearFieldVariable,lvalue.as_field->field->value); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_GetUndefined); + emit_local_variable_ref(ctx, lvalue.as_name, true); + break; + default: + throw gsc::comp_error(lvalue.as_node->loc, "unknown clear variable lvalue"); + break; + } +} + +void compiler::emit_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr) +{ + if(expr->args->list.size() <= 0) + { + throw gsc::comp_error(expr->loc, "invalid empty add array. did u mean '[]' ?"); + } + + emit_opcode(ctx, opcode::OP_EmptyArray); + + for(const auto& arg : expr->args->list) + { + emit_expr(ctx, arg); + emit_opcode(ctx, opcode::OP_AddArray); + } +} + +void compiler::emit_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr) +{ + emit_variable(ctx, expr->obj); + emit_opcode(ctx, opcode::OP_size); +} + +void compiler::emit_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr, bool set) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_array: emit_array_variable_ref(ctx, expr.as_array, set); break; + case gsc::node_t::expr_field: emit_field_variable_ref(ctx, expr.as_field, set); break; + case gsc::node_t::data_name: emit_local_variable_ref(ctx, expr.as_name, set); break; + default: throw gsc::comp_error(expr.as_node->loc, "invalid variable reference type."); break; + } +} + +void compiler::emit_array_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr, bool set) +{ + emit_expr(ctx, expr->key); + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_game: + emit_opcode(ctx, opcode::OP_GetGameRef); + emit_opcode(ctx, opcode::OP_EvalArrayRef); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_array: + case gsc::node_t::expr_field: + emit_variable_ref(ctx, expr->obj, false); + emit_opcode(ctx, opcode::OP_EvalArrayRef); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::data_name: + { + if(!variable_initialized(ctx, expr->obj.as_name)) + { + initialize_variable(ctx, expr->obj.as_name); + emit_opcode(ctx, opcode::OP_EvalNewLocalArrayRefCached0, variable_create_index(ctx, expr->obj.as_name)); + + if(!set) + { + throw gsc::comp_error(expr->loc, "INTERNAL: VAR CREATED BUT NOT SET!"); + } + } + else if(variable_stack_index(ctx, expr->obj.as_name) == 0) + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayRefCached0); + } + else + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayRefCached, variable_access_index(ctx, expr->obj.as_name)); + } + + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + } + break; + case gsc::node_t::expr_call: + throw gsc::comp_error(expr->loc, "call result can't be referenced."); + break; + default: + throw gsc::comp_error(expr->loc, "unknown array object type"); + break; + } +} + +void compiler::emit_field_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr, bool set) +{ + const auto& field = expr->field->value; + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_level: + set ? emit_opcode(ctx, opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalLevelFieldVariableRef, field); + break; + case gsc::node_t::data_anim: + set ? emit_opcode(ctx, opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalAnimFieldVariableRef, field); + break; + case gsc::node_t::data_self: + set ? emit_opcode(ctx, opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalSelfFieldVariableRef, field); + break; + case gsc::node_t::expr_array: + emit_array_variable(ctx, expr->obj.as_array); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_field: + emit_field_variable(ctx, expr->obj.as_field); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr->obj.as_name)); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_call: + throw gsc::comp_error(expr->loc, "function call result can't be referenced"); + break; + default: + throw gsc::comp_error(expr->loc, "unknown field variable object type"); + break; + } +} + +void compiler::emit_local_variable_ref(const gsc::context_ptr& ctx, const gsc::name_ptr& expr, bool set) +{ + const auto itr = constants_.find(expr->value); + + if (itr != constants_.end()) + { + throw gsc::comp_error(expr->loc, "variable name already defined as constant " + expr->value); + } + + if(set) + { + if(!variable_initialized(ctx, expr)) + { + initialize_variable(ctx, expr); + emit_opcode(ctx, opcode::OP_SetNewLocalVariableFieldCached0, variable_create_index(ctx, expr)); + } + else if(variable_stack_index(ctx, expr) == 0) + { + emit_opcode(ctx, opcode::OP_SetLocalVariableFieldCached0); + } + else + { + emit_opcode(ctx, opcode::OP_SetLocalVariableFieldCached, variable_access_index(ctx, expr)); + } + } + else + { + auto index = variable_stack_index(ctx, expr); + + if(index == 0) + emit_opcode(ctx, opcode::OP_EvalLocalVariableRefCached0); + else + emit_opcode(ctx, opcode::OP_EvalLocalVariableRefCached, variable_access_index(ctx, expr)); + } +} + +void compiler::emit_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + // for obj.size + switch(expr.as_node->type) + { + case gsc::node_t::expr_array: emit_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: emit_field_variable(ctx, expr.as_field); break; + case gsc::node_t::data_name: emit_local_variable(ctx, expr.as_name); break; + case gsc::node_t::expr_call: emit_expr_call(ctx, expr.as_call); break; + default: throw gsc::comp_error(expr.as_node->loc, "invalid variable type."); break; + } +} + +void compiler::emit_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr) +{ + emit_expr(ctx, expr->key); + + if(expr->obj.as_node->type == gsc::node_t::data_name) + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayCached, variable_access_index(ctx, expr->obj.as_name)); + } + else + { + emit_expr(ctx, expr->obj); + emit_opcode(ctx, opcode::OP_EvalArray); + } +} + +void compiler::emit_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr) +{ + const auto& field = expr->field->value; + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_level: + emit_opcode(ctx, opcode::OP_EvalLevelFieldVariable, field); + break; + case gsc::node_t::data_anim: + emit_opcode(ctx, opcode::OP_EvalAnimFieldVariable, field); + break; + case gsc::node_t::data_self: + emit_opcode(ctx, opcode::OP_EvalSelfFieldVariable, field); + break; + case gsc::node_t::expr_array: + emit_array_variable(ctx, expr->obj.as_array); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::expr_field: + emit_field_variable(ctx, expr->obj.as_field); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::expr_call: + emit_expr_call(ctx, expr->obj.as_call); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr->obj.as_name)); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + default: + throw gsc::comp_error(expr->loc, "unknown field variable object type"); + break; + } +} + +void compiler::emit_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + // is constant ( should only allow: string, loc string, number, vector) + const auto itr = constants_.find(expr->value); + + if (itr != constants_.end()) + { + const auto& value = itr->second; + emit_expr(ctx, value); + return; + } + + // is local var + auto index = variable_stack_index(ctx, expr); + + switch(index) + { + case 0: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached0); break; + case 1: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached1); break; + case 2: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached2); break; + case 3: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached3); break; + case 4: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached4); break; + case 5: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached5); break; + default: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached, variable_access_index(ctx, expr)); break; + } +} + +void compiler::emit_clear_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + auto index = variable_stack_index(ctx, expr); + + if(index == 0) + { + emit_opcode(ctx, opcode::OP_ClearLocalVariableFieldCached0); + } + else + { + emit_opcode(ctx, opcode::OP_ClearLocalVariableFieldCached, variable_access_index(ctx, expr)); + } +} + +void compiler::emit_create_local_vars(const gsc::context_ptr& ctx) +{ + if ( ctx->local_vars_create_count != ctx->local_vars_public_count ) + { + for(auto i = ctx->local_vars_create_count; i < ctx->local_vars_public_count; i++) + { + auto data = utils::string::va("%d", ctx->local_vars.at(i).create); + emit_opcode(ctx, opcode::OP_CreateLocalVariable, data); + ctx->local_vars.at(i).init = true; + } + ctx->local_vars_create_count = ctx->local_vars_public_count; + } +} + +void compiler::emit_remove_local_vars(const gsc::context_ptr& ctx) +{ + if(ctx->abort == abort_t::abort_none) + { + auto count = ctx->local_vars_create_count - ctx->local_vars_public_count; + + if(count > 0) + { + auto data = utils::string::va("%d", count); + emit_opcode(ctx, opcode::OP_RemoveLocalVariables, data); + } + } +} + +void compiler::emit_object(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + // need revision used for clear variable + switch(expr.as_node->type) + { + case gsc::node_t::data_level: + emit_opcode(ctx, opcode::OP_GetLevelObject); + break; + case gsc::node_t::data_anim: + emit_opcode(ctx, opcode::OP_GetAnimObject); + break; + case gsc::node_t::data_self: + emit_opcode(ctx, opcode::OP_GetSelfObject); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr.as_name)); + break; + case gsc::node_t::expr_call: + emit_expr_call(ctx, expr.as_call); + emit_opcode(ctx, opcode::OP_CastFieldObject); + break; + // array ? + // field ? + default: + throw gsc::comp_error(expr.as_node->loc, "unknown object type"); + break; + } +} + +void compiler::emit_animtree(const gsc::context_ptr& ctx, const gsc::animtree_ptr& animtree) +{ + if(animtrees_.size() == 0) + { + throw gsc::comp_error( animtree->loc, "trying to use animtree without specified using animtree"); + } + + auto& tree = animtrees_.back(); + + if(tree.loaded) + { + emit_opcode(ctx, opcode::OP_GetAnimTree, "''"); + } + else + { + emit_opcode(ctx, opcode::OP_GetAnimTree, tree.name); + tree.loaded = true; + } +} + +void compiler::emit_animation(const gsc::context_ptr& ctx, const gsc::animation_ptr& animation) +{ + if(animtrees_.size() == 0) + { + throw gsc::comp_error(animation->loc, "trying to use animation without specified using animtree"); + } + + auto& tree = animtrees_.back(); + + if(tree.loaded) + { + emit_opcode(ctx, opcode::OP_GetAnimation, { "''", animation->value }); + } + else + { + emit_opcode(ctx, opcode::OP_GetAnimation, { tree.name, animation->value }); + tree.loaded = true; + } +} + +void compiler::emit_istring(const gsc::context_ptr& ctx, const gsc::istring_ptr& str) +{ + emit_opcode(ctx, opcode::OP_GetIString, str->value); +} + +void compiler::emit_string(const gsc::context_ptr& ctx, const gsc::string_ptr& str) +{ + emit_opcode(ctx, opcode::OP_GetString, str->value); +} + +void compiler::emit_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec) +{ + std::vector data; + + bool expr = false; + + if(vec->x.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->x.as_integer->value); + else if(vec->x.as_node->type == gsc::node_t::data_float) + data.push_back(vec->x.as_float->value); + else expr = true; + + if(vec->y.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->y.as_integer->value); + else if(vec->y.as_node->type == gsc::node_t::data_float) + data.push_back(vec->y.as_float->value); + else expr = true; + + if(vec->z.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->z.as_integer->value); + else if(vec->z.as_node->type == gsc::node_t::data_float) + data.push_back(vec->z.as_float->value); + else expr = true; + + if(!expr) + { + emit_opcode(ctx, opcode::OP_GetVector, data); + } + else + { + emit_expr(ctx, vec->z); + emit_expr(ctx, vec->y); + emit_expr(ctx, vec->x); + emit_opcode(ctx, opcode::OP_vector); + } +} + +void compiler::emit_float(const gsc::context_ptr& ctx, const gsc::float_ptr& num) +{ + emit_opcode(ctx, opcode::OP_GetFloat, num->value); +} + +void compiler::emit_integer(const gsc::context_ptr& ctx, const gsc::integer_ptr& num) +{ + auto value = std::atoi(num->value.data()); + + if(value == 0) + { + emit_opcode(ctx, opcode::OP_GetZero); + } + else if(value > 0 && value < 256) + { + emit_opcode(ctx, opcode::OP_GetByte, num->value); + } + else if(value < 0 && value > -256) + { + emit_opcode(ctx, opcode::OP_GetNegByte, num->value.substr(1)); + } + else if(value < 65536) + { + emit_opcode(ctx, opcode::OP_GetUnsignedShort, num->value); + } + else if(value < 0 && value > -65536) + { + emit_opcode(ctx, opcode::OP_GetNegUnsignedShort, num->value.substr(1)); + } + else + { + emit_opcode(ctx, opcode::OP_GetInteger, num->value); + } +} + +void compiler::emit_false(const gsc::context_ptr& ctx, const gsc::false_ptr& expr) +{ + emit_opcode(ctx, opcode::OP_GetZero); +} + +void compiler::emit_true(const gsc::context_ptr& ctx, const gsc::true_ptr& expr) +{ + emit_opcode(ctx, opcode::OP_GetByte, "1"); +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + + index_ += inst->size; +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::string& data) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + inst->data.push_back(data); + + index_ += inst->size; +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::vector& data) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + inst->data = data; + + index_ += inst->size; +} + +void compiler::process_thread(const gsc::context_ptr& ctx, const gsc::thread_ptr& thread) +{ + process_parameters(ctx, thread->params); + process_stmt_list(ctx, thread->block); +} + +void compiler::process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + register_variable(ctx, param->value); + } +} + +void compiler::process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt) +{ + switch (stmt.as_node->type) + { + case gsc::node_t::stmt_list: process_stmt_list(ctx, stmt.as_list); break; + case gsc::node_t::stmt_assign: process_expr(ctx, stmt.as_assign->expr->lvalue); break; + case gsc::node_t::stmt_waittill: process_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_if: process_stmt_if(ctx, stmt.as_if); break; + case gsc::node_t::stmt_ifelse: process_stmt_ifelse(ctx, stmt.as_ifelse); break; + case gsc::node_t::stmt_while: process_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: process_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: process_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: process_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_break: process_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_continue: process_stmt_continue(ctx, stmt.as_continue); break; + case gsc::node_t::stmt_return: process_stmt_return(ctx, stmt.as_return); break; + default: break; + } +} + +void compiler::process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + for (const auto& entry : stmt->stmts) + { + process_stmt(ctx, entry); + } +} + +void compiler::process_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + if(expr.as_node->type == gsc::node_t::data_name) + { + register_variable(ctx, expr.as_name->value); + } + else if(expr.as_node->type == gsc::node_t::expr_array) + { + process_expr(ctx, expr.as_array->obj); + } +} + +void compiler::process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + register_variable(ctx, arg.as_name->value); + } + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); +} + +void compiler::process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt) +{ + stmt->ctx = std::make_unique(); + + ctx->copy(stmt->ctx); + process_stmt(stmt->ctx, stmt->stmt); + + std::vector childs({ stmt->ctx.get() }); + ctx->merge(childs); +} + +void compiler::process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt) +{ + std::vector childs; + auto abort = abort_t::abort_return; + + stmt->ctx_if = std::make_unique(); + stmt->ctx_else = std::make_unique(); + + ctx->copy(stmt->ctx_if); + process_stmt(stmt->ctx_if, stmt->stmt_if); + + if(stmt->ctx_if->abort <= abort_t::abort_return) + { + abort = stmt->ctx_if->abort; + if(abort == abort_t::abort_none) + childs.push_back(stmt->ctx_if.get()); + } + + ctx->copy(stmt->ctx_else); + process_stmt(stmt->ctx_else, stmt->stmt_else); + + if(stmt->ctx_else->abort <= abort) + { + abort = stmt->ctx_else->abort; + if(abort == abort_t::abort_none) + childs.push_back(stmt->ctx_else.get()); + } + + if(ctx->abort == abort_t::abort_none) + ctx->abort = abort; + + ctx->append(childs); + ctx->merge(childs); +} + +void compiler::process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + bool const_cond = is_constant_condition(stmt->expr); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + stmt->ctx = std::make_unique(); + + ctx->copy(stmt->ctx); + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + if(const_cond) ctx->append(break_ctxs_); + + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + bool const_cond = is_constant_condition(stmt->expr); + + stmt->ctx = std::make_unique(); + stmt->ctx_post = std::make_unique(); + + process_stmt(ctx, stmt->pre_expr); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + ctx->copy(stmt->ctx); + ctx->copy(stmt->ctx_post); + + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + process_stmt(stmt->ctx_post, stmt->post_expr); + + ctx->append({ stmt->ctx_post.get() }); + ctx->merge({ stmt->ctx_post.get() }); + + if(const_cond) ctx->append(break_ctxs_); + + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + auto array_name = utils::string::va("temp_%d", ++label_idx_); + auto key_name = utils::string::va("temp_%d", ++label_idx_); + + stmt->array = expr_ptr(std::make_unique(stmt->loc, array_name)); + + if(!stmt->use_key) + stmt->key_expr = expr_ptr(std::make_unique(stmt->loc, key_name)); + + key_name = stmt->key_expr.as_name->value; + + // calculate variables + + stmt->ctx = std::make_unique(); + stmt->ctx_post = std::make_unique(); + + // calculate pre_expr variables + process_expr(ctx, stmt->array); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + ctx->copy(stmt->ctx); + ctx->copy(stmt->ctx_post); + + // calculate stmt variables & add missing array access as first stmt + process_expr(stmt->ctx, stmt->value_expr); + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + process_expr(stmt->ctx_post, stmt->key_expr); + + ctx->append({ stmt->ctx_post.get() }); + ctx->merge({ stmt->ctx_post.get() }); + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + auto stmt_list = std::make_unique(stmt->stmt->loc); + auto current_case = gsc::stmt_ptr(std::make_unique()); + + auto num = stmt->stmt->stmts.size(); + + for(auto i = 0; i < num; i++) + { + auto& entry = stmt->stmt->stmts[0]; + + if(entry.as_node->type == gsc::node_t::stmt_case || entry.as_node->type == gsc::node_t::stmt_default) + { + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + current_case = std::move(stmt->stmt->stmts[0]); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + else + { + if(current_case.as_node->type != gsc::node_t::null) + { + if(current_case.as_node->type == gsc::node_t::stmt_case) + { + current_case.as_case->stmt->stmts.push_back(std::move(entry)); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + else + { + current_case.as_default->stmt->stmts.push_back(std::move(entry)); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + } + else + { + gsc::comp_error(entry.as_node->loc, "missing case statement"); + } + } + } + + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + // calculate variables + stmt->ctx = std::make_unique(); + std::vector childs; + auto abort = abort_t::abort_return; + bool has_default = false; + gsc::context* default_ctx = nullptr; + auto old_breaks = break_ctxs_; + break_ctxs_.clear(); + + for(auto i = 0; i < stmt_list->stmts.size(); i++) + { + auto& entry = stmt_list->stmts[i]; + + if(entry.as_node->type == gsc::node_t::stmt_case) + { + entry.as_case->ctx = std::make_unique(); + ctx->copy(entry.as_case->ctx); + process_stmt_list(entry.as_case->ctx, entry.as_case->stmt); + + if (entry.as_case->ctx->abort != abort_t::abort_none) + { + if (entry.as_case->ctx->abort == abort_t::abort_break ) + { + entry.as_case->ctx->abort = abort_t::abort_none; + abort = abort_t::abort_none; + childs.push_back(entry.as_case->ctx.get()); + } + else if (entry.as_case->ctx->abort <= abort ) + { + abort = entry.as_case->ctx->abort; + } + } + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + entry.as_default->ctx = std::make_unique(); + ctx->copy(entry.as_default->ctx); + process_stmt_list(entry.as_default->ctx, entry.as_default->stmt); + has_default = true; + default_ctx = entry.as_default->ctx.get(); + + if (entry.as_default->ctx->abort != abort_t::abort_none) + { + if (entry.as_default->ctx->abort == abort_t::abort_break ) + { + entry.as_default->ctx->abort = abort_t::abort_none; + abort = abort_t::abort_none; + childs.push_back(entry.as_default->ctx.get()); + } + else if (entry.as_default->ctx->abort <= abort ) + { + abort = entry.as_default->ctx->abort; + } + } + } + } + + stmt->stmt =std::move(stmt_list); + + if(has_default) + { + if(default_ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(default_ctx); + + if(ctx->abort == abort_t::abort_none) + ctx->abort = abort; + } + + ctx->append(break_ctxs_); + ctx->merge(childs); + } + + break_ctxs_ = old_breaks; +} + +void compiler::process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(ctx.get()); + ctx->abort = abort_t::abort_break; + } +} + +void compiler::process_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + continue_ctxs_.push_back(ctx.get()); + ctx->abort = abort_t::abort_continue; + } +} + +void compiler::process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + ctx->abort = abort_t::abort_return; + } +} + +void compiler::register_variable(const gsc::context_ptr& ctx, const std::string& name) +{ + auto it = std::find_if(ctx->local_vars.begin(), ctx->local_vars.end(), + [&](const gsc::local_var& v) { return v.name == name; }); + + if(it == ctx->local_vars.end()) + { + auto found = false; + for(std::size_t i = 0; i < local_stack_.size(); i++) + { + if(local_stack_[i] == name) + { + ctx->local_vars.push_back({ name, static_cast(i), false }); + found = true; + break; + } + } + + if(!found) + { + ctx->local_vars.push_back({ name, stack_idx_, false }); + local_stack_.push_back(name); + stack_idx_++; + } + } +} + +void compiler::initialize_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name) +{ + for(std::uint32_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(!ctx->local_vars[i].init) + { + for(std::uint32_t j = 0; j < i; j++) + { + if(!ctx->local_vars[j].init) + { + emit_opcode(ctx, opcode::OP_CreateLocalVariable, utils::string::va("%d", ctx->local_vars[j].create)); + ctx->local_vars[j].init = true; + //ctx->local_vars_create_count++; + } + } + ctx->local_vars[i].init = true; + ctx->local_vars_create_count = i + 1; + return; + } + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +void compiler::create_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name) +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + auto& var = ctx->local_vars.at(i); + if(var.name == name->value) + { + if(!var.init) + { + emit_opcode(ctx, opcode::OP_CreateLocalVariable, utils::string::va("%d", var.create)); + var.init = true; + ctx->local_vars_create_count++; + } + return; + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_stack_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::uint8_t +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(ctx->local_vars.at(i).init) + { + return ctx->local_vars_create_count - 1 - i; + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not initialized."); + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_create_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + return utils::string::va("%d", ctx->local_vars[i].create); + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_access_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(ctx->local_vars.at(i).init) + { + return utils::string::va("%d", ctx->local_vars_create_count - 1 - i); + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not initialized."); + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_initialized(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> bool +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + return ctx->local_vars.at(i).init; + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::is_local_call(const std::string& name) -> bool +{ + for(const auto& f : local_functions_) + { + if(f == name) return true; + } + + return false; +} + +auto compiler::is_builtin_call(const std::string& name) -> bool +{ + if(is_builtin_func(name)) return true; + + if(is_builtin_method(name)) return true; + + return false; +} + +auto compiler::is_builtin_func(const std::string& name) -> bool +{ + return resolver::find_function(name); +} +auto compiler::is_builtin_method(const std::string& name) -> bool +{ + return resolver::find_method(name); +} + +auto compiler::is_constant_condition(const gsc::expr_ptr& expr) -> bool +{ + switch(expr.as_node->type) + { + case gsc::node_t::null: + case gsc::node_t::data_true: + return true; + case gsc::node_t::data_false: + throw gsc::comp_error(expr.as_node->loc, "condition can't be always false!"); + case gsc::node_t::data_integer: + { + auto num = std::stoi(expr.as_integer->value); + if(num != 0) + return true; + else + throw gsc::comp_error(expr.as_node->loc, "condition can't be always false!"); + } + default: + break; + } + + return false; +} + +auto compiler::create_label() -> std::string +{ + label_idx_++; + auto name = utils::string::va("loc_%d", label_idx_); + return name; +} + +auto compiler::insert_label() -> std::string +{ + const auto itr = function_->labels.find(index_); + + if (itr != function_->labels.end()) + { + return itr->second; + } + else + { + label_idx_++; + auto name = utils::string::va("loc_%d", label_idx_); + function_->labels.insert({index_, name}); + return name; + } +} + +void compiler::insert_label(const std::string& name) +{ + const auto itr = function_->labels.find(index_); + + if (itr != function_->labels.end()) + { + for(auto& inst : function_->instructions) + { + switch (opcode(inst->opcode)) + { + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_jump: + case opcode::OP_jumpback: + case opcode::OP_switch: + if(inst->data[0] == name) + inst->data[0] = itr->second; + break; + case opcode::OP_endswitch: + default: + break; + } + } + } + else + { + function_->labels.insert({index_, name}); + } +} + +auto compiler::map_known_includes(const std::string& include) -> bool +{ + return false; +} + +} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/compiler.hpp b/src/h2/xsk/compiler.hpp new file mode 100644 index 00000000..19deb47a --- /dev/null +++ b/src/h2/xsk/compiler.hpp @@ -0,0 +1,146 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::h2 +{ + +enum class opcode : std::uint8_t; + +class compiler : public gsc::compiler +{ + std::string filename_; + std::vector assembly_; + gsc::function_ptr function_; + std::uint32_t index_; + std::uint32_t label_idx_; + std::uint8_t stack_idx_; + std::vector local_stack_; + std::vector local_functions_; + std::vector includes_; + std::vector animtrees_; + std::unordered_map constants_; + std::function(const std::string&)> callback_readf_; + std::vector break_ctxs_; + std::vector continue_ctxs_; + bool can_break_; + bool can_continue_; + +public: + auto output() -> std::vector; + void compile(const std::string& file, std::vector& data); + void set_readf_callback(std::function(const std::string&)> func); + +private: + auto parse_buffer(const std::string& file, std::vector& data) -> gsc::program_ptr; + auto parse_file(const std::string& file) -> gsc::program_ptr; + void compile_program(const gsc::program_ptr& program); + void emit_include(const gsc::include_ptr& include); + void emit_define(const gsc::define_ptr& define); + void emit_usingtree(const gsc::usingtree_ptr& animtree); + void emit_constant(const gsc::constant_ptr& constant); + void emit_thread(const gsc::thread_ptr& thread); + void emit_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void emit_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt, bool last); + void emit_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt, bool last); + void emit_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt); + void emit_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt); + void emit_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt); + void emit_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt); + void emit_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt); + void emit_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void emit_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt); + void emit_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt); + void emit_stmt_waitframe(const gsc::context_ptr& ctx, const gsc::stmt_waitframe_ptr& stmt); + void emit_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt, bool last); + void emit_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt, bool last); + void emit_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void emit_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void emit_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void emit_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void emit_stmt_case(const gsc::context_ptr& ctx, const gsc::stmt_case_ptr& stmt); + void emit_stmt_default(const gsc::context_ptr& ctx, const gsc::stmt_default_ptr& stmt); + void emit_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void emit_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt); + void emit_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void emit_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr); + void emit_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr); + void emit_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr); + void emit_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr); + void emit_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr); + void emit_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr); + void emit_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_pointer_type(const gsc::context_ptr& ctx, int args, bool builtin, bool method, bool thread, bool child); + void emit_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_function_builtin(const gsc::context_ptr& ctx, const std::string& func, int args, bool method); + void emit_expr_call_function_local(const gsc::context_ptr& ctx, const std::string& func, int args, bool method, bool thread, bool child); + void emit_expr_call_function_far(const gsc::context_ptr& ctx, const std::string& file, const std::string& func, int args, bool method, bool thread, bool child); + void emit_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& arg_list); + void emit_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& node); + void emit_expr_clear_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& lvalue); + void emit_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr); + void emit_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr); + void emit_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr, bool set); + void emit_array_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr, bool set); + void emit_field_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr, bool set); + void emit_local_variable_ref(const gsc::context_ptr& ctx, const gsc::name_ptr& expr, bool set); + void emit_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr); + void emit_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr); + void emit_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void emit_clear_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void emit_create_local_vars(const gsc::context_ptr& ctx); + void emit_remove_local_vars(const gsc::context_ptr& ctx); + void emit_object(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_animtree(const gsc::context_ptr& ctx, const gsc::animtree_ptr& animtree); + void emit_animation(const gsc::context_ptr& ctx, const gsc::animation_ptr& animation); + void emit_istring(const gsc::context_ptr& ctx, const gsc::istring_ptr& str); + void emit_string(const gsc::context_ptr& ctx, const gsc::string_ptr& str); + void emit_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec); + void emit_float(const gsc::context_ptr& ctx, const gsc::float_ptr& num); + void emit_integer(const gsc::context_ptr& ctx, const gsc::integer_ptr& num); + void emit_false(const gsc::context_ptr& ctx, const gsc::false_ptr& expr); + void emit_true(const gsc::context_ptr& ctx, const gsc::true_ptr& expr); + void emit_opcode(const gsc::context_ptr& ctx, opcode op); + void emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::string& data); + void emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::vector& data); + void process_thread(const gsc::context_ptr& ctx, const gsc::thread_ptr& thread); + void process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt); + void process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt); + void process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt); + void process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void process_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt); + void process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void register_variable(const gsc::context_ptr& ctx, const std::string& name); + void initialize_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name); + void create_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name); + auto variable_stack_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::uint8_t; + auto variable_create_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string; + auto variable_access_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string; + auto variable_initialized(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> bool; + auto is_local_call(const std::string& name) -> bool; + auto is_builtin_call(const std::string& name) -> bool; + auto is_builtin_func(const std::string& name) -> bool; + auto is_builtin_method(const std::string& name) -> bool; + auto is_constant_condition(const gsc::expr_ptr& expr) -> bool; + auto create_label() -> std::string; + auto insert_label() -> std::string; + void insert_label(const std::string& label); + + auto map_known_includes(const std::string& include) -> bool; +}; + +} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/decompiler.cpp b/src/h2/xsk/decompiler.cpp new file mode 100644 index 00000000..f1fe2372 --- /dev/null +++ b/src/h2/xsk/decompiler.cpp @@ -0,0 +1,3160 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "h2.hpp" + +namespace xsk::gsc::h2 +{ + +auto decompiler::output() -> std::vector +{ + std::vector output; + + auto data = std::make_unique(0x100000); + data->write_string("// H2 PC GSC\n// Decompiled by https://github.com/xensik/gsc-tool\n"); + data->write_string(program_->print()); + + output.resize(data->pos()); + std::memcpy(output.data(), data->buffer().data(), output.size()); + + return output; +} + +void decompiler::decompile(const std::string& file, std::vector& functions) +{ + filename_ = file; + program_ = std::make_unique(); + + for (auto& func : functions) + { + auto name = std::make_unique(func->name.substr(4)); + auto params = std::make_unique(); + auto block = std::make_unique(); + func_ = std::make_unique(std::move(name),std::move(params),std::move(block)); + + labels_ = func->labels; + expr_labels_.clear(); + stack_ = std::stack(); + + this->decompile_function(func); + + this->process_stack(func_); + + program_->definitions.push_back(gsc::define_ptr(std::move(func_))); + } +} + +void decompiler::decompile_function(const gsc::function_ptr& func) +{ + this->decompile_statements(func); + + if(stack_.size() > 0) + { + throw gsc::decomp_error("stack not emty at function end"); + } + + auto& block = func_->block; + + gsc::context ctx; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.back().as_node->loc.begin.line); + + // remove last return + block->stmts.pop_back(); + + // hotfix empty else block at func end + if(block->stmts.size() > 0 && block->stmts.back().as_node->type == gsc::node_t::asm_jump) + { + if(block->stmts.back().as_jump->value == ctx.loc_end) + block->stmts.pop_back(); + } + + blocks_.push_back(ctx); + this->decompile_block(block); + blocks_.pop_back(); +} + +void decompiler::decompile_statements(const gsc::function_ptr& func) +{ + std::uint32_t last_null_loc = 0; + + for (auto& inst : func->instructions) + { + auto loc = gsc::location(&filename_, inst->index); + + const auto itr = func->labels.find(inst->index); + + if (itr != func->labels.end()) + { + for(auto& entry : expr_labels_) + { + if(entry == itr->second) + { + decompile_expr(); + } + } + } + + switch (opcode(inst->opcode)) + { + case opcode::OP_End: + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::make_unique())); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_Return: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + auto stmt = gsc::stmt_ptr(std::make_unique(expr->loc, std::move(expr))); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_GetZero: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetByte: + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetInteger: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetNegByte: + case opcode::OP_GetNegUnsignedShort: + { + auto node = std::make_unique(loc, "-" + inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetFloat: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetVector: + { + auto x = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto y = gsc::expr_ptr(std::make_unique(loc, inst->data[1])); + auto z = gsc::expr_ptr(std::make_unique(loc, inst->data[2])); + auto node = std::make_unique(loc, std::move(x), std::move(y), std::move(z)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetString: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetIString: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetUndefined: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EmptyArray: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetLevel: + case opcode::OP_GetLevelObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnim: + case opcode::OP_GetAnimObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetSelf: + case opcode::OP_GetSelfObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetGame: + case opcode::OP_GetGameRef: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnimation: + { + auto tree = utils::string::unquote(inst->data[0]); + + if(tree != "") + { + auto treename = std::make_unique(loc, inst->data[0]); + auto animtree = std::make_unique(loc, std::move(treename)); + program_->definitions.push_back(gsc::define_ptr(std::move(animtree))); + } + + auto node = std::make_unique(loc, utils::string::unquote(inst->data[1])); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnimTree: + { + auto tree = utils::string::unquote(inst->data[0]); + + if(tree != "") + { + auto treename = std::make_unique(loc, inst->data[0]); + auto animtree = std::make_unique(loc, std::move(treename)); + program_->definitions.push_back(gsc::define_ptr(std::move(animtree))); + } + + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetThisthread: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_GetBuiltinMethod: + { + auto file = std::make_unique(loc); + auto func = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_GetLocalFunction: + { + auto file = std::make_unique(loc); + auto func = std::make_unique(loc, inst->data[0].substr(4)); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_GetFarFunction: + { + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + auto func = std::make_unique(loc, inst->data[1]); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + }; + break; + case opcode::OP_CreateLocalVariable: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_RemoveLocalVariables: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_EvalLocalVariableCached0: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached1: + { + auto node = std::make_unique(loc, "1"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached2: + { + auto node = std::make_unique(loc, "2"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached3: + { + auto node = std::make_unique(loc, "3"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached4: + { + auto node = std::make_unique(loc, "4"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached5: + { + auto node = std::make_unique(loc, "5"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayCached: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalArray: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalNewLocalArrayRefCached0: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayRefCached0: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, "0")); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayRefCached: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalArrayRef: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_ClearArray: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = key.as_node->loc; + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(key))); + auto rvalue = gsc::expr_ptr(std::make_unique(loc)); + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr))); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_AddArray: + { + auto var = std::move(stack_.top()); + stack_.pop(); + auto array = std::move(stack_.top()); + stack_.pop(); + + if (array->type == gsc::node_t::data_empty_array) + { + auto args = std::make_unique(loc); + args->list.push_back(std::move(var)); + auto expr = std::make_unique(array->loc, std::move(args)); + stack_.push(std::move(expr)); + } + else if (array->type == gsc::node_t::expr_add_array) + { + (*(gsc::expr_add_array_ptr*)&array)->args->list.push_back(std::move(var)); + stack_.push(std::move(array)); + } + else + { + throw gsc::decomp_error("unknown add array type (could be an array variable name?)"); + } + } + break; + case opcode::OP_PreScriptCall: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_ScriptLocalFunctionCall2: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalFunctionCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalChildThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodThreadCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodChildThreadCall: + { + // TODO: child things... + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarFunctionCall2: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarFunctionCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarMethodCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[2]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[1])); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarMethodThreadCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[2]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[1])); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFunctionCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodCallPointer: + { + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptChildThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodChildThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto obj = gsc::expr_ptr(std::make_unique()); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, true, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethodPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, true, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin0: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin1: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 1; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin2: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 2; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin3: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 3; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin4: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 4; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin5: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 5; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod0: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod1: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 1; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod2: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 2; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod3: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 3; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod4: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 4; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod5: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 5; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_DecTop: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + loc = expr->loc; + auto stmt = std::make_unique(loc, std::move(*(gsc::expr_call_ptr*)&expr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_inc: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_dec: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_or: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_ex_or: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_and: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_equality: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_inequality: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_less: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_greater: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_less_equal: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_greater_equal: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_shift_left: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_shift_right: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_plus: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_minus: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_multiply: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_divide: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_mod: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_wait: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + loc = expr->loc; + auto stmt = std::make_unique(loc, std::move(expr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_waittillFrameEnd: + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_waitFrame: + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_waittill: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = nstr.as_node->loc; + auto args = std::make_unique(loc); + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr), std::move(args)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_waittillmatch: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto expr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = expr.as_node->loc; + + gsc::expr_arguments_ptr args = std::make_unique(); + args->loc = loc; + + while(stack_.size() > 0) + { + auto node = std::move(stack_.top()); + stack_.pop(); + args->loc = node->loc; + args->list.push_back(std::move(node)); + + } + loc = args->loc; + + auto stmt = std::make_unique(loc, std::move(obj), std::move(expr), std::move(args)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_clearparams: + { + auto args = std::make_unique(loc); + auto var = std::move(stack_.top()); + stack_.pop(); + + while(var->type != gsc::node_t::stmt_waittill && var->type != gsc::node_t::stmt_waittillmatch) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + } + + if(var->type == gsc::node_t::stmt_waittill) + { + (*(gsc::stmt_waittill_ptr*)&var)->args = std::move(args); + } + + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(var))); + } + break; + case opcode::OP_checkclearparams: + { + // no needed + } + break; + case opcode::OP_notify: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_voidcodepos) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr), std::move(args)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_endon: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = nstr.as_node->loc; + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_voidCodepos: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_vector: + { + auto x = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto y = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto z = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = z.as_node->loc; + auto expr = std::make_unique(loc, std::move(x), std::move(y), std::move(z)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_size: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_EvalLevelFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalAnimFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalSelfFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalFieldVariable: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalLevelFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalAnimFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalSelfFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_ClearFieldVariable: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto expr = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto undef = gsc::expr_ptr(std::make_unique(loc)); + auto e = std::make_unique(loc, std::move(expr), std::move(undef)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::make_unique(loc, std::move(e)))); + } + break; + case opcode::OP_SafeCreateVariableFieldCached: + { + func_->params->list.push_back(std::make_unique(loc, "var_" + inst->data[0])); + } + break; + case opcode::OP_SafeSetWaittillVariableFieldCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableRefCached0: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableRefCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_SetLevelFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc,std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetVariableField: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + + if(lvalue.as_node->type == gsc::node_t::expr_increment) + { + auto stmt = std::make_unique(loc, std::move(lvalue.as_increment)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + else if(lvalue.as_node->type == gsc::node_t::expr_decrement) + { + auto stmt = std::make_unique(loc, std::move(lvalue.as_decrement)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + else + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + } + break; + case opcode::OP_SetAnimFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetSelfFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetLocalVariableFieldCached0: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, "0")); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetNewLocalVariableFieldCached0: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + + if(func_->block->stmts.size() > 0) + { + std::vector creates; + + while(func_->block->stmts.back().as_node->type == gsc::node_t::asm_create) + { + auto& entry = func_->block->stmts.back(); + if(loc.begin.line < entry.as_node->loc.begin.line) + { + creates.push_back(entry.as_asm_create->index); + func_->block->stmts.pop_back(); + continue; + } + break; + } + + std::reverse(creates.begin(), creates.end()); + lvalue.as_asm_create->vars = creates; + } + + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetLocalVariableFieldCached: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_ClearLocalVariableFieldCached: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_ClearLocalVariableFieldCached0: + { + auto stmt = std::make_unique(loc,"0"); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_EvalLocalVariableObjectCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_CastFieldObject: + case opcode::OP_CastBool: + { + //continue; + } + break; + case opcode::OP_BoolNot: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_BoolComplement: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_switch: + { + auto expr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = expr.as_node->loc; + auto sw = std::make_unique(loc, std::move(expr), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(sw))); + } + break; + case opcode::OP_endswitch: + { + auto count = inst->data[0]; + inst->data.erase(inst->data.begin()); + auto data = inst->data; + auto end = std::make_unique(loc, data, count); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(end))); + } + break; + case opcode::OP_jump: + { + auto expr = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + + } + break; + case opcode::OP_jumpback: + { + auto expr = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnTrue: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto e_not = gsc::expr_ptr(std::make_unique(loc, std::move(lvalue))); + auto expr = std::make_unique(loc, std::move(e_not), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnFalse: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnTrueExpr: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + stack_.push(std::move(expr)); + expr_labels_.push_back(inst->data[0]); + } + break; + case opcode::OP_JumpOnFalseExpr: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + stack_.push(std::move(expr)); + expr_labels_.push_back(inst->data[0]); + } + break; + default: + throw gsc::decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); + break; + } + } +} + +void decompiler::decompile_expr() +{ + auto expr = std::move(stack_.top()); + stack_.pop(); + + auto jump_expr = std::move(stack_.top()); + stack_.pop(); + auto loc = jump_expr->loc; + + if(jump_expr->type == gsc::node_t::asm_jump_true_expr) + { + auto lvalue = std::move((*(gsc::asm_jump_true_expr_ptr*)&jump_expr)->expr); + auto rvalue = gsc::expr_ptr(std::move(expr)); + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(e)); + } + else if(jump_expr->type == gsc::node_t::asm_jump_false_expr) + { + auto lvalue = std::move((*(gsc::asm_jump_false_expr_ptr*)&jump_expr)->expr); + auto rvalue = gsc::expr_ptr(std::move(expr)); + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(e)); + } + else + { + throw gsc::decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); + } +} + +void decompiler::decompile_block(const gsc::stmt_list_ptr& block) +{ + this->decompile_search_infinite(block); + this->decompile_search_loop(block); + this->decompile_search_switch(block); + this->decompile_search_ifelse(block); + this->decompile_break_continue(block); + this->decompile_nulls(block); +} + +void decompiler::decompile_nulls(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::null) + { + block->stmts.erase(block->stmts.begin() + index); + } + else index++; + } +} + +void decompiler::decompile_search_infinite(const gsc::stmt_list_ptr& block) +{ + std::int32_t index = block->stmts.size() - 1; + + while(index >= 0) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_jump_back) + { + auto break_loc = last_location_index(block, index) ? blocks_.back().loc_end : utils::string::va("loc_%X", block->stmts.at(index+1).as_node->loc.begin.line); + auto begin_loc = block->stmts.at(index).as_jump_back->value; + auto start = find_location_index(block, begin_loc); + + if(block->stmts.at(start).as_node->type != gsc::node_t::asm_jump_cond) + { + decompile_infinite(block, start, index); + index = start; + } + else if (block->stmts.at(start).as_cond->value != break_loc) + { + decompile_infinite(block, start, index); + index = start; + } + } + + index--; + } +} + +void decompiler::decompile_search_loop(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + auto& stmt = block->stmts.at(index); + + if(stmt.as_node->type == gsc::node_t::asm_jump_cond) + { + std::uint32_t end; + if(stmt.as_cond->value == blocks_.back().loc_end) + { + end = block->stmts.size() - 1; + } + else + { + end = find_location_index(block, stmt.as_cond->value) - 1; + } + + if(block->stmts.at(end).as_node->type == gsc::node_t::asm_jump_back + && utils::string::va("loc_%X", block->stmts.at(index).as_node->loc.begin.line) == block->stmts.at(end).as_jump_back->value) + { + decompile_loop(block, index, end); + index = 0; + } + } + index++; + } +} + +void decompiler::decompile_search_switch(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_switch) + { + decompile_switch(block, index); + } + + index++; + } +} + +void decompiler::decompile_search_ifelse(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + auto& stmt = block->stmts.at(index); + + if(stmt.as_node->type == gsc::node_t::asm_jump_cond) + { + std::uint32_t end; + if(stmt.as_cond->value == blocks_.back().loc_end) + { + end = block->stmts.size() - 1; + } + else + { + end = find_location_index(block, stmt.as_cond->value) - 1; + } + + auto last_loc = blocks_.back().loc_end; + + if(block->stmts.at(end).as_node->type == gsc::node_t::asm_jump) + { + // if block is a loop check break, continue + if(block->stmts.at(end).as_jump->value == blocks_.back().loc_continue) + { + // last if/else inside a loop still trigger this :( + decompile_if(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == blocks_.back().loc_break) + { + decompile_if(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == blocks_.back().loc_end) + { + decompile_ifelse(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == stmt.as_cond->value) + { + decompile_if(block, index, end); // if block, have a last empty else inside + } + else + { + decompile_ifelse(block, index, end); // TODO: if else block is empty, convert it to only if! + } + } + else if(block->stmts.at(end).as_node->type == gsc::node_t::stmt_return + && block->stmts.at(end).as_return->expr.as_node->type == gsc::node_t::null) + { + if(blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") + { + decompile_if(block, index, end); // inside a loop cant be last + } + else if(end - index == 1) + { + decompile_if(block, index, end); // only one explicit return + } + else if(block->stmts.back().as_node->type != gsc::node_t::stmt_return) + { + decompile_if(block, index, end); // block end is not a last return + } + else if(blocks_.back().is_last && block->stmts.back().as_node->type != gsc::node_t::stmt_return) + { + decompile_if(block, index, end); // inside a last block but is not and inner last + } + else if(find_location_reference(block, end, block->stmts.size(), last_loc)) + { + decompile_if(block, index, end); // reference to func end after the if + } + else if(blocks_.size() > 1 && !blocks_.back().is_last) + { + decompile_if(block, index, end); // fake last ifelse + } + else + { + decompile_last_ifelse(block, index, end); // special case + } + } + else + { + decompile_if(block, index, end); + } + } + index++; + } +} + +void decompiler::decompile_break_continue(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_jump) + { + auto loc = block->stmts.at(index).as_node->loc; + auto jump_loc = block->stmts.at(index).as_jump->value; + + if(jump_loc == blocks_.back().loc_continue) + { + block->stmts.erase(block->stmts.begin() + index); + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + block->stmts.insert(block->stmts.begin() + index, std::move(stmt)); + } + else if(jump_loc == blocks_.back().loc_break) + { + block->stmts.erase(block->stmts.begin() + index); + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + block->stmts.insert(block->stmts.begin() + index, std::move(stmt)); + } + } + + index++; + } +} + +void decompiler::decompile_if(const gsc::stmt_list_ptr& block, std::uint32_t begin, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_end = block->stmts.at(begin).as_cond->value; + ctx.loc_break = blocks_.back().loc_break; + ctx.loc_continue = blocks_.back().loc_continue; + + auto loc = block->stmts.at(begin).as_node->loc; + auto expr = std::move(block->stmts.at(begin).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + begin); // remove condition + + auto if_block = std::make_unique(loc); + + for(auto i = begin; i < end; i++) + { + if_block->stmts.push_back(std::move(block->stmts[begin])); + block->stmts.erase(block->stmts.begin() + begin); + } + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)))); + block->stmts.insert(block->stmts.begin() + begin, std::move(stmt)); +} + +void decompiler::decompile_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_break = blocks_.back().loc_break; + ctx.loc_continue = blocks_.back().loc_continue; + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto if_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) // skip the jump + { + if_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + auto end_loc = block->stmts.at(start).as_jump->value; + + block->stmts.erase(block->stmts.begin() + start); // remove jump + + std::uint32_t end_index; + + if(end_loc == blocks_.back().loc_end) + { + end_index = block->stmts.size(); + } + else + { + end_index = find_location_index(block, end_loc); + } + + gsc::context ctx2; + ctx2.loc_end = end_loc; + ctx2.loc_break = blocks_.back().loc_break; + ctx2.loc_continue = blocks_.back().loc_continue; + + auto else_block = std::make_unique(loc); + + for(auto i = start; i < end_index; i++) + { + else_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx2); + decompile_block(else_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)), gsc::stmt_ptr(std::move(else_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_last_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.is_last = true; + + auto inner_end = find_location_index(block, block->stmts.at(start).as_cond->value) - 1; + ctx.loc_end = utils::string::va("loc_%X",block->stmts.at(inner_end).as_node->loc.begin.line); + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto if_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + if_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + block->stmts.erase(block->stmts.begin() + start); // remove if block return; + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + if(start == block->stmts.size()) + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); + } + else + { + gsc::context ctx2; + ctx2.is_last = true; + + auto else_block = std::make_unique(loc); + + end = block->stmts.size(); + ctx2.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); // return is the block end + + for(auto i = start; i < end; i++) + { + else_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + else_block->stmts.pop_back(); // remove else return; + + blocks_.push_back(ctx2); + decompile_block(else_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)), gsc::stmt_ptr(std::move(else_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); + } +} + +void decompiler::decompile_infinite(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = last_location_index(block, end) ? blocks_.back().loc_end : utils::string::va("loc_%X", block->stmts.at(end+1).as_node->loc.begin.line); + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + + auto loc = block->stmts.at(start).as_node->loc; + + block->stmts.erase(block->stmts.begin() + end); // remove jump back + + auto for_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + for_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(for_block); + blocks_.pop_back(); + + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + auto expr = gsc::expr_ptr(std::make_unique()); + auto post_expr = gsc::stmt_ptr(std::make_unique()); + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(pre_expr), std::move(expr), std::move(post_expr), gsc::stmt_ptr(std::move(for_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + auto& last_stmt = block->stmts.at(end-1); + if(last_stmt.as_node->type == gsc::node_t::stmt_assign) + { + if(last_stmt.as_assign->expr->type == gsc::node_t::expr_assign_equal) + { + auto& rval = last_stmt.as_assign->expr->rvalue; + if(rval.as_node->type == gsc::node_t::expr_call) + { + if(rval.as_call->func.as_node->type == gsc::node_t::expr_call_function) + { + if(utils::string::to_lower(rval.as_call->func.as_func->name->value) == "getnextarraykey") + { + auto ref2 = utils::string::va("loc_%X", block->stmts.at(start).as_node->loc.begin.line); + if(find_location_reference(block, 0, start, ref2)) + { + // begin is at condition, not pre-expr + //decompile_while(block, start, end); + //return; + } + else + { + decompile_foreach(block, start, end); + return; + } + } + } + } + } + + if(start > 0) // while at func start + { + auto index = 1; + while(block->stmts.at(start - index).as_node->type == gsc::node_t::asm_create) + { + if(start - index > 0) + index++; + } + + if(block->stmts.at(start - index).as_node->type == gsc::node_t::stmt_assign) + { + auto ref = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + auto ref2 = utils::string::va("loc_%X", block->stmts.at(start).as_node->loc.begin.line); + + if(find_location_reference(block, start, end, ref)) + { + // continue is at jumpback, not post-expr + decompile_while(block, start, end); + return; + } + else if(find_location_reference(block, 0, start, ref2)) + { + // begin is at condition, not pre-expr + decompile_while(block, start, end); + return; + } + else + { + decompile_for(block, start, end); + return; + } + } + } + } + + decompile_while(block, start, end); +} + +void decompiler::decompile_while(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(start).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X",block->stmts.at(end).as_node->loc.begin.line); + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + end); // remove jump back + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto while_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + while_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(while_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(while_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_for(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(start).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + + // remove emit local var_creates + std::vector creates; + while(block->stmts.at(start - 1).as_node->type == gsc::node_t::asm_create) + { + creates.push_back(block->stmts.at(start - 1).as_asm_create->index); + block->stmts.erase(block->stmts.begin() + start - 1); + start--; + end--; + } + + std::reverse(creates.begin(), creates.end()); + + auto loc = block->stmts.at(start - 1).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + pre_expr.as_list->stmts.push_back(std::move(block->stmts.at(start - 1))); + pre_expr.as_list->is_expr = true; + auto post_expr = gsc::stmt_ptr(std::make_unique()); + post_expr.as_list->stmts.push_back(std::move(block->stmts.at(end - 1))); + post_expr.as_list->is_expr = true; + + start = start - 1; + end = end - 2; + for(auto i = start; i < start + 2; i++) // remove prologue (pre-expr, condition) + { + block->stmts.erase(block->stmts.begin() + start); + } + + end = end - 1; // set end in post-expr + for(auto i = end; i < end + 2; i++) // remove epilogue (post-expr, jump back) + { + block->stmts.erase(block->stmts.begin() + end); + } + + auto for_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + for_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(for_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(pre_expr), std::move(expr), std::move(post_expr), gsc::stmt_ptr(std::move(for_block)))); + stmt.as_for->vars = creates; + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_foreach(const gsc::stmt_list_ptr& block, std::uint32_t begin, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(begin).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + + // remove local var_creates + std::vector creates; + while(block->stmts.at(begin - 1).as_node->type == gsc::node_t::asm_create) + { + creates.push_back(block->stmts.at(begin - 1).as_asm_create->index); + block->stmts.erase(block->stmts.begin() + begin - 1); + begin--; + end--; + } + + std::reverse(creates.begin(), creates.end()); + + auto loc = block->stmts.at(begin - 2).as_node->loc; + + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + pre_expr.as_list->stmts.push_back(std::move(block->stmts[begin-2])); + pre_expr.as_list->stmts.push_back(std::move(block->stmts[begin-1])); + auto stmt0 = std::move(block->stmts[begin+1]); + + begin = begin - 2; + end = end - 4; + for(auto i = begin; i < begin + 4; i++) // remove prologue ( array, elem, cond, elemRef) + { + block->stmts.erase(block->stmts.begin() + begin); + } + + end = end - 1; // set end to post-expr + + for(auto i = end; i < end + 2; i++) // remove epilogue ( post-expr, jump back) + { + block->stmts.erase(block->stmts.begin() + end); + } + + if(block->stmts.size() > end && block->stmts.at(end).as_node->type == gsc::node_t::asm_clear) + { + block->stmts.erase(block->stmts.begin() + end); + } + + auto use_key = true; + + if(block->stmts.size() > end && block->stmts.at(end).as_node->type == gsc::node_t::asm_clear) + { + block->stmts.erase(block->stmts.begin() + end); + use_key = false; + } + + auto foreach_block = std::make_unique(loc); + + for(auto i = begin; i < end; i++) + { + foreach_block->stmts.push_back(std::move(block->stmts[begin])); + block->stmts.erase(block->stmts.begin() + begin); + } + + blocks_.push_back(ctx); + decompile_block(foreach_block); + blocks_.pop_back(); + + auto foreach_stmt = gsc::stmt_ptr(std::make_unique(loc, gsc::stmt_ptr(std::move(foreach_block)), use_key)); + foreach_stmt.as_foreach->vars = creates; + foreach_stmt.as_foreach->pre_expr = std::move(pre_expr); + foreach_stmt.as_foreach->stmt0 = std::move(stmt0); + + block->stmts.insert(block->stmts.begin() + begin, std::move(foreach_stmt)); +} + +void decompiler::decompile_switch(const gsc::stmt_list_ptr& block, std::uint32_t start) +{ + gsc::context ctx; + ctx.loc_continue = blocks_.back().loc_continue; + ctx.loc_end = block->stmts.at(start).as_asm_switch->value; + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_asm_switch->expr); + auto end_loc = block->stmts.at(start).as_asm_switch->value; + auto end = find_location_index(block, end_loc); + + if(end == block->stmts.size() - 1) + { + ctx.loc_break = blocks_.back().loc_end; + } + else + { + ctx.loc_break = utils::string::va("loc_%X", block->stmts.at(end + 1).as_node->loc.begin.line); + } + + // collect cases + auto casenum = std::atol(block->stmts.at(end).as_asm_endswitch->count.data()); + auto data = block->stmts.at(end).as_asm_endswitch->data; + auto idx = 0; + + for(auto i = 0; i < casenum; i++) + { + if(data.at(idx) == "case") + { + auto loc_str = data.at(idx+2); + auto loc_idx = find_location_index(block, loc_str); + auto loc_pos = gsc::location(&filename_, std::stol(loc_str.substr(4), 0, 16)); + auto value = gsc::expr_ptr(std::make_unique(loc_pos, data.at(idx+1))); + auto list = std::make_unique(loc); + list->is_case = true; + auto stmt = gsc::stmt_ptr(std::make_unique(loc_pos, std::move(value), std::move(list))); + block->stmts.insert(block->stmts.begin() + loc_idx, std::move(stmt)); + idx += 3; + } + else if(data.at(idx) == "default") + { + auto loc_str = data.at(idx+1); + auto loc_idx = find_location_index(block, loc_str); + auto loc_pos = gsc::location(&filename_, std::stol(loc_str.substr(4), 0, 16)); + auto list = std::make_unique(loc); + list->is_case = true; + auto stmt = gsc::stmt_ptr(std::make_unique(loc_pos, std::move(list))); + block->stmts.insert(block->stmts.begin() + loc_idx, std::move(stmt)); + idx += 2; + } + } + + end = find_location_index(block, end_loc) - 1; // update end; + block->stmts.erase(block->stmts.begin() + start); // remove switch + block->stmts.erase(block->stmts.begin() + end); // remove endswitch + + //decompile block + auto sw_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + sw_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(sw_block); + blocks_.pop_back(); + + auto stmt_list = std::make_unique(loc); + gsc::stmt_ptr current_case = gsc::stmt_ptr(std::make_unique()); + + auto num = sw_block->stmts.size(); + for(auto i = 0; i < num; i++) + { + auto& entry = sw_block->stmts[0]; + + if(entry.as_node->type == gsc::node_t::stmt_case || entry.as_node->type == gsc::node_t::stmt_default) + { + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + current_case = std::move(sw_block->stmts[0]); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + else + { + if(current_case.as_node->type != gsc::node_t::null) + { + if(current_case.as_node->type == gsc::node_t::stmt_case) + { + current_case.as_case->stmt->stmts.push_back(std::move(sw_block->stmts[0])); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + else + { + current_case.as_default->stmt->stmts.push_back(std::move(sw_block->stmts[0])); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + } + else + { + gsc::decomp_error("missing case before stmt inside switch!"); + } + } + } + + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), std::move(stmt_list))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +auto decompiler::find_location_reference(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end, const std::string& location) -> bool +{ + for(auto i = start; i < end; i++) + { + if(block->stmts.at(i).as_node->type == gsc::node_t::asm_jump_cond) + { + if(block->stmts.at(i).as_cond->value == location) + return true; + } + else if(block->stmts.at(i).as_node->type == gsc::node_t::asm_jump) + { + if(block->stmts.at(i).as_jump->value == location) + return true; + } + } + + return false; +} + +auto decompiler::find_location_index(const gsc::stmt_list_ptr& block, const std::string& location) -> std::uint32_t +{ + auto index = 0; + + if(location == blocks_.back().loc_end) + return block->stmts.size(); + + for(auto& stmt : block->stmts) + { + if(stmt.as_node->loc.begin.line == std::stol(location.substr(4), 0, 16)) + return index; + + index++; + } + + throw gsc::decomp_error("LOCATION NOT FOUND! (" + location + ")"); +} + +auto decompiler::last_location_index(const gsc::stmt_list_ptr& block, std::uint32_t index) -> bool +{ + if(index == block->stmts.size() - 1) + return true; + + return false; +} + +void decompiler::process_stack(const gsc::thread_ptr& thread) +{ + auto ctx = std::make_unique(); + + process_parameters(ctx, thread->params); + process_stmt_list(ctx, thread->block); + +} + +void decompiler::process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + ctx->local_vars.push_back({ param->value, static_cast(std::stoi(param->value.substr(4))), true }); + ctx->local_vars_create_count++; + } +} + +void decompiler::process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt) +{ + switch(stmt.as_node->type) + { + case gsc::node_t::stmt_list: process_stmt_list(ctx, stmt.as_list); break; + case gsc::node_t::stmt_call: process_stmt_call(ctx, stmt.as_call); break; + case gsc::node_t::stmt_assign: process_stmt_assign(ctx, stmt.as_assign); break; + case gsc::node_t::stmt_endon: process_stmt_endon(ctx, stmt.as_endon); break; + case gsc::node_t::stmt_notify: process_stmt_notify(ctx, stmt.as_notify); break; + case gsc::node_t::stmt_wait: process_stmt_wait(ctx, stmt.as_wait); break; + case gsc::node_t::stmt_waittill: process_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_waittillmatch: process_stmt_waittillmatch(ctx, stmt.as_waittillmatch); break; + case gsc::node_t::stmt_if: process_stmt_if(ctx, stmt.as_if); break; + case gsc::node_t::stmt_ifelse: process_stmt_ifelse(ctx, stmt.as_ifelse); break; + case gsc::node_t::stmt_while: process_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: process_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: process_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: process_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_break: process_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_return: process_stmt_return(ctx, stmt.as_return); break; + case gsc::node_t::asm_remove: process_var_remove(ctx, stmt.as_asm_remove); break; + case gsc::node_t::asm_create: + { + auto expr = gsc::expr_ptr(std::make_unique(stmt.as_asm_create->index)); + process_var_create(ctx, expr, true); + } + break; + default: break; + } +} + +void decompiler::process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + for (const auto& entry : stmt->stmts) + { + process_stmt(ctx, entry); + } + + for(auto i = 0; i < stmt->stmts.size(); i++) + { + auto type = stmt->stmts.at(i).as_node->type; + + if(type == gsc::node_t::asm_create || type == gsc::node_t::asm_remove) + { + stmt->stmts.erase(stmt->stmts.begin() + i); + i--; + } + } +} + +void decompiler::process_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt) +{ + process_expr_call(ctx, stmt->expr); +} + +void decompiler::process_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt) +{ + process_expr_assign(ctx, stmt->expr); +} + +void decompiler::process_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt) +{ + process_expr_arguments(ctx, stmt->args); + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt) +{ + process_expr(ctx, stmt->expr); +} + +void decompiler::process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); + process_expr_arguments(ctx, stmt->args); +} + +void decompiler::process_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt) +{ + process_expr_arguments(ctx, stmt->args); + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx_if = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx_if); + + process_stmt(stmt->ctx_if, stmt->stmt_if); + + stmt->ctx_else = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx_else); + + process_stmt(stmt->ctx_else, stmt->stmt_else); + + std::vector childs({stmt->ctx_if.get(), stmt->ctx_else.get()}); + ctx->append(childs); + + if(stmt->stmt_if.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt_if.as_list->stmts.at(0))) + { + stmt->stmt_if = std::move(stmt->stmt_if.as_list->stmts.back()); + } + + if(stmt->stmt_else.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt_noif(stmt->stmt_else.as_list->stmts.at(0))) + { + stmt->stmt_else = std::move(stmt->stmt_else.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt); + + std::vector childs({ stmt->ctx.get() }); + + if(stmt->expr.as_node->type == gsc::node_t::null) + ctx->append_decompiler(stmt->ctx); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + process_stmt(ctx, stmt->pre_expr); + + for(auto& index : stmt->vars) + { + auto var = utils::string::va("var_%d", std::stoi(index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(index)), true }); + ctx->local_vars_create_count++; + } + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_expr(ctx, stmt->expr); + + process_stmt(stmt->ctx, stmt->stmt); + + process_stmt(ctx, stmt->post_expr); + + if(stmt->expr.as_node->type == gsc::node_t::null) + ctx->append_decompiler(stmt->ctx); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + process_stmt(ctx, stmt->pre_expr); + + for(auto& index : stmt->vars) + { + auto var1 = utils::string::va("var_%d", std::stoi(index)); + ctx->local_vars.push_back({ var1, static_cast(std::stoi(index)), true }); + ctx->local_vars_create_count++; + } + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt0); + process_stmt(stmt->ctx, stmt->stmt); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } + + stmt->array_expr = std::move(stmt->pre_expr.as_list->stmts[0].as_assign->expr->rvalue); + stmt->value_expr = std::move(stmt->stmt0.as_assign->expr->lvalue); + stmt->key_expr = std::move(stmt->pre_expr.as_list->stmts[1].as_assign->expr->lvalue); +} + +void decompiler::process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt_cases(stmt->ctx, stmt->stmt); + + ctx->append_decompiler(stmt->ctx, true); +} + +void decompiler::process_stmt_cases(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + std::vector childs; + + for(auto& entry : stmt->stmts) + { + if(entry.as_node->type == gsc::node_t::stmt_case) + { + entry.as_case->ctx = std::make_unique(); + ctx->transfer_decompiler(entry.as_case->ctx); + + process_stmt_list(entry.as_case->ctx, entry.as_case->stmt); + + if(entry.as_case->ctx->abort == gsc::abort_t::abort_break) + { + childs.push_back(entry.as_case->ctx.get()); + } + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + entry.as_default->ctx = std::make_unique(); + ctx->transfer_decompiler(entry.as_default->ctx); + + process_stmt_list(entry.as_default->ctx, entry.as_default->stmt); + + if(entry.as_default->ctx->abort == gsc::abort_t::abort_break) + { + childs.push_back(entry.as_default->ctx.get()); + } + } + } + + ctx->append(childs); +} + +void decompiler::process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + ctx->abort = gsc::abort_t::abort_break; +} + +void decompiler::process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(stmt->expr.as_node->type == gsc::node_t::null) + { + return; + } + + process_expr(ctx, stmt->expr); +} + +void decompiler::process_expr(const gsc::context_ptr& ctx, gsc::expr_ptr& expr) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_increment: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_decrement: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_equal: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_add: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_sub: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_mult: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_div: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_mod: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_shift_left: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_shift_right: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_or: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_and: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_exor: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_and: process_expr_and(ctx, expr.as_and); break; + case gsc::node_t::expr_or: process_expr_or(ctx, expr.as_or); break; + case gsc::node_t::expr_equality: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_inequality: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less_equal: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater_equal: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_or: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_and: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_exor: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_left: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_right: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_add: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_sub: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mult: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_div: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mod: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_complement: process_expr_complement(ctx, expr.as_complement); break; + case gsc::node_t::expr_not: process_expr_not(ctx, expr.as_not); break; + case gsc::node_t::expr_call: process_expr_call(ctx, expr.as_call); break; + case gsc::node_t::expr_function: process_expr_function(ctx, expr.as_function); break; + case gsc::node_t::expr_add_array: process_expr_add_array(ctx, expr.as_add_array); break; + case gsc::node_t::expr_array: process_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: process_field_variable(ctx, expr.as_field); break; + case gsc::node_t::expr_size: process_expr_size(ctx, expr.as_size); break; + case gsc::node_t::data_name: process_local_variable(ctx, expr.as_name); break; + case gsc::node_t::data_vector: process_vector(ctx, expr.as_vector); break; + case gsc::node_t::asm_create: process_var_create(ctx, expr); break; + case gsc::node_t::asm_access: process_var_access(ctx, expr); break; + default: break; + } +} + +void decompiler::process_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr) +{ + if(expr->type == gsc::node_t::expr_increment) + { + process_expr(ctx, expr->lvalue); + } + else if(expr->type == gsc::node_t::expr_decrement) + { + process_expr(ctx, expr->lvalue); + } + else + { + process_expr(ctx, expr->rvalue); + process_expr(ctx, expr->lvalue); + } +} + +void decompiler::process_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr) +{ + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr) +{ + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + if(expr->func.as_node->type == gsc::node_t::expr_call_pointer) + { + process_expr_call_pointer(ctx, expr); + } + else + { + process_expr_call_function(ctx, expr); + } +} + +void decompiler::process_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + process_expr_arguments(ctx, expr->func.as_pointer->args); + + if(expr->obj.as_node->type != gsc::node_t::null) + process_expr(ctx, expr->obj); + + process_expr(ctx, expr->func.as_pointer->expr); +} + +void decompiler::process_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + process_expr_arguments(ctx, expr->func.as_func->args); + + if(expr->obj.as_node->type != gsc::node_t::null) + process_expr(ctx, expr->obj); +} + +void decompiler::process_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& args) +{ + for(auto i = args->list.size(); i > 0; i--) + { + process_expr(ctx, args->list.at(i - 1)); + } +} + +void decompiler::process_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& expr) +{ + return; +} + +void decompiler::process_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr) +{ + for(auto& arg : expr->args->list) + { + process_expr(ctx, arg); + } +} + +void decompiler::process_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr) +{ + process_expr(ctx, expr->obj); +} + +void decompiler::process_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr) +{ + process_expr(ctx, expr->key); + process_expr(ctx, expr->obj); +} + +void decompiler::process_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr) +{ + process_expr(ctx, expr->obj); +} + +void decompiler::process_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + return; +} + +void decompiler::process_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec) +{ + process_expr(ctx, vec->z); + process_expr(ctx, vec->y); + process_expr(ctx, vec->x); +} + +void decompiler::process_var_create(const gsc::context_ptr& ctx, gsc::expr_ptr& expr, bool fromstmt) +{ + if(fromstmt) + { + auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); + ctx->local_vars_create_count++; + } + else + { + for(auto& entry : expr.as_asm_create->vars) + { + ctx->local_vars.push_back({ utils::string::va("var_%d", std::stoi(entry)), static_cast(std::stoi(entry)), true }); + ctx->local_vars_create_count++; + } + + auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); + ctx->local_vars_create_count++; + + expr = gsc::expr_ptr(std::make_unique(var)); + } +} + +void decompiler::process_var_access(const gsc::context_ptr& ctx, gsc::expr_ptr& expr) +{ + if(ctx->local_vars.size() <= std::stoi(expr.as_asm_access->index)) + { + printf("WARNING: bad local var access\n"); + } + else + { + auto var = ctx->local_vars.at(ctx->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; + expr = gsc::expr_ptr(std::make_unique(var)); + } +} + +void decompiler::process_var_remove(const gsc::context_ptr& ctx, const gsc::asm_remove_ptr& expr) +{ + ctx->local_vars_public_count = ctx->local_vars.size() - std::stoi(expr->index); +} + +} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/decompiler.hpp b/src/h2/xsk/decompiler.hpp new file mode 100644 index 00000000..c83e7b5e --- /dev/null +++ b/src/h2/xsk/decompiler.hpp @@ -0,0 +1,93 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::h2 +{ + +class decompiler : public gsc::decompiler +{ + std::string filename_; + std::unique_ptr output_; + gsc::program_ptr program_; + gsc::thread_ptr func_; + std::unordered_map labels_; + std::vector expr_labels_; + std::stack stack_; + std::vector blocks_; + +public: + auto output() -> std::vector; + void decompile(const std::string& file, std::vector& functions); + +private: + void decompile_function(const gsc::function_ptr& func); + void decompile_statements(const gsc::function_ptr& func); + void decompile_expr(); + void decompile_block(const gsc::stmt_list_ptr& block); + void decompile_nulls(const gsc::stmt_list_ptr& block); + void decompile_search_infinite(const gsc::stmt_list_ptr& block); + void decompile_search_loop(const gsc::stmt_list_ptr& block); + void decompile_search_switch(const gsc::stmt_list_ptr& block); + void decompile_search_ifelse(const gsc::stmt_list_ptr& block); + void decompile_break_continue(const gsc::stmt_list_ptr& block); + void decompile_if(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_last_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_infinite(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_while(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_for(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_foreach(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_switch(const gsc::stmt_list_ptr& block, std::uint32_t start); + auto find_location_reference(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end, const std::string& location) -> bool; + auto find_location_index(const gsc::stmt_list_ptr& block, const std::string& location) -> std::uint32_t; + auto last_location_index(const gsc::stmt_list_ptr& block, std::uint32_t index) -> bool; + void process_stack(const gsc::thread_ptr& thread); + void process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt); + void process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt); + void process_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt); + void process_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt); + void process_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt); + void process_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt); + void process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void process_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt); + void process_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt); + void process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt); + void process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt); + void process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void process_stmt_cases(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void process_expr(const gsc::context_ptr& ctx, gsc::expr_ptr& expr); + void process_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr); + void process_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr); + void process_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr); + void process_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr); + void process_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr); + void process_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr); + void process_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& arg_list); + void process_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& node); + void process_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr); + void process_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr); + void process_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr); + void process_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr); + void process_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void process_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec); + void process_var_create(const gsc::context_ptr& ctx, gsc::expr_ptr& expr, bool fromstmt = false); + void process_var_access(const gsc::context_ptr& ctx, gsc::expr_ptr& expr); + void process_var_remove(const gsc::context_ptr& ctx, const gsc::asm_remove_ptr& expr); +}; + +} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/disassembler.cpp b/src/h2/xsk/disassembler.cpp new file mode 100644 index 00000000..0e2bc714 --- /dev/null +++ b/src/h2/xsk/disassembler.cpp @@ -0,0 +1,573 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "h2.hpp" + +namespace xsk::gsc::h2 +{ + +auto disassembler::output() -> std::vector +{ + return std::move(functions_); +} + +auto disassembler::output_data() -> std::vector +{ + output_ = std::make_unique(0x100000); + + output_->write_string("// H2 PC GSCASM\n"); + output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); + + for (auto& func : functions_) + { + this->print_function(func); + } + + std::vector output; + + output.resize(output_->pos()); + memcpy(output.data(), output_->buffer().data(), output.size()); + + return output; +} + +void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) +{ + filename_ = file; + script_ = std::make_unique(script); + stack_ = std::make_unique(stack); + functions_.clear(); + + script_->seek(1); + + while (stack_->is_avail() && script_->is_avail()) + { + functions_.push_back(std::make_unique()); + auto& func = functions_.back(); + + func->index = static_cast(script_->pos()); + func->size = stack_->read(); + func->id = stack_->read(); + func->name = "sub_"s + (func->id == 0 ? stack_->read_c_string() : resolver::token_name(func->id)); + + this->dissasemble_function(func); + + func->labels = labels_; + labels_.clear(); + } + + this->resolve_local_functions(); +} + +void disassembler::dissasemble_function(const gsc::function_ptr& func) +{ + auto size = func->size; + + while (size > 0) + { + func->instructions.push_back(std::make_unique()); + + auto& inst = func->instructions.back(); + inst->index = static_cast(script_->pos()); + inst->opcode = script_->read(); + inst->size = opcode_size(inst->opcode); + + this->dissasemble_instruction(inst); + + size -= inst->size; + } +} + + +void disassembler::dissasemble_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_Return: + case opcode::OP_BoolNot: + case opcode::OP_CastBool: + case opcode::OP_inequality: + case opcode::OP_GetThisthread: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_checkclearparams: + case opcode::OP_CastFieldObject: + case opcode::OP_End: + case opcode::OP_size: + case opcode::OP_EmptyArray: + case opcode::OP_bit_and: + case opcode::OP_less_equal: + case opcode::OP_voidCodepos: + case opcode::OP_ClearVariableField: + case opcode::OP_divide: + case opcode::OP_GetSelf: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_plus: + case opcode::OP_BoolComplement: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_inc: + case opcode::OP_clearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_endon: + case opcode::OP_greater_equal: + case opcode::OP_GetSelfObject: + case opcode::OP_SetVariableField: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_less: + case opcode::OP_GetGameRef: + case opcode::OP_waitFrame: + case opcode::OP_waittillFrameEnd: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_notify: + case opcode::OP_DecTop: + case opcode::OP_shift_left: + case opcode::OP_greater: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_minus: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_multiply: + case opcode::OP_mod: + case opcode::OP_GetGame: + case opcode::OP_waittill: + case opcode::OP_dec: + case opcode::OP_PreScriptCall: + case opcode::OP_GetAnim: + case opcode::OP_GetUndefined: + case opcode::OP_GetAnimObject: + case opcode::OP_GetLevelObject: + case opcode::OP_bit_ex_or: + case opcode::OP_equality: + case opcode::OP_ClearArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalArray: + case opcode::OP_vector: + case opcode::OP_bit_or: + case opcode::OP_AddArray: + case opcode::OP_waittillmatch2: + case opcode::OP_shift_right: + break; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetInteger: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetFloat: + inst->data.push_back(utils::string::va("%g", script_->read())); + break; + case opcode::OP_GetVector: + inst->data.push_back(utils::string::va("%g", script_->read())); + inst->data.push_back(utils::string::va("%g", script_->read())); + inst->data.push_back(utils::string::va("%g", script_->read())); + break; + case opcode::OP_GetString: + case opcode::OP_GetIString: + script_->seek(4); + inst->data.push_back(utils::string::to_literal(stack_->read_c_string())); + break; + case opcode::OP_GetAnimation: + script_->seek(8); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + break; + case opcode::OP_GetAnimTree: + script_->seek(1); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + break; + case opcode::OP_waittillmatch: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_EvalLocalArrayCached: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + this->disassemble_field_variable(inst); + break; + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + this->disassemble_local_call(inst, false); + break; + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + this->disassemble_local_call(inst, true); + break; + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + this->disassemble_far_call(inst, false); + break; + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + this->disassemble_far_call(inst, true); + break; + case opcode::OP_CallBuiltin: + this->disassemble_builtin_call(inst, false, true); + break; + case opcode::OP_CallBuiltinMethod: + this->disassemble_builtin_call(inst, true, true); + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + this->disassemble_builtin_call(inst, false, false); + break; + case opcode::OP_GetBuiltinMethod: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + this->disassemble_builtin_call(inst, true, false); + break; + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + this->disassemble_jump(inst, true, false); + break; + case opcode::OP_jumpback: + this->disassemble_jump(inst, false, true); + break; + case opcode::OP_jump: + this->disassemble_jump(inst, false, false); + break; + case opcode::OP_switch: + this->disassemble_switch(inst); + break; + case opcode::OP_endswitch: + this->disassemble_end_switch(inst); + break; + default: + throw gsc::disasm_error(utils::string::va("Unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); + } +} + +void disassembler::disassemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num) +{ + if (arg_num) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } + + if (method) + { + inst->data.push_back(resolver::method_name(script_->read())); + } + else + { + inst->data.push_back(resolver::function_name(script_->read())); + } +} + +void disassembler::disassemble_local_call(const gsc::instruction_ptr& inst, bool thread) +{ + std::int32_t offset = this->disassemble_offset(); + + inst->data.push_back(utils::string::va("%X", offset + inst->index + 1)); + + if (thread) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } +} + +void disassembler::disassemble_far_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->seek(3); + + if (thread) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } + + auto file_id = stack_->read(); + auto file_name = file_id == 0 ? stack_->read_c_string() : resolver::file_name(file_id); + auto func_id = stack_->read(); + auto func_name = func_id == 0 ? stack_->read_c_string() : resolver::token_name(func_id); + + inst->data.push_back(file_name != "" ? file_name : utils::string::va("_ID%i", file_id)); + inst->data.push_back(func_name != "" ? func_name : utils::string::va("_ID%i", func_id)); +} + +void disassembler::disassemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back) +{ + std::int32_t addr; + std::string label; + + if (expr) + { + addr = inst->index + 3 + script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + else if (back) + { + addr = inst->index + 3 - script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + else + { + addr = inst->index + 5 + script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + + labels_.insert({addr, label}); +} + +void disassembler::disassemble_field_variable(const gsc::instruction_ptr& inst) +{ + std::uint16_t field_id = script_->read(); + std::string field_name; + + if(field_id > 0xD5D7) + { + auto temp = stack_->read(); + field_name = temp == 0 ? stack_->read_c_string() : std::to_string(temp); + } + else + { + field_name = resolver::token_name(field_id); + } + + inst->data.push_back(field_name != "" ? field_name : utils::string::va("_ID%i", field_id)); +} + +void disassembler::disassemble_switch(const gsc::instruction_ptr& inst) +{ + std::int32_t addr = inst->index + 4 + script_->read(); + std::string label = utils::string::va("loc_%X", addr); + + inst->data.push_back(label); + labels_.insert({addr, label}); +} + +void disassembler::disassemble_end_switch(const gsc::instruction_ptr& inst) +{ + std::uint16_t case_num = script_->read(); + inst->data.push_back(utils::string::va("%i", case_num)); + + std::uint32_t internal_index = inst->index + 3; + + if (case_num) + { + for (auto i = case_num; i > 0; i--) + { + std::uint32_t case_label = script_->read(); + + if (case_label < 0x40000 && case_label > 0) + { + inst->data.push_back("case"); + inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); + } + else if (case_label == 0) + { + inst->data.push_back("default"); + stack_->read(); + } + else + { + inst->data.push_back("case"); + inst->data.push_back(utils::string::va("%i", (case_label - 0x800000) & 0xFFFFFF)); + } + + inst->size += 4; + internal_index += 4; + + auto addr = this->disassemble_offset() + internal_index; + std::string label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + + labels_.insert({addr, label}); + + inst->size += 3; + internal_index += 3; + } + } +} + +auto disassembler::disassemble_offset() -> std::int32_t +{ + std::array bytes = {}; + + for (auto i = 0; i < 3; i++) + { + bytes[i] = script_->read(); + } + + std::int32_t offset = *reinterpret_cast(bytes.data()); + + offset = (offset << 8) >> 10; + + return offset; +} + +void disassembler::resolve_local_functions() +{ + for (auto& func : functions_) + { + for (auto& inst : func->instructions) + { + switch (opcode(inst->opcode)) + { + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + inst->data.at(0) = this->resolve_function(inst->data[0]); + break; + default: + break; + } + } + } +} + +auto disassembler::resolve_function(const std::string& index) -> std::string +{ + if (utils::string::is_hex_number(index)) + { + std::uint32_t idx = std::stoul(index, nullptr, 16); + + for (auto& func : functions_) + { + if (func->index == idx) + { + return func->name; + } + } + + throw gsc::disasm_error(utils::string::va("Couldn't resolve function name at index '0x%04X'!", idx)); + } + + throw gsc::disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); +} + +void disassembler::print_function(const gsc::function_ptr& func) +{ + output_->write_string("\n"); + output_->write_string(utils::string::va("%s\n", func->name.data())); + + for (auto& inst : func->instructions) + { + const auto itr = func->labels.find(inst->index); + + if (itr != func->labels.end()) + { + output_->write_string(utils::string::va("\t%s\n", itr->second.data())); + } + + this->print_instruction(inst); + } + + output_->write_string("\n"); + output_->write_string(utils::string::va("end_%s\n", func->name.substr(4).data())); +} + +void disassembler::print_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_endswitch: + output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); + output_->write_string(utils::string::va(" %s\n", inst->data[0].data())); + { + std::uint32_t totalcase = std::stoul(inst->data[0]); + auto index = 0; + for (auto casenum = 0u; casenum < totalcase; casenum++) + { + if (inst->data[1 + index] == "case") + { + output_->write_string(utils::string::va("\t\t\t%s %s %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data(), inst->data[1 + index + 2].data())); + index += 3; + } + else if (inst->data[1 + index] == "default") + { + output_->write_string(utils::string::va("\t\t\t%s %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data())); + index += 2; + } + if (casenum != totalcase - 1) + { + output_->write_string("\n"); + } + } + } + break; + default: + output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); + for (auto& d : inst->data) + { + output_->write_string(utils::string::va(" %s", d.data())); + } + break; + } + + output_->write_string("\n"); +} + +} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/disassembler.hpp b/src/h2/xsk/disassembler.hpp new file mode 100644 index 00000000..0afb0cca --- /dev/null +++ b/src/h2/xsk/disassembler.hpp @@ -0,0 +1,42 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::h2 +{ + +class disassembler : public gsc::disassembler +{ + std::string filename_; + utils::byte_buffer_ptr script_; + utils::byte_buffer_ptr stack_; + utils::byte_buffer_ptr output_; + std::vector functions_; + std::unordered_map labels_; + +public: + auto output() -> std::vector; + auto output_data() -> std::vector; + void disassemble(const std::string& file, std::vector& script, std::vector& stack); + +private: + void dissasemble_function(const gsc::function_ptr& func); + void dissasemble_instruction(const gsc::instruction_ptr& inst); + void disassemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num); + void disassemble_local_call(const gsc::instruction_ptr& inst, bool thread); + void disassemble_far_call(const gsc::instruction_ptr& inst, bool thread); + void disassemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back); + void disassemble_field_variable(const gsc::instruction_ptr& inst); + void disassemble_switch(const gsc::instruction_ptr& inst); + void disassemble_end_switch(const gsc::instruction_ptr& inst); + auto disassemble_offset() -> std::int32_t; + void resolve_local_functions(); + auto resolve_function(const std::string& index) -> std::string; + void print_function(const gsc::function_ptr& func); + void print_instruction(const gsc::instruction_ptr& inst); +}; + +} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/h2.cpp b/src/h2/xsk/h2.cpp new file mode 100644 index 00000000..17cd9f92 --- /dev/null +++ b/src/h2/xsk/h2.cpp @@ -0,0 +1,182 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "h2.hpp" + +namespace xsk::gsc::h2 +{ + +auto opcode_size(std::uint8_t id) -> std::uint32_t +{ + switch (opcode(id)) + { + case opcode::OP_Return: + case opcode::OP_BoolNot: + case opcode::OP_CastBool: + case opcode::OP_inequality: + case opcode::OP_GetThisthread: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_checkclearparams: + case opcode::OP_CastFieldObject: + case opcode::OP_End: + case opcode::OP_size: + case opcode::OP_EmptyArray: + case opcode::OP_bit_and: + case opcode::OP_less_equal: + case opcode::OP_voidCodepos: + case opcode::OP_ClearVariableField: + case opcode::OP_divide: + case opcode::OP_GetSelf: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_plus: + case opcode::OP_BoolComplement: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_inc: + case opcode::OP_clearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_endon: + case opcode::OP_greater_equal: + case opcode::OP_GetSelfObject: + case opcode::OP_SetVariableField: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_less: + case opcode::OP_GetGameRef: + case opcode::OP_waitFrame: + case opcode::OP_waittillFrameEnd: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_notify: + case opcode::OP_DecTop: + case opcode::OP_shift_left: + case opcode::OP_greater: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_minus: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_multiply: + case opcode::OP_mod: + case opcode::OP_GetGame: + case opcode::OP_waittill: + case opcode::OP_dec: + case opcode::OP_PreScriptCall: + case opcode::OP_GetAnim: + case opcode::OP_GetUndefined: + case opcode::OP_GetAnimObject: + case opcode::OP_GetLevelObject: + case opcode::OP_bit_ex_or: + case opcode::OP_equality: + case opcode::OP_ClearArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalArray: + case opcode::OP_vector: + case opcode::OP_bit_or: + case opcode::OP_AddArray: + case opcode::OP_waittillmatch2: + case opcode::OP_shift_right: + return 1; + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_CallBuiltinPointer: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_ScriptMethodChildThreadCallPointer: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_GetNegByte: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_EvalLocalArrayCached: + case opcode::OP_GetByte: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_GetAnimTree: + return 2; + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_GetUnsignedShort: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_GetBuiltinFunction: + case opcode::OP_jumpback: + case opcode::OP_GetBuiltinMethod: + case opcode::OP_waittillmatch: + case opcode::OP_GetNegUnsignedShort: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + case opcode::OP_JumpOnFalse: + case opcode::OP_endswitch: + return 3; + case opcode::OP_CallBuiltin: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_GetLocalFunction: + case opcode::OP_CallBuiltinMethod: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarMethodCall: + return 4; + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_GetFloat: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_switch: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + case opcode::OP_jump: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_GetInteger: + case opcode::OP_GetString: + case opcode::OP_GetIString: + return 5; + case opcode::OP_GetAnimation: + return 9; + case opcode::OP_GetVector: + return 13; + default: + throw std::runtime_error("Couldn't resolve instruction size for " + std::to_string(id)); + } +} + +} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/h2.hpp b/src/h2/xsk/h2.hpp new file mode 100644 index 00000000..4741a6b6 --- /dev/null +++ b/src/h2/xsk/h2.hpp @@ -0,0 +1,180 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "utils/xsk/utils.hpp" + +#include "assembler.hpp" +#include "disassembler.hpp" +#include "compiler.hpp" +#include "decompiler.hpp" +#include "resolver.hpp" + +namespace xsk::gsc::h2 +{ + +enum class opcode : std::uint8_t +{ + OP_SetNewLocalVariableFieldCached0 = 0x17, + OP_EvalSelfFieldVariable = 0x18, + OP_Return = 0x19, + OP_CallBuiltin0 = 0x1A, + OP_CallBuiltin1 = 0x1B, + OP_CallBuiltin2 = 0x1C, + OP_CallBuiltin3 = 0x1D, + OP_CallBuiltin4 = 0x1E, + OP_CallBuiltin5 = 0x1F, + OP_CallBuiltin = 0x20, + OP_BoolNot = 0x21, + OP_ScriptFarMethodThreadCall = 0x22, + OP_JumpOnTrueExpr = 0x23, + OP_SetLevelFieldVariableField = 0x24, + OP_CastBool = 0x25, + OP_EvalNewLocalArrayRefCached0 = 0x26, + OP_CallBuiltinPointer = 0x27, + OP_inequality = 0x28, + OP_GetThisthread = 0x29, + OP_ClearFieldVariable = 0x2A, + OP_GetFloat = 0x2B, + OP_SafeCreateVariableFieldCached = 0x2C, + OP_ScriptFarFunctionCall2 = 0x2D, + OP_ScriptFarFunctionCall = 0x2E, + OP_ScriptFarChildThreadCall = 0x2F, + OP_ClearLocalVariableFieldCached0 = 0x30, + OP_ClearLocalVariableFieldCached = 0x31, + OP_checkclearparams = 0x32, + OP_CastFieldObject = 0x33, + OP_End = 0x34, + OP_size = 0x35, + OP_EmptyArray = 0x36, + OP_bit_and = 0x37, + OP_less_equal = 0x38, + OP_voidCodepos = 0x39, + OP_ScriptMethodThreadCallPointer = 0x3A, + OP_endswitch = 0x3B, + OP_ClearVariableField = 0x3C, + OP_divide = 0x3D, + OP_ScriptFarMethodChildThreadCall = 0x3E, + OP_GetUnsignedShort = 0x3F, + OP_JumpOnTrue = 0x40, + OP_GetSelf = 0x41, + OP_ScriptFarThreadCall = 0x42, + OP_ScriptLocalThreadCall = 0x43, + OP_SetLocalVariableFieldCached0 = 0x44, + OP_SetLocalVariableFieldCached = 0x45, + OP_plus = 0x46, + OP_BoolComplement = 0x47, + OP_ScriptMethodCallPointer = 0x48, + OP_inc = 0x49, + OP_RemoveLocalVariables = 0x4A, + OP_JumpOnFalseExpr = 0x4B, + OP_switch = 0x4C, + OP_clearparams = 0x4D, + OP_EvalLocalVariableRefCached0 = 0x4E, + OP_EvalLocalVariableRefCached = 0x4F, + OP_ScriptLocalMethodCall = 0x50, + OP_EvalFieldVariable = 0x51, + OP_EvalFieldVariableRef = 0x52, + OP_GetString = 0x53, + OP_ScriptFunctionCallPointer = 0x54, + OP_EvalLevelFieldVariable = 0x55, + OP_GetVector = 0x56, + OP_endon = 0x57, + OP_greater_equal = 0x58, + OP_GetSelfObject = 0x59, + OP_SetAnimFieldVariableField = 0x5A, + OP_SetVariableField = 0x5B, + OP_ScriptLocalFunctionCall2 = 0x5C, + OP_ScriptLocalFunctionCall = 0x5D, + OP_EvalLocalArrayRefCached0 = 0x5E, + OP_EvalLocalArrayRefCached = 0x5F, + OP_GetFarFunction = 0x60, + OP_less = 0x61, + OP_GetGameRef = 0x62, + OP_waitFrame = 0x63, + OP_waittillFrameEnd = 0x64, + OP_SafeSetVariableFieldCached0 = 0x65, + OP_SafeSetVariableFieldCached = 0x66, + OP_ScriptMethodChildThreadCallPointer = 0x67, + OP_GetLevel = 0x68, + OP_notify = 0x69, + OP_DecTop = 0x6A, + OP_shift_left = 0x6B, + OP_ScriptLocalMethodThreadCall = 0x6C, + OP_ScriptLocalMethodChildThreadCall = 0x6D, + OP_greater = 0x6E, + OP_EvalLocalVariableCached0 = 0x6F, + OP_EvalLocalVariableCached1 = 0x70, + OP_EvalLocalVariableCached2 = 0x71, + OP_EvalLocalVariableCached3 = 0x72, + OP_EvalLocalVariableCached4 = 0x73, + OP_EvalLocalVariableCached5 = 0x74, + OP_EvalLocalVariableCached = 0x75, + OP_SafeSetWaittillVariableFieldCached = 0x76, + OP_jump = 0x77, + OP_ScriptThreadCallPointer = 0x78, + OP_GetZero = 0x79, + OP_wait = 0x7A, + OP_minus = 0x7B, + OP_SetSelfFieldVariableField = 0x7C, + OP_EvalNewLocalVariableRefCached0 = 0x7D, + OP_multiply = 0x7E, + OP_CreateLocalVariable = 0x7F, + OP_ScriptLocalChildThreadCall = 0x80, + OP_GetInteger = 0x81, + OP_mod = 0x82, + OP_EvalAnimFieldVariableRef = 0x83, + OP_GetBuiltinFunction = 0x84, + OP_GetGame = 0x85, + OP_waittill = 0x86, + OP_dec = 0x87, + OP_EvalLocalVariableObjectCached = 0x88, + OP_PreScriptCall = 0x89, + OP_GetAnim = 0x8A, + OP_GetUndefined = 0x8B, + OP_EvalLevelFieldVariableRef = 0x8C, + OP_GetAnimObject = 0x8D, + OP_GetLevelObject = 0x8E, + OP_bit_ex_or = 0x8F, + OP_equality = 0x90, + OP_ClearArray = 0x91, + OP_jumpback = 0x92, + OP_GetAnimation = 0x93, + OP_EvalAnimFieldVariable = 0x94, + OP_GetAnimTree = 0x95, + OP_GetIString = 0x96, + OP_EvalArrayRef = 0x97, + OP_EvalSelfFieldVariableRef = 0x98, + OP_GetNegByte = 0x99, + OP_GetBuiltinMethod = 0x9A, + OP_CallBuiltinMethodPointer = 0x9B, + OP_EvalArray = 0x9C, + OP_vector = 0x9D, + OP_ScriptFarMethodCall = 0x9E, + OP_EvalLocalArrayCached = 0x9F, + OP_GetByte = 0xA0, + OP_ScriptChildThreadCallPointer = 0xA1, + OP_bit_or = 0xA2, + OP_AddArray = 0xA3, + OP_waittillmatch2 = 0xA4, + OP_waittillmatch = 0xA5, + OP_GetLocalFunction = 0xA6, + OP_GetNegUnsignedShort = 0xA7, + OP_shift_right = 0xA8, + OP_CallBuiltinMethod0 = 0xA9, + OP_CallBuiltinMethod1 = 0xAA, + OP_CallBuiltinMethod2 = 0xAB, + OP_CallBuiltinMethod3 = 0xAC, + OP_CallBuiltinMethod4 = 0xAD, + OP_CallBuiltinMethod5 = 0xAE, + OP_CallBuiltinMethod = 0xAF, + OP_JumpOnFalse = 0xB0, + OP_Count = 0xB1, +}; + +auto opcode_size(std::uint8_t op) -> std::uint32_t; + +} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/lexer.cpp b/src/h2/xsk/lexer.cpp new file mode 100644 index 00000000..ae3961bc --- /dev/null +++ b/src/h2/xsk/lexer.cpp @@ -0,0 +1,2826 @@ +#line 1 "lexer.cpp" +#include "stdafx.hpp" +#include "h2.hpp" +#include "parser.hpp" +using namespace xsk::gsc; + +#line 7 "lexer.cpp" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define h2__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer h2__create_buffer +#endif + +#ifdef yy_delete_buffer +#define h2__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer h2__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define h2__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer h2__scan_buffer +#endif + +#ifdef yy_scan_string +#define h2__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string h2__scan_string +#endif + +#ifdef yy_scan_bytes +#define h2__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes h2__scan_bytes +#endif + +#ifdef yy_init_buffer +#define h2__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer h2__init_buffer +#endif + +#ifdef yy_flush_buffer +#define h2__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer h2__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define h2__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state h2__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define h2__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer h2__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define h2_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state h2_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define h2_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state h2_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define h2_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack h2_ensure_buffer_stack +#endif + +#ifdef yylex +#define h2_lex_ALREADY_DEFINED +#else +#define yylex h2_lex +#endif + +#ifdef yyrestart +#define h2_restart_ALREADY_DEFINED +#else +#define yyrestart h2_restart +#endif + +#ifdef yylex_init +#define h2_lex_init_ALREADY_DEFINED +#else +#define yylex_init h2_lex_init +#endif + +#ifdef yylex_init_extra +#define h2_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra h2_lex_init_extra +#endif + +#ifdef yylex_destroy +#define h2_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy h2_lex_destroy +#endif + +#ifdef yyget_debug +#define h2_get_debug_ALREADY_DEFINED +#else +#define yyget_debug h2_get_debug +#endif + +#ifdef yyset_debug +#define h2_set_debug_ALREADY_DEFINED +#else +#define yyset_debug h2_set_debug +#endif + +#ifdef yyget_extra +#define h2_get_extra_ALREADY_DEFINED +#else +#define yyget_extra h2_get_extra +#endif + +#ifdef yyset_extra +#define h2_set_extra_ALREADY_DEFINED +#else +#define yyset_extra h2_set_extra +#endif + +#ifdef yyget_in +#define h2_get_in_ALREADY_DEFINED +#else +#define yyget_in h2_get_in +#endif + +#ifdef yyset_in +#define h2_set_in_ALREADY_DEFINED +#else +#define yyset_in h2_set_in +#endif + +#ifdef yyget_out +#define h2_get_out_ALREADY_DEFINED +#else +#define yyget_out h2_get_out +#endif + +#ifdef yyset_out +#define h2_set_out_ALREADY_DEFINED +#else +#define yyset_out h2_set_out +#endif + +#ifdef yyget_leng +#define h2_get_leng_ALREADY_DEFINED +#else +#define yyget_leng h2_get_leng +#endif + +#ifdef yyget_text +#define h2_get_text_ALREADY_DEFINED +#else +#define yyget_text h2_get_text +#endif + +#ifdef yyget_lineno +#define h2_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno h2_get_lineno +#endif + +#ifdef yyset_lineno +#define h2_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno h2_set_lineno +#endif + +#ifdef yyget_column +#define h2_get_column_ALREADY_DEFINED +#else +#define yyget_column h2_get_column +#endif + +#ifdef yyset_column +#define h2_set_column_ALREADY_DEFINED +#else +#define yyset_column h2_set_column +#endif + +#ifdef yywrap +#define h2_wrap_ALREADY_DEFINED +#else +#define yywrap h2_wrap +#endif + +#ifdef yyalloc +#define h2_alloc_ALREADY_DEFINED +#else +#define yyalloc h2_alloc +#endif + +#ifdef yyrealloc +#define h2_realloc_ALREADY_DEFINED +#else +#define yyrealloc h2_realloc +#endif + +#ifdef yyfree +#define h2_free_ALREADY_DEFINED +#else +#define yyfree h2_free +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. + */ +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yyg->yy_start = 1 + 2 * +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yyg->yy_start - 1) / 2) +#define YYSTATE YY_START +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +#define yy_new_buffer yy_create_buffer +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define h2_wrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; + +typedef int yy_state_type; + +#define yytext_ptr yytext_r + +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yyg->yy_c_buf_p = yy_cp; +#define YY_NUM_RULES 97 +#define YY_END_OF_BUFFER 98 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[286] = + { 0, + 0, 0, 0, 0, 0, 0, 98, 96, 1, 2, + 85, 96, 96, 84, 88, 96, 46, 47, 82, 80, + 52, 81, 53, 83, 95, 55, 56, 69, 79, 70, + 91, 50, 51, 89, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 48, + 87, 49, 86, 5, 6, 5, 9, 10, 9, 66, + 0, 93, 0, 0, 0, 0, 75, 0, 64, 0, + 77, 0, 0, 73, 57, 71, 58, 72, 94, 8, + 4, 3, 74, 94, 95, 0, 0, 54, 61, 67, + 65, 68, 62, 91, 78, 91, 91, 91, 91, 91, + + 91, 91, 91, 91, 91, 91, 22, 27, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 76, + 63, 7, 11, 0, 93, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 0, 93, 0, 94, 3, 94, + 94, 90, 59, 60, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 25, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 0, 0, + 0, 0, 92, 0, 0, 92, 0, 44, 91, 37, + 29, 91, 91, 91, 23, 91, 91, 91, 42, 91, + 91, 91, 43, 41, 91, 91, 91, 38, 91, 17, + + 91, 0, 0, 0, 31, 91, 91, 91, 15, 39, + 91, 45, 91, 91, 91, 91, 91, 91, 91, 91, + 24, 0, 0, 0, 91, 91, 91, 91, 16, 33, + 28, 91, 34, 91, 91, 91, 0, 0, 0, 91, + 91, 30, 26, 91, 91, 91, 91, 0, 12, 0, + 91, 32, 91, 91, 91, 18, 14, 0, 91, 91, + 40, 21, 91, 91, 0, 91, 36, 91, 91, 0, + 35, 91, 91, 0, 91, 91, 0, 91, 19, 0, + 91, 13, 91, 20, 0 + } ; + +static const YY_CHAR yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 5, 6, 1, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, + 22, 23, 1, 1, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 25, 26, 27, 28, 29, 1, 30, 31, 32, 33, + + 34, 35, 36, 37, 38, 24, 39, 40, 41, 42, + 43, 24, 24, 44, 45, 46, 47, 48, 49, 24, + 50, 51, 52, 53, 54, 55, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static const YY_CHAR yy_meta[56] = + { 0, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 1, 4, 1, 1, + 1, 1, 1, 4, 1, 5, 1, 1, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 1, 1, 1, 1 + } ; + +static const flex_int16_t yy_base[300] = + { 0, + 0, 0, 53, 54, 55, 56, 540, 541, 541, 541, + 517, 55, 33, 516, 64, 58, 541, 541, 515, 55, + 541, 60, 518, 73, 71, 516, 541, 70, 512, 71, + 507, 541, 541, 510, 57, 44, 70, 72, 75, 78, + 48, 76, 86, 79, 90, 93, 88, 84, 103, 541, + 81, 541, 541, 541, 541, 514, 541, 541, 513, 541, + 104, 541, 132, 487, 486, 482, 541, 118, 541, 119, + 541, 127, 138, 541, 541, 541, 541, 541, 120, 541, + 541, 0, 541, 121, 133, 134, 0, 541, 504, 541, + 541, 541, 503, 498, 541, 38, 120, 117, 135, 126, + + 137, 122, 143, 139, 140, 144, 497, 496, 145, 148, + 149, 151, 152, 154, 160, 155, 156, 161, 162, 541, + 541, 541, 541, 185, 191, 202, 483, 488, 481, 192, + 541, 203, 200, 207, 204, 205, 212, 541, 0, 201, + 541, 492, 541, 541, 186, 194, 197, 206, 199, 196, + 215, 209, 208, 218, 220, 221, 222, 223, 224, 227, + 226, 231, 233, 232, 238, 239, 241, 242, 476, 476, + 473, 264, 265, 271, 266, 270, 277, 488, 255, 487, + 486, 262, 263, 257, 485, 258, 259, 272, 484, 273, + 279, 157, 483, 482, 280, 281, 285, 481, 282, 283, + + 290, 460, 458, 468, 477, 284, 293, 294, 476, 475, + 296, 474, 295, 297, 299, 300, 305, 306, 307, 314, + 473, 454, 464, 467, 316, 315, 317, 320, 469, 468, + 467, 321, 466, 322, 324, 329, 457, 456, 459, 323, + 332, 462, 461, 334, 344, 330, 333, 452, 541, 443, + 346, 458, 349, 348, 350, 351, 541, 445, 357, 356, + 456, 455, 359, 364, 426, 362, 393, 367, 365, 372, + 391, 372, 370, 371, 373, 375, 380, 374, 384, 372, + 378, 541, 383, 379, 541, 420, 425, 430, 435, 438, + 440, 445, 450, 455, 460, 465, 357, 470, 475 + + } ; + +static const flex_int16_t yy_def[300] = + { 0, + 285, 1, 286, 286, 287, 287, 285, 285, 285, 285, + 285, 288, 285, 285, 285, 289, 285, 285, 285, 285, + 285, 285, 285, 285, 290, 285, 285, 285, 285, 285, + 291, 285, 285, 285, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 288, 285, 292, 285, 285, 285, 285, 293, 285, 294, + 285, 289, 295, 285, 285, 285, 285, 285, 285, 285, + 285, 296, 285, 285, 290, 290, 297, 285, 285, 285, + 285, 285, 285, 291, 285, 291, 291, 291, 291, 291, + + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 285, + 285, 285, 285, 288, 288, 292, 285, 285, 285, 293, + 285, 298, 294, 299, 289, 289, 295, 285, 296, 285, + 285, 297, 285, 285, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 285, 285, + 285, 293, 293, 298, 294, 294, 299, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + + 291, 285, 285, 285, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 285, 285, 285, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 285, 285, 285, 291, + 291, 291, 291, 291, 291, 291, 291, 285, 285, 285, + 291, 291, 291, 291, 291, 291, 285, 285, 291, 291, + 291, 291, 291, 291, 285, 291, 291, 291, 291, 285, + 291, 291, 291, 285, 291, 291, 285, 291, 291, 285, + 291, 285, 291, 291, 0, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285 + + } ; + +static const flex_int16_t yy_nxt[597] = + { 0, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 8, 33, 34, 31, 35, + 36, 37, 38, 39, 40, 41, 31, 42, 31, 43, + 31, 44, 31, 45, 46, 47, 48, 31, 49, 31, + 31, 50, 51, 52, 53, 55, 55, 58, 58, 62, + 59, 59, 64, 87, 56, 56, 62, 75, 68, 87, + 65, 69, 70, 87, 77, 145, 76, 106, 80, 66, + 63, 78, 87, 73, 81, 71, 84, 97, 85, 82, + 89, 90, 92, 93, 83, 87, 87, 87, 96, 98, + + 87, 87, 120, 87, 87, 101, 99, 104, 62, 87, + 107, 87, 100, 87, 102, 87, 103, 108, 87, 109, + 105, 110, 131, 111, 115, 117, 112, 131, 87, 63, + 113, 116, 118, 121, 61, 62, 125, 79, 140, 119, + 72, 114, 87, 132, 134, 87, 136, 87, 84, 285, + 85, 87, 73, 146, 138, 141, 147, 126, 87, 87, + 87, 148, 87, 137, 87, 87, 152, 150, 87, 87, + 87, 151, 149, 87, 87, 153, 87, 87, 154, 87, + 87, 87, 87, 155, 156, 87, 87, 87, 166, 62, + 160, 162, 157, 158, 159, 62, 131, 163, 167, 168, + + 214, 165, 161, 164, 61, 130, 125, 173, 131, 133, + 63, 87, 62, 62, 72, 176, 63, 132, 140, 87, + 136, 87, 87, 179, 87, 134, 178, 126, 174, 73, + 73, 87, 177, 87, 87, 141, 180, 137, 182, 181, + 87, 183, 185, 87, 184, 87, 87, 87, 87, 87, + 186, 87, 87, 188, 189, 190, 87, 87, 87, 194, + 191, 193, 187, 87, 87, 197, 87, 87, 131, 131, + 192, 198, 199, 130, 131, 173, 195, 196, 131, 133, + 87, 201, 87, 87, 87, 176, 200, 87, 87, 132, + 132, 134, 210, 205, 206, 134, 174, 87, 87, 209, + + 207, 211, 177, 208, 87, 87, 87, 87, 87, 87, + 87, 215, 212, 213, 217, 87, 218, 219, 87, 87, + 87, 87, 87, 221, 87, 87, 216, 228, 220, 225, + 87, 87, 87, 227, 226, 231, 232, 233, 230, 87, + 87, 87, 87, 234, 229, 87, 87, 87, 87, 87, + 235, 236, 240, 246, 87, 87, 243, 87, 87, 87, + 142, 241, 242, 245, 244, 252, 251, 253, 247, 87, + 255, 87, 256, 87, 87, 87, 87, 254, 260, 259, + 261, 87, 87, 262, 87, 263, 266, 87, 267, 87, + 87, 264, 87, 269, 271, 87, 272, 87, 87, 87, + + 87, 276, 268, 87, 87, 282, 278, 281, 87, 87, + 273, 279, 275, 280, 277, 284, 87, 274, 87, 283, + 54, 54, 54, 54, 54, 57, 57, 57, 57, 57, + 61, 61, 61, 61, 61, 72, 72, 72, 72, 72, + 86, 86, 86, 94, 94, 124, 124, 124, 124, 124, + 130, 130, 130, 130, 130, 133, 133, 133, 133, 133, + 135, 135, 135, 135, 135, 139, 270, 139, 139, 139, + 172, 172, 172, 172, 172, 175, 175, 175, 175, 175, + 87, 87, 265, 87, 258, 257, 87, 87, 250, 249, + 248, 87, 87, 87, 87, 239, 238, 237, 87, 87, + + 87, 87, 87, 224, 223, 222, 87, 87, 87, 87, + 87, 87, 87, 87, 204, 203, 202, 87, 171, 170, + 169, 87, 87, 87, 144, 143, 129, 128, 127, 123, + 122, 95, 87, 91, 88, 79, 74, 67, 60, 285, + 7, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285 + + } ; + +static const flex_int16_t yy_chk[597] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 4, 5, 6, 12, + 5, 6, 13, 96, 3, 4, 16, 20, 15, 36, + 13, 15, 15, 41, 22, 96, 20, 41, 24, 13, + 12, 22, 35, 16, 24, 15, 25, 36, 25, 24, + 28, 28, 30, 30, 24, 37, 25, 38, 35, 37, + + 39, 42, 51, 40, 44, 38, 37, 40, 61, 48, + 42, 43, 37, 47, 39, 45, 39, 42, 46, 43, + 40, 44, 68, 45, 47, 48, 46, 70, 49, 61, + 46, 47, 49, 51, 63, 72, 63, 79, 84, 49, + 73, 46, 98, 68, 70, 97, 73, 102, 85, 86, + 85, 100, 72, 97, 79, 84, 98, 63, 85, 86, + 99, 98, 101, 73, 104, 105, 102, 100, 103, 106, + 109, 101, 99, 110, 111, 103, 112, 113, 104, 114, + 116, 117, 192, 105, 106, 115, 118, 119, 117, 124, + 112, 114, 109, 110, 111, 125, 130, 115, 118, 119, + + 192, 116, 113, 115, 126, 132, 126, 132, 133, 134, + 124, 145, 135, 136, 137, 134, 125, 130, 140, 146, + 137, 150, 147, 146, 149, 133, 145, 126, 132, 135, + 136, 148, 134, 153, 152, 140, 147, 137, 149, 148, + 151, 150, 152, 154, 151, 155, 156, 157, 158, 159, + 153, 161, 160, 155, 156, 157, 162, 164, 163, 161, + 158, 160, 154, 165, 166, 164, 167, 168, 172, 173, + 159, 165, 166, 174, 175, 174, 162, 163, 176, 177, + 179, 168, 184, 186, 187, 177, 167, 182, 183, 172, + 173, 175, 187, 179, 182, 176, 174, 188, 190, 186, + + 183, 188, 177, 184, 191, 195, 196, 199, 200, 206, + 197, 195, 190, 191, 197, 201, 199, 200, 207, 208, + 213, 211, 214, 201, 215, 216, 196, 211, 200, 206, + 217, 218, 219, 208, 207, 215, 216, 217, 214, 220, + 226, 225, 227, 218, 213, 228, 232, 234, 240, 235, + 219, 220, 225, 235, 236, 246, 228, 241, 247, 244, + 297, 226, 227, 234, 232, 241, 240, 244, 236, 245, + 246, 251, 247, 254, 253, 255, 256, 245, 253, 251, + 254, 260, 259, 255, 263, 256, 259, 266, 260, 264, + 269, 256, 268, 264, 266, 273, 268, 272, 275, 278, + + 276, 273, 263, 281, 284, 280, 275, 278, 283, 279, + 269, 276, 272, 277, 274, 283, 271, 270, 267, 281, + 286, 286, 286, 286, 286, 287, 287, 287, 287, 287, + 288, 288, 288, 288, 288, 289, 289, 289, 289, 289, + 290, 290, 290, 291, 291, 292, 292, 292, 292, 292, + 293, 293, 293, 293, 293, 294, 294, 294, 294, 294, + 295, 295, 295, 295, 295, 296, 265, 296, 296, 296, + 298, 298, 298, 298, 298, 299, 299, 299, 299, 299, + 262, 261, 258, 252, 250, 248, 243, 242, 239, 238, + 237, 233, 231, 230, 229, 224, 223, 222, 221, 212, + + 210, 209, 205, 204, 203, 202, 198, 194, 193, 189, + 185, 181, 180, 178, 171, 170, 169, 142, 129, 128, + 127, 108, 107, 94, 93, 89, 66, 65, 64, 59, + 56, 34, 31, 29, 26, 23, 19, 14, 11, 7, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285 + + } ; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +#line 1 "lexer.lpp" +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ +#define YY_NO_INPUT 1 +#define YY_NO_UNISTD_H 1 + +#line 23 "lexer.lpp" +#define YY_USER_ACTION loc.columns(yyleng); +#line 874 "lexer.cpp" + +#line 876 "lexer.cpp" + +#define INITIAL 0 +#define COMMENT_BLOCK_STATE 1 +#define DEVELOPER_BLOCK_STATE 2 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +/* Holds the entire state of the reentrant scanner. */ +struct yyguts_t + { + + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; + + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + int yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + int yylineno_r; + int yy_flex_debug_r; + + char *yytext_r; + int yy_more_flag; + int yy_more_len; + + }; /* end struct yyguts_t */ + +static int yy_init_globals ( yyscan_t yyscanner ); + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput ( yyscan_t yyscanner ); +#else +static int input ( yyscan_t yyscanner ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + int n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK /*LINTED*/break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_load_buffer_state( yyscanner ); + } + + { +#line 36 "lexer.lpp" + + + +#line 40 "lexer.lpp" + loc.step(); + + +#line 1144 "lexer.cpp" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yyg->yy_start; +yy_match: + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 286 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + ++yy_cp; + } + while ( yy_current_state != 285 ); + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 43 "lexer.lpp" +{ loc.step(); } + YY_BREAK +case 2: +/* rule 2 can match eol */ +YY_RULE_SETUP +#line 45 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 47 "lexer.lpp" + + YY_BREAK +case 4: +YY_RULE_SETUP +#line 49 "lexer.lpp" +{ BEGIN(COMMENT_BLOCK_STATE); } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 50 "lexer.lpp" + + YY_BREAK +case 6: +/* rule 6 can match eol */ +YY_RULE_SETUP +#line 51 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 52 "lexer.lpp" +{ BEGIN(INITIAL); } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 54 "lexer.lpp" +{ BEGIN(DEVELOPER_BLOCK_STATE); } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 55 "lexer.lpp" + + YY_BREAK +case 10: +/* rule 10 can match eol */ +YY_RULE_SETUP +#line 56 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 57 "lexer.lpp" +{ BEGIN(INITIAL); } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 59 "lexer.lpp" +{ return h2::parser::make_INCLUDE(loc); } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 60 "lexer.lpp" +{ return h2::parser::make_USINGTREE(loc); } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 61 "lexer.lpp" +{ return h2::parser::make_ANIMTREE(loc); } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 62 "lexer.lpp" +{ return h2::parser::make_ENDON(loc); } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 63 "lexer.lpp" +{ return h2::parser::make_NOTIFY(loc); } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 64 "lexer.lpp" +{ return h2::parser::make_WAIT(loc); } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 65 "lexer.lpp" +{ return h2::parser::make_WAITTILL(loc); } + YY_BREAK +case 19: +YY_RULE_SETUP +#line 66 "lexer.lpp" +{ return h2::parser::make_WAITTILLMATCH(loc); } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 67 "lexer.lpp" +{ return h2::parser::make_WAITTILLFRAMEEND(loc); } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 68 "lexer.lpp" +{ return h2::parser::make_WAITFRAME(loc); } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 69 "lexer.lpp" +{ return h2::parser::make_IF(loc); } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 70 "lexer.lpp" +{ return h2::parser::make_ELSE(loc); } + YY_BREAK +case 24: +YY_RULE_SETUP +#line 71 "lexer.lpp" +{ return h2::parser::make_WHILE(loc); } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 72 "lexer.lpp" +{ return h2::parser::make_FOR(loc); } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 73 "lexer.lpp" +{ return h2::parser::make_FOREACH(loc); } + YY_BREAK +case 27: +YY_RULE_SETUP +#line 74 "lexer.lpp" +{ return h2::parser::make_IN(loc); } + YY_BREAK +case 28: +YY_RULE_SETUP +#line 75 "lexer.lpp" +{ return h2::parser::make_SWITCH(loc); } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 76 "lexer.lpp" +{ return h2::parser::make_CASE(loc); } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 77 "lexer.lpp" +{ return h2::parser::make_DEFAULT(loc); } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 78 "lexer.lpp" +{ return h2::parser::make_BREAK(loc); } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 79 "lexer.lpp" +{ return h2::parser::make_CONTINUE(loc); } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 80 "lexer.lpp" +{ return h2::parser::make_RETURN(loc); } + YY_BREAK +case 34: +YY_RULE_SETUP +#line 81 "lexer.lpp" +{ return h2::parser::make_THREAD(loc); } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 82 "lexer.lpp" +{ return h2::parser::make_CHILDTHREAD(loc); } + YY_BREAK +case 36: +YY_RULE_SETUP +#line 83 "lexer.lpp" +{ return h2::parser::make_THISTHREAD(loc); } + YY_BREAK +case 37: +YY_RULE_SETUP +#line 84 "lexer.lpp" +{ return h2::parser::make_CALL(loc); } + YY_BREAK +case 38: +YY_RULE_SETUP +#line 85 "lexer.lpp" +{ return h2::parser::make_TRUE(loc); } + YY_BREAK +case 39: +YY_RULE_SETUP +#line 86 "lexer.lpp" +{ return h2::parser::make_FALSE(loc); } + YY_BREAK +case 40: +YY_RULE_SETUP +#line 87 "lexer.lpp" +{ return h2::parser::make_UNDEFINED(loc); } + YY_BREAK +case 41: +YY_RULE_SETUP +#line 88 "lexer.lpp" +{ return h2::parser::make_SIZE(loc); } + YY_BREAK +case 42: +YY_RULE_SETUP +#line 89 "lexer.lpp" +{ return h2::parser::make_GAME(loc); } + YY_BREAK +case 43: +YY_RULE_SETUP +#line 90 "lexer.lpp" +{ return h2::parser::make_SELF(loc); } + YY_BREAK +case 44: +YY_RULE_SETUP +#line 91 "lexer.lpp" +{ return h2::parser::make_ANIM(loc); } + YY_BREAK +case 45: +YY_RULE_SETUP +#line 92 "lexer.lpp" +{ return h2::parser::make_LEVEL(loc); } + YY_BREAK +case 46: +YY_RULE_SETUP +#line 93 "lexer.lpp" +{ return h2::parser::make_LPAREN(loc); } + YY_BREAK +case 47: +YY_RULE_SETUP +#line 94 "lexer.lpp" +{ return h2::parser::make_RPAREN(loc); } + YY_BREAK +case 48: +YY_RULE_SETUP +#line 95 "lexer.lpp" +{ return h2::parser::make_LBRACE(loc); } + YY_BREAK +case 49: +YY_RULE_SETUP +#line 96 "lexer.lpp" +{ return h2::parser::make_RBRACE(loc); } + YY_BREAK +case 50: +YY_RULE_SETUP +#line 97 "lexer.lpp" +{ return h2::parser::make_LBRACKET(loc); } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 98 "lexer.lpp" +{ return h2::parser::make_RBRACKET(loc); } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 99 "lexer.lpp" +{ return h2::parser::make_COMMA(loc); } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 100 "lexer.lpp" +{ return h2::parser::make_DOT(loc); } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 101 "lexer.lpp" +{ return h2::parser::make_DOUBLECOLON(loc); } + YY_BREAK +case 55: +YY_RULE_SETUP +#line 102 "lexer.lpp" +{ return h2::parser::make_COLON(loc); } + YY_BREAK +case 56: +YY_RULE_SETUP +#line 103 "lexer.lpp" +{ return h2::parser::make_SEMICOLON(loc); } + YY_BREAK +case 57: +YY_RULE_SETUP +#line 104 "lexer.lpp" +{ return h2::parser::make_INCREMENT(loc); } + YY_BREAK +case 58: +YY_RULE_SETUP +#line 105 "lexer.lpp" +{ return h2::parser::make_DECREMENT(loc); } + YY_BREAK +case 59: +YY_RULE_SETUP +#line 106 "lexer.lpp" +{ return h2::parser::make_ASSIGN_LSHIFT(loc); } + YY_BREAK +case 60: +YY_RULE_SETUP +#line 107 "lexer.lpp" +{ return h2::parser::make_ASSIGN_RSHIFT(loc); } + YY_BREAK +case 61: +YY_RULE_SETUP +#line 108 "lexer.lpp" +{ return h2::parser::make_LSHIFT(loc); } + YY_BREAK +case 62: +YY_RULE_SETUP +#line 109 "lexer.lpp" +{ return h2::parser::make_RSHIFT(loc); } + YY_BREAK +case 63: +YY_RULE_SETUP +#line 110 "lexer.lpp" +{ return h2::parser::make_OR(loc); } + YY_BREAK +case 64: +YY_RULE_SETUP +#line 111 "lexer.lpp" +{ return h2::parser::make_AND(loc); } + YY_BREAK +case 65: +YY_RULE_SETUP +#line 112 "lexer.lpp" +{ return h2::parser::make_EQUALITY(loc); } + YY_BREAK +case 66: +YY_RULE_SETUP +#line 113 "lexer.lpp" +{ return h2::parser::make_INEQUALITY(loc); } + YY_BREAK +case 67: +YY_RULE_SETUP +#line 114 "lexer.lpp" +{ return h2::parser::make_LESS_EQUAL(loc); } + YY_BREAK +case 68: +YY_RULE_SETUP +#line 115 "lexer.lpp" +{ return h2::parser::make_GREATER_EQUAL(loc); } + YY_BREAK +case 69: +YY_RULE_SETUP +#line 116 "lexer.lpp" +{ return h2::parser::make_LESS(loc); } + YY_BREAK +case 70: +YY_RULE_SETUP +#line 117 "lexer.lpp" +{ return h2::parser::make_GREATER(loc); } + YY_BREAK +case 71: +YY_RULE_SETUP +#line 118 "lexer.lpp" +{ return h2::parser::make_ASSIGN_ADD(loc); } + YY_BREAK +case 72: +YY_RULE_SETUP +#line 119 "lexer.lpp" +{ return h2::parser::make_ASSIGN_SUB(loc); } + YY_BREAK +case 73: +YY_RULE_SETUP +#line 120 "lexer.lpp" +{ return h2::parser::make_ASSIGN_MULT(loc); } + YY_BREAK +case 74: +YY_RULE_SETUP +#line 121 "lexer.lpp" +{ return h2::parser::make_ASSIGN_DIV(loc); } + YY_BREAK +case 75: +YY_RULE_SETUP +#line 122 "lexer.lpp" +{ return h2::parser::make_ASSIGN_MOD(loc); } + YY_BREAK +case 76: +YY_RULE_SETUP +#line 123 "lexer.lpp" +{ return h2::parser::make_ASSIGN_BITWISE_OR(loc); } + YY_BREAK +case 77: +YY_RULE_SETUP +#line 124 "lexer.lpp" +{ return h2::parser::make_ASSIGN_BITWISE_AND(loc); } + YY_BREAK +case 78: +YY_RULE_SETUP +#line 125 "lexer.lpp" +{ return h2::parser::make_ASSIGN_BITWISE_EXOR(loc); } + YY_BREAK +case 79: +YY_RULE_SETUP +#line 126 "lexer.lpp" +{ return h2::parser::make_ASSIGN(loc); } + YY_BREAK +case 80: +YY_RULE_SETUP +#line 127 "lexer.lpp" +{ return h2::parser::make_ADD(loc); } + YY_BREAK +case 81: +YY_RULE_SETUP +#line 128 "lexer.lpp" +{ return h2::parser::make_SUB(loc); } + YY_BREAK +case 82: +YY_RULE_SETUP +#line 129 "lexer.lpp" +{ return h2::parser::make_MULT(loc); } + YY_BREAK +case 83: +YY_RULE_SETUP +#line 130 "lexer.lpp" +{ return h2::parser::make_DIV(loc); } + YY_BREAK +case 84: +YY_RULE_SETUP +#line 131 "lexer.lpp" +{ return h2::parser::make_MOD(loc); } + YY_BREAK +case 85: +YY_RULE_SETUP +#line 132 "lexer.lpp" +{ return h2::parser::make_NOT(loc); } + YY_BREAK +case 86: +YY_RULE_SETUP +#line 133 "lexer.lpp" +{ return h2::parser::make_COMPLEMENT(loc); } + YY_BREAK +case 87: +YY_RULE_SETUP +#line 134 "lexer.lpp" +{ return h2::parser::make_BITWISE_OR(loc); } + YY_BREAK +case 88: +YY_RULE_SETUP +#line 135 "lexer.lpp" +{ return h2::parser::make_BITWISE_AND(loc); } + YY_BREAK +case 89: +YY_RULE_SETUP +#line 136 "lexer.lpp" +{ return h2::parser::make_BITWISE_EXOR(loc); } + YY_BREAK +case 90: +YY_RULE_SETUP +#line 137 "lexer.lpp" +{ return h2::parser::make_FILE(utils::string::fordslash(yytext), loc); } + YY_BREAK +case 91: +YY_RULE_SETUP +#line 138 "lexer.lpp" +{ return h2::parser::make_NAME((std::string(yytext, 3) == "_ID") ? std::string(yytext) : utils::string::to_lower(yytext), loc); } + YY_BREAK +case 92: +/* rule 92 can match eol */ +YY_RULE_SETUP +#line 139 "lexer.lpp" +{ return h2::parser::make_ISTRING(std::string(yytext).substr(1), loc); } + YY_BREAK +case 93: +/* rule 93 can match eol */ +YY_RULE_SETUP +#line 140 "lexer.lpp" +{ return h2::parser::make_STRING(std::string(yytext), loc); } + YY_BREAK +case 94: +YY_RULE_SETUP +#line 141 "lexer.lpp" +{ return h2::parser::make_FLOAT(std::string(yytext), loc); } + YY_BREAK +case 95: +YY_RULE_SETUP +#line 142 "lexer.lpp" +{ return h2::parser::make_INTEGER(std::string(yytext), loc); } + YY_BREAK +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(COMMENT_BLOCK_STATE): +case YY_STATE_EOF(DEVELOPER_BLOCK_STATE): +#line 143 "lexer.lpp" +{ return h2::parser::make_H2EOF(loc); } + YY_BREAK +case 96: +/* rule 96 can match eol */ +YY_RULE_SETUP +#line 144 "lexer.lpp" +{ throw h2::parser::syntax_error(loc, "bad token: \'" + std::string(yytext) + "\'"); } + YY_BREAK +case 97: +YY_RULE_SETUP +#line 146 "lexer.lpp" +ECHO; + YY_BREAK +#line 1694 "lexer.cpp" + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( yywrap( yyscanner ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + yyg->yy_n_chars, num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin , yyscanner); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) +{ + yy_state_type yy_current_state; + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_current_state = yyg->yy_start; + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 286 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) +{ + int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + char *yy_cp = yyg->yy_c_buf_p; + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 286 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 285); + + (void)yyg; + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (yyscan_t yyscanner) +#else + static int input (yyscan_t yyscanner) +#endif + +{ + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin , yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( yyscanner ) ) + return 0; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(yyscanner); +#else + return input(yyscanner); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * @param yyscanner The scanner object. + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * @param yyscanner The scanner object. + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( yyscanner ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yyg->yy_did_buffer_switch_on_eof = 1; +} + +static void yy_load_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyg->yy_hold_char = *yyg->yy_c_buf_p; +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * @param yyscanner The scanner object. + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file , yyscanner); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * @param yyscanner The scanner object. + */ + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf , yyscanner ); + + yyfree( (void *) b , yyscanner ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + +{ + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_flush_buffer( b , yyscanner); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param yyscanner The scanner object. + */ + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( yyscanner ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * @param yyscanner The scanner object. + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(yyscanner); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * @param yyscanner The scanner object. + */ +void yypop_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (yyscan_t yyscanner) +{ + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (!yyg->yy_buffer_stack) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->yy_buffer_stack_max = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b , yyscanner ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n , yyscanner); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the user-defined data for this scanner. + * @param yyscanner The scanner object. + */ +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; +} + +/** Get the current line number. + * @param yyscanner The scanner object. + */ +int yyget_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; +} + +/** Get the current column number. + * @param yyscanner The scanner object. + */ +int yyget_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; +} + +/** Get the input stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; +} + +/** Get the output stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; +} + +/** Get the length of the current token. + * @param yyscanner The scanner object. + */ +int yyget_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; +} + +/** Get the current token. + * @param yyscanner The scanner object. + */ + +char *yyget_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; +} + +/** Set the user-defined data. This data is never touched by the scanner. + * @param user_defined The data to be associated with this scanner. + * @param yyscanner The scanner object. + */ +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; +} + +/** Set the current line number. + * @param _line_number line number + * @param yyscanner The scanner object. + */ +void yyset_lineno (int _line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + + yylineno = _line_number; +} + +/** Set the current column. + * @param _column_no column number + * @param yyscanner The scanner object. + */ +void yyset_column (int _column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + + yycolumn = _column_no; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * @param yyscanner The scanner object. + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * _in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; +} + +void yyset_out (FILE * _out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; +} + +int yyget_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; +} + +void yyset_debug (int _bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; +} + +/* Accessor methods for yylval and yylloc */ + +/* User-visible API */ + +/* yylex_init is special because it creates the scanner itself, so it is + * the ONLY reentrant function that doesn't take the scanner as the last argument. + * That's why we explicitly handle the declaration, instead of using our macros. + */ +int yylex_init(yyscan_t* ptr_yy_globals) +{ + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + return yy_init_globals ( *ptr_yy_globals ); +} + +/* yylex_init_extra has the same functionality as yylex_init, but follows the + * convention of taking the scanner as the last argument. Note however, that + * this is a *pointer* to a scanner, as it will be allocated by this call (and + * is the reason, too, why this function also must handle its own declaration). + * The user defined value in the first argument will be available to yyalloc in + * the yyextra field. + */ +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) +{ + struct yyguts_t dummy_yyguts; + + yyset_extra (yy_user_defined, &dummy_yyguts); + + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + yyset_extra (yy_user_defined, *ptr_yy_globals); + + return yy_init_globals ( *ptr_yy_globals ); +} + +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + yyg->yy_buffer_stack = NULL; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = NULL; + yyg->yy_init = 0; + yyg->yy_start = 0; + + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = NULL; + yyout = NULL; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(yyscanner); + } + + /* Destroy the stack itself. */ + yyfree(yyg->yy_buffer_stack , yyscanner); + yyg->yy_buffer_stack = NULL; + + /* Destroy the start condition stack. */ + yyfree( yyg->yy_start_stack , yyscanner ); + yyg->yy_start_stack = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( yyscanner); + + /* Destroy the main struct (reentrant only). */ + yyfree ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); +} + +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); +} + +void yyfree (void * ptr , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 146 "lexer.lpp" + + diff --git a/src/h2/xsk/lexer.hpp b/src/h2/xsk/lexer.hpp new file mode 100644 index 00000000..6c764da3 --- /dev/null +++ b/src/h2/xsk/lexer.hpp @@ -0,0 +1,708 @@ +#ifndef h2_HEADER_H +#define h2_HEADER_H 1 +#define h2_IN_HEADER 1 + +#line 5 "lexer.hpp" +#include "stdafx.hpp" +#include "h2.hpp" +#include "parser.hpp" +using namespace xsk::gsc; + +#line 11 "lexer.hpp" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define h2__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer h2__create_buffer +#endif + +#ifdef yy_delete_buffer +#define h2__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer h2__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define h2__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer h2__scan_buffer +#endif + +#ifdef yy_scan_string +#define h2__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string h2__scan_string +#endif + +#ifdef yy_scan_bytes +#define h2__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes h2__scan_bytes +#endif + +#ifdef yy_init_buffer +#define h2__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer h2__init_buffer +#endif + +#ifdef yy_flush_buffer +#define h2__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer h2__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define h2__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state h2__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define h2__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer h2__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define h2_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state h2_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define h2_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state h2_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define h2_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack h2_ensure_buffer_stack +#endif + +#ifdef yylex +#define h2_lex_ALREADY_DEFINED +#else +#define yylex h2_lex +#endif + +#ifdef yyrestart +#define h2_restart_ALREADY_DEFINED +#else +#define yyrestart h2_restart +#endif + +#ifdef yylex_init +#define h2_lex_init_ALREADY_DEFINED +#else +#define yylex_init h2_lex_init +#endif + +#ifdef yylex_init_extra +#define h2_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra h2_lex_init_extra +#endif + +#ifdef yylex_destroy +#define h2_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy h2_lex_destroy +#endif + +#ifdef yyget_debug +#define h2_get_debug_ALREADY_DEFINED +#else +#define yyget_debug h2_get_debug +#endif + +#ifdef yyset_debug +#define h2_set_debug_ALREADY_DEFINED +#else +#define yyset_debug h2_set_debug +#endif + +#ifdef yyget_extra +#define h2_get_extra_ALREADY_DEFINED +#else +#define yyget_extra h2_get_extra +#endif + +#ifdef yyset_extra +#define h2_set_extra_ALREADY_DEFINED +#else +#define yyset_extra h2_set_extra +#endif + +#ifdef yyget_in +#define h2_get_in_ALREADY_DEFINED +#else +#define yyget_in h2_get_in +#endif + +#ifdef yyset_in +#define h2_set_in_ALREADY_DEFINED +#else +#define yyset_in h2_set_in +#endif + +#ifdef yyget_out +#define h2_get_out_ALREADY_DEFINED +#else +#define yyget_out h2_get_out +#endif + +#ifdef yyset_out +#define h2_set_out_ALREADY_DEFINED +#else +#define yyset_out h2_set_out +#endif + +#ifdef yyget_leng +#define h2_get_leng_ALREADY_DEFINED +#else +#define yyget_leng h2_get_leng +#endif + +#ifdef yyget_text +#define h2_get_text_ALREADY_DEFINED +#else +#define yyget_text h2_get_text +#endif + +#ifdef yyget_lineno +#define h2_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno h2_get_lineno +#endif + +#ifdef yyset_lineno +#define h2_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno h2_set_lineno +#endif + +#ifdef yyget_column +#define h2_get_column_ALREADY_DEFINED +#else +#define yyget_column h2_get_column +#endif + +#ifdef yyset_column +#define h2_set_column_ALREADY_DEFINED +#else +#define yyset_column h2_set_column +#endif + +#ifdef yywrap +#define h2_wrap_ALREADY_DEFINED +#else +#define yywrap h2_wrap +#endif + +#ifdef yyalloc +#define h2_alloc_ALREADY_DEFINED +#else +#define yyalloc h2_alloc +#endif + +#ifdef yyrealloc +#define h2_realloc_ALREADY_DEFINED +#else +#define yyrealloc h2_realloc +#endif + +#ifdef yyfree +#define h2_free_ALREADY_DEFINED +#else +#define yyfree h2_free +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +/* Begin user sect3 */ + +#define h2_wrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP + +#define yytext_ptr yytext_r + +#ifdef YY_HEADER_EXPORT_START_CONDITIONS +#define INITIAL 0 +#define COMMENT_BLOCK_STATE 1 +#define DEVELOPER_BLOCK_STATE 2 + +#endif + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +#undef YY_NEW_FILE +#undef YY_FLUSH_BUFFER +#undef yy_set_bol +#undef yy_new_buffer +#undef yy_set_interactive +#undef YY_DO_BEFORE_ACTION + +#ifdef YY_DECL_IS_OURS +#undef YY_DECL_IS_OURS +#undef YY_DECL +#endif + +#ifndef h2__create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef h2__delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef h2__scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef h2__scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef h2__scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef h2__init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef h2__flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef h2__load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef h2__switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef h2_push_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef h2_pop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef h2_ensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef h2_lex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef h2_restart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef h2_lex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef h2_lex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef h2_lex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef h2_get_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef h2_set_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef h2_get_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef h2_set_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef h2_get_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef h2_set_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef h2_get_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef h2_set_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef h2_get_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef h2_get_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef h2_get_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef h2_set_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef h2_get_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef h2_set_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef h2_wrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef h2_get_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef h2_set_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef h2_get_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef h2_set_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef h2_alloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef h2_realloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef h2_free_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef h2_text_ALREADY_DEFINED +#undef yytext +#endif +#ifndef h2_leng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef h2_in_ALREADY_DEFINED +#undef yyin +#endif +#ifndef h2_out_ALREADY_DEFINED +#undef yyout +#endif +#ifndef h2__flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef h2_lineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef h2_tables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef h2_tables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef h2_TABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + +#line 146 "lexer.lpp" + + +#line 706 "lexer.hpp" +#undef h2_IN_HEADER +#endif /* h2_HEADER_H */ diff --git a/src/h2/xsk/parser.cpp b/src/h2/xsk/parser.cpp new file mode 100644 index 00000000..27cdd9b2 --- /dev/null +++ b/src/h2/xsk/parser.cpp @@ -0,0 +1,3994 @@ +// A Bison parser, made by GNU Bison 3.7.5. + +// Skeleton implementation for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. + +// 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 . + +// As a special exception, you may create a larger work that contains +// part or all of the Bison parser skeleton and distribute that work +// under terms of your choice, so long as that work isn't itself a +// parser generator using the skeleton or a modified version thereof +// as a parser skeleton. Alternatively, if you modify or redistribute +// the parser skeleton itself, you may (at your option) remove this +// special exception, which will cause the skeleton and the resulting +// Bison output files to be licensed under the GNU General Public +// License without this special exception. + +// This special exception was added by the Free Software Foundation in +// version 2.2 of Bison. + +// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, +// especially those whose name start with YY_ or yy_. They are +// private implementation details that can be changed or removed. + +// "%code top" blocks. +#line 40 "parser.ypp" + +#include "stdafx.hpp" +#include "parser.hpp" +#include "lexer.hpp" +using namespace xsk::gsc; +xsk::gsc::h2::parser::symbol_type H2lex(yyscan_t yyscanner, xsk::gsc::location& loc); + +#line 47 "parser.cpp" + +// Take the name prefix into account. +#define yylex H2lex + + + +#include "parser.hpp" + + + + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include // FIXME: INFRINGES ON USER NAME SPACE. +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + + +// Whether we are compiled with exception support. +#ifndef YY_EXCEPTIONS +# if defined __GNUC__ && !defined __EXCEPTIONS +# define YY_EXCEPTIONS 0 +# else +# define YY_EXCEPTIONS 1 +# endif +#endif + +#define YYRHSLOC(Rhs, K) ((Rhs)[K].location) +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +# ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).begin = YYRHSLOC (Rhs, 1).begin; \ + (Current).end = YYRHSLOC (Rhs, N).end; \ + } \ + else \ + { \ + (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ + } \ + while (false) +# endif + + +// Enable debugging if requested. +#if H2DEBUG + +// A pseudo ostream that takes yydebug_ into account. +# define YYCDEBUG if (yydebug_) (*yycdebug_) + +# define YY_SYMBOL_PRINT(Title, Symbol) \ + do { \ + if (yydebug_) \ + { \ + *yycdebug_ << Title << ' '; \ + yy_print_ (*yycdebug_, Symbol); \ + *yycdebug_ << '\n'; \ + } \ + } while (false) + +# define YY_REDUCE_PRINT(Rule) \ + do { \ + if (yydebug_) \ + yy_reduce_print_ (Rule); \ + } while (false) + +# define YY_STACK_PRINT() \ + do { \ + if (yydebug_) \ + yy_stack_print_ (); \ + } while (false) + +#else // !H2DEBUG + +# define YYCDEBUG if (false) std::cerr +# define YY_SYMBOL_PRINT(Title, Symbol) YY_USE (Symbol) +# define YY_REDUCE_PRINT(Rule) static_cast (0) +# define YY_STACK_PRINT() static_cast (0) + +#endif // !H2DEBUG + +#define yyerrok (yyerrstatus_ = 0) +#define yyclearin (yyla.clear ()) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYRECOVERING() (!!yyerrstatus_) + +#line 13 "parser.ypp" +namespace xsk { namespace gsc { namespace h2 { +#line 149 "parser.cpp" + + /// Build a parser object. + parser::parser (yyscan_t yyscanner_yyarg, xsk::gsc::location& loc_yyarg, xsk::gsc::program_ptr& ast_yyarg) +#if H2DEBUG + : yydebug_ (false), + yycdebug_ (&std::cerr), +#else + : +#endif + yy_lac_established_ (false), + yyscanner (yyscanner_yyarg), + loc (loc_yyarg), + ast (ast_yyarg) + {} + + parser::~parser () + {} + + parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW + {} + + /*---------------. + | symbol kinds. | + `---------------*/ + + + + // by_state. + parser::by_state::by_state () YY_NOEXCEPT + : state (empty_state) + {} + + parser::by_state::by_state (const by_state& that) YY_NOEXCEPT + : state (that.state) + {} + + void + parser::by_state::clear () YY_NOEXCEPT + { + state = empty_state; + } + + void + parser::by_state::move (by_state& that) + { + state = that.state; + that.clear (); + } + + parser::by_state::by_state (state_type s) YY_NOEXCEPT + : state (s) + {} + + parser::symbol_kind_type + parser::by_state::kind () const YY_NOEXCEPT + { + if (state == empty_state) + return symbol_kind::S_YYEMPTY; + else + return YY_CAST (symbol_kind_type, yystos_[+state]); + } + + parser::stack_symbol_type::stack_symbol_type () + {} + + parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) + : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.YY_MOVE_OR_COPY< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.YY_MOVE_OR_COPY< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.YY_MOVE_OR_COPY< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.YY_MOVE_OR_COPY< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.YY_MOVE_OR_COPY< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.YY_MOVE_OR_COPY< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.YY_MOVE_OR_COPY< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.YY_MOVE_OR_COPY< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.YY_MOVE_OR_COPY< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.YY_MOVE_OR_COPY< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.YY_MOVE_OR_COPY< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.YY_MOVE_OR_COPY< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.YY_MOVE_OR_COPY< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.YY_MOVE_OR_COPY< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.YY_MOVE_OR_COPY< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.YY_MOVE_OR_COPY< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.YY_MOVE_OR_COPY< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.YY_MOVE_OR_COPY< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.YY_MOVE_OR_COPY< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.YY_MOVE_OR_COPY< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.YY_MOVE_OR_COPY< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.YY_MOVE_OR_COPY< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.YY_MOVE_OR_COPY< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.YY_MOVE_OR_COPY< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.YY_MOVE_OR_COPY< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.YY_MOVE_OR_COPY< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.YY_MOVE_OR_COPY< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.YY_MOVE_OR_COPY< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.YY_MOVE_OR_COPY< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.YY_MOVE_OR_COPY< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.YY_MOVE_OR_COPY< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.YY_MOVE_OR_COPY< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.YY_MOVE_OR_COPY< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.YY_MOVE_OR_COPY< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.YY_MOVE_OR_COPY< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.YY_MOVE_OR_COPY< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.YY_MOVE_OR_COPY< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.YY_MOVE_OR_COPY< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.YY_MOVE_OR_COPY< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.YY_MOVE_OR_COPY< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.YY_MOVE_OR_COPY< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.YY_MOVE_OR_COPY< stmt_waitframe_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.YY_MOVE_OR_COPY< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.YY_MOVE_OR_COPY< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.YY_MOVE_OR_COPY< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.YY_MOVE_OR_COPY< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.YY_MOVE_OR_COPY< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.YY_MOVE_OR_COPY< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.YY_MOVE_OR_COPY< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.YY_MOVE_OR_COPY< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.YY_MOVE_OR_COPY< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.YY_MOVE_OR_COPY< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.YY_MOVE_OR_COPY< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + +#if 201103L <= YY_CPLUSPLUS + // that is emptied. + that.state = empty_state; +#endif + } + + parser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that) + : super_type (s, YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + + // that is emptied. + that.kind_ = symbol_kind::S_YYEMPTY; + } + +#if YY_CPLUSPLUS < 201103L + parser::stack_symbol_type& + parser::stack_symbol_type::operator= (const stack_symbol_type& that) + { + state = that.state; + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.copy< anim_ptr > (that.value); + break; + + case symbol_kind::S_animation: // animation + value.copy< animation_ptr > (that.value); + break; + + case symbol_kind::S_animtree: // animtree + value.copy< animtree_ptr > (that.value); + break; + + case symbol_kind::S_constant: // constant + value.copy< constant_ptr > (that.value); + break; + + case symbol_kind::S_define: // define + value.copy< define_ptr > (that.value); + break; + + case symbol_kind::S_empty_array: // empty_array + value.copy< empty_array_ptr > (that.value); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.copy< expr_arguments_ptr > (that.value); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.copy< expr_assign_ptr > (that.value); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.copy< expr_call_ptr > (that.value); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.copy< expr_call_type_ptr > (that.value); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.copy< expr_ptr > (that.value); + break; + + case symbol_kind::S_false: // false + value.copy< false_ptr > (that.value); + break; + + case symbol_kind::S_file: // file + value.copy< file_ptr > (that.value); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.copy< float_ptr > (that.value); + break; + + case symbol_kind::S_game: // game + value.copy< game_ptr > (that.value); + break; + + case symbol_kind::S_include: // include + value.copy< include_ptr > (that.value); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.copy< integer_ptr > (that.value); + break; + + case symbol_kind::S_istring: // istring + value.copy< istring_ptr > (that.value); + break; + + case symbol_kind::S_level: // level + value.copy< level_ptr > (that.value); + break; + + case symbol_kind::S_name: // name + value.copy< name_ptr > (that.value); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.copy< node_ptr > (that.value); + break; + + case symbol_kind::S_parameters: // parameters + value.copy< parameters_ptr > (that.value); + break; + + case symbol_kind::S_program: // program + value.copy< program_ptr > (that.value); + break; + + case symbol_kind::S_self: // self + value.copy< self_ptr > (that.value); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.copy< std::string > (that.value); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.copy< stmt_assign_ptr > (that.value); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.copy< stmt_break_ptr > (that.value); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.copy< stmt_call_ptr > (that.value); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.copy< stmt_case_ptr > (that.value); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.copy< stmt_continue_ptr > (that.value); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.copy< stmt_default_ptr > (that.value); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.copy< stmt_endon_ptr > (that.value); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.copy< stmt_for_ptr > (that.value); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.copy< stmt_foreach_ptr > (that.value); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.copy< stmt_if_ptr > (that.value); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.copy< stmt_ifelse_ptr > (that.value); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.copy< stmt_list_ptr > (that.value); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.copy< stmt_notify_ptr > (that.value); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.copy< stmt_ptr > (that.value); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.copy< stmt_return_ptr > (that.value); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.copy< stmt_switch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.copy< stmt_wait_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.copy< stmt_waitframe_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.copy< stmt_waittill_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.copy< stmt_waittillframeend_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.copy< stmt_waittillmatch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.copy< stmt_while_ptr > (that.value); + break; + + case symbol_kind::S_string: // string + value.copy< string_ptr > (that.value); + break; + + case symbol_kind::S_thisthread: // thisthread + value.copy< thisthread_ptr > (that.value); + break; + + case symbol_kind::S_thread: // thread + value.copy< thread_ptr > (that.value); + break; + + case symbol_kind::S_true: // true + value.copy< true_ptr > (that.value); + break; + + case symbol_kind::S_undefined: // undefined + value.copy< undefined_ptr > (that.value); + break; + + case symbol_kind::S_usingtree: // usingtree + value.copy< usingtree_ptr > (that.value); + break; + + case symbol_kind::S_vector: // vector + value.copy< vector_ptr > (that.value); + break; + + default: + break; + } + + location = that.location; + return *this; + } + + parser::stack_symbol_type& + parser::stack_symbol_type::operator= (stack_symbol_type& that) + { + state = that.state; + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (that.value); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (that.value); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (that.value); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (that.value); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (that.value); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (that.value); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (that.value); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (that.value); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (that.value); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (that.value); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (that.value); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (that.value); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (that.value); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (that.value); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (that.value); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (that.value); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (that.value); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (that.value); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (that.value); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (that.value); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (that.value); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (that.value); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (that.value); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (that.value); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (that.value); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (that.value); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (that.value); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (that.value); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (that.value); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (that.value); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (that.value); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (that.value); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (that.value); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (that.value); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (that.value); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (that.value); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (that.value); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (that.value); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (that.value); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (that.value); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (that.value); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (that.value); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (that.value); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (that.value); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (that.value); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (that.value); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (that.value); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (that.value); + break; + + default: + break; + } + + location = that.location; + // that is emptied. + that.state = empty_state; + return *this; + } +#endif + + template + void + parser::yy_destroy_ (const char* yymsg, basic_symbol& yysym) const + { + if (yymsg) + YY_SYMBOL_PRINT (yymsg, yysym); + } + +#if H2DEBUG + template + void + parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const + { + std::ostream& yyoutput = yyo; + YY_USE (yyoutput); + if (yysym.empty ()) + yyo << "empty symbol"; + else + { + symbol_kind_type yykind = yysym.kind (); + yyo << (yykind < YYNTOKENS ? "token" : "nterm") + << ' ' << yysym.name () << " (" + << yysym.location << ": "; + YY_USE (yykind); + yyo << ')'; + } + } +#endif + + void + parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) + { + if (m) + YY_SYMBOL_PRINT (m, sym); + yystack_.push (YY_MOVE (sym)); + } + + void + parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) + { +#if 201103L <= YY_CPLUSPLUS + yypush_ (m, stack_symbol_type (s, std::move (sym))); +#else + stack_symbol_type ss (s, sym); + yypush_ (m, ss); +#endif + } + + void + parser::yypop_ (int n) + { + yystack_.pop (n); + } + +#if H2DEBUG + std::ostream& + parser::debug_stream () const + { + return *yycdebug_; + } + + void + parser::set_debug_stream (std::ostream& o) + { + yycdebug_ = &o; + } + + + parser::debug_level_type + parser::debug_level () const + { + return yydebug_; + } + + void + parser::set_debug_level (debug_level_type l) + { + yydebug_ = l; + } +#endif // H2DEBUG + + parser::state_type + parser::yy_lr_goto_state_ (state_type yystate, int yysym) + { + int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; + if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) + return yytable_[yyr]; + else + return yydefgoto_[yysym - YYNTOKENS]; + } + + bool + parser::yy_pact_value_is_default_ (int yyvalue) + { + return yyvalue == yypact_ninf_; + } + + bool + parser::yy_table_value_is_error_ (int yyvalue) + { + return yyvalue == yytable_ninf_; + } + + int + parser::operator() () + { + return parse (); + } + + int + parser::parse () + { + int yyn; + /// Length of the RHS of the rule being reduced. + int yylen = 0; + + // Error handling. + int yynerrs_ = 0; + int yyerrstatus_ = 0; + + /// The lookahead symbol. + symbol_type yyla; + + /// The locations where the error started and ended. + stack_symbol_type yyerror_range[3]; + + /// The return value of parse (). + int yyresult; + + /// Discard the LAC context in case there still is one left from a + /// previous invocation. + yy_lac_discard_ ("init"); + +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + YYCDEBUG << "Starting parse\n"; + + + /* Initialize the stack. The initial state will be set in + yynewstate, since the latter expects the semantical and the + location values to have been already stored, initialize these + stacks with a primary value. */ + yystack_.clear (); + yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); + + /*-----------------------------------------------. + | yynewstate -- push a new symbol on the stack. | + `-----------------------------------------------*/ + yynewstate: + YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; + YY_STACK_PRINT (); + + // Accept? + if (yystack_[0].state == yyfinal_) + YYACCEPT; + + goto yybackup; + + + /*-----------. + | yybackup. | + `-----------*/ + yybackup: + // Try to take a decision without lookahead. + yyn = yypact_[+yystack_[0].state]; + if (yy_pact_value_is_default_ (yyn)) + goto yydefault; + + // Read a lookahead token. + if (yyla.empty ()) + { + YYCDEBUG << "Reading a token\n"; +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + symbol_type yylookahead (yylex (yyscanner, loc)); + yyla.move (yylookahead); + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + goto yyerrlab1; + } +#endif // YY_EXCEPTIONS + } + YY_SYMBOL_PRINT ("Next token is", yyla); + + if (yyla.kind () == symbol_kind::S_YYerror) + { + // The scanner already issued an error message, process directly + // to error recovery. But do not keep the error token as + // lookahead, it is too special and may lead us to an endless + // loop in error recovery. */ + yyla.kind_ = symbol_kind::S_YYUNDEF; + goto yyerrlab1; + } + + /* If the proper action on seeing token YYLA.TYPE is to reduce or + to detect an error, take that action. */ + yyn += yyla.kind (); + if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) + { + if (!yy_lac_establish_ (yyla.kind ())) + goto yyerrlab; + goto yydefault; + } + + // Reduce or error. + yyn = yytable_[yyn]; + if (yyn <= 0) + { + if (yy_table_value_is_error_ (yyn)) + goto yyerrlab; + if (!yy_lac_establish_ (yyla.kind ())) + goto yyerrlab; + + yyn = -yyn; + goto yyreduce; + } + + // Count tokens shifted since error; after three, turn off error status. + if (yyerrstatus_) + --yyerrstatus_; + + // Shift the lookahead token. + yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); + yy_lac_discard_ ("shift"); + goto yynewstate; + + + /*-----------------------------------------------------------. + | yydefault -- do the default action for the current state. | + `-----------------------------------------------------------*/ + yydefault: + yyn = yydefact_[+yystack_[0].state]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + + /*-----------------------------. + | yyreduce -- do a reduction. | + `-----------------------------*/ + yyreduce: + yylen = yyr2_[yyn]; + { + stack_symbol_type yylhs; + yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); + /* Variants are always initialized to an empty instance of the + correct type. The default '$$ = $1' action is NOT applied + when using variants. */ + switch (yyr1_[yyn]) + { + case symbol_kind::S_anim: // anim + yylhs.value.emplace< anim_ptr > (); + break; + + case symbol_kind::S_animation: // animation + yylhs.value.emplace< animation_ptr > (); + break; + + case symbol_kind::S_animtree: // animtree + yylhs.value.emplace< animtree_ptr > (); + break; + + case symbol_kind::S_constant: // constant + yylhs.value.emplace< constant_ptr > (); + break; + + case symbol_kind::S_define: // define + yylhs.value.emplace< define_ptr > (); + break; + + case symbol_kind::S_empty_array: // empty_array + yylhs.value.emplace< empty_array_ptr > (); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + yylhs.value.emplace< expr_arguments_ptr > (); + break; + + case symbol_kind::S_expr_assign: // expr_assign + yylhs.value.emplace< expr_assign_ptr > (); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + yylhs.value.emplace< expr_call_ptr > (); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + yylhs.value.emplace< expr_call_type_ptr > (); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + yylhs.value.emplace< expr_ptr > (); + break; + + case symbol_kind::S_false: // false + yylhs.value.emplace< false_ptr > (); + break; + + case symbol_kind::S_file: // file + yylhs.value.emplace< file_ptr > (); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + yylhs.value.emplace< float_ptr > (); + break; + + case symbol_kind::S_game: // game + yylhs.value.emplace< game_ptr > (); + break; + + case symbol_kind::S_include: // include + yylhs.value.emplace< include_ptr > (); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + yylhs.value.emplace< integer_ptr > (); + break; + + case symbol_kind::S_istring: // istring + yylhs.value.emplace< istring_ptr > (); + break; + + case symbol_kind::S_level: // level + yylhs.value.emplace< level_ptr > (); + break; + + case symbol_kind::S_name: // name + yylhs.value.emplace< name_ptr > (); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + yylhs.value.emplace< node_ptr > (); + break; + + case symbol_kind::S_parameters: // parameters + yylhs.value.emplace< parameters_ptr > (); + break; + + case symbol_kind::S_program: // program + yylhs.value.emplace< program_ptr > (); + break; + + case symbol_kind::S_self: // self + yylhs.value.emplace< self_ptr > (); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + yylhs.value.emplace< std::string > (); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + yylhs.value.emplace< stmt_assign_ptr > (); + break; + + case symbol_kind::S_stmt_break: // stmt_break + yylhs.value.emplace< stmt_break_ptr > (); + break; + + case symbol_kind::S_stmt_call: // stmt_call + yylhs.value.emplace< stmt_call_ptr > (); + break; + + case symbol_kind::S_stmt_case: // stmt_case + yylhs.value.emplace< stmt_case_ptr > (); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + yylhs.value.emplace< stmt_continue_ptr > (); + break; + + case symbol_kind::S_stmt_default: // stmt_default + yylhs.value.emplace< stmt_default_ptr > (); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + yylhs.value.emplace< stmt_endon_ptr > (); + break; + + case symbol_kind::S_stmt_for: // stmt_for + yylhs.value.emplace< stmt_for_ptr > (); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + yylhs.value.emplace< stmt_foreach_ptr > (); + break; + + case symbol_kind::S_stmt_if: // stmt_if + yylhs.value.emplace< stmt_if_ptr > (); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + yylhs.value.emplace< stmt_ifelse_ptr > (); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + yylhs.value.emplace< stmt_list_ptr > (); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + yylhs.value.emplace< stmt_notify_ptr > (); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + yylhs.value.emplace< stmt_ptr > (); + break; + + case symbol_kind::S_stmt_return: // stmt_return + yylhs.value.emplace< stmt_return_ptr > (); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + yylhs.value.emplace< stmt_switch_ptr > (); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + yylhs.value.emplace< stmt_wait_ptr > (); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + yylhs.value.emplace< stmt_waitframe_ptr > (); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + yylhs.value.emplace< stmt_waittill_ptr > (); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + yylhs.value.emplace< stmt_waittillframeend_ptr > (); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + yylhs.value.emplace< stmt_waittillmatch_ptr > (); + break; + + case symbol_kind::S_stmt_while: // stmt_while + yylhs.value.emplace< stmt_while_ptr > (); + break; + + case symbol_kind::S_string: // string + yylhs.value.emplace< string_ptr > (); + break; + + case symbol_kind::S_thisthread: // thisthread + yylhs.value.emplace< thisthread_ptr > (); + break; + + case symbol_kind::S_thread: // thread + yylhs.value.emplace< thread_ptr > (); + break; + + case symbol_kind::S_true: // true + yylhs.value.emplace< true_ptr > (); + break; + + case symbol_kind::S_undefined: // undefined + yylhs.value.emplace< undefined_ptr > (); + break; + + case symbol_kind::S_usingtree: // usingtree + yylhs.value.emplace< usingtree_ptr > (); + break; + + case symbol_kind::S_vector: // vector + yylhs.value.emplace< vector_ptr > (); + break; + + default: + break; + } + + + // Default location. + { + stack_type::slice range (yystack_, yylen); + YYLLOC_DEFAULT (yylhs.location, range, yylen); + yyerror_range[1].location = yylhs.location; + } + + // Perform the reduction. + YY_REDUCE_PRINT (yyn); +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + switch (yyn) + { + case 2: // root: program +#line 233 "parser.ypp" + { ast = std::move(yystack_[0].value.as < program_ptr > ()); } +#line 1751 "parser.cpp" + break; + + case 3: // root: %empty +#line 234 "parser.ypp" + { ast = std::make_unique(yylhs.location); } +#line 1757 "parser.cpp" + break; + + case 4: // program: program include +#line 239 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::move(yystack_[1].value.as < program_ptr > ()); yylhs.value.as < program_ptr > ()->includes.push_back(std::move(yystack_[0].value.as < include_ptr > ())); } +#line 1763 "parser.cpp" + break; + + case 5: // program: program define +#line 241 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::move(yystack_[1].value.as < program_ptr > ()); yylhs.value.as < program_ptr > ()->definitions.push_back(std::move(yystack_[0].value.as < define_ptr > ())); } +#line 1769 "parser.cpp" + break; + + case 6: // program: include +#line 243 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < program_ptr > ()->includes.push_back(std::move(yystack_[0].value.as < include_ptr > ())); } +#line 1775 "parser.cpp" + break; + + case 7: // program: define +#line 245 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < program_ptr > ()->definitions.push_back(std::move(yystack_[0].value.as < define_ptr > ())); } +#line 1781 "parser.cpp" + break; + + case 8: // include: "#include" file ";" +#line 250 "parser.ypp" + { yylhs.value.as < include_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < file_ptr > ())); } +#line 1787 "parser.cpp" + break; + + case 9: // define: usingtree +#line 254 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_usingtree = std::move(yystack_[0].value.as < usingtree_ptr > ()); } +#line 1793 "parser.cpp" + break; + + case 10: // define: constant +#line 255 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_constant = std::move(yystack_[0].value.as < constant_ptr > ()); } +#line 1799 "parser.cpp" + break; + + case 11: // define: thread +#line 256 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_thread = std::move(yystack_[0].value.as < thread_ptr > ()); } +#line 1805 "parser.cpp" + break; + + case 12: // usingtree: "#using_animtree" "(" string ")" ";" +#line 261 "parser.ypp" + { yylhs.value.as < usingtree_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < string_ptr > ())); } +#line 1811 "parser.cpp" + break; + + case 13: // constant: name "=" expr ";" +#line 266 "parser.ypp" + { yylhs.value.as < constant_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 1817 "parser.cpp" + break; + + case 14: // thread: name "(" parameters ")" stmt_block +#line 271 "parser.ypp" + { yylhs.value.as < thread_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < name_ptr > ()), std::move(yystack_[2].value.as < parameters_ptr > ()), std::move(yystack_[0].value.as < stmt_list_ptr > ())); } +#line 1823 "parser.cpp" + break; + + case 15: // parameters: parameters "," name +#line 276 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::move(yystack_[2].value.as < parameters_ptr > ()); yylhs.value.as < parameters_ptr > ()->list.push_back(std::move(yystack_[0].value.as < name_ptr > ())); } +#line 1829 "parser.cpp" + break; + + case 16: // parameters: name +#line 278 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < parameters_ptr > ()->list.push_back(std::move(yystack_[0].value.as < name_ptr > ())); } +#line 1835 "parser.cpp" + break; + + case 17: // parameters: %empty +#line 280 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::make_unique(yylhs.location); } +#line 1841 "parser.cpp" + break; + + case 18: // stmt: stmt_block +#line 284 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_list = std::move(yystack_[0].value.as < stmt_list_ptr > ()); } +#line 1847 "parser.cpp" + break; + + case 19: // stmt: stmt_call +#line 285 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_call = std::move(yystack_[0].value.as < stmt_call_ptr > ()); } +#line 1853 "parser.cpp" + break; + + case 20: // stmt: stmt_assign +#line 286 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_assign = std::move(yystack_[0].value.as < stmt_assign_ptr > ()); } +#line 1859 "parser.cpp" + break; + + case 21: // stmt: stmt_endon +#line 287 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_endon = std::move(yystack_[0].value.as < stmt_endon_ptr > ()); } +#line 1865 "parser.cpp" + break; + + case 22: // stmt: stmt_notify +#line 288 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_notify = std::move(yystack_[0].value.as < stmt_notify_ptr > ()); } +#line 1871 "parser.cpp" + break; + + case 23: // stmt: stmt_wait +#line 289 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_wait = std::move(yystack_[0].value.as < stmt_wait_ptr > ()); } +#line 1877 "parser.cpp" + break; + + case 24: // stmt: stmt_waittill +#line 290 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittill = std::move(yystack_[0].value.as < stmt_waittill_ptr > ()); } +#line 1883 "parser.cpp" + break; + + case 25: // stmt: stmt_waittillmatch +#line 291 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittillmatch = std::move(yystack_[0].value.as < stmt_waittillmatch_ptr > ()); } +#line 1889 "parser.cpp" + break; + + case 26: // stmt: stmt_waittillframeend +#line 292 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittillframeend = std::move(yystack_[0].value.as < stmt_waittillframeend_ptr > ()); } +#line 1895 "parser.cpp" + break; + + case 27: // stmt: stmt_waitframe +#line 293 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waitframe = std::move(yystack_[0].value.as < stmt_waitframe_ptr > ()); } +#line 1901 "parser.cpp" + break; + + case 28: // stmt: stmt_if +#line 294 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_if = std::move(yystack_[0].value.as < stmt_if_ptr > ()); } +#line 1907 "parser.cpp" + break; + + case 29: // stmt: stmt_ifelse +#line 295 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_ifelse = std::move(yystack_[0].value.as < stmt_ifelse_ptr > ()); } +#line 1913 "parser.cpp" + break; + + case 30: // stmt: stmt_while +#line 296 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_while = std::move(yystack_[0].value.as < stmt_while_ptr > ()); } +#line 1919 "parser.cpp" + break; + + case 31: // stmt: stmt_for +#line 297 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_for = std::move(yystack_[0].value.as < stmt_for_ptr > ()); } +#line 1925 "parser.cpp" + break; + + case 32: // stmt: stmt_foreach +#line 298 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_foreach = std::move(yystack_[0].value.as < stmt_foreach_ptr > ()); } +#line 1931 "parser.cpp" + break; + + case 33: // stmt: stmt_switch +#line 299 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_switch = std::move(yystack_[0].value.as < stmt_switch_ptr > ()); } +#line 1937 "parser.cpp" + break; + + case 34: // stmt: stmt_case +#line 300 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_case = std::move(yystack_[0].value.as < stmt_case_ptr > ()); } +#line 1943 "parser.cpp" + break; + + case 35: // stmt: stmt_default +#line 301 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_default = std::move(yystack_[0].value.as < stmt_default_ptr > ()); } +#line 1949 "parser.cpp" + break; + + case 36: // stmt: stmt_break +#line 302 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_break = std::move(yystack_[0].value.as < stmt_break_ptr > ()); } +#line 1955 "parser.cpp" + break; + + case 37: // stmt: stmt_continue +#line 303 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_continue = std::move(yystack_[0].value.as < stmt_continue_ptr > ()); } +#line 1961 "parser.cpp" + break; + + case 38: // stmt: stmt_return +#line 304 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_return = std::move(yystack_[0].value.as < stmt_return_ptr > ()); } +#line 1967 "parser.cpp" + break; + + case 39: // stmt_block: "{" stmt_list "}" +#line 308 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::move(yystack_[1].value.as < stmt_list_ptr > ()); } +#line 1973 "parser.cpp" + break; + + case 40: // stmt_block: "{" "}" +#line 309 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::make_unique(yylhs.location); } +#line 1979 "parser.cpp" + break; + + case 41: // stmt_list: stmt_list stmt +#line 314 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::move(yystack_[1].value.as < stmt_list_ptr > ()); yylhs.value.as < stmt_list_ptr > ()->stmts.push_back(std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 1985 "parser.cpp" + break; + + case 42: // stmt_list: stmt +#line 316 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < stmt_list_ptr > ()->stmts.push_back(std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 1991 "parser.cpp" + break; + + case 43: // stmt_call: expr_call ";" +#line 321 "parser.ypp" + { yylhs.value.as < stmt_call_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_call_ptr > ())); } +#line 1997 "parser.cpp" + break; + + case 44: // stmt_call: expr_call_thread ";" +#line 323 "parser.ypp" + { yylhs.value.as < stmt_call_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_call_ptr > ())); } +#line 2003 "parser.cpp" + break; + + case 45: // stmt_assign: expr_assign ";" +#line 328 "parser.ypp" + { yylhs.value.as < stmt_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_assign_ptr > ())); } +#line 2009 "parser.cpp" + break; + + case 46: // stmt_endon: object "endon" "(" expr ")" ";" +#line 333 "parser.ypp" + { yylhs.value.as < stmt_endon_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ())); } +#line 2015 "parser.cpp" + break; + + case 47: // stmt_notify: object "notify" "(" expr "," expr_arguments ")" ";" +#line 338 "parser.ypp" + { yylhs.value.as < stmt_notify_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 2021 "parser.cpp" + break; + + case 48: // stmt_notify: object "notify" "(" expr ")" ";" +#line 340 "parser.ypp" + { yylhs.value.as < stmt_notify_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2027 "parser.cpp" + break; + + case 49: // stmt_wait: "wait" expr ";" +#line 345 "parser.ypp" + { yylhs.value.as < stmt_wait_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2033 "parser.cpp" + break; + + case 50: // stmt_waittill: object "waittill" "(" expr "," expr_arguments ")" ";" +#line 350 "parser.ypp" + { yylhs.value.as < stmt_waittill_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 2039 "parser.cpp" + break; + + case 51: // stmt_waittill: object "waittill" "(" expr ")" ";" +#line 352 "parser.ypp" + { yylhs.value.as < stmt_waittill_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2045 "parser.cpp" + break; + + case 52: // stmt_waittillmatch: object "waittillmatch" "(" expr "," expr_arguments ")" ";" +#line 357 "parser.ypp" + { yylhs.value.as < stmt_waittillmatch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 2051 "parser.cpp" + break; + + case 53: // stmt_waittillmatch: object "waittillmatch" "(" expr ")" ";" +#line 359 "parser.ypp" + { yylhs.value.as < stmt_waittillmatch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2057 "parser.cpp" + break; + + case 54: // stmt_waittillframeend: "waittillframeend" ";" +#line 364 "parser.ypp" + { yylhs.value.as < stmt_waittillframeend_ptr > () = std::make_unique(yylhs.location); } +#line 2063 "parser.cpp" + break; + + case 55: // stmt_waitframe: "waitframe" ";" +#line 369 "parser.ypp" + { yylhs.value.as < stmt_waitframe_ptr > () = std::make_unique(yylhs.location); } +#line 2069 "parser.cpp" + break; + + case 56: // stmt_waitframe: "waitframe" "(" ")" ";" +#line 371 "parser.ypp" + { yylhs.value.as < stmt_waitframe_ptr > () = std::make_unique(yylhs.location); } +#line 2075 "parser.cpp" + break; + + case 57: // stmt_if: "if" "(" expr ")" stmt +#line 376 "parser.ypp" + { yylhs.value.as < stmt_if_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2081 "parser.cpp" + break; + + case 58: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt +#line 381 "parser.ypp" + { yylhs.value.as < stmt_ifelse_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < stmt_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2087 "parser.cpp" + break; + + case 59: // stmt_while: "while" "(" expr ")" stmt +#line 386 "parser.ypp" + { yylhs.value.as < stmt_while_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2093 "parser.cpp" + break; + + case 60: // stmt_for: "for" "(" for_stmt ";" for_expr ";" for_stmt ")" stmt +#line 391 "parser.ypp" + { yylhs.value.as < stmt_for_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[6].value.as < stmt_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < stmt_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2099 "parser.cpp" + break; + + case 61: // stmt_foreach: "foreach" "(" name "in" expr ")" stmt +#line 396 "parser.ypp" + { yylhs.value.as < stmt_foreach_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[4].value.as < name_ptr > ())), std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2105 "parser.cpp" + break; + + case 62: // stmt_foreach: "foreach" "(" name "," name "in" expr ")" stmt +#line 398 "parser.ypp" + { yylhs.value.as < stmt_foreach_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[6].value.as < name_ptr > ())), expr_ptr(std::move(yystack_[4].value.as < name_ptr > ())), std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2111 "parser.cpp" + break; + + case 63: // stmt_switch: "switch" "(" expr ")" stmt_block +#line 403 "parser.ypp" + { yylhs.value.as < stmt_switch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_list_ptr > ())); } +#line 2117 "parser.cpp" + break; + + case 64: // stmt_case: "case" integer ":" +#line 408 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < integer_ptr > ())), std::make_unique(yylhs.location)); } +#line 2123 "parser.cpp" + break; + + case 65: // stmt_case: "case" neg_integer ":" +#line 410 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < integer_ptr > ())), std::make_unique(yylhs.location)); } +#line 2129 "parser.cpp" + break; + + case 66: // stmt_case: "case" string ":" +#line 412 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < string_ptr > ())), std::make_unique(yylhs.location)); } +#line 2135 "parser.cpp" + break; + + case 67: // stmt_default: "default" ":" +#line 417 "parser.ypp" + { yylhs.value.as < stmt_default_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } +#line 2141 "parser.cpp" + break; + + case 68: // stmt_break: "break" ";" +#line 422 "parser.ypp" + { yylhs.value.as < stmt_break_ptr > () = std::make_unique(yylhs.location); } +#line 2147 "parser.cpp" + break; + + case 69: // stmt_continue: "continue" ";" +#line 427 "parser.ypp" + { yylhs.value.as < stmt_continue_ptr > () = std::make_unique(yylhs.location); } +#line 2153 "parser.cpp" + break; + + case 70: // stmt_return: "return" expr ";" +#line 432 "parser.ypp" + { yylhs.value.as < stmt_return_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2159 "parser.cpp" + break; + + case 71: // stmt_return: "return" ";" +#line 434 "parser.ypp" + { yylhs.value.as < stmt_return_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } +#line 2165 "parser.cpp" + break; + + case 72: // for_stmt: expr_assign +#line 438 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_list = std::make_unique(yylhs.location); yylhs.value.as < stmt_ptr > ().as_list->stmts.push_back(stmt_ptr(std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_assign_ptr > ())))); } +#line 2171 "parser.cpp" + break; + + case 73: // for_stmt: %empty +#line 439 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_node = std::make_unique(yylhs.location); } +#line 2177 "parser.cpp" + break; + + case 74: // for_expr: expr +#line 443 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2183 "parser.cpp" + break; + + case 75: // for_expr: %empty +#line 444 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location); } +#line 2189 "parser.cpp" + break; + + case 76: // expr: expr_compare +#line 448 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2195 "parser.cpp" + break; + + case 77: // expr: expr_binary +#line 449 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2201 "parser.cpp" + break; + + case 78: // expr: expr_primitive +#line 450 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2207 "parser.cpp" + break; + + case 79: // expr_assign: "++" object +#line 454 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < node_ptr > ())); } +#line 2213 "parser.cpp" + break; + + case 80: // expr_assign: "--" object +#line 455 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < node_ptr > ())); } +#line 2219 "parser.cpp" + break; + + case 81: // expr_assign: object "++" +#line 456 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < node_ptr > ())); } +#line 2225 "parser.cpp" + break; + + case 82: // expr_assign: object "--" +#line 457 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < node_ptr > ())); } +#line 2231 "parser.cpp" + break; + + case 83: // expr_assign: object "=" expr +#line 458 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2237 "parser.cpp" + break; + + case 84: // expr_assign: object "|=" expr +#line 459 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2243 "parser.cpp" + break; + + case 85: // expr_assign: object "&=" expr +#line 460 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2249 "parser.cpp" + break; + + case 86: // expr_assign: object "^=" expr +#line 461 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2255 "parser.cpp" + break; + + case 87: // expr_assign: object "<<=" expr +#line 462 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()),std::move( yystack_[0].value.as < expr_ptr > ())); } +#line 2261 "parser.cpp" + break; + + case 88: // expr_assign: object ">>=" expr +#line 463 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2267 "parser.cpp" + break; + + case 89: // expr_assign: object "+=" expr +#line 464 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2273 "parser.cpp" + break; + + case 90: // expr_assign: object "-=" expr +#line 465 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2279 "parser.cpp" + break; + + case 91: // expr_assign: object "*=" expr +#line 466 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2285 "parser.cpp" + break; + + case 92: // expr_assign: object "/=" expr +#line 467 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2291 "parser.cpp" + break; + + case 93: // expr_assign: object "%=" expr +#line 468 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2297 "parser.cpp" + break; + + case 94: // expr_compare: expr "||" expr +#line 472 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2303 "parser.cpp" + break; + + case 95: // expr_compare: expr "&&" expr +#line 473 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2309 "parser.cpp" + break; + + case 96: // expr_compare: expr "==" expr +#line 474 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2315 "parser.cpp" + break; + + case 97: // expr_compare: expr "!=" expr +#line 475 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2321 "parser.cpp" + break; + + case 98: // expr_compare: expr "<=" expr +#line 476 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2327 "parser.cpp" + break; + + case 99: // expr_compare: expr ">=" expr +#line 477 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2333 "parser.cpp" + break; + + case 100: // expr_compare: expr "<" expr +#line 478 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2339 "parser.cpp" + break; + + case 101: // expr_compare: expr ">" expr +#line 479 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2345 "parser.cpp" + break; + + case 102: // expr_binary: expr "|" expr +#line 483 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2351 "parser.cpp" + break; + + case 103: // expr_binary: expr "&" expr +#line 484 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2357 "parser.cpp" + break; + + case 104: // expr_binary: expr "^" expr +#line 485 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2363 "parser.cpp" + break; + + case 105: // expr_binary: expr "<<" expr +#line 486 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2369 "parser.cpp" + break; + + case 106: // expr_binary: expr ">>" expr +#line 487 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2375 "parser.cpp" + break; + + case 107: // expr_binary: expr "+" expr +#line 488 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2381 "parser.cpp" + break; + + case 108: // expr_binary: expr "-" expr +#line 489 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2387 "parser.cpp" + break; + + case 109: // expr_binary: expr "*" expr +#line 490 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2393 "parser.cpp" + break; + + case 110: // expr_binary: expr "/" expr +#line 491 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2399 "parser.cpp" + break; + + case 111: // expr_binary: expr "%" expr +#line 492 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2405 "parser.cpp" + break; + + case 112: // expr_primitive: "(" expr ")" +#line 496 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[1].value.as < expr_ptr > ()); } +#line 2411 "parser.cpp" + break; + + case 113: // expr_primitive: "~" expr +#line 497 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2417 "parser.cpp" + break; + + case 114: // expr_primitive: "!" expr +#line 498 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2423 "parser.cpp" + break; + + case 115: // expr_primitive: expr_call +#line 499 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2429 "parser.cpp" + break; + + case 116: // expr_primitive: expr_call_thread +#line 500 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2435 "parser.cpp" + break; + + case 117: // expr_primitive: expr_call_childthread +#line 501 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2441 "parser.cpp" + break; + + case 118: // expr_primitive: expr_function +#line 502 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2447 "parser.cpp" + break; + + case 119: // expr_primitive: expr_add_array +#line 503 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2453 "parser.cpp" + break; + + case 120: // expr_primitive: expr_array +#line 504 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2459 "parser.cpp" + break; + + case 121: // expr_primitive: expr_field +#line 505 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2465 "parser.cpp" + break; + + case 122: // expr_primitive: expr_size +#line 506 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2471 "parser.cpp" + break; + + case 123: // expr_primitive: thisthread +#line 507 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < thisthread_ptr > ()); } +#line 2477 "parser.cpp" + break; + + case 124: // expr_primitive: empty_array +#line 508 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < empty_array_ptr > ()); } +#line 2483 "parser.cpp" + break; + + case 125: // expr_primitive: undefined +#line 509 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < undefined_ptr > ()); } +#line 2489 "parser.cpp" + break; + + case 126: // expr_primitive: game +#line 510 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < game_ptr > ()); } +#line 2495 "parser.cpp" + break; + + case 127: // expr_primitive: self +#line 511 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < self_ptr > ()); } +#line 2501 "parser.cpp" + break; + + case 128: // expr_primitive: anim +#line 512 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < anim_ptr > ()); } +#line 2507 "parser.cpp" + break; + + case 129: // expr_primitive: level +#line 513 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < level_ptr > ()); } +#line 2513 "parser.cpp" + break; + + case 130: // expr_primitive: animation +#line 514 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < animation_ptr > ()); } +#line 2519 "parser.cpp" + break; + + case 131: // expr_primitive: animtree +#line 515 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < animtree_ptr > ()); } +#line 2525 "parser.cpp" + break; + + case 132: // expr_primitive: name +#line 516 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < name_ptr > ()); } +#line 2531 "parser.cpp" + break; + + case 133: // expr_primitive: istring +#line 517 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < istring_ptr > ()); } +#line 2537 "parser.cpp" + break; + + case 134: // expr_primitive: string +#line 518 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < string_ptr > ()); } +#line 2543 "parser.cpp" + break; + + case 135: // expr_primitive: vector +#line 519 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < vector_ptr > ()); } +#line 2549 "parser.cpp" + break; + + case 136: // expr_primitive: neg_float +#line 520 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < float_ptr > ()); } +#line 2555 "parser.cpp" + break; + + case 137: // expr_primitive: neg_integer +#line 521 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < integer_ptr > ()); } +#line 2561 "parser.cpp" + break; + + case 138: // expr_primitive: float +#line 522 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < float_ptr > ()); } +#line 2567 "parser.cpp" + break; + + case 139: // expr_primitive: integer +#line 523 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < integer_ptr > ()); } +#line 2573 "parser.cpp" + break; + + case 140: // expr_primitive: false +#line 524 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < false_ptr > ()); } +#line 2579 "parser.cpp" + break; + + case 141: // expr_primitive: true +#line 525 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < true_ptr > ()); } +#line 2585 "parser.cpp" + break; + + case 142: // expr_call: expr_call_function +#line 529 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2591 "parser.cpp" + break; + + case 143: // expr_call: expr_call_pointer +#line 530 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2597 "parser.cpp" + break; + + case 144: // expr_call: object expr_call_function +#line 531 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::move(yystack_[1].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2603 "parser.cpp" + break; + + case 145: // expr_call: object expr_call_pointer +#line 532 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::move(yystack_[1].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2609 "parser.cpp" + break; + + case 146: // expr_call_thread: "thread" expr_call_function +#line 536 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2615 "parser.cpp" + break; + + case 147: // expr_call_thread: "thread" expr_call_pointer +#line 537 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2621 "parser.cpp" + break; + + case 148: // expr_call_thread: object "thread" expr_call_function +#line 538 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2627 "parser.cpp" + break; + + case 149: // expr_call_thread: object "thread" expr_call_pointer +#line 539 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2633 "parser.cpp" + break; + + case 150: // expr_call_childthread: "childthread" expr_call_function +#line 543 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2639 "parser.cpp" + break; + + case 151: // expr_call_childthread: "childthread" expr_call_pointer +#line 544 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2645 "parser.cpp" + break; + + case 152: // expr_call_childthread: object "childthread" expr_call_function +#line 545 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2651 "parser.cpp" + break; + + case 153: // expr_call_childthread: object "childthread" expr_call_pointer +#line 546 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2657 "parser.cpp" + break; + + case 154: // expr_call_function: name "(" expr_arguments ")" +#line 551 "parser.ypp" + {yylhs.value.as < expr_call_type_ptr > ().as_func = std::make_unique(yylhs.location, std::make_unique(), std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2663 "parser.cpp" + break; + + case 155: // expr_call_function: file "::" name "(" expr_arguments ")" +#line 553 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_func = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < file_ptr > ()), std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2669 "parser.cpp" + break; + + case 156: // expr_call_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 558 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_pointer = std::make_unique(yylhs.location, false, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2675 "parser.cpp" + break; + + case 157: // expr_call_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 560 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_pointer = std::make_unique(yylhs.location, true, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2681 "parser.cpp" + break; + + case 158: // expr_arguments: expr_arguments_filled +#line 564 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[0].value.as < expr_arguments_ptr > ()); } +#line 2687 "parser.cpp" + break; + + case 159: // expr_arguments: expr_arguments_empty +#line 565 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[0].value.as < expr_arguments_ptr > ()); } +#line 2693 "parser.cpp" + break; + + case 160: // expr_arguments_filled: expr_arguments "," expr +#line 570 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[2].value.as < expr_arguments_ptr > ()); yylhs.value.as < expr_arguments_ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2699 "parser.cpp" + break; + + case 161: // expr_arguments_filled: expr +#line 572 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < expr_arguments_ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2705 "parser.cpp" + break; + + case 162: // expr_arguments_empty: %empty +#line 577 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::make_unique(yylhs.location); } +#line 2711 "parser.cpp" + break; + + case 163: // expr_function: "::" name +#line 582 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2717 "parser.cpp" + break; + + case 164: // expr_function: file "::" name +#line 584 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < file_ptr > ()), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2723 "parser.cpp" + break; + + case 165: // expr_add_array: "[" expr_arguments_filled "]" +#line 589 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2729 "parser.cpp" + break; + + case 166: // expr_array: object "[" expr "]" +#line 594 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < node_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2735 "parser.cpp" + break; + + case 167: // expr_field: object "." name +#line 599 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2741 "parser.cpp" + break; + + case 168: // expr_size: object "." "size" +#line 604 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ())); } +#line 2747 "parser.cpp" + break; + + case 169: // object: expr_call +#line 608 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2753 "parser.cpp" + break; + + case 170: // object: expr_array +#line 609 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2759 "parser.cpp" + break; + + case 171: // object: expr_field +#line 610 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2765 "parser.cpp" + break; + + case 172: // object: game +#line 611 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < game_ptr > ()); } +#line 2771 "parser.cpp" + break; + + case 173: // object: self +#line 612 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < self_ptr > ()); } +#line 2777 "parser.cpp" + break; + + case 174: // object: anim +#line 613 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < anim_ptr > ()); } +#line 2783 "parser.cpp" + break; + + case 175: // object: level +#line 614 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < level_ptr > ()); } +#line 2789 "parser.cpp" + break; + + case 176: // object: name +#line 615 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < name_ptr > ()); } +#line 2795 "parser.cpp" + break; + + case 177: // thisthread: "thisthread" +#line 618 "parser.ypp" + { yylhs.value.as < thisthread_ptr > () = std::make_unique(yylhs.location); } +#line 2801 "parser.cpp" + break; + + case 178: // empty_array: "[" "]" +#line 619 "parser.ypp" + { yylhs.value.as < empty_array_ptr > () = std::make_unique(yylhs.location); } +#line 2807 "parser.cpp" + break; + + case 179: // undefined: "undefined" +#line 620 "parser.ypp" + { yylhs.value.as < undefined_ptr > () = std::make_unique(yylhs.location); } +#line 2813 "parser.cpp" + break; + + case 180: // game: "game" +#line 621 "parser.ypp" + { yylhs.value.as < game_ptr > () = std::make_unique(yylhs.location); } +#line 2819 "parser.cpp" + break; + + case 181: // self: "self" +#line 622 "parser.ypp" + { yylhs.value.as < self_ptr > () = std::make_unique(yylhs.location); } +#line 2825 "parser.cpp" + break; + + case 182: // anim: "anim" +#line 623 "parser.ypp" + { yylhs.value.as < anim_ptr > () = std::make_unique(yylhs.location); } +#line 2831 "parser.cpp" + break; + + case 183: // level: "level" +#line 624 "parser.ypp" + { yylhs.value.as < level_ptr > () = std::make_unique(yylhs.location); } +#line 2837 "parser.cpp" + break; + + case 184: // animation: "%" "identifier" +#line 625 "parser.ypp" + { yylhs.value.as < animation_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2843 "parser.cpp" + break; + + case 185: // animtree: "#animtree" +#line 626 "parser.ypp" + { yylhs.value.as < animtree_ptr > () = std::make_unique(yylhs.location); } +#line 2849 "parser.cpp" + break; + + case 186: // name: "identifier" +#line 627 "parser.ypp" + { yylhs.value.as < name_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2855 "parser.cpp" + break; + + case 187: // file: "file path" +#line 628 "parser.ypp" + { yylhs.value.as < file_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2861 "parser.cpp" + break; + + case 188: // istring: "localized string" +#line 629 "parser.ypp" + { yylhs.value.as < istring_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2867 "parser.cpp" + break; + + case 189: // string: "string literal" +#line 630 "parser.ypp" + { yylhs.value.as < string_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2873 "parser.cpp" + break; + + case 190: // vector: "(" expr "," expr "," expr ")" +#line 631 "parser.ypp" + { yylhs.value.as < vector_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[3].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2879 "parser.cpp" + break; + + case 191: // neg_float: "-" "float" +#line 632 "parser.ypp" + { yylhs.value.as < float_ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 2885 "parser.cpp" + break; + + case 192: // neg_integer: "-" "int" +#line 633 "parser.ypp" + { yylhs.value.as < integer_ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 2891 "parser.cpp" + break; + + case 193: // float: "float" +#line 634 "parser.ypp" + { yylhs.value.as < float_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2897 "parser.cpp" + break; + + case 194: // integer: "int" +#line 635 "parser.ypp" + { yylhs.value.as < integer_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2903 "parser.cpp" + break; + + case 195: // false: "false" +#line 636 "parser.ypp" + { yylhs.value.as < false_ptr > () = std::make_unique(yylhs.location); } +#line 2909 "parser.cpp" + break; + + case 196: // true: "true" +#line 637 "parser.ypp" + { yylhs.value.as < true_ptr > () = std::make_unique(yylhs.location); } +#line 2915 "parser.cpp" + break; + + +#line 2919 "parser.cpp" + + default: + break; + } + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + YYERROR; + } +#endif // YY_EXCEPTIONS + YY_SYMBOL_PRINT ("-> $$ =", yylhs); + yypop_ (yylen); + yylen = 0; + + // Shift the result of the reduction. + yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); + } + goto yynewstate; + + + /*--------------------------------------. + | yyerrlab -- here on detecting error. | + `--------------------------------------*/ + yyerrlab: + // If not already recovering from an error, report this error. + if (!yyerrstatus_) + { + ++yynerrs_; + context yyctx (*this, yyla); + std::string msg = yysyntax_error_ (yyctx); + error (yyla.location, YY_MOVE (msg)); + } + + + yyerror_range[1].location = yyla.location; + if (yyerrstatus_ == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + // Return failure if at end of input. + if (yyla.kind () == symbol_kind::S_YYEOF) + YYABORT; + else if (!yyla.empty ()) + { + yy_destroy_ ("Error: discarding", yyla); + yyla.clear (); + } + } + + // Else will try to reuse lookahead token after shifting the error token. + goto yyerrlab1; + + + /*---------------------------------------------------. + | yyerrorlab -- error raised explicitly by YYERROR. | + `---------------------------------------------------*/ + yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and + the label yyerrorlab therefore never appears in user code. */ + if (false) + YYERROR; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + yypop_ (yylen); + yylen = 0; + YY_STACK_PRINT (); + goto yyerrlab1; + + + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ + yyerrlab1: + yyerrstatus_ = 3; // Each real token shifted decrements this. + // Pop stack until we find a state that shifts the error token. + for (;;) + { + yyn = yypact_[+yystack_[0].state]; + if (!yy_pact_value_is_default_ (yyn)) + { + yyn += symbol_kind::S_YYerror; + if (0 <= yyn && yyn <= yylast_ + && yycheck_[yyn] == symbol_kind::S_YYerror) + { + yyn = yytable_[yyn]; + if (0 < yyn) + break; + } + } + + // Pop the current state because it cannot handle the error token. + if (yystack_.size () == 1) + YYABORT; + + yyerror_range[1].location = yystack_[0].location; + yy_destroy_ ("Error: popping", yystack_[0]); + yypop_ (); + YY_STACK_PRINT (); + } + { + stack_symbol_type error_token; + + yyerror_range[2].location = yyla.location; + YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); + + // Shift the error token. + yy_lac_discard_ ("error recovery"); + error_token.state = state_type (yyn); + yypush_ ("Shifting", YY_MOVE (error_token)); + } + goto yynewstate; + + + /*-------------------------------------. + | yyacceptlab -- YYACCEPT comes here. | + `-------------------------------------*/ + yyacceptlab: + yyresult = 0; + goto yyreturn; + + + /*-----------------------------------. + | yyabortlab -- YYABORT comes here. | + `-----------------------------------*/ + yyabortlab: + yyresult = 1; + goto yyreturn; + + + /*-----------------------------------------------------. + | yyreturn -- parsing is finished, return the result. | + `-----------------------------------------------------*/ + yyreturn: + if (!yyla.empty ()) + yy_destroy_ ("Cleanup: discarding lookahead", yyla); + + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + yypop_ (yylen); + YY_STACK_PRINT (); + while (1 < yystack_.size ()) + { + yy_destroy_ ("Cleanup: popping", yystack_[0]); + yypop_ (); + } + + return yyresult; + } +#if YY_EXCEPTIONS + catch (...) + { + YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; + // Do not try to display the values of the reclaimed symbols, + // as their printers might throw an exception. + if (!yyla.empty ()) + yy_destroy_ (YY_NULLPTR, yyla); + + while (1 < yystack_.size ()) + { + yy_destroy_ (YY_NULLPTR, yystack_[0]); + yypop_ (); + } + throw; + } +#endif // YY_EXCEPTIONS + } + + void + parser::error (const syntax_error& yyexc) + { + error (yyexc.location, yyexc.what ()); + } + + const char * + parser::symbol_name (symbol_kind_type yysymbol) + { + static const char *const yy_sname[] = + { + "end of file", "error", "invalid token", "#include", "#using_animtree", + "#animtree", "endon", "notify", "wait", "waittill", "waittillmatch", + "waittillframeend", "waitframe", "if", "else", "while", "for", "foreach", + "in", "switch", "case", "default", "break", "continue", "return", + "thread", "childthread", "thisthread", "call", "true", "false", + "undefined", "size", "game", "self", "anim", "level", "(", ")", "{", "}", + "[", "]", ",", ".", "::", ":", ";", "++", "--", "<<", ">>", "||", "&&", + "==", "!=", "<=", ">=", "<", ">", "!", "~", "=", "+=", "-=", "*=", "/=", + "%=", "|=", "&=", "^=", ">>=", "<<=", "|", "&", "^", "+", "-", "*", "/", + "%", "file path", "identifier", "string literal", "localized string", + "float", "int", "ADD_ARRAY", "THEN", "NEG", "ANIMREF", "PREINC", + "PREDEC", "POSTINC", "POSTDEC", "$accept", "root", "program", "include", + "define", "usingtree", "constant", "thread", "parameters", "stmt", + "stmt_block", "stmt_list", "stmt_call", "stmt_assign", "stmt_endon", + "stmt_notify", "stmt_wait", "stmt_waittill", "stmt_waittillmatch", + "stmt_waittillframeend", "stmt_waitframe", "stmt_if", "stmt_ifelse", + "stmt_while", "stmt_for", "stmt_foreach", "stmt_switch", "stmt_case", + "stmt_default", "stmt_break", "stmt_continue", "stmt_return", "for_stmt", + "for_expr", "expr", "expr_assign", "expr_compare", "expr_binary", + "expr_primitive", "expr_call", "expr_call_thread", + "expr_call_childthread", "expr_call_function", "expr_call_pointer", + "expr_arguments", "expr_arguments_filled", "expr_arguments_empty", + "expr_function", "expr_add_array", "expr_array", "expr_field", + "expr_size", "object", "thisthread", "empty_array", "undefined", "game", + "self", "anim", "level", "animation", "animtree", "name", "file", + "istring", "string", "vector", "neg_float", "neg_integer", "float", + "integer", "false", "true", YY_NULLPTR + }; + return yy_sname[yysymbol]; + } + + + + // parser::context. + parser::context::context (const parser& yyparser, const symbol_type& yyla) + : yyparser_ (yyparser) + , yyla_ (yyla) + {} + + int + parser::context::expected_tokens (symbol_kind_type yyarg[], int yyargn) const + { + // Actual number of expected tokens + int yycount = 0; + +#if H2DEBUG + // Execute LAC once. We don't care if it is successful, we + // only do it for the sake of debugging output. + if (!yyparser_.yy_lac_established_) + yyparser_.yy_lac_check_ (yyla_.kind ()); +#endif + + for (int yyx = 0; yyx < YYNTOKENS; ++yyx) + { + symbol_kind_type yysym = YY_CAST (symbol_kind_type, yyx); + if (yysym != symbol_kind::S_YYerror + && yysym != symbol_kind::S_YYUNDEF + && yyparser_.yy_lac_check_ (yysym)) + { + if (!yyarg) + ++yycount; + else if (yycount == yyargn) + return 0; + else + yyarg[yycount++] = yysym; + } + } + if (yyarg && yycount == 0 && 0 < yyargn) + yyarg[0] = symbol_kind::S_YYEMPTY; + return yycount; + } + + + bool + parser::yy_lac_check_ (symbol_kind_type yytoken) const + { + // Logically, the yylac_stack's lifetime is confined to this function. + // Clear it, to get rid of potential left-overs from previous call. + yylac_stack_.clear (); + // Reduce until we encounter a shift and thereby accept the token. +#if H2DEBUG + YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; +#endif + std::ptrdiff_t lac_top = 0; + while (true) + { + state_type top_state = (yylac_stack_.empty () + ? yystack_[lac_top].state + : yylac_stack_.back ()); + int yyrule = yypact_[+top_state]; + if (yy_pact_value_is_default_ (yyrule) + || (yyrule += yytoken) < 0 || yylast_ < yyrule + || yycheck_[yyrule] != yytoken) + { + // Use the default action. + yyrule = yydefact_[+top_state]; + if (yyrule == 0) + { + YYCDEBUG << " Err\n"; + return false; + } + } + else + { + // Use the action from yytable. + yyrule = yytable_[yyrule]; + if (yy_table_value_is_error_ (yyrule)) + { + YYCDEBUG << " Err\n"; + return false; + } + if (0 < yyrule) + { + YYCDEBUG << " S" << yyrule << '\n'; + return true; + } + yyrule = -yyrule; + } + // By now we know we have to simulate a reduce. + YYCDEBUG << " R" << yyrule - 1; + // Pop the corresponding number of values from the stack. + { + std::ptrdiff_t yylen = yyr2_[yyrule]; + // First pop from the LAC stack as many tokens as possible. + std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); + if (yylen < lac_size) + { + yylac_stack_.resize (std::size_t (lac_size - yylen)); + yylen = 0; + } + else if (lac_size) + { + yylac_stack_.clear (); + yylen -= lac_size; + } + // Only afterwards look at the main stack. + // We simulate popping elements by incrementing lac_top. + lac_top += yylen; + } + // Keep top_state in sync with the updated stack. + top_state = (yylac_stack_.empty () + ? yystack_[lac_top].state + : yylac_stack_.back ()); + // Push the resulting state of the reduction. + state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); + YYCDEBUG << " G" << int (state); + yylac_stack_.push_back (state); + } + } + + // Establish the initial context if no initial context currently exists. + bool + parser::yy_lac_establish_ (symbol_kind_type yytoken) + { + /* Establish the initial context for the current lookahead if no initial + context is currently established. + + We define a context as a snapshot of the parser stacks. We define + the initial context for a lookahead as the context in which the + parser initially examines that lookahead in order to select a + syntactic action. Thus, if the lookahead eventually proves + syntactically unacceptable (possibly in a later context reached via a + series of reductions), the initial context can be used to determine + the exact set of tokens that would be syntactically acceptable in the + lookahead's place. Moreover, it is the context after which any + further semantic actions would be erroneous because they would be + determined by a syntactically unacceptable token. + + yy_lac_establish_ should be invoked when a reduction is about to be + performed in an inconsistent state (which, for the purposes of LAC, + includes consistent states that don't know they're consistent because + their default reductions have been disabled). + + For parse.lac=full, the implementation of yy_lac_establish_ is as + follows. If no initial context is currently established for the + current lookahead, then check if that lookahead can eventually be + shifted if syntactic actions continue from the current context. */ + if (!yy_lac_established_) + { +#if H2DEBUG + YYCDEBUG << "LAC: initial context established for " + << symbol_name (yytoken) << '\n'; +#endif + yy_lac_established_ = true; + return yy_lac_check_ (yytoken); + } + return true; + } + + // Discard any previous initial lookahead context. + void + parser::yy_lac_discard_ (const char* evt) + { + /* Discard any previous initial lookahead context because of Event, + which may be a lookahead change or an invalidation of the currently + established initial context for the current lookahead. + + The most common example of a lookahead change is a shift. An example + of both cases is syntax error recovery. That is, a syntax error + occurs when the lookahead is syntactically erroneous for the + currently established initial context, so error recovery manipulates + the parser stacks to try to find a new initial context in which the + current lookahead is syntactically acceptable. If it fails to find + such a context, it discards the lookahead. */ + if (yy_lac_established_) + { + YYCDEBUG << "LAC: initial context discarded due to " + << evt << '\n'; + yy_lac_established_ = false; + } + } + + int + parser::yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const + { + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yyla) is + if this state is a consistent state with a default action. + Thus, detecting the absence of a lookahead is sufficient to + determine that there is no unexpected or expected token to + report. In that case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is + a consistent state with a default action. There might have + been a previous inconsistent state, consistent state with a + non-default action, or user semantic action that manipulated + yyla. (However, yyla is currently not documented for users.) + In the first two cases, it might appear that the current syntax + error should have been detected in the previous state when + yy_lac_check was invoked. However, at that time, there might + have been a different syntax error that discarded a different + initial context during error recovery, leaving behind the + current lookahead. + */ + + if (!yyctx.lookahead ().empty ()) + { + if (yyarg) + yyarg[0] = yyctx.token (); + int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); + return yyn + 1; + } + return 0; + } + + // Generate an error message. + std::string + parser::yysyntax_error_ (const context& yyctx) const + { + // Its maximum. + enum { YYARGS_MAX = 5 }; + // Arguments of yyformat. + symbol_kind_type yyarg[YYARGS_MAX]; + int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); + + char const* yyformat = YY_NULLPTR; + switch (yycount) + { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + default: // Avoid compiler warnings. + YYCASE_ (0, YY_("syntax error")); + YYCASE_ (1, YY_("syntax error, unexpected %s")); + YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +#undef YYCASE_ + } + + std::string yyres; + // Argument number. + std::ptrdiff_t yyi = 0; + for (char const* yyp = yyformat; *yyp; ++yyp) + if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) + { + yyres += symbol_name (yyarg[yyi++]); + ++yyp; + } + else + yyres += *yyp; + return yyres; + } + + + const short parser::yypact_ninf_ = -230; + + const short parser::yytable_ninf_ = -177; + + const short + parser::yypact_[] = + { + 7, -67, -20, -230, 53, 7, -230, -230, -230, -230, + -230, -21, -230, 13, -10, -230, -230, -230, -3, 607, + -230, -230, 25, -15, -230, -230, 41, 41, -230, 29, + -230, -230, -230, -230, -230, -230, -230, 607, 480, -3, + 607, 607, -50, -1, -230, -230, -230, 1341, -230, -230, + -230, 18, -230, -230, -230, -230, -230, -230, 23, 30, + -230, 332, -230, -230, -230, 446, 507, 569, 573, -230, + -230, -4, 38, -230, -230, -230, -230, -230, -230, -230, + -230, -230, 47, 85, -3, 56, -230, -230, 84, 64, + -230, -230, 86, 905, 480, -230, 1419, 90, 95, -230, + -230, -230, -230, -230, -230, -230, -230, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 41, 41, 669, -17, -230, + -230, 607, -3, -230, 787, -230, -230, 607, -3, 607, + -230, 607, 1212, 607, -230, 124, 124, 1429, 938, 1501, + 1501, 40, 40, 40, 40, 981, 1460, 1470, 101, 101, + -230, -230, -230, -230, -230, -230, -230, 1251, -230, -230, + -13, -230, 103, 607, 94, -18, 123, 126, 128, 130, + 131, 9, 125, 135, 138, 545, -230, 732, 732, -230, + -230, 826, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, 139, 143, 148, -230, -230, 715, -230, -230, + -230, -230, 84, 1212, 103, 1290, 1328, 133, 1419, -230, + -230, 607, 1375, -230, 132, -230, 607, 607, 630, -3, + 607, 91, 151, 159, 160, -230, -230, -230, -230, 1388, + -230, 6, 6, -230, -230, -230, -230, -230, 152, 172, + 173, 174, -3, -230, -230, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 170, 607, 176, 14, + -230, 177, 1044, 1077, 178, -230, 868, 2, 1087, -230, + -230, -230, -230, 607, 607, 607, 607, 1419, 1419, 1419, + 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 182, 1120, + 607, -230, -230, 865, 865, 607, 607, -3, 85, 1130, + 948, 991, 1034, 607, -230, 42, 207, -230, 187, 1419, + 1163, 205, -230, 188, 190, 607, 193, 607, 195, 607, + 55, -230, 865, 630, 865, 607, -230, -230, 58, -230, + 70, -230, 72, -230, -230, 206, -230, 1173, 198, 199, + 200, 865, 865, -230, -230, -230, -230, -230 + }; + + const unsigned char + parser::yydefact_[] = + { + 3, 0, 0, 186, 0, 2, 6, 7, 9, 10, + 11, 0, 187, 0, 0, 1, 4, 5, 17, 0, + 8, 189, 0, 0, 16, 185, 0, 0, 177, 0, + 196, 195, 179, 180, 181, 182, 183, 0, 162, 0, + 0, 0, 0, 0, 188, 193, 194, 0, 76, 77, + 78, 115, 116, 117, 142, 143, 118, 119, 120, 121, + 122, 0, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 0, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 0, 0, 0, 0, 146, 147, 0, 0, + 150, 151, 0, 0, 162, 178, 161, 0, 158, 159, + 163, 114, 113, 191, 192, 184, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, + 145, 162, 0, 12, 0, 14, 15, 0, 0, 0, + 112, 0, 161, 0, 165, 105, 106, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 107, 108, + 109, 110, 111, 148, 149, 152, 153, 0, 168, 167, + 0, 158, 164, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 40, 0, 0, 42, + 18, 0, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 0, 169, 0, 170, 171, 0, 172, 173, + 174, 175, 176, 0, 0, 0, 0, 0, 160, 166, + 154, 162, 0, 54, 0, 55, 0, 0, 73, 0, + 0, 0, 0, 0, 0, 67, 68, 69, 71, 0, + 169, 79, 80, 39, 41, 45, 43, 44, 0, 0, + 0, 0, 0, 81, 82, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 0, 72, 0, 0, 0, 66, + 65, 64, 70, 0, 0, 0, 0, 83, 89, 90, + 91, 92, 93, 84, 85, 86, 88, 87, 0, 0, + 162, 155, 56, 0, 0, 75, 0, 0, 0, 0, + 0, 0, 0, 162, 190, 0, 57, 59, 0, 74, + 0, 0, 63, 0, 0, 162, 0, 162, 0, 162, + 0, 156, 0, 73, 0, 0, 46, 48, 0, 51, + 0, 53, 0, 157, 58, 0, 61, 0, 0, 0, + 0, 0, 0, 47, 50, 52, 60, 62 + }; + + const short + parser::yypgoto_[] = + { + -230, -230, -230, 243, 244, -230, -230, -230, -230, -178, + -82, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -93, -230, 35, -229, -230, -230, -230, 27, + 142, -230, -23, -19, 68, -26, -230, -230, -230, 39, + 73, -230, 82, -230, -230, -230, 97, 107, 134, 241, + -230, -230, 0, 5, -230, -12, -230, -230, 74, -230, + 77, -230, -230 + }; + + const short + parser::yydefgoto_[] = + { + 0, 4, 5, 6, 7, 8, 9, 10, 23, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 284, 328, 96, 212, 48, 49, 50, 51, + 52, 53, 54, 55, 97, 171, 99, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81 + }; + + const short + parser::yytable_[] = + { + 11, 135, 22, 86, 90, 11, 13, 87, 91, 285, + 1, 2, 98, 254, 12, 168, 18, 14, 24, 234, + 316, -176, -176, 83, -176, 230, 88, 88, 84, 235, + 143, 89, 89, 131, 29, 103, 104, -176, 129, 100, + -176, 19, 130, -169, -169, 317, -169, 127, -170, -170, + 262, -170, 311, 15, 47, -171, -171, 143, -171, -169, + 20, 88, -169, 82, -170, 3, 89, -170, 98, 29, + 92, -171, 93, 21, -171, 101, 102, -176, -176, 3, + 341, 105, 85, 132, 136, 143, 241, 12, 3, 3, + 107, 108, 21, 353, 133, 46, 358, 137, 143, -169, + -169, 143, 163, 165, -170, -170, 164, 166, 359, 138, + 360, -171, -171, 143, 285, 143, 120, 121, 122, 123, + 124, 131, 12, 3, 134, 88, 88, 139, 169, 142, + 89, 89, 172, 143, 222, 326, 327, 144, 224, 89, + 231, 233, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 236, 213, 167, 237, 354, 238, 356, 239, 240, 242, + 281, 245, 223, 215, 225, 278, 226, 104, 228, 122, + 123, 124, 246, 366, 367, 247, 255, 222, 222, 293, + 256, 222, 89, 89, 129, 257, 89, 289, 130, 170, + 120, 121, 122, 123, 124, 290, 291, 216, 232, 294, + 295, 296, 308, 310, 250, 250, 217, 88, 213, 323, + 249, 342, 89, 345, 312, 315, 215, 215, 129, 129, + 215, 218, 130, 130, 343, 346, 332, 347, 222, 287, + 349, 219, 351, 89, 361, 363, 364, 365, 16, 17, + 355, 88, 88, 0, 0, 243, 89, 89, 244, 0, + 216, 216, 169, 129, 216, 250, 0, 130, 220, 251, + 252, 282, 283, 217, 0, 288, 214, 215, 0, 0, + 0, 0, 0, 0, 218, 218, 88, 0, 218, 0, + 0, 89, 0, 0, 219, 219, 0, 0, 219, 279, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 216, 309, 222, 222, 0, 0, 331, 89, 89, + 286, 220, 220, 0, 0, 220, 0, 0, 319, 320, + 321, 322, 0, 214, 0, 218, 0, 0, 0, 0, + 213, 213, 222, 222, 222, 219, 0, 89, 89, 89, + 329, 330, 215, 215, 0, 0, 0, 125, 126, 0, + 29, 222, 222, 0, 0, 0, 89, 89, 0, 213, + 250, 213, 220, 127, 0, 221, 128, 0, 325, 0, + 357, 215, 215, 215, 0, 0, 216, 216, 213, 213, + 0, 340, 0, 0, 0, 217, 217, 0, 0, 0, + 215, 215, 0, 348, 0, 350, 0, 352, 0, 0, + 218, 218, 0, 12, 3, 216, 216, 216, 0, 0, + 219, 219, 0, 0, 217, 286, 217, 0, 221, 221, + 0, 0, 221, 0, 216, 216, 0, 0, 0, 218, + 218, 218, 0, 217, 217, 0, 0, 220, 220, 219, + 219, 219, 0, 0, 0, 214, 214, 0, 218, 218, + 0, 0, 0, 0, 0, 0, 0, 0, 219, 219, + 0, -172, -172, 0, -172, 0, 220, 220, 220, 221, + 0, 0, 0, 0, 214, 25, 214, -172, 0, 0, + -172, 0, 0, 0, 0, 220, 220, 0, 0, 0, + 0, 0, 0, 214, 214, 26, 27, 28, 29, 30, + 31, 32, 0, 33, 34, 35, 36, 37, 0, 0, + 0, 94, 95, 0, 0, 39, 0, -172, -172, 0, + 0, 0, -173, -173, 0, -173, 0, 0, 0, 0, + 40, 41, 0, 0, 0, 0, 0, 0, -173, 0, + 25, -173, 0, 0, 221, 221, 0, 42, 0, 0, + 43, 12, 3, 21, 44, 45, 46, 0, 0, 0, + 26, 27, 28, 29, 30, 31, 32, 0, 33, 34, + 35, 36, 37, 221, 221, 221, 38, 0, -173, -173, + 39, 0, 248, 0, -174, -174, 0, -174, -175, -175, + 0, -175, 221, 221, 0, 40, 41, 0, 0, 0, + -174, 0, 25, -174, -175, 0, 0, -175, 0, 0, + 0, 0, 42, 0, 0, 43, 12, 3, 21, 44, + 45, 46, 26, 27, 28, 29, 30, 31, 32, 0, + 33, 34, 35, 36, 37, 0, 0, 0, 38, 0, + -174, -174, 39, 0, -175, -175, 0, 0, 29, 0, + 0, 0, 0, 33, 34, 35, 36, 40, 41, 0, + 0, 85, 0, 0, 25, 0, 0, 0, 187, 188, + 0, 0, 0, 0, 42, 0, 0, 43, 12, 3, + 21, 44, 45, 46, 26, 27, 28, 29, 30, 31, + 32, 0, 33, 34, 35, 36, 37, 0, 0, 0, + 94, 12, 3, 0, 39, 0, 0, 0, 0, 0, + 0, 258, 259, 0, 260, 261, 0, 0, 0, 40, + 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 29, 0, 0, 42, 0, 0, 43, + 12, 3, 21, 44, 45, 46, 127, 0, 0, 262, + 29, 0, 0, 263, 264, 33, 34, 35, 36, 0, + 0, 0, 0, 85, 0, 0, 0, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 0, 0, + 0, 0, 0, 0, 0, 173, 12, 3, 174, 175, + 176, 0, 177, 178, 179, 0, 180, 181, 182, 183, + 184, 185, 26, 12, 3, 29, 0, 0, 0, 0, + 33, 34, 35, 36, 0, 0, 134, 186, 85, 0, + 0, 0, 0, 0, 173, 187, 188, 174, 175, 176, + 0, 177, 178, 179, 0, 180, 181, 182, 183, 184, + 185, 26, 0, 0, 29, 0, 0, 0, 0, 33, + 34, 35, 36, 0, 0, 134, 253, 85, 12, 3, + 0, 0, 0, 173, 187, 188, 174, 175, 176, 0, + 177, 178, 179, 0, 180, 181, 182, 183, 184, 185, + 26, 0, 0, 29, 0, 0, 29, 0, 33, 34, + 35, 36, 0, 0, 134, 0, 85, 12, 3, 127, + 0, 0, 262, 187, 188, 0, 263, 264, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 0, 0, 140, 0, 0, 12, 3, 141, 12, + 3, 0, 0, 0, 0, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, + 119, 120, 121, 122, 123, 124, 334, 0, 107, 108, + 0, 335, 111, 112, 113, 114, 115, 116, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 0, 0, + 0, 117, 118, 119, 120, 121, 122, 123, 124, 0, + 0, 117, 118, 119, 120, 121, 122, 123, 124, 336, + 0, 107, 108, 0, 337, 111, 112, 113, 114, 115, + 116, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 0, 0, 117, 118, 119, 120, 121, 122, + 123, 124, 338, 0, 0, 0, 0, 339, 0, 0, + 0, 0, 313, 0, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 0, 0, 0, 117, 118, 119, + 120, 121, 122, 123, 124, 314, 0, 117, 118, 119, + 120, 121, 122, 123, 124, 318, 0, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 0, 0, 0, + 117, 118, 119, 120, 121, 122, 123, 124, 324, 0, + 117, 118, 119, 120, 121, 122, 123, 124, 333, 0, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, + 124, 344, 0, 117, 118, 119, 120, 121, 122, 123, + 124, 362, 0, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 0, 0, 0, 117, 118, 119, 120, + 121, 122, 123, 124, 0, 0, 117, 118, 119, 120, + 121, 122, 123, 124, 227, 0, 0, 0, 0, 0, + 0, 0, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 117, 118, 119, 120, 121, + 122, 123, 124, 229, 0, 0, 0, 0, 0, 0, + 0, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 117, 118, 119, 120, 121, 122, + 123, 124, 276, 0, 0, 0, 0, 0, 0, 0, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, + 124, 277, 0, 0, 0, 0, 0, 0, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 106, 0, + 0, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 0, + 0, 0, 0, 0, 117, 118, 119, 120, 121, 122, + 123, 124, 280, 0, 0, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 292, 0, 0, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 0, 0, 0, 0, + 0, 117, 118, 119, 120, 121, 122, 123, 124, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 107, + 108, 0, 110, 111, 112, 113, 114, 115, 116, 0, + 0, 0, 117, 118, 119, 120, 121, 122, 123, 124, + 0, 0, 117, 118, 119, 120, 121, 122, 123, 124, + 107, 108, 0, 0, 111, 112, 113, 114, 115, 116, + 107, 108, 0, 0, 111, 112, 113, 114, 115, 116, + 0, 0, 0, 0, 0, 119, 120, 121, 122, 123, + 124, 0, 0, 0, 0, 0, 120, 121, 122, 123, + 124, 107, 108, 0, 0, 0, 0, 113, 114, 115, + 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 120, 121, 122, + 123, 124 + }; + + const short + parser::yycheck_[] = + { + 0, 83, 14, 26, 27, 5, 1, 26, 27, 238, + 3, 4, 38, 191, 81, 32, 37, 37, 18, 37, + 18, 25, 26, 38, 28, 38, 26, 27, 43, 47, + 43, 26, 27, 37, 28, 85, 86, 41, 61, 39, + 44, 62, 61, 25, 26, 43, 28, 41, 25, 26, + 44, 28, 38, 0, 19, 25, 26, 43, 28, 41, + 47, 61, 44, 38, 41, 82, 61, 44, 94, 28, + 41, 41, 37, 83, 44, 40, 41, 81, 82, 82, + 38, 82, 41, 45, 84, 43, 77, 81, 82, 82, + 50, 51, 83, 38, 47, 86, 38, 41, 43, 81, + 82, 43, 125, 126, 81, 82, 125, 126, 38, 45, + 38, 81, 82, 43, 343, 43, 76, 77, 78, 79, + 80, 37, 81, 82, 39, 125, 126, 41, 128, 94, + 125, 126, 132, 43, 134, 313, 314, 42, 138, 134, + 37, 47, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 37, 134, 127, 37, 342, 37, 344, 37, 37, 181, + 38, 46, 137, 134, 139, 42, 141, 86, 143, 78, + 79, 80, 47, 361, 362, 47, 47, 187, 188, 37, + 47, 191, 187, 188, 217, 47, 191, 46, 217, 131, + 76, 77, 78, 79, 80, 46, 46, 134, 173, 37, + 37, 37, 42, 37, 187, 188, 134, 217, 191, 37, + 185, 14, 217, 18, 47, 47, 187, 188, 251, 252, + 191, 134, 251, 252, 47, 47, 318, 47, 238, 239, + 47, 134, 47, 238, 38, 47, 47, 47, 5, 5, + 343, 251, 252, -1, -1, 181, 251, 252, 181, -1, + 187, 188, 262, 286, 191, 238, -1, 286, 134, 187, + 188, 236, 237, 191, -1, 240, 134, 238, -1, -1, + -1, -1, -1, -1, 187, 188, 286, -1, 191, -1, + -1, 286, -1, -1, 187, 188, -1, -1, 191, 231, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 238, 277, 313, 314, -1, -1, 317, 313, 314, + 238, 187, 188, -1, -1, 191, -1, -1, 293, 294, + 295, 296, -1, 191, -1, 238, -1, -1, -1, -1, + 313, 314, 342, 343, 344, 238, -1, 342, 343, 344, + 315, 316, 313, 314, -1, -1, -1, 25, 26, -1, + 28, 361, 362, -1, -1, -1, 361, 362, -1, 342, + 343, 344, 238, 41, -1, 134, 44, -1, 310, -1, + 345, 342, 343, 344, -1, -1, 313, 314, 361, 362, + -1, 323, -1, -1, -1, 313, 314, -1, -1, -1, + 361, 362, -1, 335, -1, 337, -1, 339, -1, -1, + 313, 314, -1, 81, 82, 342, 343, 344, -1, -1, + 313, 314, -1, -1, 342, 343, 344, -1, 187, 188, + -1, -1, 191, -1, 361, 362, -1, -1, -1, 342, + 343, 344, -1, 361, 362, -1, -1, 313, 314, 342, + 343, 344, -1, -1, -1, 313, 314, -1, 361, 362, + -1, -1, -1, -1, -1, -1, -1, -1, 361, 362, + -1, 25, 26, -1, 28, -1, 342, 343, 344, 238, + -1, -1, -1, -1, 342, 5, 344, 41, -1, -1, + 44, -1, -1, -1, -1, 361, 362, -1, -1, -1, + -1, -1, -1, 361, 362, 25, 26, 27, 28, 29, + 30, 31, -1, 33, 34, 35, 36, 37, -1, -1, + -1, 41, 42, -1, -1, 45, -1, 81, 82, -1, + -1, -1, 25, 26, -1, 28, -1, -1, -1, -1, + 60, 61, -1, -1, -1, -1, -1, -1, 41, -1, + 5, 44, -1, -1, 313, 314, -1, 77, -1, -1, + 80, 81, 82, 83, 84, 85, 86, -1, -1, -1, + 25, 26, 27, 28, 29, 30, 31, -1, 33, 34, + 35, 36, 37, 342, 343, 344, 41, -1, 81, 82, + 45, -1, 47, -1, 25, 26, -1, 28, 25, 26, + -1, 28, 361, 362, -1, 60, 61, -1, -1, -1, + 41, -1, 5, 44, 41, -1, -1, 44, -1, -1, + -1, -1, 77, -1, -1, 80, 81, 82, 83, 84, + 85, 86, 25, 26, 27, 28, 29, 30, 31, -1, + 33, 34, 35, 36, 37, -1, -1, -1, 41, -1, + 81, 82, 45, -1, 81, 82, -1, -1, 28, -1, + -1, -1, -1, 33, 34, 35, 36, 60, 61, -1, + -1, 41, -1, -1, 5, -1, -1, -1, 48, 49, + -1, -1, -1, -1, 77, -1, -1, 80, 81, 82, + 83, 84, 85, 86, 25, 26, 27, 28, 29, 30, + 31, -1, 33, 34, 35, 36, 37, -1, -1, -1, + 41, 81, 82, -1, 45, -1, -1, -1, -1, -1, + -1, 6, 7, -1, 9, 10, -1, -1, -1, 60, + 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 25, -1, -1, 28, -1, -1, 77, -1, -1, 80, + 81, 82, 83, 84, 85, 86, 41, -1, -1, 44, + 28, -1, -1, 48, 49, 33, 34, 35, 36, -1, + -1, -1, -1, 41, -1, -1, -1, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, -1, -1, + -1, -1, -1, -1, -1, 8, 81, 82, 11, 12, + 13, -1, 15, 16, 17, -1, 19, 20, 21, 22, + 23, 24, 25, 81, 82, 28, -1, -1, -1, -1, + 33, 34, 35, 36, -1, -1, 39, 40, 41, -1, + -1, -1, -1, -1, 8, 48, 49, 11, 12, 13, + -1, 15, 16, 17, -1, 19, 20, 21, 22, 23, + 24, 25, -1, -1, 28, -1, -1, -1, -1, 33, + 34, 35, 36, -1, -1, 39, 40, 41, 81, 82, + -1, -1, -1, 8, 48, 49, 11, 12, 13, -1, + 15, 16, 17, -1, 19, 20, 21, 22, 23, 24, + 25, -1, -1, 28, -1, -1, 28, -1, 33, 34, + 35, 36, -1, -1, 39, -1, 41, 81, 82, 41, + -1, -1, 44, 48, 49, -1, 48, 49, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, -1, -1, 38, -1, -1, 81, 82, 43, 81, + 82, -1, -1, -1, -1, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 73, 74, + 75, 76, 77, 78, 79, 80, 38, -1, 50, 51, + -1, 43, 54, 55, 56, 57, 58, 59, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, -1, -1, + -1, 73, 74, 75, 76, 77, 78, 79, 80, -1, + -1, 73, 74, 75, 76, 77, 78, 79, 80, 38, + -1, 50, 51, -1, 43, 54, 55, 56, 57, 58, + 59, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, -1, -1, -1, -1, 74, 75, 76, 77, 78, + 79, 80, -1, -1, 73, 74, 75, 76, 77, 78, + 79, 80, 38, -1, -1, -1, -1, 43, -1, -1, + -1, -1, 38, -1, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, -1, -1, -1, 73, 74, 75, + 76, 77, 78, 79, 80, 38, -1, 73, 74, 75, + 76, 77, 78, 79, 80, 38, -1, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, -1, -1, -1, + 73, 74, 75, 76, 77, 78, 79, 80, 38, -1, + 73, 74, 75, 76, 77, 78, 79, 80, 38, -1, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + -1, -1, -1, 73, 74, 75, 76, 77, 78, 79, + 80, 38, -1, 73, 74, 75, 76, 77, 78, 79, + 80, 38, -1, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, -1, -1, -1, 73, 74, 75, 76, + 77, 78, 79, 80, -1, -1, 73, 74, 75, 76, + 77, 78, 79, 80, 42, -1, -1, -1, -1, -1, + -1, -1, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 73, 74, 75, 76, 77, + 78, 79, 80, 42, -1, -1, -1, -1, -1, -1, + -1, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 73, 74, 75, 76, 77, 78, + 79, 80, 42, -1, -1, -1, -1, -1, -1, -1, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 73, 74, 75, 76, 77, 78, 79, + 80, 43, -1, -1, -1, -1, -1, -1, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 47, -1, + -1, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 73, 74, 75, 76, 77, 78, 79, 80, -1, + -1, -1, -1, -1, 73, 74, 75, 76, 77, 78, + 79, 80, 47, -1, -1, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 47, -1, -1, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 73, 74, + 75, 76, 77, 78, 79, 80, -1, -1, -1, -1, + -1, 73, 74, 75, 76, 77, 78, 79, 80, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 50, + 51, -1, 53, 54, 55, 56, 57, 58, 59, -1, + -1, -1, 73, 74, 75, 76, 77, 78, 79, 80, + -1, -1, 73, 74, 75, 76, 77, 78, 79, 80, + 50, 51, -1, -1, 54, 55, 56, 57, 58, 59, + 50, 51, -1, -1, 54, 55, 56, 57, 58, 59, + -1, -1, -1, -1, -1, 75, 76, 77, 78, 79, + 80, -1, -1, -1, -1, -1, 76, 77, 78, 79, + 80, 50, 51, -1, -1, -1, -1, 56, 57, 58, + 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 76, 77, 78, + 79, 80 + }; + + const unsigned char + parser::yystos_[] = + { + 0, 3, 4, 82, 96, 97, 98, 99, 100, 101, + 102, 157, 81, 158, 37, 0, 98, 99, 37, 62, + 47, 83, 160, 103, 157, 5, 25, 26, 27, 28, + 29, 30, 31, 33, 34, 35, 36, 37, 41, 45, + 60, 61, 77, 80, 84, 85, 86, 129, 131, 132, + 133, 134, 135, 136, 137, 138, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 38, 38, 43, 41, 137, 138, 157, 158, + 137, 138, 41, 129, 41, 42, 129, 139, 140, 141, + 157, 129, 129, 85, 86, 82, 47, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 73, 74, 75, + 76, 77, 78, 79, 80, 25, 26, 41, 44, 137, + 138, 37, 45, 47, 39, 105, 157, 41, 45, 41, + 38, 43, 129, 43, 42, 129, 129, 129, 129, 129, + 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, + 129, 129, 129, 137, 138, 137, 138, 129, 32, 157, + 139, 140, 157, 8, 11, 12, 13, 15, 16, 17, + 19, 20, 21, 22, 23, 24, 40, 48, 49, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 130, 134, 135, 144, 145, 147, 151, 152, + 153, 154, 157, 129, 157, 129, 129, 42, 129, 42, + 38, 37, 129, 47, 37, 47, 37, 37, 37, 37, + 37, 77, 160, 163, 165, 46, 47, 47, 47, 129, + 134, 147, 147, 40, 104, 47, 47, 47, 6, 7, + 9, 10, 44, 48, 49, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 42, 43, 42, 139, + 47, 38, 129, 129, 127, 130, 147, 157, 129, 46, + 46, 46, 47, 37, 37, 37, 37, 129, 129, 129, + 129, 129, 129, 129, 129, 129, 129, 129, 42, 129, + 37, 38, 47, 38, 38, 47, 18, 43, 38, 129, + 129, 129, 129, 37, 38, 139, 104, 104, 128, 129, + 129, 157, 105, 38, 38, 43, 38, 43, 38, 43, + 139, 38, 14, 47, 38, 18, 47, 47, 139, 47, + 139, 47, 139, 38, 104, 127, 104, 129, 38, 38, + 38, 38, 38, 47, 47, 47, 104, 104 + }; + + const unsigned char + parser::yyr1_[] = + { + 0, 95, 96, 96, 97, 97, 97, 97, 98, 99, + 99, 99, 100, 101, 102, 103, 103, 103, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 105, + 105, 106, 106, 107, 107, 108, 109, 110, 110, 111, + 112, 112, 113, 113, 114, 115, 115, 116, 117, 118, + 119, 120, 120, 121, 122, 122, 122, 123, 124, 125, + 126, 126, 127, 127, 128, 128, 129, 129, 129, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 131, 131, 131, 131, 131, 131, + 131, 131, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 133, 133, 133, 133, 133, 133, 133, 133, + 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, + 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, + 133, 133, 134, 134, 134, 134, 135, 135, 135, 135, + 136, 136, 136, 136, 137, 137, 138, 138, 139, 139, + 140, 140, 141, 142, 142, 143, 144, 145, 146, 147, + 147, 147, 147, 147, 147, 147, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167 + }; + + const signed char + parser::yyr2_[] = + { + 0, 2, 1, 0, 2, 2, 1, 1, 3, 1, + 1, 1, 5, 4, 5, 3, 1, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 2, 2, 1, 2, 2, 2, 6, 8, 6, 3, + 8, 6, 8, 6, 2, 2, 4, 5, 7, 5, + 9, 7, 9, 5, 3, 3, 3, 2, 2, 2, + 3, 2, 1, 0, 1, 0, 1, 1, 1, 2, + 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 2, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, + 2, 2, 3, 3, 4, 6, 8, 9, 1, 1, + 3, 1, 0, 2, 3, 3, 4, 3, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, + 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, + 7, 2, 2, 1, 1, 1, 1 + }; + + + + +#if H2DEBUG + const short + parser::yyrline_[] = + { + 0, 233, 233, 234, 238, 240, 242, 244, 249, 254, + 255, 256, 260, 265, 270, 275, 277, 280, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 308, + 309, 313, 315, 320, 322, 327, 332, 337, 339, 344, + 349, 351, 356, 358, 363, 368, 370, 375, 380, 385, + 390, 395, 397, 402, 407, 409, 411, 416, 421, 426, + 431, 433, 438, 439, 443, 444, 448, 449, 450, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 472, 473, 474, 475, 476, 477, + 478, 479, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 496, 497, 498, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, + 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, + 524, 525, 529, 530, 531, 532, 536, 537, 538, 539, + 543, 544, 545, 546, 550, 552, 557, 559, 564, 565, + 569, 571, 577, 581, 583, 588, 593, 598, 603, 608, + 609, 610, 611, 612, 613, 614, 615, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637 + }; + + void + parser::yy_stack_print_ () const + { + *yycdebug_ << "Stack now"; + for (stack_type::const_iterator + i = yystack_.begin (), + i_end = yystack_.end (); + i != i_end; ++i) + *yycdebug_ << ' ' << int (i->state); + *yycdebug_ << '\n'; + } + + void + parser::yy_reduce_print_ (int yyrule) const + { + int yylno = yyrline_[yyrule]; + int yynrhs = yyr2_[yyrule]; + // Print the symbols being reduced, and their result. + *yycdebug_ << "Reducing stack by rule " << yyrule - 1 + << " (line " << yylno << "):\n"; + // The symbols being reduced. + for (int yyi = 0; yyi < yynrhs; yyi++) + YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", + yystack_[(yynrhs) - (yyi + 1)]); + } +#endif // H2DEBUG + + +#line 13 "parser.ypp" +} } } // xsk::gsc::h2 +#line 3987 "parser.cpp" + +#line 639 "parser.ypp" + + +void xsk::gsc::h2::parser::error(const xsk::gsc::location& loc, const std::string& msg) +{ + throw xsk::gsc::comp_error(loc, msg); +} diff --git a/src/h2/xsk/parser.hpp b/src/h2/xsk/parser.hpp new file mode 100644 index 00000000..58e8f902 --- /dev/null +++ b/src/h2/xsk/parser.hpp @@ -0,0 +1,4768 @@ +// A Bison parser, made by GNU Bison 3.7.5. + +// Skeleton interface for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. + +// 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 . + +// As a special exception, you may create a larger work that contains +// part or all of the Bison parser skeleton and distribute that work +// under terms of your choice, so long as that work isn't itself a +// parser generator using the skeleton or a modified version thereof +// as a parser skeleton. Alternatively, if you modify or redistribute +// the parser skeleton itself, you may (at your option) remove this +// special exception, which will cause the skeleton and the resulting +// Bison output files to be licensed under the GNU General Public +// License without this special exception. + +// This special exception was added by the Free Software Foundation in +// version 2.2 of Bison. + + +/** + ** \file parser.hpp + ** Define the xsk::gsc::h2::parser class. + */ + +// C++ LALR(1) parser skeleton written by Akim Demaille. + +// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, +// especially those whose name start with YY_ or yy_. They are +// private implementation details that can be changed or removed. + +#ifndef YY_H2_PARSER_HPP_INCLUDED +# define YY_H2_PARSER_HPP_INCLUDED +// "%code requires" blocks. +#line 33 "parser.ypp" + +#include "h2.hpp" +typedef void *yyscan_t; +#define YY_DECL xsk::gsc::h2::parser::symbol_type H2lex(yyscan_t yyscanner, xsk::gsc::location& loc) + +#line 55 "parser.hpp" + +# include +# include // std::abort +# include +# include +# include +# include + +#if defined __cplusplus +# define YY_CPLUSPLUS __cplusplus +#else +# define YY_CPLUSPLUS 199711L +#endif + +// Support move semantics when possible. +#if 201103L <= YY_CPLUSPLUS +# define YY_MOVE std::move +# define YY_MOVE_OR_COPY move +# define YY_MOVE_REF(Type) Type&& +# define YY_RVREF(Type) Type&& +# define YY_COPY(Type) Type +#else +# define YY_MOVE +# define YY_MOVE_OR_COPY copy +# define YY_MOVE_REF(Type) Type& +# define YY_RVREF(Type) const Type& +# define YY_COPY(Type) const Type& +#endif + +// Support noexcept when possible. +#if 201103L <= YY_CPLUSPLUS +# define YY_NOEXCEPT noexcept +# define YY_NOTHROW +#else +# define YY_NOEXCEPT +# define YY_NOTHROW throw () +#endif + +// Support constexpr when possible. +#if 201703 <= YY_CPLUSPLUS +# define YY_CONSTEXPR constexpr +#else +# define YY_CONSTEXPR +#endif + +#include +#ifndef H2_ASSERT +# include +# define H2_ASSERT assert +#endif + + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YY_USE(E) ((void) (E)) +#else +# define YY_USE(E) /* empty */ +#endif + +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +/* Debug traces. */ +#ifndef H2DEBUG +# if defined YYDEBUG +#if YYDEBUG +# define H2DEBUG 1 +# else +# define H2DEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define H2DEBUG 1 +# endif /* ! defined YYDEBUG */ +#endif /* ! defined H2DEBUG */ + +#line 13 "parser.ypp" +namespace xsk { namespace gsc { namespace h2 { +#line 198 "parser.hpp" + + + + + /// A Bison parser. + class parser + { + public: +#ifndef H2STYPE + /// A buffer to store and retrieve objects. + /// + /// Sort of a variant, but does not keep track of the nature + /// of the stored data, since that knowledge is available + /// via the current parser state. + class semantic_type + { + public: + /// Type of *this. + typedef semantic_type self_type; + + /// Empty construction. + semantic_type () YY_NOEXCEPT + : yybuffer_ () + , yytypeid_ (YY_NULLPTR) + {} + + /// Construct and fill. + template + semantic_type (YY_RVREF (T) t) + : yytypeid_ (&typeid (T)) + { + H2_ASSERT (sizeof (T) <= size); + new (yyas_ ()) T (YY_MOVE (t)); + } + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + semantic_type (const self_type&) = delete; + /// Non copyable. + self_type& operator= (const self_type&) = delete; +#endif + + /// Destruction, allowed only if empty. + ~semantic_type () YY_NOEXCEPT + { + H2_ASSERT (!yytypeid_); + } + +# if 201103L <= YY_CPLUSPLUS + /// Instantiate a \a T in here from \a t. + template + T& + emplace (U&&... u) + { + H2_ASSERT (!yytypeid_); + H2_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (std::forward (u)...); + } +# else + /// Instantiate an empty \a T in here. + template + T& + emplace () + { + H2_ASSERT (!yytypeid_); + H2_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (); + } + + /// Instantiate a \a T in here from \a t. + template + T& + emplace (const T& t) + { + H2_ASSERT (!yytypeid_); + H2_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (t); + } +# endif + + /// Instantiate an empty \a T in here. + /// Obsolete, use emplace. + template + T& + build () + { + return emplace (); + } + + /// Instantiate a \a T in here from \a t. + /// Obsolete, use emplace. + template + T& + build (const T& t) + { + return emplace (t); + } + + /// Accessor to a built \a T. + template + T& + as () YY_NOEXCEPT + { + H2_ASSERT (yytypeid_); + H2_ASSERT (*yytypeid_ == typeid (T)); + H2_ASSERT (sizeof (T) <= size); + return *yyas_ (); + } + + /// Const accessor to a built \a T (for %printer). + template + const T& + as () const YY_NOEXCEPT + { + H2_ASSERT (yytypeid_); + H2_ASSERT (*yytypeid_ == typeid (T)); + H2_ASSERT (sizeof (T) <= size); + return *yyas_ (); + } + + /// Swap the content with \a that, of same type. + /// + /// Both variants must be built beforehand, because swapping the actual + /// data requires reading it (with as()), and this is not possible on + /// unconstructed variants: it would require some dynamic testing, which + /// should not be the variant's responsibility. + /// Swapping between built and (possibly) non-built is done with + /// self_type::move (). + template + void + swap (self_type& that) YY_NOEXCEPT + { + H2_ASSERT (yytypeid_); + H2_ASSERT (*yytypeid_ == *that.yytypeid_); + std::swap (as (), that.as ()); + } + + /// Move the content of \a that to this. + /// + /// Destroys \a that. + template + void + move (self_type& that) + { +# if 201103L <= YY_CPLUSPLUS + emplace (std::move (that.as ())); +# else + emplace (); + swap (that); +# endif + that.destroy (); + } + +# if 201103L <= YY_CPLUSPLUS + /// Move the content of \a that to this. + template + void + move (self_type&& that) + { + emplace (std::move (that.as ())); + that.destroy (); + } +#endif + + /// Copy the content of \a that to this. + template + void + copy (const self_type& that) + { + emplace (that.as ()); + } + + /// Destroy the stored \a T. + template + void + destroy () + { + as ().~T (); + yytypeid_ = YY_NULLPTR; + } + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + semantic_type (const self_type&); + /// Non copyable. + self_type& operator= (const self_type&); +#endif + + /// Accessor to raw memory as \a T. + template + T* + yyas_ () YY_NOEXCEPT + { + void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + /// Const accessor to raw memory as \a T. + template + const T* + yyas_ () const YY_NOEXCEPT + { + const void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + /// An auxiliary type to compute the largest semantic type. + union union_type + { + // anim + char dummy1[sizeof (anim_ptr)]; + + // animation + char dummy2[sizeof (animation_ptr)]; + + // animtree + char dummy3[sizeof (animtree_ptr)]; + + // constant + char dummy4[sizeof (constant_ptr)]; + + // define + char dummy5[sizeof (define_ptr)]; + + // empty_array + char dummy6[sizeof (empty_array_ptr)]; + + // expr_arguments + // expr_arguments_filled + // expr_arguments_empty + char dummy7[sizeof (expr_arguments_ptr)]; + + // expr_assign + char dummy8[sizeof (expr_assign_ptr)]; + + // expr_call + // expr_call_thread + // expr_call_childthread + char dummy9[sizeof (expr_call_ptr)]; + + // expr_call_function + // expr_call_pointer + char dummy10[sizeof (expr_call_type_ptr)]; + + // for_expr + // expr + // expr_compare + // expr_binary + // expr_primitive + char dummy11[sizeof (expr_ptr)]; + + // false + char dummy12[sizeof (false_ptr)]; + + // file + char dummy13[sizeof (file_ptr)]; + + // neg_float + // float + char dummy14[sizeof (float_ptr)]; + + // game + char dummy15[sizeof (game_ptr)]; + + // include + char dummy16[sizeof (include_ptr)]; + + // neg_integer + // integer + char dummy17[sizeof (integer_ptr)]; + + // istring + char dummy18[sizeof (istring_ptr)]; + + // level + char dummy19[sizeof (level_ptr)]; + + // name + char dummy20[sizeof (name_ptr)]; + + // expr_function + // expr_add_array + // expr_array + // expr_field + // expr_size + // object + char dummy21[sizeof (node_ptr)]; + + // parameters + char dummy22[sizeof (parameters_ptr)]; + + // program + char dummy23[sizeof (program_ptr)]; + + // self + char dummy24[sizeof (self_ptr)]; + + // "file path" + // "identifier" + // "string literal" + // "localized string" + // "float" + // "int" + char dummy25[sizeof (std::string)]; + + // stmt_assign + char dummy26[sizeof (stmt_assign_ptr)]; + + // stmt_break + char dummy27[sizeof (stmt_break_ptr)]; + + // stmt_call + char dummy28[sizeof (stmt_call_ptr)]; + + // stmt_case + char dummy29[sizeof (stmt_case_ptr)]; + + // stmt_continue + char dummy30[sizeof (stmt_continue_ptr)]; + + // stmt_default + char dummy31[sizeof (stmt_default_ptr)]; + + // stmt_endon + char dummy32[sizeof (stmt_endon_ptr)]; + + // stmt_for + char dummy33[sizeof (stmt_for_ptr)]; + + // stmt_foreach + char dummy34[sizeof (stmt_foreach_ptr)]; + + // stmt_if + char dummy35[sizeof (stmt_if_ptr)]; + + // stmt_ifelse + char dummy36[sizeof (stmt_ifelse_ptr)]; + + // stmt_block + // stmt_list + char dummy37[sizeof (stmt_list_ptr)]; + + // stmt_notify + char dummy38[sizeof (stmt_notify_ptr)]; + + // stmt + // for_stmt + char dummy39[sizeof (stmt_ptr)]; + + // stmt_return + char dummy40[sizeof (stmt_return_ptr)]; + + // stmt_switch + char dummy41[sizeof (stmt_switch_ptr)]; + + // stmt_wait + char dummy42[sizeof (stmt_wait_ptr)]; + + // stmt_waitframe + char dummy43[sizeof (stmt_waitframe_ptr)]; + + // stmt_waittill + char dummy44[sizeof (stmt_waittill_ptr)]; + + // stmt_waittillframeend + char dummy45[sizeof (stmt_waittillframeend_ptr)]; + + // stmt_waittillmatch + char dummy46[sizeof (stmt_waittillmatch_ptr)]; + + // stmt_while + char dummy47[sizeof (stmt_while_ptr)]; + + // string + char dummy48[sizeof (string_ptr)]; + + // thisthread + char dummy49[sizeof (thisthread_ptr)]; + + // thread + char dummy50[sizeof (thread_ptr)]; + + // true + char dummy51[sizeof (true_ptr)]; + + // undefined + char dummy52[sizeof (undefined_ptr)]; + + // usingtree + char dummy53[sizeof (usingtree_ptr)]; + + // vector + char dummy54[sizeof (vector_ptr)]; + }; + + /// The size of the largest semantic type. + enum { size = sizeof (union_type) }; + + /// A buffer to store semantic values. + union + { + /// Strongest alignment constraints. + long double yyalign_me; + /// A buffer large enough to store any of the semantic values. + char yyraw[size]; + } yybuffer_; + + /// Whether the content is built: if defined, the name of the stored type. + const std::type_info *yytypeid_; + }; + +#else + typedef H2STYPE semantic_type; +#endif + /// Symbol locations. + typedef xsk::gsc::location location_type; + + /// Syntax errors thrown from user actions. + struct syntax_error : std::runtime_error + { + syntax_error (const location_type& l, const std::string& m) + : std::runtime_error (m) + , location (l) + {} + + syntax_error (const syntax_error& s) + : std::runtime_error (s.what ()) + , location (s.location) + {} + + ~syntax_error () YY_NOEXCEPT YY_NOTHROW; + + location_type location; + }; + + /// Token kinds. + struct token + { + enum token_kind_type + { + H2EMPTY = -2, + H2EOF = 0, // "end of file" + H2error = 1, // error + H2UNDEF = 2, // "invalid token" + INCLUDE = 3, // "#include" + USINGTREE = 4, // "#using_animtree" + ANIMTREE = 5, // "#animtree" + ENDON = 6, // "endon" + NOTIFY = 7, // "notify" + WAIT = 8, // "wait" + WAITTILL = 9, // "waittill" + WAITTILLMATCH = 10, // "waittillmatch" + WAITTILLFRAMEEND = 11, // "waittillframeend" + WAITFRAME = 12, // "waitframe" + IF = 13, // "if" + ELSE = 14, // "else" + WHILE = 15, // "while" + FOR = 16, // "for" + FOREACH = 17, // "foreach" + IN = 18, // "in" + SWITCH = 19, // "switch" + CASE = 20, // "case" + DEFAULT = 21, // "default" + BREAK = 22, // "break" + CONTINUE = 23, // "continue" + RETURN = 24, // "return" + THREAD = 25, // "thread" + CHILDTHREAD = 26, // "childthread" + THISTHREAD = 27, // "thisthread" + CALL = 28, // "call" + TRUE = 29, // "true" + FALSE = 30, // "false" + UNDEFINED = 31, // "undefined" + SIZE = 32, // "size" + GAME = 33, // "game" + SELF = 34, // "self" + ANIM = 35, // "anim" + LEVEL = 36, // "level" + LPAREN = 37, // "(" + RPAREN = 38, // ")" + LBRACE = 39, // "{" + RBRACE = 40, // "}" + LBRACKET = 41, // "[" + RBRACKET = 42, // "]" + COMMA = 43, // "," + DOT = 44, // "." + DOUBLECOLON = 45, // "::" + COLON = 46, // ":" + SEMICOLON = 47, // ";" + INCREMENT = 48, // "++" + DECREMENT = 49, // "--" + LSHIFT = 50, // "<<" + RSHIFT = 51, // ">>" + OR = 52, // "||" + AND = 53, // "&&" + EQUALITY = 54, // "==" + INEQUALITY = 55, // "!=" + LESS_EQUAL = 56, // "<=" + GREATER_EQUAL = 57, // ">=" + LESS = 58, // "<" + GREATER = 59, // ">" + NOT = 60, // "!" + COMPLEMENT = 61, // "~" + ASSIGN = 62, // "=" + ASSIGN_ADD = 63, // "+=" + ASSIGN_SUB = 64, // "-=" + ASSIGN_MULT = 65, // "*=" + ASSIGN_DIV = 66, // "/=" + ASSIGN_MOD = 67, // "%=" + ASSIGN_BITWISE_OR = 68, // "|=" + ASSIGN_BITWISE_AND = 69, // "&=" + ASSIGN_BITWISE_EXOR = 70, // "^=" + ASSIGN_RSHIFT = 71, // ">>=" + ASSIGN_LSHIFT = 72, // "<<=" + BITWISE_OR = 73, // "|" + BITWISE_AND = 74, // "&" + BITWISE_EXOR = 75, // "^" + ADD = 76, // "+" + SUB = 77, // "-" + MULT = 78, // "*" + DIV = 79, // "/" + MOD = 80, // "%" + FILE = 81, // "file path" + NAME = 82, // "identifier" + STRING = 83, // "string literal" + ISTRING = 84, // "localized string" + FLOAT = 85, // "float" + INTEGER = 86, // "int" + ADD_ARRAY = 87, // ADD_ARRAY + THEN = 88, // THEN + NEG = 89, // NEG + ANIMREF = 90, // ANIMREF + PREINC = 91, // PREINC + PREDEC = 92, // PREDEC + POSTINC = 93, // POSTINC + POSTDEC = 94 // POSTDEC + }; + /// Backward compatibility alias (Bison 3.6). + typedef token_kind_type yytokentype; + }; + + /// Token kind, as returned by yylex. + typedef token::yytokentype token_kind_type; + + /// Backward compatibility alias (Bison 3.6). + typedef token_kind_type token_type; + + /// Symbol kinds. + struct symbol_kind + { + enum symbol_kind_type + { + YYNTOKENS = 95, ///< Number of tokens. + S_YYEMPTY = -2, + S_YYEOF = 0, // "end of file" + S_YYerror = 1, // error + S_YYUNDEF = 2, // "invalid token" + S_INCLUDE = 3, // "#include" + S_USINGTREE = 4, // "#using_animtree" + S_ANIMTREE = 5, // "#animtree" + S_ENDON = 6, // "endon" + S_NOTIFY = 7, // "notify" + S_WAIT = 8, // "wait" + S_WAITTILL = 9, // "waittill" + S_WAITTILLMATCH = 10, // "waittillmatch" + S_WAITTILLFRAMEEND = 11, // "waittillframeend" + S_WAITFRAME = 12, // "waitframe" + S_IF = 13, // "if" + S_ELSE = 14, // "else" + S_WHILE = 15, // "while" + S_FOR = 16, // "for" + S_FOREACH = 17, // "foreach" + S_IN = 18, // "in" + S_SWITCH = 19, // "switch" + S_CASE = 20, // "case" + S_DEFAULT = 21, // "default" + S_BREAK = 22, // "break" + S_CONTINUE = 23, // "continue" + S_RETURN = 24, // "return" + S_THREAD = 25, // "thread" + S_CHILDTHREAD = 26, // "childthread" + S_THISTHREAD = 27, // "thisthread" + S_CALL = 28, // "call" + S_TRUE = 29, // "true" + S_FALSE = 30, // "false" + S_UNDEFINED = 31, // "undefined" + S_SIZE = 32, // "size" + S_GAME = 33, // "game" + S_SELF = 34, // "self" + S_ANIM = 35, // "anim" + S_LEVEL = 36, // "level" + S_LPAREN = 37, // "(" + S_RPAREN = 38, // ")" + S_LBRACE = 39, // "{" + S_RBRACE = 40, // "}" + S_LBRACKET = 41, // "[" + S_RBRACKET = 42, // "]" + S_COMMA = 43, // "," + S_DOT = 44, // "." + S_DOUBLECOLON = 45, // "::" + S_COLON = 46, // ":" + S_SEMICOLON = 47, // ";" + S_INCREMENT = 48, // "++" + S_DECREMENT = 49, // "--" + S_LSHIFT = 50, // "<<" + S_RSHIFT = 51, // ">>" + S_OR = 52, // "||" + S_AND = 53, // "&&" + S_EQUALITY = 54, // "==" + S_INEQUALITY = 55, // "!=" + S_LESS_EQUAL = 56, // "<=" + S_GREATER_EQUAL = 57, // ">=" + S_LESS = 58, // "<" + S_GREATER = 59, // ">" + S_NOT = 60, // "!" + S_COMPLEMENT = 61, // "~" + S_ASSIGN = 62, // "=" + S_ASSIGN_ADD = 63, // "+=" + S_ASSIGN_SUB = 64, // "-=" + S_ASSIGN_MULT = 65, // "*=" + S_ASSIGN_DIV = 66, // "/=" + S_ASSIGN_MOD = 67, // "%=" + S_ASSIGN_BITWISE_OR = 68, // "|=" + S_ASSIGN_BITWISE_AND = 69, // "&=" + S_ASSIGN_BITWISE_EXOR = 70, // "^=" + S_ASSIGN_RSHIFT = 71, // ">>=" + S_ASSIGN_LSHIFT = 72, // "<<=" + S_BITWISE_OR = 73, // "|" + S_BITWISE_AND = 74, // "&" + S_BITWISE_EXOR = 75, // "^" + S_ADD = 76, // "+" + S_SUB = 77, // "-" + S_MULT = 78, // "*" + S_DIV = 79, // "/" + S_MOD = 80, // "%" + S_FILE = 81, // "file path" + S_NAME = 82, // "identifier" + S_STRING = 83, // "string literal" + S_ISTRING = 84, // "localized string" + S_FLOAT = 85, // "float" + S_INTEGER = 86, // "int" + S_ADD_ARRAY = 87, // ADD_ARRAY + S_THEN = 88, // THEN + S_NEG = 89, // NEG + S_ANIMREF = 90, // ANIMREF + S_PREINC = 91, // PREINC + S_PREDEC = 92, // PREDEC + S_POSTINC = 93, // POSTINC + S_POSTDEC = 94, // POSTDEC + S_YYACCEPT = 95, // $accept + S_root = 96, // root + S_program = 97, // program + S_include = 98, // include + S_define = 99, // define + S_usingtree = 100, // usingtree + S_constant = 101, // constant + S_thread = 102, // thread + S_parameters = 103, // parameters + S_stmt = 104, // stmt + S_stmt_block = 105, // stmt_block + S_stmt_list = 106, // stmt_list + S_stmt_call = 107, // stmt_call + S_stmt_assign = 108, // stmt_assign + S_stmt_endon = 109, // stmt_endon + S_stmt_notify = 110, // stmt_notify + S_stmt_wait = 111, // stmt_wait + S_stmt_waittill = 112, // stmt_waittill + S_stmt_waittillmatch = 113, // stmt_waittillmatch + S_stmt_waittillframeend = 114, // stmt_waittillframeend + S_stmt_waitframe = 115, // stmt_waitframe + S_stmt_if = 116, // stmt_if + S_stmt_ifelse = 117, // stmt_ifelse + S_stmt_while = 118, // stmt_while + S_stmt_for = 119, // stmt_for + S_stmt_foreach = 120, // stmt_foreach + S_stmt_switch = 121, // stmt_switch + S_stmt_case = 122, // stmt_case + S_stmt_default = 123, // stmt_default + S_stmt_break = 124, // stmt_break + S_stmt_continue = 125, // stmt_continue + S_stmt_return = 126, // stmt_return + S_for_stmt = 127, // for_stmt + S_for_expr = 128, // for_expr + S_expr = 129, // expr + S_expr_assign = 130, // expr_assign + S_expr_compare = 131, // expr_compare + S_expr_binary = 132, // expr_binary + S_expr_primitive = 133, // expr_primitive + S_expr_call = 134, // expr_call + S_expr_call_thread = 135, // expr_call_thread + S_expr_call_childthread = 136, // expr_call_childthread + S_expr_call_function = 137, // expr_call_function + S_expr_call_pointer = 138, // expr_call_pointer + S_expr_arguments = 139, // expr_arguments + S_expr_arguments_filled = 140, // expr_arguments_filled + S_expr_arguments_empty = 141, // expr_arguments_empty + S_expr_function = 142, // expr_function + S_expr_add_array = 143, // expr_add_array + S_expr_array = 144, // expr_array + S_expr_field = 145, // expr_field + S_expr_size = 146, // expr_size + S_object = 147, // object + S_thisthread = 148, // thisthread + S_empty_array = 149, // empty_array + S_undefined = 150, // undefined + S_game = 151, // game + S_self = 152, // self + S_anim = 153, // anim + S_level = 154, // level + S_animation = 155, // animation + S_animtree = 156, // animtree + S_name = 157, // name + S_file = 158, // file + S_istring = 159, // istring + S_string = 160, // string + S_vector = 161, // vector + S_neg_float = 162, // neg_float + S_neg_integer = 163, // neg_integer + S_float = 164, // float + S_integer = 165, // integer + S_false = 166, // false + S_true = 167 // true + }; + }; + + /// (Internal) symbol kind. + typedef symbol_kind::symbol_kind_type symbol_kind_type; + + /// The number of tokens. + static const symbol_kind_type YYNTOKENS = symbol_kind::YYNTOKENS; + + /// A complete symbol. + /// + /// Expects its Base type to provide access to the symbol kind + /// via kind (). + /// + /// Provide access to semantic value and location. + template + struct basic_symbol : Base + { + /// Alias to Base. + typedef Base super_type; + + /// Default constructor. + basic_symbol () + : value () + , location () + {} + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + basic_symbol (basic_symbol&& that) + : Base (std::move (that)) + , value () + , location (std::move (that.location)) + { + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (std::move (that.value)); + break; + + default: + break; + } + + } +#endif + + /// Copy constructor. + basic_symbol (const basic_symbol& that); + + /// Constructors for typed symbols. +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, location_type&& l) + : Base (t) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const location_type& l) + : Base (t) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, anim_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const anim_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, animation_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const animation_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, animtree_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const animtree_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, constant_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const constant_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, define_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const define_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, empty_array_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const empty_array_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_arguments_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_arguments_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_assign_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_assign_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_call_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_call_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_call_type_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_call_type_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, false_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const false_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, file_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const file_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, float_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const float_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, game_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const game_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, include_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const include_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, integer_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const integer_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, istring_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const istring_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, level_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const level_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, name_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const name_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, node_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const node_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, parameters_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const parameters_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, program_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const program_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, self_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const self_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_assign_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_assign_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_break_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_break_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_call_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_call_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_case_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_case_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_continue_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_continue_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_default_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_default_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_endon_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_endon_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_for_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_for_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_foreach_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_foreach_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_if_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_if_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_ifelse_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_ifelse_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_list_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_list_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_notify_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_notify_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_return_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_return_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_switch_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_switch_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_wait_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_wait_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waitframe_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waitframe_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittill_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittill_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittillframeend_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittillframeend_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittillmatch_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittillmatch_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_while_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_while_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, string_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const string_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, thisthread_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const thisthread_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, thread_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const thread_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, true_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const true_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, undefined_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const undefined_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, usingtree_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const usingtree_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, vector_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const vector_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + + /// Destroy the symbol. + ~basic_symbol () + { + clear (); + } + + /// Destroy contents, and record that is empty. + void clear () YY_NOEXCEPT + { + // User destructor. + symbol_kind_type yykind = this->kind (); + basic_symbol& yysym = *this; + (void) yysym; + switch (yykind) + { + default: + break; + } + + // Value type destructor. +switch (yykind) + { + case symbol_kind::S_anim: // anim + value.template destroy< anim_ptr > (); + break; + + case symbol_kind::S_animation: // animation + value.template destroy< animation_ptr > (); + break; + + case symbol_kind::S_animtree: // animtree + value.template destroy< animtree_ptr > (); + break; + + case symbol_kind::S_constant: // constant + value.template destroy< constant_ptr > (); + break; + + case symbol_kind::S_define: // define + value.template destroy< define_ptr > (); + break; + + case symbol_kind::S_empty_array: // empty_array + value.template destroy< empty_array_ptr > (); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.template destroy< expr_arguments_ptr > (); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.template destroy< expr_assign_ptr > (); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.template destroy< expr_call_ptr > (); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.template destroy< expr_call_type_ptr > (); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.template destroy< expr_ptr > (); + break; + + case symbol_kind::S_false: // false + value.template destroy< false_ptr > (); + break; + + case symbol_kind::S_file: // file + value.template destroy< file_ptr > (); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.template destroy< float_ptr > (); + break; + + case symbol_kind::S_game: // game + value.template destroy< game_ptr > (); + break; + + case symbol_kind::S_include: // include + value.template destroy< include_ptr > (); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.template destroy< integer_ptr > (); + break; + + case symbol_kind::S_istring: // istring + value.template destroy< istring_ptr > (); + break; + + case symbol_kind::S_level: // level + value.template destroy< level_ptr > (); + break; + + case symbol_kind::S_name: // name + value.template destroy< name_ptr > (); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.template destroy< node_ptr > (); + break; + + case symbol_kind::S_parameters: // parameters + value.template destroy< parameters_ptr > (); + break; + + case symbol_kind::S_program: // program + value.template destroy< program_ptr > (); + break; + + case symbol_kind::S_self: // self + value.template destroy< self_ptr > (); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.template destroy< std::string > (); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.template destroy< stmt_assign_ptr > (); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.template destroy< stmt_break_ptr > (); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.template destroy< stmt_call_ptr > (); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.template destroy< stmt_case_ptr > (); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.template destroy< stmt_continue_ptr > (); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.template destroy< stmt_default_ptr > (); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.template destroy< stmt_endon_ptr > (); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.template destroy< stmt_for_ptr > (); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.template destroy< stmt_foreach_ptr > (); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.template destroy< stmt_if_ptr > (); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.template destroy< stmt_ifelse_ptr > (); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.template destroy< stmt_list_ptr > (); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.template destroy< stmt_notify_ptr > (); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.template destroy< stmt_ptr > (); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.template destroy< stmt_return_ptr > (); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.template destroy< stmt_switch_ptr > (); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.template destroy< stmt_wait_ptr > (); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.template destroy< stmt_waitframe_ptr > (); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.template destroy< stmt_waittill_ptr > (); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.template destroy< stmt_waittillframeend_ptr > (); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.template destroy< stmt_waittillmatch_ptr > (); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.template destroy< stmt_while_ptr > (); + break; + + case symbol_kind::S_string: // string + value.template destroy< string_ptr > (); + break; + + case symbol_kind::S_thisthread: // thisthread + value.template destroy< thisthread_ptr > (); + break; + + case symbol_kind::S_thread: // thread + value.template destroy< thread_ptr > (); + break; + + case symbol_kind::S_true: // true + value.template destroy< true_ptr > (); + break; + + case symbol_kind::S_undefined: // undefined + value.template destroy< undefined_ptr > (); + break; + + case symbol_kind::S_usingtree: // usingtree + value.template destroy< usingtree_ptr > (); + break; + + case symbol_kind::S_vector: // vector + value.template destroy< vector_ptr > (); + break; + + default: + break; + } + + Base::clear (); + } + + /// The user-facing name of this symbol. + const char *name () const YY_NOEXCEPT + { + return parser::symbol_name (this->kind ()); + } + + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; + + /// Whether empty. + bool empty () const YY_NOEXCEPT; + + /// Destructive move, \a s is emptied into this. + void move (basic_symbol& s); + + /// The semantic value. + semantic_type value; + + /// The location. + location_type location; + + private: +#if YY_CPLUSPLUS < 201103L + /// Assignment operator. + basic_symbol& operator= (const basic_symbol& that); +#endif + }; + + /// Type access provider for token (enum) based symbols. + struct by_kind + { + /// Default constructor. + by_kind (); + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + by_kind (by_kind&& that); +#endif + + /// Copy constructor. + by_kind (const by_kind& that); + + /// The symbol kind as needed by the constructor. + typedef token_kind_type kind_type; + + /// Constructor from (external) token numbers. + by_kind (kind_type t); + + /// Record that this symbol is empty. + void clear () YY_NOEXCEPT; + + /// Steal the symbol kind from \a that. + void move (by_kind& that); + + /// The (internal) type number (corresponding to \a type). + /// \a empty when empty. + symbol_kind_type kind () const YY_NOEXCEPT; + + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; + + /// The symbol kind. + /// \a S_YYEMPTY when empty. + symbol_kind_type kind_; + }; + + /// Backward compatibility for a private implementation detail (Bison 3.6). + typedef by_kind by_type; + + /// "External" symbols: returned by the scanner. + struct symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + + /// Empty symbol. + symbol_type () {} + + /// Constructor for valueless symbols, and symbols from each type. +#if 201103L <= YY_CPLUSPLUS + symbol_type (int tok, location_type l) + : super_type(token_type (tok), std::move (l)) +#else + symbol_type (int tok, const location_type& l) + : super_type(token_type (tok), l) +#endif + { + H2_ASSERT (tok == token::H2EOF + || (token::H2error <= tok && tok <= token::MOD) + || (token::ADD_ARRAY <= tok && tok <= token::POSTDEC)); + } +#if 201103L <= YY_CPLUSPLUS + symbol_type (int tok, std::string v, location_type l) + : super_type(token_type (tok), std::move (v), std::move (l)) +#else + symbol_type (int tok, const std::string& v, const location_type& l) + : super_type(token_type (tok), v, l) +#endif + { + H2_ASSERT ((token::FILE <= tok && tok <= token::INTEGER)); + } + }; + + /// Build a parser object. + parser (yyscan_t yyscanner_yyarg, xsk::gsc::location& loc_yyarg, xsk::gsc::program_ptr& ast_yyarg); + virtual ~parser (); + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + parser (const parser&) = delete; + /// Non copyable. + parser& operator= (const parser&) = delete; +#endif + + /// Parse. An alias for parse (). + /// \returns 0 iff parsing succeeded. + int operator() (); + + /// Parse. + /// \returns 0 iff parsing succeeded. + virtual int parse (); + +#if H2DEBUG + /// The current debugging stream. + std::ostream& debug_stream () const YY_ATTRIBUTE_PURE; + /// Set the current debugging stream. + void set_debug_stream (std::ostream &); + + /// Type for debugging levels. + typedef int debug_level_type; + /// The current debugging level. + debug_level_type debug_level () const YY_ATTRIBUTE_PURE; + /// Set the current debugging level. + void set_debug_level (debug_level_type l); +#endif + + /// Report a syntax error. + /// \param loc where the syntax error is found. + /// \param msg a description of the syntax error. + virtual void error (const location_type& loc, const std::string& msg); + + /// Report a syntax error. + void error (const syntax_error& err); + + /// The user-facing name of the symbol whose (internal) number is + /// YYSYMBOL. No bounds checking. + static const char *symbol_name (symbol_kind_type yysymbol); + + // Implementation of make_symbol for each symbol type. +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_H2EOF (location_type l) + { + return symbol_type (token::H2EOF, std::move (l)); + } +#else + static + symbol_type + make_H2EOF (const location_type& l) + { + return symbol_type (token::H2EOF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_H2error (location_type l) + { + return symbol_type (token::H2error, std::move (l)); + } +#else + static + symbol_type + make_H2error (const location_type& l) + { + return symbol_type (token::H2error, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_H2UNDEF (location_type l) + { + return symbol_type (token::H2UNDEF, std::move (l)); + } +#else + static + symbol_type + make_H2UNDEF (const location_type& l) + { + return symbol_type (token::H2UNDEF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INCLUDE (location_type l) + { + return symbol_type (token::INCLUDE, std::move (l)); + } +#else + static + symbol_type + make_INCLUDE (const location_type& l) + { + return symbol_type (token::INCLUDE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_USINGTREE (location_type l) + { + return symbol_type (token::USINGTREE, std::move (l)); + } +#else + static + symbol_type + make_USINGTREE (const location_type& l) + { + return symbol_type (token::USINGTREE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIMTREE (location_type l) + { + return symbol_type (token::ANIMTREE, std::move (l)); + } +#else + static + symbol_type + make_ANIMTREE (const location_type& l) + { + return symbol_type (token::ANIMTREE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ENDON (location_type l) + { + return symbol_type (token::ENDON, std::move (l)); + } +#else + static + symbol_type + make_ENDON (const location_type& l) + { + return symbol_type (token::ENDON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NOTIFY (location_type l) + { + return symbol_type (token::NOTIFY, std::move (l)); + } +#else + static + symbol_type + make_NOTIFY (const location_type& l) + { + return symbol_type (token::NOTIFY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAIT (location_type l) + { + return symbol_type (token::WAIT, std::move (l)); + } +#else + static + symbol_type + make_WAIT (const location_type& l) + { + return symbol_type (token::WAIT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILL (location_type l) + { + return symbol_type (token::WAITTILL, std::move (l)); + } +#else + static + symbol_type + make_WAITTILL (const location_type& l) + { + return symbol_type (token::WAITTILL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILLMATCH (location_type l) + { + return symbol_type (token::WAITTILLMATCH, std::move (l)); + } +#else + static + symbol_type + make_WAITTILLMATCH (const location_type& l) + { + return symbol_type (token::WAITTILLMATCH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILLFRAMEEND (location_type l) + { + return symbol_type (token::WAITTILLFRAMEEND, std::move (l)); + } +#else + static + symbol_type + make_WAITTILLFRAMEEND (const location_type& l) + { + return symbol_type (token::WAITTILLFRAMEEND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITFRAME (location_type l) + { + return symbol_type (token::WAITFRAME, std::move (l)); + } +#else + static + symbol_type + make_WAITFRAME (const location_type& l) + { + return symbol_type (token::WAITFRAME, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IF (location_type l) + { + return symbol_type (token::IF, std::move (l)); + } +#else + static + symbol_type + make_IF (const location_type& l) + { + return symbol_type (token::IF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ELSE (location_type l) + { + return symbol_type (token::ELSE, std::move (l)); + } +#else + static + symbol_type + make_ELSE (const location_type& l) + { + return symbol_type (token::ELSE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WHILE (location_type l) + { + return symbol_type (token::WHILE, std::move (l)); + } +#else + static + symbol_type + make_WHILE (const location_type& l) + { + return symbol_type (token::WHILE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FOR (location_type l) + { + return symbol_type (token::FOR, std::move (l)); + } +#else + static + symbol_type + make_FOR (const location_type& l) + { + return symbol_type (token::FOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FOREACH (location_type l) + { + return symbol_type (token::FOREACH, std::move (l)); + } +#else + static + symbol_type + make_FOREACH (const location_type& l) + { + return symbol_type (token::FOREACH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IN (location_type l) + { + return symbol_type (token::IN, std::move (l)); + } +#else + static + symbol_type + make_IN (const location_type& l) + { + return symbol_type (token::IN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SWITCH (location_type l) + { + return symbol_type (token::SWITCH, std::move (l)); + } +#else + static + symbol_type + make_SWITCH (const location_type& l) + { + return symbol_type (token::SWITCH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CASE (location_type l) + { + return symbol_type (token::CASE, std::move (l)); + } +#else + static + symbol_type + make_CASE (const location_type& l) + { + return symbol_type (token::CASE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DEFAULT (location_type l) + { + return symbol_type (token::DEFAULT, std::move (l)); + } +#else + static + symbol_type + make_DEFAULT (const location_type& l) + { + return symbol_type (token::DEFAULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BREAK (location_type l) + { + return symbol_type (token::BREAK, std::move (l)); + } +#else + static + symbol_type + make_BREAK (const location_type& l) + { + return symbol_type (token::BREAK, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CONTINUE (location_type l) + { + return symbol_type (token::CONTINUE, std::move (l)); + } +#else + static + symbol_type + make_CONTINUE (const location_type& l) + { + return symbol_type (token::CONTINUE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RETURN (location_type l) + { + return symbol_type (token::RETURN, std::move (l)); + } +#else + static + symbol_type + make_RETURN (const location_type& l) + { + return symbol_type (token::RETURN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THREAD (location_type l) + { + return symbol_type (token::THREAD, std::move (l)); + } +#else + static + symbol_type + make_THREAD (const location_type& l) + { + return symbol_type (token::THREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CHILDTHREAD (location_type l) + { + return symbol_type (token::CHILDTHREAD, std::move (l)); + } +#else + static + symbol_type + make_CHILDTHREAD (const location_type& l) + { + return symbol_type (token::CHILDTHREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THISTHREAD (location_type l) + { + return symbol_type (token::THISTHREAD, std::move (l)); + } +#else + static + symbol_type + make_THISTHREAD (const location_type& l) + { + return symbol_type (token::THISTHREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CALL (location_type l) + { + return symbol_type (token::CALL, std::move (l)); + } +#else + static + symbol_type + make_CALL (const location_type& l) + { + return symbol_type (token::CALL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_TRUE (location_type l) + { + return symbol_type (token::TRUE, std::move (l)); + } +#else + static + symbol_type + make_TRUE (const location_type& l) + { + return symbol_type (token::TRUE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FALSE (location_type l) + { + return symbol_type (token::FALSE, std::move (l)); + } +#else + static + symbol_type + make_FALSE (const location_type& l) + { + return symbol_type (token::FALSE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_UNDEFINED (location_type l) + { + return symbol_type (token::UNDEFINED, std::move (l)); + } +#else + static + symbol_type + make_UNDEFINED (const location_type& l) + { + return symbol_type (token::UNDEFINED, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SIZE (location_type l) + { + return symbol_type (token::SIZE, std::move (l)); + } +#else + static + symbol_type + make_SIZE (const location_type& l) + { + return symbol_type (token::SIZE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GAME (location_type l) + { + return symbol_type (token::GAME, std::move (l)); + } +#else + static + symbol_type + make_GAME (const location_type& l) + { + return symbol_type (token::GAME, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SELF (location_type l) + { + return symbol_type (token::SELF, std::move (l)); + } +#else + static + symbol_type + make_SELF (const location_type& l) + { + return symbol_type (token::SELF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIM (location_type l) + { + return symbol_type (token::ANIM, std::move (l)); + } +#else + static + symbol_type + make_ANIM (const location_type& l) + { + return symbol_type (token::ANIM, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LEVEL (location_type l) + { + return symbol_type (token::LEVEL, std::move (l)); + } +#else + static + symbol_type + make_LEVEL (const location_type& l) + { + return symbol_type (token::LEVEL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LPAREN (location_type l) + { + return symbol_type (token::LPAREN, std::move (l)); + } +#else + static + symbol_type + make_LPAREN (const location_type& l) + { + return symbol_type (token::LPAREN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RPAREN (location_type l) + { + return symbol_type (token::RPAREN, std::move (l)); + } +#else + static + symbol_type + make_RPAREN (const location_type& l) + { + return symbol_type (token::RPAREN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LBRACE (location_type l) + { + return symbol_type (token::LBRACE, std::move (l)); + } +#else + static + symbol_type + make_LBRACE (const location_type& l) + { + return symbol_type (token::LBRACE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RBRACE (location_type l) + { + return symbol_type (token::RBRACE, std::move (l)); + } +#else + static + symbol_type + make_RBRACE (const location_type& l) + { + return symbol_type (token::RBRACE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LBRACKET (location_type l) + { + return symbol_type (token::LBRACKET, std::move (l)); + } +#else + static + symbol_type + make_LBRACKET (const location_type& l) + { + return symbol_type (token::LBRACKET, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RBRACKET (location_type l) + { + return symbol_type (token::RBRACKET, std::move (l)); + } +#else + static + symbol_type + make_RBRACKET (const location_type& l) + { + return symbol_type (token::RBRACKET, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COMMA (location_type l) + { + return symbol_type (token::COMMA, std::move (l)); + } +#else + static + symbol_type + make_COMMA (const location_type& l) + { + return symbol_type (token::COMMA, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DOT (location_type l) + { + return symbol_type (token::DOT, std::move (l)); + } +#else + static + symbol_type + make_DOT (const location_type& l) + { + return symbol_type (token::DOT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DOUBLECOLON (location_type l) + { + return symbol_type (token::DOUBLECOLON, std::move (l)); + } +#else + static + symbol_type + make_DOUBLECOLON (const location_type& l) + { + return symbol_type (token::DOUBLECOLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COLON (location_type l) + { + return symbol_type (token::COLON, std::move (l)); + } +#else + static + symbol_type + make_COLON (const location_type& l) + { + return symbol_type (token::COLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SEMICOLON (location_type l) + { + return symbol_type (token::SEMICOLON, std::move (l)); + } +#else + static + symbol_type + make_SEMICOLON (const location_type& l) + { + return symbol_type (token::SEMICOLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INCREMENT (location_type l) + { + return symbol_type (token::INCREMENT, std::move (l)); + } +#else + static + symbol_type + make_INCREMENT (const location_type& l) + { + return symbol_type (token::INCREMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DECREMENT (location_type l) + { + return symbol_type (token::DECREMENT, std::move (l)); + } +#else + static + symbol_type + make_DECREMENT (const location_type& l) + { + return symbol_type (token::DECREMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LSHIFT (location_type l) + { + return symbol_type (token::LSHIFT, std::move (l)); + } +#else + static + symbol_type + make_LSHIFT (const location_type& l) + { + return symbol_type (token::LSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RSHIFT (location_type l) + { + return symbol_type (token::RSHIFT, std::move (l)); + } +#else + static + symbol_type + make_RSHIFT (const location_type& l) + { + return symbol_type (token::RSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_OR (location_type l) + { + return symbol_type (token::OR, std::move (l)); + } +#else + static + symbol_type + make_OR (const location_type& l) + { + return symbol_type (token::OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_AND (location_type l) + { + return symbol_type (token::AND, std::move (l)); + } +#else + static + symbol_type + make_AND (const location_type& l) + { + return symbol_type (token::AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_EQUALITY (location_type l) + { + return symbol_type (token::EQUALITY, std::move (l)); + } +#else + static + symbol_type + make_EQUALITY (const location_type& l) + { + return symbol_type (token::EQUALITY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INEQUALITY (location_type l) + { + return symbol_type (token::INEQUALITY, std::move (l)); + } +#else + static + symbol_type + make_INEQUALITY (const location_type& l) + { + return symbol_type (token::INEQUALITY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LESS_EQUAL (location_type l) + { + return symbol_type (token::LESS_EQUAL, std::move (l)); + } +#else + static + symbol_type + make_LESS_EQUAL (const location_type& l) + { + return symbol_type (token::LESS_EQUAL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GREATER_EQUAL (location_type l) + { + return symbol_type (token::GREATER_EQUAL, std::move (l)); + } +#else + static + symbol_type + make_GREATER_EQUAL (const location_type& l) + { + return symbol_type (token::GREATER_EQUAL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LESS (location_type l) + { + return symbol_type (token::LESS, std::move (l)); + } +#else + static + symbol_type + make_LESS (const location_type& l) + { + return symbol_type (token::LESS, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GREATER (location_type l) + { + return symbol_type (token::GREATER, std::move (l)); + } +#else + static + symbol_type + make_GREATER (const location_type& l) + { + return symbol_type (token::GREATER, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NOT (location_type l) + { + return symbol_type (token::NOT, std::move (l)); + } +#else + static + symbol_type + make_NOT (const location_type& l) + { + return symbol_type (token::NOT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COMPLEMENT (location_type l) + { + return symbol_type (token::COMPLEMENT, std::move (l)); + } +#else + static + symbol_type + make_COMPLEMENT (const location_type& l) + { + return symbol_type (token::COMPLEMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN (location_type l) + { + return symbol_type (token::ASSIGN, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN (const location_type& l) + { + return symbol_type (token::ASSIGN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_ADD (location_type l) + { + return symbol_type (token::ASSIGN_ADD, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_ADD (const location_type& l) + { + return symbol_type (token::ASSIGN_ADD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_SUB (location_type l) + { + return symbol_type (token::ASSIGN_SUB, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_SUB (const location_type& l) + { + return symbol_type (token::ASSIGN_SUB, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_MULT (location_type l) + { + return symbol_type (token::ASSIGN_MULT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_MULT (const location_type& l) + { + return symbol_type (token::ASSIGN_MULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_DIV (location_type l) + { + return symbol_type (token::ASSIGN_DIV, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_DIV (const location_type& l) + { + return symbol_type (token::ASSIGN_DIV, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_MOD (location_type l) + { + return symbol_type (token::ASSIGN_MOD, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_MOD (const location_type& l) + { + return symbol_type (token::ASSIGN_MOD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_OR (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_OR, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_OR (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_AND (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_AND, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_AND (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_EXOR (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_EXOR, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_EXOR (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_EXOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_RSHIFT (location_type l) + { + return symbol_type (token::ASSIGN_RSHIFT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_RSHIFT (const location_type& l) + { + return symbol_type (token::ASSIGN_RSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_LSHIFT (location_type l) + { + return symbol_type (token::ASSIGN_LSHIFT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_LSHIFT (const location_type& l) + { + return symbol_type (token::ASSIGN_LSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_OR (location_type l) + { + return symbol_type (token::BITWISE_OR, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_OR (const location_type& l) + { + return symbol_type (token::BITWISE_OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_AND (location_type l) + { + return symbol_type (token::BITWISE_AND, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_AND (const location_type& l) + { + return symbol_type (token::BITWISE_AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_EXOR (location_type l) + { + return symbol_type (token::BITWISE_EXOR, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_EXOR (const location_type& l) + { + return symbol_type (token::BITWISE_EXOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ADD (location_type l) + { + return symbol_type (token::ADD, std::move (l)); + } +#else + static + symbol_type + make_ADD (const location_type& l) + { + return symbol_type (token::ADD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SUB (location_type l) + { + return symbol_type (token::SUB, std::move (l)); + } +#else + static + symbol_type + make_SUB (const location_type& l) + { + return symbol_type (token::SUB, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_MULT (location_type l) + { + return symbol_type (token::MULT, std::move (l)); + } +#else + static + symbol_type + make_MULT (const location_type& l) + { + return symbol_type (token::MULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DIV (location_type l) + { + return symbol_type (token::DIV, std::move (l)); + } +#else + static + symbol_type + make_DIV (const location_type& l) + { + return symbol_type (token::DIV, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_MOD (location_type l) + { + return symbol_type (token::MOD, std::move (l)); + } +#else + static + symbol_type + make_MOD (const location_type& l) + { + return symbol_type (token::MOD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FILE (std::string v, location_type l) + { + return symbol_type (token::FILE, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_FILE (const std::string& v, const location_type& l) + { + return symbol_type (token::FILE, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NAME (std::string v, location_type l) + { + return symbol_type (token::NAME, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_NAME (const std::string& v, const location_type& l) + { + return symbol_type (token::NAME, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_STRING (std::string v, location_type l) + { + return symbol_type (token::STRING, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_STRING (const std::string& v, const location_type& l) + { + return symbol_type (token::STRING, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ISTRING (std::string v, location_type l) + { + return symbol_type (token::ISTRING, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_ISTRING (const std::string& v, const location_type& l) + { + return symbol_type (token::ISTRING, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FLOAT (std::string v, location_type l) + { + return symbol_type (token::FLOAT, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_FLOAT (const std::string& v, const location_type& l) + { + return symbol_type (token::FLOAT, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INTEGER (std::string v, location_type l) + { + return symbol_type (token::INTEGER, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_INTEGER (const std::string& v, const location_type& l) + { + return symbol_type (token::INTEGER, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ADD_ARRAY (location_type l) + { + return symbol_type (token::ADD_ARRAY, std::move (l)); + } +#else + static + symbol_type + make_ADD_ARRAY (const location_type& l) + { + return symbol_type (token::ADD_ARRAY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THEN (location_type l) + { + return symbol_type (token::THEN, std::move (l)); + } +#else + static + symbol_type + make_THEN (const location_type& l) + { + return symbol_type (token::THEN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NEG (location_type l) + { + return symbol_type (token::NEG, std::move (l)); + } +#else + static + symbol_type + make_NEG (const location_type& l) + { + return symbol_type (token::NEG, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIMREF (location_type l) + { + return symbol_type (token::ANIMREF, std::move (l)); + } +#else + static + symbol_type + make_ANIMREF (const location_type& l) + { + return symbol_type (token::ANIMREF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_PREINC (location_type l) + { + return symbol_type (token::PREINC, std::move (l)); + } +#else + static + symbol_type + make_PREINC (const location_type& l) + { + return symbol_type (token::PREINC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_PREDEC (location_type l) + { + return symbol_type (token::PREDEC, std::move (l)); + } +#else + static + symbol_type + make_PREDEC (const location_type& l) + { + return symbol_type (token::PREDEC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_POSTINC (location_type l) + { + return symbol_type (token::POSTINC, std::move (l)); + } +#else + static + symbol_type + make_POSTINC (const location_type& l) + { + return symbol_type (token::POSTINC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_POSTDEC (location_type l) + { + return symbol_type (token::POSTDEC, std::move (l)); + } +#else + static + symbol_type + make_POSTDEC (const location_type& l) + { + return symbol_type (token::POSTDEC, l); + } +#endif + + + class context + { + public: + context (const parser& yyparser, const symbol_type& yyla); + const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; } + symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); } + const location_type& location () const YY_NOEXCEPT { return yyla_.location; } + + /// Put in YYARG at most YYARGN of the expected tokens, and return the + /// number of tokens stored in YYARG. If YYARG is null, return the + /// number of expected tokens (guaranteed to be less than YYNTOKENS). + int expected_tokens (symbol_kind_type yyarg[], int yyargn) const; + + private: + const parser& yyparser_; + const symbol_type& yyla_; + }; + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + parser (const parser&); + /// Non copyable. + parser& operator= (const parser&); +#endif + + /// Check the lookahead yytoken. + /// \returns true iff the token will be eventually shifted. + bool yy_lac_check_ (symbol_kind_type yytoken) const; + /// Establish the initial context if no initial context currently exists. + /// \returns true iff the token will be eventually shifted. + bool yy_lac_establish_ (symbol_kind_type yytoken); + /// Discard any previous initial lookahead context because of event. + /// \param event the event which caused the lookahead to be discarded. + /// Only used for debbuging output. + void yy_lac_discard_ (const char* event); + + /// Stored state numbers (used for stacks). + typedef short state_type; + + /// The arguments of the error message. + int yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const; + + /// Generate an error message. + /// \param yyctx the context in which the error occurred. + virtual std::string yysyntax_error_ (const context& yyctx) const; + /// Compute post-reduction state. + /// \param yystate the current state + /// \param yysym the nonterminal to push on the stack + static state_type yy_lr_goto_state_ (state_type yystate, int yysym); + + /// Whether the given \c yypact_ value indicates a defaulted state. + /// \param yyvalue the value to check + static bool yy_pact_value_is_default_ (int yyvalue); + + /// Whether the given \c yytable_ value indicates a syntax error. + /// \param yyvalue the value to check + static bool yy_table_value_is_error_ (int yyvalue); + + static const short yypact_ninf_; + static const short yytable_ninf_; + + /// Convert a scanner token kind \a t to a symbol kind. + /// In theory \a t should be a token_kind_type, but character literals + /// are valid, yet not members of the token_type enum. + static symbol_kind_type yytranslate_ (int t); + + + + // Tables. + // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + // STATE-NUM. + static const short yypact_[]; + + // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + // Performed when YYTABLE does not specify something else to do. Zero + // means the default is an error. + static const unsigned char yydefact_[]; + + // YYPGOTO[NTERM-NUM]. + static const short yypgoto_[]; + + // YYDEFGOTO[NTERM-NUM]. + static const short yydefgoto_[]; + + // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + // positive, shift that token. If negative, reduce the rule whose + // number is the opposite. If YYTABLE_NINF, syntax error. + static const short yytable_[]; + + static const short yycheck_[]; + + // YYSTOS[STATE-NUM] -- The (internal number of the) accessing + // symbol of state STATE-NUM. + static const unsigned char yystos_[]; + + // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + static const unsigned char yyr1_[]; + + // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + static const signed char yyr2_[]; + + +#if H2DEBUG + // YYRLINE[YYN] -- Source line where rule number YYN was defined. + static const short yyrline_[]; + /// Report on the debug stream that the rule \a r is going to be reduced. + virtual void yy_reduce_print_ (int r) const; + /// Print the state stack on the debug stream. + virtual void yy_stack_print_ () const; + + /// Debugging level. + int yydebug_; + /// Debug stream. + std::ostream* yycdebug_; + + /// \brief Display a symbol kind, value and location. + /// \param yyo The output stream. + /// \param yysym The symbol. + template + void yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const; +#endif + + /// \brief Reclaim the memory associated to a symbol. + /// \param yymsg Why this token is reclaimed. + /// If null, print nothing. + /// \param yysym The symbol. + template + void yy_destroy_ (const char* yymsg, basic_symbol& yysym) const; + + private: + /// Type access provider for state based symbols. + struct by_state + { + /// Default constructor. + by_state () YY_NOEXCEPT; + + /// The symbol kind as needed by the constructor. + typedef state_type kind_type; + + /// Constructor. + by_state (kind_type s) YY_NOEXCEPT; + + /// Copy constructor. + by_state (const by_state& that) YY_NOEXCEPT; + + /// Record that this symbol is empty. + void clear () YY_NOEXCEPT; + + /// Steal the symbol kind from \a that. + void move (by_state& that); + + /// The symbol kind (corresponding to \a state). + /// \a symbol_kind::S_YYEMPTY when empty. + symbol_kind_type kind () const YY_NOEXCEPT; + + /// The state number used to denote an empty symbol. + /// We use the initial state, as it does not have a value. + enum { empty_state = 0 }; + + /// The state. + /// \a empty when empty. + state_type state; + }; + + /// "Internal" symbol: element of the stack. + struct stack_symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + /// Construct an empty symbol. + stack_symbol_type (); + /// Move or copy construction. + stack_symbol_type (YY_RVREF (stack_symbol_type) that); + /// Steal the contents from \a sym to build this. + stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym); +#if YY_CPLUSPLUS < 201103L + /// Assignment, needed by push_back by some old implementations. + /// Moves the contents of that. + stack_symbol_type& operator= (stack_symbol_type& that); + + /// Assignment, needed by push_back by other implementations. + /// Needed by some other old implementations. + stack_symbol_type& operator= (const stack_symbol_type& that); +#endif + }; + + /// A stack with random access from its top. + template > + class stack + { + public: + // Hide our reversed order. + typedef typename S::iterator iterator; + typedef typename S::const_iterator const_iterator; + typedef typename S::size_type size_type; + typedef typename std::ptrdiff_t index_type; + + stack (size_type n = 200) + : seq_ (n) + {} + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + stack (const stack&) = delete; + /// Non copyable. + stack& operator= (const stack&) = delete; +#endif + + /// Random access. + /// + /// Index 0 returns the topmost element. + const T& + operator[] (index_type i) const + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Random access. + /// + /// Index 0 returns the topmost element. + T& + operator[] (index_type i) + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Steal the contents of \a t. + /// + /// Close to move-semantics. + void + push (YY_MOVE_REF (T) t) + { + seq_.push_back (T ()); + operator[] (0).move (t); + } + + /// Pop elements from the stack. + void + pop (std::ptrdiff_t n = 1) YY_NOEXCEPT + { + for (; 0 < n; --n) + seq_.pop_back (); + } + + /// Pop all elements from the stack. + void + clear () YY_NOEXCEPT + { + seq_.clear (); + } + + /// Number of elements on the stack. + index_type + size () const YY_NOEXCEPT + { + return index_type (seq_.size ()); + } + + /// Iterator on top of the stack (going downwards). + const_iterator + begin () const YY_NOEXCEPT + { + return seq_.begin (); + } + + /// Bottom of the stack. + const_iterator + end () const YY_NOEXCEPT + { + return seq_.end (); + } + + /// Present a slice of the top of a stack. + class slice + { + public: + slice (const stack& stack, index_type range) + : stack_ (stack) + , range_ (range) + {} + + const T& + operator[] (index_type i) const + { + return stack_[range_ - i]; + } + + private: + const stack& stack_; + index_type range_; + }; + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + stack (const stack&); + /// Non copyable. + stack& operator= (const stack&); +#endif + /// The wrapped container. + S seq_; + }; + + + /// Stack type. + typedef stack stack_type; + + /// The stack. + stack_type yystack_; + /// The stack for LAC. + /// Logically, the yy_lac_stack's lifetime is confined to the function + /// yy_lac_check_. We just store it as a member of this class to hold + /// on to the memory and to avoid frequent reallocations. + /// Since yy_lac_check_ is const, this member must be mutable. + mutable std::vector yylac_stack_; + /// Whether an initial LAC context was established. + bool yy_lac_established_; + + + /// Push a new state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param sym the symbol + /// \warning the contents of \a s.value is stolen. + void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym); + + /// Push a new look ahead token on the state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param s the state + /// \param sym the symbol (for its value and location). + /// \warning the contents of \a sym.value is stolen. + void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); + + /// Pop \a n symbols from the stack. + void yypop_ (int n = 1); + + /// Constants. + enum + { + yylast_ = 1581, ///< Last index in yytable_. + yynnts_ = 73, ///< Number of nonterminal symbols. + yyfinal_ = 15 ///< Termination state number. + }; + + + // User arguments. + yyscan_t yyscanner; + xsk::gsc::location& loc; + xsk::gsc::program_ptr& ast; + + }; + + inline + parser::symbol_kind_type + parser::yytranslate_ (int t) + { + return static_cast (t); + } + + // basic_symbol. + template + parser::basic_symbol::basic_symbol (const basic_symbol& that) + : Base (that) + , value () + , location (that.location) + { + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.copy< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.copy< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.copy< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.copy< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.copy< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.copy< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.copy< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.copy< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.copy< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.copy< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.copy< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.copy< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.copy< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.copy< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.copy< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.copy< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.copy< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.copy< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.copy< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.copy< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.copy< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.copy< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.copy< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.copy< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.copy< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.copy< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.copy< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.copy< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.copy< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.copy< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.copy< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.copy< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.copy< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.copy< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.copy< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.copy< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.copy< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.copy< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.copy< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.copy< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.copy< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.copy< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.copy< stmt_waitframe_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.copy< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.copy< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.copy< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.copy< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.copy< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.copy< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.copy< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.copy< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.copy< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.copy< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.copy< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + + } + + + + template + parser::symbol_kind_type + parser::basic_symbol::type_get () const YY_NOEXCEPT + { + return this->kind (); + } + + template + bool + parser::basic_symbol::empty () const YY_NOEXCEPT + { + return this->kind () == symbol_kind::S_YYEMPTY; + } + + template + void + parser::basic_symbol::move (basic_symbol& s) + { + super_type::move (s); + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (YY_MOVE (s.value)); + break; + + default: + break; + } + + location = YY_MOVE (s.location); + } + + // by_kind. + inline + parser::by_kind::by_kind () + : kind_ (symbol_kind::S_YYEMPTY) + {} + +#if 201103L <= YY_CPLUSPLUS + inline + parser::by_kind::by_kind (by_kind&& that) + : kind_ (that.kind_) + { + that.clear (); + } +#endif + + inline + parser::by_kind::by_kind (const by_kind& that) + : kind_ (that.kind_) + {} + + inline + parser::by_kind::by_kind (token_kind_type t) + : kind_ (yytranslate_ (t)) + {} + + inline + void + parser::by_kind::clear () YY_NOEXCEPT + { + kind_ = symbol_kind::S_YYEMPTY; + } + + inline + void + parser::by_kind::move (by_kind& that) + { + kind_ = that.kind_; + that.clear (); + } + + inline + parser::symbol_kind_type + parser::by_kind::kind () const YY_NOEXCEPT + { + return kind_; + } + + inline + parser::symbol_kind_type + parser::by_kind::type_get () const YY_NOEXCEPT + { + return this->kind (); + } + +#line 13 "parser.ypp" +} } } // xsk::gsc::h2 +#line 4764 "parser.hpp" + + + + +#endif // !YY_H2_PARSER_HPP_INCLUDED diff --git a/src/h2/xsk/resolver.cpp b/src/h2/xsk/resolver.cpp new file mode 100644 index 00000000..1651aa63 --- /dev/null +++ b/src/h2/xsk/resolver.cpp @@ -0,0 +1,2688 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "h2.hpp" + +namespace xsk::gsc::h2 +{ + +std::unordered_map opcode_map; +std::unordered_map function_map; +std::unordered_map method_map; +std::unordered_map file_map; +std::unordered_map token_map; +std::unordered_map opcode_map_rev; +std::unordered_map function_map_rev; +std::unordered_map method_map_rev; +std::unordered_map file_map_rev; +std::unordered_map token_map_rev; + +auto resolver::opcode_id(const std::string& name) -> std::uint8_t +{ + const auto itr = opcode_map_rev.find(name); + + if (itr != opcode_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve opcode id for name '%s'!", name.data())); +} + +auto resolver::opcode_name(std::uint8_t id) -> std::string +{ + const auto itr = opcode_map.find(id); + + if (itr != opcode_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve opcode name for id '0x%hhX'!", id)); +} + +auto resolver::function_id(const std::string& name) -> std::uint16_t +{ + const auto itr = function_map_rev.find(name); + + if (itr != function_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin function id for name '%s'!", name.data())); +} + +auto resolver::function_name(std::uint16_t id) -> std::string +{ + const auto itr = function_map.find(id); + + if (itr != function_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin function name for id '%i'!", id)); +} + +auto resolver::method_id(const std::string& name) -> std::uint16_t +{ + const auto itr = method_map_rev.find(name); + + if (itr != method_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin method id for name '%s'!", name.data())); +} + +auto resolver::method_name(std::uint16_t id) -> std::string +{ + const auto itr = method_map.find(id); + + if (itr != method_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin method name for id '%i'!", id)); + return utils::string::va("_ID%i", id); +} + +auto resolver::file_id(const std::string& name) -> std::uint16_t +{ + const auto itr = file_map_rev.find(name); + + if (itr != file_map_rev.end()) + { + return itr->second; + } + + return 0; +} + +auto resolver::file_name(std::uint16_t id) -> std::string +{ + const auto itr = file_map.find(id); + + if (itr != file_map.end()) + { + return itr->second; + } + + return utils::string::va("_ID%i", id); +} + +auto resolver::token_id(const std::string& name) -> std::uint16_t +{ + const auto itr = token_map_rev.find(name); + + if (itr != token_map_rev.end()) + { + return itr->second; + } + + return 0; +} + +auto resolver::token_name(std::uint16_t id) -> std::string +{ + const auto itr = token_map.find(id); + + if (itr != token_map.end()) + { + return itr->second; + } + + return utils::string::va("_ID%i", id); +} + +auto resolver::find_function(const std::string& name) -> bool +{ + const auto itr = function_map_rev.find(name); + + if (itr != function_map_rev.end()) + { + return true; + } + + return false; +} + +auto resolver::find_method(const std::string& name) -> bool +{ + const auto itr = method_map_rev.find(name); + + if (itr != method_map_rev.end()) + { + return true; + } + + return false; +} + +const std::array opcode_list +{{ + { std::uint8_t(opcode::OP_End),"END" }, + { std::uint8_t(opcode::OP_Return),"RETN" }, + { std::uint8_t(opcode::OP_GetByte),"GET_BYTE" }, + { std::uint8_t(opcode::OP_GetNegByte),"GET_NBYTE" }, + { std::uint8_t(opcode::OP_GetUnsignedShort),"GET_USHORT" }, + { std::uint8_t(opcode::OP_GetNegUnsignedShort),"GET_NUSHORT" }, + { std::uint8_t(opcode::OP_GetInteger),"GET_INT" }, + { std::uint8_t(opcode::OP_GetBuiltinFunction),"GET_BUILTIN_FUNC" }, + { std::uint8_t(opcode::OP_GetBuiltinMethod),"GET_BUILTIN_METHOD" }, + { std::uint8_t(opcode::OP_GetFloat),"GET_FLOAT" }, + { std::uint8_t(opcode::OP_GetString),"GET_STRING" }, + { std::uint8_t(opcode::OP_GetUndefined),"GET_UNDEFINED" }, + { std::uint8_t(opcode::OP_GetZero),"GET_ZERO" }, + { std::uint8_t(opcode::OP_waittillFrameEnd),"WAITTILLFRAMEEND" }, + { std::uint8_t(opcode::OP_CreateLocalVariable),"CREATE_LOCAL_VARIABLE" }, + { std::uint8_t(opcode::OP_RemoveLocalVariables),"REMOVE_LOCAL_VARIABLES" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached0),"EVAL_LOCAL_VARIABLE_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached1),"EVAL_LOCAL_VARIABLE_CACHED1" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached2),"EVAL_LOCAL_VARIABLE_CACHED2" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached3),"EVAL_LOCAL_VARIABLE_CACHED3" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached4),"EVAL_LOCAL_VARIABLE_CACHED4" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached5),"EVAL_LOCAL_VARIABLE_CACHED5" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached),"EVAL_LOCAL_VARIABLE_CACHED" }, + { std::uint8_t(opcode::OP_EvalLocalArrayCached),"EVAL_LOCAL_ARRAY_CACHED" }, + { std::uint8_t(opcode::OP_EvalArray),"EVAL_ARRAY" }, + { std::uint8_t(opcode::OP_EvalNewLocalArrayRefCached0),"EVAL_NEW_LOCAL_ARRAY_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalArrayRefCached0),"EVAL_LOCAL_ARRAY_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalArrayRefCached),"EVAL_LOCAL_ARRAY_REF_CACHED" }, + { std::uint8_t(opcode::OP_EvalArrayRef),"EVAL_ARRAY_REF" }, + { std::uint8_t(opcode::OP_ClearArray),"CLEAR_ARRAY" }, + { std::uint8_t(opcode::OP_EmptyArray),"EMPTY_ARRAY" }, + { std::uint8_t(opcode::OP_AddArray),"ADD_ARRAY" }, + { std::uint8_t(opcode::OP_PreScriptCall),"PRE_CALL" }, + { std::uint8_t(opcode::OP_ScriptLocalFunctionCall2),"CALL_LOCAL_FUNC2" }, + { std::uint8_t(opcode::OP_ScriptLocalFunctionCall),"CALL_LOCAL_FUNC" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodCall),"CALL_LOCAL_METHOD" }, + { std::uint8_t(opcode::OP_ScriptLocalThreadCall),"CALL_LOCAL_FUNC_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalChildThreadCall),"CALL_LOCAL_FUNC_CHILD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodThreadCall),"CALL_LOCAL_METHOD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodChildThreadCall),"CALL_LOCAL_METHOD_CHILD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptFarFunctionCall2),"CALL_FAR_FUNC2" }, + { std::uint8_t(opcode::OP_ScriptFarFunctionCall),"CALL_FAR_FUNC" }, + { std::uint8_t(opcode::OP_ScriptFarMethodCall),"CALL_FAR_METHOD" }, + { std::uint8_t(opcode::OP_ScriptFarThreadCall),"CALL_FAR_FUNC_THREAD" }, + { std::uint8_t(opcode::OP_ScriptFarChildThreadCall),"CALL_FAR_FUNC_CHILD_THREAD"}, + { std::uint8_t(opcode::OP_ScriptFarMethodThreadCall),"CALL_FAR_METHOD_THEAD" }, + { std::uint8_t(opcode::OP_ScriptFarMethodChildThreadCall),"CALL_FAR_METHOD_CHILD_THEAD" }, + { std::uint8_t(opcode::OP_ScriptFunctionCallPointer),"CALL_FUNC_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodCallPointer),"CALL_METHOD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptThreadCallPointer),"CALL_FUNC_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptChildThreadCallPointer),"CALL_FUNC_CHILD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodThreadCallPointer),"CALL_METHOD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodChildThreadCallPointer),"CALL_METHOD_CHILD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_CallBuiltinPointer),"CALL_BUILTIN_FUNC_POINTER" }, + { std::uint8_t(opcode::OP_CallBuiltinMethodPointer),"CALL_BUILTIN_METHOD_POINTER" }, + { std::uint8_t(opcode::OP_GetIString),"GET_ISTRING" }, + { std::uint8_t(opcode::OP_GetVector),"GET_VECTOR" }, + { std::uint8_t(opcode::OP_GetLevelObject),"GET_LEVEL_OBJ" }, + { std::uint8_t(opcode::OP_GetAnimObject),"GET_ANIM_OBJ" }, + { std::uint8_t(opcode::OP_GetSelf),"GET_SELF" }, + { std::uint8_t(opcode::OP_GetThisthread),"GET_THISTHREAD" }, + { std::uint8_t(opcode::OP_GetLevel),"GET_LEVEL" }, + { std::uint8_t(opcode::OP_GetGame),"GET_GAME" }, + { std::uint8_t(opcode::OP_GetAnim),"GET_ANIM" }, + { std::uint8_t(opcode::OP_GetAnimation),"GET_ANIMATION" }, + { std::uint8_t(opcode::OP_GetGameRef),"GET_GAME_REF" }, + { std::uint8_t(opcode::OP_inc),"INC" }, + { std::uint8_t(opcode::OP_dec),"DEC" }, + { std::uint8_t(opcode::OP_bit_or),"BIT_OR" }, + { std::uint8_t(opcode::OP_JumpOnFalseExpr),"JMP_EXPR_FALSE" }, + { std::uint8_t(opcode::OP_bit_ex_or),"BIT_EXOR" }, + { std::uint8_t(opcode::OP_bit_and),"BIT_AND" }, + { std::uint8_t(opcode::OP_equality),"EQUALITY" }, + { std::uint8_t(opcode::OP_inequality),"INEQUALITY" }, + { std::uint8_t(opcode::OP_less),"LESS" }, + { std::uint8_t(opcode::OP_greater),"GREATER" }, + { std::uint8_t(opcode::OP_JumpOnTrueExpr),"JMP_EXPR_TRUE" }, + { std::uint8_t(opcode::OP_less_equal),"LESSEQUAL" }, + { std::uint8_t(opcode::OP_jumpback),"JMP_BACK" }, + { std::uint8_t(opcode::OP_waittillmatch2),"WAITTILLMATCH2" }, + { std::uint8_t(opcode::OP_waittill),"WAITTILL" }, + { std::uint8_t(opcode::OP_notify),"NOTIFY" }, + { std::uint8_t(opcode::OP_endon),"ENDON" }, + { std::uint8_t(opcode::OP_voidCodepos),"VOIDCODEPOS" }, + { std::uint8_t(opcode::OP_switch),"SWITCH" }, + { std::uint8_t(opcode::OP_endswitch),"ENDSWITCH" }, + { std::uint8_t(opcode::OP_vector),"VECTOR" }, + { std::uint8_t(opcode::OP_JumpOnFalse),"JMP_FALSE" }, + { std::uint8_t(opcode::OP_greater_equal),"GREATEREQUAL" }, + { std::uint8_t(opcode::OP_shift_left),"SHIFT_LEFT" }, + { std::uint8_t(opcode::OP_shift_right),"SHIFT_RIGHT" }, + { std::uint8_t(opcode::OP_plus),"PLUS" }, + { std::uint8_t(opcode::OP_jump),"JMP" }, + { std::uint8_t(opcode::OP_minus),"MINUS" }, + { std::uint8_t(opcode::OP_multiply),"MULT" }, + { std::uint8_t(opcode::OP_divide),"DIV" }, + { std::uint8_t(opcode::OP_mod),"MOD" }, + { std::uint8_t(opcode::OP_JumpOnTrue),"JMP_TRUE" }, + { std::uint8_t(opcode::OP_size),"SIZE" }, + { std::uint8_t(opcode::OP_waittillmatch),"WAITTILLMATCH" }, + { std::uint8_t(opcode::OP_GetLocalFunction),"GET_LOCAL_FUNC" }, + { std::uint8_t(opcode::OP_GetFarFunction),"GET_FAR_FUNC" }, + { std::uint8_t(opcode::OP_GetSelfObject),"GET_SELF_OBJ" }, + { std::uint8_t(opcode::OP_EvalLevelFieldVariable),"EVAL_LEVEL_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalAnimFieldVariable),"EVAL_ANIM_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalSelfFieldVariable),"EVAL_SELF_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalFieldVariable),"EVAL_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalLevelFieldVariableRef),"EVAL_LEVEL_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalAnimFieldVariableRef),"EVAL_ANIM_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalSelfFieldVariableRef),"EVAL_SELF_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalFieldVariableRef),"EVAL_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_ClearFieldVariable),"CLEAR_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_SafeCreateVariableFieldCached),"SAFE_CREATE_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_SafeSetVariableFieldCached0),"SAFE_SET_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SafeSetVariableFieldCached),"SAFE_SET_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_SafeSetWaittillVariableFieldCached),"SAFE_SET_WAITTILL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_GetAnimTree),"GET_ANIMTREE" }, + { std::uint8_t(opcode::OP_clearparams),"CLEAR_PARAMS" }, + { std::uint8_t(opcode::OP_checkclearparams),"CHECK_CLEAR_PARAMS" }, + { std::uint8_t(opcode::OP_EvalLocalVariableRefCached0),"EVAL_LOCAL_VARIABLE_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalNewLocalVariableRefCached0),"EVAL_NEW_LOCAL_VARIABLE_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalVariableRefCached),"EVAL_LOCAL_VARIABLE_REF_CACHED" }, + { std::uint8_t(opcode::OP_SetLevelFieldVariableField),"SET_LEVEL_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetVariableField),"SET_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_ClearVariableField),"CLEAR_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetAnimFieldVariableField),"SET_ANIM_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetSelfFieldVariableField),"SET_SELF_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetLocalVariableFieldCached0),"SET_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SetNewLocalVariableFieldCached0),"SET_NEW_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SetLocalVariableFieldCached),"SET_LOCAL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_ClearLocalVariableFieldCached),"CLEAR_LOCAL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_ClearLocalVariableFieldCached0),"CLEAR_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_CallBuiltin0),"CALL_BUILTIN_FUNC_0" }, + { std::uint8_t(opcode::OP_CallBuiltin1),"CALL_BUILTIN_FUNC_1" }, + { std::uint8_t(opcode::OP_CallBuiltin2),"CALL_BUILTIN_FUNC_2" }, + { std::uint8_t(opcode::OP_CallBuiltin3),"CALL_BUILTIN_FUNC_3" }, + { std::uint8_t(opcode::OP_CallBuiltin4),"CALL_BUILTIN_FUNC_4" }, + { std::uint8_t(opcode::OP_CallBuiltin5),"CALL_BUILTIN_FUNC_5" }, + { std::uint8_t(opcode::OP_CallBuiltin),"CALL_BUILTIN_FUNC" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod0),"CALL_BUILTIN_METHOD_0" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod1),"CALL_BUILTIN_METHOD_1" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod2),"CALL_BUILTIN_METHOD_2" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod3),"CALL_BUILTIN_METHOD_3" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod4),"CALL_BUILTIN_METHOD_4" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod5),"CALL_BUILTIN_METHOD_5" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod),"CALL_BUILTIN_METHOD" }, + { std::uint8_t(opcode::OP_wait),"WAIT" }, + { std::uint8_t(opcode::OP_DecTop),"DEC_TOP" }, + { std::uint8_t(opcode::OP_CastFieldObject),"CAST_FIELD_OBJ" }, + { std::uint8_t(opcode::OP_EvalLocalVariableObjectCached),"EVAL_LOCAL_VARIABLE_OBJECT_CACHED" }, + { std::uint8_t(opcode::OP_CastBool),"CAST_BOOL" }, + { std::uint8_t(opcode::OP_BoolNot),"BOOL_NOT" }, + { std::uint8_t(opcode::OP_BoolComplement),"BOOL_COMPLEMENT" }, + { std::uint8_t(opcode::OP_waitFrame), "WAITFRAME" }, +}}; + +const std::array function_list +{{ + { 0x001, "_func_001" }, + { 0x002, "_func_002" }, + { 0x003, "_func_003" }, + { 0x004, "_func_004" }, + { 0x005, "_func_005" }, + { 0x006, "_func_006" }, + { 0x007, "_func_007" }, + { 0x008, "_func_008" }, + { 0x009, "_func_009" }, + { 0x00A, "_func_00A" }, + { 0x00B, "_func_00B" }, + { 0x00C, "_func_00C" }, + { 0x00D, "_func_00D" }, + { 0x00E, "_func_00E" }, + { 0x00F, "_func_00F" }, + { 0x010, "_func_010" }, + { 0x011, "_func_011" }, + { 0x012, "_func_012" }, + { 0x013, "_func_013" }, + { 0x014, "_func_014" }, + { 0x015, "_func_015" }, + { 0x016, "_func_016" }, + { 0x017, "_func_017" }, + { 0x018, "_func_018" }, + { 0x019, "_func_019" }, + { 0x01A, "_func_01A" }, + { 0x01B, "_func_01B" }, + { 0x01C, "_func_01C" }, + { 0x01D, "_func_01D" }, + { 0x01E, "_func_01E" }, + { 0x01F, "_func_01F" }, + { 0x020, "_func_020" }, + { 0x021, "_func_021" }, + { 0x022, "_func_022" }, + { 0x023, "_func_023" }, + { 0x024, "_func_024" }, + { 0x025, "_func_025" }, + { 0x026, "_func_026" }, + { 0x027, "_func_027" }, + { 0x028, "_func_028" }, + { 0x029, "_func_029" }, + { 0x02A, "_func_02A" }, + { 0x02B, "_func_02B" }, + { 0x02C, "_func_02C" }, + { 0x02D, "_func_02D" }, + { 0x02E, "_func_02E" }, + { 0x02F, "_func_02F" }, + { 0x030, "_func_030" }, + { 0x031, "_func_031" }, + { 0x032, "_func_032" }, + { 0x033, "_func_033" }, + { 0x034, "_func_034" }, + { 0x035, "_func_035" }, + { 0x036, "_func_036" }, + { 0x037, "_func_037" }, + { 0x038, "_func_038" }, + { 0x039, "_func_039" }, + { 0x03A, "_func_03A" }, + { 0x03B, "_func_03B" }, + { 0x03C, "_func_03C" }, + { 0x03D, "_func_03D" }, + { 0x03E, "_func_03E" }, + { 0x03F, "_func_03F" }, + { 0x040, "_func_040" }, + { 0x041, "_func_041" }, + { 0x042, "_func_042" }, + { 0x043, "_func_043" }, + { 0x044, "_func_044" }, + { 0x045, "_func_045" }, + { 0x046, "_func_046" }, + { 0x047, "_func_047" }, + { 0x048, "_func_048" }, + { 0x049, "_func_049" }, + { 0x04A, "_func_04A" }, + { 0x04B, "_func_04B" }, + { 0x04C, "_func_04C" }, + { 0x04D, "_func_04D" }, + { 0x04E, "_func_04E" }, + { 0x04F, "_func_04F" }, + { 0x050, "_func_050" }, + { 0x051, "_func_051" }, + { 0x052, "_func_052" }, + { 0x053, "_func_053" }, + { 0x054, "_func_054" }, + { 0x055, "_func_055" }, + { 0x056, "_func_056" }, + { 0x057, "_func_057" }, + { 0x058, "_func_058" }, + { 0x059, "_func_059" }, + { 0x05A, "_func_05A" }, + { 0x05B, "_func_05B" }, + { 0x05C, "_func_05C" }, + { 0x05D, "_func_05D" }, + { 0x05E, "_func_05E" }, + { 0x05F, "_func_05F" }, + { 0x060, "_func_060" }, + { 0x061, "_func_061" }, + { 0x062, "_func_062" }, + { 0x063, "_func_063" }, + { 0x064, "_func_064" }, + { 0x065, "_func_065" }, + { 0x066, "_func_066" }, + { 0x067, "_func_067" }, + { 0x068, "_func_068" }, + { 0x069, "_func_069" }, + { 0x06A, "_func_06A" }, + { 0x06B, "_func_06B" }, + { 0x06C, "_func_06C" }, + { 0x06D, "_func_06D" }, + { 0x06E, "_func_06E" }, + { 0x06F, "_func_06F" }, + { 0x070, "_func_070" }, + { 0x071, "_func_071" }, + { 0x072, "_func_072" }, + { 0x073, "_func_073" }, + { 0x074, "_func_074" }, + { 0x075, "_func_075" }, + { 0x076, "_func_076" }, + { 0x077, "_func_077" }, + { 0x078, "_func_078" }, + { 0x079, "_func_079" }, + { 0x07A, "_func_07A" }, + { 0x07B, "_func_07B" }, + { 0x07C, "_func_07C" }, + { 0x07D, "_func_07D" }, + { 0x07E, "_func_07E" }, + { 0x07F, "_func_07F" }, + { 0x080, "_func_080" }, + { 0x081, "_func_081" }, + { 0x082, "_func_082" }, + { 0x083, "_func_083" }, + { 0x084, "_func_084" }, + { 0x085, "_func_085" }, + { 0x086, "_func_086" }, + { 0x087, "_func_087" }, + { 0x088, "_func_088" }, + { 0x089, "_func_089" }, + { 0x08A, "_func_08A" }, + { 0x08B, "_func_08B" }, + { 0x08C, "_func_08C" }, + { 0x08D, "_func_08D" }, + { 0x08E, "_func_08E" }, + { 0x08F, "_func_08F" }, + { 0x090, "_func_090" }, + { 0x091, "_func_091" }, + { 0x092, "_func_092" }, + { 0x093, "_func_093" }, + { 0x094, "_func_094" }, + { 0x095, "_func_095" }, + { 0x096, "_func_096" }, + { 0x097, "_func_097" }, + { 0x098, "_func_098" }, + { 0x099, "_func_099" }, + { 0x09A, "_func_09A" }, + { 0x09B, "_func_09B" }, + { 0x09C, "_func_09C" }, + { 0x09D, "_func_09D" }, + { 0x09E, "_func_09E" }, + { 0x09F, "_func_09F" }, + { 0x0A0, "_func_0A0" }, + { 0x0A1, "_func_0A1" }, + { 0x0A2, "_func_0A2" }, + { 0x0A3, "_func_0A3" }, + { 0x0A4, "_func_0A4" }, + { 0x0A5, "_func_0A5" }, + { 0x0A6, "_func_0A6" }, + { 0x0A7, "_func_0A7" }, + { 0x0A8, "_func_0A8" }, + { 0x0A9, "_func_0A9" }, + { 0x0AA, "_func_0AA" }, + { 0x0AB, "_func_0AB" }, + { 0x0AC, "_func_0AC" }, + { 0x0AD, "_func_0AD" }, + { 0x0AE, "_func_0AE" }, + { 0x0AF, "_func_0AF" }, + { 0x0B0, "_func_0B0" }, + { 0x0B1, "_func_0B1" }, + { 0x0B2, "_func_0B2" }, + { 0x0B3, "_func_0B3" }, + { 0x0B4, "_func_0B4" }, + { 0x0B5, "_func_0B5" }, + { 0x0B6, "_func_0B6" }, + { 0x0B7, "_func_0B7" }, + { 0x0B8, "_func_0B8" }, + { 0x0B9, "_func_0B9" }, + { 0x0BA, "_func_0BA" }, + { 0x0BB, "_func_0BB" }, + { 0x0BC, "_func_0BC" }, + { 0x0BD, "_func_0BD" }, + { 0x0BE, "_func_0BE" }, + { 0x0BF, "_func_0BF" }, + { 0x0C0, "_func_0C0" }, + { 0x0C1, "_func_0C1" }, + { 0x0C2, "_func_0C2" }, + { 0x0C3, "_func_0C3" }, + { 0x0C4, "_func_0C4" }, + { 0x0C5, "_func_0C5" }, + { 0x0C6, "_func_0C6" }, + { 0x0C7, "_func_0C7" }, + { 0x0C8, "_func_0C8" }, + { 0x0C9, "_func_0C9" }, + { 0x0CA, "_func_0CA" }, + { 0x0CB, "_func_0CB" }, + { 0x0CC, "_func_0CC" }, + { 0x0CD, "_func_0CD" }, + { 0x0CE, "_func_0CE" }, + { 0x0CF, "_func_0CF" }, + { 0x0D0, "_func_0D0" }, + { 0x0D1, "_func_0D1" }, + { 0x0D2, "_func_0D2" }, + { 0x0D3, "_func_0D3" }, + { 0x0D4, "_func_0D4" }, + { 0x0D5, "_func_0D5" }, + { 0x0D6, "_func_0D6" }, + { 0x0D7, "_func_0D7" }, + { 0x0D8, "_func_0D8" }, + { 0x0D9, "_func_0D9" }, + { 0x0DA, "_func_0DA" }, + { 0x0DB, "_func_0DB" }, + { 0x0DC, "_func_0DC" }, + { 0x0DD, "_func_0DD" }, + { 0x0DE, "_func_0DE" }, + { 0x0DF, "_func_0DF" }, + { 0x0E0, "_func_0E0" }, + { 0x0E1, "_func_0E1" }, + { 0x0E2, "_func_0E2" }, + { 0x0E3, "_func_0E3" }, + { 0x0E4, "_func_0E4" }, + { 0x0E5, "_func_0E5" }, + { 0x0E6, "_func_0E6" }, + { 0x0E7, "_func_0E7" }, + { 0x0E8, "_func_0E8" }, + { 0x0E9, "_func_0E9" }, + { 0x0EA, "_func_0EA" }, + { 0x0EB, "_func_0EB" }, + { 0x0EC, "_func_0EC" }, + { 0x0ED, "_func_0ED" }, + { 0x0EE, "_func_0EE" }, + { 0x0EF, "_func_0EF" }, + { 0x0F0, "_func_0F0" }, + { 0x0F1, "_func_0F1" }, + { 0x0F2, "_func_0F2" }, + { 0x0F3, "_func_0F3" }, + { 0x0F4, "_func_0F4" }, + { 0x0F5, "_func_0F5" }, + { 0x0F6, "_func_0F6" }, + { 0x0F7, "_func_0F7" }, + { 0x0F8, "_func_0F8" }, + { 0x0F9, "_func_0F9" }, + { 0x0FA, "_func_0FA" }, + { 0x0FB, "_func_0FB" }, + { 0x0FC, "_func_0FC" }, + { 0x0FD, "_func_0FD" }, + { 0x0FE, "_func_0FE" }, + { 0x0FF, "_func_0FF" }, + { 0x100, "_func_100" }, + { 0x101, "_func_101" }, + { 0x102, "_func_102" }, + { 0x103, "_func_103" }, + { 0x104, "_func_104" }, + { 0x105, "_func_105" }, + { 0x106, "_func_106" }, + { 0x107, "_func_107" }, + { 0x108, "_func_108" }, + { 0x109, "_func_109" }, + { 0x10A, "_func_10A" }, + { 0x10B, "_func_10B" }, + { 0x10C, "_func_10C" }, + { 0x10D, "_func_10D" }, + { 0x10E, "_func_10E" }, + { 0x10F, "_func_10F" }, + { 0x110, "_func_110" }, + { 0x111, "_func_111" }, + { 0x112, "_func_112" }, + { 0x113, "_func_113" }, + { 0x114, "_func_114" }, + { 0x115, "_func_115" }, + { 0x116, "_func_116" }, + { 0x117, "_func_117" }, + { 0x118, "_func_118" }, + { 0x119, "_func_119" }, + { 0x11A, "_func_11A" }, + { 0x11B, "_func_11B" }, + { 0x11C, "_func_11C" }, + { 0x11D, "_func_11D" }, + { 0x11E, "_func_11E" }, + { 0x11F, "_func_11F" }, + { 0x120, "_func_120" }, + { 0x121, "_func_121" }, + { 0x122, "_func_122" }, + { 0x123, "_func_123" }, + { 0x124, "_func_124" }, + { 0x125, "_func_125" }, + { 0x126, "_func_126" }, + { 0x127, "_func_127" }, + { 0x128, "_func_128" }, + { 0x129, "_func_129" }, + { 0x12A, "_func_12A" }, + { 0x12B, "_func_12B" }, + { 0x12C, "_func_12C" }, + { 0x12D, "_func_12D" }, + { 0x12E, "_func_12E" }, + { 0x12F, "_func_12F" }, + { 0x130, "_func_130" }, + { 0x131, "_func_131" }, + { 0x132, "_func_132" }, + { 0x133, "_func_133" }, + { 0x134, "_func_134" }, + { 0x135, "_func_135" }, + { 0x136, "_func_136" }, + { 0x137, "_func_137" }, + { 0x138, "_func_138" }, + { 0x139, "_func_139" }, + { 0x13A, "_func_13A" }, + { 0x13B, "_func_13B" }, + { 0x13C, "_func_13C" }, + { 0x13D, "_func_13D" }, + { 0x13E, "_func_13E" }, + { 0x13F, "_func_13F" }, + { 0x140, "_func_140" }, + { 0x141, "_func_141" }, + { 0x142, "_func_142" }, + { 0x143, "_func_143" }, + { 0x144, "_func_144" }, + { 0x145, "_func_145" }, + { 0x146, "_func_146" }, + { 0x147, "_func_147" }, + { 0x148, "_func_148" }, + { 0x149, "_func_149" }, + { 0x14A, "_func_14A" }, + { 0x14B, "_func_14B" }, + { 0x14C, "_func_14C" }, + { 0x14D, "_func_14D" }, + { 0x14E, "_func_14E" }, + { 0x14F, "_func_14F" }, + { 0x150, "_func_150" }, + { 0x151, "_func_151" }, + { 0x152, "_func_152" }, + { 0x153, "_func_153" }, + { 0x154, "_func_154" }, + { 0x155, "_func_155" }, + { 0x156, "_func_156" }, + { 0x157, "_func_157" }, + { 0x158, "_func_158" }, + { 0x159, "_func_159" }, + { 0x15A, "_func_15A" }, + { 0x15B, "_func_15B" }, + { 0x15C, "_func_15C" }, + { 0x15D, "_func_15D" }, + { 0x15E, "_func_15E" }, + { 0x15F, "_func_15F" }, + { 0x160, "_func_160" }, + { 0x161, "_func_161" }, + { 0x162, "_func_162" }, + { 0x163, "_func_163" }, + { 0x164, "_func_164" }, + { 0x165, "_func_165" }, + { 0x166, "_func_166" }, + { 0x167, "_func_167" }, + { 0x168, "_func_168" }, + { 0x169, "_func_169" }, + { 0x16A, "_func_16A" }, + { 0x16B, "_func_16B" }, + { 0x16C, "_func_16C" }, + { 0x16D, "_func_16D" }, + { 0x16E, "_func_16E" }, + { 0x16F, "_func_16F" }, + { 0x170, "_func_170" }, + { 0x171, "_func_171" }, + { 0x172, "_func_172" }, + { 0x173, "_func_173" }, + { 0x174, "_func_174" }, + { 0x175, "_func_175" }, + { 0x176, "_func_176" }, + { 0x177, "_func_177" }, + { 0x178, "_func_178" }, + { 0x179, "_func_179" }, + { 0x17A, "_func_17A" }, + { 0x17B, "_func_17B" }, + { 0x17C, "_func_17C" }, + { 0x17D, "_func_17D" }, + { 0x17E, "_func_17E" }, + { 0x17F, "_func_17F" }, + { 0x180, "_func_180" }, + { 0x181, "_func_181" }, + { 0x182, "_func_182" }, + { 0x183, "_func_183" }, + { 0x184, "_func_184" }, + { 0x185, "_func_185" }, + { 0x186, "_func_186" }, + { 0x187, "_func_187" }, + { 0x188, "_func_188" }, + { 0x189, "_func_189" }, + { 0x18A, "_func_18A" }, + { 0x18B, "_func_18B" }, + { 0x18C, "_func_18C" }, + { 0x18D, "_func_18D" }, + { 0x18E, "_func_18E" }, + { 0x18F, "_func_18F" }, + { 0x190, "_func_190" }, + { 0x191, "_func_191" }, + { 0x192, "_func_192" }, + { 0x193, "_func_193" }, + { 0x194, "_func_194" }, + { 0x195, "_func_195" }, + { 0x196, "_func_196" }, + { 0x197, "_func_197" }, + { 0x198, "_func_198" }, + { 0x199, "_func_199" }, + { 0x19A, "_func_19A" }, + { 0x19B, "_func_19B" }, + { 0x19C, "_func_19C" }, + { 0x19D, "_func_19D" }, + { 0x19E, "_func_19E" }, + { 0x19F, "_func_19F" }, + { 0x1A0, "_func_1A0" }, + { 0x1A1, "_func_1A1" }, + { 0x1A2, "_func_1A2" }, + { 0x1A3, "_func_1A3" }, + { 0x1A4, "_func_1A4" }, + { 0x1A5, "_func_1A5" }, + { 0x1A6, "_func_1A6" }, + { 0x1A7, "_func_1A7" }, + { 0x1A8, "_func_1A8" }, + { 0x1A9, "_func_1A9" }, + { 0x1AA, "_func_1AA" }, + { 0x1AB, "_func_1AB" }, + { 0x1AC, "_func_1AC" }, + { 0x1AD, "_func_1AD" }, + { 0x1AE, "_func_1AE" }, + { 0x1AF, "_func_1AF" }, + { 0x1B0, "_func_1B0" }, + { 0x1B1, "_func_1B1" }, + { 0x1B2, "_func_1B2" }, + { 0x1B3, "_func_1B3" }, + { 0x1B4, "_func_1B4" }, + { 0x1B5, "_func_1B5" }, + { 0x1B6, "_func_1B6" }, + { 0x1B7, "_func_1B7" }, + { 0x1B8, "_func_1B8" }, + { 0x1B9, "_func_1B9" }, + { 0x1BA, "_func_1BA" }, + { 0x1BB, "_func_1BB" }, + { 0x1BC, "_func_1BC" }, + { 0x1BD, "_func_1BD" }, + { 0x1BE, "_func_1BE" }, + { 0x1BF, "_func_1BF" }, + { 0x1C0, "_func_1C0" }, + { 0x1C1, "_func_1C1" }, + { 0x1C2, "_func_1C2" }, + { 0x1C3, "_func_1C3" }, + { 0x1C4, "_func_1C4" }, + { 0x1C5, "_func_1C5" }, + { 0x1C6, "_func_1C6" }, + { 0x1C7, "_func_1C7" }, + { 0x1C8, "_func_1C8" }, + { 0x1C9, "_func_1C9" }, + { 0x1CA, "_func_1CA" }, + { 0x1CB, "_func_1CB" }, + { 0x1CC, "_func_1CC" }, + { 0x1CD, "_func_1CD" }, + { 0x1CE, "_func_1CE" }, + { 0x1CF, "_func_1CF" }, + { 0x1D0, "_func_1D0" }, + { 0x1D1, "_func_1D1" }, + { 0x1D2, "_func_1D2" }, + { 0x1D3, "_func_1D3" }, + { 0x1D4, "_func_1D4" }, + { 0x1D5, "_func_1D5" }, + { 0x1D6, "_func_1D6" }, + { 0x1D7, "_func_1D7" }, + { 0x1D8, "_func_1D8" }, + { 0x1D9, "_func_1D9" }, + { 0x1DA, "_func_1DA" }, + { 0x1DB, "_func_1DB" }, + { 0x1DC, "_func_1DC" }, + { 0x1DD, "_func_1DD" }, + { 0x1DE, "_func_1DE" }, + { 0x1DF, "_func_1DF" }, + { 0x1E0, "_func_1E0" }, + { 0x1E1, "_func_1E1" }, + { 0x1E2, "_func_1E2" }, + { 0x1E3, "_func_1E3" }, + { 0x1E4, "_func_1E4" }, + { 0x1E5, "_func_1E5" }, + { 0x1E6, "_func_1E6" }, + { 0x1E7, "_func_1E7" }, + { 0x1E8, "_func_1E8" }, + { 0x1E9, "_func_1E9" }, + { 0x1EA, "_func_1EA" }, + { 0x1EB, "_func_1EB" }, + { 0x1EC, "_func_1EC" }, + { 0x1ED, "_func_1ED" }, + { 0x1EE, "_func_1EE" }, + { 0x1EF, "_func_1EF" }, + { 0x1F0, "_func_1F0" }, + { 0x1F1, "_func_1F1" }, + { 0x1F2, "_func_1F2" }, + { 0x1F3, "_func_1F3" }, + { 0x1F4, "_func_1F4" }, + { 0x1F5, "_func_1F5" }, + { 0x1F6, "_func_1F6" }, + { 0x1F7, "_func_1F7" }, + { 0x1F8, "_func_1F8" }, + { 0x1F9, "_func_1F9" }, + { 0x1FA, "_func_1FA" }, + { 0x1FB, "_func_1FB" }, + { 0x1FC, "_func_1FC" }, + { 0x1FD, "_func_1FD" }, + { 0x1FE, "_func_1FE" }, + { 0x1FF, "_func_1FF" }, + { 0x200, "_func_200" }, + { 0x201, "_func_201" }, + { 0x202, "_func_202" }, + { 0x203, "_func_203" }, + { 0x204, "_func_204" }, + { 0x205, "_func_205" }, + { 0x206, "_func_206" }, + { 0x207, "_func_207" }, + { 0x208, "_func_208" }, + { 0x209, "_func_209" }, + { 0x20A, "_func_20A" }, + { 0x20B, "_func_20B" }, + { 0x20C, "_func_20C" }, + { 0x20D, "_func_20D" }, + { 0x20E, "_func_20E" }, + { 0x20F, "_func_20F" }, + { 0x210, "_func_210" }, + { 0x211, "_func_211" }, + { 0x212, "_func_212" }, + { 0x213, "_func_213" }, + { 0x214, "_func_214" }, + { 0x215, "_func_215" }, + { 0x216, "_func_216" }, + { 0x217, "_func_217" }, + { 0x218, "_func_218" }, + { 0x219, "_func_219" }, + { 0x21A, "_func_21A" }, + { 0x21B, "_func_21B" }, + { 0x21C, "_func_21C" }, + { 0x21D, "_func_21D" }, + { 0x21E, "_func_21E" }, + { 0x21F, "_func_21F" }, + { 0x220, "_func_220" }, + { 0x221, "_func_221" }, + { 0x222, "_func_222" }, + { 0x223, "_func_223" }, + { 0x224, "_func_224" }, + { 0x225, "_func_225" }, + { 0x226, "_func_226" }, + { 0x227, "_func_227" }, + { 0x228, "_func_228" }, + { 0x229, "_func_229" }, + { 0x22A, "_func_22A" }, + { 0x22B, "_func_22B" }, + { 0x22C, "_func_22C" }, + { 0x22D, "_func_22D" }, + { 0x22E, "_func_22E" }, + { 0x22F, "_func_22F" }, + { 0x230, "_func_230" }, + { 0x231, "_func_231" }, + { 0x232, "_func_232" }, + { 0x233, "_func_233" }, + { 0x234, "_func_234" }, + { 0x235, "_func_235" }, + { 0x236, "_func_236" }, + { 0x237, "_func_237" }, + { 0x238, "_func_238" }, + { 0x239, "_func_239" }, + { 0x23A, "_func_23A" }, + { 0x23B, "_func_23B" }, + { 0x23C, "_func_23C" }, + { 0x23D, "_func_23D" }, + { 0x23E, "_func_23E" }, + { 0x23F, "_func_23F" }, + { 0x240, "_func_240" }, + { 0x241, "_func_241" }, + { 0x242, "_func_242" }, + { 0x243, "_func_243" }, + { 0x244, "_func_244" }, + { 0x245, "_func_245" }, + { 0x246, "_func_246" }, + { 0x247, "_func_247" }, + { 0x248, "_func_248" }, + { 0x249, "_func_249" }, + { 0x24A, "_func_24A" }, + { 0x24B, "_func_24B" }, + { 0x24C, "_func_24C" }, + { 0x24D, "_func_24D" }, + { 0x24E, "_func_24E" }, + { 0x24F, "_func_24F" }, + { 0x250, "_func_250" }, + { 0x251, "_func_251" }, + { 0x252, "_func_252" }, + { 0x253, "_func_253" }, + { 0x254, "_func_254" }, + { 0x255, "_func_255" }, + { 0x256, "_func_256" }, + { 0x257, "_func_257" }, + { 0x258, "_func_258" }, + { 0x259, "_func_259" }, + { 0x25A, "_func_25A" }, + { 0x25B, "_func_25B" }, + { 0x25C, "_func_25C" }, + { 0x25D, "_func_25D" }, + { 0x25E, "_func_25E" }, + { 0x25F, "_func_25F" }, + { 0x260, "_func_260" }, + { 0x261, "_func_261" }, + { 0x262, "_func_262" }, + { 0x263, "_func_263" }, + { 0x264, "_func_264" }, + { 0x265, "_func_265" }, + { 0x266, "_func_266" }, + { 0x267, "_func_267" }, + { 0x268, "_func_268" }, + { 0x269, "_func_269" }, + { 0x26A, "_func_26A" }, + { 0x26B, "_func_26B" }, + { 0x26C, "_func_26C" }, + { 0x26D, "_func_26D" }, + { 0x26E, "_func_26E" }, + { 0x26F, "_func_26F" }, + { 0x270, "_func_270" }, + { 0x271, "_func_271" }, + { 0x272, "_func_272" }, + { 0x273, "_func_273" }, + { 0x274, "_func_274" }, + { 0x275, "_func_275" }, + { 0x276, "_func_276" }, + { 0x277, "_func_277" }, + { 0x278, "_func_278" }, + { 0x279, "_func_279" }, + { 0x27A, "_func_27A" }, + { 0x27B, "_func_27B" }, + { 0x27C, "_func_27C" }, + { 0x27D, "_func_27D" }, + { 0x27E, "_func_27E" }, + { 0x27F, "_func_27F" }, + { 0x280, "_func_280" }, + { 0x281, "_func_281" }, + { 0x282, "_func_282" }, + { 0x283, "_func_283" }, + { 0x284, "_func_284" }, + { 0x285, "_func_285" }, + { 0x286, "_func_286" }, + { 0x287, "_func_287" }, + { 0x288, "_func_288" }, + { 0x289, "_func_289" }, + { 0x28A, "_func_28A" }, + { 0x28B, "_func_28B" }, + { 0x28C, "_func_28C" }, + { 0x28D, "_func_28D" }, + { 0x28E, "_func_28E" }, + { 0x28F, "_func_28F" }, + { 0x290, "_func_290" }, + { 0x291, "_func_291" }, + { 0x292, "_func_292" }, + { 0x293, "_func_293" }, + { 0x294, "_func_294" }, + { 0x295, "_func_295" }, + { 0x296, "_func_296" }, + { 0x297, "_func_297" }, + { 0x298, "_func_298" }, + { 0x299, "_func_299" }, + { 0x29A, "_func_29A" }, + { 0x29B, "_func_29B" }, + { 0x29C, "_func_29C" }, + { 0x29D, "_func_29D" }, + { 0x29E, "_func_29E" }, + { 0x29F, "_func_29F" }, + { 0x2A0, "_func_2A0" }, + { 0x2A1, "_func_2A1" }, + { 0x2A2, "_func_2A2" }, + { 0x2A3, "_func_2A3" }, + { 0x2A4, "_func_2A4" }, + { 0x2A5, "_func_2A5" }, + { 0x2A6, "_func_2A6" }, + { 0x2A7, "_func_2A7" }, + { 0x2A8, "_func_2A8" }, + { 0x2A9, "_func_2A9" }, + { 0x2AA, "_func_2AA" }, + { 0x2AB, "_func_2AB" }, + { 0x2AC, "_func_2AC" }, + { 0x2AD, "_func_2AD" }, + { 0x2AE, "_func_2AE" }, + { 0x2AF, "_func_2AF" }, + { 0x2B0, "_func_2B0" }, + { 0x2B1, "_func_2B1" }, + { 0x2B2, "_func_2B2" }, + { 0x2B3, "_func_2B3" }, + { 0x2B4, "_func_2B4" }, + { 0x2B5, "_func_2B5" }, + { 0x2B6, "_func_2B6" }, + { 0x2B7, "_func_2B7" }, + { 0x2B8, "_func_2B8" }, + { 0x2B9, "_func_2B9" }, + { 0x2BA, "_func_2BA" }, + { 0x2BB, "_func_2BB" }, + { 0x2BC, "_func_2BC" }, + { 0x2BD, "_func_2BD" }, + { 0x2BE, "_func_2BE" }, + { 0x2BF, "_func_2BF" }, + { 0x2C0, "_func_2C0" }, + { 0x2C1, "_func_2C1" }, + { 0x2C2, "_func_2C2" }, + { 0x2C3, "_func_2C3" }, + { 0x2C4, "_func_2C4" }, + { 0x2C5, "_func_2C5" }, + { 0x2C6, "_func_2C6" }, + { 0x2C7, "_func_2C7" }, + { 0x2C8, "_func_2C8" }, + { 0x2C9, "_func_2C9" }, + { 0x2CA, "_func_2CA" }, + { 0x2CB, "_func_2CB" }, + { 0x2CC, "_func_2CC" }, + { 0x2CD, "_func_2CD" }, + { 0x2CE, "_func_2CE" }, + { 0x2CF, "_func_2CF" }, + { 0x2D0, "_func_2D0" }, + { 0x2D1, "_func_2D1" }, + { 0x2D2, "_func_2D2" }, + { 0x2D3, "_func_2D3" }, + { 0x2D4, "_func_2D4" }, + { 0x2D5, "_func_2D5" }, + { 0x2D6, "_func_2D6" }, + { 0x2D7, "_func_2D7" }, + { 0x2D8, "_func_2D8" }, + { 0x2D9, "_func_2D9" }, + { 0x2DA, "_func_2DA" }, + { 0x2DB, "_func_2DB" }, + { 0x2DC, "_func_2DC" }, + { 0x2DD, "_func_2DD" }, + { 0x2DE, "_func_2DE" }, + { 0x2DF, "_func_2DF" }, + { 0x2E0, "_func_2E0" }, + { 0x2E1, "_func_2E1" }, + { 0x2E2, "_func_2E2" }, + { 0x2E3, "_func_2E3" }, + { 0x2E4, "_func_2E4" }, + { 0x2E5, "_func_2E5" }, + { 0x2E6, "_func_2E6" }, + { 0x2E7, "_func_2E7" }, + { 0x2E8, "_func_2E8" }, + { 0x2E9, "_func_2E9" }, + { 0x2EA, "_func_2EA" }, + { 0x2EB, "_func_2EB" }, + { 0x2EC, "_func_2EC" }, + { 0x2ED, "_func_2ED" }, + { 0x2EE, "_func_2EE" }, + { 0x2EF, "_func_2EF" }, + { 0x2F0, "_func_2F0" }, + { 0x2F1, "_func_2F1" }, + { 0x2F2, "_func_2F2" }, + { 0x2F3, "_func_2F3" }, + { 0x2F4, "_func_2F4" }, + { 0x2F5, "_func_2F5" }, + { 0x2F6, "_func_2F6" }, + { 0x2F7, "_func_2F7" }, + { 0x2F8, "_func_2F8" }, + { 0x2F9, "_func_2F9" }, + { 0x2FA, "_func_2FA" }, + { 0x2FB, "_func_2FB" }, + { 0x2FC, "_func_2FC" }, + { 0x2FD, "_func_2FD" }, + { 0x2FE, "_func_2FE" }, + { 0x2FF, "_func_2FF" }, + { 0x300, "_func_300" }, + { 0x301, "_func_301" }, + { 0x302, "_func_302" }, + { 0x303, "_func_303" }, + { 0x304, "_func_304" }, + { 0x305, "_func_305" }, + { 0x306, "_func_306" }, + { 0x307, "_func_307" }, + { 0x308, "_func_308" }, + { 0x309, "_func_309" }, + { 0x30A, "_func_30A" }, + { 0x30B, "_func_30B" }, + { 0x30C, "_func_30C" }, + { 0x30D, "_func_30D" }, + { 0x30E, "_func_30E" }, + { 0x30F, "_func_30F" }, + { 0x310, "_func_310" }, + { 0x311, "_func_311" }, + { 0x312, "_func_312" }, + { 0x313, "_func_313" }, + { 0x314, "_func_314" }, + { 0x315, "_func_315" }, + { 0x316, "_func_316" }, + { 0x317, "_func_317" }, + { 0x318, "_func_318" }, + { 0x319, "_func_319" }, + { 0x31A, "_func_31A" }, + { 0x31B, "_func_31B" }, + { 0x31C, "_func_31C" }, + { 0x31D, "_func_31D" }, + { 0x31E, "_func_31E" }, + { 0x31F, "_func_31F" }, + { 0x320, "_func_320" }, +}}; + +const std::array method_list +{{ + { 0x8000, "_meth_8000" }, + { 0x8001, "_meth_8001" }, + { 0x8002, "_meth_8002" }, + { 0x8003, "_meth_8003" }, + { 0x8004, "_meth_8004" }, + { 0x8005, "_meth_8005" }, + { 0x8006, "_meth_8006" }, + { 0x8007, "_meth_8007" }, + { 0x8008, "_meth_8008" }, + { 0x8009, "_meth_8009" }, + { 0x800A, "_meth_800A" }, + { 0x800B, "_meth_800B" }, + { 0x800C, "_meth_800C" }, + { 0x800D, "_meth_800D" }, + { 0x800E, "_meth_800E" }, + { 0x800F, "_meth_800F" }, + { 0x8010, "_meth_8010" }, + { 0x8011, "_meth_8011" }, + { 0x8012, "_meth_8012" }, + { 0x8013, "_meth_8013" }, + { 0x8014, "_meth_8014" }, + { 0x8015, "_meth_8015" }, + { 0x8016, "_meth_8016" }, + { 0x8017, "_meth_8017" }, + { 0x8018, "_meth_8018" }, + { 0x8019, "_meth_8019" }, + { 0x801A, "_meth_801A" }, + { 0x801B, "_meth_801B" }, + { 0x801C, "_meth_801C" }, + { 0x801D, "_meth_801D" }, + { 0x801E, "_meth_801E" }, + { 0x801F, "_meth_801F" }, + { 0x8020, "_meth_8020" }, + { 0x8021, "_meth_8021" }, + { 0x8022, "_meth_8022" }, + { 0x8023, "_meth_8023" }, + { 0x8024, "_meth_8024" }, + { 0x8025, "_meth_8025" }, + { 0x8026, "_meth_8026" }, + { 0x8027, "_meth_8027" }, + { 0x8028, "_meth_8028" }, + { 0x8029, "_meth_8029" }, + { 0x802A, "_meth_802A" }, + { 0x802B, "_meth_802B" }, + { 0x802C, "_meth_802C" }, + { 0x802D, "_meth_802D" }, + { 0x802E, "_meth_802E" }, + { 0x802F, "_meth_802F" }, + { 0x8030, "_meth_8030" }, + { 0x8031, "_meth_8031" }, + { 0x8032, "_meth_8032" }, + { 0x8033, "_meth_8033" }, + { 0x8034, "_meth_8034" }, + { 0x8035, "_meth_8035" }, + { 0x8036, "_meth_8036" }, + { 0x8037, "_meth_8037" }, + { 0x8038, "_meth_8038" }, + { 0x8039, "_meth_8039" }, + { 0x803A, "_meth_803A" }, + { 0x803B, "_meth_803B" }, + { 0x803C, "_meth_803C" }, + { 0x803D, "_meth_803D" }, + { 0x803E, "_meth_803E" }, + { 0x803F, "_meth_803F" }, + { 0x8040, "_meth_8040" }, + { 0x8041, "_meth_8041" }, + { 0x8042, "_meth_8042" }, + { 0x8043, "_meth_8043" }, + { 0x8044, "_meth_8044" }, + { 0x8045, "_meth_8045" }, + { 0x8046, "_meth_8046" }, + { 0x8047, "_meth_8047" }, + { 0x8048, "_meth_8048" }, + { 0x8049, "_meth_8049" }, + { 0x804A, "_meth_804A" }, + { 0x804B, "_meth_804B" }, + { 0x804C, "_meth_804C" }, + { 0x804D, "_meth_804D" }, + { 0x804E, "_meth_804E" }, + { 0x804F, "_meth_804F" }, + { 0x8050, "_meth_8050" }, + { 0x8051, "_meth_8051" }, + { 0x8052, "_meth_8052" }, + { 0x8053, "_meth_8053" }, + { 0x8054, "_meth_8054" }, + { 0x8055, "_meth_8055" }, + { 0x8056, "_meth_8056" }, + { 0x8057, "_meth_8057" }, + { 0x8058, "_meth_8058" }, + { 0x8059, "_meth_8059" }, + { 0x805A, "_meth_805A" }, + { 0x805B, "_meth_805B" }, + { 0x805C, "_meth_805C" }, + { 0x805D, "_meth_805D" }, + { 0x805E, "_meth_805E" }, + { 0x805F, "_meth_805F" }, + { 0x8060, "_meth_8060" }, + { 0x8061, "_meth_8061" }, + { 0x8062, "_meth_8062" }, + { 0x8063, "_meth_8063" }, + { 0x8064, "_meth_8064" }, + { 0x8065, "_meth_8065" }, + { 0x8066, "_meth_8066" }, + { 0x8067, "_meth_8067" }, + { 0x8068, "_meth_8068" }, + { 0x8069, "_meth_8069" }, + { 0x806A, "_meth_806A" }, + { 0x806B, "_meth_806B" }, + { 0x806C, "_meth_806C" }, + { 0x806D, "_meth_806D" }, + { 0x806E, "_meth_806E" }, + { 0x806F, "_meth_806F" }, + { 0x8070, "_meth_8070" }, + { 0x8071, "_meth_8071" }, + { 0x8072, "_meth_8072" }, + { 0x8073, "_meth_8073" }, + { 0x8074, "_meth_8074" }, + { 0x8075, "_meth_8075" }, + { 0x8076, "_meth_8076" }, + { 0x8077, "_meth_8077" }, + { 0x8078, "_meth_8078" }, + { 0x8079, "_meth_8079" }, + { 0x807A, "_meth_807A" }, + { 0x807B, "_meth_807B" }, + { 0x807C, "_meth_807C" }, + { 0x807D, "_meth_807D" }, + { 0x807E, "_meth_807E" }, + { 0x807F, "_meth_807F" }, + { 0x8080, "_meth_8080" }, + { 0x8081, "_meth_8081" }, + { 0x8082, "_meth_8082" }, + { 0x8083, "_meth_8083" }, + { 0x8084, "_meth_8084" }, + { 0x8085, "_meth_8085" }, + { 0x8086, "_meth_8086" }, + { 0x8087, "_meth_8087" }, + { 0x8088, "_meth_8088" }, + { 0x8089, "_meth_8089" }, + { 0x808A, "_meth_808A" }, + { 0x808B, "_meth_808B" }, + { 0x808C, "_meth_808C" }, + { 0x808D, "_meth_808D" }, + { 0x808E, "_meth_808E" }, + { 0x808F, "_meth_808F" }, + { 0x8090, "_meth_8090" }, + { 0x8091, "_meth_8091" }, + { 0x8092, "_meth_8092" }, + { 0x8093, "_meth_8093" }, + { 0x8094, "_meth_8094" }, + { 0x8095, "_meth_8095" }, + { 0x8096, "_meth_8096" }, + { 0x8097, "_meth_8097" }, + { 0x8098, "_meth_8098" }, + { 0x8099, "_meth_8099" }, + { 0x809A, "_meth_809A" }, + { 0x809B, "_meth_809B" }, + { 0x809C, "_meth_809C" }, + { 0x809D, "_meth_809D" }, + { 0x809E, "_meth_809E" }, + { 0x809F, "_meth_809F" }, + { 0x80A0, "_meth_80A0" }, + { 0x80A1, "_meth_80A1" }, + { 0x80A2, "_meth_80A2" }, + { 0x80A3, "_meth_80A3" }, + { 0x80A4, "_meth_80A4" }, + { 0x80A5, "_meth_80A5" }, + { 0x80A6, "_meth_80A6" }, + { 0x80A7, "_meth_80A7" }, + { 0x80A8, "_meth_80A8" }, + { 0x80A9, "_meth_80A9" }, + { 0x80AA, "_meth_80AA" }, + { 0x80AB, "_meth_80AB" }, + { 0x80AC, "_meth_80AC" }, + { 0x80AD, "_meth_80AD" }, + { 0x80AE, "_meth_80AE" }, + { 0x80AF, "_meth_80AF" }, + { 0x80B0, "_meth_80B0" }, + { 0x80B1, "_meth_80B1" }, + { 0x80B2, "_meth_80B2" }, + { 0x80B3, "_meth_80B3" }, + { 0x80B4, "_meth_80B4" }, + { 0x80B5, "_meth_80B5" }, + { 0x80B6, "_meth_80B6" }, + { 0x80B7, "_meth_80B7" }, + { 0x80B8, "_meth_80B8" }, + { 0x80B9, "_meth_80B9" }, + { 0x80BA, "_meth_80BA" }, + { 0x80BB, "_meth_80BB" }, + { 0x80BC, "_meth_80BC" }, + { 0x80BD, "_meth_80BD" }, + { 0x80BE, "_meth_80BE" }, + { 0x80BF, "_meth_80BF" }, + { 0x80C0, "_meth_80C0" }, + { 0x80C1, "_meth_80C1" }, + { 0x80C2, "_meth_80C2" }, + { 0x80C3, "_meth_80C3" }, + { 0x80C4, "_meth_80C4" }, + { 0x80C5, "_meth_80C5" }, + { 0x80C6, "_meth_80C6" }, + { 0x80C7, "_meth_80C7" }, + { 0x80C8, "_meth_80C8" }, + { 0x80C9, "_meth_80C9" }, + { 0x80CA, "_meth_80CA" }, + { 0x80CB, "_meth_80CB" }, + { 0x80CC, "_meth_80CC" }, + { 0x80CD, "_meth_80CD" }, + { 0x80CE, "_meth_80CE" }, + { 0x80CF, "_meth_80CF" }, + { 0x80D0, "_meth_80D0" }, + { 0x80D1, "_meth_80D1" }, + { 0x80D2, "_meth_80D2" }, + { 0x80D3, "_meth_80D3" }, + { 0x80D4, "_meth_80D4" }, + { 0x80D5, "_meth_80D5" }, + { 0x80D6, "_meth_80D6" }, + { 0x80D7, "_meth_80D7" }, + { 0x80D8, "_meth_80D8" }, + { 0x80D9, "_meth_80D9" }, + { 0x80DA, "_meth_80DA" }, + { 0x80DB, "_meth_80DB" }, + { 0x80DC, "_meth_80DC" }, + { 0x80DD, "_meth_80DD" }, + { 0x80DE, "_meth_80DE" }, + { 0x80DF, "_meth_80DF" }, + { 0x80E0, "_meth_80E0" }, + { 0x80E1, "_meth_80E1" }, + { 0x80E2, "_meth_80E2" }, + { 0x80E3, "_meth_80E3" }, + { 0x80E4, "_meth_80E4" }, + { 0x80E5, "_meth_80E5" }, + { 0x80E6, "_meth_80E6" }, + { 0x80E7, "_meth_80E7" }, + { 0x80E8, "_meth_80E8" }, + { 0x80E9, "_meth_80E9" }, + { 0x80EA, "_meth_80EA" }, + { 0x80EB, "_meth_80EB" }, + { 0x80EC, "_meth_80EC" }, + { 0x80ED, "_meth_80ED" }, + { 0x80EE, "_meth_80EE" }, + { 0x80EF, "_meth_80EF" }, + { 0x80F0, "_meth_80F0" }, + { 0x80F1, "_meth_80F1" }, + { 0x80F2, "_meth_80F2" }, + { 0x80F3, "_meth_80F3" }, + { 0x80F4, "_meth_80F4" }, + { 0x80F5, "_meth_80F5" }, + { 0x80F6, "_meth_80F6" }, + { 0x80F7, "_meth_80F7" }, + { 0x80F8, "_meth_80F8" }, + { 0x80F9, "_meth_80F9" }, + { 0x80FA, "_meth_80FA" }, + { 0x80FB, "_meth_80FB" }, + { 0x80FC, "_meth_80FC" }, + { 0x80FD, "_meth_80FD" }, + { 0x80FE, "_meth_80FE" }, + { 0x80FF, "_meth_80FF" }, + { 0x8100, "_meth_8100" }, + { 0x8101, "_meth_8101" }, + { 0x8102, "_meth_8102" }, + { 0x8103, "_meth_8103" }, + { 0x8104, "_meth_8104" }, + { 0x8105, "_meth_8105" }, + { 0x8106, "_meth_8106" }, + { 0x8107, "_meth_8107" }, + { 0x8108, "_meth_8108" }, + { 0x8109, "_meth_8109" }, + { 0x810A, "_meth_810A" }, + { 0x810B, "_meth_810B" }, + { 0x810C, "_meth_810C" }, + { 0x810D, "_meth_810D" }, + { 0x810E, "_meth_810E" }, + { 0x810F, "_meth_810F" }, + { 0x8110, "_meth_8110" }, + { 0x8111, "_meth_8111" }, + { 0x8112, "_meth_8112" }, + { 0x8113, "_meth_8113" }, + { 0x8114, "_meth_8114" }, + { 0x8115, "_meth_8115" }, + { 0x8116, "_meth_8116" }, + { 0x8117, "_meth_8117" }, + { 0x8118, "_meth_8118" }, + { 0x8119, "_meth_8119" }, + { 0x811A, "_meth_811A" }, + { 0x811B, "_meth_811B" }, + { 0x811C, "_meth_811C" }, + { 0x811D, "_meth_811D" }, + { 0x811E, "_meth_811E" }, + { 0x811F, "_meth_811F" }, + { 0x8120, "_meth_8120" }, + { 0x8121, "_meth_8121" }, + { 0x8122, "_meth_8122" }, + { 0x8123, "_meth_8123" }, + { 0x8124, "_meth_8124" }, + { 0x8125, "_meth_8125" }, + { 0x8126, "_meth_8126" }, + { 0x8127, "_meth_8127" }, + { 0x8128, "_meth_8128" }, + { 0x8129, "_meth_8129" }, + { 0x812A, "_meth_812A" }, + { 0x812B, "_meth_812B" }, + { 0x812C, "_meth_812C" }, + { 0x812D, "_meth_812D" }, + { 0x812E, "_meth_812E" }, + { 0x812F, "_meth_812F" }, + { 0x8130, "_meth_8130" }, + { 0x8131, "_meth_8131" }, + { 0x8132, "_meth_8132" }, + { 0x8133, "_meth_8133" }, + { 0x8134, "_meth_8134" }, + { 0x8135, "_meth_8135" }, + { 0x8136, "_meth_8136" }, + { 0x8137, "_meth_8137" }, + { 0x8138, "_meth_8138" }, + { 0x8139, "_meth_8139" }, + { 0x813A, "_meth_813A" }, + { 0x813B, "_meth_813B" }, + { 0x813C, "_meth_813C" }, + { 0x813D, "_meth_813D" }, + { 0x813E, "_meth_813E" }, + { 0x813F, "_meth_813F" }, + { 0x8140, "_meth_8140" }, + { 0x8141, "_meth_8141" }, + { 0x8142, "_meth_8142" }, + { 0x8143, "_meth_8143" }, + { 0x8144, "_meth_8144" }, + { 0x8145, "_meth_8145" }, + { 0x8146, "_meth_8146" }, + { 0x8147, "_meth_8147" }, + { 0x8148, "_meth_8148" }, + { 0x8149, "_meth_8149" }, + { 0x814A, "_meth_814A" }, + { 0x814B, "_meth_814B" }, + { 0x814C, "_meth_814C" }, + { 0x814D, "_meth_814D" }, + { 0x814E, "_meth_814E" }, + { 0x814F, "_meth_814F" }, + { 0x8150, "_meth_8150" }, + { 0x8151, "_meth_8151" }, + { 0x8152, "_meth_8152" }, + { 0x8153, "_meth_8153" }, + { 0x8154, "_meth_8154" }, + { 0x8155, "_meth_8155" }, + { 0x8156, "_meth_8156" }, + { 0x8157, "_meth_8157" }, + { 0x8158, "_meth_8158" }, + { 0x8159, "_meth_8159" }, + { 0x815A, "_meth_815A" }, + { 0x815B, "_meth_815B" }, + { 0x815C, "_meth_815C" }, + { 0x815D, "_meth_815D" }, + { 0x815E, "_meth_815E" }, + { 0x815F, "_meth_815F" }, + { 0x8160, "_meth_8160" }, + { 0x8161, "_meth_8161" }, + { 0x8162, "_meth_8162" }, + { 0x8163, "_meth_8163" }, + { 0x8164, "_meth_8164" }, + { 0x8165, "_meth_8165" }, + { 0x8166, "_meth_8166" }, + { 0x8167, "_meth_8167" }, + { 0x8168, "_meth_8168" }, + { 0x8169, "_meth_8169" }, + { 0x816A, "_meth_816A" }, + { 0x816B, "_meth_816B" }, + { 0x816C, "_meth_816C" }, + { 0x816D, "_meth_816D" }, + { 0x816E, "_meth_816E" }, + { 0x816F, "_meth_816F" }, + { 0x8170, "_meth_8170" }, + { 0x8171, "_meth_8171" }, + { 0x8172, "_meth_8172" }, + { 0x8173, "_meth_8173" }, + { 0x8174, "_meth_8174" }, + { 0x8175, "_meth_8175" }, + { 0x8176, "_meth_8176" }, + { 0x8177, "_meth_8177" }, + { 0x8178, "_meth_8178" }, + { 0x8179, "_meth_8179" }, + { 0x817A, "_meth_817A" }, + { 0x817B, "_meth_817B" }, + { 0x817C, "_meth_817C" }, + { 0x817D, "_meth_817D" }, + { 0x817E, "_meth_817E" }, + { 0x817F, "_meth_817F" }, + { 0x8180, "_meth_8180" }, + { 0x8181, "_meth_8181" }, + { 0x8182, "_meth_8182" }, + { 0x8183, "_meth_8183" }, + { 0x8184, "_meth_8184" }, + { 0x8185, "_meth_8185" }, + { 0x8186, "_meth_8186" }, + { 0x8187, "_meth_8187" }, + { 0x8188, "_meth_8188" }, + { 0x8189, "_meth_8189" }, + { 0x818A, "_meth_818A" }, + { 0x818B, "_meth_818B" }, + { 0x818C, "_meth_818C" }, + { 0x818D, "_meth_818D" }, + { 0x818E, "_meth_818E" }, + { 0x818F, "_meth_818F" }, + { 0x8190, "_meth_8190" }, + { 0x8191, "_meth_8191" }, + { 0x8192, "_meth_8192" }, + { 0x8193, "_meth_8193" }, + { 0x8194, "_meth_8194" }, + { 0x8195, "_meth_8195" }, + { 0x8196, "_meth_8196" }, + { 0x8197, "_meth_8197" }, + { 0x8198, "_meth_8198" }, + { 0x8199, "_meth_8199" }, + { 0x819A, "_meth_819A" }, + { 0x819B, "_meth_819B" }, + { 0x819C, "_meth_819C" }, + { 0x819D, "_meth_819D" }, + { 0x819E, "_meth_819E" }, + { 0x819F, "_meth_819F" }, + { 0x81A0, "_meth_81A0" }, + { 0x81A1, "_meth_81A1" }, + { 0x81A2, "_meth_81A2" }, + { 0x81A3, "_meth_81A3" }, + { 0x81A4, "_meth_81A4" }, + { 0x81A5, "_meth_81A5" }, + { 0x81A6, "_meth_81A6" }, + { 0x81A7, "_meth_81A7" }, + { 0x81A8, "_meth_81A8" }, + { 0x81A9, "_meth_81A9" }, + { 0x81AA, "_meth_81AA" }, + { 0x81AB, "_meth_81AB" }, + { 0x81AC, "_meth_81AC" }, + { 0x81AD, "_meth_81AD" }, + { 0x81AE, "_meth_81AE" }, + { 0x81AF, "_meth_81AF" }, + { 0x81B0, "_meth_81B0" }, + { 0x81B1, "_meth_81B1" }, + { 0x81B2, "_meth_81B2" }, + { 0x81B3, "_meth_81B3" }, + { 0x81B4, "_meth_81B4" }, + { 0x81B5, "_meth_81B5" }, + { 0x81B6, "_meth_81B6" }, + { 0x81B7, "_meth_81B7" }, + { 0x81B8, "_meth_81B8" }, + { 0x81B9, "_meth_81B9" }, + { 0x81BA, "_meth_81BA" }, + { 0x81BB, "_meth_81BB" }, + { 0x81BC, "_meth_81BC" }, + { 0x81BD, "_meth_81BD" }, + { 0x81BE, "_meth_81BE" }, + { 0x81BF, "_meth_81BF" }, + { 0x81C0, "_meth_81C0" }, + { 0x81C1, "_meth_81C1" }, + { 0x81C2, "_meth_81C2" }, + { 0x81C3, "_meth_81C3" }, + { 0x81C4, "_meth_81C4" }, + { 0x81C5, "_meth_81C5" }, + { 0x81C6, "_meth_81C6" }, + { 0x81C7, "_meth_81C7" }, + { 0x81C8, "_meth_81C8" }, + { 0x81C9, "_meth_81C9" }, + { 0x81CA, "_meth_81CA" }, + { 0x81CB, "_meth_81CB" }, + { 0x81CC, "_meth_81CC" }, + { 0x81CD, "_meth_81CD" }, + { 0x81CE, "_meth_81CE" }, + { 0x81CF, "_meth_81CF" }, + { 0x81D0, "_meth_81D0" }, + { 0x81D1, "_meth_81D1" }, + { 0x81D2, "_meth_81D2" }, + { 0x81D3, "_meth_81D3" }, + { 0x81D4, "_meth_81D4" }, + { 0x81D5, "_meth_81D5" }, + { 0x81D6, "_meth_81D6" }, + { 0x81D7, "_meth_81D7" }, + { 0x81D8, "_meth_81D8" }, + { 0x81D9, "_meth_81D9" }, + { 0x81DA, "_meth_81DA" }, + { 0x81DB, "_meth_81DB" }, + { 0x81DC, "_meth_81DC" }, + { 0x81DD, "_meth_81DD" }, + { 0x81DE, "_meth_81DE" }, + { 0x81DF, "_meth_81DF" }, + { 0x81E0, "_meth_81E0" }, + { 0x81E1, "_meth_81E1" }, + { 0x81E2, "_meth_81E2" }, + { 0x81E3, "_meth_81E3" }, + { 0x81E4, "_meth_81E4" }, + { 0x81E5, "_meth_81E5" }, + { 0x81E6, "_meth_81E6" }, + { 0x81E7, "_meth_81E7" }, + { 0x81E8, "_meth_81E8" }, + { 0x81E9, "_meth_81E9" }, + { 0x81EA, "_meth_81EA" }, + { 0x81EB, "_meth_81EB" }, + { 0x81EC, "_meth_81EC" }, + { 0x81ED, "_meth_81ED" }, + { 0x81EE, "_meth_81EE" }, + { 0x81EF, "_meth_81EF" }, + { 0x81F0, "_meth_81F0" }, + { 0x81F1, "_meth_81F1" }, + { 0x81F2, "_meth_81F2" }, + { 0x81F3, "_meth_81F3" }, + { 0x81F4, "_meth_81F4" }, + { 0x81F5, "_meth_81F5" }, + { 0x81F6, "_meth_81F6" }, + { 0x81F7, "_meth_81F7" }, + { 0x81F8, "_meth_81F8" }, + { 0x81F9, "_meth_81F9" }, + { 0x81FA, "_meth_81FA" }, + { 0x81FB, "_meth_81FB" }, + { 0x81FC, "_meth_81FC" }, + { 0x81FD, "_meth_81FD" }, + { 0x81FE, "_meth_81FE" }, + { 0x81FF, "_meth_81FF" }, + { 0x8200, "_meth_8200" }, + { 0x8201, "_meth_8201" }, + { 0x8202, "_meth_8202" }, + { 0x8203, "_meth_8203" }, + { 0x8204, "_meth_8204" }, + { 0x8205, "_meth_8205" }, + { 0x8206, "_meth_8206" }, + { 0x8207, "_meth_8207" }, + { 0x8208, "_meth_8208" }, + { 0x8209, "_meth_8209" }, + { 0x820A, "_meth_820A" }, + { 0x820B, "_meth_820B" }, + { 0x820C, "_meth_820C" }, + { 0x820D, "_meth_820D" }, + { 0x820E, "_meth_820E" }, + { 0x820F, "_meth_820F" }, + { 0x8210, "_meth_8210" }, + { 0x8211, "_meth_8211" }, + { 0x8212, "_meth_8212" }, + { 0x8213, "_meth_8213" }, + { 0x8214, "_meth_8214" }, + { 0x8215, "_meth_8215" }, + { 0x8216, "_meth_8216" }, + { 0x8217, "_meth_8217" }, + { 0x8218, "_meth_8218" }, + { 0x8219, "_meth_8219" }, + { 0x821A, "_meth_821A" }, + { 0x821B, "_meth_821B" }, + { 0x821C, "_meth_821C" }, + { 0x821D, "_meth_821D" }, + { 0x821E, "_meth_821E" }, + { 0x821F, "_meth_821F" }, + { 0x8220, "_meth_8220" }, + { 0x8221, "_meth_8221" }, + { 0x8222, "_meth_8222" }, + { 0x8223, "_meth_8223" }, + { 0x8224, "_meth_8224" }, + { 0x8225, "_meth_8225" }, + { 0x8226, "_meth_8226" }, + { 0x8227, "_meth_8227" }, + { 0x8228, "_meth_8228" }, + { 0x8229, "_meth_8229" }, + { 0x822A, "_meth_822A" }, + { 0x822B, "_meth_822B" }, + { 0x822C, "_meth_822C" }, + { 0x822D, "_meth_822D" }, + { 0x822E, "_meth_822E" }, + { 0x822F, "_meth_822F" }, + { 0x8230, "_meth_8230" }, + { 0x8231, "_meth_8231" }, + { 0x8232, "_meth_8232" }, + { 0x8233, "_meth_8233" }, + { 0x8234, "_meth_8234" }, + { 0x8235, "_meth_8235" }, + { 0x8236, "_meth_8236" }, + { 0x8237, "_meth_8237" }, + { 0x8238, "_meth_8238" }, + { 0x8239, "_meth_8239" }, + { 0x823A, "_meth_823A" }, + { 0x823B, "_meth_823B" }, + { 0x823C, "_meth_823C" }, + { 0x823D, "_meth_823D" }, + { 0x823E, "_meth_823E" }, + { 0x823F, "_meth_823F" }, + { 0x8240, "_meth_8240" }, + { 0x8241, "_meth_8241" }, + { 0x8242, "_meth_8242" }, + { 0x8243, "_meth_8243" }, + { 0x8244, "_meth_8244" }, + { 0x8245, "_meth_8245" }, + { 0x8246, "_meth_8246" }, + { 0x8247, "_meth_8247" }, + { 0x8248, "_meth_8248" }, + { 0x8249, "_meth_8249" }, + { 0x824A, "_meth_824A" }, + { 0x824B, "_meth_824B" }, + { 0x824C, "_meth_824C" }, + { 0x824D, "_meth_824D" }, + { 0x824E, "_meth_824E" }, + { 0x824F, "_meth_824F" }, + { 0x8250, "_meth_8250" }, + { 0x8251, "_meth_8251" }, + { 0x8252, "_meth_8252" }, + { 0x8253, "_meth_8253" }, + { 0x8254, "_meth_8254" }, + { 0x8255, "_meth_8255" }, + { 0x8256, "_meth_8256" }, + { 0x8257, "_meth_8257" }, + { 0x8258, "_meth_8258" }, + { 0x8259, "_meth_8259" }, + { 0x825A, "_meth_825A" }, + { 0x825B, "_meth_825B" }, + { 0x825C, "_meth_825C" }, + { 0x825D, "_meth_825D" }, + { 0x825E, "_meth_825E" }, + { 0x825F, "_meth_825F" }, + { 0x8260, "_meth_8260" }, + { 0x8261, "_meth_8261" }, + { 0x8262, "_meth_8262" }, + { 0x8263, "_meth_8263" }, + { 0x8264, "_meth_8264" }, + { 0x8265, "_meth_8265" }, + { 0x8266, "_meth_8266" }, + { 0x8267, "_meth_8267" }, + { 0x8268, "_meth_8268" }, + { 0x8269, "_meth_8269" }, + { 0x826A, "_meth_826A" }, + { 0x826B, "_meth_826B" }, + { 0x826C, "_meth_826C" }, + { 0x826D, "_meth_826D" }, + { 0x826E, "_meth_826E" }, + { 0x826F, "_meth_826F" }, + { 0x8270, "_meth_8270" }, + { 0x8271, "_meth_8271" }, + { 0x8272, "_meth_8272" }, + { 0x8273, "_meth_8273" }, + { 0x8274, "_meth_8274" }, + { 0x8275, "_meth_8275" }, + { 0x8276, "_meth_8276" }, + { 0x8277, "_meth_8277" }, + { 0x8278, "_meth_8278" }, + { 0x8279, "_meth_8279" }, + { 0x827A, "_meth_827A" }, + { 0x827B, "_meth_827B" }, + { 0x827C, "_meth_827C" }, + { 0x827D, "_meth_827D" }, + { 0x827E, "_meth_827E" }, + { 0x827F, "_meth_827F" }, + { 0x8280, "_meth_8280" }, + { 0x8281, "_meth_8281" }, + { 0x8282, "_meth_8282" }, + { 0x8283, "_meth_8283" }, + { 0x8284, "_meth_8284" }, + { 0x8285, "_meth_8285" }, + { 0x8286, "_meth_8286" }, + { 0x8287, "_meth_8287" }, + { 0x8288, "_meth_8288" }, + { 0x8289, "_meth_8289" }, + { 0x828A, "_meth_828A" }, + { 0x828B, "_meth_828B" }, + { 0x828C, "_meth_828C" }, + { 0x828D, "_meth_828D" }, + { 0x828E, "_meth_828E" }, + { 0x828F, "_meth_828F" }, + { 0x8290, "_meth_8290" }, + { 0x8291, "_meth_8291" }, + { 0x8292, "_meth_8292" }, + { 0x8293, "_meth_8293" }, + { 0x8294, "_meth_8294" }, + { 0x8295, "_meth_8295" }, + { 0x8296, "_meth_8296" }, + { 0x8297, "_meth_8297" }, + { 0x8298, "_meth_8298" }, + { 0x8299, "_meth_8299" }, + { 0x829A, "_meth_829A" }, + { 0x829B, "_meth_829B" }, + { 0x829C, "_meth_829C" }, + { 0x829D, "_meth_829D" }, + { 0x829E, "_meth_829E" }, + { 0x829F, "_meth_829F" }, + { 0x82A0, "_meth_82A0" }, + { 0x82A1, "_meth_82A1" }, + { 0x82A2, "_meth_82A2" }, + { 0x82A3, "_meth_82A3" }, + { 0x82A4, "_meth_82A4" }, + { 0x82A5, "_meth_82A5" }, + { 0x82A6, "_meth_82A6" }, + { 0x82A7, "_meth_82A7" }, + { 0x82A8, "_meth_82A8" }, + { 0x82A9, "_meth_82A9" }, + { 0x82AA, "_meth_82AA" }, + { 0x82AB, "_meth_82AB" }, + { 0x82AC, "_meth_82AC" }, + { 0x82AD, "_meth_82AD" }, + { 0x82AE, "_meth_82AE" }, + { 0x82AF, "_meth_82AF" }, + { 0x82B0, "_meth_82B0" }, + { 0x82B1, "_meth_82B1" }, + { 0x82B2, "_meth_82B2" }, + { 0x82B3, "_meth_82B3" }, + { 0x82B4, "_meth_82B4" }, + { 0x82B5, "_meth_82B5" }, + { 0x82B6, "_meth_82B6" }, + { 0x82B7, "_meth_82B7" }, + { 0x82B8, "_meth_82B8" }, + { 0x82B9, "_meth_82B9" }, + { 0x82BA, "_meth_82BA" }, + { 0x82BB, "_meth_82BB" }, + { 0x82BC, "_meth_82BC" }, + { 0x82BD, "_meth_82BD" }, + { 0x82BE, "_meth_82BE" }, + { 0x82BF, "_meth_82BF" }, + { 0x82C0, "_meth_82C0" }, + { 0x82C1, "_meth_82C1" }, + { 0x82C2, "_meth_82C2" }, + { 0x82C3, "_meth_82C3" }, + { 0x82C4, "_meth_82C4" }, + { 0x82C5, "_meth_82C5" }, + { 0x82C6, "_meth_82C6" }, + { 0x82C7, "_meth_82C7" }, + { 0x82C8, "_meth_82C8" }, + { 0x82C9, "_meth_82C9" }, + { 0x82CA, "_meth_82CA" }, + { 0x82CB, "_meth_82CB" }, + { 0x82CC, "_meth_82CC" }, + { 0x82CD, "_meth_82CD" }, + { 0x82CE, "_meth_82CE" }, + { 0x82CF, "_meth_82CF" }, + { 0x82D0, "_meth_82D0" }, + { 0x82D1, "_meth_82D1" }, + { 0x82D2, "_meth_82D2" }, + { 0x82D3, "_meth_82D3" }, + { 0x82D4, "_meth_82D4" }, + { 0x82D5, "_meth_82D5" }, + { 0x82D6, "_meth_82D6" }, + { 0x82D7, "_meth_82D7" }, + { 0x82D8, "_meth_82D8" }, + { 0x82D9, "_meth_82D9" }, + { 0x82DA, "_meth_82DA" }, + { 0x82DB, "_meth_82DB" }, + { 0x82DC, "_meth_82DC" }, + { 0x82DD, "_meth_82DD" }, + { 0x82DE, "_meth_82DE" }, + { 0x82DF, "_meth_82DF" }, + { 0x82E0, "_meth_82E0" }, + { 0x82E1, "_meth_82E1" }, + { 0x82E2, "_meth_82E2" }, + { 0x82E3, "_meth_82E3" }, + { 0x82E4, "_meth_82E4" }, + { 0x82E5, "_meth_82E5" }, + { 0x82E6, "_meth_82E6" }, + { 0x82E7, "_meth_82E7" }, + { 0x82E8, "_meth_82E8" }, + { 0x82E9, "_meth_82E9" }, + { 0x82EA, "_meth_82EA" }, + { 0x82EB, "_meth_82EB" }, + { 0x82EC, "_meth_82EC" }, + { 0x82ED, "_meth_82ED" }, + { 0x82EE, "_meth_82EE" }, + { 0x82EF, "_meth_82EF" }, + { 0x82F0, "_meth_82F0" }, + { 0x82F1, "_meth_82F1" }, + { 0x82F2, "_meth_82F2" }, + { 0x82F3, "_meth_82F3" }, + { 0x82F4, "_meth_82F4" }, + { 0x82F5, "_meth_82F5" }, + { 0x82F6, "_meth_82F6" }, + { 0x82F7, "_meth_82F7" }, + { 0x82F8, "_meth_82F8" }, + { 0x82F9, "_meth_82F9" }, + { 0x82FA, "_meth_82FA" }, + { 0x82FB, "_meth_82FB" }, + { 0x82FC, "_meth_82FC" }, + { 0x82FD, "_meth_82FD" }, + { 0x82FE, "_meth_82FE" }, + { 0x82FF, "_meth_82FF" }, + { 0x8300, "_meth_8300" }, + { 0x8301, "_meth_8301" }, + { 0x8302, "_meth_8302" }, + { 0x8303, "_meth_8303" }, + { 0x8304, "_meth_8304" }, + { 0x8305, "_meth_8305" }, + { 0x8306, "_meth_8306" }, + { 0x8307, "_meth_8307" }, + { 0x8308, "_meth_8308" }, + { 0x8309, "_meth_8309" }, + { 0x830A, "_meth_830A" }, + { 0x830B, "_meth_830B" }, + { 0x830C, "_meth_830C" }, + { 0x830D, "_meth_830D" }, + { 0x830E, "_meth_830E" }, + { 0x830F, "_meth_830F" }, + { 0x8310, "_meth_8310" }, + { 0x8311, "_meth_8311" }, + { 0x8312, "_meth_8312" }, + { 0x8313, "_meth_8313" }, + { 0x8314, "_meth_8314" }, + { 0x8315, "_meth_8315" }, + { 0x8316, "_meth_8316" }, + { 0x8317, "_meth_8317" }, + { 0x8318, "_meth_8318" }, + { 0x8319, "_meth_8319" }, + { 0x831A, "_meth_831A" }, + { 0x831B, "_meth_831B" }, + { 0x831C, "_meth_831C" }, + { 0x831D, "_meth_831D" }, + { 0x831E, "_meth_831E" }, + { 0x831F, "_meth_831F" }, + { 0x8320, "_meth_8320" }, + { 0x8321, "_meth_8321" }, + { 0x8322, "_meth_8322" }, + { 0x8323, "_meth_8323" }, + { 0x8324, "_meth_8324" }, + { 0x8325, "_meth_8325" }, + { 0x8326, "_meth_8326" }, + { 0x8327, "_meth_8327" }, + { 0x8328, "_meth_8328" }, + { 0x8329, "_meth_8329" }, + { 0x832A, "_meth_832A" }, + { 0x832B, "_meth_832B" }, + { 0x832C, "_meth_832C" }, + { 0x832D, "_meth_832D" }, + { 0x832E, "_meth_832E" }, + { 0x832F, "_meth_832F" }, + { 0x8330, "_meth_8330" }, + { 0x8331, "_meth_8331" }, + { 0x8332, "_meth_8332" }, + { 0x8333, "_meth_8333" }, + { 0x8334, "_meth_8334" }, + { 0x8335, "_meth_8335" }, + { 0x8336, "_meth_8336" }, + { 0x8337, "_meth_8337" }, + { 0x8338, "_meth_8338" }, + { 0x8339, "_meth_8339" }, + { 0x833A, "_meth_833A" }, + { 0x833B, "_meth_833B" }, + { 0x833C, "_meth_833C" }, + { 0x833D, "_meth_833D" }, + { 0x833E, "_meth_833E" }, + { 0x833F, "_meth_833F" }, + { 0x8340, "_meth_8340" }, + { 0x8341, "_meth_8341" }, + { 0x8342, "_meth_8342" }, + { 0x8343, "_meth_8343" }, + { 0x8344, "_meth_8344" }, + { 0x8345, "_meth_8345" }, + { 0x8346, "_meth_8346" }, + { 0x8347, "_meth_8347" }, + { 0x8348, "_meth_8348" }, + { 0x8349, "_meth_8349" }, + { 0x834A, "_meth_834A" }, + { 0x834B, "_meth_834B" }, + { 0x834C, "_meth_834C" }, + { 0x834D, "_meth_834D" }, + { 0x834E, "_meth_834E" }, + { 0x834F, "_meth_834F" }, + { 0x8350, "_meth_8350" }, + { 0x8351, "_meth_8351" }, + { 0x8352, "_meth_8352" }, + { 0x8353, "_meth_8353" }, + { 0x8354, "_meth_8354" }, + { 0x8355, "_meth_8355" }, + { 0x8356, "_meth_8356" }, + { 0x8357, "_meth_8357" }, + { 0x8358, "_meth_8358" }, + { 0x8359, "_meth_8359" }, + { 0x835A, "_meth_835A" }, + { 0x835B, "_meth_835B" }, + { 0x835C, "_meth_835C" }, + { 0x835D, "_meth_835D" }, + { 0x835E, "_meth_835E" }, + { 0x835F, "_meth_835F" }, + { 0x8360, "_meth_8360" }, + { 0x8361, "_meth_8361" }, + { 0x8362, "_meth_8362" }, + { 0x8363, "_meth_8363" }, + { 0x8364, "_meth_8364" }, + { 0x8365, "_meth_8365" }, + { 0x8366, "_meth_8366" }, + { 0x8367, "_meth_8367" }, + { 0x8368, "_meth_8368" }, + { 0x8369, "_meth_8369" }, + { 0x836A, "_meth_836A" }, + { 0x836B, "_meth_836B" }, + { 0x836C, "_meth_836C" }, + { 0x836D, "_meth_836D" }, + { 0x836E, "_meth_836E" }, + { 0x836F, "_meth_836F" }, + { 0x8370, "_meth_8370" }, + { 0x8371, "_meth_8371" }, + { 0x8372, "_meth_8372" }, + { 0x8373, "_meth_8373" }, + { 0x8374, "_meth_8374" }, + { 0x8375, "_meth_8375" }, + { 0x8376, "_meth_8376" }, + { 0x8377, "_meth_8377" }, + { 0x8378, "_meth_8378" }, + { 0x8379, "_meth_8379" }, + { 0x837A, "_meth_837A" }, + { 0x837B, "_meth_837B" }, + { 0x837C, "_meth_837C" }, + { 0x837D, "_meth_837D" }, + { 0x837E, "_meth_837E" }, + { 0x837F, "_meth_837F" }, + { 0x8380, "_meth_8380" }, + { 0x8381, "_meth_8381" }, + { 0x8382, "_meth_8382" }, + { 0x8383, "_meth_8383" }, + { 0x8384, "_meth_8384" }, + { 0x8385, "_meth_8385" }, + { 0x8386, "_meth_8386" }, + { 0x8387, "_meth_8387" }, + { 0x8388, "_meth_8388" }, + { 0x8389, "_meth_8389" }, + { 0x838A, "_meth_838A" }, + { 0x838B, "_meth_838B" }, + { 0x838C, "_meth_838C" }, + { 0x838D, "_meth_838D" }, + { 0x838E, "_meth_838E" }, + { 0x838F, "_meth_838F" }, + { 0x8390, "_meth_8390" }, + { 0x8391, "_meth_8391" }, + { 0x8392, "_meth_8392" }, + { 0x8393, "_meth_8393" }, + { 0x8394, "_meth_8394" }, + { 0x8395, "_meth_8395" }, + { 0x8396, "_meth_8396" }, + { 0x8397, "_meth_8397" }, + { 0x8398, "_meth_8398" }, + { 0x8399, "_meth_8399" }, + { 0x839A, "_meth_839A" }, + { 0x839B, "_meth_839B" }, + { 0x839C, "_meth_839C" }, + { 0x839D, "_meth_839D" }, + { 0x839E, "_meth_839E" }, + { 0x839F, "_meth_839F" }, + { 0x83A0, "_meth_83A0" }, + { 0x83A1, "_meth_83A1" }, + { 0x83A2, "_meth_83A2" }, + { 0x83A3, "_meth_83A3" }, + { 0x83A4, "_meth_83A4" }, + { 0x83A5, "_meth_83A5" }, + { 0x83A6, "_meth_83A6" }, + { 0x83A7, "_meth_83A7" }, + { 0x83A8, "_meth_83A8" }, + { 0x83A9, "_meth_83A9" }, + { 0x83AA, "_meth_83AA" }, + { 0x83AB, "_meth_83AB" }, + { 0x83AC, "_meth_83AC" }, + { 0x83AD, "_meth_83AD" }, + { 0x83AE, "_meth_83AE" }, + { 0x83AF, "_meth_83AF" }, + { 0x83B0, "_meth_83B0" }, + { 0x83B1, "_meth_83B1" }, + { 0x83B2, "_meth_83B2" }, + { 0x83B3, "_meth_83B3" }, + { 0x83B4, "_meth_83B4" }, + { 0x83B5, "_meth_83B5" }, + { 0x83B6, "_meth_83B6" }, + { 0x83B7, "_meth_83B7" }, + { 0x83B8, "_meth_83B8" }, + { 0x83B9, "_meth_83B9" }, + { 0x83BA, "_meth_83BA" }, + { 0x83BB, "_meth_83BB" }, + { 0x83BC, "_meth_83BC" }, + { 0x83BD, "_meth_83BD" }, + { 0x83BE, "_meth_83BE" }, + { 0x83BF, "_meth_83BF" }, + { 0x83C0, "_meth_83C0" }, + { 0x83C1, "_meth_83C1" }, + { 0x83C2, "_meth_83C2" }, + { 0x83C3, "_meth_83C3" }, + { 0x83C4, "_meth_83C4" }, + { 0x83C5, "_meth_83C5" }, + { 0x83C6, "_meth_83C6" }, + { 0x83C7, "_meth_83C7" }, + { 0x83C8, "_meth_83C8" }, + { 0x83C9, "_meth_83C9" }, + { 0x83CA, "_meth_83CA" }, + { 0x83CB, "_meth_83CB" }, + { 0x83CC, "_meth_83CC" }, + { 0x83CD, "_meth_83CD" }, + { 0x83CE, "_meth_83CE" }, + { 0x83CF, "_meth_83CF" }, + { 0x83D0, "_meth_83D0" }, + { 0x83D1, "_meth_83D1" }, + { 0x83D2, "_meth_83D2" }, + { 0x83D3, "_meth_83D3" }, + { 0x83D4, "_meth_83D4" }, + { 0x83D5, "_meth_83D5" }, + { 0x83D6, "_meth_83D6" }, + { 0x83D7, "_meth_83D7" }, + { 0x83D8, "_meth_83D8" }, + { 0x83D9, "_meth_83D9" }, + { 0x83DA, "_meth_83DA" }, + { 0x83DB, "_meth_83DB" }, + { 0x83DC, "_meth_83DC" }, + { 0x83DD, "_meth_83DD" }, + { 0x83DE, "_meth_83DE" }, + { 0x83DF, "_meth_83DF" }, + { 0x83E0, "_meth_83E0" }, + { 0x83E1, "_meth_83E1" }, + { 0x83E2, "_meth_83E2" }, + { 0x83E3, "_meth_83E3" }, + { 0x83E4, "_meth_83E4" }, + { 0x83E5, "_meth_83E5" }, + { 0x83E6, "_meth_83E6" }, + { 0x83E7, "_meth_83E7" }, + { 0x83E8, "_meth_83E8" }, + { 0x83E9, "_meth_83E9" }, + { 0x83EA, "_meth_83EA" }, + { 0x83EB, "_meth_83EB" }, + { 0x83EC, "_meth_83EC" }, + { 0x83ED, "_meth_83ED" }, + { 0x83EE, "_meth_83EE" }, + { 0x83EF, "_meth_83EF" }, + { 0x83F0, "_meth_83F0" }, + { 0x83F1, "_meth_83F1" }, + { 0x83F2, "_meth_83F2" }, + { 0x83F3, "_meth_83F3" }, + { 0x83F4, "_meth_83F4" }, + { 0x83F5, "_meth_83F5" }, + { 0x83F6, "_meth_83F6" }, + { 0x83F7, "_meth_83F7" }, + { 0x83F8, "_meth_83F8" }, + { 0x83F9, "_meth_83F9" }, + { 0x83FA, "_meth_83FA" }, + { 0x83FB, "_meth_83FB" }, + { 0x83FC, "_meth_83FC" }, + { 0x83FD, "_meth_83FD" }, + { 0x83FE, "_meth_83FE" }, + { 0x83FF, "_meth_83FF" }, + { 0x8400, "_meth_8400" }, + { 0x8401, "_meth_8401" }, + { 0x8402, "_meth_8402" }, + { 0x8403, "_meth_8403" }, + { 0x8404, "_meth_8404" }, + { 0x8405, "_meth_8405" }, + { 0x8406, "_meth_8406" }, + { 0x8407, "_meth_8407" }, + { 0x8408, "_meth_8408" }, + { 0x8409, "_meth_8409" }, + { 0x840A, "_meth_840A" }, + { 0x840B, "_meth_840B" }, + { 0x840C, "_meth_840C" }, + { 0x840D, "_meth_840D" }, + { 0x840E, "_meth_840E" }, + { 0x840F, "_meth_840F" }, + { 0x8410, "_meth_8410" }, + { 0x8411, "_meth_8411" }, + { 0x8412, "_meth_8412" }, + { 0x8413, "_meth_8413" }, + { 0x8414, "_meth_8414" }, + { 0x8415, "_meth_8415" }, + { 0x8416, "_meth_8416" }, + { 0x8417, "_meth_8417" }, + { 0x8418, "_meth_8418" }, + { 0x8419, "_meth_8419" }, + { 0x841A, "_meth_841A" }, + { 0x841B, "_meth_841B" }, + { 0x841C, "_meth_841C" }, + { 0x841D, "_meth_841D" }, + { 0x841E, "_meth_841E" }, + { 0x841F, "_meth_841F" }, + { 0x8420, "_meth_8420" }, + { 0x8421, "_meth_8421" }, + { 0x8422, "_meth_8422" }, + { 0x8423, "_meth_8423" }, + { 0x8424, "_meth_8424" }, + { 0x8425, "_meth_8425" }, + { 0x8426, "_meth_8426" }, + { 0x8427, "_meth_8427" }, + { 0x8428, "_meth_8428" }, + { 0x8429, "_meth_8429" }, + { 0x842A, "_meth_842A" }, + { 0x842B, "_meth_842B" }, + { 0x842C, "_meth_842C" }, + { 0x842D, "_meth_842D" }, + { 0x842E, "_meth_842E" }, + { 0x842F, "_meth_842F" }, + { 0x8430, "_meth_8430" }, + { 0x8431, "_meth_8431" }, + { 0x8432, "_meth_8432" }, + { 0x8433, "_meth_8433" }, + { 0x8434, "_meth_8434" }, + { 0x8435, "_meth_8435" }, + { 0x8436, "_meth_8436" }, + { 0x8437, "_meth_8437" }, + { 0x8438, "_meth_8438" }, + { 0x8439, "_meth_8439" }, + { 0x843A, "_meth_843A" }, + { 0x843B, "_meth_843B" }, + { 0x843C, "_meth_843C" }, + { 0x843D, "_meth_843D" }, + { 0x843E, "_meth_843E" }, + { 0x843F, "_meth_843F" }, + { 0x8440, "_meth_8440" }, + { 0x8441, "_meth_8441" }, + { 0x8442, "_meth_8442" }, + { 0x8443, "_meth_8443" }, + { 0x8444, "_meth_8444" }, + { 0x8445, "_meth_8445" }, + { 0x8446, "_meth_8446" }, + { 0x8447, "_meth_8447" }, + { 0x8448, "_meth_8448" }, + { 0x8449, "_meth_8449" }, + { 0x844A, "_meth_844A" }, + { 0x844B, "_meth_844B" }, + { 0x844C, "_meth_844C" }, + { 0x844D, "_meth_844D" }, + { 0x844E, "_meth_844E" }, + { 0x844F, "_meth_844F" }, + { 0x8450, "_meth_8450" }, + { 0x8451, "_meth_8451" }, + { 0x8452, "_meth_8452" }, + { 0x8453, "_meth_8453" }, + { 0x8454, "_meth_8454" }, + { 0x8455, "_meth_8455" }, + { 0x8456, "_meth_8456" }, + { 0x8457, "_meth_8457" }, + { 0x8458, "_meth_8458" }, + { 0x8459, "_meth_8459" }, + { 0x845A, "_meth_845A" }, + { 0x845B, "_meth_845B" }, + { 0x845C, "_meth_845C" }, + { 0x845D, "_meth_845D" }, + { 0x845E, "_meth_845E" }, + { 0x845F, "_meth_845F" }, + { 0x8460, "_meth_8460" }, + { 0x8461, "_meth_8461" }, + { 0x8462, "_meth_8462" }, + { 0x8463, "_meth_8463" }, + { 0x8464, "_meth_8464" }, + { 0x8465, "_meth_8465" }, + { 0x8466, "_meth_8466" }, + { 0x8467, "_meth_8467" }, + { 0x8468, "_meth_8468" }, + { 0x8469, "_meth_8469" }, + { 0x846A, "_meth_846A" }, + { 0x846B, "_meth_846B" }, + { 0x846C, "_meth_846C" }, + { 0x846D, "_meth_846D" }, + { 0x846E, "_meth_846E" }, + { 0x846F, "_meth_846F" }, + { 0x8470, "_meth_8470" }, + { 0x8471, "_meth_8471" }, + { 0x8472, "_meth_8472" }, + { 0x8473, "_meth_8473" }, + { 0x8474, "_meth_8474" }, + { 0x8475, "_meth_8475" }, + { 0x8476, "_meth_8476" }, + { 0x8477, "_meth_8477" }, + { 0x8478, "_meth_8478" }, + { 0x8479, "_meth_8479" }, + { 0x847A, "_meth_847A" }, + { 0x847B, "_meth_847B" }, + { 0x847C, "_meth_847C" }, + { 0x847D, "_meth_847D" }, + { 0x847E, "_meth_847E" }, + { 0x847F, "_meth_847F" }, + { 0x8480, "_meth_8480" }, + { 0x8481, "_meth_8481" }, + { 0x8482, "_meth_8482" }, + { 0x8483, "_meth_8483" }, + { 0x8484, "_meth_8484" }, + { 0x8485, "_meth_8485" }, + { 0x8486, "_meth_8486" }, + { 0x8487, "_meth_8487" }, + { 0x8488, "_meth_8488" }, + { 0x8489, "_meth_8489" }, + { 0x848A, "_meth_848A" }, + { 0x848B, "_meth_848B" }, + { 0x848C, "_meth_848C" }, + { 0x848D, "_meth_848D" }, + { 0x848E, "_meth_848E" }, + { 0x848F, "_meth_848F" }, + { 0x8490, "_meth_8490" }, + { 0x8491, "_meth_8491" }, + { 0x8492, "_meth_8492" }, + { 0x8493, "_meth_8493" }, + { 0x8494, "_meth_8494" }, + { 0x8495, "_meth_8495" }, + { 0x8496, "_meth_8496" }, + { 0x8497, "_meth_8497" }, + { 0x8498, "_meth_8498" }, + { 0x8499, "_meth_8499" }, + { 0x849A, "_meth_849A" }, + { 0x849B, "_meth_849B" }, + { 0x849C, "_meth_849C" }, + { 0x849D, "_meth_849D" }, + { 0x849E, "_meth_849E" }, + { 0x849F, "_meth_849F" }, + { 0x84A0, "_meth_84A0" }, + { 0x84A1, "_meth_84A1" }, + { 0x84A2, "_meth_84A2" }, + { 0x84A3, "_meth_84A3" }, + { 0x84A4, "_meth_84A4" }, + { 0x84A5, "_meth_84A5" }, + { 0x84A6, "_meth_84A6" }, + { 0x84A7, "_meth_84A7" }, + { 0x84A8, "_meth_84A8" }, + { 0x84A9, "_meth_84A9" }, + { 0x84AA, "_meth_84AA" }, + { 0x84AB, "_meth_84AB" }, + { 0x84AC, "_meth_84AC" }, + { 0x84AD, "_meth_84AD" }, + { 0x84AE, "_meth_84AE" }, + { 0x84AF, "_meth_84AF" }, + { 0x84B0, "_meth_84B0" }, + { 0x84B1, "_meth_84B1" }, + { 0x84B2, "_meth_84B2" }, + { 0x84B3, "_meth_84B3" }, + { 0x84B4, "_meth_84B4" }, + { 0x84B5, "_meth_84B5" }, + { 0x84B6, "_meth_84B6" }, + { 0x84B7, "_meth_84B7" }, + { 0x84B8, "_meth_84B8" }, + { 0x84B9, "_meth_84B9" }, + { 0x84BA, "_meth_84BA" }, + { 0x84BB, "_meth_84BB" }, + { 0x84BC, "_meth_84BC" }, + { 0x84BD, "_meth_84BD" }, + { 0x84BE, "_meth_84BE" }, + { 0x84BF, "_meth_84BF" }, + { 0x84C0, "_meth_84C0" }, + { 0x84C1, "_meth_84C1" }, + { 0x84C2, "_meth_84C2" }, + { 0x84C3, "_meth_84C3" }, + { 0x84C4, "_meth_84C4" }, + { 0x84C5, "_meth_84C5" }, + { 0x84C6, "_meth_84C6" }, + { 0x84C7, "_meth_84C7" }, + { 0x84C8, "_meth_84C8" }, + { 0x84C9, "_meth_84C9" }, + { 0x84CA, "_meth_84CA" }, + { 0x84CB, "_meth_84CB" }, + { 0x84CC, "_meth_84CC" }, + { 0x84CD, "_meth_84CD" }, + { 0x84CE, "_meth_84CE" }, + { 0x84CF, "_meth_84CF" }, + { 0x84D0, "_meth_84D0" }, + { 0x84D1, "_meth_84D1" }, + { 0x84D2, "_meth_84D2" }, + { 0x84D3, "_meth_84D3" }, + { 0x84D4, "_meth_84D4" }, + { 0x84D5, "_meth_84D5" }, + { 0x84D6, "_meth_84D6" }, + { 0x84D7, "_meth_84D7" }, + { 0x84D8, "_meth_84D8" }, + { 0x84D9, "_meth_84D9" }, + { 0x84DA, "_meth_84DA" }, + { 0x84DB, "_meth_84DB" }, + { 0x84DC, "_meth_84DC" }, + { 0x84DD, "_meth_84DD" }, + { 0x84DE, "_meth_84DE" }, + { 0x84DF, "_meth_84DF" }, + { 0x84E0, "_meth_84E0" }, + { 0x84E1, "_meth_84E1" }, + { 0x84E2, "_meth_84E2" }, + { 0x84E3, "_meth_84E3" }, + { 0x84E4, "_meth_84E4" }, + { 0x84E5, "_meth_84E5" }, + { 0x84E6, "_meth_84E6" }, + { 0x84E7, "_meth_84E7" }, + { 0x84E8, "_meth_84E8" }, + { 0x84E9, "_meth_84E9" }, + { 0x84EA, "_meth_84EA" }, + { 0x84EB, "_meth_84EB" }, + { 0x84EC, "_meth_84EC" }, + { 0x84ED, "_meth_84ED" }, + { 0x84EE, "_meth_84EE" }, + { 0x84EF, "_meth_84EF" }, + { 0x84F0, "_meth_84F0" }, + { 0x84F1, "_meth_84F1" }, + { 0x84F2, "_meth_84F2" }, + { 0x84F3, "_meth_84F3" }, + { 0x84F4, "_meth_84F4" }, + { 0x84F5, "_meth_84F5" }, + { 0x84F6, "_meth_84F6" }, + { 0x84F7, "_meth_84F7" }, + { 0x84F8, "_meth_84F8" }, + { 0x84F9, "_meth_84F9" }, + { 0x84FA, "_meth_84FA" }, + { 0x84FB, "_meth_84FB" }, + { 0x84FC, "_meth_84FC" }, + { 0x84FD, "_meth_84FD" }, + { 0x84FE, "_meth_84FE" }, + { 0x84FF, "_meth_84FF" }, + { 0x8500, "_meth_8500" }, + { 0x8501, "_meth_8501" }, + { 0x8502, "_meth_8502" }, + { 0x8503, "_meth_8503" }, + { 0x8504, "_meth_8504" }, + { 0x8505, "_meth_8505" }, + { 0x8506, "_meth_8506" }, + { 0x8507, "_meth_8507" }, + { 0x8508, "_meth_8508" }, + { 0x8509, "_meth_8509" }, + { 0x850A, "_meth_850A" }, + { 0x850B, "_meth_850B" }, + { 0x850C, "_meth_850C" }, + { 0x850D, "_meth_850D" }, + { 0x850E, "_meth_850E" }, + { 0x850F, "_meth_850F" }, + { 0x8510, "_meth_8510" }, + { 0x8511, "_meth_8511" }, + { 0x8512, "_meth_8512" }, + { 0x8513, "_meth_8513" }, + { 0x8514, "_meth_8514" }, + { 0x8515, "_meth_8515" }, + { 0x8516, "_meth_8516" }, + { 0x8517, "_meth_8517" }, + { 0x8518, "_meth_8518" }, + { 0x8519, "_meth_8519" }, + { 0x851A, "_meth_851A" }, + { 0x851B, "_meth_851B" }, + { 0x851C, "_meth_851C" }, + { 0x851D, "_meth_851D" }, + { 0x851E, "_meth_851E" }, + { 0x851F, "_meth_851F" }, + { 0x8520, "_meth_8520" }, + { 0x8521, "_meth_8521" }, + { 0x8522, "_meth_8522" }, + { 0x8523, "_meth_8523" }, + { 0x8524, "_meth_8524" }, + { 0x8525, "_meth_8525" }, + { 0x8526, "_meth_8526" }, + { 0x8527, "_meth_8527" }, + { 0x8528, "_meth_8528" }, + { 0x8529, "_meth_8529" }, + { 0x852A, "_meth_852A" }, + { 0x852B, "_meth_852B" }, + { 0x852C, "_meth_852C" }, + { 0x852D, "_meth_852D" }, + { 0x852E, "_meth_852E" }, + { 0x852F, "_meth_852F" }, + { 0x8530, "_meth_8530" }, + { 0x8531, "_meth_8531" }, + { 0x8532, "_meth_8532" }, + { 0x8533, "_meth_8533" }, + { 0x8534, "_meth_8534" }, + { 0x8535, "_meth_8535" }, + { 0x8536, "_meth_8536" }, + { 0x8537, "_meth_8537" }, + { 0x8538, "_meth_8538" }, + { 0x8539, "_meth_8539" }, + { 0x853A, "_meth_853A" }, + { 0x853B, "_meth_853B" }, + { 0x853C, "_meth_853C" }, + { 0x853D, "_meth_853D" }, + { 0x853E, "_meth_853E" }, + { 0x853F, "_meth_853F" }, + { 0x8540, "_meth_8540" }, + { 0x8541, "_meth_8541" }, + { 0x8542, "_meth_8542" }, + { 0x8543, "_meth_8543" }, + { 0x8544, "_meth_8544" }, + { 0x8545, "_meth_8545" }, + { 0x8546, "_meth_8546" }, + { 0x8547, "_meth_8547" }, + { 0x8548, "_meth_8548" }, + { 0x8549, "_meth_8549" }, + { 0x854A, "_meth_854A" }, + { 0x854B, "_meth_854B" }, + { 0x854C, "_meth_854C" }, + { 0x854D, "_meth_854D" }, + { 0x854E, "_meth_854E" }, + { 0x854F, "_meth_854F" }, + { 0x8550, "_meth_8550" }, + { 0x8551, "_meth_8551" }, + { 0x8552, "_meth_8552" }, + { 0x8553, "_meth_8553" }, + { 0x8554, "_meth_8554" }, + { 0x8555, "_meth_8555" }, + { 0x8556, "_meth_8556" }, + { 0x8557, "_meth_8557" }, + { 0x8558, "_meth_8558" }, + { 0x8559, "_meth_8559" }, + { 0x855A, "_meth_855A" }, + { 0x855B, "_meth_855B" }, + { 0x855C, "_meth_855C" }, + { 0x855D, "_meth_855D" }, + { 0x855E, "_meth_855E" }, + { 0x855F, "_meth_855F" }, + { 0x8560, "_meth_8560" }, + { 0x8561, "_meth_8561" }, + { 0x8562, "_meth_8562" }, + { 0x8563, "_meth_8563" }, + { 0x8564, "_meth_8564" }, + { 0x8565, "_meth_8565" }, + { 0x8566, "_meth_8566" }, + { 0x8567, "_meth_8567" }, + { 0x8568, "_meth_8568" }, + { 0x8569, "_meth_8569" }, + { 0x856A, "_meth_856A" }, + { 0x856B, "_meth_856B" }, + { 0x856C, "_meth_856C" }, + { 0x856D, "_meth_856D" }, + { 0x856E, "_meth_856E" }, + { 0x856F, "_meth_856F" }, + { 0x8570, "_meth_8570" }, + { 0x8571, "_meth_8571" }, + { 0x8572, "_meth_8572" }, + { 0x8573, "_meth_8573" }, + { 0x8574, "_meth_8574" }, + { 0x8575, "_meth_8575" }, + { 0x8576, "_meth_8576" }, + { 0x8577, "_meth_8577" }, + { 0x8578, "_meth_8578" }, + { 0x8579, "_meth_8579" }, + { 0x857A, "_meth_857A" }, + { 0x857B, "_meth_857B" }, + { 0x857C, "_meth_857C" }, + { 0x857D, "_meth_857D" }, + { 0x857E, "_meth_857E" }, + { 0x857F, "_meth_857F" }, + { 0x8580, "_meth_8580" }, + { 0x8581, "_meth_8581" }, + { 0x8582, "_meth_8582" }, + { 0x8583, "_meth_8583" }, + { 0x8584, "_meth_8584" }, + { 0x8585, "_meth_8585" }, + { 0x8586, "_meth_8586" }, + { 0x8587, "_meth_8587" }, + { 0x8588, "_meth_8588" }, + { 0x8589, "_meth_8589" }, + { 0x858A, "_meth_858A" }, + { 0x858B, "_meth_858B" }, + { 0x858C, "_meth_858C" }, + { 0x858D, "_meth_858D" }, + { 0x858E, "_meth_858E" }, + { 0x858F, "_meth_858F" }, + { 0x8590, "_meth_8590" }, + { 0x8591, "_meth_8591" }, + { 0x8592, "_meth_8592" }, + { 0x8593, "_meth_8593" }, + { 0x8594, "_meth_8594" }, + { 0x8595, "_meth_8595" }, + { 0x8596, "_meth_8596" }, + { 0x8597, "_meth_8597" }, + { 0x8598, "_meth_8598" }, + { 0x8599, "_meth_8599" }, + { 0x859A, "_meth_859A" }, + { 0x859B, "_meth_859B" }, + { 0x859C, "_meth_859C" }, + { 0x859D, "_meth_859D" }, + { 0x859E, "_meth_859E" }, + { 0x859F, "_meth_859F" }, + { 0x85A0, "_meth_85A0" }, + { 0x85A1, "_meth_85A1" }, + { 0x85A2, "_meth_85A2" }, + { 0x85A3, "_meth_85A3" }, + { 0x85A4, "_meth_85A4" }, + { 0x85A5, "_meth_85A5" }, + { 0x85A6, "_meth_85A6" }, + { 0x85A7, "_meth_85A7" }, + { 0x85A8, "_meth_85A8" }, + { 0x85A9, "_meth_85A9" }, + { 0x85AA, "_meth_85AA" }, + { 0x85AB, "_meth_85AB" }, + { 0x85AC, "_meth_85AC" }, + { 0x85AD, "_meth_85AD" }, + { 0x85AE, "_meth_85AE" }, + { 0x85AF, "_meth_85AF" }, + { 0x85B0, "_meth_85B0" }, + { 0x85B1, "_meth_85B1" }, + { 0x85B2, "_meth_85B2" }, + { 0x85B3, "_meth_85B3" }, + { 0x85B4, "_meth_85B4" }, + { 0x85B5, "_meth_85B5" }, + { 0x85B6, "_meth_85B6" }, + { 0x85B7, "_meth_85B7" }, + { 0x85B8, "_meth_85B8" }, + { 0x85B9, "_meth_85B9" }, + { 0x85BA, "_meth_85BA" }, + { 0x85BB, "_meth_85BB" }, + { 0x85BC, "_meth_85BC" }, + { 0x85BD, "_meth_85BD" }, + { 0x85BE, "_meth_85BE" }, + { 0x85BF, "_meth_85BF" }, + { 0x85C0, "_meth_85C0" }, + { 0x85C1, "_meth_85C1" }, + { 0x85C2, "_meth_85C2" }, + { 0x85C3, "_meth_85C3" }, + { 0x85C4, "_meth_85C4" }, + { 0x85C5, "_meth_85C5" }, + { 0x85C6, "_meth_85C6" }, + { 0x85C7, "_meth_85C7" }, + { 0x85C8, "_meth_85C8" }, + { 0x85C9, "_meth_85C9" }, + { 0x85CA, "_meth_85CA" }, + { 0x85CB, "_meth_85CB" }, + { 0x85CC, "_meth_85CC" }, + { 0x85CD, "_meth_85CD" }, + { 0x85CE, "_meth_85CE" }, + { 0x85CF, "_meth_85CF" }, + { 0x85D0, "_meth_85D0" }, + { 0x85D1, "_meth_85D1" }, + { 0x85D2, "_meth_85D2" }, +}}; + +const std::array file_list +{{ + { 0, "DUMMY" }, +}}; + +const std::array token_list +{{ + { 0, "DUMMY" }, +}}; + +struct __init__ +{ + __init__() + { + static bool init = false; + if(init) return; + init = true; + + opcode_map.reserve(opcode_list.size()); + opcode_map_rev.reserve(opcode_list.size()); + function_map.reserve(function_list.size()); + function_map_rev.reserve(function_list.size()); + method_map.reserve(method_list.size()); + method_map_rev.reserve(method_list.size()); + file_map.reserve(file_list.size()); + file_map_rev.reserve(file_list.size()); + token_map.reserve(token_list.size()); + token_map_rev.reserve(token_list.size()); + + for(const auto& entry : opcode_list) + { + opcode_map.insert({ entry.key, entry.value }); + opcode_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : function_list) + { + function_map.insert({ entry.key, entry.value }); + function_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : method_list) + { + method_map.insert({ entry.key, entry.value }); + method_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : file_list) + { + file_map.insert({ entry.key, entry.value }); + file_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : token_list) + { + token_map.insert({ entry.key, entry.value }); + token_map_rev.insert({ utils::string::to_lower(entry.value), entry.key }); + } + } +}; + +__init__ _; + +} // namespace xsk::gsc::h2 diff --git a/src/h2/xsk/resolver.hpp b/src/h2/xsk/resolver.hpp new file mode 100644 index 00000000..b46bf600 --- /dev/null +++ b/src/h2/xsk/resolver.hpp @@ -0,0 +1,33 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::h2 +{ + +class resolver +{ +public: + static auto opcode_id(const std::string& name) -> std::uint8_t; + static auto opcode_name(std::uint8_t id) -> std::string; + + static auto function_id(const std::string& name) -> std::uint16_t; + static auto function_name(std::uint16_t id) -> std::string; + + static auto method_id(const std::string& name) -> std::uint16_t; + static auto method_name(std::uint16_t id) -> std::string; + + static auto file_id(const std::string& name) -> std::uint16_t; + static auto file_name(std::uint16_t id) -> std::string; + + static auto token_id(const std::string& name) -> std::uint16_t; + static auto token_name(std::uint16_t id) -> std::string; + + static auto find_function(const std::string& name) -> bool; + static auto find_method(const std::string& name) -> bool; +}; + +} // namespace xsk::gsc::h2 diff --git a/src/iw5/stdafx.cpp b/src/iw5/stdafx.cpp new file mode 100644 index 00000000..0f0f08c2 --- /dev/null +++ b/src/iw5/stdafx.cpp @@ -0,0 +1,6 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" diff --git a/src/iw5/stdafx.hpp b/src/iw5/stdafx.hpp new file mode 100644 index 00000000..2fe6dd57 --- /dev/null +++ b/src/iw5/stdafx.hpp @@ -0,0 +1,38 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +// Warnings +#ifdef _WIN32 +#pragma warning(disable:4244) +#pragma warning(disable:4267) +#pragma warning(disable:4005) +#pragma warning(disable:4065) +#define _CRT_SECURE_NO_WARNINGS +#endif + +// C/C++ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Ext +using namespace std::literals; + +#include "xsk/iw5.hpp" diff --git a/src/iw5/xsk/assembler.cpp b/src/iw5/xsk/assembler.cpp new file mode 100644 index 00000000..b29cf76c --- /dev/null +++ b/src/iw5/xsk/assembler.cpp @@ -0,0 +1,598 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw5.hpp" + +namespace xsk::gsc::iw5 +{ + +auto assembler::output_script() -> std::vector +{ + std::vector script; + + if(script_ == nullptr) return script; + + script.resize(script_->pos()); + memcpy(script.data(), script_->buffer().data(), script.size()); + + return script; +} + +auto assembler::output_stack() -> std::vector +{ + std::vector stack; + + if(stack_ == nullptr) return stack; + + stack.resize(stack_->pos()); + memcpy(stack.data(), stack_->buffer().data(), stack.size()); + + return stack; +} + +void assembler::assemble(const std::string& file, std::vector& data) +{ + std::vector assembly = utils::string::clean_buffer_lines(data); + std::vector functions; + gsc::function_ptr func = nullptr; + std::uint32_t index = 1; + std::uint16_t switchnum = 0; + + for (auto& line : assembly) + { + if (line == "" || line.substr(0, 2) == "//") + { + continue; + } + else if (line.substr(0, 4) == "sub_") + { + func = std::make_unique(); + func->index = index; + func->name = line.substr(4); + } + else if (line.substr(0, 4) == "end_") + { + if (func != nullptr) + { + func->size = index - func->index; + functions.push_back(std::move(func)); + } + } + else if (line.substr(0, 4) == "loc_") + { + func->labels[index] = line; + } + else + { + auto data = utils::string::parse_code(line); + + if (switchnum) + { + if (data[0] == "case" || data[0] == "default") + { + for (auto& entry : data) + { + func->instructions.back()->data.push_back(entry); + } + switchnum--; + continue; + } + + throw asm_error("invalid instruction inside endswitch \""s + line + "\"!"); + } + else + { + auto inst = std::make_unique(); + inst->index = index; + inst->opcode = static_cast(resolver::opcode_id(data[0])); + inst->size = opcode_size(inst->opcode); + data.erase(data.begin()); + inst->data = std::move(data); + + if (opcode(inst->opcode) == opcode::OP_endswitch) + { + switchnum = static_cast(std::stoul(inst->data[0])); + inst->size += 7 * switchnum; + } + + index += inst->size; + func->instructions.push_back(std::move(inst)); + } + } + } + + this->assemble(file, functions); +} + +void assembler::assemble(const std::string& file, std::vector& functions) +{ + script_ = std::make_unique(0x100000); + stack_ = std::make_unique(0x100000); + filename_ = file; + functions_ = std::move(functions); + + script_->write(static_cast(opcode::OP_End)); + stack_->write(0x62727568); + + for (const auto& func : functions_) + { + this->assemble_function(func); + } +} + +void assembler::assemble_function(const gsc::function_ptr& func) +{ + labels_ = func->labels; + + stack_->write(func->size); + + func->id = func->name.substr(0, 3) == "_ID" ? std::stoul(func->name.substr(3)) : resolver::token_id(func->name); + stack_->write(func->id); + + if (func->id == 0) + { + stack_->write_c_string(func->name); + } + + for (const auto& inst : func->instructions) + { + this->assemble_instruction(inst); + } +} + +void assembler::assemble_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_End: + case opcode::OP_Return: + case opcode::OP_GetUndefined: + case opcode::OP_GetZero: + case opcode::OP_waittillFrameEnd: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_EvalArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_ClearArray: + case opcode::OP_EmptyArray: + case opcode::OP_AddArray: + case opcode::OP_PreScriptCall: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_GetLevelObject: + case opcode::OP_GetAnimObject: + case opcode::OP_GetSelf: + case opcode::OP_GetThisthread: + case opcode::OP_GetLevel: + case opcode::OP_GetGame: + case opcode::OP_GetAnim: + case opcode::OP_GetGameRef: + case opcode::OP_inc: + case opcode::OP_dec: + case opcode::OP_bit_or: + case opcode::OP_bit_ex_or: + case opcode::OP_bit_and: + case opcode::OP_equality: + case opcode::OP_inequality: + case opcode::OP_less: + case opcode::OP_greater: + case opcode::OP_less_equal: + case opcode::OP_waittillmatch2: + case opcode::OP_waittill: + case opcode::OP_notify: + case opcode::OP_endon: + case opcode::OP_voidCodepos: + case opcode::OP_vector: + case opcode::OP_greater_equal: + case opcode::OP_shift_left: + case opcode::OP_shift_right: + case opcode::OP_plus: + case opcode::OP_minus: + case opcode::OP_multiply: + case opcode::OP_divide: + case opcode::OP_mod: + case opcode::OP_size: + case opcode::OP_GetSelfObject: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_clearparams: + case opcode::OP_checkclearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_SetVariableField: + case opcode::OP_ClearVariableField: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_wait: + case opcode::OP_DecTop: + case opcode::OP_CastFieldObject: + case opcode::OP_CastBool: + case opcode::OP_BoolNot: + case opcode::OP_BoolComplement: + script_->write(static_cast(inst->opcode)); + break; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetInteger: + script_->write(static_cast(inst->opcode)); + script_->write(std::stoi(inst->data[0])); + break; + case opcode::OP_GetFloat: + script_->write(static_cast(inst->opcode)); + script_->write(std::stof(inst->data[0])); + break; + case opcode::OP_GetVector: + script_->write(static_cast(inst->opcode)); + script_->write(std::stof(inst->data[0])); + script_->write(std::stof(inst->data[1])); + script_->write(std::stof(inst->data[2])); + break; + case opcode::OP_GetString: + case opcode::OP_GetIString: + script_->write(static_cast(inst->opcode)); + script_->write(0); + stack_->write_c_string(utils::string::to_code(inst->data[0])); + break; + case opcode::OP_GetAnimation: + script_->write(static_cast(inst->opcode)); + script_->write(0); + stack_->write_c_string(utils::string::unquote(inst->data[0])); + stack_->write_c_string(utils::string::unquote(inst->data[1])); + break; + case opcode::OP_GetAnimTree: + script_->write(static_cast(inst->opcode)); + script_->write(0); + stack_->write_c_string(utils::string::unquote(inst->data[0])); + break; + case opcode::OP_waittillmatch: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stol(inst->data[0]))); + break; + case opcode::OP_CreateLocalVariable: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_EvalLocalArrayCached: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_EvalLocalVariableObjectCached: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stol(inst->data[0]))); + break; + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalSelfFieldVariableRef: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_ClearFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + this->assemble_field_variable(inst); + break; + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stol(inst->data[0]))); + break; + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_GetLocalFunction: + this->assemble_local_call(inst, false); + break; + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + this->assemble_local_call(inst, true); + break; + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + case opcode::OP_GetFarFunction: + this->assemble_far_call(inst, false); + break; + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + this->assemble_far_call(inst, true); + break; + case opcode::OP_CallBuiltin: + this->assemble_builtin_call(inst, false, true); + break; + case opcode::OP_CallBuiltinMethod: + this->assemble_builtin_call(inst, true, true); + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + this->assemble_builtin_call(inst, false, false); + break; + case opcode::OP_GetBuiltinMethod: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + this->assemble_builtin_call(inst, true, false); + break; + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + this->assemble_jump(inst, true, false); + break; + case opcode::OP_jumpback: + this->assemble_jump(inst, false, true); + break; + case opcode::OP_jump: + this->assemble_jump(inst, false, false); + break; + case opcode::OP_switch: + this->assemble_switch(inst); + break; + case opcode::OP_endswitch: + this->assemble_end_switch(inst); + break; + default: + throw asm_error(utils::string::va("Unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); + } +} + +void assembler::assemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num) +{ + script_->write(static_cast(inst->opcode)); + + std::uint16_t id = 0; + + if (arg_num) + { + script_->write(static_cast(std::stol(inst->data[0]))); + + if (method) + id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::method_id(inst->data[1]); + else + id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::function_id(inst->data[1]); + } + else + { + if (method) + id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::method_id(inst->data[0]); + else + id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::function_id(inst->data[0]); + } + + script_->write(id); +} + +void assembler::assemble_local_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_function(inst->data[0]); + + std::int32_t offset = addr - inst->index - 1; + + this->assemble_offset(offset); + + if (thread) + { + script_->write(static_cast(std::stol(inst->data[1]))); + } +} + +void assembler::assemble_far_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->write(static_cast(inst->opcode)); + script_->write(0); + script_->write(0); + + std::uint16_t file_id = 0; + std::uint16_t func_id = 0; + + if (thread) + { + script_->write(static_cast(std::stol(inst->data[0]))); + + file_id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::file_id(inst->data[1]); + func_id = inst->data[2].substr(0, 3) == "_ID" ? std::stol(inst->data[2].substr(3)) : resolver::token_id(inst->data[2]); + } + else + { + file_id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::file_id(inst->data[0]); + func_id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::token_id(inst->data[1]); + } + + stack_->write(file_id); + if (file_id == 0) stack_->write_c_string(thread ? inst->data[1] : inst->data[0]); + stack_->write(func_id); + if (func_id == 0) stack_->write_c_string(thread ? inst->data[2] : inst->data[1]); +} + +void assembler::assemble_switch(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_label(inst->data[0]); + + script_->write(addr - inst->index - 4); +} + +void assembler::assemble_end_switch(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + if (!utils::string::is_number(inst->data[0])) + { + throw asm_error("invalid endswitch number!"); + } + + std::uint16_t casenum = std::stol(inst->data[0]); + + script_->write(casenum); + + std::uint32_t internal_index = inst->index + 3; + + for (std::uint16_t i = 0; i < casenum; i++) + { + if (inst->data[1 + (3 * i)] == "case") + { + if (utils::string::is_number(inst->data[1 + (3 * i) + 1])) + { + script_->write((std::stol(inst->data[1 + (3 * i) + 1]) & 0xFFFFFF) + 0x800000); + } + else + { + script_->write(i + 1); + stack_->write_c_string(utils::string::unquote(inst->data[1 + (3 * i) + 1])); + } + + internal_index += 4; + + std::int32_t addr = this->resolve_label(inst->data[1 + (3 * i) + 2]); + + this->assemble_offset(addr - internal_index); + + internal_index += 3; + } + else if (inst->data[1 + (3 * i)] == "default") + { + script_->write(0); + stack_->write_c_string("\x01"); + + internal_index += 4; + std::int32_t addr = this->resolve_label(inst->data[1 + (3 * i) + 1]); + + this->assemble_offset(addr - internal_index); + + internal_index += 3; + } + } +} + +void assembler::assemble_field_variable(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::uint16_t field_id = 0; + + if (inst->data[0].substr(0, 3) == "_ID") + { + field_id = (std::uint16_t)std::stol(inst->data[0].substr(3)); + } + else + { + field_id = resolver::token_id(inst->data[0]); + + if (field_id == 0) + { + field_id = 0xFFFF; + } + } + + script_->write(field_id); + + if (field_id > 0x826A) + { + stack_->write(0); + stack_->write_c_string(inst->data[0]); + } +} + +void assembler::assemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_label(inst->data[0]); + + if (expr) + { + script_->write(addr - inst->index - 3); + } + else if (back) + { + script_->write((inst->index + 3) - addr); + } + else + { + script_->write(addr - inst->index - 5); + } +} + +void assembler::assemble_offset(std::int32_t offset) +{ + std::array bytes = {}; + + offset = (offset << 10) >> 8; + + *reinterpret_cast(bytes.data()) = offset; + + script_->write(bytes[0]); + script_->write(bytes[1]); + script_->write(bytes[2]); +} + +auto assembler::resolve_function(const std::string& name) -> std::uint32_t +{ + auto temp = name.substr(0, 4) == "sub_" ? name.substr(4) : name; + + for (const auto& func : functions_) + { + if (func->name == temp) + { + return func->index; + } + } + + throw asm_error("Couldn't resolve local function address of '" + temp + "'!"); +} + +auto assembler::resolve_label(const std::string& name) -> std::uint32_t +{ + for (auto& func : labels_) + { + if (func.second == name) + { + return func.first; + } + } + + throw asm_error("Couldn't resolve label address of '" + name + "'!"); +} + +} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/assembler.hpp b/src/iw5/xsk/assembler.hpp new file mode 100644 index 00000000..e4ca8e58 --- /dev/null +++ b/src/iw5/xsk/assembler.hpp @@ -0,0 +1,40 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::iw5 +{ + +class assembler : public gsc::assembler +{ + std::string filename_; + utils::byte_buffer_ptr script_; + utils::byte_buffer_ptr stack_; + std::vector functions_; + std::unordered_map labels_; + +public: + auto output_script() -> std::vector; + auto output_stack() -> std::vector; + void assemble(const std::string& file, std::vector& data); + void assemble(const std::string& file, std::vector& functions); + +private: + void assemble_function(const gsc::function_ptr& func); + void assemble_instruction(const gsc::instruction_ptr& inst); + void assemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num); + void assemble_local_call(const gsc::instruction_ptr& inst, bool thread); + void assemble_far_call(const gsc::instruction_ptr& inst, bool thread); + void assemble_switch(const gsc::instruction_ptr& inst); + void assemble_end_switch(const gsc::instruction_ptr& inst); + void assemble_field_variable(const gsc::instruction_ptr& inst); + void assemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back); + void assemble_offset(std::int32_t offset); + auto resolve_function(const std::string& name) -> std::uint32_t; + auto resolve_label(const std::string& name) -> std::uint32_t; +}; + +} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/compiler.cpp b/src/iw5/xsk/compiler.cpp new file mode 100644 index 00000000..444edca8 --- /dev/null +++ b/src/iw5/xsk/compiler.cpp @@ -0,0 +1,2899 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw5.hpp" +#include "parser.hpp" +#include "lexer.hpp" + +namespace xsk::gsc::iw5 +{ + +auto compiler::output() -> std::vector +{ + return std::move(assembly_); +} + +void compiler::compile(const std::string& file, std::vector& data) +{ + filename_ = file; + + auto result = parse_buffer(filename_, data); + + compile_program(result); +} + +void compiler::set_readf_callback(std::function(const std::string&)> func) +{ + callback_readf_ = func; +} + +auto compiler::parse_buffer(const std::string& file, std::vector& data) -> gsc::program_ptr +{ + yyscan_t scanner; + gsc::location loc; + gsc::program_ptr result(nullptr); + + loc.initialize(&file); + // Add the two NULL terminators, required by flex. + data.push_back(0); + data.push_back(0); + + if (iw5_lex_init(&scanner)) + exit(1); + + YY_BUFFER_STATE yybuffer = iw5__scan_buffer(reinterpret_cast(data.data()), data.size(), scanner); + + parser parser(scanner, loc, result); + + if(parser.parse() || result == nullptr) + { + throw gsc::comp_error(loc, "An unknown error ocurred while parsing gsc file."); + } + + iw5__delete_buffer(yybuffer, scanner); + iw5_lex_destroy(scanner); + + return result; +} + +auto compiler::parse_file(const std::string& file) -> gsc::program_ptr +{ + auto buffer = callback_readf_(file); + auto result = parse_buffer(file, buffer); + + return result; +} + +void compiler::compile_program(const gsc::program_ptr& program) +{ + assembly_.clear(); + includes_.clear(); + animtrees_.clear(); + constants_.clear(); + local_functions_.clear(); + index_ = 1; + + for(const auto& def : program->definitions) + { + if(def.as_node->type == gsc::node_t::thread) + { + local_functions_.push_back(def.as_thread->name->value); + } + } + + for(const auto& include : program->includes) + { + emit_include(include); + } + + for(const auto& def : program->definitions) + { + emit_define(def); + } + +#ifdef DEBUG_GSC_COMPILER + print_debug_info(); +#endif +} + +void compiler::emit_include(const gsc::include_ptr& include) +{ + const auto& path = include->file->value; + + for(const auto& inc : includes_) + { + if(inc.name == path) + { + throw gsc::comp_error(include->loc, "error duplicated include file '" + path + "'."); + } + } + + if(map_known_includes(path)) return; + + try + { + auto program = parse_file(path); + + std::vector funcs; + + for(const auto& def : program->definitions) + { + if(def.as_node->type == gsc::node_t::thread) + { + funcs.push_back(def.as_thread->name->value); + } + } + + if(funcs.size() == 0) + { + throw gsc::comp_error(include->loc, "error empty include file '" + path + "'."); + } + + includes_.push_back(include_t(path, funcs)); + } + catch(const std::exception& e) + { + throw gsc::comp_error(include->loc, "error parsing include file '" + path + "': " + e.what()); + } +} + +void compiler::emit_define(const gsc::define_ptr& define) +{ + switch(define.as_node->type) + { + case gsc::node_t::usingtree: emit_usingtree(define.as_usingtree); break; + case gsc::node_t::constant: emit_constant(define.as_constant); break; + case gsc::node_t::thread: emit_thread(define.as_thread); break; + default: break; + } +} + +void compiler::emit_usingtree(const gsc::usingtree_ptr& animtree) +{ + animtrees_.push_back({ animtree->animtree->value, false }); +} + +void compiler::emit_constant(const gsc::constant_ptr& constant) +{ + constants_.insert({ constant->name->value, std::move(constant->value) }); +} + +void compiler::emit_thread(const gsc::thread_ptr& thread) +{ + function_ = std::make_unique(); + function_->index = index_; + function_->name = thread->name->value; + + auto ctx = std::make_unique(); + stack_idx_ = 0; + label_idx_ = 0; + can_break_ = false; + can_continue_ = false; + local_stack_.clear(); + break_ctxs_.clear(); + continue_ctxs_.clear(); + + process_thread(ctx, thread); + + emit_parameters(ctx, thread->params); + emit_stmt_list(ctx, thread->block, true); + emit_opcode(ctx, opcode::OP_End); + + function_->size = index_ - function_->index; + assembly_.push_back(std::move(function_)); +} + +void compiler::emit_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + initialize_variable(ctx, param); + emit_opcode(ctx, opcode::OP_SafeCreateVariableFieldCached, variable_create_index(ctx, param)); + } + + emit_opcode(ctx, opcode::OP_checkclearparams); +} + +void compiler::emit_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt, bool last) +{ + switch(stmt.as_node->type) + { + case gsc::node_t::stmt_list: emit_stmt_list(ctx, stmt.as_list, last); break; + case gsc::node_t::stmt_call: emit_stmt_call(ctx, stmt.as_call); break; + case gsc::node_t::stmt_assign: emit_stmt_assign(ctx, stmt.as_assign); break; + case gsc::node_t::stmt_endon: emit_stmt_endon(ctx, stmt.as_endon); break; + case gsc::node_t::stmt_notify: emit_stmt_notify(ctx, stmt.as_notify); break; + case gsc::node_t::stmt_wait: emit_stmt_wait(ctx, stmt.as_wait); break; + case gsc::node_t::stmt_waittill: emit_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_waittillmatch: emit_stmt_waittillmatch(ctx, stmt.as_waittillmatch); break; + case gsc::node_t::stmt_waittillframeend: emit_stmt_waittillframeend(ctx, stmt.as_waittillframeend); break; + case gsc::node_t::stmt_if: emit_stmt_if(ctx, stmt.as_if, last); break; + case gsc::node_t::stmt_ifelse: emit_stmt_ifelse(ctx, stmt.as_ifelse, last); break; + case gsc::node_t::stmt_while: emit_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: emit_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: emit_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: emit_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_case: emit_stmt_case(ctx, stmt.as_case); break; + case gsc::node_t::stmt_default: emit_stmt_default(ctx, stmt.as_default); break; + case gsc::node_t::stmt_break: emit_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_continue: emit_stmt_continue(ctx, stmt.as_continue); break; + case gsc::node_t::stmt_return: emit_stmt_return(ctx, stmt.as_return); break; + default: break; + } +} + +void compiler::emit_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt, bool last) +{ + for (const auto& entry : stmt->stmts) + { + bool last_ = (&entry == &stmt->stmts.back() && last) ? true : false; + emit_stmt(ctx, entry, last_); + } +} + +void compiler::emit_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt) +{ + if(stmt->expr->func.as_node->type == gsc::node_t::expr_call_function) + { + const auto& name = stmt->expr->func.as_func->name->value; + + if(name == "assert" || name == "assertex" || name == "assertmsg") return; + } + + emit_expr_call(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_DecTop); +} + +void compiler::emit_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt) +{ + emit_expr_assign(ctx, stmt->expr); +} + +void compiler::emit_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_endon); +} + +void compiler::emit_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt) +{ + emit_opcode(ctx, opcode::OP_voidCodepos); + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + emit_expr(ctx, arg); + } + + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_notify); +} + +void compiler::emit_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_wait); +} + +void compiler::emit_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_waittill); + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + create_variable(ctx, arg.as_name); + emit_opcode(ctx, opcode::OP_SafeSetWaittillVariableFieldCached, variable_access_index(ctx, arg.as_name)); + } + + emit_opcode(ctx, opcode::OP_clearparams); +} + +void compiler::emit_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt) +{ + emit_expr_arguments(ctx, stmt->args); + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_waittillmatch); + emit_opcode(ctx, opcode::OP_clearparams); +} + +void compiler::emit_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt) +{ + emit_opcode(ctx, opcode::OP_waittillFrameEnd); +} + +void compiler::emit_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt, bool last) +{ + auto end_loc = create_label(); + + if(stmt->expr.as_node->type == gsc::node_t::expr_not) + { + emit_expr(ctx, stmt->expr.as_not->rvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrue, end_loc); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, end_loc); + } + + ctx->transfer(stmt->ctx); + stmt->ctx->is_last = last; + + emit_stmt(stmt->ctx, stmt->stmt, last); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_remove_local_vars(stmt->ctx); + + insert_label(end_loc); +} + +void compiler::emit_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt, bool last) +{ + std::vector childs; + auto else_loc = create_label(); + auto end_loc = create_label(); + + if(stmt->expr.as_node->type == gsc::node_t::expr_not) + { + emit_expr(ctx, stmt->expr.as_not->rvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrue, else_loc); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, else_loc); + } + + ctx->transfer(stmt->ctx_if); + stmt->ctx_if->is_last = last; + + emit_stmt(stmt->ctx_if, stmt->stmt_if, last); + + emit_remove_local_vars(stmt->ctx_if); + + if(stmt->ctx_if->abort == abort_t::abort_none) + childs.push_back(stmt->ctx_if.get()); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_opcode(ctx, opcode::OP_jump, end_loc); + + insert_label(else_loc); + + ctx->transfer(stmt->ctx_else); + stmt->ctx_else->is_last = last; + + emit_stmt(stmt->ctx_else, stmt->stmt_else, last); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_remove_local_vars(stmt->ctx_else); + + if(stmt->ctx_else->abort == abort_t::abort_none) + childs.push_back(stmt->ctx_else.get()); + + insert_label(end_loc); + + ctx->init_from_child(childs); +} + +void compiler::emit_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = true; + can_continue_ = true; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + + auto begin_loc = insert_label(); + + bool const_cond = is_constant_condition(stmt->expr); + + if(!const_cond) + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + } + + emit_stmt(stmt->ctx, stmt->stmt, false); + + insert_label(continue_loc); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + + if(const_cond) + ctx->init_from_child(break_ctxs_); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = false; + can_continue_ = false; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + emit_stmt(ctx, stmt->pre_expr, false); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + ctx->transfer(stmt->ctx_post); + + auto begin_loc = insert_label(); + + bool const_cond = is_constant_condition(stmt->expr); + + if(!const_cond) + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + } + + can_break_ = true; + can_continue_ = true; + + emit_stmt(stmt->ctx, stmt->stmt, false); + + if(stmt->ctx->abort == abort_t::abort_none) + continue_ctxs_.push_back(stmt->ctx.get()); + + can_break_ = false; + can_continue_ = false; + + insert_label(continue_loc); + + stmt->ctx_post->init_from_child(continue_ctxs_); + + emit_stmt(stmt->ctx_post, stmt->post_expr, false); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + + if(const_cond) + ctx->init_from_child(break_ctxs_); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = false; + can_continue_ = false; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + emit_expr(ctx, stmt->array_expr); + emit_variable_ref(ctx, stmt->array, true); + emit_variable(ctx, stmt->array); + emit_opcode(ctx, opcode::OP_CallBuiltin1, "getfirstarraykey"); + emit_variable_ref(ctx, stmt->key_expr, true); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + + ctx->transfer(stmt->ctx_post); + + auto begin_loc = insert_label(); + + emit_variable(ctx, stmt->key_expr); + emit_opcode(ctx, opcode::OP_CallBuiltin1, "isdefined"); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + + can_break_ = true; + can_continue_ = true; + + emit_variable(stmt->ctx, stmt->key_expr); + emit_opcode(stmt->ctx, opcode::OP_EvalLocalArrayCached, variable_access_index(stmt->ctx, stmt->array.as_name)); + emit_variable_ref(stmt->ctx, stmt->value_expr, true); + emit_stmt(stmt->ctx, stmt->stmt, false); + + if(stmt->ctx->abort == abort_t::abort_none) + continue_ctxs_.push_back(stmt->ctx.get()); + + can_break_ = false; + can_continue_ = false; + + insert_label(continue_loc); + + stmt->ctx_post->init_from_child(continue_ctxs_); + + emit_variable(stmt->ctx_post, stmt->key_expr); + emit_variable(stmt->ctx_post, stmt->array); + emit_opcode(stmt->ctx_post, opcode::OP_CallBuiltin2, "getnextarraykey"); + emit_variable_ref(stmt->ctx_post, stmt->key_expr, true); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + emit_clear_local_variable(ctx, stmt->array.as_name); + if(!stmt->use_key) emit_clear_local_variable(ctx, stmt->key_expr.as_name); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_break = can_break_; + break_ctxs_.clear(); + can_break_ = false; + + auto jmptable_loc = create_label(); + auto break_loc = create_label(); + + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_switch, jmptable_loc); + + can_break_ = true; + + std::vector data; + data.push_back(utils::string::va("%d", stmt->stmt->stmts.size())); + + bool has_default = false; + gsc::context* default_ctx = nullptr; + + for(auto i = 0; i < stmt->stmt->stmts.size(); i++) + { + auto& entry = stmt->stmt->stmts[i]; + + if(entry.as_node->type == gsc::node_t::stmt_case) + { + auto& case_ = entry.as_case; + if(case_->value.as_node->type == gsc::node_t::data_integer) + { + auto loc = insert_label(); + data.push_back("case"); + data.push_back(case_->value.as_integer->value); + data.push_back(loc); + } + else if(case_->value.as_node->type == gsc::node_t::data_string) + { + auto loc = insert_label(); + data.push_back("case"); + data.push_back(case_->value.as_string->value); + data.push_back(loc); + } + else + { + throw gsc::comp_error(stmt->loc, "case type must be int or string"); + } + + ctx->transfer(case_->ctx); + case_->ctx->loc_break = break_loc; + emit_stmt_list(case_->ctx, case_->stmt, false); + if(case_->stmt->stmts.size() > 0) + emit_remove_local_vars(case_->ctx); + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + auto loc = insert_label(); + data.push_back("default"); + data.push_back(loc); + + has_default = true; + default_ctx = entry.as_default->ctx.get(); + + ctx->transfer(entry.as_default->ctx); + entry.as_default->ctx->loc_break = break_loc; + emit_stmt_list(entry.as_default->ctx, entry.as_default->stmt, false); + if(entry.as_default->stmt->stmts.size() > 0) + emit_remove_local_vars(entry.as_default->ctx); + } + else + { + throw gsc::comp_error(entry.as_node->loc, "missing case statement"); + } + } + + if(has_default) + { + if(default_ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(default_ctx); + } + ctx->init_from_child(break_ctxs_); + } + + insert_label(jmptable_loc); + + emit_opcode(ctx, opcode::OP_endswitch, data); + + auto offset = 7 * stmt->stmt->stmts.size(); + function_->instructions.back()->size += offset; + index_ += offset; + + insert_label(break_loc); + + can_break_ = old_break; + break_ctxs_ = old_breaks; +} + +void compiler::emit_stmt_case(const gsc::context_ptr& ctx, const gsc::stmt_case_ptr& stmt) +{ + throw gsc::comp_error(stmt->loc, "illegal case statement"); +} + +void compiler::emit_stmt_default(const gsc::context_ptr& ctx, const gsc::stmt_default_ptr& stmt) +{ + throw gsc::comp_error(stmt->loc, "illegal default statement"); +} + +void compiler::emit_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + if(can_break_ && ctx->abort == abort_t::abort_none && ctx->loc_break != "") + { + break_ctxs_.push_back(ctx.get()); + emit_remove_local_vars(ctx); + ctx->abort = abort_t::abort_break; + emit_opcode(ctx, opcode::OP_jump, ctx->loc_break); + } + else + { + throw gsc::comp_error(stmt->loc, "illegal break statement"); + } +} + +void compiler::emit_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt) +{ + if(can_break_ && ctx->abort == abort_t::abort_none && ctx->loc_continue != "") + { + continue_ctxs_.push_back(ctx.get()); + emit_remove_local_vars(ctx); + ctx->abort = abort_t::abort_continue; + emit_opcode(ctx, opcode::OP_jump, ctx->loc_continue); + } + else + { + throw gsc::comp_error(stmt->loc, "illegal continue statement"); + } +} + +void compiler::emit_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + ctx->abort = abort_t::abort_return; + } + + if(stmt->expr.as_node->type == gsc::node_t::null) + { + emit_opcode(ctx, opcode::OP_End); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_Return); + } +} + +void compiler::emit_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_and: emit_expr_and(ctx, expr.as_and); break; + case gsc::node_t::expr_or: emit_expr_or(ctx, expr.as_or); break; + case gsc::node_t::expr_equality: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_inequality: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less_equal: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater_equal: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_or: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_and: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_exor: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_left: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_right: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_add: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_sub: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mult: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_div: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mod: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_complement: emit_expr_complement(ctx, expr.as_complement); break; + case gsc::node_t::expr_not: emit_expr_not(ctx, expr.as_not); break; + case gsc::node_t::expr_call: emit_expr_call(ctx, expr.as_call); break; + case gsc::node_t::expr_function: emit_expr_function(ctx, expr.as_function); break; + case gsc::node_t::expr_add_array: emit_expr_add_array(ctx, expr.as_add_array); break; + case gsc::node_t::expr_array: emit_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: emit_field_variable(ctx, expr.as_field); break; + case gsc::node_t::expr_size: emit_expr_size(ctx, expr.as_size); break; + case gsc::node_t::data_thisthread: emit_opcode(ctx, opcode::OP_GetThisthread); break; + case gsc::node_t::data_empty_array: emit_opcode(ctx, opcode::OP_EmptyArray); break; + case gsc::node_t::data_undefined: emit_opcode(ctx, opcode::OP_GetUndefined); break; + case gsc::node_t::data_game: emit_opcode(ctx, opcode::OP_GetGame); break; + case gsc::node_t::data_self: emit_opcode(ctx, opcode::OP_GetSelf); break; + case gsc::node_t::data_anim: emit_opcode(ctx, opcode::OP_GetAnim); break; + case gsc::node_t::data_level: emit_opcode(ctx, opcode::OP_GetLevel); break; + case gsc::node_t::data_animation: emit_animation(ctx, expr.as_animation); break; + case gsc::node_t::data_animtree: emit_animtree(ctx, expr.as_animtree); break; + case gsc::node_t::data_name: emit_local_variable(ctx, expr.as_name); break; + case gsc::node_t::data_istring: emit_istring(ctx, expr.as_istring); break; + case gsc::node_t::data_string: emit_string(ctx, expr.as_string); break; + case gsc::node_t::data_vector: emit_vector(ctx, expr.as_vector); break; + case gsc::node_t::data_float: emit_float(ctx, expr.as_float); break; + case gsc::node_t::data_integer: emit_integer(ctx, expr.as_integer); break; + case gsc::node_t::data_false: emit_false(ctx, expr.as_false); break; + case gsc::node_t::data_true: emit_true(ctx, expr.as_true); break; + default: throw gsc::comp_error(expr.as_node->loc, "unknown expression"); break; + } +} + +void compiler::emit_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr) +{ + if(expr->type == gsc::node_t::expr_increment) + { + emit_variable_ref(ctx, expr->lvalue, false); + emit_opcode(ctx, opcode::OP_inc); + emit_opcode(ctx, opcode::OP_SetVariableField); + } + else if(expr->type == gsc::node_t::expr_decrement) + { + emit_variable_ref(ctx, expr->lvalue, false); + emit_opcode(ctx, opcode::OP_dec); + emit_opcode(ctx, opcode::OP_SetVariableField); + } + else if(expr->type == gsc::node_t::expr_assign_equal) + { + if(expr->rvalue.as_node->type == gsc::node_t::data_undefined) + { + emit_expr_clear_variable(ctx, expr->lvalue); + } + else + { + emit_expr(ctx, expr->rvalue); + emit_variable_ref(ctx, expr->lvalue, true); + } + } + else + { + emit_expr(ctx, expr->lvalue); + emit_expr(ctx, expr->rvalue); + + switch(expr->type) + { + case gsc::node_t::expr_assign_add: emit_opcode(ctx, opcode::OP_plus); break; + case gsc::node_t::expr_assign_sub: emit_opcode(ctx, opcode::OP_minus); break; + case gsc::node_t::expr_assign_mult: emit_opcode(ctx, opcode::OP_multiply); break; + case gsc::node_t::expr_assign_div: emit_opcode(ctx, opcode::OP_divide); break; + case gsc::node_t::expr_assign_mod: emit_opcode(ctx, opcode::OP_mod); break; + case gsc::node_t::expr_assign_shift_left: emit_opcode(ctx, opcode::OP_shift_left); break; + case gsc::node_t::expr_assign_shift_right: emit_opcode(ctx, opcode::OP_shift_right); break; + case gsc::node_t::expr_assign_bitwise_or: emit_opcode(ctx, opcode::OP_bit_or); break; + case gsc::node_t::expr_assign_bitwise_and: emit_opcode(ctx, opcode::OP_bit_and); break; + case gsc::node_t::expr_assign_bitwise_exor: emit_opcode(ctx, opcode::OP_bit_ex_or); break; + default: throw gsc::comp_error(expr->loc, "unknown assign operation"); break; + } + + emit_variable_ref(ctx, expr->lvalue, true); + } +} + +void compiler::emit_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr) +{ + emit_expr(ctx, expr->lvalue); + emit_expr(ctx, expr->rvalue); + + switch(expr->type) + { + case gsc::node_t::expr_equality: emit_opcode(ctx, opcode::OP_equality); break; + case gsc::node_t::expr_inequality: emit_opcode(ctx, opcode::OP_inequality); break; + case gsc::node_t::expr_less: emit_opcode(ctx, opcode::OP_less); break; + case gsc::node_t::expr_greater: emit_opcode(ctx, opcode::OP_greater); break; + case gsc::node_t::expr_less_equal: emit_opcode(ctx, opcode::OP_less_equal); break; + case gsc::node_t::expr_greater_equal: emit_opcode(ctx, opcode::OP_greater_equal); break; + case gsc::node_t::expr_bitwise_or: emit_opcode(ctx, opcode::OP_bit_or); break; + case gsc::node_t::expr_bitwise_and: emit_opcode(ctx, opcode::OP_bit_and); break; + case gsc::node_t::expr_bitwise_exor: emit_opcode(ctx, opcode::OP_bit_ex_or); break; + case gsc::node_t::expr_shift_left: emit_opcode(ctx, opcode::OP_shift_left); break; + case gsc::node_t::expr_shift_right: emit_opcode(ctx, opcode::OP_shift_right); break; + case gsc::node_t::expr_add: emit_opcode(ctx, opcode::OP_plus); break; + case gsc::node_t::expr_sub: emit_opcode(ctx, opcode::OP_minus); break; + case gsc::node_t::expr_mult: emit_opcode(ctx, opcode::OP_multiply); break; + case gsc::node_t::expr_div: emit_opcode(ctx, opcode::OP_divide); break; + case gsc::node_t::expr_mod: emit_opcode(ctx, opcode::OP_mod); break; + default: throw gsc::comp_error(expr->loc, "unknown binary expression"); break; + } +} + +void compiler::emit_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr) +{ + auto label = create_label(); + + emit_expr(ctx, expr->lvalue); + emit_opcode(ctx, opcode::OP_JumpOnFalseExpr, label); + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_CastBool); + + insert_label(label); +} + +void compiler::emit_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr) +{ + auto label = create_label(); + + emit_expr(ctx, expr->lvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrueExpr, label); + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_CastBool); + + insert_label(label); +} + +void compiler::emit_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr) +{ + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_BoolComplement); +} + +void compiler::emit_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr) +{ + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_BoolNot); +} + +void compiler::emit_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + if(expr->func.as_node->type == gsc::node_t::expr_call_pointer) + { + emit_expr_call_pointer(ctx, expr); + } + else + { + emit_expr_call_function(ctx, expr); + } +} + +void compiler::emit_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + bool thread = expr->thread; + bool child = expr->child; + bool method = expr->obj.as_node->type != gsc::node_t::null ? true : false; + bool builtin = builtin = expr->func.as_pointer->builtin; + std::uint32_t args = expr->func.as_pointer->args->list.size(); + + if(thread && child || thread && builtin || child && builtin) + throw gsc::comp_error(expr->loc, "function call have more than 1 type (thread, childthread, builtin)"); + + if(!thread && !child && !builtin) emit_opcode(ctx, opcode::OP_PreScriptCall); + + emit_expr_arguments(ctx, expr->func.as_pointer->args); + + if(method) emit_expr(ctx, expr->obj); + + emit_expr(ctx, expr->func.as_pointer->expr); + emit_expr_call_pointer_type(ctx, args, builtin, method, thread, child); +} + +void compiler::emit_expr_call_pointer_type(const gsc::context_ptr& ctx, int args, bool builtin, bool method, bool thread, bool child) +{ + if(builtin && !method) + { + emit_opcode(ctx, opcode::OP_CallBuiltinPointer, utils::string::va("%d", args)); + } + else if(builtin && method) + { + emit_opcode(ctx, opcode::OP_CallBuiltinMethodPointer, utils::string::va("%d", args)); + } + else if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptThreadCallPointer, utils::string::va("%d", args)); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptMethodThreadCallPointer, utils::string::va("%d", args)); + } + else if (child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptChildThreadCallPointer, utils::string::va("%d", args)); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptMethodChildThreadCallPointer, utils::string::va("%d", args)); + } + else + { + method ? emit_opcode(ctx, opcode::OP_ScriptMethodCallPointer) : emit_opcode(ctx, opcode::OP_ScriptFunctionCallPointer); + } +} + +void compiler::emit_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + bool thread = expr->thread; + bool child = expr->child; + bool method = expr->obj.as_node->type != gsc::node_t::null ? true : false; + std::uint32_t args = expr->func.as_func->args->list.size(); + auto name = expr->func.as_func->name->value; + auto file = expr->func.as_func->file->value; + + bool builtin = false, far = false, local = false; + + if(file != "") far = true; + else + { + if(is_local_call(name)) local = true; + else if(method && is_builtin_method(name)) builtin = true; + else if(!method && is_builtin_func(name)) builtin = true; + else + { + for(const auto& inc : includes_) + { + for(const auto& fun : inc.funcs) + { + if(name == fun) + { + far = true; + file = inc.name; + break; + } + } + } + + if(!builtin && !far && !local) + throw gsc::comp_error(expr->loc, "unknown function call " + name); + } + } + + if(thread && child || thread && builtin || child && builtin) + throw gsc::comp_error(expr->loc, "function call have more than 1 type (thread, childthread, builtin)"); + + if(!thread && !child && !builtin && !(!method && args == 0)) + emit_opcode(ctx, opcode::OP_PreScriptCall); + + emit_expr_arguments(ctx, expr->func.as_func->args); + + if(method) emit_expr(ctx, expr->obj); + + if(builtin) emit_expr_call_function_builtin(ctx, name, args, method); + else if(local) emit_expr_call_function_local(ctx, name, args, method, thread, child); + else if(far) emit_expr_call_function_far(ctx, file, name, args, method, thread, child); +} + +void compiler::emit_expr_call_function_builtin(const gsc::context_ptr& ctx, const std::string& func, int args, bool method) +{ + if(method) + { + switch(args) + { + case 0: emit_opcode(ctx, opcode::OP_CallBuiltinMethod0, func); break; + case 1: emit_opcode(ctx, opcode::OP_CallBuiltinMethod1, func); break; + case 2: emit_opcode(ctx, opcode::OP_CallBuiltinMethod2, func); break; + case 3: emit_opcode(ctx, opcode::OP_CallBuiltinMethod3, func); break; + case 4: emit_opcode(ctx, opcode::OP_CallBuiltinMethod4, func); break; + case 5: emit_opcode(ctx, opcode::OP_CallBuiltinMethod5, func); break; + default: emit_opcode(ctx, opcode::OP_CallBuiltinMethod, { utils::string::va("%d", args), func }); break; + } + } + else + { + switch(args) + { + case 0: emit_opcode(ctx, opcode::OP_CallBuiltin0, func); break; + case 1: emit_opcode(ctx, opcode::OP_CallBuiltin1, func); break; + case 2: emit_opcode(ctx, opcode::OP_CallBuiltin2, func); break; + case 3: emit_opcode(ctx, opcode::OP_CallBuiltin3, func); break; + case 4: emit_opcode(ctx, opcode::OP_CallBuiltin4, func); break; + case 5: emit_opcode(ctx, opcode::OP_CallBuiltin5, func); break; + default: emit_opcode(ctx, opcode::OP_CallBuiltin, { utils::string::va("%d", args), func }); break; + } + } +} + +void compiler::emit_expr_call_function_local(const gsc::context_ptr& ctx, const std::string& func, int args, bool method, bool thread, bool child) +{ + if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalThreadCall, { func, utils::string::va("%d", args) }); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodThreadCall, { func, utils::string::va("%d", args) }); + } + else if(child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptLocalChildThreadCall, { func, utils::string::va("%d", args) }); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodChildThreadCall, { func, utils::string::va("%d", args) }); + } + else if(method && !thread && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodCall, func); + } + else if(!thread && !child && !method && args == 0) + { + emit_opcode(ctx, opcode::OP_ScriptLocalFunctionCall2, func); + } + else if(!thread && !child && !method && args != 0) + { + emit_opcode(ctx, opcode::OP_ScriptLocalFunctionCall, func); + } +} + +void compiler::emit_expr_call_function_far(const gsc::context_ptr& ctx, const std::string& file, const std::string& func, int args, bool method, bool thread, bool child) +{ + if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptFarThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptFarChildThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodChildThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(!thread && !child && method) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodCall, { file, func }); + } + else if(!thread && !child && !method && args == 0) + { + emit_opcode(ctx, opcode::OP_ScriptFarFunctionCall2, { file, func }); + } + else if(!thread && !child && !method && args != 0) + { + emit_opcode(ctx, opcode::OP_ScriptFarFunctionCall, { file, func }); + } +} + +void compiler::emit_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& args) +{ + std::reverse(args->list.begin(), args->list.end()); + + for(auto& arg : args->list) + { + emit_expr(ctx, arg); + } +} + +void compiler::emit_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& expr) +{ + bool far = false, local = false, builtin = false, method = false; + auto name = expr->name->value; + auto file = expr->file->value; + + if(file != "") + { + far = true; + } + else if(is_builtin_method(name)) + { + builtin = true; + method = true; + } + else if(is_builtin_func(name)) + { + builtin = true; + } + else if(is_local_call(name)) + { + local = true; + } + + if(local) + { + emit_opcode(ctx, opcode::OP_GetLocalFunction, name); + } + else if(far) + { + emit_opcode(ctx, opcode::OP_GetFarFunction, { file, name } ); + } + else if(builtin && method) + { + emit_opcode(ctx, opcode::OP_GetBuiltinMethod, name); + } + else if(builtin && !method) + { + emit_opcode(ctx, opcode::OP_GetBuiltinFunction, name); + } +} + +void compiler::emit_expr_clear_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& lvalue) +{ + switch(lvalue.as_node->type) + { + case gsc::node_t::expr_array: + emit_expr(ctx, lvalue.as_array->key); + lvalue.as_array->obj.as_node->type == gsc::node_t::data_game ? emit_opcode(ctx, opcode::OP_GetGameRef) : emit_variable_ref(ctx, lvalue.as_array->obj, false); + emit_opcode(ctx, opcode::OP_ClearArray); + break; + case gsc::node_t::expr_field: + emit_object(ctx, lvalue.as_field->obj); + emit_opcode(ctx, opcode::OP_ClearFieldVariable,lvalue.as_field->field->value); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_GetUndefined); + emit_local_variable_ref(ctx, lvalue.as_name, true); + break; + default: + throw gsc::comp_error(lvalue.as_node->loc, "unknown clear variable lvalue"); + break; + } +} + +void compiler::emit_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr) +{ + if(expr->args->list.size() <= 0) + { + throw gsc::comp_error(expr->loc, "invalid empty add array. did u mean '[]' ?"); + } + + emit_opcode(ctx, opcode::OP_EmptyArray); + + for(const auto& arg : expr->args->list) + { + emit_expr(ctx, arg); + emit_opcode(ctx, opcode::OP_AddArray); + } +} + +void compiler::emit_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr) +{ + emit_variable(ctx, expr->obj); + emit_opcode(ctx, opcode::OP_size); +} + +void compiler::emit_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr, bool set) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_array: emit_array_variable_ref(ctx, expr.as_array, set); break; + case gsc::node_t::expr_field: emit_field_variable_ref(ctx, expr.as_field, set); break; + case gsc::node_t::data_name: emit_local_variable_ref(ctx, expr.as_name, set); break; + default: throw gsc::comp_error(expr.as_node->loc, "invalid variable reference type."); break; + } +} + +void compiler::emit_array_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr, bool set) +{ + emit_expr(ctx, expr->key); + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_game: + emit_opcode(ctx, opcode::OP_GetGameRef); + emit_opcode(ctx, opcode::OP_EvalArrayRef); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_array: + case gsc::node_t::expr_field: + emit_variable_ref(ctx, expr->obj, false); + emit_opcode(ctx, opcode::OP_EvalArrayRef); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::data_name: + { + if(!variable_initialized(ctx, expr->obj.as_name)) + { + initialize_variable(ctx, expr->obj.as_name); + emit_opcode(ctx, opcode::OP_EvalNewLocalArrayRefCached0, variable_create_index(ctx, expr->obj.as_name)); + + if(!set) + { + throw gsc::comp_error(expr->loc, "INTERNAL: VAR CREATED BUT NOT SET!"); + } + } + else if(variable_stack_index(ctx, expr->obj.as_name) == 0) + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayRefCached0); + } + else + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayRefCached, variable_access_index(ctx, expr->obj.as_name)); + } + + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + } + break; + case gsc::node_t::expr_call: + throw gsc::comp_error(expr->loc, "call result can't be referenced."); + break; + default: + throw gsc::comp_error(expr->loc, "unknown array object type"); + break; + } +} + +void compiler::emit_field_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr, bool set) +{ + const auto& field = expr->field->value; + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_level: + set ? emit_opcode(ctx, opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalLevelFieldVariableRef, field); + break; + case gsc::node_t::data_anim: + set ? emit_opcode(ctx, opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalAnimFieldVariableRef, field); + break; + case gsc::node_t::data_self: + set ? emit_opcode(ctx, opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalSelfFieldVariableRef, field); + break; + case gsc::node_t::expr_array: + emit_array_variable(ctx, expr->obj.as_array); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_field: + emit_field_variable(ctx, expr->obj.as_field); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr->obj.as_name)); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_call: + throw gsc::comp_error(expr->loc, "function call result can't be referenced"); + break; + default: + throw gsc::comp_error(expr->loc, "unknown field variable object type"); + break; + } +} + +void compiler::emit_local_variable_ref(const gsc::context_ptr& ctx, const gsc::name_ptr& expr, bool set) +{ + const auto itr = constants_.find(expr->value); + + if (itr != constants_.end()) + { + throw gsc::comp_error(expr->loc, "variable name already defined as constant " + expr->value); + } + + if(set) + { + if(!variable_initialized(ctx, expr)) + { + initialize_variable(ctx, expr); + emit_opcode(ctx, opcode::OP_SetNewLocalVariableFieldCached0, variable_create_index(ctx, expr)); + } + else if(variable_stack_index(ctx, expr) == 0) + { + emit_opcode(ctx, opcode::OP_SetLocalVariableFieldCached0); + } + else + { + emit_opcode(ctx, opcode::OP_SetLocalVariableFieldCached, variable_access_index(ctx, expr)); + } + } + else + { + auto index = variable_stack_index(ctx, expr); + + if(index == 0) + emit_opcode(ctx, opcode::OP_EvalLocalVariableRefCached0); + else + emit_opcode(ctx, opcode::OP_EvalLocalVariableRefCached, variable_access_index(ctx, expr)); + } +} + +void compiler::emit_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + // for obj.size + switch(expr.as_node->type) + { + case gsc::node_t::expr_array: emit_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: emit_field_variable(ctx, expr.as_field); break; + case gsc::node_t::data_name: emit_local_variable(ctx, expr.as_name); break; + case gsc::node_t::expr_call: emit_expr_call(ctx, expr.as_call); break; + default: throw gsc::comp_error(expr.as_node->loc, "invalid variable type."); break; + } +} + +void compiler::emit_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr) +{ + emit_expr(ctx, expr->key); + + if(expr->obj.as_node->type == gsc::node_t::data_name) + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayCached, variable_access_index(ctx, expr->obj.as_name)); + } + else + { + emit_expr(ctx, expr->obj); + emit_opcode(ctx, opcode::OP_EvalArray); + } +} + +void compiler::emit_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr) +{ + const auto& field = expr->field->value; + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_level: + emit_opcode(ctx, opcode::OP_EvalLevelFieldVariable, field); + break; + case gsc::node_t::data_anim: + emit_opcode(ctx, opcode::OP_EvalAnimFieldVariable, field); + break; + case gsc::node_t::data_self: + emit_opcode(ctx, opcode::OP_EvalSelfFieldVariable, field); + break; + case gsc::node_t::expr_array: + emit_array_variable(ctx, expr->obj.as_array); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::expr_field: + emit_field_variable(ctx, expr->obj.as_field); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::expr_call: + emit_expr_call(ctx, expr->obj.as_call); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr->obj.as_name)); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + default: + throw gsc::comp_error(expr->loc, "unknown field variable object type"); + break; + } +} + +void compiler::emit_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + // is constant ( should only allow: string, loc string, number, vector) + const auto itr = constants_.find(expr->value); + + if (itr != constants_.end()) + { + const auto& value = itr->second; + emit_expr(ctx, value); + return; + } + + // is local var + auto index = variable_stack_index(ctx, expr); + + switch(index) + { + case 0: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached0); break; + case 1: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached1); break; + case 2: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached2); break; + case 3: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached3); break; + case 4: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached4); break; + case 5: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached5); break; + default: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached, variable_access_index(ctx, expr)); break; + } +} + +void compiler::emit_clear_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + auto index = variable_stack_index(ctx, expr); + + if(index == 0) + { + emit_opcode(ctx, opcode::OP_ClearLocalVariableFieldCached0); + } + else + { + emit_opcode(ctx, opcode::OP_ClearLocalVariableFieldCached, variable_access_index(ctx, expr)); + } +} + +void compiler::emit_create_local_vars(const gsc::context_ptr& ctx) +{ + if ( ctx->local_vars_create_count != ctx->local_vars_public_count ) + { + for(auto i = ctx->local_vars_create_count; i < ctx->local_vars_public_count; i++) + { + auto data = utils::string::va("%d", ctx->local_vars.at(i).create); + emit_opcode(ctx, opcode::OP_CreateLocalVariable, data); + ctx->local_vars.at(i).init = true; + } + ctx->local_vars_create_count = ctx->local_vars_public_count; + } +} + +void compiler::emit_remove_local_vars(const gsc::context_ptr& ctx) +{ + if(ctx->abort == abort_t::abort_none) + { + auto count = ctx->local_vars_create_count - ctx->local_vars_public_count; + + if(count > 0) + { + auto data = utils::string::va("%d", count); + emit_opcode(ctx, opcode::OP_RemoveLocalVariables, data); + } + } +} + +void compiler::emit_object(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + // need revision used for clear variable + switch(expr.as_node->type) + { + case gsc::node_t::data_level: + emit_opcode(ctx, opcode::OP_GetLevelObject); + break; + case gsc::node_t::data_anim: + emit_opcode(ctx, opcode::OP_GetAnimObject); + break; + case gsc::node_t::data_self: + emit_opcode(ctx, opcode::OP_GetSelfObject); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr.as_name)); + break; + case gsc::node_t::expr_call: + emit_expr_call(ctx, expr.as_call); + emit_opcode(ctx, opcode::OP_CastFieldObject); + break; + // array ? + // field ? + default: + throw gsc::comp_error(expr.as_node->loc, "unknown object type"); + break; + } +} + +void compiler::emit_animtree(const gsc::context_ptr& ctx, const gsc::animtree_ptr& animtree) +{ + if(animtrees_.size() == 0) + { + throw gsc::comp_error( animtree->loc, "trying to use animtree without specified using animtree"); + } + + auto& tree = animtrees_.back(); + + if(tree.loaded) + { + emit_opcode(ctx, opcode::OP_GetAnimTree, "''"); + } + else + { + emit_opcode(ctx, opcode::OP_GetAnimTree, tree.name); + tree.loaded = true; + } +} + +void compiler::emit_animation(const gsc::context_ptr& ctx, const gsc::animation_ptr& animation) +{ + if(animtrees_.size() == 0) + { + throw gsc::comp_error(animation->loc, "trying to use animation without specified using animtree"); + } + + auto& tree = animtrees_.back(); + + if(tree.loaded) + { + emit_opcode(ctx, opcode::OP_GetAnimation, { "''", animation->value }); + } + else + { + emit_opcode(ctx, opcode::OP_GetAnimation, { tree.name, animation->value }); + tree.loaded = true; + } +} + +void compiler::emit_istring(const gsc::context_ptr& ctx, const gsc::istring_ptr& str) +{ + emit_opcode(ctx, opcode::OP_GetIString, str->value); +} + +void compiler::emit_string(const gsc::context_ptr& ctx, const gsc::string_ptr& str) +{ + emit_opcode(ctx, opcode::OP_GetString, str->value); +} + +void compiler::emit_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec) +{ + std::vector data; + + bool expr = false; + + if(vec->x.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->x.as_integer->value); + else if(vec->x.as_node->type == gsc::node_t::data_float) + data.push_back(vec->x.as_float->value); + else expr = true; + + if(vec->y.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->y.as_integer->value); + else if(vec->y.as_node->type == gsc::node_t::data_float) + data.push_back(vec->y.as_float->value); + else expr = true; + + if(vec->z.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->z.as_integer->value); + else if(vec->z.as_node->type == gsc::node_t::data_float) + data.push_back(vec->z.as_float->value); + else expr = true; + + if(!expr) + { + emit_opcode(ctx, opcode::OP_GetVector, data); + } + else + { + emit_expr(ctx, vec->z); + emit_expr(ctx, vec->y); + emit_expr(ctx, vec->x); + emit_opcode(ctx, opcode::OP_vector); + } +} + +void compiler::emit_float(const gsc::context_ptr& ctx, const gsc::float_ptr& num) +{ + emit_opcode(ctx, opcode::OP_GetFloat, num->value); +} + +void compiler::emit_integer(const gsc::context_ptr& ctx, const gsc::integer_ptr& num) +{ + auto value = std::atoi(num->value.data()); + + if(value == 0) + { + emit_opcode(ctx, opcode::OP_GetZero); + } + else if(value > 0 && value < 256) + { + emit_opcode(ctx, opcode::OP_GetByte, num->value); + } + else if(value < 0 && value > -256) + { + emit_opcode(ctx, opcode::OP_GetNegByte, num->value.substr(1)); + } + else if(value < 65536) + { + emit_opcode(ctx, opcode::OP_GetUnsignedShort, num->value); + } + else if(value < 0 && value > -65536) + { + emit_opcode(ctx, opcode::OP_GetNegUnsignedShort, num->value.substr(1)); + } + else + { + emit_opcode(ctx, opcode::OP_GetInteger, num->value); + } +} + +void compiler::emit_false(const gsc::context_ptr& ctx, const gsc::false_ptr& expr) +{ + emit_opcode(ctx, opcode::OP_GetZero); +} + +void compiler::emit_true(const gsc::context_ptr& ctx, const gsc::true_ptr& expr) +{ + emit_opcode(ctx, opcode::OP_GetByte, "1"); +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + + index_ += inst->size; +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::string& data) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + inst->data.push_back(data); + + index_ += inst->size; +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::vector& data) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + inst->data = data; + + index_ += inst->size; +} + +void compiler::process_thread(const gsc::context_ptr& ctx, const gsc::thread_ptr& thread) +{ + process_parameters(ctx, thread->params); + process_stmt_list(ctx, thread->block); +} + +void compiler::process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + register_variable(ctx, param->value); + } +} + +void compiler::process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt) +{ + switch (stmt.as_node->type) + { + case gsc::node_t::stmt_list: process_stmt_list(ctx, stmt.as_list); break; + case gsc::node_t::stmt_assign: process_expr(ctx, stmt.as_assign->expr->lvalue); break; + case gsc::node_t::stmt_waittill: process_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_if: process_stmt_if(ctx, stmt.as_if); break; + case gsc::node_t::stmt_ifelse: process_stmt_ifelse(ctx, stmt.as_ifelse); break; + case gsc::node_t::stmt_while: process_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: process_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: process_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: process_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_break: process_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_continue: process_stmt_continue(ctx, stmt.as_continue); break; + case gsc::node_t::stmt_return: process_stmt_return(ctx, stmt.as_return); break; + default: break; + } +} + +void compiler::process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + for (const auto& entry : stmt->stmts) + { + process_stmt(ctx, entry); + } +} + +void compiler::process_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + if(expr.as_node->type == gsc::node_t::data_name) + { + register_variable(ctx, expr.as_name->value); + } + else if(expr.as_node->type == gsc::node_t::expr_array) + { + process_expr(ctx, expr.as_array->obj); + } +} + +void compiler::process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + register_variable(ctx, arg.as_name->value); + } + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); +} + +void compiler::process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt) +{ + stmt->ctx = std::make_unique(); + + ctx->copy(stmt->ctx); + process_stmt(stmt->ctx, stmt->stmt); + + std::vector childs({ stmt->ctx.get() }); + ctx->merge(childs); +} + +void compiler::process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt) +{ + std::vector childs; + auto abort = abort_t::abort_return; + + stmt->ctx_if = std::make_unique(); + stmt->ctx_else = std::make_unique(); + + ctx->copy(stmt->ctx_if); + process_stmt(stmt->ctx_if, stmt->stmt_if); + + if(stmt->ctx_if->abort <= abort_t::abort_return) + { + abort = stmt->ctx_if->abort; + if(abort == abort_t::abort_none) + childs.push_back(stmt->ctx_if.get()); + } + + ctx->copy(stmt->ctx_else); + process_stmt(stmt->ctx_else, stmt->stmt_else); + + if(stmt->ctx_else->abort <= abort) + { + abort = stmt->ctx_else->abort; + if(abort == abort_t::abort_none) + childs.push_back(stmt->ctx_else.get()); + } + + if(ctx->abort == abort_t::abort_none) + ctx->abort = abort; + + ctx->append(childs); + ctx->merge(childs); +} + +void compiler::process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + bool const_cond = is_constant_condition(stmt->expr); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + stmt->ctx = std::make_unique(); + + ctx->copy(stmt->ctx); + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + if(const_cond) ctx->append(break_ctxs_); + + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + bool const_cond = is_constant_condition(stmt->expr); + + stmt->ctx = std::make_unique(); + stmt->ctx_post = std::make_unique(); + + process_stmt(ctx, stmt->pre_expr); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + ctx->copy(stmt->ctx); + ctx->copy(stmt->ctx_post); + + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + process_stmt(stmt->ctx_post, stmt->post_expr); + + ctx->append({ stmt->ctx_post.get() }); + ctx->merge({ stmt->ctx_post.get() }); + + if(const_cond) ctx->append(break_ctxs_); + + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + auto array_name = utils::string::va("temp_%d", ++label_idx_); + auto key_name = utils::string::va("temp_%d", ++label_idx_); + + stmt->array = expr_ptr(std::make_unique(stmt->loc, array_name)); + + if(!stmt->use_key) + stmt->key_expr = expr_ptr(std::make_unique(stmt->loc, key_name)); + + key_name = stmt->key_expr.as_name->value; + + // calculate variables + + stmt->ctx = std::make_unique(); + stmt->ctx_post = std::make_unique(); + + // calculate pre_expr variables + process_expr(ctx, stmt->array); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + ctx->copy(stmt->ctx); + ctx->copy(stmt->ctx_post); + + // calculate stmt variables & add missing array access as first stmt + process_expr(stmt->ctx, stmt->value_expr); + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + process_expr(stmt->ctx_post, stmt->key_expr); + + ctx->append({ stmt->ctx_post.get() }); + ctx->merge({ stmt->ctx_post.get() }); + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + auto stmt_list = std::make_unique(stmt->stmt->loc); + auto current_case = gsc::stmt_ptr(std::make_unique()); + + auto num = stmt->stmt->stmts.size(); + + for(auto i = 0; i < num; i++) + { + auto& entry = stmt->stmt->stmts[0]; + + if(entry.as_node->type == gsc::node_t::stmt_case || entry.as_node->type == gsc::node_t::stmt_default) + { + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + current_case = std::move(stmt->stmt->stmts[0]); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + else + { + if(current_case.as_node->type != gsc::node_t::null) + { + if(current_case.as_node->type == gsc::node_t::stmt_case) + { + current_case.as_case->stmt->stmts.push_back(std::move(entry)); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + else + { + current_case.as_default->stmt->stmts.push_back(std::move(entry)); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + } + else + { + gsc::comp_error(entry.as_node->loc, "missing case statement"); + } + } + } + + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + // calculate variables + stmt->ctx = std::make_unique(); + std::vector childs; + auto abort = abort_t::abort_return; + bool has_default = false; + gsc::context* default_ctx = nullptr; + auto old_breaks = break_ctxs_; + break_ctxs_.clear(); + + for(auto i = 0; i < stmt_list->stmts.size(); i++) + { + auto& entry = stmt_list->stmts[i]; + + if(entry.as_node->type == gsc::node_t::stmt_case) + { + entry.as_case->ctx = std::make_unique(); + ctx->copy(entry.as_case->ctx); + process_stmt_list(entry.as_case->ctx, entry.as_case->stmt); + + if (entry.as_case->ctx->abort != abort_t::abort_none) + { + if (entry.as_case->ctx->abort == abort_t::abort_break ) + { + entry.as_case->ctx->abort = abort_t::abort_none; + abort = abort_t::abort_none; + childs.push_back(entry.as_case->ctx.get()); + } + else if (entry.as_case->ctx->abort <= abort ) + { + abort = entry.as_case->ctx->abort; + } + } + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + entry.as_default->ctx = std::make_unique(); + ctx->copy(entry.as_default->ctx); + process_stmt_list(entry.as_default->ctx, entry.as_default->stmt); + has_default = true; + default_ctx = entry.as_default->ctx.get(); + + if (entry.as_default->ctx->abort != abort_t::abort_none) + { + if (entry.as_default->ctx->abort == abort_t::abort_break ) + { + entry.as_default->ctx->abort = abort_t::abort_none; + abort = abort_t::abort_none; + childs.push_back(entry.as_default->ctx.get()); + } + else if (entry.as_default->ctx->abort <= abort ) + { + abort = entry.as_default->ctx->abort; + } + } + } + } + + stmt->stmt =std::move(stmt_list); + + if(has_default) + { + if(default_ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(default_ctx); + + if(ctx->abort == abort_t::abort_none) + ctx->abort = abort; + } + + ctx->append(break_ctxs_); + ctx->merge(childs); + } + + break_ctxs_ = old_breaks; +} + +void compiler::process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(ctx.get()); + ctx->abort = abort_t::abort_break; + } +} + +void compiler::process_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + continue_ctxs_.push_back(ctx.get()); + ctx->abort = abort_t::abort_continue; + } +} + +void compiler::process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + ctx->abort = abort_t::abort_return; + } +} + +void compiler::register_variable(const gsc::context_ptr& ctx, const std::string& name) +{ + auto it = std::find_if(ctx->local_vars.begin(), ctx->local_vars.end(), + [&](const gsc::local_var& v) { return v.name == name; }); + + if(it == ctx->local_vars.end()) + { + auto found = false; + for(std::size_t i = 0; i < local_stack_.size(); i++) + { + if(local_stack_[i] == name) + { + ctx->local_vars.push_back({ name, static_cast(i), false }); + found = true; + break; + } + } + + if(!found) + { + ctx->local_vars.push_back({ name, stack_idx_, false }); + local_stack_.push_back(name); + stack_idx_++; + } + } +} + +void compiler::initialize_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name) +{ + for(std::uint32_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(!ctx->local_vars[i].init) + { + for(std::uint32_t j = 0; j < i; j++) + { + if(!ctx->local_vars[j].init) + { + emit_opcode(ctx, opcode::OP_CreateLocalVariable, utils::string::va("%d", ctx->local_vars[j].create)); + ctx->local_vars[j].init = true; + //ctx->local_vars_create_count++; + } + } + ctx->local_vars[i].init = true; + ctx->local_vars_create_count = i + 1; + return; + } + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +void compiler::create_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name) +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + auto& var = ctx->local_vars.at(i); + if(var.name == name->value) + { + if(!var.init) + { + emit_opcode(ctx, opcode::OP_CreateLocalVariable, utils::string::va("%d", var.create)); + var.init = true; + ctx->local_vars_create_count++; + } + return; + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_stack_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::uint8_t +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(ctx->local_vars.at(i).init) + { + return ctx->local_vars_create_count - 1 - i; + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not initialized."); + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_create_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + return utils::string::va("%d", ctx->local_vars[i].create); + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_access_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(ctx->local_vars.at(i).init) + { + return utils::string::va("%d", ctx->local_vars_create_count - 1 - i); + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not initialized."); + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_initialized(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> bool +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + return ctx->local_vars.at(i).init; + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::is_local_call(const std::string& name) -> bool +{ + for(const auto& f : local_functions_) + { + if(f == name) return true; + } + + return false; +} + +auto compiler::is_builtin_call(const std::string& name) -> bool +{ + if(is_builtin_func(name)) return true; + + if(is_builtin_method(name)) return true; + + return false; +} + +auto compiler::is_builtin_func(const std::string& name) -> bool +{ + return resolver::find_function(name); +} +auto compiler::is_builtin_method(const std::string& name) -> bool +{ + return resolver::find_method(name); +} + +auto compiler::is_constant_condition(const gsc::expr_ptr& expr) -> bool +{ + switch(expr.as_node->type) + { + case gsc::node_t::null: + case gsc::node_t::data_true: + return true; + case gsc::node_t::data_false: + throw gsc::comp_error(expr.as_node->loc, "condition can't be always false!"); + case gsc::node_t::data_integer: + { + auto num = std::stoi(expr.as_integer->value); + if(num != 0) + return true; + else + throw gsc::comp_error(expr.as_node->loc, "condition can't be always false!"); + } + default: + break; + } + + return false; +} + +auto compiler::create_label() -> std::string +{ + label_idx_++; + auto name = utils::string::va("loc_%d", label_idx_); + return name; +} + +auto compiler::insert_label() -> std::string +{ + const auto itr = function_->labels.find(index_); + + if (itr != function_->labels.end()) + { + return itr->second; + } + else + { + label_idx_++; + auto name = utils::string::va("loc_%d", label_idx_); + function_->labels.insert({index_, name}); + return name; + } +} + +void compiler::insert_label(const std::string& name) +{ + const auto itr = function_->labels.find(index_); + + if (itr != function_->labels.end()) + { + for(auto& inst : function_->instructions) + { + switch (opcode(inst->opcode)) + { + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_jump: + case opcode::OP_jumpback: + case opcode::OP_switch: + if(inst->data[0] == name) + inst->data[0] = itr->second; + break; + case opcode::OP_endswitch: + default: + break; + } + } + } + else + { + function_->labels.insert({index_, name}); + } +} + + +gsc::include_t compiler::include_maps_mp_utility_ = +{ + "maps/mp/_utility", + { + "exploder_sound", + "_beginlocationselection", + "stoplocationselection", + "endselectiononemp", + "endselectiononaction", + "endselectiononendgame", + "isattachment", + "getattachmenttype", + "delaythread", + "delaythread_proc", + "getplant", + "orienttonormal", + "deleteplacedentity", + "playsoundonplayers", + "sortlowermessages", + "addlowermessage", + "removelowermessage", + "getlowermessage", + "setlowermessage", + "updatelowermessage", + "clearondeath", + "clearafterfade", + "clearlowermessage", + "clearlowermessages", + "printonteam", + "printboldonteam", + "printboldonteamarg", + "printonteamarg", + "printonplayers", + "printandsoundoneveryone", + "printandsoundonteam", + "printandsoundonplayer", + "_playlocalsound", + "dvarintvalue", + "dvarfloatvalue", + "play_sound_on_tag", + "getotherteam", + "wait_endon", + "initpersstat", + "getpersstat", + "incpersstat", + "setpersstat", + "initplayerstat", + "incplayerstat", + "setplayerstat", + "getplayerstat", + "getplayerstattime", + "setplayerstatifgreater", + "setplayerstatiflower", + "updatepersratio", + "updatepersratiobuffered", + "waittillslowprocessallowed", + "waitfortimeornotify", + "isexcluded", + "leaderdialog", + "leaderdialogbothteams", + "leaderdialogonplayers", + "leaderdialogonplayer", + "playleaderdialogonplayer", + "updatemainmenu", + "updateobjectivetext", + "setobjectivetext", + "setobjectivescoretext", + "setobjectivehinttext", + "getobjectivetext", + "getobjectivescoretext", + "getobjectivehinttext", + "gettimepassed", + "getsecondspassed", + "getminutespassed", + "clearkillcamstate", + "isinkillcam", + "isvalidclass", + "getvalueinrange", + "waitfortimeornotifies", + "closemenus", + "logxpgains", + "registerroundswitchdvar", + "registerroundlimitdvar", + "registerwinlimitdvar", + "registerscorelimitdvar", + "registertimelimitdvar", + "registerhalftimedvar", + "registernumlivesdvar", + "setovertimelimitdvar", + "get_damageable_player", + "get_damageable_sentry", + "get_damageable_grenade", + "get_damageable_mine", + "get_damageable_player_pos", + "getstancecenter", + "get_damageable_grenade_pos", + "getdvarvec", + "strip_suffix", + "_takeweaponsexcept", + "savedata", + "restoredata", + "_setactionslot", + "isfloat", + "registerwatchdvarint", + "registerwatchdvarfloat", + "registerwatchdvar", + "setoverridewatchdvar", + "getwatcheddvar", + "updatewatcheddvars", + "isroundbased", + "islastround", + "wasonlyround", + "waslastround", + "hitroundlimit", + "hitscorelimit", + "hitwinlimit", + "getscorelimit", + "getroundswon", + "isobjectivebased", + "gettimelimit", + "gethalftime", + "inovertime", + "gamehasstarted", + "getaverageorigin", + "getlivingplayers", + "setusingremote", + "getremotename", + "freezecontrolswrapper", + "clearusingremote", + "isusingremote", + "queuecreate", + "queueadd", + "queueremovefirst", + "_giveweapon", + "_hasperk", + "giveperk", + "_setperk", + "_setextraperks", + "_unsetperk", + "_unsetextraperks", + "_clearperks", + "quicksort", + "quicksortmid", + "swap", + "_suicide", + "isreallyalive", + "playdeathsound", + "rankingenabled", + "privatematch", + "matchmakinggame", + "setaltsceneobj", + "endsceneondeath", + "getgametypenumlives", + "givecombathigh", + "arrayinsertion", + "getproperty", + "getintproperty", + "getfloatproperty", + "statusmenu", + "ischangingweapon", + "killshouldaddtokillstreak", + "streakshouldchain", + "isjuggernaut", + "iskillstreakweapon", + "isenvironmentweapon", + "getweaponclass", + "isdeathstreakweapon", + "getbaseweaponname", + "fixakimbostring", + "playsoundinspace", + "limitdecimalplaces", + "rounddecimalplaces", + "playerforclientid", + "isrested", + "stringtofloat", + "setselfusable", + "maketeamusable", + "_updateteamusable", + "makeenemyusable", + "_updateenemyusable", + "getnextlifeid", + "initgameflags", + "gameflaginit", + "gameflag", + "gameflagset", + "gameflagclear", + "gameflagwait", + "isprimarydamage", + "isbulletdamage", + "initlevelflags", + "levelflaginit", + "levelflag", + "levelflagset", + "levelflagclear", + "levelflagwait", + "levelflagwaitopen", + "getweaponattachments", + "isemped", + "isairdenied", + "isnuked", + "getplayerforguid", + "teamplayercardsplash", + "iscacprimaryweapon", + "iscacsecondaryweapon", + "getlastlivingplayer", + "getpotentiallivingplayers", + "waittillrecoveredhealth", + "attachmentmap", + "validateattachment", + "_objective_delete", + "touchingbadtrigger", + "setthirdpersondof", + "killtrigger", + "findisfacing", + "combinearrays", + "setrecoilscale", + "cleanarray", + "notusableforjoiningplayers", + "isstrstart", + "validateusestreak", + "currentactivevehiclecount", + "maxvehiclesallowed", + "incrementfauxvehiclecount", + "decrementfauxvehiclecount", + "lightweightscalar", + "allowteamchoice", + "allowclasschoice", + "isbuffunlockedforweapon", + "isbuffequippedonweapon", + "setcommonrulesfrommatchrulesdata", + "reinitializematchrulesonmigration", + "getmatchrulesspecialclass", + "recipeclassapplyjuggernaut", + } +}; + +gsc::include_t compiler::include_common_scripts_createfx_ = +{ + "common_scripts/_createfx", + { + "createeffect", + "getloopeffectdelaydefault", + "getoneshoteffectdelaydefault", + "getexploderdelaydefault", + "getintervalsounddelaymindefault", + "getintervalsounddelaymaxdefault", + "add_effect", + "createloopsound", + "createintervalsound", + "createnewexploder", + "createexploderex", + "set_origin_and_angles", + "set_forward_and_up_vectors", + "createfx_common", + "createfxlogic", + "copy_angles_of_selected_ents", + "reset_axis_of_selected_ents", + "last_selected_entity_has_changed", + "createfx_showorigin", + "drop_selection_to_ground", + "set_off_exploders", + "draw_distance", + "createfx_autosave", + "rotate_over_time", + "delete_pressed", + "remove_selected_option", + "remove_option", + "delete_selection", + "move_selection_to_cursor", + "insert_effect", + "show_help", + "select_last_entity", + "select_all_exploders_of_currently_selected", + "copy_ents", + "post_entity_creation_function", + "paste_ents", + "add_and_select_entity", + "get_center_of_array", + "ent_draw_axis", + "rotation_is_occuring", + "print_fx_options", + "entity_highlight_disable", + "entity_highlight_enable", + "toggle_createfx_drawing", + "manipulate_createfx_ents", + "clear_settable_fx", + "reset_fx_hud_colors", + "button_is_held", + "button_is_clicked", + "toggle_entity_selection", + "select_entity", + "ent_is_highlighted", + "deselect_entity", + "index_is_selected", + "ent_is_selected", + "clear_entity_selection", + "draw_axis", + "clear_fx_hudelements", + "set_fx_hudelement", + "createfx_centerprint", + "createfx_centerprint_thread", + "buttondown", + "buttonpressed_internal", + "get_selected_move_vector", + "process_button_held_and_clicked", + "locked", + "kb_locked", + "add_button", + "add_kb_button", + "set_anglemod_move_vector", + "cfxprintlnstart", + "cfxprintln", + "cfxprintlnend", + "update_selected_entities", + "hack_start", + "get_player", + "createfx_orgranize_array", + "stop_fx_looper", + "stop_loopsound", + "func_get_level_fx", + "restart_fx_looper", + "process_fx_rotater", + "generate_fx_log", + } +}; + +gsc::include_t compiler::include_common_scripts_utility_ = +{ + "common_scripts/utility", + { + "scriptprintln", + "debugprintln", + "draw_debug_line", + "waittillend", + "noself_func", + "self_func", + "randomvector", + "randomvectorrange", + "angle_dif", + "sign", + "track", + "get_enemy_team", + "clear_exception", + "set_exception", + "set_all_exceptions", + "cointoss", + "choose_from_weighted_array", + "get_cumulative_weights", + "waittill_string", + "waittill_multiple", + "waittill_multiple_ents", + "waittill_any_return", + "waittill_any_timeout", + "_timeout", + "waittill_any", + "waittill_any_ents", + "isflashed", + "flag_exist", + "flag", + "init_flags", + "flag_init", + "empty_init_func", + "issuffix", + "flag_set", + "assign_unique_id", + "flag_wait", + "flag_clear", + "flag_waitopen", + "waittill_either", + "array_thread", + "array_call", + "array_thread4", + "array_thread5", + "trigger_on", + "trigger_on_proc", + "trigger_off", + "trigger_off_proc", + "set_trigger_flag_permissions", + "update_trigger_based_on_flags", + "create_flags_and_return_tokens", + "init_trigger_flags", + "getstruct", + "getstructarray", + "struct_class_init", + "fileprint_start", + "fileprint_map_start", + "fileprint_map_header", + "fileprint_map_keypairprint", + "fileprint_map_entity_start", + "fileprint_map_entity_end", + "fileprint_radiant_vec", + "array_remove", + "array_remove_array", + "array_removeundefined", + "array_levelthread", + "array_levelcall", + "add_to_array", + "flag_assert", + "flag_wait_either", + "flag_wait_either_return", + "flag_wait_any", + "flag_wait_any_return", + "flag_wait_all", + "flag_wait_or_timeout", + "flag_waitopen_or_timeout", + "wait_for_flag_or_time_elapses", + "delaycall", + "delaycall_proc", + "noself_delaycall", + "noself_delaycall_proc", + "issp", + "issp_towerdefense", + "string_starts_with", + "plot_points", + "draw_line_for_time", + "array_combine", + "flat_angle", + "flat_origin", + "draw_arrow_time", + "get_linked_ents", + "get_linked_vehicle_nodes", + "get_linked_ent", + "get_linked_vehicle_node", + "get_links", + "run_thread_on_targetname", + "run_thread_on_noteworthy", + "draw_arrow", + "getfx", + "fxexists", + "print_csv_asset", + "fileprint_csv_start", + "_loadfx", + "getlastweapon", + "playerunlimitedammothread", + "isusabilityenabled", + "_disableusability", + "_enableusability", + "resetusability", + "_disableweapon", + "_enableweapon", + "isweaponenabled", + "_disableweaponswitch", + "_enableweaponswitch", + "isweaponswitchenabled", + "_disableoffhandweapons", + "_enableoffhandweapons", + "isoffhandweaponenabled", + "random", + "spawn_tag_origin", + "waittill_notify_or_timeout", + "fileprint_launcher_start_file", + "fileprint_launcher", + "fileprint_launcher_end_file", + "launcher_write_clipboard", + "isdestructible", + "pauseeffect", + "activate_individual_exploder", + "waitframe", + "brush_delete", + "brush_throw", + "get_target_ent", + "brush_show", + "exploder_earthquake", + "do_earthquake", + "exploder_rumble", + "exploder_delay", + "exploder_damage", + "effect_loopsound", + "play_loopsound_in_space", + "sound_effect", + "effect_soundalias", + "play_sound_in_space", + "cannon_effect", + "exploder_playsound", + "fire_effect", + "loop_fx_sound", + "loop_fx_sound_interval", + "loop_sound_delete", + "exploder_before_load", + "exploder_after_load", + "activate_exploder", + "createloopeffect", + "createoneshoteffect", + "createexploder", + "alphabetize", + "is_later_in_alphabet", + "alphabet_compare", + "play_loop_sound_on_entity", + "stop_loop_sound_on_entity", + "delete_on_death", + "error", + "exploder", + "create_dvar", + "void", + "tag_project", + "ter_op", + "create_lock", + "lock", + "is_locked", + "unlock_wait", + "unlock", + "unlock_thread", + "get_template_level", + } +}; + +auto compiler::map_known_includes(const std::string& include) -> bool +{ + if(include == "maps/mp/_utility") + { + includes_.push_back(include_maps_mp_utility_); + return true; + } + else if(include == "common_scripts/utility") + { + includes_.push_back(include_common_scripts_utility_); + return true; + } + else if(include == "common_scripts/_createfx") + { + includes_.push_back(include_common_scripts_createfx_); + return true; + } + + return false; +} + +void compiler::print_debug_info() +{ + printf("----------------------------------\n"); + printf("files included: %zu\n", includes_.size()); + printf("animtrees used: %zu\n", animtrees_.size()); + printf("functions compiled: %zu\n",assembly_.size()); + + for (auto& func : assembly_) + { + this->print_function(func); + + for (auto& inst : func->instructions) + { + const auto itr = func->labels.find(inst->index); + + if (itr != func->labels.end()) + { + this->print_label(itr->second); + } + + this->print_instruction(inst); + } + } + + printf("----------------------------------\n"); +} + +void compiler::print_opcodes(std::uint32_t index, std::uint32_t size) +{ + printf(" "); +} + +void compiler::print_function(const gsc::function_ptr& func) +{ + printf("\n"); + printf("%s\n", func->name.data()); +} + +void compiler::print_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_endswitch: + this->print_opcodes(inst->index, 3); + printf("%s", resolver::opcode_name(inst->opcode).data()); + printf(" %s\n", inst->data[0].data()); + { + std::uint32_t totalcase = std::stoul(inst->data[0]); + auto index = 0; + for (auto casenum = 0u; casenum < totalcase; casenum++) + { + this->print_opcodes(inst->index, 7); + if (inst->data[1 + index] == "case") + { + printf("%s %s %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data(), inst->data[1 + index + 2].data()); + index += 3; + } + else if (inst->data[1 + index] == "default") + { + printf("%s %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data()); + index += 2; + } + if (casenum != totalcase - 1) + { + printf("\n"); + } + } + } + break; + default: + this->print_opcodes(inst->index, inst->size); + printf("%s", resolver::opcode_name(inst->opcode).data()); + for (auto& d : inst->data) + { + printf(" %s", d.data()); + } + break; + } + + printf("\n"); +} + +void compiler::print_label(const std::string& label) +{ + printf(" %s\n", label.data()); +} + +} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/compiler.hpp b/src/iw5/xsk/compiler.hpp new file mode 100644 index 00000000..179961a3 --- /dev/null +++ b/src/iw5/xsk/compiler.hpp @@ -0,0 +1,155 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::iw5 +{ + +enum class opcode : std::uint8_t; + +class compiler : public gsc::compiler +{ + std::string filename_; + std::vector assembly_; + gsc::function_ptr function_; + std::uint32_t index_; + std::uint32_t label_idx_; + std::uint8_t stack_idx_; + std::vector local_stack_; + std::vector local_functions_; + std::vector includes_; + std::vector animtrees_; + std::unordered_map constants_; + std::function(const std::string&)> callback_readf_; + std::vector break_ctxs_; + std::vector continue_ctxs_; + bool can_break_; + bool can_continue_; + +public: + auto output() -> std::vector; + void compile(const std::string& file, std::vector& data); + void set_readf_callback(std::function(const std::string&)> func); + +private: + auto parse_buffer(const std::string& file, std::vector& data) -> gsc::program_ptr; + auto parse_file(const std::string& file) -> gsc::program_ptr; + void compile_program(const gsc::program_ptr& program); + void emit_include(const gsc::include_ptr& include); + void emit_define(const gsc::define_ptr& define); + void emit_usingtree(const gsc::usingtree_ptr& animtree); + void emit_constant(const gsc::constant_ptr& constant); + void emit_thread(const gsc::thread_ptr& thread); + void emit_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void emit_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt, bool last); + void emit_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt, bool last); + void emit_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt); + void emit_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt); + void emit_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt); + void emit_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt); + void emit_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt); + void emit_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void emit_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt); + void emit_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt); + void emit_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt, bool last); + void emit_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt, bool last); + void emit_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void emit_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void emit_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void emit_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void emit_stmt_case(const gsc::context_ptr& ctx, const gsc::stmt_case_ptr& stmt); + void emit_stmt_default(const gsc::context_ptr& ctx, const gsc::stmt_default_ptr& stmt); + void emit_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void emit_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt); + void emit_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void emit_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr); + void emit_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr); + void emit_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr); + void emit_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr); + void emit_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr); + void emit_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr); + void emit_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_pointer_type(const gsc::context_ptr& ctx, int args, bool builtin, bool method, bool thread, bool child); + void emit_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_function_builtin(const gsc::context_ptr& ctx, const std::string& func, int args, bool method); + void emit_expr_call_function_local(const gsc::context_ptr& ctx, const std::string& func, int args, bool method, bool thread, bool child); + void emit_expr_call_function_far(const gsc::context_ptr& ctx, const std::string& file, const std::string& func, int args, bool method, bool thread, bool child); + void emit_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& arg_list); + void emit_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& node); + void emit_expr_clear_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& lvalue); + void emit_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr); + void emit_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr); + void emit_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr, bool set); + void emit_array_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr, bool set); + void emit_field_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr, bool set); + void emit_local_variable_ref(const gsc::context_ptr& ctx, const gsc::name_ptr& expr, bool set); + void emit_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr); + void emit_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr); + void emit_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void emit_clear_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void emit_create_local_vars(const gsc::context_ptr& ctx); + void emit_remove_local_vars(const gsc::context_ptr& ctx); + void emit_object(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_animtree(const gsc::context_ptr& ctx, const gsc::animtree_ptr& animtree); + void emit_animation(const gsc::context_ptr& ctx, const gsc::animation_ptr& animation); + void emit_istring(const gsc::context_ptr& ctx, const gsc::istring_ptr& str); + void emit_string(const gsc::context_ptr& ctx, const gsc::string_ptr& str); + void emit_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec); + void emit_float(const gsc::context_ptr& ctx, const gsc::float_ptr& num); + void emit_integer(const gsc::context_ptr& ctx, const gsc::integer_ptr& num); + void emit_false(const gsc::context_ptr& ctx, const gsc::false_ptr& expr); + void emit_true(const gsc::context_ptr& ctx, const gsc::true_ptr& expr); + void emit_opcode(const gsc::context_ptr& ctx, opcode op); + void emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::string& data); + void emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::vector& data); + void process_thread(const gsc::context_ptr& ctx, const gsc::thread_ptr& thread); + void process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt); + void process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt); + void process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt); + void process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void process_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt); + void process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void register_variable(const gsc::context_ptr& ctx, const std::string& name); + void initialize_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name); + void create_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name); + auto variable_stack_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::uint8_t; + auto variable_create_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string; + auto variable_access_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string; + auto variable_initialized(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> bool; + auto is_local_call(const std::string& name) -> bool; + auto is_builtin_call(const std::string& name) -> bool; + auto is_builtin_func(const std::string& name) -> bool; + auto is_builtin_method(const std::string& name) -> bool; + auto is_constant_condition(const gsc::expr_ptr& expr) -> bool; + auto create_label() -> std::string; + auto insert_label() -> std::string; + void insert_label(const std::string& label); + + static gsc::include_t include_maps_mp_utility_; + static gsc::include_t include_common_scripts_utility_; + static gsc::include_t include_common_scripts_createfx_; + auto map_known_includes(const std::string& include) -> bool; + + // debug + void print_debug_info(); + void print_opcodes(std::uint32_t index, std::uint32_t size); + void print_function(const gsc::function_ptr& func); + void print_instruction(const gsc::instruction_ptr& inst); + void print_label(const std::string& label); +}; + +} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/decompiler.cpp b/src/iw5/xsk/decompiler.cpp new file mode 100644 index 00000000..9695e4f0 --- /dev/null +++ b/src/iw5/xsk/decompiler.cpp @@ -0,0 +1,3154 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw5.hpp" + +namespace xsk::gsc::iw5 +{ + +auto decompiler::output() -> std::vector +{ + std::vector output; + + auto data = std::make_unique(0x100000); + data->write_string("// IW5 PC GSC\n// Decompiled by https://github.com/xensik/gsc-tool\n"); + data->write_string(program_->print()); + + output.resize(data->pos()); + std::memcpy(output.data(), data->buffer().data(), output.size()); + + return output; +} + +void decompiler::decompile(const std::string& file, std::vector& functions) +{ + filename_ = file; + program_ = std::make_unique(); + + for (auto& func : functions) + { + auto name = std::make_unique(func->name.substr(4)); + auto params = std::make_unique(); + auto block = std::make_unique(); + func_ = std::make_unique(std::move(name),std::move(params),std::move(block)); + + labels_ = func->labels; + expr_labels_.clear(); + stack_ = std::stack(); + + this->decompile_function(func); + + this->process_stack(func_); + + program_->definitions.push_back(gsc::define_ptr(std::move(func_))); + } +} + +void decompiler::decompile_function(const gsc::function_ptr& func) +{ + this->decompile_statements(func); + + if(stack_.size() > 0) + { + throw gsc::decomp_error("stack not emty at function end"); + } + + auto& block = func_->block; + + gsc::context ctx; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.back().as_node->loc.begin.line); + + // remove last return + block->stmts.pop_back(); + + // hotfix empty else block at func end + if(block->stmts.size() > 0 && block->stmts.back().as_node->type == gsc::node_t::asm_jump) + { + if(block->stmts.back().as_jump->value == ctx.loc_end) + block->stmts.pop_back(); + } + + blocks_.push_back(ctx); + this->decompile_block(block); + blocks_.pop_back(); +} + +void decompiler::decompile_statements(const gsc::function_ptr& func) +{ + std::uint32_t last_null_loc = 0; + + for (auto& inst : func->instructions) + { + auto loc = gsc::location(&filename_, inst->index); + + const auto itr = func->labels.find(inst->index); + + if (itr != func->labels.end()) + { + for(auto& entry : expr_labels_) + { + if(entry == itr->second) + { + decompile_expr(); + } + } + } + + switch (opcode(inst->opcode)) + { + case opcode::OP_End: + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::make_unique())); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_Return: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + auto stmt = gsc::stmt_ptr(std::make_unique(expr->loc, std::move(expr))); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_GetZero: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetByte: + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetInteger: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetNegByte: + case opcode::OP_GetNegUnsignedShort: + { + auto node = std::make_unique(loc, "-" + inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetFloat: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetVector: + { + auto x = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto y = gsc::expr_ptr(std::make_unique(loc, inst->data[1])); + auto z = gsc::expr_ptr(std::make_unique(loc, inst->data[2])); + auto node = std::make_unique(loc, std::move(x), std::move(y), std::move(z)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetString: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetIString: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetUndefined: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EmptyArray: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetLevel: + case opcode::OP_GetLevelObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnim: + case opcode::OP_GetAnimObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetSelf: + case opcode::OP_GetSelfObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetGame: + case opcode::OP_GetGameRef: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnimation: + { + auto tree = utils::string::unquote(inst->data[0]); + + if(tree != "") + { + auto treename = std::make_unique(loc, inst->data[0]); + auto animtree = std::make_unique(loc, std::move(treename)); + program_->definitions.push_back(gsc::define_ptr(std::move(animtree))); + } + + auto node = std::make_unique(loc, utils::string::unquote(inst->data[1])); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnimTree: + { + auto tree = utils::string::unquote(inst->data[0]); + + if(tree != "") + { + auto treename = std::make_unique(loc, inst->data[0]); + auto animtree = std::make_unique(loc, std::move(treename)); + program_->definitions.push_back(gsc::define_ptr(std::move(animtree))); + } + + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetThisthread: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_GetBuiltinMethod: + { + auto file = std::make_unique(loc); + auto func = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_GetLocalFunction: + { + auto file = std::make_unique(loc); + auto func = std::make_unique(loc, inst->data[0].substr(4)); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_GetFarFunction: + { + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + auto func = std::make_unique(loc, inst->data[1]); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + }; + break; + case opcode::OP_CreateLocalVariable: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_RemoveLocalVariables: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_EvalLocalVariableCached0: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached1: + { + auto node = std::make_unique(loc, "1"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached2: + { + auto node = std::make_unique(loc, "2"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached3: + { + auto node = std::make_unique(loc, "3"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached4: + { + auto node = std::make_unique(loc, "4"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached5: + { + auto node = std::make_unique(loc, "5"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayCached: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalArray: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalNewLocalArrayRefCached0: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayRefCached0: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, "0")); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayRefCached: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalArrayRef: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_ClearArray: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = key.as_node->loc; + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(key))); + auto rvalue = gsc::expr_ptr(std::make_unique(loc)); + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr))); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_AddArray: + { + auto var = std::move(stack_.top()); + stack_.pop(); + auto array = std::move(stack_.top()); + stack_.pop(); + + if (array->type == gsc::node_t::data_empty_array) + { + auto args = std::make_unique(loc); + args->list.push_back(std::move(var)); + auto expr = std::make_unique(array->loc, std::move(args)); + stack_.push(std::move(expr)); + } + else if (array->type == gsc::node_t::expr_add_array) + { + (*(gsc::expr_add_array_ptr*)&array)->args->list.push_back(std::move(var)); + stack_.push(std::move(array)); + } + else + { + throw gsc::decomp_error("unknown add array type (could be an array variable name?)"); + } + } + break; + case opcode::OP_PreScriptCall: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_ScriptLocalFunctionCall2: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalFunctionCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalChildThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodThreadCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodChildThreadCall: + { + // TODO: child things... + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarFunctionCall2: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarFunctionCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarMethodCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[2]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[1])); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarMethodThreadCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[2]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[1])); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFunctionCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodCallPointer: + { + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptChildThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodChildThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto obj = gsc::expr_ptr(std::make_unique()); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, true, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethodPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, true, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin0: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin1: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 1; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin2: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 2; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin3: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 3; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin4: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 4; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin5: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 5; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod0: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod1: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 1; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod2: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 2; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod3: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 3; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod4: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 4; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod5: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 5; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_DecTop: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + loc = expr->loc; + auto stmt = std::make_unique(loc, std::move(*(gsc::expr_call_ptr*)&expr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_inc: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_dec: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_or: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_ex_or: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_and: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_equality: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_inequality: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_less: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_greater: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_less_equal: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_greater_equal: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_shift_left: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_shift_right: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_plus: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_minus: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_multiply: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_divide: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_mod: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_wait: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + loc = expr->loc; + auto stmt = std::make_unique(loc, std::move(expr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_waittillFrameEnd: + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_waittill: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = nstr.as_node->loc; + auto args = std::make_unique(loc); + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr), std::move(args)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_waittillmatch: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto expr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = expr.as_node->loc; + + gsc::expr_arguments_ptr args = std::make_unique(); + args->loc = loc; + + while(stack_.size() > 0) + { + auto node = std::move(stack_.top()); + stack_.pop(); + args->loc = node->loc; + args->list.push_back(std::move(node)); + + } + loc = args->loc; + + auto stmt = std::make_unique(loc, std::move(obj), std::move(expr), std::move(args)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_clearparams: + { + auto args = std::make_unique(loc); + auto var = std::move(stack_.top()); + stack_.pop(); + + while(var->type != gsc::node_t::stmt_waittill && var->type != gsc::node_t::stmt_waittillmatch) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + } + + if(var->type == gsc::node_t::stmt_waittill) + { + (*(gsc::stmt_waittill_ptr*)&var)->args = std::move(args); + } + + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(var))); + } + break; + case opcode::OP_checkclearparams: + { + // no needed + } + break; + case opcode::OP_notify: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_voidcodepos) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr), std::move(args)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_endon: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = nstr.as_node->loc; + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_voidCodepos: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_vector: + { + auto x = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto y = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto z = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = z.as_node->loc; + auto expr = std::make_unique(loc, std::move(x), std::move(y), std::move(z)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_size: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_EvalLevelFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalAnimFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalSelfFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalFieldVariable: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalLevelFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalAnimFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalSelfFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_ClearFieldVariable: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto expr = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto undef = gsc::expr_ptr(std::make_unique(loc)); + auto e = std::make_unique(loc, std::move(expr), std::move(undef)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::make_unique(loc, std::move(e)))); + } + break; + case opcode::OP_SafeCreateVariableFieldCached: + { + func_->params->list.push_back(std::make_unique(loc, "var_" + inst->data[0])); + } + break; + case opcode::OP_SafeSetWaittillVariableFieldCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableRefCached0: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableRefCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_SetLevelFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc,std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetVariableField: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + + if(lvalue.as_node->type == gsc::node_t::expr_increment) + { + auto stmt = std::make_unique(loc, std::move(lvalue.as_increment)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + else if(lvalue.as_node->type == gsc::node_t::expr_decrement) + { + auto stmt = std::make_unique(loc, std::move(lvalue.as_decrement)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + else + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + } + break; + case opcode::OP_SetAnimFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetSelfFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetLocalVariableFieldCached0: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, "0")); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetNewLocalVariableFieldCached0: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + + if(func_->block->stmts.size() > 0) + { + std::vector creates; + + while(func_->block->stmts.back().as_node->type == gsc::node_t::asm_create) + { + auto& entry = func_->block->stmts.back(); + if(loc.begin.line < entry.as_node->loc.begin.line) + { + creates.push_back(entry.as_asm_create->index); + func_->block->stmts.pop_back(); + continue; + } + break; + } + + std::reverse(creates.begin(), creates.end()); + lvalue.as_asm_create->vars = creates; + } + + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetLocalVariableFieldCached: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_ClearLocalVariableFieldCached: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_ClearLocalVariableFieldCached0: + { + auto stmt = std::make_unique(loc,"0"); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_EvalLocalVariableObjectCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_CastFieldObject: + case opcode::OP_CastBool: + { + //continue; + } + break; + case opcode::OP_BoolNot: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_BoolComplement: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_switch: + { + auto expr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = expr.as_node->loc; + auto sw = std::make_unique(loc, std::move(expr), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(sw))); + } + break; + case opcode::OP_endswitch: + { + auto count = inst->data[0]; + inst->data.erase(inst->data.begin()); + auto data = inst->data; + auto end = std::make_unique(loc, data, count); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(end))); + } + break; + case opcode::OP_jump: + { + auto expr = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + + } + break; + case opcode::OP_jumpback: + { + auto expr = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnTrue: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto e_not = gsc::expr_ptr(std::make_unique(loc, std::move(lvalue))); + auto expr = std::make_unique(loc, std::move(e_not), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnFalse: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnTrueExpr: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + stack_.push(std::move(expr)); + expr_labels_.push_back(inst->data[0]); + } + break; + case opcode::OP_JumpOnFalseExpr: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + stack_.push(std::move(expr)); + expr_labels_.push_back(inst->data[0]); + } + break; + default: + throw gsc::decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); + break; + } + } +} + +void decompiler::decompile_expr() +{ + auto expr = std::move(stack_.top()); + stack_.pop(); + + auto jump_expr = std::move(stack_.top()); + stack_.pop(); + auto loc = jump_expr->loc; + + if(jump_expr->type == gsc::node_t::asm_jump_true_expr) + { + auto lvalue = std::move((*(gsc::asm_jump_true_expr_ptr*)&jump_expr)->expr); + auto rvalue = gsc::expr_ptr(std::move(expr)); + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(e)); + } + else if(jump_expr->type == gsc::node_t::asm_jump_false_expr) + { + auto lvalue = std::move((*(gsc::asm_jump_false_expr_ptr*)&jump_expr)->expr); + auto rvalue = gsc::expr_ptr(std::move(expr)); + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(e)); + } + else + { + throw gsc::decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); + } +} + +void decompiler::decompile_block(const gsc::stmt_list_ptr& block) +{ + this->decompile_search_infinite(block); + this->decompile_search_loop(block); + this->decompile_search_switch(block); + this->decompile_search_ifelse(block); + this->decompile_break_continue(block); + this->decompile_nulls(block); +} + +void decompiler::decompile_nulls(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::null) + { + block->stmts.erase(block->stmts.begin() + index); + } + else index++; + } +} + +void decompiler::decompile_search_infinite(const gsc::stmt_list_ptr& block) +{ + std::int32_t index = block->stmts.size() - 1; + + while(index >= 0) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_jump_back) + { + auto break_loc = last_location_index(block, index) ? blocks_.back().loc_end : utils::string::va("loc_%X", block->stmts.at(index+1).as_node->loc.begin.line); + auto begin_loc = block->stmts.at(index).as_jump_back->value; + auto start = find_location_index(block, begin_loc); + + if(block->stmts.at(start).as_node->type != gsc::node_t::asm_jump_cond) + { + decompile_infinite(block, start, index); + index = start; + } + else if (block->stmts.at(start).as_cond->value != break_loc) + { + decompile_infinite(block, start, index); + index = start; + } + } + + index--; + } +} + +void decompiler::decompile_search_loop(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + auto& stmt = block->stmts.at(index); + + if(stmt.as_node->type == gsc::node_t::asm_jump_cond) + { + std::uint32_t end; + if(stmt.as_cond->value == blocks_.back().loc_end) + { + end = block->stmts.size() - 1; + } + else + { + end = find_location_index(block, stmt.as_cond->value) - 1; + } + + if(block->stmts.at(end).as_node->type == gsc::node_t::asm_jump_back + && utils::string::va("loc_%X", block->stmts.at(index).as_node->loc.begin.line) == block->stmts.at(end).as_jump_back->value) + { + decompile_loop(block, index, end); + index = 0; + } + } + index++; + } +} + +void decompiler::decompile_search_switch(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_switch) + { + decompile_switch(block, index); + } + + index++; + } +} + +void decompiler::decompile_search_ifelse(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + auto& stmt = block->stmts.at(index); + + if(stmt.as_node->type == gsc::node_t::asm_jump_cond) + { + std::uint32_t end; + if(stmt.as_cond->value == blocks_.back().loc_end) + { + end = block->stmts.size() - 1; + } + else + { + end = find_location_index(block, stmt.as_cond->value) - 1; + } + + auto last_loc = blocks_.back().loc_end; + + if(block->stmts.at(end).as_node->type == gsc::node_t::asm_jump) + { + // if block is a loop check break, continue + if(block->stmts.at(end).as_jump->value == blocks_.back().loc_continue) + { + // last if/else inside a loop still trigger this :( + decompile_if(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == blocks_.back().loc_break) + { + decompile_if(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == blocks_.back().loc_end) + { + decompile_ifelse(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == stmt.as_cond->value) + { + decompile_if(block, index, end); // if block, have a last empty else inside + } + else + { + decompile_ifelse(block, index, end); // TODO: if else block is empty, convert it to only if! + } + } + else if(block->stmts.at(end).as_node->type == gsc::node_t::stmt_return + && block->stmts.at(end).as_return->expr.as_node->type == gsc::node_t::null) + { + if(blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") + { + decompile_if(block, index, end); // inside a loop cant be last + } + else if(end - index == 1) + { + decompile_if(block, index, end); // only one explicit return + } + else if(block->stmts.back().as_node->type != gsc::node_t::stmt_return) + { + decompile_if(block, index, end); // block end is not a last return + } + else if(blocks_.back().is_last && block->stmts.back().as_node->type != gsc::node_t::stmt_return) + { + decompile_if(block, index, end); // inside a last block but is not and inner last + } + else if(find_location_reference(block, end, block->stmts.size(), last_loc)) + { + decompile_if(block, index, end); // reference to func end after the if + } + else if(blocks_.size() > 1 && !blocks_.back().is_last) + { + decompile_if(block, index, end); // fake last ifelse + } + else + { + decompile_last_ifelse(block, index, end); // special case + } + } + else + { + decompile_if(block, index, end); + } + } + index++; + } +} + +void decompiler::decompile_break_continue(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_jump) + { + auto loc = block->stmts.at(index).as_node->loc; + auto jump_loc = block->stmts.at(index).as_jump->value; + + if(jump_loc == blocks_.back().loc_continue) + { + block->stmts.erase(block->stmts.begin() + index); + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + block->stmts.insert(block->stmts.begin() + index, std::move(stmt)); + } + else if(jump_loc == blocks_.back().loc_break) + { + block->stmts.erase(block->stmts.begin() + index); + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + block->stmts.insert(block->stmts.begin() + index, std::move(stmt)); + } + } + + index++; + } +} + +void decompiler::decompile_if(const gsc::stmt_list_ptr& block, std::uint32_t begin, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_end = block->stmts.at(begin).as_cond->value; + ctx.loc_break = blocks_.back().loc_break; + ctx.loc_continue = blocks_.back().loc_continue; + + auto loc = block->stmts.at(begin).as_node->loc; + auto expr = std::move(block->stmts.at(begin).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + begin); // remove condition + + auto if_block = std::make_unique(loc); + + for(auto i = begin; i < end; i++) + { + if_block->stmts.push_back(std::move(block->stmts[begin])); + block->stmts.erase(block->stmts.begin() + begin); + } + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)))); + block->stmts.insert(block->stmts.begin() + begin, std::move(stmt)); +} + +void decompiler::decompile_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_break = blocks_.back().loc_break; + ctx.loc_continue = blocks_.back().loc_continue; + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto if_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) // skip the jump + { + if_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + auto end_loc = block->stmts.at(start).as_jump->value; + + block->stmts.erase(block->stmts.begin() + start); // remove jump + + std::uint32_t end_index; + + if(end_loc == blocks_.back().loc_end) + { + end_index = block->stmts.size(); + } + else + { + end_index = find_location_index(block, end_loc); + } + + gsc::context ctx2; + ctx2.loc_end = end_loc; + ctx2.loc_break = blocks_.back().loc_break; + ctx2.loc_continue = blocks_.back().loc_continue; + + auto else_block = std::make_unique(loc); + + for(auto i = start; i < end_index; i++) + { + else_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx2); + decompile_block(else_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)), gsc::stmt_ptr(std::move(else_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_last_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.is_last = true; + + auto inner_end = find_location_index(block, block->stmts.at(start).as_cond->value) - 1; + ctx.loc_end = utils::string::va("loc_%X",block->stmts.at(inner_end).as_node->loc.begin.line); + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto if_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + if_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + block->stmts.erase(block->stmts.begin() + start); // remove if block return; + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + if(start == block->stmts.size()) + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); + } + else + { + gsc::context ctx2; + ctx2.is_last = true; + + auto else_block = std::make_unique(loc); + + end = block->stmts.size(); + ctx2.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); // return is the block end + + for(auto i = start; i < end; i++) + { + else_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + else_block->stmts.pop_back(); // remove else return; + + blocks_.push_back(ctx2); + decompile_block(else_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)), gsc::stmt_ptr(std::move(else_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); + } +} + +void decompiler::decompile_infinite(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = last_location_index(block, end) ? blocks_.back().loc_end : utils::string::va("loc_%X", block->stmts.at(end+1).as_node->loc.begin.line); + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + + auto loc = block->stmts.at(start).as_node->loc; + + block->stmts.erase(block->stmts.begin() + end); // remove jump back + + auto for_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + for_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(for_block); + blocks_.pop_back(); + + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + auto expr = gsc::expr_ptr(std::make_unique()); + auto post_expr = gsc::stmt_ptr(std::make_unique()); + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(pre_expr), std::move(expr), std::move(post_expr), gsc::stmt_ptr(std::move(for_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + auto& last_stmt = block->stmts.at(end-1); + if(last_stmt.as_node->type == gsc::node_t::stmt_assign) + { + if(last_stmt.as_assign->expr->type == gsc::node_t::expr_assign_equal) + { + auto& rval = last_stmt.as_assign->expr->rvalue; + if(rval.as_node->type == gsc::node_t::expr_call) + { + if(rval.as_call->func.as_node->type == gsc::node_t::expr_call_function) + { + if(utils::string::to_lower(rval.as_call->func.as_func->name->value) == "getnextarraykey") + { + auto ref2 = utils::string::va("loc_%X", block->stmts.at(start).as_node->loc.begin.line); + if(find_location_reference(block, 0, start, ref2)) + { + // begin is at condition, not pre-expr + //decompile_while(block, start, end); + //return; + } + else + { + decompile_foreach(block, start, end); + return; + } + } + } + } + } + + if(start > 0) // while at func start + { + auto index = 1; + while(block->stmts.at(start - index).as_node->type == gsc::node_t::asm_create) + { + if(start - index > 0) + index++; + } + + if(block->stmts.at(start - index).as_node->type == gsc::node_t::stmt_assign) + { + auto ref = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + auto ref2 = utils::string::va("loc_%X", block->stmts.at(start).as_node->loc.begin.line); + + if(find_location_reference(block, start, end, ref)) + { + // continue is at jumpback, not post-expr + decompile_while(block, start, end); + return; + } + else if(find_location_reference(block, 0, start, ref2)) + { + // begin is at condition, not pre-expr + decompile_while(block, start, end); + return; + } + else + { + decompile_for(block, start, end); + return; + } + } + } + } + + decompile_while(block, start, end); +} + +void decompiler::decompile_while(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(start).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X",block->stmts.at(end).as_node->loc.begin.line); + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + end); // remove jump back + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto while_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + while_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(while_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(while_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_for(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(start).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + + // remove emit local var_creates + std::vector creates; + while(block->stmts.at(start - 1).as_node->type == gsc::node_t::asm_create) + { + creates.push_back(block->stmts.at(start - 1).as_asm_create->index); + block->stmts.erase(block->stmts.begin() + start - 1); + start--; + end--; + } + + std::reverse(creates.begin(), creates.end()); + + auto loc = block->stmts.at(start - 1).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + pre_expr.as_list->stmts.push_back(std::move(block->stmts.at(start - 1))); + pre_expr.as_list->is_expr = true; + auto post_expr = gsc::stmt_ptr(std::make_unique()); + post_expr.as_list->stmts.push_back(std::move(block->stmts.at(end - 1))); + post_expr.as_list->is_expr = true; + + start = start - 1; + end = end - 2; + for(auto i = start; i < start + 2; i++) // remove prologue (pre-expr, condition) + { + block->stmts.erase(block->stmts.begin() + start); + } + + end = end - 1; // set end in post-expr + for(auto i = end; i < end + 2; i++) // remove epilogue (post-expr, jump back) + { + block->stmts.erase(block->stmts.begin() + end); + } + + auto for_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + for_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(for_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(pre_expr), std::move(expr), std::move(post_expr), gsc::stmt_ptr(std::move(for_block)))); + stmt.as_for->vars = creates; + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_foreach(const gsc::stmt_list_ptr& block, std::uint32_t begin, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(begin).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + + // remove local var_creates + std::vector creates; + while(block->stmts.at(begin - 1).as_node->type == gsc::node_t::asm_create) + { + creates.push_back(block->stmts.at(begin - 1).as_asm_create->index); + block->stmts.erase(block->stmts.begin() + begin - 1); + begin--; + end--; + } + + std::reverse(creates.begin(), creates.end()); + + auto loc = block->stmts.at(begin - 2).as_node->loc; + + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + pre_expr.as_list->stmts.push_back(std::move(block->stmts[begin-2])); + pre_expr.as_list->stmts.push_back(std::move(block->stmts[begin-1])); + auto stmt0 = std::move(block->stmts[begin+1]); + + begin = begin - 2; + end = end - 4; + for(auto i = begin; i < begin + 4; i++) // remove prologue ( array, elem, cond, elemRef) + { + block->stmts.erase(block->stmts.begin() + begin); + } + + end = end - 1; // set end to post-expr + + for(auto i = end; i < end + 2; i++) // remove epilogue ( post-expr, jump back) + { + block->stmts.erase(block->stmts.begin() + end); + } + + if(block->stmts.size() > end && block->stmts.at(end).as_node->type == gsc::node_t::asm_clear) + { + block->stmts.erase(block->stmts.begin() + end); + } + + auto use_key = true; + + if(block->stmts.size() > end && block->stmts.at(end).as_node->type == gsc::node_t::asm_clear) + { + block->stmts.erase(block->stmts.begin() + end); + use_key = false; + } + + auto foreach_block = std::make_unique(loc); + + for(auto i = begin; i < end; i++) + { + foreach_block->stmts.push_back(std::move(block->stmts[begin])); + block->stmts.erase(block->stmts.begin() + begin); + } + + blocks_.push_back(ctx); + decompile_block(foreach_block); + blocks_.pop_back(); + + auto foreach_stmt = gsc::stmt_ptr(std::make_unique(loc, gsc::stmt_ptr(std::move(foreach_block)), use_key)); + foreach_stmt.as_foreach->vars = creates; + foreach_stmt.as_foreach->pre_expr = std::move(pre_expr); + foreach_stmt.as_foreach->stmt0 = std::move(stmt0); + + block->stmts.insert(block->stmts.begin() + begin, std::move(foreach_stmt)); +} + +void decompiler::decompile_switch(const gsc::stmt_list_ptr& block, std::uint32_t start) +{ + gsc::context ctx; + ctx.loc_continue = blocks_.back().loc_continue; + ctx.loc_end = block->stmts.at(start).as_asm_switch->value; + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_asm_switch->expr); + auto end_loc = block->stmts.at(start).as_asm_switch->value; + auto end = find_location_index(block, end_loc); + + if(end == block->stmts.size() - 1) + { + ctx.loc_break = blocks_.back().loc_end; + } + else + { + ctx.loc_break = utils::string::va("loc_%X", block->stmts.at(end + 1).as_node->loc.begin.line); + } + + // collect cases + auto casenum = std::atol(block->stmts.at(end).as_asm_endswitch->count.data()); + auto data = block->stmts.at(end).as_asm_endswitch->data; + auto idx = 0; + + for(auto i = 0; i < casenum; i++) + { + if(data.at(idx) == "case") + { + auto loc_str = data.at(idx+2); + auto loc_idx = find_location_index(block, loc_str); + auto loc_pos = gsc::location(&filename_, std::stol(loc_str.substr(4), 0, 16)); + auto value = gsc::expr_ptr(std::make_unique(loc_pos, data.at(idx+1))); + auto list = std::make_unique(loc); + list->is_case = true; + auto stmt = gsc::stmt_ptr(std::make_unique(loc_pos, std::move(value), std::move(list))); + block->stmts.insert(block->stmts.begin() + loc_idx, std::move(stmt)); + idx += 3; + } + else if(data.at(idx) == "default") + { + auto loc_str = data.at(idx+1); + auto loc_idx = find_location_index(block, loc_str); + auto loc_pos = gsc::location(&filename_, std::stol(loc_str.substr(4), 0, 16)); + auto list = std::make_unique(loc); + list->is_case = true; + auto stmt = gsc::stmt_ptr(std::make_unique(loc_pos, std::move(list))); + block->stmts.insert(block->stmts.begin() + loc_idx, std::move(stmt)); + idx += 2; + } + } + + end = find_location_index(block, end_loc) - 1; // update end; + block->stmts.erase(block->stmts.begin() + start); // remove switch + block->stmts.erase(block->stmts.begin() + end); // remove endswitch + + //decompile block + auto sw_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + sw_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(sw_block); + blocks_.pop_back(); + + auto stmt_list = std::make_unique(loc); + gsc::stmt_ptr current_case = gsc::stmt_ptr(std::make_unique()); + + auto num = sw_block->stmts.size(); + for(auto i = 0; i < num; i++) + { + auto& entry = sw_block->stmts[0]; + + if(entry.as_node->type == gsc::node_t::stmt_case || entry.as_node->type == gsc::node_t::stmt_default) + { + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + current_case = std::move(sw_block->stmts[0]); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + else + { + if(current_case.as_node->type != gsc::node_t::null) + { + if(current_case.as_node->type == gsc::node_t::stmt_case) + { + current_case.as_case->stmt->stmts.push_back(std::move(sw_block->stmts[0])); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + else + { + current_case.as_default->stmt->stmts.push_back(std::move(sw_block->stmts[0])); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + } + else + { + gsc::decomp_error("missing case before stmt inside switch!"); + } + } + } + + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), std::move(stmt_list))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +auto decompiler::find_location_reference(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end, const std::string& location) -> bool +{ + for(auto i = start; i < end; i++) + { + if(block->stmts.at(i).as_node->type == gsc::node_t::asm_jump_cond) + { + if(block->stmts.at(i).as_cond->value == location) + return true; + } + else if(block->stmts.at(i).as_node->type == gsc::node_t::asm_jump) + { + if(block->stmts.at(i).as_jump->value == location) + return true; + } + } + + return false; +} + +auto decompiler::find_location_index(const gsc::stmt_list_ptr& block, const std::string& location) -> std::uint32_t +{ + auto index = 0; + + if(location == blocks_.back().loc_end) + return block->stmts.size(); + + for(auto& stmt : block->stmts) + { + if(stmt.as_node->loc.begin.line == std::stol(location.substr(4), 0, 16)) + return index; + + index++; + } + + throw gsc::decomp_error("LOCATION NOT FOUND! (" + location + ")"); +} + +auto decompiler::last_location_index(const gsc::stmt_list_ptr& block, std::uint32_t index) -> bool +{ + if(index == block->stmts.size() - 1) + return true; + + return false; +} + +void decompiler::process_stack(const gsc::thread_ptr& thread) +{ + auto ctx = std::make_unique(); + + process_parameters(ctx, thread->params); + process_stmt_list(ctx, thread->block); + +} + +void decompiler::process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + ctx->local_vars.push_back({ param->value, static_cast(std::stoi(param->value.substr(4))), true }); + ctx->local_vars_create_count++; + } +} + +void decompiler::process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt) +{ + switch(stmt.as_node->type) + { + case gsc::node_t::stmt_list: process_stmt_list(ctx, stmt.as_list); break; + case gsc::node_t::stmt_call: process_stmt_call(ctx, stmt.as_call); break; + case gsc::node_t::stmt_assign: process_stmt_assign(ctx, stmt.as_assign); break; + case gsc::node_t::stmt_endon: process_stmt_endon(ctx, stmt.as_endon); break; + case gsc::node_t::stmt_notify: process_stmt_notify(ctx, stmt.as_notify); break; + case gsc::node_t::stmt_wait: process_stmt_wait(ctx, stmt.as_wait); break; + case gsc::node_t::stmt_waittill: process_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_waittillmatch: process_stmt_waittillmatch(ctx, stmt.as_waittillmatch); break; + case gsc::node_t::stmt_if: process_stmt_if(ctx, stmt.as_if); break; + case gsc::node_t::stmt_ifelse: process_stmt_ifelse(ctx, stmt.as_ifelse); break; + case gsc::node_t::stmt_while: process_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: process_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: process_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: process_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_break: process_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_return: process_stmt_return(ctx, stmt.as_return); break; + case gsc::node_t::asm_remove: process_var_remove(ctx, stmt.as_asm_remove); break; + case gsc::node_t::asm_create: + { + auto expr = gsc::expr_ptr(std::make_unique(stmt.as_asm_create->index)); + process_var_create(ctx, expr, true); + } + break; + default: break; + } +} + +void decompiler::process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + for (const auto& entry : stmt->stmts) + { + process_stmt(ctx, entry); + } + + for(auto i = 0; i < stmt->stmts.size(); i++) + { + auto type = stmt->stmts.at(i).as_node->type; + + if(type == gsc::node_t::asm_create || type == gsc::node_t::asm_remove) + { + stmt->stmts.erase(stmt->stmts.begin() + i); + i--; + } + } +} + +void decompiler::process_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt) +{ + process_expr_call(ctx, stmt->expr); +} + +void decompiler::process_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt) +{ + process_expr_assign(ctx, stmt->expr); +} + +void decompiler::process_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt) +{ + process_expr_arguments(ctx, stmt->args); + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt) +{ + process_expr(ctx, stmt->expr); +} + +void decompiler::process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); + process_expr_arguments(ctx, stmt->args); +} + +void decompiler::process_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt) +{ + process_expr_arguments(ctx, stmt->args); + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx_if = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx_if); + + process_stmt(stmt->ctx_if, stmt->stmt_if); + + stmt->ctx_else = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx_else); + + process_stmt(stmt->ctx_else, stmt->stmt_else); + + std::vector childs({stmt->ctx_if.get(), stmt->ctx_else.get()}); + ctx->append(childs); + + if(stmt->stmt_if.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt_if.as_list->stmts.at(0))) + { + stmt->stmt_if = std::move(stmt->stmt_if.as_list->stmts.back()); + } + + if(stmt->stmt_else.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt_noif(stmt->stmt_else.as_list->stmts.at(0))) + { + stmt->stmt_else = std::move(stmt->stmt_else.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt); + + std::vector childs({ stmt->ctx.get() }); + + if(stmt->expr.as_node->type == gsc::node_t::null) + ctx->append_decompiler(stmt->ctx); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + process_stmt(ctx, stmt->pre_expr); + + for(auto& index : stmt->vars) + { + auto var = utils::string::va("var_%d", std::stoi(index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(index)), true }); + ctx->local_vars_create_count++; + } + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_expr(ctx, stmt->expr); + + process_stmt(stmt->ctx, stmt->stmt); + + process_stmt(ctx, stmt->post_expr); + + if(stmt->expr.as_node->type == gsc::node_t::null) + ctx->append_decompiler(stmt->ctx); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + process_stmt(ctx, stmt->pre_expr); + + for(auto& index : stmt->vars) + { + auto var1 = utils::string::va("var_%d", std::stoi(index)); + ctx->local_vars.push_back({ var1, static_cast(std::stoi(index)), true }); + ctx->local_vars_create_count++; + } + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt0); + process_stmt(stmt->ctx, stmt->stmt); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } + + stmt->array_expr = std::move(stmt->pre_expr.as_list->stmts[0].as_assign->expr->rvalue); + stmt->value_expr = std::move(stmt->stmt0.as_assign->expr->lvalue); + stmt->key_expr = std::move(stmt->pre_expr.as_list->stmts[1].as_assign->expr->lvalue); +} + +void decompiler::process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt_cases(stmt->ctx, stmt->stmt); + + ctx->append_decompiler(stmt->ctx, true); +} + +void decompiler::process_stmt_cases(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + std::vector childs; + + for(auto& entry : stmt->stmts) + { + if(entry.as_node->type == gsc::node_t::stmt_case) + { + entry.as_case->ctx = std::make_unique(); + ctx->transfer_decompiler(entry.as_case->ctx); + + process_stmt_list(entry.as_case->ctx, entry.as_case->stmt); + + if(entry.as_case->ctx->abort == gsc::abort_t::abort_break) + { + childs.push_back(entry.as_case->ctx.get()); + } + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + entry.as_default->ctx = std::make_unique(); + ctx->transfer_decompiler(entry.as_default->ctx); + + process_stmt_list(entry.as_default->ctx, entry.as_default->stmt); + + if(entry.as_default->ctx->abort == gsc::abort_t::abort_break) + { + childs.push_back(entry.as_default->ctx.get()); + } + } + } + + ctx->append(childs); +} + +void decompiler::process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + ctx->abort = gsc::abort_t::abort_break; +} + +void decompiler::process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(stmt->expr.as_node->type == gsc::node_t::null) + { + return; + } + + process_expr(ctx, stmt->expr); +} + +void decompiler::process_expr(const gsc::context_ptr& ctx, gsc::expr_ptr& expr) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_increment: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_decrement: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_equal: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_add: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_sub: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_mult: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_div: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_mod: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_shift_left: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_shift_right: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_or: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_and: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_exor: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_and: process_expr_and(ctx, expr.as_and); break; + case gsc::node_t::expr_or: process_expr_or(ctx, expr.as_or); break; + case gsc::node_t::expr_equality: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_inequality: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less_equal: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater_equal: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_or: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_and: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_exor: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_left: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_right: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_add: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_sub: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mult: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_div: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mod: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_complement: process_expr_complement(ctx, expr.as_complement); break; + case gsc::node_t::expr_not: process_expr_not(ctx, expr.as_not); break; + case gsc::node_t::expr_call: process_expr_call(ctx, expr.as_call); break; + case gsc::node_t::expr_function: process_expr_function(ctx, expr.as_function); break; + case gsc::node_t::expr_add_array: process_expr_add_array(ctx, expr.as_add_array); break; + case gsc::node_t::expr_array: process_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: process_field_variable(ctx, expr.as_field); break; + case gsc::node_t::expr_size: process_expr_size(ctx, expr.as_size); break; + case gsc::node_t::data_name: process_local_variable(ctx, expr.as_name); break; + case gsc::node_t::data_vector: process_vector(ctx, expr.as_vector); break; + case gsc::node_t::asm_create: process_var_create(ctx, expr); break; + case gsc::node_t::asm_access: process_var_access(ctx, expr); break; + default: break; + } +} + +void decompiler::process_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr) +{ + if(expr->type == gsc::node_t::expr_increment) + { + process_expr(ctx, expr->lvalue); + } + else if(expr->type == gsc::node_t::expr_decrement) + { + process_expr(ctx, expr->lvalue); + } + else + { + process_expr(ctx, expr->rvalue); + process_expr(ctx, expr->lvalue); + } +} + +void decompiler::process_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr) +{ + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr) +{ + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + if(expr->func.as_node->type == gsc::node_t::expr_call_pointer) + { + process_expr_call_pointer(ctx, expr); + } + else + { + process_expr_call_function(ctx, expr); + } +} + +void decompiler::process_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + process_expr_arguments(ctx, expr->func.as_pointer->args); + + if(expr->obj.as_node->type != gsc::node_t::null) + process_expr(ctx, expr->obj); + + process_expr(ctx, expr->func.as_pointer->expr); +} + +void decompiler::process_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + process_expr_arguments(ctx, expr->func.as_func->args); + + if(expr->obj.as_node->type != gsc::node_t::null) + process_expr(ctx, expr->obj); +} + +void decompiler::process_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& args) +{ + for(auto i = args->list.size(); i > 0; i--) + { + process_expr(ctx, args->list.at(i - 1)); + } +} + +void decompiler::process_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& expr) +{ + return; +} + +void decompiler::process_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr) +{ + for(auto& arg : expr->args->list) + { + process_expr(ctx, arg); + } +} + +void decompiler::process_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr) +{ + process_expr(ctx, expr->obj); +} + +void decompiler::process_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr) +{ + process_expr(ctx, expr->key); + process_expr(ctx, expr->obj); +} + +void decompiler::process_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr) +{ + process_expr(ctx, expr->obj); +} + +void decompiler::process_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + return; +} + +void decompiler::process_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec) +{ + process_expr(ctx, vec->z); + process_expr(ctx, vec->y); + process_expr(ctx, vec->x); +} + +void decompiler::process_var_create(const gsc::context_ptr& ctx, gsc::expr_ptr& expr, bool fromstmt) +{ + if(fromstmt) + { + auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); + ctx->local_vars_create_count++; + } + else + { + for(auto& entry : expr.as_asm_create->vars) + { + ctx->local_vars.push_back({ utils::string::va("var_%d", std::stoi(entry)), static_cast(std::stoi(entry)), true }); + ctx->local_vars_create_count++; + } + + auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); + ctx->local_vars_create_count++; + + expr = gsc::expr_ptr(std::make_unique(var)); + } +} + +void decompiler::process_var_access(const gsc::context_ptr& ctx, gsc::expr_ptr& expr) +{ + if(ctx->local_vars.size() <= std::stoi(expr.as_asm_access->index)) + { + printf("WARNING: bad local var access\n"); + } + else + { + auto var = ctx->local_vars.at(ctx->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; + expr = gsc::expr_ptr(std::make_unique(var)); + } +} + +void decompiler::process_var_remove(const gsc::context_ptr& ctx, const gsc::asm_remove_ptr& expr) +{ + ctx->local_vars_public_count = ctx->local_vars.size() - std::stoi(expr->index); +} + +} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/decompiler.hpp b/src/iw5/xsk/decompiler.hpp new file mode 100644 index 00000000..14fab3c3 --- /dev/null +++ b/src/iw5/xsk/decompiler.hpp @@ -0,0 +1,93 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::iw5 +{ + +class decompiler : public gsc::decompiler +{ + std::string filename_; + std::unique_ptr output_; + gsc::program_ptr program_; + gsc::thread_ptr func_; + std::unordered_map labels_; + std::vector expr_labels_; + std::stack stack_; + std::vector blocks_; + +public: + auto output() -> std::vector; + void decompile(const std::string& file, std::vector& functions); + +private: + void decompile_function(const gsc::function_ptr& func); + void decompile_statements(const gsc::function_ptr& func); + void decompile_expr(); + void decompile_block(const gsc::stmt_list_ptr& block); + void decompile_nulls(const gsc::stmt_list_ptr& block); + void decompile_search_infinite(const gsc::stmt_list_ptr& block); + void decompile_search_loop(const gsc::stmt_list_ptr& block); + void decompile_search_switch(const gsc::stmt_list_ptr& block); + void decompile_search_ifelse(const gsc::stmt_list_ptr& block); + void decompile_break_continue(const gsc::stmt_list_ptr& block); + void decompile_if(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_last_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_infinite(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_while(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_for(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_foreach(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_switch(const gsc::stmt_list_ptr& block, std::uint32_t start); + auto find_location_reference(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end, const std::string& location) -> bool; + auto find_location_index(const gsc::stmt_list_ptr& block, const std::string& location) -> std::uint32_t; + auto last_location_index(const gsc::stmt_list_ptr& block, std::uint32_t index) -> bool; + void process_stack(const gsc::thread_ptr& thread); + void process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt); + void process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt); + void process_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt); + void process_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt); + void process_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt); + void process_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt); + void process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void process_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt); + void process_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt); + void process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt); + void process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt); + void process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void process_stmt_cases(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void process_expr(const gsc::context_ptr& ctx, gsc::expr_ptr& expr); + void process_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr); + void process_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr); + void process_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr); + void process_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr); + void process_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr); + void process_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr); + void process_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& arg_list); + void process_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& node); + void process_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr); + void process_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr); + void process_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr); + void process_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr); + void process_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void process_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec); + void process_var_create(const gsc::context_ptr& ctx, gsc::expr_ptr& expr, bool fromstmt = false); + void process_var_access(const gsc::context_ptr& ctx, gsc::expr_ptr& expr); + void process_var_remove(const gsc::context_ptr& ctx, const gsc::asm_remove_ptr& expr); +}; + +} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/disassembler.cpp b/src/iw5/xsk/disassembler.cpp new file mode 100644 index 00000000..71bdde54 --- /dev/null +++ b/src/iw5/xsk/disassembler.cpp @@ -0,0 +1,567 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw5.hpp" + +namespace xsk::gsc::iw5 +{ + +auto disassembler::output() -> std::vector +{ + return std::move(functions_); +} + +auto disassembler::output_data() -> std::vector +{ + output_ = std::make_unique(0x100000); + + output_->write_string("// IW5 PC GSCASM\n"); + output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); + + for (auto& func : functions_) + { + this->print_function(func); + } + + std::vector output; + + output.resize(output_->pos()); + memcpy(output.data(), output_->buffer().data(), output.size()); + + return output; +} + +void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) +{ + filename_ = file; + script_ = std::make_unique(script); + stack_ = std::make_unique(stack); + functions_.clear(); + + script_->seek(1); + + while (stack_->is_avail() && script_->is_avail()) + { + functions_.push_back(std::make_unique()); + auto& func = functions_.back(); + + func->index = static_cast(script_->pos()); + func->size = stack_->read(); + func->id = stack_->read(); + func->name = "sub_"s + (func->id == 0 ? stack_->read_c_string() : resolver::token_name(func->id)); + + this->dissasemble_function(func); + + func->labels = labels_; + labels_.clear(); + } + + this->resolve_local_functions(); +} + +void disassembler::dissasemble_function(const gsc::function_ptr& func) +{ + auto size = func->size; + + while (size > 0) + { + func->instructions.push_back(std::make_unique()); + auto& inst = func->instructions.back(); + inst->index = static_cast(script_->pos()); + inst->opcode = script_->read(); + inst->size = opcode_size(inst->opcode); + + this->dissasemble_instruction(inst); + size -= inst->size; + } +} + +void disassembler::dissasemble_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_End: + case opcode::OP_Return: + case opcode::OP_GetUndefined: + case opcode::OP_GetZero: + case opcode::OP_waittillFrameEnd: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_EvalArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_ClearArray: + case opcode::OP_EmptyArray: + case opcode::OP_AddArray: + case opcode::OP_PreScriptCall: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_GetLevelObject: + case opcode::OP_GetAnimObject: + case opcode::OP_GetSelf: + case opcode::OP_GetThisthread: + case opcode::OP_GetLevel: + case opcode::OP_GetGame: + case opcode::OP_GetAnim: + case opcode::OP_GetGameRef: + case opcode::OP_inc: + case opcode::OP_dec: + case opcode::OP_bit_or: + case opcode::OP_bit_ex_or: + case opcode::OP_bit_and: + case opcode::OP_equality: + case opcode::OP_inequality: + case opcode::OP_less: + case opcode::OP_greater: + case opcode::OP_less_equal: + case opcode::OP_waittillmatch2: + case opcode::OP_waittill: + case opcode::OP_notify: + case opcode::OP_endon: + case opcode::OP_voidCodepos: + case opcode::OP_vector: + case opcode::OP_greater_equal: + case opcode::OP_shift_left: + case opcode::OP_shift_right: + case opcode::OP_plus: + case opcode::OP_minus: + case opcode::OP_multiply: + case opcode::OP_divide: + case opcode::OP_mod: + case opcode::OP_size: + case opcode::OP_GetSelfObject: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_clearparams: + case opcode::OP_checkclearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_SetVariableField: + case opcode::OP_ClearVariableField: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_wait: + case opcode::OP_DecTop: + case opcode::OP_CastFieldObject: + case opcode::OP_CastBool: + case opcode::OP_BoolNot: + case opcode::OP_BoolComplement: + break; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetInteger: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetFloat: + inst->data.push_back(utils::string::va("%g", script_->read())); + break; + case opcode::OP_GetVector: + inst->data.push_back(utils::string::va("%g", script_->read())); + inst->data.push_back(utils::string::va("%g", script_->read())); + inst->data.push_back(utils::string::va("%g", script_->read())); + break; + case opcode::OP_GetString: + case opcode::OP_GetIString: + script_->seek(2); + inst->data.push_back(utils::string::to_literal(stack_->read_c_string())); + break; + case opcode::OP_GetAnimation: + script_->seek(4); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + break; + case opcode::OP_GetAnimTree: + script_->seek(1); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + break; + case opcode::OP_waittillmatch: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_CreateLocalVariable: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_EvalLocalArrayCached: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_EvalLocalVariableObjectCached: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalSelfFieldVariableRef: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_ClearFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + this->disassemble_field_variable(inst); + break; + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + this->disassemble_local_call(inst, false); + break; + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + this->disassemble_local_call(inst, true); + break; + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + this->disassemble_far_call(inst, false); + break; + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + this->disassemble_far_call(inst, true); + break; + case opcode::OP_CallBuiltin: + this->disassemble_builtin_call(inst, false, true); + break; + case opcode::OP_CallBuiltinMethod: + this->disassemble_builtin_call(inst, true, true); + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + this->disassemble_builtin_call(inst, false, false); + break; + case opcode::OP_GetBuiltinMethod: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + this->disassemble_builtin_call(inst, true, false); + break; + case opcode::OP_jump: + this->disassemble_jump(inst, false, false); + break; + case opcode::OP_jumpback: + this->disassemble_jump(inst, false, true); + break; + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + this->disassemble_jump(inst, true, false); + break; + case opcode::OP_switch: + this->disassemble_switch(inst); + break; + case opcode::OP_endswitch: + this->disassemble_end_switch(inst); + break; + default: + throw disasm_error(utils::string::va("Unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); + } +} + +void disassembler::disassemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num) +{ + if (arg_num) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } + + if (method) + { + inst->data.push_back(resolver::method_name(script_->read())); + } + else + { + inst->data.push_back(resolver::function_name(script_->read())); + } +} + +void disassembler::disassemble_local_call(const gsc::instruction_ptr& inst, bool thread) +{ + std::int32_t offset = this->disassemble_offset(); + + inst->data.push_back(utils::string::va("%X", offset + inst->index + 1)); + + if (thread) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } +} + +void disassembler::disassemble_far_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->seek(3); + + if (thread) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } + + auto file_id = stack_->read(); + auto file_name = file_id == 0 ? stack_->read_c_string() : resolver::file_name(file_id); + auto func_id = stack_->read(); + auto func_name = func_id == 0 ? stack_->read_c_string() : resolver::token_name(func_id); + + inst->data.push_back(file_name != "" ? file_name : utils::string::va("_ID%i", file_id)); + inst->data.push_back(func_name != "" ? func_name : utils::string::va("_ID%i", func_id)); +} + +void disassembler::disassemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back) +{ + std::int32_t addr; + std::string label; + + if (expr) + { + addr = inst->index + 3 + script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + else if (back) + { + addr = inst->index + 3 - script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + else + { + addr = inst->index + 5 + script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + + labels_.insert({addr, label}); +} + +void disassembler::disassemble_field_variable(const gsc::instruction_ptr& inst) +{ + std::uint16_t field_id = script_->read(); + std::string field_name; + + if(field_id > 0x826A) + { + auto temp = stack_->read(); + field_name = temp == 0 ? stack_->read_c_string() : std::to_string(temp); + } + else + { + field_name = resolver::token_name(field_id); + } + + inst->data.push_back(field_name != "" ? field_name : utils::string::va("_ID%i", field_id)); +} + +void disassembler::disassemble_switch(const gsc::instruction_ptr& inst) +{ + std::int32_t addr = inst->index + 4 + script_->read(); + std::string label = utils::string::va("loc_%X", addr); + + inst->data.push_back(label); + labels_.insert({addr, label}); +} + +void disassembler::disassemble_end_switch(const gsc::instruction_ptr& inst) +{ + std::uint16_t case_num = script_->read(); + inst->data.push_back(utils::string::va("%i", case_num)); + + std::uint32_t internal_index = inst->index + 3; + + if (case_num) + { + for (auto i = case_num; i > 0; i--) + { + std::uint32_t case_label = script_->read(); + + if (case_label < 0x10000 && case_label > 0) + { + inst->data.push_back("case"); + inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); + } + else if (case_label == 0) + { + inst->data.push_back("default"); + stack_->read(); + } + else + { + inst->data.push_back("case"); + inst->data.push_back(utils::string::va("%i", (case_label - 0x800000) & 0xFFFFFF)); + } + + inst->size += 4; + internal_index += 4; + + auto addr = this->disassemble_offset() + internal_index; + std::string label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + + labels_.insert({addr, label}); + + inst->size += 3; + internal_index += 3; + } + } +} + +auto disassembler::disassemble_offset() -> std::int32_t +{ + std::array bytes = {}; + + for (auto i = 0; i < 3; i++) + { + bytes[i] = script_->read(); + } + + std::int32_t offset = *reinterpret_cast(bytes.data()); + + offset = (offset << 8) >> 10; + + return offset; +} + +void disassembler::resolve_local_functions() +{ + for (auto& func : functions_) + { + for (auto& inst : func->instructions) + { + switch (opcode(inst->opcode)) + { + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + inst->data.at(0) = this->resolve_function(inst->data[0]); + break; + default: + break; + } + } + } +} + +auto disassembler::resolve_function(const std::string& index) -> std::string +{ + if (utils::string::is_hex_number(index)) + { + std::uint32_t idx = std::stoul(index, nullptr, 16); + + for (auto& func : functions_) + { + if (func->index == idx) + { + return func->name; + } + } + + throw disasm_error(utils::string::va("Couldn't resolve function name at index '0x%04X'!", idx)); + } + + throw disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); +} + +void disassembler::print_function(const gsc::function_ptr& func) +{ + output_->write_string("\n"); + output_->write_string(utils::string::va("%s\n", func->name.data())); + + for (auto& inst : func->instructions) + { + const auto itr = func->labels.find(inst->index); + + if (itr != func->labels.end()) + { + output_->write_string(utils::string::va("\t%s\n", itr->second.data())); + } + + this->print_instruction(inst); + } + + output_->write_string(utils::string::va("end_%s\n", func->name.substr(4).data())); +} + +void disassembler::print_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_endswitch: + output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); + output_->write_string(utils::string::va(" %s\n", inst->data[0].data())); + { + std::uint32_t totalcase = std::stoul(inst->data[0]); + auto index = 0; + for (auto casenum = 0u; casenum < totalcase; casenum++) + { + if (inst->data[1 + index] == "case") + { + output_->write_string(utils::string::va("\t\t\t%s %s %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data(), inst->data[1 + index + 2].data())); + index += 3; + } + else if (inst->data[1 + index] == "default") + { + output_->write_string(utils::string::va("\t\t\t%s %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data())); + index += 2; + } + + output_->write_string("\n"); + } + } + break; + default: + output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); + + for (auto& d : inst->data) + { + output_->write_string(utils::string::va(" %s", d.data())); + } + + output_->write_string("\n"); + break; + } +} + +} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/disassembler.hpp b/src/iw5/xsk/disassembler.hpp new file mode 100644 index 00000000..1a1e2a89 --- /dev/null +++ b/src/iw5/xsk/disassembler.hpp @@ -0,0 +1,42 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::iw5 +{ + +class disassembler : public gsc::disassembler +{ + std::string filename_; + utils::byte_buffer_ptr script_; + utils::byte_buffer_ptr stack_; + utils::byte_buffer_ptr output_; + std::vector functions_; + std::unordered_map labels_; + +public: + auto output() -> std::vector; + auto output_data() -> std::vector; + void disassemble(const std::string& file, std::vector& script, std::vector& stack); + +private: + void dissasemble_function(const gsc::function_ptr& func); + void dissasemble_instruction(const gsc::instruction_ptr& inst); + void disassemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num); + void disassemble_local_call(const gsc::instruction_ptr& inst, bool thread); + void disassemble_far_call(const gsc::instruction_ptr& inst, bool thread); + void disassemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back); + void disassemble_field_variable(const gsc::instruction_ptr& inst); + void disassemble_switch(const gsc::instruction_ptr& inst); + void disassemble_end_switch(const gsc::instruction_ptr& inst); + auto disassemble_offset() -> std::int32_t; + void resolve_local_functions(); + auto resolve_function(const std::string& index) -> std::string; + void print_function(const gsc::function_ptr& func); + void print_instruction(const gsc::instruction_ptr& inst); +}; + +} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/iw5.cpp b/src/iw5/xsk/iw5.cpp new file mode 100644 index 00000000..f67a4344 --- /dev/null +++ b/src/iw5/xsk/iw5.cpp @@ -0,0 +1,179 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw5.hpp" + +namespace xsk::gsc::iw5 +{ + +auto opcode_size(std::uint8_t id) -> std::uint32_t +{ + switch (opcode(id)) + { + case opcode::OP_End: + case opcode::OP_Return: + case opcode::OP_GetUndefined: + case opcode::OP_GetZero: + case opcode::OP_waittillFrameEnd: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_EvalArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_ClearArray: + case opcode::OP_EmptyArray: + case opcode::OP_AddArray: + case opcode::OP_PreScriptCall: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_GetLevelObject: + case opcode::OP_GetAnimObject: + case opcode::OP_GetSelf: + case opcode::OP_GetThisthread: + case opcode::OP_GetLevel: + case opcode::OP_GetGame: + case opcode::OP_GetAnim: + case opcode::OP_GetGameRef: + case opcode::OP_inc: + case opcode::OP_dec: + case opcode::OP_bit_or: + case opcode::OP_bit_ex_or: + case opcode::OP_bit_and: + case opcode::OP_equality: + case opcode::OP_inequality: + case opcode::OP_less: + case opcode::OP_greater: + case opcode::OP_less_equal: + case opcode::OP_waittillmatch2: + case opcode::OP_waittill: + case opcode::OP_notify: + case opcode::OP_endon: + case opcode::OP_voidCodepos: + case opcode::OP_vector: + case opcode::OP_greater_equal: + case opcode::OP_shift_left: + case opcode::OP_shift_right: + case opcode::OP_plus: + case opcode::OP_minus: + case opcode::OP_multiply: + case opcode::OP_divide: + case opcode::OP_mod: + case opcode::OP_size: + case opcode::OP_GetSelfObject: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_clearparams: + case opcode::OP_checkclearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_SetVariableField: + case opcode::OP_ClearVariableField: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_wait: + case opcode::OP_DecTop: + case opcode::OP_CastFieldObject: + case opcode::OP_CastBool: + case opcode::OP_BoolNot: + case opcode::OP_BoolComplement: + return 1; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + case opcode::OP_CreateLocalVariable: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_EvalLocalArrayCached: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_GetAnimTree: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_EvalLocalVariableObjectCached: + return 2; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + case opcode::OP_GetBuiltinFunction: + case opcode::OP_GetBuiltinMethod: + case opcode::OP_GetString: + case opcode::OP_GetIString: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_jumpback: + case opcode::OP_endswitch: + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_waittillmatch: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalSelfFieldVariableRef: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_ClearFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + return 3; + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_GetLocalFunction: + case opcode::OP_CallBuiltin: + case opcode::OP_CallBuiltinMethod: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + case opcode::OP_GetFarFunction: + return 4; + case opcode::OP_GetInteger: + case opcode::OP_GetFloat: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + case opcode::OP_GetAnimation: + case opcode::OP_switch: + case opcode::OP_jump: + return 5; + case opcode::OP_GetVector: + return 13; + default: + throw std::runtime_error("Couldn't resolve instruction size for " + std::to_string(id)); + } +} + +} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/iw5.hpp b/src/iw5/xsk/iw5.hpp new file mode 100644 index 00000000..3e321a72 --- /dev/null +++ b/src/iw5/xsk/iw5.hpp @@ -0,0 +1,179 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "utils/xsk/utils.hpp" + +#include "assembler.hpp" +#include "disassembler.hpp" +#include "compiler.hpp" +#include "decompiler.hpp" +#include "resolver.hpp" + +namespace xsk::gsc::iw5 +{ + +enum class opcode : std::uint8_t +{ + OP_End = 0x0, + OP_Return = 0x1, + OP_GetByte = 0x2, + OP_GetNegByte = 0x3, + OP_GetUnsignedShort = 0x4, + OP_GetNegUnsignedShort = 0x5, + OP_GetInteger = 0x6, + OP_GetBuiltinFunction = 0x7, + OP_GetBuiltinMethod = 0x8, + OP_GetFloat = 0x9, + OP_GetString = 0xA, + OP_GetUndefined = 0xB, + OP_GetZero = 0xC, + OP_waittillFrameEnd = 0xD, + OP_CreateLocalVariable = 0xE, + OP_RemoveLocalVariables = 0xF, + OP_EvalLocalVariableCached0 = 0x10, + OP_EvalLocalVariableCached1 = 0x11, + OP_EvalLocalVariableCached2 = 0x12, + OP_EvalLocalVariableCached3 = 0x13, + OP_EvalLocalVariableCached4 = 0x14, + OP_EvalLocalVariableCached5 = 0x15, + OP_EvalLocalVariableCached = 0x16, + OP_EvalLocalArrayCached = 0x17, + OP_EvalArray = 0x18, + OP_EvalLocalArrayRefCached0 = 0x19, + OP_EvalNewLocalArrayRefCached0 = 0x1A, + OP_EvalLocalArrayRefCached = 0x1B, + OP_EvalArrayRef = 0x1C, + OP_ClearArray = 0x1D, + OP_EmptyArray = 0x1E, + OP_AddArray = 0x1F, + OP_PreScriptCall = 0x20, + OP_ScriptLocalFunctionCall2 = 0x21, + OP_ScriptLocalFunctionCall = 0x22, + OP_ScriptLocalMethodCall = 0x23, + OP_ScriptLocalThreadCall = 0x24, + OP_ScriptLocalChildThreadCall = 0x25, + OP_ScriptLocalMethodThreadCall = 0x26, + OP_ScriptLocalMethodChildThreadCall = 0x27, + OP_ScriptFarFunctionCall2 = 0x28, + OP_ScriptFarFunctionCall = 0x29, + OP_ScriptFarMethodCall = 0x2A, + OP_ScriptFarThreadCall = 0x2B, + OP_ScriptFarChildThreadCall = 0x2C, + OP_ScriptFarMethodThreadCall = 0x2D, + OP_ScriptFarMethodChildThreadCall = 0x2E, + OP_ScriptFunctionCallPointer = 0x2F, + OP_ScriptMethodCallPointer = 0x30, + OP_ScriptThreadCallPointer = 0x31, + OP_ScriptChildThreadCallPointer = 0x32, + OP_ScriptMethodThreadCallPointer = 0x33, + OP_ScriptMethodChildThreadCallPointer = 0x34, + OP_CallBuiltinPointer = 0x35, + OP_CallBuiltinMethodPointer = 0x36, + OP_GetIString = 0x37, + OP_GetVector = 0x38, + OP_GetLevelObject = 0x39, + OP_GetAnimObject = 0x3A, + OP_GetSelf = 0x3B, + OP_GetThisthread = 0x3C, + OP_GetLevel = 0x3D, + OP_GetGame = 0x3E, + OP_GetAnim = 0x3F, + OP_GetAnimation = 0x40, + OP_GetGameRef = 0x41, + OP_inc = 0x42, + OP_dec = 0x43, + OP_bit_or = 0x44, + OP_JumpOnFalseExpr = 0x45, + OP_bit_ex_or = 0x46, + OP_bit_and = 0x47, + OP_equality = 0x48, + OP_inequality = 0x49, + OP_less = 0x4A, + OP_greater = 0x4B, + OP_JumpOnTrueExpr = 0x4C, + OP_less_equal = 0x4D, + OP_jumpback = 0x4E, + OP_waittillmatch2 = 0x4F, + OP_waittill = 0x50, + OP_notify = 0x51, + OP_endon = 0x52, + OP_voidCodepos = 0x53, + OP_switch = 0x54, + OP_endswitch = 0x55, + OP_vector = 0x56, + OP_JumpOnFalse = 0x57, + OP_greater_equal = 0x58, + OP_shift_left = 0x59, + OP_shift_right = 0x5A, + OP_plus = 0x5B, + OP_jump = 0x5C, + OP_minus = 0x5D, + OP_multiply = 0x5E, + OP_divide = 0x5F, + OP_mod = 0x60, + OP_JumpOnTrue = 0x61, + OP_size = 0x62, + OP_waittillmatch = 0x63, + OP_GetLocalFunction = 0x64, + OP_GetFarFunction = 0x65, + OP_GetSelfObject = 0x66, + OP_EvalLevelFieldVariable = 0x67, + OP_EvalAnimFieldVariable = 0x68, + OP_EvalSelfFieldVariable = 0x69, + OP_EvalFieldVariable = 0x6A, + OP_EvalLevelFieldVariableRef = 0x6B, + OP_EvalAnimFieldVariableRef = 0x6C, + OP_EvalSelfFieldVariableRef = 0x6D, + OP_EvalFieldVariableRef = 0x6E, + OP_ClearFieldVariable = 0x6F, + OP_SafeCreateVariableFieldCached = 0x70, + OP_SafeSetVariableFieldCached0 = 0x71, + OP_SafeSetVariableFieldCached = 0x72, + OP_SafeSetWaittillVariableFieldCached = 0x73, + OP_GetAnimTree = 0x74, + OP_clearparams = 0x75, + OP_checkclearparams = 0x76, + OP_EvalLocalVariableRefCached0 = 0x77, + OP_EvalNewLocalVariableRefCached0 = 0x78, + OP_EvalLocalVariableRefCached = 0x79, + OP_SetLevelFieldVariableField = 0x7A, + OP_SetVariableField = 0x7B, + OP_ClearVariableField = 0x7C, + OP_SetAnimFieldVariableField = 0x7D, + OP_SetSelfFieldVariableField = 0x7E, + OP_SetLocalVariableFieldCached0 = 0x7F, + OP_SetNewLocalVariableFieldCached0 = 0x80, + OP_SetLocalVariableFieldCached = 0x81, + OP_ClearLocalVariableFieldCached = 0x82, + OP_ClearLocalVariableFieldCached0 = 0x83, + OP_CallBuiltin0 = 0x84, + OP_CallBuiltin1 = 0x85, + OP_CallBuiltin2 = 0x86, + OP_CallBuiltin3 = 0x87, + OP_CallBuiltin4 = 0x88, + OP_CallBuiltin5 = 0x89, + OP_CallBuiltin = 0x8A, + OP_CallBuiltinMethod0 = 0x8B, + OP_CallBuiltinMethod1 = 0x8C, + OP_CallBuiltinMethod2 = 0x8D, + OP_CallBuiltinMethod3 = 0x8E, + OP_CallBuiltinMethod4 = 0x8F, + OP_CallBuiltinMethod5 = 0x90, + OP_CallBuiltinMethod = 0x91, + OP_wait = 0x92, + OP_DecTop = 0x93, + OP_CastFieldObject = 0x94, + OP_EvalLocalVariableObjectCached = 0x95, + OP_CastBool = 0x96, + OP_BoolNot = 0x97, + OP_BoolComplement = 0x98, + OP_Count = 0x99, +}; + +auto opcode_size(std::uint8_t id) -> std::uint32_t; + +} // namespace xsk::gsc::iw5 diff --git a/src/iw5/xsk/lexer.cpp b/src/iw5/xsk/lexer.cpp new file mode 100644 index 00000000..002dbbcf --- /dev/null +++ b/src/iw5/xsk/lexer.cpp @@ -0,0 +1,2816 @@ +#line 1 "lexer.cpp" +#include "stdafx.hpp" +#include "iw5.hpp" +#include "parser.hpp" +using namespace xsk::gsc; + +#line 7 "lexer.cpp" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define iw5__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer iw5__create_buffer +#endif + +#ifdef yy_delete_buffer +#define iw5__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer iw5__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define iw5__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer iw5__scan_buffer +#endif + +#ifdef yy_scan_string +#define iw5__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string iw5__scan_string +#endif + +#ifdef yy_scan_bytes +#define iw5__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes iw5__scan_bytes +#endif + +#ifdef yy_init_buffer +#define iw5__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer iw5__init_buffer +#endif + +#ifdef yy_flush_buffer +#define iw5__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer iw5__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define iw5__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state iw5__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define iw5__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer iw5__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define iw5_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state iw5_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define iw5_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state iw5_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define iw5_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack iw5_ensure_buffer_stack +#endif + +#ifdef yylex +#define iw5_lex_ALREADY_DEFINED +#else +#define yylex iw5_lex +#endif + +#ifdef yyrestart +#define iw5_restart_ALREADY_DEFINED +#else +#define yyrestart iw5_restart +#endif + +#ifdef yylex_init +#define iw5_lex_init_ALREADY_DEFINED +#else +#define yylex_init iw5_lex_init +#endif + +#ifdef yylex_init_extra +#define iw5_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra iw5_lex_init_extra +#endif + +#ifdef yylex_destroy +#define iw5_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy iw5_lex_destroy +#endif + +#ifdef yyget_debug +#define iw5_get_debug_ALREADY_DEFINED +#else +#define yyget_debug iw5_get_debug +#endif + +#ifdef yyset_debug +#define iw5_set_debug_ALREADY_DEFINED +#else +#define yyset_debug iw5_set_debug +#endif + +#ifdef yyget_extra +#define iw5_get_extra_ALREADY_DEFINED +#else +#define yyget_extra iw5_get_extra +#endif + +#ifdef yyset_extra +#define iw5_set_extra_ALREADY_DEFINED +#else +#define yyset_extra iw5_set_extra +#endif + +#ifdef yyget_in +#define iw5_get_in_ALREADY_DEFINED +#else +#define yyget_in iw5_get_in +#endif + +#ifdef yyset_in +#define iw5_set_in_ALREADY_DEFINED +#else +#define yyset_in iw5_set_in +#endif + +#ifdef yyget_out +#define iw5_get_out_ALREADY_DEFINED +#else +#define yyget_out iw5_get_out +#endif + +#ifdef yyset_out +#define iw5_set_out_ALREADY_DEFINED +#else +#define yyset_out iw5_set_out +#endif + +#ifdef yyget_leng +#define iw5_get_leng_ALREADY_DEFINED +#else +#define yyget_leng iw5_get_leng +#endif + +#ifdef yyget_text +#define iw5_get_text_ALREADY_DEFINED +#else +#define yyget_text iw5_get_text +#endif + +#ifdef yyget_lineno +#define iw5_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno iw5_get_lineno +#endif + +#ifdef yyset_lineno +#define iw5_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno iw5_set_lineno +#endif + +#ifdef yyget_column +#define iw5_get_column_ALREADY_DEFINED +#else +#define yyget_column iw5_get_column +#endif + +#ifdef yyset_column +#define iw5_set_column_ALREADY_DEFINED +#else +#define yyset_column iw5_set_column +#endif + +#ifdef yywrap +#define iw5_wrap_ALREADY_DEFINED +#else +#define yywrap iw5_wrap +#endif + +#ifdef yyalloc +#define iw5_alloc_ALREADY_DEFINED +#else +#define yyalloc iw5_alloc +#endif + +#ifdef yyrealloc +#define iw5_realloc_ALREADY_DEFINED +#else +#define yyrealloc iw5_realloc +#endif + +#ifdef yyfree +#define iw5_free_ALREADY_DEFINED +#else +#define yyfree iw5_free +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. + */ +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yyg->yy_start = 1 + 2 * +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yyg->yy_start - 1) / 2) +#define YYSTATE YY_START +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +#define yy_new_buffer yy_create_buffer +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define iw5_wrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; + +typedef int yy_state_type; + +#define yytext_ptr yytext_r + +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yyg->yy_c_buf_p = yy_cp; +#define YY_NUM_RULES 96 +#define YY_END_OF_BUFFER 97 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[281] = + { 0, + 0, 0, 0, 0, 0, 0, 97, 95, 1, 2, + 84, 95, 95, 83, 87, 95, 45, 46, 81, 79, + 51, 80, 52, 82, 94, 54, 55, 68, 78, 69, + 90, 49, 50, 88, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, 90, 47, + 86, 48, 85, 5, 6, 5, 9, 10, 9, 65, + 0, 92, 0, 0, 0, 0, 74, 0, 63, 0, + 76, 0, 0, 72, 56, 70, 57, 71, 93, 8, + 4, 3, 73, 93, 94, 0, 0, 53, 60, 66, + 64, 67, 61, 90, 77, 90, 90, 90, 90, 90, + + 90, 90, 90, 90, 90, 90, 21, 26, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, 90, 75, + 62, 7, 11, 0, 92, 0, 0, 0, 0, 0, + 91, 0, 0, 0, 0, 92, 0, 93, 3, 93, + 93, 89, 58, 59, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 24, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, 0, 0, + 0, 0, 91, 0, 0, 91, 0, 43, 90, 36, + 28, 90, 90, 90, 22, 90, 90, 90, 41, 90, + 90, 90, 42, 40, 90, 90, 90, 37, 90, 17, + + 90, 0, 0, 0, 30, 90, 90, 90, 15, 38, + 90, 44, 90, 90, 90, 90, 90, 90, 90, 23, + 0, 0, 0, 90, 90, 90, 90, 16, 32, 27, + 90, 33, 90, 90, 0, 0, 0, 90, 90, 29, + 25, 90, 90, 90, 0, 12, 0, 90, 31, 90, + 90, 18, 14, 0, 90, 90, 39, 90, 90, 0, + 90, 35, 90, 90, 0, 34, 90, 90, 0, 90, + 90, 0, 90, 19, 0, 90, 13, 90, 20, 0 + } ; + +static const YY_CHAR yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 5, 6, 1, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, + 22, 23, 1, 1, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 25, 26, 27, 28, 29, 1, 30, 31, 32, 33, + + 34, 35, 36, 37, 38, 24, 39, 40, 41, 42, + 43, 24, 24, 44, 45, 46, 47, 48, 49, 24, + 50, 51, 52, 53, 54, 55, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static const YY_CHAR yy_meta[56] = + { 0, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 1, 4, 1, 1, + 1, 1, 1, 4, 1, 5, 1, 1, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 1, 1, 1, 1 + } ; + +static const flex_int16_t yy_base[295] = + { 0, + 0, 0, 53, 54, 55, 56, 530, 531, 531, 531, + 507, 55, 33, 506, 64, 58, 531, 531, 505, 55, + 531, 60, 508, 73, 71, 506, 531, 70, 502, 71, + 497, 531, 531, 500, 57, 44, 70, 72, 75, 78, + 48, 76, 86, 79, 90, 93, 88, 84, 103, 531, + 81, 531, 531, 531, 531, 504, 531, 531, 503, 531, + 104, 531, 132, 477, 476, 472, 531, 118, 531, 119, + 531, 127, 138, 531, 531, 531, 531, 531, 120, 531, + 531, 0, 531, 121, 133, 134, 0, 531, 494, 531, + 531, 531, 493, 488, 531, 38, 120, 117, 135, 126, + + 137, 122, 143, 139, 140, 144, 487, 486, 145, 148, + 149, 151, 152, 154, 160, 155, 156, 161, 162, 531, + 531, 531, 531, 185, 191, 202, 473, 478, 471, 192, + 531, 203, 200, 207, 204, 205, 212, 531, 0, 201, + 531, 482, 531, 531, 186, 194, 197, 206, 199, 196, + 215, 209, 208, 218, 220, 221, 222, 223, 224, 227, + 226, 231, 233, 232, 238, 239, 241, 242, 466, 466, + 463, 264, 265, 271, 266, 270, 277, 478, 255, 477, + 476, 262, 263, 257, 475, 258, 259, 272, 474, 273, + 279, 157, 473, 472, 280, 281, 285, 471, 282, 283, + + 284, 450, 448, 458, 467, 290, 293, 294, 466, 465, + 296, 464, 295, 297, 300, 304, 298, 306, 312, 463, + 444, 454, 457, 314, 299, 307, 317, 459, 458, 457, + 316, 456, 321, 322, 447, 446, 449, 323, 330, 452, + 451, 331, 332, 329, 442, 531, 433, 342, 448, 344, + 326, 345, 531, 435, 347, 346, 446, 349, 352, 430, + 355, 444, 357, 358, 423, 429, 359, 363, 363, 364, + 365, 372, 371, 377, 365, 366, 531, 368, 370, 531, + 408, 413, 418, 423, 426, 428, 433, 438, 443, 448, + 453, 357, 458, 463 + + } ; + +static const flex_int16_t yy_def[295] = + { 0, + 280, 1, 281, 281, 282, 282, 280, 280, 280, 280, + 280, 283, 280, 280, 280, 284, 280, 280, 280, 280, + 280, 280, 280, 280, 285, 280, 280, 280, 280, 280, + 286, 280, 280, 280, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 286, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 283, 280, 287, 280, 280, 280, 280, 288, 280, 289, + 280, 284, 290, 280, 280, 280, 280, 280, 280, 280, + 280, 291, 280, 280, 285, 285, 292, 280, 280, 280, + 280, 280, 280, 286, 280, 286, 286, 286, 286, 286, + + 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 286, 280, + 280, 280, 280, 283, 283, 287, 280, 280, 280, 288, + 280, 293, 289, 294, 284, 284, 290, 280, 291, 280, + 280, 292, 280, 280, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 280, 280, + 280, 288, 288, 293, 289, 289, 294, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, + + 286, 280, 280, 280, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, + 280, 280, 280, 286, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 280, 280, 280, 286, 286, 286, + 286, 286, 286, 286, 280, 280, 280, 286, 286, 286, + 286, 286, 280, 280, 286, 286, 286, 286, 286, 280, + 286, 286, 286, 286, 280, 286, 286, 286, 280, 286, + 286, 280, 286, 286, 280, 286, 280, 286, 286, 0, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280 + + } ; + +static const flex_int16_t yy_nxt[587] = + { 0, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 8, 33, 34, 31, 35, + 36, 37, 38, 39, 40, 41, 31, 42, 31, 43, + 31, 44, 31, 45, 46, 47, 48, 31, 49, 31, + 31, 50, 51, 52, 53, 55, 55, 58, 58, 62, + 59, 59, 64, 87, 56, 56, 62, 75, 68, 87, + 65, 69, 70, 87, 77, 145, 76, 106, 80, 66, + 63, 78, 87, 73, 81, 71, 84, 97, 85, 82, + 89, 90, 92, 93, 83, 87, 87, 87, 96, 98, + + 87, 87, 120, 87, 87, 101, 99, 104, 62, 87, + 107, 87, 100, 87, 102, 87, 103, 108, 87, 109, + 105, 110, 131, 111, 115, 117, 112, 131, 87, 63, + 113, 116, 118, 121, 61, 62, 125, 79, 140, 119, + 72, 114, 87, 132, 134, 87, 136, 87, 84, 280, + 85, 87, 73, 146, 138, 141, 147, 126, 87, 87, + 87, 148, 87, 137, 87, 87, 152, 150, 87, 87, + 87, 151, 149, 87, 87, 153, 87, 87, 154, 87, + 87, 87, 87, 155, 156, 87, 87, 87, 166, 62, + 160, 162, 157, 158, 159, 62, 131, 163, 167, 168, + + 214, 165, 161, 164, 61, 130, 125, 173, 131, 133, + 63, 87, 62, 62, 72, 176, 63, 132, 140, 87, + 136, 87, 87, 179, 87, 134, 178, 126, 174, 73, + 73, 87, 177, 87, 87, 141, 180, 137, 182, 181, + 87, 183, 185, 87, 184, 87, 87, 87, 87, 87, + 186, 87, 87, 188, 189, 190, 87, 87, 87, 194, + 191, 193, 187, 87, 87, 197, 87, 87, 131, 131, + 192, 198, 199, 130, 131, 173, 195, 196, 131, 133, + 87, 201, 87, 87, 87, 176, 200, 87, 87, 132, + 132, 134, 210, 205, 206, 134, 174, 87, 87, 209, + + 207, 211, 177, 208, 87, 87, 87, 87, 87, 87, + 87, 215, 212, 213, 217, 87, 218, 220, 87, 87, + 87, 87, 87, 87, 87, 87, 216, 227, 219, 87, + 232, 87, 87, 226, 225, 224, 230, 87, 229, 87, + 231, 87, 87, 233, 228, 239, 87, 87, 87, 234, + 238, 87, 240, 241, 87, 87, 87, 87, 257, 242, + 142, 244, 243, 249, 250, 251, 248, 87, 252, 87, + 87, 87, 87, 256, 87, 255, 261, 87, 262, 258, + 87, 264, 87, 87, 87, 259, 267, 266, 87, 87, + 87, 87, 263, 87, 271, 87, 87, 273, 277, 270, + + 279, 274, 87, 268, 276, 275, 272, 278, 54, 54, + 54, 54, 54, 57, 57, 57, 57, 57, 61, 61, + 61, 61, 61, 72, 72, 72, 72, 72, 86, 86, + 86, 94, 94, 124, 124, 124, 124, 124, 130, 130, + 130, 130, 130, 133, 133, 133, 133, 133, 135, 135, + 135, 135, 135, 139, 87, 139, 139, 139, 172, 172, + 172, 172, 172, 175, 175, 175, 175, 175, 269, 87, + 265, 87, 260, 87, 254, 253, 87, 87, 247, 246, + 245, 87, 87, 87, 87, 237, 236, 235, 87, 87, + 87, 87, 87, 223, 222, 221, 87, 87, 87, 87, + + 87, 87, 87, 87, 204, 203, 202, 87, 171, 170, + 169, 87, 87, 87, 144, 143, 129, 128, 127, 123, + 122, 95, 87, 91, 88, 79, 74, 67, 60, 280, + 7, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280 + } ; + +static const flex_int16_t yy_chk[587] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 4, 5, 6, 12, + 5, 6, 13, 96, 3, 4, 16, 20, 15, 36, + 13, 15, 15, 41, 22, 96, 20, 41, 24, 13, + 12, 22, 35, 16, 24, 15, 25, 36, 25, 24, + 28, 28, 30, 30, 24, 37, 25, 38, 35, 37, + + 39, 42, 51, 40, 44, 38, 37, 40, 61, 48, + 42, 43, 37, 47, 39, 45, 39, 42, 46, 43, + 40, 44, 68, 45, 47, 48, 46, 70, 49, 61, + 46, 47, 49, 51, 63, 72, 63, 79, 84, 49, + 73, 46, 98, 68, 70, 97, 73, 102, 85, 86, + 85, 100, 72, 97, 79, 84, 98, 63, 85, 86, + 99, 98, 101, 73, 104, 105, 102, 100, 103, 106, + 109, 101, 99, 110, 111, 103, 112, 113, 104, 114, + 116, 117, 192, 105, 106, 115, 118, 119, 117, 124, + 112, 114, 109, 110, 111, 125, 130, 115, 118, 119, + + 192, 116, 113, 115, 126, 132, 126, 132, 133, 134, + 124, 145, 135, 136, 137, 134, 125, 130, 140, 146, + 137, 150, 147, 146, 149, 133, 145, 126, 132, 135, + 136, 148, 134, 153, 152, 140, 147, 137, 149, 148, + 151, 150, 152, 154, 151, 155, 156, 157, 158, 159, + 153, 161, 160, 155, 156, 157, 162, 164, 163, 161, + 158, 160, 154, 165, 166, 164, 167, 168, 172, 173, + 159, 165, 166, 174, 175, 174, 162, 163, 176, 177, + 179, 168, 184, 186, 187, 177, 167, 182, 183, 172, + 173, 175, 187, 179, 182, 176, 174, 188, 190, 186, + + 183, 188, 177, 184, 191, 195, 196, 199, 200, 201, + 197, 195, 190, 191, 197, 206, 199, 201, 207, 208, + 213, 211, 214, 217, 225, 215, 196, 211, 200, 216, + 217, 218, 226, 208, 207, 206, 215, 219, 214, 224, + 216, 231, 227, 218, 213, 225, 233, 234, 238, 219, + 224, 251, 226, 227, 244, 239, 242, 243, 251, 231, + 292, 234, 233, 239, 242, 243, 238, 248, 244, 250, + 252, 256, 255, 250, 258, 248, 255, 259, 256, 252, + 261, 259, 263, 264, 267, 252, 263, 261, 268, 270, + 271, 276, 258, 278, 268, 279, 273, 270, 275, 267, + + 278, 271, 274, 264, 273, 272, 269, 276, 281, 281, + 281, 281, 281, 282, 282, 282, 282, 282, 283, 283, + 283, 283, 283, 284, 284, 284, 284, 284, 285, 285, + 285, 286, 286, 287, 287, 287, 287, 287, 288, 288, + 288, 288, 288, 289, 289, 289, 289, 289, 290, 290, + 290, 290, 290, 291, 266, 291, 291, 291, 293, 293, + 293, 293, 293, 294, 294, 294, 294, 294, 265, 262, + 260, 257, 254, 249, 247, 245, 241, 240, 237, 236, + 235, 232, 230, 229, 228, 223, 222, 221, 220, 212, + 210, 209, 205, 204, 203, 202, 198, 194, 193, 189, + + 185, 181, 180, 178, 171, 170, 169, 142, 129, 128, + 127, 108, 107, 94, 93, 89, 66, 65, 64, 59, + 56, 34, 31, 29, 26, 23, 19, 14, 11, 7, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280 + } ; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +#line 1 "lexer.lpp" +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ +#define YY_NO_INPUT 1 +#define YY_NO_UNISTD_H 1 + +#line 23 "lexer.lpp" +#define YY_USER_ACTION loc.columns(yyleng); +#line 869 "lexer.cpp" + +#line 871 "lexer.cpp" + +#define INITIAL 0 +#define COMMENT_BLOCK_STATE 1 +#define DEVELOPER_BLOCK_STATE 2 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +/* Holds the entire state of the reentrant scanner. */ +struct yyguts_t + { + + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; + + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + int yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + int yylineno_r; + int yy_flex_debug_r; + + char *yytext_r; + int yy_more_flag; + int yy_more_len; + + }; /* end struct yyguts_t */ + +static int yy_init_globals ( yyscan_t yyscanner ); + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput ( yyscan_t yyscanner ); +#else +static int input ( yyscan_t yyscanner ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + int n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK /*LINTED*/break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_load_buffer_state( yyscanner ); + } + + { +#line 36 "lexer.lpp" + + + +#line 40 "lexer.lpp" + loc.step(); + + +#line 1139 "lexer.cpp" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yyg->yy_start; +yy_match: + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 281 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + ++yy_cp; + } + while ( yy_current_state != 280 ); + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 43 "lexer.lpp" +{ loc.step(); } + YY_BREAK +case 2: +/* rule 2 can match eol */ +YY_RULE_SETUP +#line 45 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 47 "lexer.lpp" + + YY_BREAK +case 4: +YY_RULE_SETUP +#line 49 "lexer.lpp" +{ BEGIN(COMMENT_BLOCK_STATE); } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 50 "lexer.lpp" + + YY_BREAK +case 6: +/* rule 6 can match eol */ +YY_RULE_SETUP +#line 51 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 52 "lexer.lpp" +{ BEGIN(INITIAL); } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 54 "lexer.lpp" +{ BEGIN(DEVELOPER_BLOCK_STATE); } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 55 "lexer.lpp" + + YY_BREAK +case 10: +/* rule 10 can match eol */ +YY_RULE_SETUP +#line 56 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 57 "lexer.lpp" +{ BEGIN(INITIAL); } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 59 "lexer.lpp" +{ return iw5::parser::make_INCLUDE(loc); } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 60 "lexer.lpp" +{ return iw5::parser::make_USINGTREE(loc); } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 61 "lexer.lpp" +{ return iw5::parser::make_ANIMTREE(loc); } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 62 "lexer.lpp" +{ return iw5::parser::make_ENDON(loc); } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 63 "lexer.lpp" +{ return iw5::parser::make_NOTIFY(loc); } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 64 "lexer.lpp" +{ return iw5::parser::make_WAIT(loc); } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 65 "lexer.lpp" +{ return iw5::parser::make_WAITTILL(loc); } + YY_BREAK +case 19: +YY_RULE_SETUP +#line 66 "lexer.lpp" +{ return iw5::parser::make_WAITTILLMATCH(loc); } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 67 "lexer.lpp" +{ return iw5::parser::make_WAITTILLFRAMEEND(loc); } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 68 "lexer.lpp" +{ return iw5::parser::make_IF(loc); } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 69 "lexer.lpp" +{ return iw5::parser::make_ELSE(loc); } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 70 "lexer.lpp" +{ return iw5::parser::make_WHILE(loc); } + YY_BREAK +case 24: +YY_RULE_SETUP +#line 71 "lexer.lpp" +{ return iw5::parser::make_FOR(loc); } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 72 "lexer.lpp" +{ return iw5::parser::make_FOREACH(loc); } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 73 "lexer.lpp" +{ return iw5::parser::make_IN(loc); } + YY_BREAK +case 27: +YY_RULE_SETUP +#line 74 "lexer.lpp" +{ return iw5::parser::make_SWITCH(loc); } + YY_BREAK +case 28: +YY_RULE_SETUP +#line 75 "lexer.lpp" +{ return iw5::parser::make_CASE(loc); } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 76 "lexer.lpp" +{ return iw5::parser::make_DEFAULT(loc); } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 77 "lexer.lpp" +{ return iw5::parser::make_BREAK(loc); } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 78 "lexer.lpp" +{ return iw5::parser::make_CONTINUE(loc); } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 79 "lexer.lpp" +{ return iw5::parser::make_RETURN(loc); } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 80 "lexer.lpp" +{ return iw5::parser::make_THREAD(loc); } + YY_BREAK +case 34: +YY_RULE_SETUP +#line 81 "lexer.lpp" +{ return iw5::parser::make_CHILDTHREAD(loc); } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 82 "lexer.lpp" +{ return iw5::parser::make_THISTHREAD(loc); } + YY_BREAK +case 36: +YY_RULE_SETUP +#line 83 "lexer.lpp" +{ return iw5::parser::make_CALL(loc); } + YY_BREAK +case 37: +YY_RULE_SETUP +#line 84 "lexer.lpp" +{ return iw5::parser::make_TRUE(loc); } + YY_BREAK +case 38: +YY_RULE_SETUP +#line 85 "lexer.lpp" +{ return iw5::parser::make_FALSE(loc); } + YY_BREAK +case 39: +YY_RULE_SETUP +#line 86 "lexer.lpp" +{ return iw5::parser::make_UNDEFINED(loc); } + YY_BREAK +case 40: +YY_RULE_SETUP +#line 87 "lexer.lpp" +{ return iw5::parser::make_SIZE(loc); } + YY_BREAK +case 41: +YY_RULE_SETUP +#line 88 "lexer.lpp" +{ return iw5::parser::make_GAME(loc); } + YY_BREAK +case 42: +YY_RULE_SETUP +#line 89 "lexer.lpp" +{ return iw5::parser::make_SELF(loc); } + YY_BREAK +case 43: +YY_RULE_SETUP +#line 90 "lexer.lpp" +{ return iw5::parser::make_ANIM(loc); } + YY_BREAK +case 44: +YY_RULE_SETUP +#line 91 "lexer.lpp" +{ return iw5::parser::make_LEVEL(loc); } + YY_BREAK +case 45: +YY_RULE_SETUP +#line 92 "lexer.lpp" +{ return iw5::parser::make_LPAREN(loc); } + YY_BREAK +case 46: +YY_RULE_SETUP +#line 93 "lexer.lpp" +{ return iw5::parser::make_RPAREN(loc); } + YY_BREAK +case 47: +YY_RULE_SETUP +#line 94 "lexer.lpp" +{ return iw5::parser::make_LBRACE(loc); } + YY_BREAK +case 48: +YY_RULE_SETUP +#line 95 "lexer.lpp" +{ return iw5::parser::make_RBRACE(loc); } + YY_BREAK +case 49: +YY_RULE_SETUP +#line 96 "lexer.lpp" +{ return iw5::parser::make_LBRACKET(loc); } + YY_BREAK +case 50: +YY_RULE_SETUP +#line 97 "lexer.lpp" +{ return iw5::parser::make_RBRACKET(loc); } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 98 "lexer.lpp" +{ return iw5::parser::make_COMMA(loc); } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 99 "lexer.lpp" +{ return iw5::parser::make_DOT(loc); } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 100 "lexer.lpp" +{ return iw5::parser::make_DOUBLECOLON(loc); } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 101 "lexer.lpp" +{ return iw5::parser::make_COLON(loc); } + YY_BREAK +case 55: +YY_RULE_SETUP +#line 102 "lexer.lpp" +{ return iw5::parser::make_SEMICOLON(loc); } + YY_BREAK +case 56: +YY_RULE_SETUP +#line 103 "lexer.lpp" +{ return iw5::parser::make_INCREMENT(loc); } + YY_BREAK +case 57: +YY_RULE_SETUP +#line 104 "lexer.lpp" +{ return iw5::parser::make_DECREMENT(loc); } + YY_BREAK +case 58: +YY_RULE_SETUP +#line 105 "lexer.lpp" +{ return iw5::parser::make_ASSIGN_LSHIFT(loc); } + YY_BREAK +case 59: +YY_RULE_SETUP +#line 106 "lexer.lpp" +{ return iw5::parser::make_ASSIGN_RSHIFT(loc); } + YY_BREAK +case 60: +YY_RULE_SETUP +#line 107 "lexer.lpp" +{ return iw5::parser::make_LSHIFT(loc); } + YY_BREAK +case 61: +YY_RULE_SETUP +#line 108 "lexer.lpp" +{ return iw5::parser::make_RSHIFT(loc); } + YY_BREAK +case 62: +YY_RULE_SETUP +#line 109 "lexer.lpp" +{ return iw5::parser::make_OR(loc); } + YY_BREAK +case 63: +YY_RULE_SETUP +#line 110 "lexer.lpp" +{ return iw5::parser::make_AND(loc); } + YY_BREAK +case 64: +YY_RULE_SETUP +#line 111 "lexer.lpp" +{ return iw5::parser::make_EQUALITY(loc); } + YY_BREAK +case 65: +YY_RULE_SETUP +#line 112 "lexer.lpp" +{ return iw5::parser::make_INEQUALITY(loc); } + YY_BREAK +case 66: +YY_RULE_SETUP +#line 113 "lexer.lpp" +{ return iw5::parser::make_LESS_EQUAL(loc); } + YY_BREAK +case 67: +YY_RULE_SETUP +#line 114 "lexer.lpp" +{ return iw5::parser::make_GREATER_EQUAL(loc); } + YY_BREAK +case 68: +YY_RULE_SETUP +#line 115 "lexer.lpp" +{ return iw5::parser::make_LESS(loc); } + YY_BREAK +case 69: +YY_RULE_SETUP +#line 116 "lexer.lpp" +{ return iw5::parser::make_GREATER(loc); } + YY_BREAK +case 70: +YY_RULE_SETUP +#line 117 "lexer.lpp" +{ return iw5::parser::make_ASSIGN_ADD(loc); } + YY_BREAK +case 71: +YY_RULE_SETUP +#line 118 "lexer.lpp" +{ return iw5::parser::make_ASSIGN_SUB(loc); } + YY_BREAK +case 72: +YY_RULE_SETUP +#line 119 "lexer.lpp" +{ return iw5::parser::make_ASSIGN_MULT(loc); } + YY_BREAK +case 73: +YY_RULE_SETUP +#line 120 "lexer.lpp" +{ return iw5::parser::make_ASSIGN_DIV(loc); } + YY_BREAK +case 74: +YY_RULE_SETUP +#line 121 "lexer.lpp" +{ return iw5::parser::make_ASSIGN_MOD(loc); } + YY_BREAK +case 75: +YY_RULE_SETUP +#line 122 "lexer.lpp" +{ return iw5::parser::make_ASSIGN_BITWISE_OR(loc); } + YY_BREAK +case 76: +YY_RULE_SETUP +#line 123 "lexer.lpp" +{ return iw5::parser::make_ASSIGN_BITWISE_AND(loc); } + YY_BREAK +case 77: +YY_RULE_SETUP +#line 124 "lexer.lpp" +{ return iw5::parser::make_ASSIGN_BITWISE_EXOR(loc); } + YY_BREAK +case 78: +YY_RULE_SETUP +#line 125 "lexer.lpp" +{ return iw5::parser::make_ASSIGN(loc); } + YY_BREAK +case 79: +YY_RULE_SETUP +#line 126 "lexer.lpp" +{ return iw5::parser::make_ADD(loc); } + YY_BREAK +case 80: +YY_RULE_SETUP +#line 127 "lexer.lpp" +{ return iw5::parser::make_SUB(loc); } + YY_BREAK +case 81: +YY_RULE_SETUP +#line 128 "lexer.lpp" +{ return iw5::parser::make_MULT(loc); } + YY_BREAK +case 82: +YY_RULE_SETUP +#line 129 "lexer.lpp" +{ return iw5::parser::make_DIV(loc); } + YY_BREAK +case 83: +YY_RULE_SETUP +#line 130 "lexer.lpp" +{ return iw5::parser::make_MOD(loc); } + YY_BREAK +case 84: +YY_RULE_SETUP +#line 131 "lexer.lpp" +{ return iw5::parser::make_NOT(loc); } + YY_BREAK +case 85: +YY_RULE_SETUP +#line 132 "lexer.lpp" +{ return iw5::parser::make_COMPLEMENT(loc); } + YY_BREAK +case 86: +YY_RULE_SETUP +#line 133 "lexer.lpp" +{ return iw5::parser::make_BITWISE_OR(loc); } + YY_BREAK +case 87: +YY_RULE_SETUP +#line 134 "lexer.lpp" +{ return iw5::parser::make_BITWISE_AND(loc); } + YY_BREAK +case 88: +YY_RULE_SETUP +#line 135 "lexer.lpp" +{ return iw5::parser::make_BITWISE_EXOR(loc); } + YY_BREAK +case 89: +YY_RULE_SETUP +#line 136 "lexer.lpp" +{ return iw5::parser::make_FILE(utils::string::fordslash(yytext), loc); } + YY_BREAK +case 90: +YY_RULE_SETUP +#line 137 "lexer.lpp" +{ return iw5::parser::make_NAME((std::string(yytext, 3) == "_ID") ? std::string(yytext) : utils::string::to_lower(yytext), loc); } + YY_BREAK +case 91: +/* rule 91 can match eol */ +YY_RULE_SETUP +#line 138 "lexer.lpp" +{ return iw5::parser::make_ISTRING(std::string(yytext).substr(1), loc); } + YY_BREAK +case 92: +/* rule 92 can match eol */ +YY_RULE_SETUP +#line 139 "lexer.lpp" +{ return iw5::parser::make_STRING(std::string(yytext), loc); } + YY_BREAK +case 93: +YY_RULE_SETUP +#line 140 "lexer.lpp" +{ return iw5::parser::make_FLOAT(std::string(yytext), loc); } + YY_BREAK +case 94: +YY_RULE_SETUP +#line 141 "lexer.lpp" +{ return iw5::parser::make_INTEGER(std::string(yytext), loc); } + YY_BREAK +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(COMMENT_BLOCK_STATE): +case YY_STATE_EOF(DEVELOPER_BLOCK_STATE): +#line 142 "lexer.lpp" +{ return iw5::parser::make_IW5EOF(loc); } + YY_BREAK +case 95: +/* rule 95 can match eol */ +YY_RULE_SETUP +#line 143 "lexer.lpp" +{ throw iw5::parser::syntax_error(loc, "bad token: '" + std::string(yytext) + "'"); } + YY_BREAK +case 96: +YY_RULE_SETUP +#line 145 "lexer.lpp" +ECHO; + YY_BREAK +#line 1684 "lexer.cpp" + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( yywrap( yyscanner ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + yyg->yy_n_chars, num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin , yyscanner); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) +{ + yy_state_type yy_current_state; + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_current_state = yyg->yy_start; + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 281 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) +{ + int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + char *yy_cp = yyg->yy_c_buf_p; + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 281 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 280); + + (void)yyg; + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (yyscan_t yyscanner) +#else + static int input (yyscan_t yyscanner) +#endif + +{ + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin , yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( yyscanner ) ) + return 0; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(yyscanner); +#else + return input(yyscanner); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * @param yyscanner The scanner object. + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * @param yyscanner The scanner object. + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( yyscanner ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yyg->yy_did_buffer_switch_on_eof = 1; +} + +static void yy_load_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyg->yy_hold_char = *yyg->yy_c_buf_p; +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * @param yyscanner The scanner object. + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file , yyscanner); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * @param yyscanner The scanner object. + */ + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf , yyscanner ); + + yyfree( (void *) b , yyscanner ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + +{ + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_flush_buffer( b , yyscanner); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param yyscanner The scanner object. + */ + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( yyscanner ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * @param yyscanner The scanner object. + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(yyscanner); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * @param yyscanner The scanner object. + */ +void yypop_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (yyscan_t yyscanner) +{ + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (!yyg->yy_buffer_stack) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->yy_buffer_stack_max = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b , yyscanner ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n , yyscanner); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the user-defined data for this scanner. + * @param yyscanner The scanner object. + */ +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; +} + +/** Get the current line number. + * @param yyscanner The scanner object. + */ +int yyget_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; +} + +/** Get the current column number. + * @param yyscanner The scanner object. + */ +int yyget_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; +} + +/** Get the input stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; +} + +/** Get the output stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; +} + +/** Get the length of the current token. + * @param yyscanner The scanner object. + */ +int yyget_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; +} + +/** Get the current token. + * @param yyscanner The scanner object. + */ + +char *yyget_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; +} + +/** Set the user-defined data. This data is never touched by the scanner. + * @param user_defined The data to be associated with this scanner. + * @param yyscanner The scanner object. + */ +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; +} + +/** Set the current line number. + * @param _line_number line number + * @param yyscanner The scanner object. + */ +void yyset_lineno (int _line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + + yylineno = _line_number; +} + +/** Set the current column. + * @param _column_no column number + * @param yyscanner The scanner object. + */ +void yyset_column (int _column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + + yycolumn = _column_no; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * @param yyscanner The scanner object. + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * _in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; +} + +void yyset_out (FILE * _out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; +} + +int yyget_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; +} + +void yyset_debug (int _bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; +} + +/* Accessor methods for yylval and yylloc */ + +/* User-visible API */ + +/* yylex_init is special because it creates the scanner itself, so it is + * the ONLY reentrant function that doesn't take the scanner as the last argument. + * That's why we explicitly handle the declaration, instead of using our macros. + */ +int yylex_init(yyscan_t* ptr_yy_globals) +{ + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + return yy_init_globals ( *ptr_yy_globals ); +} + +/* yylex_init_extra has the same functionality as yylex_init, but follows the + * convention of taking the scanner as the last argument. Note however, that + * this is a *pointer* to a scanner, as it will be allocated by this call (and + * is the reason, too, why this function also must handle its own declaration). + * The user defined value in the first argument will be available to yyalloc in + * the yyextra field. + */ +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) +{ + struct yyguts_t dummy_yyguts; + + yyset_extra (yy_user_defined, &dummy_yyguts); + + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + yyset_extra (yy_user_defined, *ptr_yy_globals); + + return yy_init_globals ( *ptr_yy_globals ); +} + +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + yyg->yy_buffer_stack = NULL; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = NULL; + yyg->yy_init = 0; + yyg->yy_start = 0; + + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = NULL; + yyout = NULL; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(yyscanner); + } + + /* Destroy the stack itself. */ + yyfree(yyg->yy_buffer_stack , yyscanner); + yyg->yy_buffer_stack = NULL; + + /* Destroy the start condition stack. */ + yyfree( yyg->yy_start_stack , yyscanner ); + yyg->yy_start_stack = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( yyscanner); + + /* Destroy the main struct (reentrant only). */ + yyfree ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); +} + +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); +} + +void yyfree (void * ptr , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 145 "lexer.lpp" + + diff --git a/src/iw5/xsk/lexer.hpp b/src/iw5/xsk/lexer.hpp new file mode 100644 index 00000000..8269fee3 --- /dev/null +++ b/src/iw5/xsk/lexer.hpp @@ -0,0 +1,708 @@ +#ifndef iw5_HEADER_H +#define iw5_HEADER_H 1 +#define iw5_IN_HEADER 1 + +#line 5 "lexer.hpp" +#include "stdafx.hpp" +#include "iw5.hpp" +#include "parser.hpp" +using namespace xsk::gsc; + +#line 11 "lexer.hpp" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define iw5__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer iw5__create_buffer +#endif + +#ifdef yy_delete_buffer +#define iw5__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer iw5__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define iw5__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer iw5__scan_buffer +#endif + +#ifdef yy_scan_string +#define iw5__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string iw5__scan_string +#endif + +#ifdef yy_scan_bytes +#define iw5__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes iw5__scan_bytes +#endif + +#ifdef yy_init_buffer +#define iw5__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer iw5__init_buffer +#endif + +#ifdef yy_flush_buffer +#define iw5__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer iw5__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define iw5__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state iw5__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define iw5__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer iw5__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define iw5_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state iw5_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define iw5_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state iw5_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define iw5_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack iw5_ensure_buffer_stack +#endif + +#ifdef yylex +#define iw5_lex_ALREADY_DEFINED +#else +#define yylex iw5_lex +#endif + +#ifdef yyrestart +#define iw5_restart_ALREADY_DEFINED +#else +#define yyrestart iw5_restart +#endif + +#ifdef yylex_init +#define iw5_lex_init_ALREADY_DEFINED +#else +#define yylex_init iw5_lex_init +#endif + +#ifdef yylex_init_extra +#define iw5_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra iw5_lex_init_extra +#endif + +#ifdef yylex_destroy +#define iw5_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy iw5_lex_destroy +#endif + +#ifdef yyget_debug +#define iw5_get_debug_ALREADY_DEFINED +#else +#define yyget_debug iw5_get_debug +#endif + +#ifdef yyset_debug +#define iw5_set_debug_ALREADY_DEFINED +#else +#define yyset_debug iw5_set_debug +#endif + +#ifdef yyget_extra +#define iw5_get_extra_ALREADY_DEFINED +#else +#define yyget_extra iw5_get_extra +#endif + +#ifdef yyset_extra +#define iw5_set_extra_ALREADY_DEFINED +#else +#define yyset_extra iw5_set_extra +#endif + +#ifdef yyget_in +#define iw5_get_in_ALREADY_DEFINED +#else +#define yyget_in iw5_get_in +#endif + +#ifdef yyset_in +#define iw5_set_in_ALREADY_DEFINED +#else +#define yyset_in iw5_set_in +#endif + +#ifdef yyget_out +#define iw5_get_out_ALREADY_DEFINED +#else +#define yyget_out iw5_get_out +#endif + +#ifdef yyset_out +#define iw5_set_out_ALREADY_DEFINED +#else +#define yyset_out iw5_set_out +#endif + +#ifdef yyget_leng +#define iw5_get_leng_ALREADY_DEFINED +#else +#define yyget_leng iw5_get_leng +#endif + +#ifdef yyget_text +#define iw5_get_text_ALREADY_DEFINED +#else +#define yyget_text iw5_get_text +#endif + +#ifdef yyget_lineno +#define iw5_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno iw5_get_lineno +#endif + +#ifdef yyset_lineno +#define iw5_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno iw5_set_lineno +#endif + +#ifdef yyget_column +#define iw5_get_column_ALREADY_DEFINED +#else +#define yyget_column iw5_get_column +#endif + +#ifdef yyset_column +#define iw5_set_column_ALREADY_DEFINED +#else +#define yyset_column iw5_set_column +#endif + +#ifdef yywrap +#define iw5_wrap_ALREADY_DEFINED +#else +#define yywrap iw5_wrap +#endif + +#ifdef yyalloc +#define iw5_alloc_ALREADY_DEFINED +#else +#define yyalloc iw5_alloc +#endif + +#ifdef yyrealloc +#define iw5_realloc_ALREADY_DEFINED +#else +#define yyrealloc iw5_realloc +#endif + +#ifdef yyfree +#define iw5_free_ALREADY_DEFINED +#else +#define yyfree iw5_free +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +/* Begin user sect3 */ + +#define iw5_wrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP + +#define yytext_ptr yytext_r + +#ifdef YY_HEADER_EXPORT_START_CONDITIONS +#define INITIAL 0 +#define COMMENT_BLOCK_STATE 1 +#define DEVELOPER_BLOCK_STATE 2 + +#endif + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +#undef YY_NEW_FILE +#undef YY_FLUSH_BUFFER +#undef yy_set_bol +#undef yy_new_buffer +#undef yy_set_interactive +#undef YY_DO_BEFORE_ACTION + +#ifdef YY_DECL_IS_OURS +#undef YY_DECL_IS_OURS +#undef YY_DECL +#endif + +#ifndef iw5__create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef iw5__delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef iw5__scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef iw5__scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef iw5__scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef iw5__init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef iw5__flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef iw5__load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef iw5__switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef iw5_push_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef iw5_pop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef iw5_ensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef iw5_lex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef iw5_restart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef iw5_lex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef iw5_lex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef iw5_lex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef iw5_get_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef iw5_set_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef iw5_get_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef iw5_set_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef iw5_get_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef iw5_set_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef iw5_get_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef iw5_set_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef iw5_get_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef iw5_get_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef iw5_get_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef iw5_set_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef iw5_get_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef iw5_set_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef iw5_wrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef iw5_get_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef iw5_set_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef iw5_get_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef iw5_set_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef iw5_alloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef iw5_realloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef iw5_free_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef iw5_text_ALREADY_DEFINED +#undef yytext +#endif +#ifndef iw5_leng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef iw5_in_ALREADY_DEFINED +#undef yyin +#endif +#ifndef iw5_out_ALREADY_DEFINED +#undef yyout +#endif +#ifndef iw5__flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef iw5_lineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef iw5_tables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef iw5_tables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef iw5_TABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + +#line 145 "lexer.lpp" + + +#line 706 "lexer.hpp" +#undef iw5_IN_HEADER +#endif /* iw5_HEADER_H */ diff --git a/src/iw5/xsk/parser.cpp b/src/iw5/xsk/parser.cpp new file mode 100644 index 00000000..113cd80a --- /dev/null +++ b/src/iw5/xsk/parser.cpp @@ -0,0 +1,3958 @@ +// A Bison parser, made by GNU Bison 3.7.5. + +// Skeleton implementation for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. + +// 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 . + +// As a special exception, you may create a larger work that contains +// part or all of the Bison parser skeleton and distribute that work +// under terms of your choice, so long as that work isn't itself a +// parser generator using the skeleton or a modified version thereof +// as a parser skeleton. Alternatively, if you modify or redistribute +// the parser skeleton itself, you may (at your option) remove this +// special exception, which will cause the skeleton and the resulting +// Bison output files to be licensed under the GNU General Public +// License without this special exception. + +// This special exception was added by the Free Software Foundation in +// version 2.2 of Bison. + +// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, +// especially those whose name start with YY_ or yy_. They are +// private implementation details that can be changed or removed. + +// "%code top" blocks. +#line 40 "parser.ypp" + +#include "stdafx.hpp" +#include "parser.hpp" +#include "lexer.hpp" +using namespace xsk::gsc; +xsk::gsc::iw5::parser::symbol_type IW5lex(yyscan_t yyscanner, xsk::gsc::location& loc); + +#line 47 "parser.cpp" + +// Take the name prefix into account. +#define yylex IW5lex + + + +#include "parser.hpp" + + + + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include // FIXME: INFRINGES ON USER NAME SPACE. +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + + +// Whether we are compiled with exception support. +#ifndef YY_EXCEPTIONS +# if defined __GNUC__ && !defined __EXCEPTIONS +# define YY_EXCEPTIONS 0 +# else +# define YY_EXCEPTIONS 1 +# endif +#endif + +#define YYRHSLOC(Rhs, K) ((Rhs)[K].location) +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +# ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).begin = YYRHSLOC (Rhs, 1).begin; \ + (Current).end = YYRHSLOC (Rhs, N).end; \ + } \ + else \ + { \ + (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ + } \ + while (false) +# endif + + +// Enable debugging if requested. +#if IW5DEBUG + +// A pseudo ostream that takes yydebug_ into account. +# define YYCDEBUG if (yydebug_) (*yycdebug_) + +# define YY_SYMBOL_PRINT(Title, Symbol) \ + do { \ + if (yydebug_) \ + { \ + *yycdebug_ << Title << ' '; \ + yy_print_ (*yycdebug_, Symbol); \ + *yycdebug_ << '\n'; \ + } \ + } while (false) + +# define YY_REDUCE_PRINT(Rule) \ + do { \ + if (yydebug_) \ + yy_reduce_print_ (Rule); \ + } while (false) + +# define YY_STACK_PRINT() \ + do { \ + if (yydebug_) \ + yy_stack_print_ (); \ + } while (false) + +#else // !IW5DEBUG + +# define YYCDEBUG if (false) std::cerr +# define YY_SYMBOL_PRINT(Title, Symbol) YY_USE (Symbol) +# define YY_REDUCE_PRINT(Rule) static_cast (0) +# define YY_STACK_PRINT() static_cast (0) + +#endif // !IW5DEBUG + +#define yyerrok (yyerrstatus_ = 0) +#define yyclearin (yyla.clear ()) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYRECOVERING() (!!yyerrstatus_) + +#line 13 "parser.ypp" +namespace xsk { namespace gsc { namespace iw5 { +#line 149 "parser.cpp" + + /// Build a parser object. + parser::parser (yyscan_t yyscanner_yyarg, xsk::gsc::location& loc_yyarg, xsk::gsc::program_ptr& ast_yyarg) +#if IW5DEBUG + : yydebug_ (false), + yycdebug_ (&std::cerr), +#else + : +#endif + yy_lac_established_ (false), + yyscanner (yyscanner_yyarg), + loc (loc_yyarg), + ast (ast_yyarg) + {} + + parser::~parser () + {} + + parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW + {} + + /*---------------. + | symbol kinds. | + `---------------*/ + + + + // by_state. + parser::by_state::by_state () YY_NOEXCEPT + : state (empty_state) + {} + + parser::by_state::by_state (const by_state& that) YY_NOEXCEPT + : state (that.state) + {} + + void + parser::by_state::clear () YY_NOEXCEPT + { + state = empty_state; + } + + void + parser::by_state::move (by_state& that) + { + state = that.state; + that.clear (); + } + + parser::by_state::by_state (state_type s) YY_NOEXCEPT + : state (s) + {} + + parser::symbol_kind_type + parser::by_state::kind () const YY_NOEXCEPT + { + if (state == empty_state) + return symbol_kind::S_YYEMPTY; + else + return YY_CAST (symbol_kind_type, yystos_[+state]); + } + + parser::stack_symbol_type::stack_symbol_type () + {} + + parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) + : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.YY_MOVE_OR_COPY< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.YY_MOVE_OR_COPY< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.YY_MOVE_OR_COPY< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.YY_MOVE_OR_COPY< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.YY_MOVE_OR_COPY< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.YY_MOVE_OR_COPY< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.YY_MOVE_OR_COPY< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.YY_MOVE_OR_COPY< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.YY_MOVE_OR_COPY< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.YY_MOVE_OR_COPY< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.YY_MOVE_OR_COPY< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.YY_MOVE_OR_COPY< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.YY_MOVE_OR_COPY< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.YY_MOVE_OR_COPY< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.YY_MOVE_OR_COPY< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.YY_MOVE_OR_COPY< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.YY_MOVE_OR_COPY< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.YY_MOVE_OR_COPY< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.YY_MOVE_OR_COPY< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.YY_MOVE_OR_COPY< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.YY_MOVE_OR_COPY< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.YY_MOVE_OR_COPY< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.YY_MOVE_OR_COPY< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.YY_MOVE_OR_COPY< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.YY_MOVE_OR_COPY< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.YY_MOVE_OR_COPY< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.YY_MOVE_OR_COPY< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.YY_MOVE_OR_COPY< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.YY_MOVE_OR_COPY< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.YY_MOVE_OR_COPY< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.YY_MOVE_OR_COPY< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.YY_MOVE_OR_COPY< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.YY_MOVE_OR_COPY< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.YY_MOVE_OR_COPY< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.YY_MOVE_OR_COPY< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.YY_MOVE_OR_COPY< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.YY_MOVE_OR_COPY< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.YY_MOVE_OR_COPY< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.YY_MOVE_OR_COPY< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.YY_MOVE_OR_COPY< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.YY_MOVE_OR_COPY< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.YY_MOVE_OR_COPY< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.YY_MOVE_OR_COPY< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.YY_MOVE_OR_COPY< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.YY_MOVE_OR_COPY< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.YY_MOVE_OR_COPY< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.YY_MOVE_OR_COPY< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.YY_MOVE_OR_COPY< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.YY_MOVE_OR_COPY< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.YY_MOVE_OR_COPY< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.YY_MOVE_OR_COPY< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.YY_MOVE_OR_COPY< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + +#if 201103L <= YY_CPLUSPLUS + // that is emptied. + that.state = empty_state; +#endif + } + + parser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that) + : super_type (s, YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + + // that is emptied. + that.kind_ = symbol_kind::S_YYEMPTY; + } + +#if YY_CPLUSPLUS < 201103L + parser::stack_symbol_type& + parser::stack_symbol_type::operator= (const stack_symbol_type& that) + { + state = that.state; + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.copy< anim_ptr > (that.value); + break; + + case symbol_kind::S_animation: // animation + value.copy< animation_ptr > (that.value); + break; + + case symbol_kind::S_animtree: // animtree + value.copy< animtree_ptr > (that.value); + break; + + case symbol_kind::S_constant: // constant + value.copy< constant_ptr > (that.value); + break; + + case symbol_kind::S_define: // define + value.copy< define_ptr > (that.value); + break; + + case symbol_kind::S_empty_array: // empty_array + value.copy< empty_array_ptr > (that.value); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.copy< expr_arguments_ptr > (that.value); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.copy< expr_assign_ptr > (that.value); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.copy< expr_call_ptr > (that.value); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.copy< expr_call_type_ptr > (that.value); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.copy< expr_ptr > (that.value); + break; + + case symbol_kind::S_false: // false + value.copy< false_ptr > (that.value); + break; + + case symbol_kind::S_file: // file + value.copy< file_ptr > (that.value); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.copy< float_ptr > (that.value); + break; + + case symbol_kind::S_game: // game + value.copy< game_ptr > (that.value); + break; + + case symbol_kind::S_include: // include + value.copy< include_ptr > (that.value); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.copy< integer_ptr > (that.value); + break; + + case symbol_kind::S_istring: // istring + value.copy< istring_ptr > (that.value); + break; + + case symbol_kind::S_level: // level + value.copy< level_ptr > (that.value); + break; + + case symbol_kind::S_name: // name + value.copy< name_ptr > (that.value); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.copy< node_ptr > (that.value); + break; + + case symbol_kind::S_parameters: // parameters + value.copy< parameters_ptr > (that.value); + break; + + case symbol_kind::S_program: // program + value.copy< program_ptr > (that.value); + break; + + case symbol_kind::S_self: // self + value.copy< self_ptr > (that.value); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.copy< std::string > (that.value); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.copy< stmt_assign_ptr > (that.value); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.copy< stmt_break_ptr > (that.value); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.copy< stmt_call_ptr > (that.value); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.copy< stmt_case_ptr > (that.value); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.copy< stmt_continue_ptr > (that.value); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.copy< stmt_default_ptr > (that.value); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.copy< stmt_endon_ptr > (that.value); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.copy< stmt_for_ptr > (that.value); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.copy< stmt_foreach_ptr > (that.value); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.copy< stmt_if_ptr > (that.value); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.copy< stmt_ifelse_ptr > (that.value); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.copy< stmt_list_ptr > (that.value); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.copy< stmt_notify_ptr > (that.value); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.copy< stmt_ptr > (that.value); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.copy< stmt_return_ptr > (that.value); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.copy< stmt_switch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.copy< stmt_wait_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.copy< stmt_waittill_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.copy< stmt_waittillframeend_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.copy< stmt_waittillmatch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.copy< stmt_while_ptr > (that.value); + break; + + case symbol_kind::S_string: // string + value.copy< string_ptr > (that.value); + break; + + case symbol_kind::S_thisthread: // thisthread + value.copy< thisthread_ptr > (that.value); + break; + + case symbol_kind::S_thread: // thread + value.copy< thread_ptr > (that.value); + break; + + case symbol_kind::S_true: // true + value.copy< true_ptr > (that.value); + break; + + case symbol_kind::S_undefined: // undefined + value.copy< undefined_ptr > (that.value); + break; + + case symbol_kind::S_usingtree: // usingtree + value.copy< usingtree_ptr > (that.value); + break; + + case symbol_kind::S_vector: // vector + value.copy< vector_ptr > (that.value); + break; + + default: + break; + } + + location = that.location; + return *this; + } + + parser::stack_symbol_type& + parser::stack_symbol_type::operator= (stack_symbol_type& that) + { + state = that.state; + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (that.value); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (that.value); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (that.value); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (that.value); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (that.value); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (that.value); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (that.value); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (that.value); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (that.value); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (that.value); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (that.value); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (that.value); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (that.value); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (that.value); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (that.value); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (that.value); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (that.value); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (that.value); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (that.value); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (that.value); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (that.value); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (that.value); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (that.value); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (that.value); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (that.value); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (that.value); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (that.value); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (that.value); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (that.value); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (that.value); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (that.value); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (that.value); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (that.value); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (that.value); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (that.value); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (that.value); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (that.value); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (that.value); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (that.value); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (that.value); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (that.value); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (that.value); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (that.value); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (that.value); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (that.value); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (that.value); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (that.value); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (that.value); + break; + + default: + break; + } + + location = that.location; + // that is emptied. + that.state = empty_state; + return *this; + } +#endif + + template + void + parser::yy_destroy_ (const char* yymsg, basic_symbol& yysym) const + { + if (yymsg) + YY_SYMBOL_PRINT (yymsg, yysym); + } + +#if IW5DEBUG + template + void + parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const + { + std::ostream& yyoutput = yyo; + YY_USE (yyoutput); + if (yysym.empty ()) + yyo << "empty symbol"; + else + { + symbol_kind_type yykind = yysym.kind (); + yyo << (yykind < YYNTOKENS ? "token" : "nterm") + << ' ' << yysym.name () << " (" + << yysym.location << ": "; + YY_USE (yykind); + yyo << ')'; + } + } +#endif + + void + parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) + { + if (m) + YY_SYMBOL_PRINT (m, sym); + yystack_.push (YY_MOVE (sym)); + } + + void + parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) + { +#if 201103L <= YY_CPLUSPLUS + yypush_ (m, stack_symbol_type (s, std::move (sym))); +#else + stack_symbol_type ss (s, sym); + yypush_ (m, ss); +#endif + } + + void + parser::yypop_ (int n) + { + yystack_.pop (n); + } + +#if IW5DEBUG + std::ostream& + parser::debug_stream () const + { + return *yycdebug_; + } + + void + parser::set_debug_stream (std::ostream& o) + { + yycdebug_ = &o; + } + + + parser::debug_level_type + parser::debug_level () const + { + return yydebug_; + } + + void + parser::set_debug_level (debug_level_type l) + { + yydebug_ = l; + } +#endif // IW5DEBUG + + parser::state_type + parser::yy_lr_goto_state_ (state_type yystate, int yysym) + { + int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; + if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) + return yytable_[yyr]; + else + return yydefgoto_[yysym - YYNTOKENS]; + } + + bool + parser::yy_pact_value_is_default_ (int yyvalue) + { + return yyvalue == yypact_ninf_; + } + + bool + parser::yy_table_value_is_error_ (int yyvalue) + { + return yyvalue == yytable_ninf_; + } + + int + parser::operator() () + { + return parse (); + } + + int + parser::parse () + { + int yyn; + /// Length of the RHS of the rule being reduced. + int yylen = 0; + + // Error handling. + int yynerrs_ = 0; + int yyerrstatus_ = 0; + + /// The lookahead symbol. + symbol_type yyla; + + /// The locations where the error started and ended. + stack_symbol_type yyerror_range[3]; + + /// The return value of parse (). + int yyresult; + + /// Discard the LAC context in case there still is one left from a + /// previous invocation. + yy_lac_discard_ ("init"); + +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + YYCDEBUG << "Starting parse\n"; + + + /* Initialize the stack. The initial state will be set in + yynewstate, since the latter expects the semantical and the + location values to have been already stored, initialize these + stacks with a primary value. */ + yystack_.clear (); + yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); + + /*-----------------------------------------------. + | yynewstate -- push a new symbol on the stack. | + `-----------------------------------------------*/ + yynewstate: + YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; + YY_STACK_PRINT (); + + // Accept? + if (yystack_[0].state == yyfinal_) + YYACCEPT; + + goto yybackup; + + + /*-----------. + | yybackup. | + `-----------*/ + yybackup: + // Try to take a decision without lookahead. + yyn = yypact_[+yystack_[0].state]; + if (yy_pact_value_is_default_ (yyn)) + goto yydefault; + + // Read a lookahead token. + if (yyla.empty ()) + { + YYCDEBUG << "Reading a token\n"; +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + symbol_type yylookahead (yylex (yyscanner, loc)); + yyla.move (yylookahead); + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + goto yyerrlab1; + } +#endif // YY_EXCEPTIONS + } + YY_SYMBOL_PRINT ("Next token is", yyla); + + if (yyla.kind () == symbol_kind::S_YYerror) + { + // The scanner already issued an error message, process directly + // to error recovery. But do not keep the error token as + // lookahead, it is too special and may lead us to an endless + // loop in error recovery. */ + yyla.kind_ = symbol_kind::S_YYUNDEF; + goto yyerrlab1; + } + + /* If the proper action on seeing token YYLA.TYPE is to reduce or + to detect an error, take that action. */ + yyn += yyla.kind (); + if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) + { + if (!yy_lac_establish_ (yyla.kind ())) + goto yyerrlab; + goto yydefault; + } + + // Reduce or error. + yyn = yytable_[yyn]; + if (yyn <= 0) + { + if (yy_table_value_is_error_ (yyn)) + goto yyerrlab; + if (!yy_lac_establish_ (yyla.kind ())) + goto yyerrlab; + + yyn = -yyn; + goto yyreduce; + } + + // Count tokens shifted since error; after three, turn off error status. + if (yyerrstatus_) + --yyerrstatus_; + + // Shift the lookahead token. + yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); + yy_lac_discard_ ("shift"); + goto yynewstate; + + + /*-----------------------------------------------------------. + | yydefault -- do the default action for the current state. | + `-----------------------------------------------------------*/ + yydefault: + yyn = yydefact_[+yystack_[0].state]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + + /*-----------------------------. + | yyreduce -- do a reduction. | + `-----------------------------*/ + yyreduce: + yylen = yyr2_[yyn]; + { + stack_symbol_type yylhs; + yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); + /* Variants are always initialized to an empty instance of the + correct type. The default '$$ = $1' action is NOT applied + when using variants. */ + switch (yyr1_[yyn]) + { + case symbol_kind::S_anim: // anim + yylhs.value.emplace< anim_ptr > (); + break; + + case symbol_kind::S_animation: // animation + yylhs.value.emplace< animation_ptr > (); + break; + + case symbol_kind::S_animtree: // animtree + yylhs.value.emplace< animtree_ptr > (); + break; + + case symbol_kind::S_constant: // constant + yylhs.value.emplace< constant_ptr > (); + break; + + case symbol_kind::S_define: // define + yylhs.value.emplace< define_ptr > (); + break; + + case symbol_kind::S_empty_array: // empty_array + yylhs.value.emplace< empty_array_ptr > (); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + yylhs.value.emplace< expr_arguments_ptr > (); + break; + + case symbol_kind::S_expr_assign: // expr_assign + yylhs.value.emplace< expr_assign_ptr > (); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + yylhs.value.emplace< expr_call_ptr > (); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + yylhs.value.emplace< expr_call_type_ptr > (); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + yylhs.value.emplace< expr_ptr > (); + break; + + case symbol_kind::S_false: // false + yylhs.value.emplace< false_ptr > (); + break; + + case symbol_kind::S_file: // file + yylhs.value.emplace< file_ptr > (); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + yylhs.value.emplace< float_ptr > (); + break; + + case symbol_kind::S_game: // game + yylhs.value.emplace< game_ptr > (); + break; + + case symbol_kind::S_include: // include + yylhs.value.emplace< include_ptr > (); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + yylhs.value.emplace< integer_ptr > (); + break; + + case symbol_kind::S_istring: // istring + yylhs.value.emplace< istring_ptr > (); + break; + + case symbol_kind::S_level: // level + yylhs.value.emplace< level_ptr > (); + break; + + case symbol_kind::S_name: // name + yylhs.value.emplace< name_ptr > (); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + yylhs.value.emplace< node_ptr > (); + break; + + case symbol_kind::S_parameters: // parameters + yylhs.value.emplace< parameters_ptr > (); + break; + + case symbol_kind::S_program: // program + yylhs.value.emplace< program_ptr > (); + break; + + case symbol_kind::S_self: // self + yylhs.value.emplace< self_ptr > (); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + yylhs.value.emplace< std::string > (); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + yylhs.value.emplace< stmt_assign_ptr > (); + break; + + case symbol_kind::S_stmt_break: // stmt_break + yylhs.value.emplace< stmt_break_ptr > (); + break; + + case symbol_kind::S_stmt_call: // stmt_call + yylhs.value.emplace< stmt_call_ptr > (); + break; + + case symbol_kind::S_stmt_case: // stmt_case + yylhs.value.emplace< stmt_case_ptr > (); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + yylhs.value.emplace< stmt_continue_ptr > (); + break; + + case symbol_kind::S_stmt_default: // stmt_default + yylhs.value.emplace< stmt_default_ptr > (); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + yylhs.value.emplace< stmt_endon_ptr > (); + break; + + case symbol_kind::S_stmt_for: // stmt_for + yylhs.value.emplace< stmt_for_ptr > (); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + yylhs.value.emplace< stmt_foreach_ptr > (); + break; + + case symbol_kind::S_stmt_if: // stmt_if + yylhs.value.emplace< stmt_if_ptr > (); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + yylhs.value.emplace< stmt_ifelse_ptr > (); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + yylhs.value.emplace< stmt_list_ptr > (); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + yylhs.value.emplace< stmt_notify_ptr > (); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + yylhs.value.emplace< stmt_ptr > (); + break; + + case symbol_kind::S_stmt_return: // stmt_return + yylhs.value.emplace< stmt_return_ptr > (); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + yylhs.value.emplace< stmt_switch_ptr > (); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + yylhs.value.emplace< stmt_wait_ptr > (); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + yylhs.value.emplace< stmt_waittill_ptr > (); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + yylhs.value.emplace< stmt_waittillframeend_ptr > (); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + yylhs.value.emplace< stmt_waittillmatch_ptr > (); + break; + + case symbol_kind::S_stmt_while: // stmt_while + yylhs.value.emplace< stmt_while_ptr > (); + break; + + case symbol_kind::S_string: // string + yylhs.value.emplace< string_ptr > (); + break; + + case symbol_kind::S_thisthread: // thisthread + yylhs.value.emplace< thisthread_ptr > (); + break; + + case symbol_kind::S_thread: // thread + yylhs.value.emplace< thread_ptr > (); + break; + + case symbol_kind::S_true: // true + yylhs.value.emplace< true_ptr > (); + break; + + case symbol_kind::S_undefined: // undefined + yylhs.value.emplace< undefined_ptr > (); + break; + + case symbol_kind::S_usingtree: // usingtree + yylhs.value.emplace< usingtree_ptr > (); + break; + + case symbol_kind::S_vector: // vector + yylhs.value.emplace< vector_ptr > (); + break; + + default: + break; + } + + + // Default location. + { + stack_type::slice range (yystack_, yylen); + YYLLOC_DEFAULT (yylhs.location, range, yylen); + yyerror_range[1].location = yylhs.location; + } + + // Perform the reduction. + YY_REDUCE_PRINT (yyn); +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + switch (yyn) + { + case 2: // root: program +#line 231 "parser.ypp" + { ast = std::move(yystack_[0].value.as < program_ptr > ()); } +#line 1731 "parser.cpp" + break; + + case 3: // root: %empty +#line 232 "parser.ypp" + { ast = std::make_unique(yylhs.location); } +#line 1737 "parser.cpp" + break; + + case 4: // program: program include +#line 237 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::move(yystack_[1].value.as < program_ptr > ()); yylhs.value.as < program_ptr > ()->includes.push_back(std::move(yystack_[0].value.as < include_ptr > ())); } +#line 1743 "parser.cpp" + break; + + case 5: // program: program define +#line 239 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::move(yystack_[1].value.as < program_ptr > ()); yylhs.value.as < program_ptr > ()->definitions.push_back(std::move(yystack_[0].value.as < define_ptr > ())); } +#line 1749 "parser.cpp" + break; + + case 6: // program: include +#line 241 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < program_ptr > ()->includes.push_back(std::move(yystack_[0].value.as < include_ptr > ())); } +#line 1755 "parser.cpp" + break; + + case 7: // program: define +#line 243 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < program_ptr > ()->definitions.push_back(std::move(yystack_[0].value.as < define_ptr > ())); } +#line 1761 "parser.cpp" + break; + + case 8: // include: "#include" file ";" +#line 248 "parser.ypp" + { yylhs.value.as < include_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < file_ptr > ())); } +#line 1767 "parser.cpp" + break; + + case 9: // define: usingtree +#line 252 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_usingtree = std::move(yystack_[0].value.as < usingtree_ptr > ()); } +#line 1773 "parser.cpp" + break; + + case 10: // define: constant +#line 253 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_constant = std::move(yystack_[0].value.as < constant_ptr > ()); } +#line 1779 "parser.cpp" + break; + + case 11: // define: thread +#line 254 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_thread = std::move(yystack_[0].value.as < thread_ptr > ()); } +#line 1785 "parser.cpp" + break; + + case 12: // usingtree: "#using_animtree" "(" string ")" ";" +#line 259 "parser.ypp" + { yylhs.value.as < usingtree_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < string_ptr > ())); } +#line 1791 "parser.cpp" + break; + + case 13: // constant: name "=" expr ";" +#line 264 "parser.ypp" + { yylhs.value.as < constant_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 1797 "parser.cpp" + break; + + case 14: // thread: name "(" parameters ")" stmt_block +#line 269 "parser.ypp" + { yylhs.value.as < thread_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < name_ptr > ()), std::move(yystack_[2].value.as < parameters_ptr > ()), std::move(yystack_[0].value.as < stmt_list_ptr > ())); } +#line 1803 "parser.cpp" + break; + + case 15: // parameters: parameters "," name +#line 274 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::move(yystack_[2].value.as < parameters_ptr > ()); yylhs.value.as < parameters_ptr > ()->list.push_back(std::move(yystack_[0].value.as < name_ptr > ())); } +#line 1809 "parser.cpp" + break; + + case 16: // parameters: name +#line 276 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < parameters_ptr > ()->list.push_back(std::move(yystack_[0].value.as < name_ptr > ())); } +#line 1815 "parser.cpp" + break; + + case 17: // parameters: %empty +#line 278 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::make_unique(yylhs.location); } +#line 1821 "parser.cpp" + break; + + case 18: // stmt: stmt_block +#line 282 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_list = std::move(yystack_[0].value.as < stmt_list_ptr > ()); } +#line 1827 "parser.cpp" + break; + + case 19: // stmt: stmt_call +#line 283 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_call = std::move(yystack_[0].value.as < stmt_call_ptr > ()); } +#line 1833 "parser.cpp" + break; + + case 20: // stmt: stmt_assign +#line 284 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_assign = std::move(yystack_[0].value.as < stmt_assign_ptr > ()); } +#line 1839 "parser.cpp" + break; + + case 21: // stmt: stmt_endon +#line 285 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_endon = std::move(yystack_[0].value.as < stmt_endon_ptr > ()); } +#line 1845 "parser.cpp" + break; + + case 22: // stmt: stmt_notify +#line 286 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_notify = std::move(yystack_[0].value.as < stmt_notify_ptr > ()); } +#line 1851 "parser.cpp" + break; + + case 23: // stmt: stmt_wait +#line 287 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_wait = std::move(yystack_[0].value.as < stmt_wait_ptr > ()); } +#line 1857 "parser.cpp" + break; + + case 24: // stmt: stmt_waittill +#line 288 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittill = std::move(yystack_[0].value.as < stmt_waittill_ptr > ()); } +#line 1863 "parser.cpp" + break; + + case 25: // stmt: stmt_waittillmatch +#line 289 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittillmatch = std::move(yystack_[0].value.as < stmt_waittillmatch_ptr > ()); } +#line 1869 "parser.cpp" + break; + + case 26: // stmt: stmt_waittillframeend +#line 290 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittillframeend = std::move(yystack_[0].value.as < stmt_waittillframeend_ptr > ()); } +#line 1875 "parser.cpp" + break; + + case 27: // stmt: stmt_if +#line 291 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_if = std::move(yystack_[0].value.as < stmt_if_ptr > ()); } +#line 1881 "parser.cpp" + break; + + case 28: // stmt: stmt_ifelse +#line 292 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_ifelse = std::move(yystack_[0].value.as < stmt_ifelse_ptr > ()); } +#line 1887 "parser.cpp" + break; + + case 29: // stmt: stmt_while +#line 293 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_while = std::move(yystack_[0].value.as < stmt_while_ptr > ()); } +#line 1893 "parser.cpp" + break; + + case 30: // stmt: stmt_for +#line 294 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_for = std::move(yystack_[0].value.as < stmt_for_ptr > ()); } +#line 1899 "parser.cpp" + break; + + case 31: // stmt: stmt_foreach +#line 295 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_foreach = std::move(yystack_[0].value.as < stmt_foreach_ptr > ()); } +#line 1905 "parser.cpp" + break; + + case 32: // stmt: stmt_switch +#line 296 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_switch = std::move(yystack_[0].value.as < stmt_switch_ptr > ()); } +#line 1911 "parser.cpp" + break; + + case 33: // stmt: stmt_case +#line 297 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_case = std::move(yystack_[0].value.as < stmt_case_ptr > ()); } +#line 1917 "parser.cpp" + break; + + case 34: // stmt: stmt_default +#line 298 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_default = std::move(yystack_[0].value.as < stmt_default_ptr > ()); } +#line 1923 "parser.cpp" + break; + + case 35: // stmt: stmt_break +#line 299 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_break = std::move(yystack_[0].value.as < stmt_break_ptr > ()); } +#line 1929 "parser.cpp" + break; + + case 36: // stmt: stmt_continue +#line 300 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_continue = std::move(yystack_[0].value.as < stmt_continue_ptr > ()); } +#line 1935 "parser.cpp" + break; + + case 37: // stmt: stmt_return +#line 301 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_return = std::move(yystack_[0].value.as < stmt_return_ptr > ()); } +#line 1941 "parser.cpp" + break; + + case 38: // stmt_block: "{" stmt_list "}" +#line 305 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::move(yystack_[1].value.as < stmt_list_ptr > ()); } +#line 1947 "parser.cpp" + break; + + case 39: // stmt_block: "{" "}" +#line 306 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::make_unique(yylhs.location); } +#line 1953 "parser.cpp" + break; + + case 40: // stmt_list: stmt_list stmt +#line 311 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::move(yystack_[1].value.as < stmt_list_ptr > ()); yylhs.value.as < stmt_list_ptr > ()->stmts.push_back(std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 1959 "parser.cpp" + break; + + case 41: // stmt_list: stmt +#line 313 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < stmt_list_ptr > ()->stmts.push_back(std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 1965 "parser.cpp" + break; + + case 42: // stmt_call: expr_call ";" +#line 318 "parser.ypp" + { yylhs.value.as < stmt_call_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_call_ptr > ())); } +#line 1971 "parser.cpp" + break; + + case 43: // stmt_call: expr_call_thread ";" +#line 320 "parser.ypp" + { yylhs.value.as < stmt_call_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_call_ptr > ())); } +#line 1977 "parser.cpp" + break; + + case 44: // stmt_assign: expr_assign ";" +#line 325 "parser.ypp" + { yylhs.value.as < stmt_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_assign_ptr > ())); } +#line 1983 "parser.cpp" + break; + + case 45: // stmt_endon: object "endon" "(" expr ")" ";" +#line 330 "parser.ypp" + { yylhs.value.as < stmt_endon_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ())); } +#line 1989 "parser.cpp" + break; + + case 46: // stmt_notify: object "notify" "(" expr "," expr_arguments ")" ";" +#line 335 "parser.ypp" + { yylhs.value.as < stmt_notify_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 1995 "parser.cpp" + break; + + case 47: // stmt_notify: object "notify" "(" expr ")" ";" +#line 337 "parser.ypp" + { yylhs.value.as < stmt_notify_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2001 "parser.cpp" + break; + + case 48: // stmt_wait: "wait" expr ";" +#line 342 "parser.ypp" + { yylhs.value.as < stmt_wait_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2007 "parser.cpp" + break; + + case 49: // stmt_waittill: object "waittill" "(" expr "," expr_arguments ")" ";" +#line 347 "parser.ypp" + { yylhs.value.as < stmt_waittill_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 2013 "parser.cpp" + break; + + case 50: // stmt_waittill: object "waittill" "(" expr ")" ";" +#line 349 "parser.ypp" + { yylhs.value.as < stmt_waittill_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2019 "parser.cpp" + break; + + case 51: // stmt_waittillmatch: object "waittillmatch" "(" expr "," expr_arguments ")" ";" +#line 354 "parser.ypp" + { yylhs.value.as < stmt_waittillmatch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 2025 "parser.cpp" + break; + + case 52: // stmt_waittillmatch: object "waittillmatch" "(" expr ")" ";" +#line 356 "parser.ypp" + { yylhs.value.as < stmt_waittillmatch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2031 "parser.cpp" + break; + + case 53: // stmt_waittillframeend: "waittillframeend" ";" +#line 361 "parser.ypp" + { yylhs.value.as < stmt_waittillframeend_ptr > () = std::make_unique(yylhs.location); } +#line 2037 "parser.cpp" + break; + + case 54: // stmt_if: "if" "(" expr ")" stmt +#line 366 "parser.ypp" + { yylhs.value.as < stmt_if_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2043 "parser.cpp" + break; + + case 55: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt +#line 371 "parser.ypp" + { yylhs.value.as < stmt_ifelse_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < stmt_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2049 "parser.cpp" + break; + + case 56: // stmt_while: "while" "(" expr ")" stmt +#line 376 "parser.ypp" + { yylhs.value.as < stmt_while_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2055 "parser.cpp" + break; + + case 57: // stmt_for: "for" "(" for_stmt ";" for_expr ";" for_stmt ")" stmt +#line 381 "parser.ypp" + { yylhs.value.as < stmt_for_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[6].value.as < stmt_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < stmt_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2061 "parser.cpp" + break; + + case 58: // stmt_foreach: "foreach" "(" name "in" expr ")" stmt +#line 386 "parser.ypp" + { yylhs.value.as < stmt_foreach_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[4].value.as < name_ptr > ())), std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2067 "parser.cpp" + break; + + case 59: // stmt_foreach: "foreach" "(" name "," name "in" expr ")" stmt +#line 388 "parser.ypp" + { yylhs.value.as < stmt_foreach_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[6].value.as < name_ptr > ())), expr_ptr(std::move(yystack_[4].value.as < name_ptr > ())), std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2073 "parser.cpp" + break; + + case 60: // stmt_switch: "switch" "(" expr ")" stmt_block +#line 393 "parser.ypp" + { yylhs.value.as < stmt_switch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_list_ptr > ())); } +#line 2079 "parser.cpp" + break; + + case 61: // stmt_case: "case" integer ":" +#line 398 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < integer_ptr > ())), std::make_unique(yylhs.location)); } +#line 2085 "parser.cpp" + break; + + case 62: // stmt_case: "case" neg_integer ":" +#line 400 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < integer_ptr > ())), std::make_unique(yylhs.location)); } +#line 2091 "parser.cpp" + break; + + case 63: // stmt_case: "case" string ":" +#line 402 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < string_ptr > ())), std::make_unique(yylhs.location)); } +#line 2097 "parser.cpp" + break; + + case 64: // stmt_default: "default" ":" +#line 407 "parser.ypp" + { yylhs.value.as < stmt_default_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } +#line 2103 "parser.cpp" + break; + + case 65: // stmt_break: "break" ";" +#line 412 "parser.ypp" + { yylhs.value.as < stmt_break_ptr > () = std::make_unique(yylhs.location); } +#line 2109 "parser.cpp" + break; + + case 66: // stmt_continue: "continue" ";" +#line 417 "parser.ypp" + { yylhs.value.as < stmt_continue_ptr > () = std::make_unique(yylhs.location); } +#line 2115 "parser.cpp" + break; + + case 67: // stmt_return: "return" expr ";" +#line 422 "parser.ypp" + { yylhs.value.as < stmt_return_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2121 "parser.cpp" + break; + + case 68: // stmt_return: "return" ";" +#line 424 "parser.ypp" + { yylhs.value.as < stmt_return_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } +#line 2127 "parser.cpp" + break; + + case 69: // for_stmt: expr_assign +#line 428 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_list = std::make_unique(yylhs.location); yylhs.value.as < stmt_ptr > ().as_list->stmts.push_back(stmt_ptr(std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_assign_ptr > ())))); } +#line 2133 "parser.cpp" + break; + + case 70: // for_stmt: %empty +#line 429 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_node = std::make_unique(yylhs.location); } +#line 2139 "parser.cpp" + break; + + case 71: // for_expr: expr +#line 433 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2145 "parser.cpp" + break; + + case 72: // for_expr: %empty +#line 434 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location); } +#line 2151 "parser.cpp" + break; + + case 73: // expr: expr_compare +#line 438 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2157 "parser.cpp" + break; + + case 74: // expr: expr_binary +#line 439 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2163 "parser.cpp" + break; + + case 75: // expr: expr_primitive +#line 440 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2169 "parser.cpp" + break; + + case 76: // expr_assign: "++" object +#line 444 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < node_ptr > ())); } +#line 2175 "parser.cpp" + break; + + case 77: // expr_assign: "--" object +#line 445 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < node_ptr > ())); } +#line 2181 "parser.cpp" + break; + + case 78: // expr_assign: object "++" +#line 446 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < node_ptr > ())); } +#line 2187 "parser.cpp" + break; + + case 79: // expr_assign: object "--" +#line 447 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < node_ptr > ())); } +#line 2193 "parser.cpp" + break; + + case 80: // expr_assign: object "=" expr +#line 448 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2199 "parser.cpp" + break; + + case 81: // expr_assign: object "|=" expr +#line 449 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2205 "parser.cpp" + break; + + case 82: // expr_assign: object "&=" expr +#line 450 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2211 "parser.cpp" + break; + + case 83: // expr_assign: object "^=" expr +#line 451 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2217 "parser.cpp" + break; + + case 84: // expr_assign: object "<<=" expr +#line 452 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()),std::move( yystack_[0].value.as < expr_ptr > ())); } +#line 2223 "parser.cpp" + break; + + case 85: // expr_assign: object ">>=" expr +#line 453 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2229 "parser.cpp" + break; + + case 86: // expr_assign: object "+=" expr +#line 454 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2235 "parser.cpp" + break; + + case 87: // expr_assign: object "-=" expr +#line 455 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2241 "parser.cpp" + break; + + case 88: // expr_assign: object "*=" expr +#line 456 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2247 "parser.cpp" + break; + + case 89: // expr_assign: object "/=" expr +#line 457 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2253 "parser.cpp" + break; + + case 90: // expr_assign: object "%=" expr +#line 458 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2259 "parser.cpp" + break; + + case 91: // expr_compare: expr "||" expr +#line 462 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2265 "parser.cpp" + break; + + case 92: // expr_compare: expr "&&" expr +#line 463 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2271 "parser.cpp" + break; + + case 93: // expr_compare: expr "==" expr +#line 464 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2277 "parser.cpp" + break; + + case 94: // expr_compare: expr "!=" expr +#line 465 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2283 "parser.cpp" + break; + + case 95: // expr_compare: expr "<=" expr +#line 466 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2289 "parser.cpp" + break; + + case 96: // expr_compare: expr ">=" expr +#line 467 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2295 "parser.cpp" + break; + + case 97: // expr_compare: expr "<" expr +#line 468 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2301 "parser.cpp" + break; + + case 98: // expr_compare: expr ">" expr +#line 469 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2307 "parser.cpp" + break; + + case 99: // expr_binary: expr "|" expr +#line 473 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2313 "parser.cpp" + break; + + case 100: // expr_binary: expr "&" expr +#line 474 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2319 "parser.cpp" + break; + + case 101: // expr_binary: expr "^" expr +#line 475 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2325 "parser.cpp" + break; + + case 102: // expr_binary: expr "<<" expr +#line 476 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2331 "parser.cpp" + break; + + case 103: // expr_binary: expr ">>" expr +#line 477 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2337 "parser.cpp" + break; + + case 104: // expr_binary: expr "+" expr +#line 478 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2343 "parser.cpp" + break; + + case 105: // expr_binary: expr "-" expr +#line 479 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2349 "parser.cpp" + break; + + case 106: // expr_binary: expr "*" expr +#line 480 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2355 "parser.cpp" + break; + + case 107: // expr_binary: expr "/" expr +#line 481 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2361 "parser.cpp" + break; + + case 108: // expr_binary: expr "%" expr +#line 482 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2367 "parser.cpp" + break; + + case 109: // expr_primitive: "(" expr ")" +#line 486 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[1].value.as < expr_ptr > ()); } +#line 2373 "parser.cpp" + break; + + case 110: // expr_primitive: "~" expr +#line 487 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2379 "parser.cpp" + break; + + case 111: // expr_primitive: "!" expr +#line 488 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2385 "parser.cpp" + break; + + case 112: // expr_primitive: expr_call +#line 489 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2391 "parser.cpp" + break; + + case 113: // expr_primitive: expr_call_thread +#line 490 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2397 "parser.cpp" + break; + + case 114: // expr_primitive: expr_call_childthread +#line 491 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2403 "parser.cpp" + break; + + case 115: // expr_primitive: expr_function +#line 492 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2409 "parser.cpp" + break; + + case 116: // expr_primitive: expr_add_array +#line 493 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2415 "parser.cpp" + break; + + case 117: // expr_primitive: expr_array +#line 494 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2421 "parser.cpp" + break; + + case 118: // expr_primitive: expr_field +#line 495 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2427 "parser.cpp" + break; + + case 119: // expr_primitive: expr_size +#line 496 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2433 "parser.cpp" + break; + + case 120: // expr_primitive: thisthread +#line 497 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < thisthread_ptr > ()); } +#line 2439 "parser.cpp" + break; + + case 121: // expr_primitive: empty_array +#line 498 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < empty_array_ptr > ()); } +#line 2445 "parser.cpp" + break; + + case 122: // expr_primitive: undefined +#line 499 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < undefined_ptr > ()); } +#line 2451 "parser.cpp" + break; + + case 123: // expr_primitive: game +#line 500 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < game_ptr > ()); } +#line 2457 "parser.cpp" + break; + + case 124: // expr_primitive: self +#line 501 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < self_ptr > ()); } +#line 2463 "parser.cpp" + break; + + case 125: // expr_primitive: anim +#line 502 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < anim_ptr > ()); } +#line 2469 "parser.cpp" + break; + + case 126: // expr_primitive: level +#line 503 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < level_ptr > ()); } +#line 2475 "parser.cpp" + break; + + case 127: // expr_primitive: animation +#line 504 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < animation_ptr > ()); } +#line 2481 "parser.cpp" + break; + + case 128: // expr_primitive: animtree +#line 505 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < animtree_ptr > ()); } +#line 2487 "parser.cpp" + break; + + case 129: // expr_primitive: name +#line 506 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < name_ptr > ()); } +#line 2493 "parser.cpp" + break; + + case 130: // expr_primitive: istring +#line 507 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < istring_ptr > ()); } +#line 2499 "parser.cpp" + break; + + case 131: // expr_primitive: string +#line 508 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < string_ptr > ()); } +#line 2505 "parser.cpp" + break; + + case 132: // expr_primitive: vector +#line 509 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < vector_ptr > ()); } +#line 2511 "parser.cpp" + break; + + case 133: // expr_primitive: neg_float +#line 510 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < float_ptr > ()); } +#line 2517 "parser.cpp" + break; + + case 134: // expr_primitive: neg_integer +#line 511 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < integer_ptr > ()); } +#line 2523 "parser.cpp" + break; + + case 135: // expr_primitive: float +#line 512 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < float_ptr > ()); } +#line 2529 "parser.cpp" + break; + + case 136: // expr_primitive: integer +#line 513 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < integer_ptr > ()); } +#line 2535 "parser.cpp" + break; + + case 137: // expr_primitive: false +#line 514 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < false_ptr > ()); } +#line 2541 "parser.cpp" + break; + + case 138: // expr_primitive: true +#line 515 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < true_ptr > ()); } +#line 2547 "parser.cpp" + break; + + case 139: // expr_call: expr_call_function +#line 519 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2553 "parser.cpp" + break; + + case 140: // expr_call: expr_call_pointer +#line 520 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2559 "parser.cpp" + break; + + case 141: // expr_call: object expr_call_function +#line 521 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::move(yystack_[1].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2565 "parser.cpp" + break; + + case 142: // expr_call: object expr_call_pointer +#line 522 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::move(yystack_[1].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2571 "parser.cpp" + break; + + case 143: // expr_call_thread: "thread" expr_call_function +#line 526 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2577 "parser.cpp" + break; + + case 144: // expr_call_thread: "thread" expr_call_pointer +#line 527 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2583 "parser.cpp" + break; + + case 145: // expr_call_thread: object "thread" expr_call_function +#line 528 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2589 "parser.cpp" + break; + + case 146: // expr_call_thread: object "thread" expr_call_pointer +#line 529 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2595 "parser.cpp" + break; + + case 147: // expr_call_childthread: "childthread" expr_call_function +#line 533 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2601 "parser.cpp" + break; + + case 148: // expr_call_childthread: "childthread" expr_call_pointer +#line 534 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2607 "parser.cpp" + break; + + case 149: // expr_call_childthread: object "childthread" expr_call_function +#line 535 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2613 "parser.cpp" + break; + + case 150: // expr_call_childthread: object "childthread" expr_call_pointer +#line 536 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2619 "parser.cpp" + break; + + case 151: // expr_call_function: name "(" expr_arguments ")" +#line 541 "parser.ypp" + {yylhs.value.as < expr_call_type_ptr > ().as_func = std::make_unique(yylhs.location, std::make_unique(), std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2625 "parser.cpp" + break; + + case 152: // expr_call_function: file "::" name "(" expr_arguments ")" +#line 543 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_func = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < file_ptr > ()), std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2631 "parser.cpp" + break; + + case 153: // expr_call_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 548 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_pointer = std::make_unique(yylhs.location, false, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2637 "parser.cpp" + break; + + case 154: // expr_call_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 550 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_pointer = std::make_unique(yylhs.location, true, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2643 "parser.cpp" + break; + + case 155: // expr_arguments: expr_arguments_filled +#line 554 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[0].value.as < expr_arguments_ptr > ()); } +#line 2649 "parser.cpp" + break; + + case 156: // expr_arguments: expr_arguments_empty +#line 555 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[0].value.as < expr_arguments_ptr > ()); } +#line 2655 "parser.cpp" + break; + + case 157: // expr_arguments_filled: expr_arguments_filled "," expr +#line 560 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[2].value.as < expr_arguments_ptr > ()); yylhs.value.as < expr_arguments_ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2661 "parser.cpp" + break; + + case 158: // expr_arguments_filled: expr +#line 562 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < expr_arguments_ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2667 "parser.cpp" + break; + + case 159: // expr_arguments_empty: %empty +#line 567 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::make_unique(yylhs.location); } +#line 2673 "parser.cpp" + break; + + case 160: // expr_function: "::" name +#line 572 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2679 "parser.cpp" + break; + + case 161: // expr_function: file "::" name +#line 574 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < file_ptr > ()), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2685 "parser.cpp" + break; + + case 162: // expr_add_array: "[" expr_arguments_filled "]" +#line 579 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2691 "parser.cpp" + break; + + case 163: // expr_array: object "[" expr "]" +#line 584 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < node_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2697 "parser.cpp" + break; + + case 164: // expr_field: object "." name +#line 589 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2703 "parser.cpp" + break; + + case 165: // expr_size: object "." "size" +#line 594 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ())); } +#line 2709 "parser.cpp" + break; + + case 166: // object: expr_call +#line 598 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2715 "parser.cpp" + break; + + case 167: // object: expr_array +#line 599 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2721 "parser.cpp" + break; + + case 168: // object: expr_field +#line 600 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2727 "parser.cpp" + break; + + case 169: // object: game +#line 601 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < game_ptr > ()); } +#line 2733 "parser.cpp" + break; + + case 170: // object: self +#line 602 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < self_ptr > ()); } +#line 2739 "parser.cpp" + break; + + case 171: // object: anim +#line 603 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < anim_ptr > ()); } +#line 2745 "parser.cpp" + break; + + case 172: // object: level +#line 604 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < level_ptr > ()); } +#line 2751 "parser.cpp" + break; + + case 173: // object: name +#line 605 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < name_ptr > ()); } +#line 2757 "parser.cpp" + break; + + case 174: // thisthread: "thisthread" +#line 608 "parser.ypp" + { yylhs.value.as < thisthread_ptr > () = std::make_unique(yylhs.location); } +#line 2763 "parser.cpp" + break; + + case 175: // empty_array: "[" "]" +#line 609 "parser.ypp" + { yylhs.value.as < empty_array_ptr > () = std::make_unique(yylhs.location); } +#line 2769 "parser.cpp" + break; + + case 176: // undefined: "undefined" +#line 610 "parser.ypp" + { yylhs.value.as < undefined_ptr > () = std::make_unique(yylhs.location); } +#line 2775 "parser.cpp" + break; + + case 177: // game: "game" +#line 611 "parser.ypp" + { yylhs.value.as < game_ptr > () = std::make_unique(yylhs.location); } +#line 2781 "parser.cpp" + break; + + case 178: // self: "self" +#line 612 "parser.ypp" + { yylhs.value.as < self_ptr > () = std::make_unique(yylhs.location); } +#line 2787 "parser.cpp" + break; + + case 179: // anim: "anim" +#line 613 "parser.ypp" + { yylhs.value.as < anim_ptr > () = std::make_unique(yylhs.location); } +#line 2793 "parser.cpp" + break; + + case 180: // level: "level" +#line 614 "parser.ypp" + { yylhs.value.as < level_ptr > () = std::make_unique(yylhs.location); } +#line 2799 "parser.cpp" + break; + + case 181: // animation: "%" "identifier" +#line 615 "parser.ypp" + { yylhs.value.as < animation_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2805 "parser.cpp" + break; + + case 182: // animtree: "#animtree" +#line 616 "parser.ypp" + { yylhs.value.as < animtree_ptr > () = std::make_unique(yylhs.location); } +#line 2811 "parser.cpp" + break; + + case 183: // name: "identifier" +#line 617 "parser.ypp" + { yylhs.value.as < name_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2817 "parser.cpp" + break; + + case 184: // file: "file path" +#line 618 "parser.ypp" + { yylhs.value.as < file_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2823 "parser.cpp" + break; + + case 185: // istring: "localized string" +#line 619 "parser.ypp" + { yylhs.value.as < istring_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2829 "parser.cpp" + break; + + case 186: // string: "string literal" +#line 620 "parser.ypp" + { yylhs.value.as < string_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2835 "parser.cpp" + break; + + case 187: // vector: "(" expr "," expr "," expr ")" +#line 621 "parser.ypp" + { yylhs.value.as < vector_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[3].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2841 "parser.cpp" + break; + + case 188: // neg_float: "-" "float" +#line 622 "parser.ypp" + { yylhs.value.as < float_ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 2847 "parser.cpp" + break; + + case 189: // neg_integer: "-" "int" +#line 623 "parser.ypp" + { yylhs.value.as < integer_ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 2853 "parser.cpp" + break; + + case 190: // float: "float" +#line 624 "parser.ypp" + { yylhs.value.as < float_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2859 "parser.cpp" + break; + + case 191: // integer: "int" +#line 625 "parser.ypp" + { yylhs.value.as < integer_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2865 "parser.cpp" + break; + + case 192: // false: "false" +#line 626 "parser.ypp" + { yylhs.value.as < false_ptr > () = std::make_unique(yylhs.location); } +#line 2871 "parser.cpp" + break; + + case 193: // true: "true" +#line 627 "parser.ypp" + { yylhs.value.as < true_ptr > () = std::make_unique(yylhs.location); } +#line 2877 "parser.cpp" + break; + + +#line 2881 "parser.cpp" + + default: + break; + } + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + YYERROR; + } +#endif // YY_EXCEPTIONS + YY_SYMBOL_PRINT ("-> $$ =", yylhs); + yypop_ (yylen); + yylen = 0; + + // Shift the result of the reduction. + yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); + } + goto yynewstate; + + + /*--------------------------------------. + | yyerrlab -- here on detecting error. | + `--------------------------------------*/ + yyerrlab: + // If not already recovering from an error, report this error. + if (!yyerrstatus_) + { + ++yynerrs_; + context yyctx (*this, yyla); + std::string msg = yysyntax_error_ (yyctx); + error (yyla.location, YY_MOVE (msg)); + } + + + yyerror_range[1].location = yyla.location; + if (yyerrstatus_ == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + // Return failure if at end of input. + if (yyla.kind () == symbol_kind::S_YYEOF) + YYABORT; + else if (!yyla.empty ()) + { + yy_destroy_ ("Error: discarding", yyla); + yyla.clear (); + } + } + + // Else will try to reuse lookahead token after shifting the error token. + goto yyerrlab1; + + + /*---------------------------------------------------. + | yyerrorlab -- error raised explicitly by YYERROR. | + `---------------------------------------------------*/ + yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and + the label yyerrorlab therefore never appears in user code. */ + if (false) + YYERROR; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + yypop_ (yylen); + yylen = 0; + YY_STACK_PRINT (); + goto yyerrlab1; + + + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ + yyerrlab1: + yyerrstatus_ = 3; // Each real token shifted decrements this. + // Pop stack until we find a state that shifts the error token. + for (;;) + { + yyn = yypact_[+yystack_[0].state]; + if (!yy_pact_value_is_default_ (yyn)) + { + yyn += symbol_kind::S_YYerror; + if (0 <= yyn && yyn <= yylast_ + && yycheck_[yyn] == symbol_kind::S_YYerror) + { + yyn = yytable_[yyn]; + if (0 < yyn) + break; + } + } + + // Pop the current state because it cannot handle the error token. + if (yystack_.size () == 1) + YYABORT; + + yyerror_range[1].location = yystack_[0].location; + yy_destroy_ ("Error: popping", yystack_[0]); + yypop_ (); + YY_STACK_PRINT (); + } + { + stack_symbol_type error_token; + + yyerror_range[2].location = yyla.location; + YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); + + // Shift the error token. + yy_lac_discard_ ("error recovery"); + error_token.state = state_type (yyn); + yypush_ ("Shifting", YY_MOVE (error_token)); + } + goto yynewstate; + + + /*-------------------------------------. + | yyacceptlab -- YYACCEPT comes here. | + `-------------------------------------*/ + yyacceptlab: + yyresult = 0; + goto yyreturn; + + + /*-----------------------------------. + | yyabortlab -- YYABORT comes here. | + `-----------------------------------*/ + yyabortlab: + yyresult = 1; + goto yyreturn; + + + /*-----------------------------------------------------. + | yyreturn -- parsing is finished, return the result. | + `-----------------------------------------------------*/ + yyreturn: + if (!yyla.empty ()) + yy_destroy_ ("Cleanup: discarding lookahead", yyla); + + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + yypop_ (yylen); + YY_STACK_PRINT (); + while (1 < yystack_.size ()) + { + yy_destroy_ ("Cleanup: popping", yystack_[0]); + yypop_ (); + } + + return yyresult; + } +#if YY_EXCEPTIONS + catch (...) + { + YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; + // Do not try to display the values of the reclaimed symbols, + // as their printers might throw an exception. + if (!yyla.empty ()) + yy_destroy_ (YY_NULLPTR, yyla); + + while (1 < yystack_.size ()) + { + yy_destroy_ (YY_NULLPTR, yystack_[0]); + yypop_ (); + } + throw; + } +#endif // YY_EXCEPTIONS + } + + void + parser::error (const syntax_error& yyexc) + { + error (yyexc.location, yyexc.what ()); + } + + const char * + parser::symbol_name (symbol_kind_type yysymbol) + { + static const char *const yy_sname[] = + { + "end of file", "error", "invalid token", "#include", "#using_animtree", + "#animtree", "endon", "notify", "wait", "waittill", "waittillmatch", + "waittillframeend", "if", "else", "while", "for", "foreach", "in", + "switch", "case", "default", "break", "continue", "return", "thread", + "childthread", "thisthread", "call", "true", "false", "undefined", + "size", "game", "self", "anim", "level", "(", ")", "{", "}", "[", "]", + ",", ".", "::", ":", ";", "++", "--", "<<", ">>", "||", "&&", "==", "!=", + "<=", ">=", "<", ">", "!", "~", "=", "+=", "-=", "*=", "/=", "%=", "|=", + "&=", "^=", ">>=", "<<=", "|", "&", "^", "+", "-", "*", "/", "%", + "file path", "identifier", "string literal", "localized string", "float", + "int", "ADD_ARRAY", "THEN", "NEG", "ANIMREF", "PREINC", "PREDEC", + "POSTINC", "POSTDEC", "$accept", "root", "program", "include", "define", + "usingtree", "constant", "thread", "parameters", "stmt", "stmt_block", + "stmt_list", "stmt_call", "stmt_assign", "stmt_endon", "stmt_notify", + "stmt_wait", "stmt_waittill", "stmt_waittillmatch", + "stmt_waittillframeend", "stmt_if", "stmt_ifelse", "stmt_while", + "stmt_for", "stmt_foreach", "stmt_switch", "stmt_case", "stmt_default", + "stmt_break", "stmt_continue", "stmt_return", "for_stmt", "for_expr", + "expr", "expr_assign", "expr_compare", "expr_binary", "expr_primitive", + "expr_call", "expr_call_thread", "expr_call_childthread", + "expr_call_function", "expr_call_pointer", "expr_arguments", + "expr_arguments_filled", "expr_arguments_empty", "expr_function", + "expr_add_array", "expr_array", "expr_field", "expr_size", "object", + "thisthread", "empty_array", "undefined", "game", "self", "anim", + "level", "animation", "animtree", "name", "file", "istring", "string", + "vector", "neg_float", "neg_integer", "float", "integer", "false", + "true", YY_NULLPTR + }; + return yy_sname[yysymbol]; + } + + + + // parser::context. + parser::context::context (const parser& yyparser, const symbol_type& yyla) + : yyparser_ (yyparser) + , yyla_ (yyla) + {} + + int + parser::context::expected_tokens (symbol_kind_type yyarg[], int yyargn) const + { + // Actual number of expected tokens + int yycount = 0; + +#if IW5DEBUG + // Execute LAC once. We don't care if it is successful, we + // only do it for the sake of debugging output. + if (!yyparser_.yy_lac_established_) + yyparser_.yy_lac_check_ (yyla_.kind ()); +#endif + + for (int yyx = 0; yyx < YYNTOKENS; ++yyx) + { + symbol_kind_type yysym = YY_CAST (symbol_kind_type, yyx); + if (yysym != symbol_kind::S_YYerror + && yysym != symbol_kind::S_YYUNDEF + && yyparser_.yy_lac_check_ (yysym)) + { + if (!yyarg) + ++yycount; + else if (yycount == yyargn) + return 0; + else + yyarg[yycount++] = yysym; + } + } + if (yyarg && yycount == 0 && 0 < yyargn) + yyarg[0] = symbol_kind::S_YYEMPTY; + return yycount; + } + + + bool + parser::yy_lac_check_ (symbol_kind_type yytoken) const + { + // Logically, the yylac_stack's lifetime is confined to this function. + // Clear it, to get rid of potential left-overs from previous call. + yylac_stack_.clear (); + // Reduce until we encounter a shift and thereby accept the token. +#if IW5DEBUG + YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; +#endif + std::ptrdiff_t lac_top = 0; + while (true) + { + state_type top_state = (yylac_stack_.empty () + ? yystack_[lac_top].state + : yylac_stack_.back ()); + int yyrule = yypact_[+top_state]; + if (yy_pact_value_is_default_ (yyrule) + || (yyrule += yytoken) < 0 || yylast_ < yyrule + || yycheck_[yyrule] != yytoken) + { + // Use the default action. + yyrule = yydefact_[+top_state]; + if (yyrule == 0) + { + YYCDEBUG << " Err\n"; + return false; + } + } + else + { + // Use the action from yytable. + yyrule = yytable_[yyrule]; + if (yy_table_value_is_error_ (yyrule)) + { + YYCDEBUG << " Err\n"; + return false; + } + if (0 < yyrule) + { + YYCDEBUG << " S" << yyrule << '\n'; + return true; + } + yyrule = -yyrule; + } + // By now we know we have to simulate a reduce. + YYCDEBUG << " R" << yyrule - 1; + // Pop the corresponding number of values from the stack. + { + std::ptrdiff_t yylen = yyr2_[yyrule]; + // First pop from the LAC stack as many tokens as possible. + std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); + if (yylen < lac_size) + { + yylac_stack_.resize (std::size_t (lac_size - yylen)); + yylen = 0; + } + else if (lac_size) + { + yylac_stack_.clear (); + yylen -= lac_size; + } + // Only afterwards look at the main stack. + // We simulate popping elements by incrementing lac_top. + lac_top += yylen; + } + // Keep top_state in sync with the updated stack. + top_state = (yylac_stack_.empty () + ? yystack_[lac_top].state + : yylac_stack_.back ()); + // Push the resulting state of the reduction. + state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); + YYCDEBUG << " G" << int (state); + yylac_stack_.push_back (state); + } + } + + // Establish the initial context if no initial context currently exists. + bool + parser::yy_lac_establish_ (symbol_kind_type yytoken) + { + /* Establish the initial context for the current lookahead if no initial + context is currently established. + + We define a context as a snapshot of the parser stacks. We define + the initial context for a lookahead as the context in which the + parser initially examines that lookahead in order to select a + syntactic action. Thus, if the lookahead eventually proves + syntactically unacceptable (possibly in a later context reached via a + series of reductions), the initial context can be used to determine + the exact set of tokens that would be syntactically acceptable in the + lookahead's place. Moreover, it is the context after which any + further semantic actions would be erroneous because they would be + determined by a syntactically unacceptable token. + + yy_lac_establish_ should be invoked when a reduction is about to be + performed in an inconsistent state (which, for the purposes of LAC, + includes consistent states that don't know they're consistent because + their default reductions have been disabled). + + For parse.lac=full, the implementation of yy_lac_establish_ is as + follows. If no initial context is currently established for the + current lookahead, then check if that lookahead can eventually be + shifted if syntactic actions continue from the current context. */ + if (!yy_lac_established_) + { +#if IW5DEBUG + YYCDEBUG << "LAC: initial context established for " + << symbol_name (yytoken) << '\n'; +#endif + yy_lac_established_ = true; + return yy_lac_check_ (yytoken); + } + return true; + } + + // Discard any previous initial lookahead context. + void + parser::yy_lac_discard_ (const char* evt) + { + /* Discard any previous initial lookahead context because of Event, + which may be a lookahead change or an invalidation of the currently + established initial context for the current lookahead. + + The most common example of a lookahead change is a shift. An example + of both cases is syntax error recovery. That is, a syntax error + occurs when the lookahead is syntactically erroneous for the + currently established initial context, so error recovery manipulates + the parser stacks to try to find a new initial context in which the + current lookahead is syntactically acceptable. If it fails to find + such a context, it discards the lookahead. */ + if (yy_lac_established_) + { + YYCDEBUG << "LAC: initial context discarded due to " + << evt << '\n'; + yy_lac_established_ = false; + } + } + + int + parser::yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const + { + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yyla) is + if this state is a consistent state with a default action. + Thus, detecting the absence of a lookahead is sufficient to + determine that there is no unexpected or expected token to + report. In that case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is + a consistent state with a default action. There might have + been a previous inconsistent state, consistent state with a + non-default action, or user semantic action that manipulated + yyla. (However, yyla is currently not documented for users.) + In the first two cases, it might appear that the current syntax + error should have been detected in the previous state when + yy_lac_check was invoked. However, at that time, there might + have been a different syntax error that discarded a different + initial context during error recovery, leaving behind the + current lookahead. + */ + + if (!yyctx.lookahead ().empty ()) + { + if (yyarg) + yyarg[0] = yyctx.token (); + int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); + return yyn + 1; + } + return 0; + } + + // Generate an error message. + std::string + parser::yysyntax_error_ (const context& yyctx) const + { + // Its maximum. + enum { YYARGS_MAX = 5 }; + // Arguments of yyformat. + symbol_kind_type yyarg[YYARGS_MAX]; + int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); + + char const* yyformat = YY_NULLPTR; + switch (yycount) + { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + default: // Avoid compiler warnings. + YYCASE_ (0, YY_("syntax error")); + YYCASE_ (1, YY_("syntax error, unexpected %s")); + YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +#undef YYCASE_ + } + + std::string yyres; + // Argument number. + std::ptrdiff_t yyi = 0; + for (char const* yyp = yyformat; *yyp; ++yyp) + if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) + { + yyres += symbol_name (yyarg[yyi++]); + ++yyp; + } + else + yyres += *yyp; + return yyres; + } + + + const short parser::yypact_ninf_ = -219; + + const short parser::yytable_ninf_ = -174; + + const short + parser::yypact_[] = + { + -2, -63, -11, -219, 35, -2, -219, -219, -219, -219, + -219, -32, -219, -4, -31, -219, -219, -219, -29, 634, + -219, -219, 21, -23, -219, -219, -6, -6, -219, 22, + -219, -219, -219, -219, -219, -219, -219, 634, 451, -29, + 634, 634, -62, -13, -219, -219, -219, 1382, -219, -219, + -219, 30, -219, -219, -219, -219, -219, -219, 40, 183, + -219, 350, -219, -219, -219, 417, 529, 546, 595, -219, + -219, 13, 19, -219, -219, -219, -219, -219, -219, -219, + -219, -219, 23, 33, -29, 32, -219, -219, 42, 44, + -219, -219, 36, 946, 451, -219, 1460, 6, -219, -219, + -219, -219, -219, -219, -219, 634, 634, 634, 634, 634, + 634, 634, 634, 634, 634, 634, 634, 634, 634, 634, + 634, 634, 634, -6, -6, 696, -21, -219, -219, 634, + -29, -219, 813, -219, -219, 634, -29, 634, -219, 634, + 1253, -219, 634, 327, 327, 1470, 979, 219, 219, 335, + 335, 335, 335, 1022, 1501, 1511, 8, 8, -219, -219, + -219, -219, -219, -219, -219, 1292, -219, -219, 53, 49, + -219, 56, 634, 50, 61, 64, 66, 76, 78, -52, + 71, 73, 79, 572, -219, 107, 107, -219, -219, 851, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, 85, + 87, 89, -219, -219, 742, -219, -219, -219, -219, 42, + 1253, 56, 1331, 1369, 86, 1460, -219, -219, 634, 1416, + -219, 634, 634, 657, -29, 634, 37, 93, 98, 99, + -219, -219, -219, -219, 1429, -219, 1, 1, -219, -219, + -219, -219, -219, 109, 110, 112, 113, -29, -219, -219, + 634, 634, 634, 634, 634, 634, 634, 634, 634, 634, + 634, 114, 634, 120, 122, -219, 1085, 1118, 104, -219, + 911, 3, 1128, -219, -219, -219, -219, 634, 634, 634, + 634, 1460, 1460, 1460, 1460, 1460, 1460, 1460, 1460, 1460, + 1460, 1460, 121, 1161, 634, -219, 889, 889, 634, 634, + -29, 33, 1171, 989, 1032, 1075, 634, -219, 123, 148, + -219, 146, 1460, 1204, 145, -219, 152, 157, 634, 159, + 634, 160, 634, 172, -219, 889, 657, 889, 634, -219, + -219, 179, -219, 180, -219, 181, -219, -219, 184, -219, + 1214, 174, 176, 190, 889, 889, -219, -219, -219, -219, + -219 + }; + + const unsigned char + parser::yydefact_[] = + { + 3, 0, 0, 183, 0, 2, 6, 7, 9, 10, + 11, 0, 184, 0, 0, 1, 4, 5, 17, 0, + 8, 186, 0, 0, 16, 182, 0, 0, 174, 0, + 193, 192, 176, 177, 178, 179, 180, 0, 0, 0, + 0, 0, 0, 0, 185, 190, 191, 0, 73, 74, + 75, 112, 113, 114, 139, 140, 115, 116, 117, 118, + 119, 0, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 0, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 0, 0, 0, 0, 143, 144, 0, 0, + 147, 148, 0, 0, 0, 175, 158, 0, 160, 111, + 110, 188, 189, 181, 13, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 141, 142, 159, + 0, 12, 0, 14, 15, 0, 0, 0, 109, 0, + 158, 162, 0, 102, 103, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 104, 105, 106, 107, + 108, 145, 146, 149, 150, 0, 165, 164, 0, 155, + 156, 161, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 39, 0, 0, 41, 18, 0, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 0, + 166, 0, 167, 168, 0, 169, 170, 171, 172, 173, + 0, 0, 0, 0, 0, 157, 163, 151, 159, 0, + 53, 0, 0, 70, 0, 0, 0, 0, 0, 0, + 64, 65, 66, 68, 0, 166, 76, 77, 38, 40, + 44, 42, 43, 0, 0, 0, 0, 0, 78, 79, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 48, 0, 0, 0, 69, + 0, 0, 0, 63, 62, 61, 67, 0, 0, 0, + 0, 80, 86, 87, 88, 89, 90, 81, 82, 83, + 85, 84, 0, 0, 159, 152, 0, 0, 72, 0, + 0, 0, 0, 0, 0, 0, 159, 187, 0, 54, + 56, 0, 71, 0, 0, 60, 0, 0, 159, 0, + 159, 0, 159, 0, 153, 0, 70, 0, 0, 45, + 47, 0, 50, 0, 52, 0, 154, 55, 0, 58, + 0, 0, 0, 0, 0, 0, 46, 49, 51, 57, + 59 + }; + + const short + parser::yypgoto_[] = + { + -219, -219, -219, 222, 232, -219, -219, -219, -219, -153, + -76, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -219, -219, -219, -219, -219, -219, -219, -219, -219, + -219, -97, -219, 58, -218, -219, -219, -219, -82, 72, + -219, -18, -15, -215, -35, -219, -219, -219, 26, 81, + -219, 116, -219, -219, -219, 167, 206, 212, 239, -219, + -219, 0, 5, -219, 2, -219, -219, 63, -219, 65, + -219, -219 + }; + + const short + parser::yydefgoto_[] = + { + 0, 4, 5, 6, 7, 8, 9, 10, 23, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 278, 321, 96, 209, 48, 49, 50, 51, 52, + 53, 54, 55, 168, 169, 170, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81 + }; + + const short + parser::yytable_[] = + { + 11, 1, 2, 97, 18, 11, 13, 133, 86, 90, + 166, 87, 91, 274, 83, 279, 22, 12, 24, 84, + 309, 29, 101, 102, 236, 14, 88, 88, 29, 19, + 21, 89, 89, 46, 85, 15, 249, -173, -173, 98, + -173, 125, 20, 127, 257, 310, 128, 141, 142, 129, + 210, 21, 3, -173, -166, -166, -173, -166, 82, 97, + 3, 88, 92, 130, -167, -167, 89, -167, 103, 131, + -166, 132, 135, -166, 12, 3, 137, 47, 129, 3, + -167, 12, 3, -167, 134, 120, 121, 122, 136, 318, + 227, 142, 228, -173, -173, 93, 230, 231, 99, 100, + 232, 333, 233, 245, 245, 161, 163, 210, 162, 164, + -166, -166, 234, 341, 235, 343, 240, 345, 279, 241, + -167, -167, 102, 88, 88, 242, 167, 273, 89, 89, + 171, 250, 219, 251, 29, 252, 221, 89, 283, 33, + 34, 35, 36, 284, 285, 287, 288, 85, 289, 290, + 308, 245, 140, 319, 320, 302, 304, 316, 212, 305, + 334, 335, 338, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 237, 347, 165, 349, 219, 219, 12, 3, 219, + 89, 89, 336, 220, 89, 222, 127, 223, 339, 128, + 225, 359, 360, 340, 211, 342, 344, -168, -168, 346, + -168, 212, 212, 213, 88, 212, 351, 352, 353, 89, + 356, 354, 357, -168, 210, 210, -168, 16, 127, 127, + 229, 128, 128, 219, 281, 325, 358, 17, 89, 348, + 0, 244, 238, 0, 239, 0, 88, 88, 214, 0, + 0, 89, 89, 210, 245, 210, 0, 167, 0, 212, + 0, 211, 127, -168, -168, 128, 213, 213, 105, 106, + 213, 0, 210, 210, 111, 112, 113, 114, 0, 0, + 88, 0, 0, 0, 0, 89, 0, 0, 0, 276, + 277, 0, 0, 282, 118, 119, 120, 121, 122, 215, + 0, 246, 247, 0, 0, 214, 219, 219, 0, 0, + 324, 89, 89, 0, 213, 0, 0, 0, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 0, + 303, 0, 212, 212, 0, 219, 219, 219, 216, 0, + 89, 89, 89, 0, 217, 312, 313, 314, 315, 280, + 0, 0, 215, 215, 219, 219, 215, 0, 0, 89, + 89, 212, 212, 212, 0, 0, 322, 323, 0, 0, + 0, 218, 0, 0, 123, 124, 0, 29, 211, 211, + 212, 212, 0, 0, 105, 106, 0, 213, 213, 0, + 125, 216, 216, 126, 0, 216, 350, 217, 217, 0, + 215, 217, 118, 119, 120, 121, 122, 211, 0, 211, + 118, 119, 120, 121, 122, 0, 213, 213, 213, 0, + 0, 0, 214, 214, 218, 218, 211, 211, 218, 0, + 12, 3, 0, 0, 0, 213, 213, 0, 0, 216, + 0, -169, -169, 0, -169, 217, 0, 0, 0, 0, + 0, 214, 280, 214, 0, 0, 25, -169, 0, 0, + -169, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 214, 214, 218, 215, 215, 26, 27, 28, 29, 30, + 31, 32, 0, 33, 34, 35, 36, 37, 0, 0, + 0, 94, 95, 0, 0, 39, 0, -169, -169, 0, + 0, 0, 215, 215, 215, 0, 0, 0, 0, 0, + 40, 41, 216, 216, 0, 0, 0, 0, 217, 217, + 0, 215, 215, 0, 0, 0, 0, 42, 0, 0, + 43, 12, 3, 21, 44, 45, 46, 0, 0, 0, + 0, 216, 216, 216, 0, 218, 218, 217, 217, 217, + 0, 0, 0, -170, -170, 0, -170, 0, 0, 0, + 216, 216, 0, 0, 0, 0, 217, 217, 0, -170, + -171, -171, -170, -171, 218, 218, 218, 25, 0, 0, + 0, 0, 0, 0, 0, 0, -171, 0, 0, -171, + 0, 0, 0, 218, 218, 0, 26, 27, 28, 29, + 30, 31, 32, 0, 33, 34, 35, 36, 37, -170, + -170, 0, 38, 0, 0, 0, 39, 0, 243, -172, + -172, 0, -172, 0, 0, 0, -171, -171, 0, 0, + 0, 40, 41, 0, 0, -172, 0, 0, -172, 25, + 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, + 0, 43, 12, 3, 21, 44, 45, 46, 26, 27, + 28, 29, 30, 31, 32, 0, 33, 34, 35, 36, + 37, 0, 0, 0, 38, -172, -172, 0, 39, 0, + 0, 0, 0, 0, 29, 0, 0, 0, 0, 33, + 34, 35, 36, 40, 41, 0, 0, 85, 0, 0, + 0, 25, 0, 0, 185, 186, 0, 0, 0, 0, + 42, 0, 0, 43, 12, 3, 21, 44, 45, 46, + 26, 27, 28, 29, 30, 31, 32, 0, 33, 34, + 35, 36, 37, 0, 0, 0, 94, 12, 3, 0, + 39, 0, 0, 0, 0, 0, 0, 0, 253, 254, + 0, 255, 256, 0, 0, 40, 41, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 123, 0, 0, 29, + 0, 0, 42, 0, 0, 43, 12, 3, 21, 44, + 45, 46, 125, 0, 0, 257, 0, 0, 0, 258, + 259, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 0, 0, 0, 0, 0, 0, + 0, 172, 12, 3, 173, 174, 0, 175, 176, 177, + 0, 178, 179, 180, 181, 182, 183, 26, 0, 0, + 29, 0, 0, 0, 0, 33, 34, 35, 36, 0, + 0, 132, 184, 85, 0, 0, 0, 0, 0, 172, + 185, 186, 173, 174, 0, 175, 176, 177, 0, 178, + 179, 180, 181, 182, 183, 26, 0, 0, 29, 0, + 0, 0, 0, 33, 34, 35, 36, 0, 0, 132, + 248, 85, 0, 12, 3, 0, 0, 172, 185, 186, + 173, 174, 0, 175, 176, 177, 0, 178, 179, 180, + 181, 182, 183, 26, 0, 0, 29, 0, 0, 0, + 0, 33, 34, 35, 36, 0, 0, 132, 0, 85, + 0, 12, 3, 0, 0, 0, 185, 186, 29, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 125, 0, 0, 257, 0, 0, 0, 258, 259, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, + 3, 0, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 138, 0, 0, 0, 0, 139, 0, + 0, 12, 3, 0, 0, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 115, 116, + 117, 118, 119, 120, 121, 122, 327, 0, 105, 106, + 0, 328, 109, 110, 111, 112, 113, 114, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 0, 0, + 0, 115, 116, 117, 118, 119, 120, 121, 122, 0, + 0, 115, 116, 117, 118, 119, 120, 121, 122, 329, + 0, 105, 106, 0, 330, 109, 110, 111, 112, 113, + 114, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 0, 0, 0, 0, 116, 117, 118, 119, 120, + 121, 122, 0, 0, 115, 116, 117, 118, 119, 120, + 121, 122, 331, 0, 0, 0, 0, 332, 0, 0, + 0, 0, 306, 0, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 0, 0, 0, 115, 116, 117, + 118, 119, 120, 121, 122, 307, 0, 115, 116, 117, + 118, 119, 120, 121, 122, 311, 0, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 317, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 326, 0, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 0, 0, 0, 115, 116, 117, 118, 119, 120, 121, + 122, 337, 0, 115, 116, 117, 118, 119, 120, 121, + 122, 355, 0, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 0, 0, 0, 115, 116, 117, 118, + 119, 120, 121, 122, 0, 0, 115, 116, 117, 118, + 119, 120, 121, 122, 224, 0, 0, 0, 0, 0, + 0, 0, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 115, 116, 117, 118, 119, + 120, 121, 122, 226, 0, 0, 0, 0, 0, 0, + 0, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 115, 116, 117, 118, 119, 120, + 121, 122, 271, 0, 0, 0, 0, 0, 0, 0, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 115, 116, 117, 118, 119, 120, 121, + 122, 272, 0, 0, 0, 0, 0, 0, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 104, 0, + 0, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 0, + 0, 0, 0, 0, 115, 116, 117, 118, 119, 120, + 121, 122, 275, 0, 0, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 286, 0, 0, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 0, 0, 0, 0, + 0, 115, 116, 117, 118, 119, 120, 121, 122, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 105, + 106, 0, 108, 109, 110, 111, 112, 113, 114, 0, + 0, 0, 115, 116, 117, 118, 119, 120, 121, 122, + 0, 0, 115, 116, 117, 118, 119, 120, 121, 122, + 105, 106, 0, 0, 109, 110, 111, 112, 113, 114, + 105, 106, 0, 0, 109, 110, 111, 112, 113, 114, + 0, 0, 0, 0, 0, 117, 118, 119, 120, 121, + 122, 0, 0, 0, 0, 0, 118, 119, 120, 121, + 122 + }; + + const short + parser::yycheck_[] = + { + 0, 3, 4, 38, 36, 5, 1, 83, 26, 27, + 31, 26, 27, 228, 37, 233, 14, 80, 18, 42, + 17, 27, 84, 85, 76, 36, 26, 27, 27, 61, + 82, 26, 27, 85, 40, 0, 189, 24, 25, 39, + 27, 40, 46, 61, 43, 42, 61, 41, 42, 36, + 132, 82, 81, 40, 24, 25, 43, 27, 37, 94, + 81, 61, 40, 44, 24, 25, 61, 27, 81, 46, + 40, 38, 40, 43, 80, 81, 40, 19, 36, 81, + 40, 80, 81, 43, 84, 77, 78, 79, 44, 304, + 37, 42, 36, 80, 81, 37, 46, 36, 40, 41, + 36, 316, 36, 185, 186, 123, 124, 189, 123, 124, + 80, 81, 36, 328, 36, 330, 45, 332, 336, 46, + 80, 81, 85, 123, 124, 46, 126, 41, 123, 124, + 130, 46, 132, 46, 27, 46, 136, 132, 45, 32, + 33, 34, 35, 45, 45, 36, 36, 40, 36, 36, + 46, 233, 94, 306, 307, 41, 36, 36, 132, 37, + 37, 13, 17, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 179, 335, 125, 337, 185, 186, 80, 81, 189, + 185, 186, 46, 135, 189, 137, 214, 139, 46, 214, + 142, 354, 355, 46, 132, 46, 46, 24, 25, 37, + 27, 185, 186, 132, 214, 189, 37, 37, 37, 214, + 46, 37, 46, 40, 306, 307, 43, 5, 246, 247, + 172, 246, 247, 233, 234, 311, 46, 5, 233, 336, + -1, 183, 179, -1, 179, -1, 246, 247, 132, -1, + -1, 246, 247, 335, 336, 337, -1, 257, -1, 233, + -1, 189, 280, 80, 81, 280, 185, 186, 49, 50, + 189, -1, 354, 355, 55, 56, 57, 58, -1, -1, + 280, -1, -1, -1, -1, 280, -1, -1, -1, 231, + 232, -1, -1, 235, 75, 76, 77, 78, 79, 132, + -1, 185, 186, -1, -1, 189, 306, 307, -1, -1, + 310, 306, 307, -1, 233, -1, -1, -1, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, -1, + 272, -1, 306, 307, -1, 335, 336, 337, 132, -1, + 335, 336, 337, -1, 132, 287, 288, 289, 290, 233, + -1, -1, 185, 186, 354, 355, 189, -1, -1, 354, + 355, 335, 336, 337, -1, -1, 308, 309, -1, -1, + -1, 132, -1, -1, 24, 25, -1, 27, 306, 307, + 354, 355, -1, -1, 49, 50, -1, 306, 307, -1, + 40, 185, 186, 43, -1, 189, 338, 185, 186, -1, + 233, 189, 75, 76, 77, 78, 79, 335, -1, 337, + 75, 76, 77, 78, 79, -1, 335, 336, 337, -1, + -1, -1, 306, 307, 185, 186, 354, 355, 189, -1, + 80, 81, -1, -1, -1, 354, 355, -1, -1, 233, + -1, 24, 25, -1, 27, 233, -1, -1, -1, -1, + -1, 335, 336, 337, -1, -1, 5, 40, -1, -1, + 43, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 354, 355, 233, 306, 307, 24, 25, 26, 27, 28, + 29, 30, -1, 32, 33, 34, 35, 36, -1, -1, + -1, 40, 41, -1, -1, 44, -1, 80, 81, -1, + -1, -1, 335, 336, 337, -1, -1, -1, -1, -1, + 59, 60, 306, 307, -1, -1, -1, -1, 306, 307, + -1, 354, 355, -1, -1, -1, -1, 76, -1, -1, + 79, 80, 81, 82, 83, 84, 85, -1, -1, -1, + -1, 335, 336, 337, -1, 306, 307, 335, 336, 337, + -1, -1, -1, 24, 25, -1, 27, -1, -1, -1, + 354, 355, -1, -1, -1, -1, 354, 355, -1, 40, + 24, 25, 43, 27, 335, 336, 337, 5, -1, -1, + -1, -1, -1, -1, -1, -1, 40, -1, -1, 43, + -1, -1, -1, 354, 355, -1, 24, 25, 26, 27, + 28, 29, 30, -1, 32, 33, 34, 35, 36, 80, + 81, -1, 40, -1, -1, -1, 44, -1, 46, 24, + 25, -1, 27, -1, -1, -1, 80, 81, -1, -1, + -1, 59, 60, -1, -1, 40, -1, -1, 43, 5, + -1, -1, -1, -1, -1, -1, -1, -1, 76, -1, + -1, 79, 80, 81, 82, 83, 84, 85, 24, 25, + 26, 27, 28, 29, 30, -1, 32, 33, 34, 35, + 36, -1, -1, -1, 40, 80, 81, -1, 44, -1, + -1, -1, -1, -1, 27, -1, -1, -1, -1, 32, + 33, 34, 35, 59, 60, -1, -1, 40, -1, -1, + -1, 5, -1, -1, 47, 48, -1, -1, -1, -1, + 76, -1, -1, 79, 80, 81, 82, 83, 84, 85, + 24, 25, 26, 27, 28, 29, 30, -1, 32, 33, + 34, 35, 36, -1, -1, -1, 40, 80, 81, -1, + 44, -1, -1, -1, -1, -1, -1, -1, 6, 7, + -1, 9, 10, -1, -1, 59, 60, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 24, -1, -1, 27, + -1, -1, 76, -1, -1, 79, 80, 81, 82, 83, + 84, 85, 40, -1, -1, 43, -1, -1, -1, 47, + 48, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, -1, -1, -1, -1, -1, -1, + -1, 8, 80, 81, 11, 12, -1, 14, 15, 16, + -1, 18, 19, 20, 21, 22, 23, 24, -1, -1, + 27, -1, -1, -1, -1, 32, 33, 34, 35, -1, + -1, 38, 39, 40, -1, -1, -1, -1, -1, 8, + 47, 48, 11, 12, -1, 14, 15, 16, -1, 18, + 19, 20, 21, 22, 23, 24, -1, -1, 27, -1, + -1, -1, -1, 32, 33, 34, 35, -1, -1, 38, + 39, 40, -1, 80, 81, -1, -1, 8, 47, 48, + 11, 12, -1, 14, 15, 16, -1, 18, 19, 20, + 21, 22, 23, 24, -1, -1, 27, -1, -1, -1, + -1, 32, 33, 34, 35, -1, -1, 38, -1, 40, + -1, 80, 81, -1, -1, -1, 47, 48, 27, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 40, -1, -1, 43, -1, -1, -1, 47, 48, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 80, + 81, -1, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 37, -1, -1, -1, -1, 42, -1, + -1, 80, 81, -1, -1, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 72, 73, + 74, 75, 76, 77, 78, 79, 37, -1, 49, 50, + -1, 42, 53, 54, 55, 56, 57, 58, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, -1, -1, + -1, 72, 73, 74, 75, 76, 77, 78, 79, -1, + -1, 72, 73, 74, 75, 76, 77, 78, 79, 37, + -1, 49, 50, -1, 42, 53, 54, 55, 56, 57, + 58, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, -1, -1, -1, -1, 73, 74, 75, 76, 77, + 78, 79, -1, -1, 72, 73, 74, 75, 76, 77, + 78, 79, 37, -1, -1, -1, -1, 42, -1, -1, + -1, -1, 37, -1, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, -1, -1, -1, 72, 73, 74, + 75, 76, 77, 78, 79, 37, -1, 72, 73, 74, + 75, 76, 77, 78, 79, 37, -1, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, -1, -1, -1, + 72, 73, 74, 75, 76, 77, 78, 79, 37, -1, + 72, 73, 74, 75, 76, 77, 78, 79, 37, -1, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + -1, -1, -1, 72, 73, 74, 75, 76, 77, 78, + 79, 37, -1, 72, 73, 74, 75, 76, 77, 78, + 79, 37, -1, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, -1, -1, -1, 72, 73, 74, 75, + 76, 77, 78, 79, -1, -1, 72, 73, 74, 75, + 76, 77, 78, 79, 41, -1, -1, -1, -1, -1, + -1, -1, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 72, 73, 74, 75, 76, + 77, 78, 79, 41, -1, -1, -1, -1, -1, -1, + -1, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 72, 73, 74, 75, 76, 77, + 78, 79, 41, -1, -1, -1, -1, -1, -1, -1, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 72, 73, 74, 75, 76, 77, 78, + 79, 42, -1, -1, -1, -1, -1, -1, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 46, -1, + -1, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 72, 73, 74, 75, 76, 77, 78, 79, -1, + -1, -1, -1, -1, 72, 73, 74, 75, 76, 77, + 78, 79, 46, -1, -1, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 46, -1, -1, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 72, 73, + 74, 75, 76, 77, 78, 79, -1, -1, -1, -1, + -1, 72, 73, 74, 75, 76, 77, 78, 79, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 49, + 50, -1, 52, 53, 54, 55, 56, 57, 58, -1, + -1, -1, 72, 73, 74, 75, 76, 77, 78, 79, + -1, -1, 72, 73, 74, 75, 76, 77, 78, 79, + 49, 50, -1, -1, 53, 54, 55, 56, 57, 58, + 49, 50, -1, -1, 53, 54, 55, 56, 57, 58, + -1, -1, -1, -1, -1, 74, 75, 76, 77, 78, + 79, -1, -1, -1, -1, -1, 75, 76, 77, 78, + 79 + }; + + const unsigned char + parser::yystos_[] = + { + 0, 3, 4, 81, 95, 96, 97, 98, 99, 100, + 101, 155, 80, 156, 36, 0, 97, 98, 36, 61, + 46, 82, 158, 102, 155, 5, 24, 25, 26, 27, + 28, 29, 30, 32, 33, 34, 35, 36, 40, 44, + 59, 60, 76, 79, 83, 84, 85, 127, 129, 130, + 131, 132, 133, 134, 135, 136, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 37, 37, 42, 40, 135, 136, 155, 156, + 135, 136, 40, 127, 40, 41, 127, 138, 155, 127, + 127, 84, 85, 81, 46, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 72, 73, 74, 75, 76, + 77, 78, 79, 24, 25, 40, 43, 135, 136, 36, + 44, 46, 38, 104, 155, 40, 44, 40, 37, 42, + 127, 41, 42, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 135, 136, 135, 136, 127, 31, 155, 137, 138, + 139, 155, 8, 11, 12, 14, 15, 16, 18, 19, + 20, 21, 22, 23, 39, 47, 48, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 128, + 132, 133, 142, 143, 145, 149, 150, 151, 152, 155, + 127, 155, 127, 127, 41, 127, 41, 37, 36, 127, + 46, 36, 36, 36, 36, 36, 76, 158, 161, 163, + 45, 46, 46, 46, 127, 132, 145, 145, 39, 103, + 46, 46, 46, 6, 7, 9, 10, 43, 47, 48, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 41, 42, 41, 137, 46, 127, 127, 125, 128, + 145, 155, 127, 45, 45, 45, 46, 36, 36, 36, + 36, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 41, 127, 36, 37, 37, 37, 46, 17, + 42, 37, 127, 127, 127, 127, 36, 37, 137, 103, + 103, 126, 127, 127, 155, 104, 37, 37, 42, 37, + 42, 37, 42, 137, 37, 13, 46, 37, 17, 46, + 46, 137, 46, 137, 46, 137, 37, 103, 125, 103, + 127, 37, 37, 37, 37, 37, 46, 46, 46, 103, + 103 + }; + + const unsigned char + parser::yyr1_[] = + { + 0, 94, 95, 95, 96, 96, 96, 96, 97, 98, + 98, 98, 99, 100, 101, 102, 102, 102, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 104, 104, + 105, 105, 106, 106, 107, 108, 109, 109, 110, 111, + 111, 112, 112, 113, 114, 115, 116, 117, 118, 118, + 119, 120, 120, 120, 121, 122, 123, 124, 124, 125, + 125, 126, 126, 127, 127, 127, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 129, 129, 129, 129, 129, 129, 129, 129, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 132, + 132, 132, 132, 133, 133, 133, 133, 134, 134, 134, + 134, 135, 135, 136, 136, 137, 137, 138, 138, 139, + 140, 140, 141, 142, 143, 144, 145, 145, 145, 145, + 145, 145, 145, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165 + }; + + const signed char + parser::yyr2_[] = + { + 0, 2, 1, 0, 2, 2, 1, 1, 3, 1, + 1, 1, 5, 4, 5, 3, 1, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, + 2, 1, 2, 2, 2, 6, 8, 6, 3, 8, + 6, 8, 6, 2, 5, 7, 5, 9, 7, 9, + 5, 3, 3, 3, 2, 2, 2, 3, 2, 1, + 0, 1, 0, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 2, 2, 2, 3, 3, 2, 2, 3, + 3, 4, 6, 8, 9, 1, 1, 3, 1, 0, + 2, 3, 3, 4, 3, 3, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, + 1, 2, 1, 1, 1, 1, 1, 7, 2, 2, + 1, 1, 1, 1 + }; + + + + +#if IW5DEBUG + const short + parser::yyrline_[] = + { + 0, 231, 231, 232, 236, 238, 240, 242, 247, 252, + 253, 254, 258, 263, 268, 273, 275, 278, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 305, 306, + 310, 312, 317, 319, 324, 329, 334, 336, 341, 346, + 348, 353, 355, 360, 365, 370, 375, 380, 385, 387, + 392, 397, 399, 401, 406, 411, 416, 421, 423, 428, + 429, 433, 434, 438, 439, 440, 444, 445, 446, 447, + 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 462, 463, 464, 465, 466, 467, 468, 469, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 519, + 520, 521, 522, 526, 527, 528, 529, 533, 534, 535, + 536, 540, 542, 547, 549, 554, 555, 559, 561, 567, + 571, 573, 578, 583, 588, 593, 598, 599, 600, 601, + 602, 603, 604, 605, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627 + }; + + void + parser::yy_stack_print_ () const + { + *yycdebug_ << "Stack now"; + for (stack_type::const_iterator + i = yystack_.begin (), + i_end = yystack_.end (); + i != i_end; ++i) + *yycdebug_ << ' ' << int (i->state); + *yycdebug_ << '\n'; + } + + void + parser::yy_reduce_print_ (int yyrule) const + { + int yylno = yyrline_[yyrule]; + int yynrhs = yyr2_[yyrule]; + // Print the symbols being reduced, and their result. + *yycdebug_ << "Reducing stack by rule " << yyrule - 1 + << " (line " << yylno << "):\n"; + // The symbols being reduced. + for (int yyi = 0; yyi < yynrhs; yyi++) + YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", + yystack_[(yynrhs) - (yyi + 1)]); + } +#endif // IW5DEBUG + + +#line 13 "parser.ypp" +} } } // xsk::gsc::iw5 +#line 3951 "parser.cpp" + +#line 629 "parser.ypp" + + +void xsk::gsc::iw5::parser::error(const xsk::gsc::location& loc, const std::string& msg) +{ + throw xsk::gsc::comp_error(loc, msg); +} diff --git a/src/iw5/xsk/parser.hpp b/src/iw5/xsk/parser.hpp new file mode 100644 index 00000000..9a339fb0 --- /dev/null +++ b/src/iw5/xsk/parser.hpp @@ -0,0 +1,4717 @@ +// A Bison parser, made by GNU Bison 3.7.5. + +// Skeleton interface for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. + +// 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 . + +// As a special exception, you may create a larger work that contains +// part or all of the Bison parser skeleton and distribute that work +// under terms of your choice, so long as that work isn't itself a +// parser generator using the skeleton or a modified version thereof +// as a parser skeleton. Alternatively, if you modify or redistribute +// the parser skeleton itself, you may (at your option) remove this +// special exception, which will cause the skeleton and the resulting +// Bison output files to be licensed under the GNU General Public +// License without this special exception. + +// This special exception was added by the Free Software Foundation in +// version 2.2 of Bison. + + +/** + ** \file parser.hpp + ** Define the xsk::gsc::iw5::parser class. + */ + +// C++ LALR(1) parser skeleton written by Akim Demaille. + +// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, +// especially those whose name start with YY_ or yy_. They are +// private implementation details that can be changed or removed. + +#ifndef YY_IW5_PARSER_HPP_INCLUDED +# define YY_IW5_PARSER_HPP_INCLUDED +// "%code requires" blocks. +#line 33 "parser.ypp" + +#include "iw5.hpp" +typedef void *yyscan_t; +#define YY_DECL xsk::gsc::iw5::parser::symbol_type IW5lex(yyscan_t yyscanner, xsk::gsc::location& loc) + +#line 55 "parser.hpp" + +# include +# include // std::abort +# include +# include +# include +# include + +#if defined __cplusplus +# define YY_CPLUSPLUS __cplusplus +#else +# define YY_CPLUSPLUS 199711L +#endif + +// Support move semantics when possible. +#if 201103L <= YY_CPLUSPLUS +# define YY_MOVE std::move +# define YY_MOVE_OR_COPY move +# define YY_MOVE_REF(Type) Type&& +# define YY_RVREF(Type) Type&& +# define YY_COPY(Type) Type +#else +# define YY_MOVE +# define YY_MOVE_OR_COPY copy +# define YY_MOVE_REF(Type) Type& +# define YY_RVREF(Type) const Type& +# define YY_COPY(Type) const Type& +#endif + +// Support noexcept when possible. +#if 201103L <= YY_CPLUSPLUS +# define YY_NOEXCEPT noexcept +# define YY_NOTHROW +#else +# define YY_NOEXCEPT +# define YY_NOTHROW throw () +#endif + +// Support constexpr when possible. +#if 201703 <= YY_CPLUSPLUS +# define YY_CONSTEXPR constexpr +#else +# define YY_CONSTEXPR +#endif + +#include +#ifndef IW5_ASSERT +# include +# define IW5_ASSERT assert +#endif + + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YY_USE(E) ((void) (E)) +#else +# define YY_USE(E) /* empty */ +#endif + +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +/* Debug traces. */ +#ifndef IW5DEBUG +# if defined YYDEBUG +#if YYDEBUG +# define IW5DEBUG 1 +# else +# define IW5DEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define IW5DEBUG 1 +# endif /* ! defined YYDEBUG */ +#endif /* ! defined IW5DEBUG */ + +#line 13 "parser.ypp" +namespace xsk { namespace gsc { namespace iw5 { +#line 198 "parser.hpp" + + + + + /// A Bison parser. + class parser + { + public: +#ifndef IW5STYPE + /// A buffer to store and retrieve objects. + /// + /// Sort of a variant, but does not keep track of the nature + /// of the stored data, since that knowledge is available + /// via the current parser state. + class semantic_type + { + public: + /// Type of *this. + typedef semantic_type self_type; + + /// Empty construction. + semantic_type () YY_NOEXCEPT + : yybuffer_ () + , yytypeid_ (YY_NULLPTR) + {} + + /// Construct and fill. + template + semantic_type (YY_RVREF (T) t) + : yytypeid_ (&typeid (T)) + { + IW5_ASSERT (sizeof (T) <= size); + new (yyas_ ()) T (YY_MOVE (t)); + } + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + semantic_type (const self_type&) = delete; + /// Non copyable. + self_type& operator= (const self_type&) = delete; +#endif + + /// Destruction, allowed only if empty. + ~semantic_type () YY_NOEXCEPT + { + IW5_ASSERT (!yytypeid_); + } + +# if 201103L <= YY_CPLUSPLUS + /// Instantiate a \a T in here from \a t. + template + T& + emplace (U&&... u) + { + IW5_ASSERT (!yytypeid_); + IW5_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (std::forward (u)...); + } +# else + /// Instantiate an empty \a T in here. + template + T& + emplace () + { + IW5_ASSERT (!yytypeid_); + IW5_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (); + } + + /// Instantiate a \a T in here from \a t. + template + T& + emplace (const T& t) + { + IW5_ASSERT (!yytypeid_); + IW5_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (t); + } +# endif + + /// Instantiate an empty \a T in here. + /// Obsolete, use emplace. + template + T& + build () + { + return emplace (); + } + + /// Instantiate a \a T in here from \a t. + /// Obsolete, use emplace. + template + T& + build (const T& t) + { + return emplace (t); + } + + /// Accessor to a built \a T. + template + T& + as () YY_NOEXCEPT + { + IW5_ASSERT (yytypeid_); + IW5_ASSERT (*yytypeid_ == typeid (T)); + IW5_ASSERT (sizeof (T) <= size); + return *yyas_ (); + } + + /// Const accessor to a built \a T (for %printer). + template + const T& + as () const YY_NOEXCEPT + { + IW5_ASSERT (yytypeid_); + IW5_ASSERT (*yytypeid_ == typeid (T)); + IW5_ASSERT (sizeof (T) <= size); + return *yyas_ (); + } + + /// Swap the content with \a that, of same type. + /// + /// Both variants must be built beforehand, because swapping the actual + /// data requires reading it (with as()), and this is not possible on + /// unconstructed variants: it would require some dynamic testing, which + /// should not be the variant's responsibility. + /// Swapping between built and (possibly) non-built is done with + /// self_type::move (). + template + void + swap (self_type& that) YY_NOEXCEPT + { + IW5_ASSERT (yytypeid_); + IW5_ASSERT (*yytypeid_ == *that.yytypeid_); + std::swap (as (), that.as ()); + } + + /// Move the content of \a that to this. + /// + /// Destroys \a that. + template + void + move (self_type& that) + { +# if 201103L <= YY_CPLUSPLUS + emplace (std::move (that.as ())); +# else + emplace (); + swap (that); +# endif + that.destroy (); + } + +# if 201103L <= YY_CPLUSPLUS + /// Move the content of \a that to this. + template + void + move (self_type&& that) + { + emplace (std::move (that.as ())); + that.destroy (); + } +#endif + + /// Copy the content of \a that to this. + template + void + copy (const self_type& that) + { + emplace (that.as ()); + } + + /// Destroy the stored \a T. + template + void + destroy () + { + as ().~T (); + yytypeid_ = YY_NULLPTR; + } + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + semantic_type (const self_type&); + /// Non copyable. + self_type& operator= (const self_type&); +#endif + + /// Accessor to raw memory as \a T. + template + T* + yyas_ () YY_NOEXCEPT + { + void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + /// Const accessor to raw memory as \a T. + template + const T* + yyas_ () const YY_NOEXCEPT + { + const void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + /// An auxiliary type to compute the largest semantic type. + union union_type + { + // anim + char dummy1[sizeof (anim_ptr)]; + + // animation + char dummy2[sizeof (animation_ptr)]; + + // animtree + char dummy3[sizeof (animtree_ptr)]; + + // constant + char dummy4[sizeof (constant_ptr)]; + + // define + char dummy5[sizeof (define_ptr)]; + + // empty_array + char dummy6[sizeof (empty_array_ptr)]; + + // expr_arguments + // expr_arguments_filled + // expr_arguments_empty + char dummy7[sizeof (expr_arguments_ptr)]; + + // expr_assign + char dummy8[sizeof (expr_assign_ptr)]; + + // expr_call + // expr_call_thread + // expr_call_childthread + char dummy9[sizeof (expr_call_ptr)]; + + // expr_call_function + // expr_call_pointer + char dummy10[sizeof (expr_call_type_ptr)]; + + // for_expr + // expr + // expr_compare + // expr_binary + // expr_primitive + char dummy11[sizeof (expr_ptr)]; + + // false + char dummy12[sizeof (false_ptr)]; + + // file + char dummy13[sizeof (file_ptr)]; + + // neg_float + // float + char dummy14[sizeof (float_ptr)]; + + // game + char dummy15[sizeof (game_ptr)]; + + // include + char dummy16[sizeof (include_ptr)]; + + // neg_integer + // integer + char dummy17[sizeof (integer_ptr)]; + + // istring + char dummy18[sizeof (istring_ptr)]; + + // level + char dummy19[sizeof (level_ptr)]; + + // name + char dummy20[sizeof (name_ptr)]; + + // expr_function + // expr_add_array + // expr_array + // expr_field + // expr_size + // object + char dummy21[sizeof (node_ptr)]; + + // parameters + char dummy22[sizeof (parameters_ptr)]; + + // program + char dummy23[sizeof (program_ptr)]; + + // self + char dummy24[sizeof (self_ptr)]; + + // "file path" + // "identifier" + // "string literal" + // "localized string" + // "float" + // "int" + char dummy25[sizeof (std::string)]; + + // stmt_assign + char dummy26[sizeof (stmt_assign_ptr)]; + + // stmt_break + char dummy27[sizeof (stmt_break_ptr)]; + + // stmt_call + char dummy28[sizeof (stmt_call_ptr)]; + + // stmt_case + char dummy29[sizeof (stmt_case_ptr)]; + + // stmt_continue + char dummy30[sizeof (stmt_continue_ptr)]; + + // stmt_default + char dummy31[sizeof (stmt_default_ptr)]; + + // stmt_endon + char dummy32[sizeof (stmt_endon_ptr)]; + + // stmt_for + char dummy33[sizeof (stmt_for_ptr)]; + + // stmt_foreach + char dummy34[sizeof (stmt_foreach_ptr)]; + + // stmt_if + char dummy35[sizeof (stmt_if_ptr)]; + + // stmt_ifelse + char dummy36[sizeof (stmt_ifelse_ptr)]; + + // stmt_block + // stmt_list + char dummy37[sizeof (stmt_list_ptr)]; + + // stmt_notify + char dummy38[sizeof (stmt_notify_ptr)]; + + // stmt + // for_stmt + char dummy39[sizeof (stmt_ptr)]; + + // stmt_return + char dummy40[sizeof (stmt_return_ptr)]; + + // stmt_switch + char dummy41[sizeof (stmt_switch_ptr)]; + + // stmt_wait + char dummy42[sizeof (stmt_wait_ptr)]; + + // stmt_waittill + char dummy43[sizeof (stmt_waittill_ptr)]; + + // stmt_waittillframeend + char dummy44[sizeof (stmt_waittillframeend_ptr)]; + + // stmt_waittillmatch + char dummy45[sizeof (stmt_waittillmatch_ptr)]; + + // stmt_while + char dummy46[sizeof (stmt_while_ptr)]; + + // string + char dummy47[sizeof (string_ptr)]; + + // thisthread + char dummy48[sizeof (thisthread_ptr)]; + + // thread + char dummy49[sizeof (thread_ptr)]; + + // true + char dummy50[sizeof (true_ptr)]; + + // undefined + char dummy51[sizeof (undefined_ptr)]; + + // usingtree + char dummy52[sizeof (usingtree_ptr)]; + + // vector + char dummy53[sizeof (vector_ptr)]; + }; + + /// The size of the largest semantic type. + enum { size = sizeof (union_type) }; + + /// A buffer to store semantic values. + union + { + /// Strongest alignment constraints. + long double yyalign_me; + /// A buffer large enough to store any of the semantic values. + char yyraw[size]; + } yybuffer_; + + /// Whether the content is built: if defined, the name of the stored type. + const std::type_info *yytypeid_; + }; + +#else + typedef IW5STYPE semantic_type; +#endif + /// Symbol locations. + typedef xsk::gsc::location location_type; + + /// Syntax errors thrown from user actions. + struct syntax_error : std::runtime_error + { + syntax_error (const location_type& l, const std::string& m) + : std::runtime_error (m) + , location (l) + {} + + syntax_error (const syntax_error& s) + : std::runtime_error (s.what ()) + , location (s.location) + {} + + ~syntax_error () YY_NOEXCEPT YY_NOTHROW; + + location_type location; + }; + + /// Token kinds. + struct token + { + enum token_kind_type + { + IW5EMPTY = -2, + IW5EOF = 0, // "end of file" + IW5error = 1, // error + IW5UNDEF = 2, // "invalid token" + INCLUDE = 3, // "#include" + USINGTREE = 4, // "#using_animtree" + ANIMTREE = 5, // "#animtree" + ENDON = 6, // "endon" + NOTIFY = 7, // "notify" + WAIT = 8, // "wait" + WAITTILL = 9, // "waittill" + WAITTILLMATCH = 10, // "waittillmatch" + WAITTILLFRAMEEND = 11, // "waittillframeend" + IF = 12, // "if" + ELSE = 13, // "else" + WHILE = 14, // "while" + FOR = 15, // "for" + FOREACH = 16, // "foreach" + IN = 17, // "in" + SWITCH = 18, // "switch" + CASE = 19, // "case" + DEFAULT = 20, // "default" + BREAK = 21, // "break" + CONTINUE = 22, // "continue" + RETURN = 23, // "return" + THREAD = 24, // "thread" + CHILDTHREAD = 25, // "childthread" + THISTHREAD = 26, // "thisthread" + CALL = 27, // "call" + TRUE = 28, // "true" + FALSE = 29, // "false" + UNDEFINED = 30, // "undefined" + SIZE = 31, // "size" + GAME = 32, // "game" + SELF = 33, // "self" + ANIM = 34, // "anim" + LEVEL = 35, // "level" + LPAREN = 36, // "(" + RPAREN = 37, // ")" + LBRACE = 38, // "{" + RBRACE = 39, // "}" + LBRACKET = 40, // "[" + RBRACKET = 41, // "]" + COMMA = 42, // "," + DOT = 43, // "." + DOUBLECOLON = 44, // "::" + COLON = 45, // ":" + SEMICOLON = 46, // ";" + INCREMENT = 47, // "++" + DECREMENT = 48, // "--" + LSHIFT = 49, // "<<" + RSHIFT = 50, // ">>" + OR = 51, // "||" + AND = 52, // "&&" + EQUALITY = 53, // "==" + INEQUALITY = 54, // "!=" + LESS_EQUAL = 55, // "<=" + GREATER_EQUAL = 56, // ">=" + LESS = 57, // "<" + GREATER = 58, // ">" + NOT = 59, // "!" + COMPLEMENT = 60, // "~" + ASSIGN = 61, // "=" + ASSIGN_ADD = 62, // "+=" + ASSIGN_SUB = 63, // "-=" + ASSIGN_MULT = 64, // "*=" + ASSIGN_DIV = 65, // "/=" + ASSIGN_MOD = 66, // "%=" + ASSIGN_BITWISE_OR = 67, // "|=" + ASSIGN_BITWISE_AND = 68, // "&=" + ASSIGN_BITWISE_EXOR = 69, // "^=" + ASSIGN_RSHIFT = 70, // ">>=" + ASSIGN_LSHIFT = 71, // "<<=" + BITWISE_OR = 72, // "|" + BITWISE_AND = 73, // "&" + BITWISE_EXOR = 74, // "^" + ADD = 75, // "+" + SUB = 76, // "-" + MULT = 77, // "*" + DIV = 78, // "/" + MOD = 79, // "%" + FILE = 80, // "file path" + NAME = 81, // "identifier" + STRING = 82, // "string literal" + ISTRING = 83, // "localized string" + FLOAT = 84, // "float" + INTEGER = 85, // "int" + ADD_ARRAY = 86, // ADD_ARRAY + THEN = 87, // THEN + NEG = 88, // NEG + ANIMREF = 89, // ANIMREF + PREINC = 90, // PREINC + PREDEC = 91, // PREDEC + POSTINC = 92, // POSTINC + POSTDEC = 93 // POSTDEC + }; + /// Backward compatibility alias (Bison 3.6). + typedef token_kind_type yytokentype; + }; + + /// Token kind, as returned by yylex. + typedef token::yytokentype token_kind_type; + + /// Backward compatibility alias (Bison 3.6). + typedef token_kind_type token_type; + + /// Symbol kinds. + struct symbol_kind + { + enum symbol_kind_type + { + YYNTOKENS = 94, ///< Number of tokens. + S_YYEMPTY = -2, + S_YYEOF = 0, // "end of file" + S_YYerror = 1, // error + S_YYUNDEF = 2, // "invalid token" + S_INCLUDE = 3, // "#include" + S_USINGTREE = 4, // "#using_animtree" + S_ANIMTREE = 5, // "#animtree" + S_ENDON = 6, // "endon" + S_NOTIFY = 7, // "notify" + S_WAIT = 8, // "wait" + S_WAITTILL = 9, // "waittill" + S_WAITTILLMATCH = 10, // "waittillmatch" + S_WAITTILLFRAMEEND = 11, // "waittillframeend" + S_IF = 12, // "if" + S_ELSE = 13, // "else" + S_WHILE = 14, // "while" + S_FOR = 15, // "for" + S_FOREACH = 16, // "foreach" + S_IN = 17, // "in" + S_SWITCH = 18, // "switch" + S_CASE = 19, // "case" + S_DEFAULT = 20, // "default" + S_BREAK = 21, // "break" + S_CONTINUE = 22, // "continue" + S_RETURN = 23, // "return" + S_THREAD = 24, // "thread" + S_CHILDTHREAD = 25, // "childthread" + S_THISTHREAD = 26, // "thisthread" + S_CALL = 27, // "call" + S_TRUE = 28, // "true" + S_FALSE = 29, // "false" + S_UNDEFINED = 30, // "undefined" + S_SIZE = 31, // "size" + S_GAME = 32, // "game" + S_SELF = 33, // "self" + S_ANIM = 34, // "anim" + S_LEVEL = 35, // "level" + S_LPAREN = 36, // "(" + S_RPAREN = 37, // ")" + S_LBRACE = 38, // "{" + S_RBRACE = 39, // "}" + S_LBRACKET = 40, // "[" + S_RBRACKET = 41, // "]" + S_COMMA = 42, // "," + S_DOT = 43, // "." + S_DOUBLECOLON = 44, // "::" + S_COLON = 45, // ":" + S_SEMICOLON = 46, // ";" + S_INCREMENT = 47, // "++" + S_DECREMENT = 48, // "--" + S_LSHIFT = 49, // "<<" + S_RSHIFT = 50, // ">>" + S_OR = 51, // "||" + S_AND = 52, // "&&" + S_EQUALITY = 53, // "==" + S_INEQUALITY = 54, // "!=" + S_LESS_EQUAL = 55, // "<=" + S_GREATER_EQUAL = 56, // ">=" + S_LESS = 57, // "<" + S_GREATER = 58, // ">" + S_NOT = 59, // "!" + S_COMPLEMENT = 60, // "~" + S_ASSIGN = 61, // "=" + S_ASSIGN_ADD = 62, // "+=" + S_ASSIGN_SUB = 63, // "-=" + S_ASSIGN_MULT = 64, // "*=" + S_ASSIGN_DIV = 65, // "/=" + S_ASSIGN_MOD = 66, // "%=" + S_ASSIGN_BITWISE_OR = 67, // "|=" + S_ASSIGN_BITWISE_AND = 68, // "&=" + S_ASSIGN_BITWISE_EXOR = 69, // "^=" + S_ASSIGN_RSHIFT = 70, // ">>=" + S_ASSIGN_LSHIFT = 71, // "<<=" + S_BITWISE_OR = 72, // "|" + S_BITWISE_AND = 73, // "&" + S_BITWISE_EXOR = 74, // "^" + S_ADD = 75, // "+" + S_SUB = 76, // "-" + S_MULT = 77, // "*" + S_DIV = 78, // "/" + S_MOD = 79, // "%" + S_FILE = 80, // "file path" + S_NAME = 81, // "identifier" + S_STRING = 82, // "string literal" + S_ISTRING = 83, // "localized string" + S_FLOAT = 84, // "float" + S_INTEGER = 85, // "int" + S_ADD_ARRAY = 86, // ADD_ARRAY + S_THEN = 87, // THEN + S_NEG = 88, // NEG + S_ANIMREF = 89, // ANIMREF + S_PREINC = 90, // PREINC + S_PREDEC = 91, // PREDEC + S_POSTINC = 92, // POSTINC + S_POSTDEC = 93, // POSTDEC + S_YYACCEPT = 94, // $accept + S_root = 95, // root + S_program = 96, // program + S_include = 97, // include + S_define = 98, // define + S_usingtree = 99, // usingtree + S_constant = 100, // constant + S_thread = 101, // thread + S_parameters = 102, // parameters + S_stmt = 103, // stmt + S_stmt_block = 104, // stmt_block + S_stmt_list = 105, // stmt_list + S_stmt_call = 106, // stmt_call + S_stmt_assign = 107, // stmt_assign + S_stmt_endon = 108, // stmt_endon + S_stmt_notify = 109, // stmt_notify + S_stmt_wait = 110, // stmt_wait + S_stmt_waittill = 111, // stmt_waittill + S_stmt_waittillmatch = 112, // stmt_waittillmatch + S_stmt_waittillframeend = 113, // stmt_waittillframeend + S_stmt_if = 114, // stmt_if + S_stmt_ifelse = 115, // stmt_ifelse + S_stmt_while = 116, // stmt_while + S_stmt_for = 117, // stmt_for + S_stmt_foreach = 118, // stmt_foreach + S_stmt_switch = 119, // stmt_switch + S_stmt_case = 120, // stmt_case + S_stmt_default = 121, // stmt_default + S_stmt_break = 122, // stmt_break + S_stmt_continue = 123, // stmt_continue + S_stmt_return = 124, // stmt_return + S_for_stmt = 125, // for_stmt + S_for_expr = 126, // for_expr + S_expr = 127, // expr + S_expr_assign = 128, // expr_assign + S_expr_compare = 129, // expr_compare + S_expr_binary = 130, // expr_binary + S_expr_primitive = 131, // expr_primitive + S_expr_call = 132, // expr_call + S_expr_call_thread = 133, // expr_call_thread + S_expr_call_childthread = 134, // expr_call_childthread + S_expr_call_function = 135, // expr_call_function + S_expr_call_pointer = 136, // expr_call_pointer + S_expr_arguments = 137, // expr_arguments + S_expr_arguments_filled = 138, // expr_arguments_filled + S_expr_arguments_empty = 139, // expr_arguments_empty + S_expr_function = 140, // expr_function + S_expr_add_array = 141, // expr_add_array + S_expr_array = 142, // expr_array + S_expr_field = 143, // expr_field + S_expr_size = 144, // expr_size + S_object = 145, // object + S_thisthread = 146, // thisthread + S_empty_array = 147, // empty_array + S_undefined = 148, // undefined + S_game = 149, // game + S_self = 150, // self + S_anim = 151, // anim + S_level = 152, // level + S_animation = 153, // animation + S_animtree = 154, // animtree + S_name = 155, // name + S_file = 156, // file + S_istring = 157, // istring + S_string = 158, // string + S_vector = 159, // vector + S_neg_float = 160, // neg_float + S_neg_integer = 161, // neg_integer + S_float = 162, // float + S_integer = 163, // integer + S_false = 164, // false + S_true = 165 // true + }; + }; + + /// (Internal) symbol kind. + typedef symbol_kind::symbol_kind_type symbol_kind_type; + + /// The number of tokens. + static const symbol_kind_type YYNTOKENS = symbol_kind::YYNTOKENS; + + /// A complete symbol. + /// + /// Expects its Base type to provide access to the symbol kind + /// via kind (). + /// + /// Provide access to semantic value and location. + template + struct basic_symbol : Base + { + /// Alias to Base. + typedef Base super_type; + + /// Default constructor. + basic_symbol () + : value () + , location () + {} + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + basic_symbol (basic_symbol&& that) + : Base (std::move (that)) + , value () + , location (std::move (that.location)) + { + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (std::move (that.value)); + break; + + default: + break; + } + + } +#endif + + /// Copy constructor. + basic_symbol (const basic_symbol& that); + + /// Constructors for typed symbols. +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, location_type&& l) + : Base (t) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const location_type& l) + : Base (t) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, anim_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const anim_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, animation_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const animation_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, animtree_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const animtree_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, constant_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const constant_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, define_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const define_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, empty_array_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const empty_array_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_arguments_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_arguments_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_assign_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_assign_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_call_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_call_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_call_type_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_call_type_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, false_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const false_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, file_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const file_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, float_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const float_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, game_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const game_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, include_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const include_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, integer_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const integer_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, istring_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const istring_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, level_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const level_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, name_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const name_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, node_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const node_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, parameters_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const parameters_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, program_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const program_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, self_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const self_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_assign_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_assign_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_break_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_break_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_call_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_call_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_case_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_case_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_continue_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_continue_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_default_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_default_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_endon_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_endon_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_for_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_for_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_foreach_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_foreach_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_if_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_if_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_ifelse_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_ifelse_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_list_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_list_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_notify_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_notify_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_return_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_return_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_switch_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_switch_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_wait_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_wait_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittill_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittill_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittillframeend_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittillframeend_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittillmatch_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittillmatch_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_while_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_while_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, string_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const string_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, thisthread_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const thisthread_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, thread_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const thread_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, true_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const true_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, undefined_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const undefined_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, usingtree_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const usingtree_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, vector_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const vector_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + + /// Destroy the symbol. + ~basic_symbol () + { + clear (); + } + + /// Destroy contents, and record that is empty. + void clear () YY_NOEXCEPT + { + // User destructor. + symbol_kind_type yykind = this->kind (); + basic_symbol& yysym = *this; + (void) yysym; + switch (yykind) + { + default: + break; + } + + // Value type destructor. +switch (yykind) + { + case symbol_kind::S_anim: // anim + value.template destroy< anim_ptr > (); + break; + + case symbol_kind::S_animation: // animation + value.template destroy< animation_ptr > (); + break; + + case symbol_kind::S_animtree: // animtree + value.template destroy< animtree_ptr > (); + break; + + case symbol_kind::S_constant: // constant + value.template destroy< constant_ptr > (); + break; + + case symbol_kind::S_define: // define + value.template destroy< define_ptr > (); + break; + + case symbol_kind::S_empty_array: // empty_array + value.template destroy< empty_array_ptr > (); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.template destroy< expr_arguments_ptr > (); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.template destroy< expr_assign_ptr > (); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.template destroy< expr_call_ptr > (); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.template destroy< expr_call_type_ptr > (); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.template destroy< expr_ptr > (); + break; + + case symbol_kind::S_false: // false + value.template destroy< false_ptr > (); + break; + + case symbol_kind::S_file: // file + value.template destroy< file_ptr > (); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.template destroy< float_ptr > (); + break; + + case symbol_kind::S_game: // game + value.template destroy< game_ptr > (); + break; + + case symbol_kind::S_include: // include + value.template destroy< include_ptr > (); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.template destroy< integer_ptr > (); + break; + + case symbol_kind::S_istring: // istring + value.template destroy< istring_ptr > (); + break; + + case symbol_kind::S_level: // level + value.template destroy< level_ptr > (); + break; + + case symbol_kind::S_name: // name + value.template destroy< name_ptr > (); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.template destroy< node_ptr > (); + break; + + case symbol_kind::S_parameters: // parameters + value.template destroy< parameters_ptr > (); + break; + + case symbol_kind::S_program: // program + value.template destroy< program_ptr > (); + break; + + case symbol_kind::S_self: // self + value.template destroy< self_ptr > (); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.template destroy< std::string > (); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.template destroy< stmt_assign_ptr > (); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.template destroy< stmt_break_ptr > (); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.template destroy< stmt_call_ptr > (); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.template destroy< stmt_case_ptr > (); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.template destroy< stmt_continue_ptr > (); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.template destroy< stmt_default_ptr > (); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.template destroy< stmt_endon_ptr > (); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.template destroy< stmt_for_ptr > (); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.template destroy< stmt_foreach_ptr > (); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.template destroy< stmt_if_ptr > (); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.template destroy< stmt_ifelse_ptr > (); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.template destroy< stmt_list_ptr > (); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.template destroy< stmt_notify_ptr > (); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.template destroy< stmt_ptr > (); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.template destroy< stmt_return_ptr > (); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.template destroy< stmt_switch_ptr > (); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.template destroy< stmt_wait_ptr > (); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.template destroy< stmt_waittill_ptr > (); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.template destroy< stmt_waittillframeend_ptr > (); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.template destroy< stmt_waittillmatch_ptr > (); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.template destroy< stmt_while_ptr > (); + break; + + case symbol_kind::S_string: // string + value.template destroy< string_ptr > (); + break; + + case symbol_kind::S_thisthread: // thisthread + value.template destroy< thisthread_ptr > (); + break; + + case symbol_kind::S_thread: // thread + value.template destroy< thread_ptr > (); + break; + + case symbol_kind::S_true: // true + value.template destroy< true_ptr > (); + break; + + case symbol_kind::S_undefined: // undefined + value.template destroy< undefined_ptr > (); + break; + + case symbol_kind::S_usingtree: // usingtree + value.template destroy< usingtree_ptr > (); + break; + + case symbol_kind::S_vector: // vector + value.template destroy< vector_ptr > (); + break; + + default: + break; + } + + Base::clear (); + } + + /// The user-facing name of this symbol. + const char *name () const YY_NOEXCEPT + { + return parser::symbol_name (this->kind ()); + } + + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; + + /// Whether empty. + bool empty () const YY_NOEXCEPT; + + /// Destructive move, \a s is emptied into this. + void move (basic_symbol& s); + + /// The semantic value. + semantic_type value; + + /// The location. + location_type location; + + private: +#if YY_CPLUSPLUS < 201103L + /// Assignment operator. + basic_symbol& operator= (const basic_symbol& that); +#endif + }; + + /// Type access provider for token (enum) based symbols. + struct by_kind + { + /// Default constructor. + by_kind (); + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + by_kind (by_kind&& that); +#endif + + /// Copy constructor. + by_kind (const by_kind& that); + + /// The symbol kind as needed by the constructor. + typedef token_kind_type kind_type; + + /// Constructor from (external) token numbers. + by_kind (kind_type t); + + /// Record that this symbol is empty. + void clear () YY_NOEXCEPT; + + /// Steal the symbol kind from \a that. + void move (by_kind& that); + + /// The (internal) type number (corresponding to \a type). + /// \a empty when empty. + symbol_kind_type kind () const YY_NOEXCEPT; + + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; + + /// The symbol kind. + /// \a S_YYEMPTY when empty. + symbol_kind_type kind_; + }; + + /// Backward compatibility for a private implementation detail (Bison 3.6). + typedef by_kind by_type; + + /// "External" symbols: returned by the scanner. + struct symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + + /// Empty symbol. + symbol_type () {} + + /// Constructor for valueless symbols, and symbols from each type. +#if 201103L <= YY_CPLUSPLUS + symbol_type (int tok, location_type l) + : super_type(token_type (tok), std::move (l)) +#else + symbol_type (int tok, const location_type& l) + : super_type(token_type (tok), l) +#endif + { + IW5_ASSERT (tok == token::IW5EOF + || (token::IW5error <= tok && tok <= token::MOD) + || (token::ADD_ARRAY <= tok && tok <= token::POSTDEC)); + } +#if 201103L <= YY_CPLUSPLUS + symbol_type (int tok, std::string v, location_type l) + : super_type(token_type (tok), std::move (v), std::move (l)) +#else + symbol_type (int tok, const std::string& v, const location_type& l) + : super_type(token_type (tok), v, l) +#endif + { + IW5_ASSERT ((token::FILE <= tok && tok <= token::INTEGER)); + } + }; + + /// Build a parser object. + parser (yyscan_t yyscanner_yyarg, xsk::gsc::location& loc_yyarg, xsk::gsc::program_ptr& ast_yyarg); + virtual ~parser (); + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + parser (const parser&) = delete; + /// Non copyable. + parser& operator= (const parser&) = delete; +#endif + + /// Parse. An alias for parse (). + /// \returns 0 iff parsing succeeded. + int operator() (); + + /// Parse. + /// \returns 0 iff parsing succeeded. + virtual int parse (); + +#if IW5DEBUG + /// The current debugging stream. + std::ostream& debug_stream () const YY_ATTRIBUTE_PURE; + /// Set the current debugging stream. + void set_debug_stream (std::ostream &); + + /// Type for debugging levels. + typedef int debug_level_type; + /// The current debugging level. + debug_level_type debug_level () const YY_ATTRIBUTE_PURE; + /// Set the current debugging level. + void set_debug_level (debug_level_type l); +#endif + + /// Report a syntax error. + /// \param loc where the syntax error is found. + /// \param msg a description of the syntax error. + virtual void error (const location_type& loc, const std::string& msg); + + /// Report a syntax error. + void error (const syntax_error& err); + + /// The user-facing name of the symbol whose (internal) number is + /// YYSYMBOL. No bounds checking. + static const char *symbol_name (symbol_kind_type yysymbol); + + // Implementation of make_symbol for each symbol type. +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IW5EOF (location_type l) + { + return symbol_type (token::IW5EOF, std::move (l)); + } +#else + static + symbol_type + make_IW5EOF (const location_type& l) + { + return symbol_type (token::IW5EOF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IW5error (location_type l) + { + return symbol_type (token::IW5error, std::move (l)); + } +#else + static + symbol_type + make_IW5error (const location_type& l) + { + return symbol_type (token::IW5error, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IW5UNDEF (location_type l) + { + return symbol_type (token::IW5UNDEF, std::move (l)); + } +#else + static + symbol_type + make_IW5UNDEF (const location_type& l) + { + return symbol_type (token::IW5UNDEF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INCLUDE (location_type l) + { + return symbol_type (token::INCLUDE, std::move (l)); + } +#else + static + symbol_type + make_INCLUDE (const location_type& l) + { + return symbol_type (token::INCLUDE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_USINGTREE (location_type l) + { + return symbol_type (token::USINGTREE, std::move (l)); + } +#else + static + symbol_type + make_USINGTREE (const location_type& l) + { + return symbol_type (token::USINGTREE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIMTREE (location_type l) + { + return symbol_type (token::ANIMTREE, std::move (l)); + } +#else + static + symbol_type + make_ANIMTREE (const location_type& l) + { + return symbol_type (token::ANIMTREE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ENDON (location_type l) + { + return symbol_type (token::ENDON, std::move (l)); + } +#else + static + symbol_type + make_ENDON (const location_type& l) + { + return symbol_type (token::ENDON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NOTIFY (location_type l) + { + return symbol_type (token::NOTIFY, std::move (l)); + } +#else + static + symbol_type + make_NOTIFY (const location_type& l) + { + return symbol_type (token::NOTIFY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAIT (location_type l) + { + return symbol_type (token::WAIT, std::move (l)); + } +#else + static + symbol_type + make_WAIT (const location_type& l) + { + return symbol_type (token::WAIT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILL (location_type l) + { + return symbol_type (token::WAITTILL, std::move (l)); + } +#else + static + symbol_type + make_WAITTILL (const location_type& l) + { + return symbol_type (token::WAITTILL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILLMATCH (location_type l) + { + return symbol_type (token::WAITTILLMATCH, std::move (l)); + } +#else + static + symbol_type + make_WAITTILLMATCH (const location_type& l) + { + return symbol_type (token::WAITTILLMATCH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILLFRAMEEND (location_type l) + { + return symbol_type (token::WAITTILLFRAMEEND, std::move (l)); + } +#else + static + symbol_type + make_WAITTILLFRAMEEND (const location_type& l) + { + return symbol_type (token::WAITTILLFRAMEEND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IF (location_type l) + { + return symbol_type (token::IF, std::move (l)); + } +#else + static + symbol_type + make_IF (const location_type& l) + { + return symbol_type (token::IF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ELSE (location_type l) + { + return symbol_type (token::ELSE, std::move (l)); + } +#else + static + symbol_type + make_ELSE (const location_type& l) + { + return symbol_type (token::ELSE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WHILE (location_type l) + { + return symbol_type (token::WHILE, std::move (l)); + } +#else + static + symbol_type + make_WHILE (const location_type& l) + { + return symbol_type (token::WHILE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FOR (location_type l) + { + return symbol_type (token::FOR, std::move (l)); + } +#else + static + symbol_type + make_FOR (const location_type& l) + { + return symbol_type (token::FOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FOREACH (location_type l) + { + return symbol_type (token::FOREACH, std::move (l)); + } +#else + static + symbol_type + make_FOREACH (const location_type& l) + { + return symbol_type (token::FOREACH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IN (location_type l) + { + return symbol_type (token::IN, std::move (l)); + } +#else + static + symbol_type + make_IN (const location_type& l) + { + return symbol_type (token::IN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SWITCH (location_type l) + { + return symbol_type (token::SWITCH, std::move (l)); + } +#else + static + symbol_type + make_SWITCH (const location_type& l) + { + return symbol_type (token::SWITCH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CASE (location_type l) + { + return symbol_type (token::CASE, std::move (l)); + } +#else + static + symbol_type + make_CASE (const location_type& l) + { + return symbol_type (token::CASE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DEFAULT (location_type l) + { + return symbol_type (token::DEFAULT, std::move (l)); + } +#else + static + symbol_type + make_DEFAULT (const location_type& l) + { + return symbol_type (token::DEFAULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BREAK (location_type l) + { + return symbol_type (token::BREAK, std::move (l)); + } +#else + static + symbol_type + make_BREAK (const location_type& l) + { + return symbol_type (token::BREAK, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CONTINUE (location_type l) + { + return symbol_type (token::CONTINUE, std::move (l)); + } +#else + static + symbol_type + make_CONTINUE (const location_type& l) + { + return symbol_type (token::CONTINUE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RETURN (location_type l) + { + return symbol_type (token::RETURN, std::move (l)); + } +#else + static + symbol_type + make_RETURN (const location_type& l) + { + return symbol_type (token::RETURN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THREAD (location_type l) + { + return symbol_type (token::THREAD, std::move (l)); + } +#else + static + symbol_type + make_THREAD (const location_type& l) + { + return symbol_type (token::THREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CHILDTHREAD (location_type l) + { + return symbol_type (token::CHILDTHREAD, std::move (l)); + } +#else + static + symbol_type + make_CHILDTHREAD (const location_type& l) + { + return symbol_type (token::CHILDTHREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THISTHREAD (location_type l) + { + return symbol_type (token::THISTHREAD, std::move (l)); + } +#else + static + symbol_type + make_THISTHREAD (const location_type& l) + { + return symbol_type (token::THISTHREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CALL (location_type l) + { + return symbol_type (token::CALL, std::move (l)); + } +#else + static + symbol_type + make_CALL (const location_type& l) + { + return symbol_type (token::CALL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_TRUE (location_type l) + { + return symbol_type (token::TRUE, std::move (l)); + } +#else + static + symbol_type + make_TRUE (const location_type& l) + { + return symbol_type (token::TRUE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FALSE (location_type l) + { + return symbol_type (token::FALSE, std::move (l)); + } +#else + static + symbol_type + make_FALSE (const location_type& l) + { + return symbol_type (token::FALSE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_UNDEFINED (location_type l) + { + return symbol_type (token::UNDEFINED, std::move (l)); + } +#else + static + symbol_type + make_UNDEFINED (const location_type& l) + { + return symbol_type (token::UNDEFINED, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SIZE (location_type l) + { + return symbol_type (token::SIZE, std::move (l)); + } +#else + static + symbol_type + make_SIZE (const location_type& l) + { + return symbol_type (token::SIZE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GAME (location_type l) + { + return symbol_type (token::GAME, std::move (l)); + } +#else + static + symbol_type + make_GAME (const location_type& l) + { + return symbol_type (token::GAME, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SELF (location_type l) + { + return symbol_type (token::SELF, std::move (l)); + } +#else + static + symbol_type + make_SELF (const location_type& l) + { + return symbol_type (token::SELF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIM (location_type l) + { + return symbol_type (token::ANIM, std::move (l)); + } +#else + static + symbol_type + make_ANIM (const location_type& l) + { + return symbol_type (token::ANIM, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LEVEL (location_type l) + { + return symbol_type (token::LEVEL, std::move (l)); + } +#else + static + symbol_type + make_LEVEL (const location_type& l) + { + return symbol_type (token::LEVEL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LPAREN (location_type l) + { + return symbol_type (token::LPAREN, std::move (l)); + } +#else + static + symbol_type + make_LPAREN (const location_type& l) + { + return symbol_type (token::LPAREN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RPAREN (location_type l) + { + return symbol_type (token::RPAREN, std::move (l)); + } +#else + static + symbol_type + make_RPAREN (const location_type& l) + { + return symbol_type (token::RPAREN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LBRACE (location_type l) + { + return symbol_type (token::LBRACE, std::move (l)); + } +#else + static + symbol_type + make_LBRACE (const location_type& l) + { + return symbol_type (token::LBRACE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RBRACE (location_type l) + { + return symbol_type (token::RBRACE, std::move (l)); + } +#else + static + symbol_type + make_RBRACE (const location_type& l) + { + return symbol_type (token::RBRACE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LBRACKET (location_type l) + { + return symbol_type (token::LBRACKET, std::move (l)); + } +#else + static + symbol_type + make_LBRACKET (const location_type& l) + { + return symbol_type (token::LBRACKET, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RBRACKET (location_type l) + { + return symbol_type (token::RBRACKET, std::move (l)); + } +#else + static + symbol_type + make_RBRACKET (const location_type& l) + { + return symbol_type (token::RBRACKET, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COMMA (location_type l) + { + return symbol_type (token::COMMA, std::move (l)); + } +#else + static + symbol_type + make_COMMA (const location_type& l) + { + return symbol_type (token::COMMA, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DOT (location_type l) + { + return symbol_type (token::DOT, std::move (l)); + } +#else + static + symbol_type + make_DOT (const location_type& l) + { + return symbol_type (token::DOT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DOUBLECOLON (location_type l) + { + return symbol_type (token::DOUBLECOLON, std::move (l)); + } +#else + static + symbol_type + make_DOUBLECOLON (const location_type& l) + { + return symbol_type (token::DOUBLECOLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COLON (location_type l) + { + return symbol_type (token::COLON, std::move (l)); + } +#else + static + symbol_type + make_COLON (const location_type& l) + { + return symbol_type (token::COLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SEMICOLON (location_type l) + { + return symbol_type (token::SEMICOLON, std::move (l)); + } +#else + static + symbol_type + make_SEMICOLON (const location_type& l) + { + return symbol_type (token::SEMICOLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INCREMENT (location_type l) + { + return symbol_type (token::INCREMENT, std::move (l)); + } +#else + static + symbol_type + make_INCREMENT (const location_type& l) + { + return symbol_type (token::INCREMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DECREMENT (location_type l) + { + return symbol_type (token::DECREMENT, std::move (l)); + } +#else + static + symbol_type + make_DECREMENT (const location_type& l) + { + return symbol_type (token::DECREMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LSHIFT (location_type l) + { + return symbol_type (token::LSHIFT, std::move (l)); + } +#else + static + symbol_type + make_LSHIFT (const location_type& l) + { + return symbol_type (token::LSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RSHIFT (location_type l) + { + return symbol_type (token::RSHIFT, std::move (l)); + } +#else + static + symbol_type + make_RSHIFT (const location_type& l) + { + return symbol_type (token::RSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_OR (location_type l) + { + return symbol_type (token::OR, std::move (l)); + } +#else + static + symbol_type + make_OR (const location_type& l) + { + return symbol_type (token::OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_AND (location_type l) + { + return symbol_type (token::AND, std::move (l)); + } +#else + static + symbol_type + make_AND (const location_type& l) + { + return symbol_type (token::AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_EQUALITY (location_type l) + { + return symbol_type (token::EQUALITY, std::move (l)); + } +#else + static + symbol_type + make_EQUALITY (const location_type& l) + { + return symbol_type (token::EQUALITY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INEQUALITY (location_type l) + { + return symbol_type (token::INEQUALITY, std::move (l)); + } +#else + static + symbol_type + make_INEQUALITY (const location_type& l) + { + return symbol_type (token::INEQUALITY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LESS_EQUAL (location_type l) + { + return symbol_type (token::LESS_EQUAL, std::move (l)); + } +#else + static + symbol_type + make_LESS_EQUAL (const location_type& l) + { + return symbol_type (token::LESS_EQUAL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GREATER_EQUAL (location_type l) + { + return symbol_type (token::GREATER_EQUAL, std::move (l)); + } +#else + static + symbol_type + make_GREATER_EQUAL (const location_type& l) + { + return symbol_type (token::GREATER_EQUAL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LESS (location_type l) + { + return symbol_type (token::LESS, std::move (l)); + } +#else + static + symbol_type + make_LESS (const location_type& l) + { + return symbol_type (token::LESS, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GREATER (location_type l) + { + return symbol_type (token::GREATER, std::move (l)); + } +#else + static + symbol_type + make_GREATER (const location_type& l) + { + return symbol_type (token::GREATER, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NOT (location_type l) + { + return symbol_type (token::NOT, std::move (l)); + } +#else + static + symbol_type + make_NOT (const location_type& l) + { + return symbol_type (token::NOT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COMPLEMENT (location_type l) + { + return symbol_type (token::COMPLEMENT, std::move (l)); + } +#else + static + symbol_type + make_COMPLEMENT (const location_type& l) + { + return symbol_type (token::COMPLEMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN (location_type l) + { + return symbol_type (token::ASSIGN, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN (const location_type& l) + { + return symbol_type (token::ASSIGN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_ADD (location_type l) + { + return symbol_type (token::ASSIGN_ADD, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_ADD (const location_type& l) + { + return symbol_type (token::ASSIGN_ADD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_SUB (location_type l) + { + return symbol_type (token::ASSIGN_SUB, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_SUB (const location_type& l) + { + return symbol_type (token::ASSIGN_SUB, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_MULT (location_type l) + { + return symbol_type (token::ASSIGN_MULT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_MULT (const location_type& l) + { + return symbol_type (token::ASSIGN_MULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_DIV (location_type l) + { + return symbol_type (token::ASSIGN_DIV, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_DIV (const location_type& l) + { + return symbol_type (token::ASSIGN_DIV, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_MOD (location_type l) + { + return symbol_type (token::ASSIGN_MOD, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_MOD (const location_type& l) + { + return symbol_type (token::ASSIGN_MOD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_OR (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_OR, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_OR (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_AND (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_AND, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_AND (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_EXOR (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_EXOR, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_EXOR (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_EXOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_RSHIFT (location_type l) + { + return symbol_type (token::ASSIGN_RSHIFT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_RSHIFT (const location_type& l) + { + return symbol_type (token::ASSIGN_RSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_LSHIFT (location_type l) + { + return symbol_type (token::ASSIGN_LSHIFT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_LSHIFT (const location_type& l) + { + return symbol_type (token::ASSIGN_LSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_OR (location_type l) + { + return symbol_type (token::BITWISE_OR, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_OR (const location_type& l) + { + return symbol_type (token::BITWISE_OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_AND (location_type l) + { + return symbol_type (token::BITWISE_AND, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_AND (const location_type& l) + { + return symbol_type (token::BITWISE_AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_EXOR (location_type l) + { + return symbol_type (token::BITWISE_EXOR, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_EXOR (const location_type& l) + { + return symbol_type (token::BITWISE_EXOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ADD (location_type l) + { + return symbol_type (token::ADD, std::move (l)); + } +#else + static + symbol_type + make_ADD (const location_type& l) + { + return symbol_type (token::ADD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SUB (location_type l) + { + return symbol_type (token::SUB, std::move (l)); + } +#else + static + symbol_type + make_SUB (const location_type& l) + { + return symbol_type (token::SUB, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_MULT (location_type l) + { + return symbol_type (token::MULT, std::move (l)); + } +#else + static + symbol_type + make_MULT (const location_type& l) + { + return symbol_type (token::MULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DIV (location_type l) + { + return symbol_type (token::DIV, std::move (l)); + } +#else + static + symbol_type + make_DIV (const location_type& l) + { + return symbol_type (token::DIV, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_MOD (location_type l) + { + return symbol_type (token::MOD, std::move (l)); + } +#else + static + symbol_type + make_MOD (const location_type& l) + { + return symbol_type (token::MOD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FILE (std::string v, location_type l) + { + return symbol_type (token::FILE, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_FILE (const std::string& v, const location_type& l) + { + return symbol_type (token::FILE, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NAME (std::string v, location_type l) + { + return symbol_type (token::NAME, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_NAME (const std::string& v, const location_type& l) + { + return symbol_type (token::NAME, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_STRING (std::string v, location_type l) + { + return symbol_type (token::STRING, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_STRING (const std::string& v, const location_type& l) + { + return symbol_type (token::STRING, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ISTRING (std::string v, location_type l) + { + return symbol_type (token::ISTRING, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_ISTRING (const std::string& v, const location_type& l) + { + return symbol_type (token::ISTRING, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FLOAT (std::string v, location_type l) + { + return symbol_type (token::FLOAT, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_FLOAT (const std::string& v, const location_type& l) + { + return symbol_type (token::FLOAT, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INTEGER (std::string v, location_type l) + { + return symbol_type (token::INTEGER, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_INTEGER (const std::string& v, const location_type& l) + { + return symbol_type (token::INTEGER, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ADD_ARRAY (location_type l) + { + return symbol_type (token::ADD_ARRAY, std::move (l)); + } +#else + static + symbol_type + make_ADD_ARRAY (const location_type& l) + { + return symbol_type (token::ADD_ARRAY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THEN (location_type l) + { + return symbol_type (token::THEN, std::move (l)); + } +#else + static + symbol_type + make_THEN (const location_type& l) + { + return symbol_type (token::THEN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NEG (location_type l) + { + return symbol_type (token::NEG, std::move (l)); + } +#else + static + symbol_type + make_NEG (const location_type& l) + { + return symbol_type (token::NEG, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIMREF (location_type l) + { + return symbol_type (token::ANIMREF, std::move (l)); + } +#else + static + symbol_type + make_ANIMREF (const location_type& l) + { + return symbol_type (token::ANIMREF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_PREINC (location_type l) + { + return symbol_type (token::PREINC, std::move (l)); + } +#else + static + symbol_type + make_PREINC (const location_type& l) + { + return symbol_type (token::PREINC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_PREDEC (location_type l) + { + return symbol_type (token::PREDEC, std::move (l)); + } +#else + static + symbol_type + make_PREDEC (const location_type& l) + { + return symbol_type (token::PREDEC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_POSTINC (location_type l) + { + return symbol_type (token::POSTINC, std::move (l)); + } +#else + static + symbol_type + make_POSTINC (const location_type& l) + { + return symbol_type (token::POSTINC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_POSTDEC (location_type l) + { + return symbol_type (token::POSTDEC, std::move (l)); + } +#else + static + symbol_type + make_POSTDEC (const location_type& l) + { + return symbol_type (token::POSTDEC, l); + } +#endif + + + class context + { + public: + context (const parser& yyparser, const symbol_type& yyla); + const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; } + symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); } + const location_type& location () const YY_NOEXCEPT { return yyla_.location; } + + /// Put in YYARG at most YYARGN of the expected tokens, and return the + /// number of tokens stored in YYARG. If YYARG is null, return the + /// number of expected tokens (guaranteed to be less than YYNTOKENS). + int expected_tokens (symbol_kind_type yyarg[], int yyargn) const; + + private: + const parser& yyparser_; + const symbol_type& yyla_; + }; + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + parser (const parser&); + /// Non copyable. + parser& operator= (const parser&); +#endif + + /// Check the lookahead yytoken. + /// \returns true iff the token will be eventually shifted. + bool yy_lac_check_ (symbol_kind_type yytoken) const; + /// Establish the initial context if no initial context currently exists. + /// \returns true iff the token will be eventually shifted. + bool yy_lac_establish_ (symbol_kind_type yytoken); + /// Discard any previous initial lookahead context because of event. + /// \param event the event which caused the lookahead to be discarded. + /// Only used for debbuging output. + void yy_lac_discard_ (const char* event); + + /// Stored state numbers (used for stacks). + typedef short state_type; + + /// The arguments of the error message. + int yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const; + + /// Generate an error message. + /// \param yyctx the context in which the error occurred. + virtual std::string yysyntax_error_ (const context& yyctx) const; + /// Compute post-reduction state. + /// \param yystate the current state + /// \param yysym the nonterminal to push on the stack + static state_type yy_lr_goto_state_ (state_type yystate, int yysym); + + /// Whether the given \c yypact_ value indicates a defaulted state. + /// \param yyvalue the value to check + static bool yy_pact_value_is_default_ (int yyvalue); + + /// Whether the given \c yytable_ value indicates a syntax error. + /// \param yyvalue the value to check + static bool yy_table_value_is_error_ (int yyvalue); + + static const short yypact_ninf_; + static const short yytable_ninf_; + + /// Convert a scanner token kind \a t to a symbol kind. + /// In theory \a t should be a token_kind_type, but character literals + /// are valid, yet not members of the token_type enum. + static symbol_kind_type yytranslate_ (int t); + + + + // Tables. + // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + // STATE-NUM. + static const short yypact_[]; + + // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + // Performed when YYTABLE does not specify something else to do. Zero + // means the default is an error. + static const unsigned char yydefact_[]; + + // YYPGOTO[NTERM-NUM]. + static const short yypgoto_[]; + + // YYDEFGOTO[NTERM-NUM]. + static const short yydefgoto_[]; + + // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + // positive, shift that token. If negative, reduce the rule whose + // number is the opposite. If YYTABLE_NINF, syntax error. + static const short yytable_[]; + + static const short yycheck_[]; + + // YYSTOS[STATE-NUM] -- The (internal number of the) accessing + // symbol of state STATE-NUM. + static const unsigned char yystos_[]; + + // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + static const unsigned char yyr1_[]; + + // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + static const signed char yyr2_[]; + + +#if IW5DEBUG + // YYRLINE[YYN] -- Source line where rule number YYN was defined. + static const short yyrline_[]; + /// Report on the debug stream that the rule \a r is going to be reduced. + virtual void yy_reduce_print_ (int r) const; + /// Print the state stack on the debug stream. + virtual void yy_stack_print_ () const; + + /// Debugging level. + int yydebug_; + /// Debug stream. + std::ostream* yycdebug_; + + /// \brief Display a symbol kind, value and location. + /// \param yyo The output stream. + /// \param yysym The symbol. + template + void yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const; +#endif + + /// \brief Reclaim the memory associated to a symbol. + /// \param yymsg Why this token is reclaimed. + /// If null, print nothing. + /// \param yysym The symbol. + template + void yy_destroy_ (const char* yymsg, basic_symbol& yysym) const; + + private: + /// Type access provider for state based symbols. + struct by_state + { + /// Default constructor. + by_state () YY_NOEXCEPT; + + /// The symbol kind as needed by the constructor. + typedef state_type kind_type; + + /// Constructor. + by_state (kind_type s) YY_NOEXCEPT; + + /// Copy constructor. + by_state (const by_state& that) YY_NOEXCEPT; + + /// Record that this symbol is empty. + void clear () YY_NOEXCEPT; + + /// Steal the symbol kind from \a that. + void move (by_state& that); + + /// The symbol kind (corresponding to \a state). + /// \a symbol_kind::S_YYEMPTY when empty. + symbol_kind_type kind () const YY_NOEXCEPT; + + /// The state number used to denote an empty symbol. + /// We use the initial state, as it does not have a value. + enum { empty_state = 0 }; + + /// The state. + /// \a empty when empty. + state_type state; + }; + + /// "Internal" symbol: element of the stack. + struct stack_symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + /// Construct an empty symbol. + stack_symbol_type (); + /// Move or copy construction. + stack_symbol_type (YY_RVREF (stack_symbol_type) that); + /// Steal the contents from \a sym to build this. + stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym); +#if YY_CPLUSPLUS < 201103L + /// Assignment, needed by push_back by some old implementations. + /// Moves the contents of that. + stack_symbol_type& operator= (stack_symbol_type& that); + + /// Assignment, needed by push_back by other implementations. + /// Needed by some other old implementations. + stack_symbol_type& operator= (const stack_symbol_type& that); +#endif + }; + + /// A stack with random access from its top. + template > + class stack + { + public: + // Hide our reversed order. + typedef typename S::iterator iterator; + typedef typename S::const_iterator const_iterator; + typedef typename S::size_type size_type; + typedef typename std::ptrdiff_t index_type; + + stack (size_type n = 200) + : seq_ (n) + {} + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + stack (const stack&) = delete; + /// Non copyable. + stack& operator= (const stack&) = delete; +#endif + + /// Random access. + /// + /// Index 0 returns the topmost element. + const T& + operator[] (index_type i) const + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Random access. + /// + /// Index 0 returns the topmost element. + T& + operator[] (index_type i) + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Steal the contents of \a t. + /// + /// Close to move-semantics. + void + push (YY_MOVE_REF (T) t) + { + seq_.push_back (T ()); + operator[] (0).move (t); + } + + /// Pop elements from the stack. + void + pop (std::ptrdiff_t n = 1) YY_NOEXCEPT + { + for (; 0 < n; --n) + seq_.pop_back (); + } + + /// Pop all elements from the stack. + void + clear () YY_NOEXCEPT + { + seq_.clear (); + } + + /// Number of elements on the stack. + index_type + size () const YY_NOEXCEPT + { + return index_type (seq_.size ()); + } + + /// Iterator on top of the stack (going downwards). + const_iterator + begin () const YY_NOEXCEPT + { + return seq_.begin (); + } + + /// Bottom of the stack. + const_iterator + end () const YY_NOEXCEPT + { + return seq_.end (); + } + + /// Present a slice of the top of a stack. + class slice + { + public: + slice (const stack& stack, index_type range) + : stack_ (stack) + , range_ (range) + {} + + const T& + operator[] (index_type i) const + { + return stack_[range_ - i]; + } + + private: + const stack& stack_; + index_type range_; + }; + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + stack (const stack&); + /// Non copyable. + stack& operator= (const stack&); +#endif + /// The wrapped container. + S seq_; + }; + + + /// Stack type. + typedef stack stack_type; + + /// The stack. + stack_type yystack_; + /// The stack for LAC. + /// Logically, the yy_lac_stack's lifetime is confined to the function + /// yy_lac_check_. We just store it as a member of this class to hold + /// on to the memory and to avoid frequent reallocations. + /// Since yy_lac_check_ is const, this member must be mutable. + mutable std::vector yylac_stack_; + /// Whether an initial LAC context was established. + bool yy_lac_established_; + + + /// Push a new state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param sym the symbol + /// \warning the contents of \a s.value is stolen. + void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym); + + /// Push a new look ahead token on the state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param s the state + /// \param sym the symbol (for its value and location). + /// \warning the contents of \a sym.value is stolen. + void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); + + /// Pop \a n symbols from the stack. + void yypop_ (int n = 1); + + /// Constants. + enum + { + yylast_ = 1590, ///< Last index in yytable_. + yynnts_ = 72, ///< Number of nonterminal symbols. + yyfinal_ = 15 ///< Termination state number. + }; + + + // User arguments. + yyscan_t yyscanner; + xsk::gsc::location& loc; + xsk::gsc::program_ptr& ast; + + }; + + inline + parser::symbol_kind_type + parser::yytranslate_ (int t) + { + return static_cast (t); + } + + // basic_symbol. + template + parser::basic_symbol::basic_symbol (const basic_symbol& that) + : Base (that) + , value () + , location (that.location) + { + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.copy< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.copy< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.copy< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.copy< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.copy< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.copy< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.copy< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.copy< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.copy< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.copy< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.copy< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.copy< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.copy< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.copy< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.copy< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.copy< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.copy< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.copy< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.copy< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.copy< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.copy< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.copy< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.copy< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.copy< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.copy< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.copy< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.copy< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.copy< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.copy< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.copy< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.copy< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.copy< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.copy< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.copy< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.copy< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.copy< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.copy< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.copy< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.copy< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.copy< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.copy< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.copy< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.copy< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.copy< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.copy< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.copy< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.copy< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.copy< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.copy< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.copy< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.copy< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.copy< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.copy< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + + } + + + + template + parser::symbol_kind_type + parser::basic_symbol::type_get () const YY_NOEXCEPT + { + return this->kind (); + } + + template + bool + parser::basic_symbol::empty () const YY_NOEXCEPT + { + return this->kind () == symbol_kind::S_YYEMPTY; + } + + template + void + parser::basic_symbol::move (basic_symbol& s) + { + super_type::move (s); + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (YY_MOVE (s.value)); + break; + + default: + break; + } + + location = YY_MOVE (s.location); + } + + // by_kind. + inline + parser::by_kind::by_kind () + : kind_ (symbol_kind::S_YYEMPTY) + {} + +#if 201103L <= YY_CPLUSPLUS + inline + parser::by_kind::by_kind (by_kind&& that) + : kind_ (that.kind_) + { + that.clear (); + } +#endif + + inline + parser::by_kind::by_kind (const by_kind& that) + : kind_ (that.kind_) + {} + + inline + parser::by_kind::by_kind (token_kind_type t) + : kind_ (yytranslate_ (t)) + {} + + inline + void + parser::by_kind::clear () YY_NOEXCEPT + { + kind_ = symbol_kind::S_YYEMPTY; + } + + inline + void + parser::by_kind::move (by_kind& that) + { + kind_ = that.kind_; + that.clear (); + } + + inline + parser::symbol_kind_type + parser::by_kind::kind () const YY_NOEXCEPT + { + return kind_; + } + + inline + parser::symbol_kind_type + parser::by_kind::type_get () const YY_NOEXCEPT + { + return this->kind (); + } + +#line 13 "parser.ypp" +} } } // xsk::gsc::iw5 +#line 4713 "parser.hpp" + + + + +#endif // !YY_IW5_PARSER_HPP_INCLUDED diff --git a/src/iw5/xsk/resolver.cpp b/src/iw5/xsk/resolver.cpp new file mode 100644 index 00000000..615a4a03 --- /dev/null +++ b/src/iw5/xsk/resolver.cpp @@ -0,0 +1,8238 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw5.hpp" + +namespace xsk::gsc::iw5 +{ + +std::unordered_map opcode_map; +std::unordered_map function_map; +std::unordered_map method_map; +std::unordered_map file_map; +std::unordered_map token_map; +std::unordered_map opcode_map_rev; +std::unordered_map function_map_rev; +std::unordered_map method_map_rev; +std::unordered_map file_map_rev; +std::unordered_map token_map_rev; + +auto resolver::opcode_id(const std::string& name) -> std::uint8_t +{ + const auto itr = opcode_map_rev.find(name); + + if (itr != opcode_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve opcode id for name '%s'!", name.data())); +} + +auto resolver::opcode_name(std::uint8_t id) -> std::string +{ + const auto itr = opcode_map.find(id); + + if (itr != opcode_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve opcode name for id '0x%hhX'!", id)); +} + +auto resolver::function_id(const std::string& name) -> std::uint16_t +{ + const auto itr = function_map_rev.find(name); + + if (itr != function_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin function id for name '%s'!", name.data())); +} + +auto resolver::function_name(std::uint16_t id) -> std::string +{ + const auto itr = function_map.find(id); + + if (itr != function_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin function name for id '%i'!", id)); +} + +auto resolver::method_id(const std::string& name) -> std::uint16_t +{ + const auto itr = method_map_rev.find(name); + + if (itr != method_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin method id for name '%s'!", name.data())); +} + +auto resolver::method_name(std::uint16_t id) -> std::string +{ + const auto itr = method_map.find(id); + + if (itr != method_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin method name for id '%i'!", id)); +} + +auto resolver::file_id(const std::string& name) -> std::uint16_t +{ + const auto itr = file_map_rev.find(name); + + if (itr != file_map_rev.end()) + { + return itr->second; + } + + return 0; +} + +auto resolver::file_name(std::uint16_t id) -> std::string +{ + const auto itr = file_map.find(id); + + if (itr != file_map.end()) + { + return itr->second; + } + + return utils::string::va("_ID%i", id); +} + +auto resolver::token_id(const std::string& name) -> std::uint16_t +{ + const auto itr = token_map_rev.find(name); + + if (itr != token_map_rev.end()) + { + return itr->second; + } + + return 0; +} + +auto resolver::token_name(std::uint16_t id) -> std::string +{ + const auto itr = token_map.find(id); + + if (itr != token_map.end()) + { + return itr->second; + } + + return utils::string::va("_ID%i", id); +} + +auto resolver::find_function(const std::string& name) -> bool +{ + const auto itr = function_map_rev.find(name); + + if (itr != function_map_rev.end()) + { + return true; + } + + return false; +} + +auto resolver::find_method(const std::string& name) -> bool +{ + const auto itr = method_map_rev.find(name); + + if (itr != method_map_rev.end()) + { + return true; + } + + return false; +} + +const std::array opcode_list +{{ + { std::uint8_t(opcode::OP_End),"END" }, + { std::uint8_t(opcode::OP_Return),"RETN" }, + { std::uint8_t(opcode::OP_GetByte),"GET_BYTE" }, + { std::uint8_t(opcode::OP_GetNegByte),"GET_NBYTE" }, + { std::uint8_t(opcode::OP_GetUnsignedShort),"GET_USHORT" }, + { std::uint8_t(opcode::OP_GetNegUnsignedShort),"GET_NUSHORT" }, + { std::uint8_t(opcode::OP_GetInteger),"GET_INT" }, + { std::uint8_t(opcode::OP_GetBuiltinFunction),"GET_BUILTIN_FUNC" }, + { std::uint8_t(opcode::OP_GetBuiltinMethod),"GET_BUILTIN_METHOD" }, + { std::uint8_t(opcode::OP_GetFloat),"GET_FLOAT" }, + { std::uint8_t(opcode::OP_GetString),"GET_STRING" }, + { std::uint8_t(opcode::OP_GetUndefined),"GET_UNDEFINED" }, + { std::uint8_t(opcode::OP_GetZero),"GET_ZERO" }, + { std::uint8_t(opcode::OP_waittillFrameEnd),"WAITTILLFRAMEEND" }, + { std::uint8_t(opcode::OP_CreateLocalVariable),"CREATE_LOCAL_VARIABLE" }, + { std::uint8_t(opcode::OP_RemoveLocalVariables),"REMOVE_LOCAL_VARIABLES" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached0),"EVAL_LOCAL_VARIABLE_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached1),"EVAL_LOCAL_VARIABLE_CACHED1" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached2),"EVAL_LOCAL_VARIABLE_CACHED2" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached3),"EVAL_LOCAL_VARIABLE_CACHED3" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached4),"EVAL_LOCAL_VARIABLE_CACHED4" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached5),"EVAL_LOCAL_VARIABLE_CACHED5" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached),"EVAL_LOCAL_VARIABLE_CACHED" }, + { std::uint8_t(opcode::OP_EvalLocalArrayCached),"EVAL_LOCAL_ARRAY_CACHED" }, + { std::uint8_t(opcode::OP_EvalArray),"EVAL_ARRAY" }, + { std::uint8_t(opcode::OP_EvalNewLocalArrayRefCached0),"EVAL_NEW_LOCAL_ARRAY_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalArrayRefCached0),"EVAL_LOCAL_ARRAY_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalArrayRefCached),"EVAL_LOCAL_ARRAY_REF_CACHED" }, + { std::uint8_t(opcode::OP_EvalArrayRef),"EVAL_ARRAY_REF" }, + { std::uint8_t(opcode::OP_ClearArray),"CLEAR_ARRAY" }, + { std::uint8_t(opcode::OP_EmptyArray),"EMPTY_ARRAY" }, + { std::uint8_t(opcode::OP_AddArray),"ADD_ARRAY" }, + { std::uint8_t(opcode::OP_PreScriptCall),"PRE_CALL" }, + { std::uint8_t(opcode::OP_ScriptLocalFunctionCall2),"CALL_LOCAL_FUNC2" }, + { std::uint8_t(opcode::OP_ScriptLocalFunctionCall),"CALL_LOCAL_FUNC" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodCall),"CALL_LOCAL_METHOD" }, + { std::uint8_t(opcode::OP_ScriptLocalThreadCall),"CALL_LOCAL_FUNC_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalChildThreadCall),"CALL_LOCAL_FUNC_CHILD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodThreadCall),"CALL_LOCAL_METHOD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodChildThreadCall),"CALL_LOCAL_METHOD_CHILD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptFarFunctionCall2),"CALL_FAR_FUNC2" }, + { std::uint8_t(opcode::OP_ScriptFarFunctionCall),"CALL_FAR_FUNC" }, + { std::uint8_t(opcode::OP_ScriptFarMethodCall),"CALL_FAR_METHOD" }, + { std::uint8_t(opcode::OP_ScriptFarThreadCall),"CALL_FAR_FUNC_THREAD" }, + { std::uint8_t(opcode::OP_ScriptFarChildThreadCall),"CALL_FAR_FUNC_CHILD_THREAD"}, + { std::uint8_t(opcode::OP_ScriptFarMethodThreadCall),"CALL_FAR_METHOD_THEAD" }, + { std::uint8_t(opcode::OP_ScriptFarMethodChildThreadCall),"CALL_FAR_METHOD_CHILD_THEAD" }, + { std::uint8_t(opcode::OP_ScriptFunctionCallPointer),"CALL_FUNC_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodCallPointer),"CALL_METHOD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptThreadCallPointer),"CALL_FUNC_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptChildThreadCallPointer),"CALL_FUNC_CHILD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodThreadCallPointer),"CALL_METHOD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodChildThreadCallPointer),"CALL_METHOD_CHILD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_CallBuiltinPointer),"CALL_BUILTIN_FUNC_POINTER" }, + { std::uint8_t(opcode::OP_CallBuiltinMethodPointer),"CALL_BUILTIN_METHOD_POINTER" }, + { std::uint8_t(opcode::OP_GetIString),"GET_ISTRING" }, + { std::uint8_t(opcode::OP_GetVector),"GET_VECTOR" }, + { std::uint8_t(opcode::OP_GetLevelObject),"GET_LEVEL_OBJ" }, + { std::uint8_t(opcode::OP_GetAnimObject),"GET_ANIM_OBJ" }, + { std::uint8_t(opcode::OP_GetSelf),"GET_SELF" }, + { std::uint8_t(opcode::OP_GetThisthread),"GET_THISTHREAD" }, + { std::uint8_t(opcode::OP_GetLevel),"GET_LEVEL" }, + { std::uint8_t(opcode::OP_GetGame),"GET_GAME" }, + { std::uint8_t(opcode::OP_GetAnim),"GET_ANIM" }, + { std::uint8_t(opcode::OP_GetAnimation),"GET_ANIMATION" }, + { std::uint8_t(opcode::OP_GetGameRef),"GET_GAME_REF" }, + { std::uint8_t(opcode::OP_inc),"INC" }, + { std::uint8_t(opcode::OP_dec),"DEC" }, + { std::uint8_t(opcode::OP_bit_or),"BIT_OR" }, + { std::uint8_t(opcode::OP_JumpOnFalseExpr),"JMP_EXPR_FALSE" }, + { std::uint8_t(opcode::OP_bit_ex_or),"BIT_EXOR" }, + { std::uint8_t(opcode::OP_bit_and),"BIT_AND" }, + { std::uint8_t(opcode::OP_equality),"EQUALITY" }, + { std::uint8_t(opcode::OP_inequality),"INEQUALITY" }, + { std::uint8_t(opcode::OP_less),"LESS" }, + { std::uint8_t(opcode::OP_greater),"GREATER" }, + { std::uint8_t(opcode::OP_JumpOnTrueExpr),"JMP_EXPR_TRUE" }, + { std::uint8_t(opcode::OP_less_equal),"LESSEQUAL" }, + { std::uint8_t(opcode::OP_jumpback),"JMP_BACK" }, + { std::uint8_t(opcode::OP_waittillmatch2),"WAITTILLMATCH2" }, + { std::uint8_t(opcode::OP_waittill),"WAITTILL" }, + { std::uint8_t(opcode::OP_notify),"NOTIFY" }, + { std::uint8_t(opcode::OP_endon),"ENDON" }, + { std::uint8_t(opcode::OP_voidCodepos),"VOIDCODEPOS" }, + { std::uint8_t(opcode::OP_switch),"SWITCH" }, + { std::uint8_t(opcode::OP_endswitch),"ENDSWITCH" }, + { std::uint8_t(opcode::OP_vector),"VECTOR" }, + { std::uint8_t(opcode::OP_JumpOnFalse),"JMP_FALSE" }, + { std::uint8_t(opcode::OP_greater_equal),"GREATEREQUAL" }, + { std::uint8_t(opcode::OP_shift_left),"SHIFT_LEFT" }, + { std::uint8_t(opcode::OP_shift_right),"SHIFT_RIGHT" }, + { std::uint8_t(opcode::OP_plus),"PLUS" }, + { std::uint8_t(opcode::OP_jump),"JMP" }, + { std::uint8_t(opcode::OP_minus),"MINUS" }, + { std::uint8_t(opcode::OP_multiply),"MULT" }, + { std::uint8_t(opcode::OP_divide),"DIV" }, + { std::uint8_t(opcode::OP_mod),"MOD" }, + { std::uint8_t(opcode::OP_JumpOnTrue),"JMP_TRUE" }, + { std::uint8_t(opcode::OP_size),"SIZE" }, + { std::uint8_t(opcode::OP_waittillmatch),"WAITTILLMATCH" }, + { std::uint8_t(opcode::OP_GetLocalFunction),"GET_LOCAL_FUNC" }, + { std::uint8_t(opcode::OP_GetFarFunction),"GET_FAR_FUNC" }, + { std::uint8_t(opcode::OP_GetSelfObject),"GET_SELF_OBJ" }, + { std::uint8_t(opcode::OP_EvalLevelFieldVariable),"EVAL_LEVEL_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalAnimFieldVariable),"EVAL_ANIM_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalSelfFieldVariable),"EVAL_SELF_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalFieldVariable),"EVAL_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalLevelFieldVariableRef),"EVAL_LEVEL_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalAnimFieldVariableRef),"EVAL_ANIM_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalSelfFieldVariableRef),"EVAL_SELF_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalFieldVariableRef),"EVAL_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_ClearFieldVariable),"CLEAR_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_SafeCreateVariableFieldCached),"SAFE_CREATE_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_SafeSetVariableFieldCached0),"SAFE_SET_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SafeSetVariableFieldCached),"SAFE_SET_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_SafeSetWaittillVariableFieldCached),"SAFE_SET_WAITTILL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_GetAnimTree),"GET_ANIMTREE" }, + { std::uint8_t(opcode::OP_clearparams),"CLEAR_PARAMS" }, + { std::uint8_t(opcode::OP_checkclearparams),"CHECK_CLEAR_PARAMS" }, + { std::uint8_t(opcode::OP_EvalLocalVariableRefCached0),"EVAL_LOCAL_VARIABLE_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalNewLocalVariableRefCached0),"EVAL_NEW_LOCAL_VARIABLE_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalVariableRefCached),"EVAL_LOCAL_VARIABLE_REF_CACHED" }, + { std::uint8_t(opcode::OP_SetLevelFieldVariableField),"SET_LEVEL_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetVariableField),"SET_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_ClearVariableField),"CLEAR_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetAnimFieldVariableField),"SET_ANIM_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetSelfFieldVariableField),"SET_SELF_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetLocalVariableFieldCached0),"SET_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SetNewLocalVariableFieldCached0),"SET_NEW_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SetLocalVariableFieldCached),"SET_LOCAL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_ClearLocalVariableFieldCached),"CLEAR_LOCAL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_ClearLocalVariableFieldCached0),"CLEAR_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_CallBuiltin0),"CALL_BUILTIN_FUNC_0" }, + { std::uint8_t(opcode::OP_CallBuiltin1),"CALL_BUILTIN_FUNC_1" }, + { std::uint8_t(opcode::OP_CallBuiltin2),"CALL_BUILTIN_FUNC_2" }, + { std::uint8_t(opcode::OP_CallBuiltin3),"CALL_BUILTIN_FUNC_3" }, + { std::uint8_t(opcode::OP_CallBuiltin4),"CALL_BUILTIN_FUNC_4" }, + { std::uint8_t(opcode::OP_CallBuiltin5),"CALL_BUILTIN_FUNC_5" }, + { std::uint8_t(opcode::OP_CallBuiltin),"CALL_BUILTIN_FUNC" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod0),"CALL_BUILTIN_METHOD_0" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod1),"CALL_BUILTIN_METHOD_1" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod2),"CALL_BUILTIN_METHOD_2" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod3),"CALL_BUILTIN_METHOD_3" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod4),"CALL_BUILTIN_METHOD_4" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod5),"CALL_BUILTIN_METHOD_5" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod),"CALL_BUILTIN_METHOD" }, + { std::uint8_t(opcode::OP_wait),"WAIT" }, + { std::uint8_t(opcode::OP_DecTop),"DEC_TOP" }, + { std::uint8_t(opcode::OP_CastFieldObject),"CAST_FIELD_OBJ" }, + { std::uint8_t(opcode::OP_EvalLocalVariableObjectCached),"EVAL_LOCAL_VARIABLE_OBJECT_CACHED" }, + { std::uint8_t(opcode::OP_CastBool),"CAST_BOOL" }, + { std::uint8_t(opcode::OP_BoolNot),"BOOL_NOT" }, + { std::uint8_t(opcode::OP_BoolComplement),"BOOL_COMPLEMENT" }, +}}; + +const std::array function_list +{{ + { 0x001, "precacheturret" }, + { 0x002, "getweaponarray" }, + { 0x003, "createprintchannel" }, + { 0x004, "updategamerprofileall" }, + { 0x005, "clearlocalizedstrings" }, + { 0x006, "setphysicsgravitydir" }, + { 0x007, "gettimescale" }, + { 0x008, "settimescale" }, + { 0x009, "setslowmotionview" }, + { 0x00A, "forcesharedammo" }, + { 0x00B, "refreshhudcompass" }, + { 0x00C, "refreshhudammocounter" }, + { 0x00D, "notifyoncommand" }, + { 0x00E, "setprintchannel" }, + { 0x00F, "print" }, + { 0x010, "println" }, + { 0x011, "print3d" }, + { 0x012, "line" }, + { 0x013, "spawnturret" }, + { 0x014, "canspawnturret" }, + { 0x015, "assert" }, + { 0x016, "pausecinematicingame" }, + { 0x017, "drawcompassfriendlies" }, + { 0x018, "bulletspread" }, + { 0x019, "bullettracer" }, + { 0x01A, "badplace_delete" }, + { 0x01B, "badplace_cylinder" }, + { 0x01C, "badplace_arc" }, + { 0x01D, "badplace_brush" }, + { 0x01E, "clearallcorpses" }, + { 0x01F, "setturretnode" }, + { 0x020, "unsetturretnode" }, + { 0x021, "setnodepriority" }, + { 0x022, "isnodeoccupied" }, + { 0x023, "setdebugorigin" }, + { 0x024, "setdebugangles" }, + { 0x025, "updategamerprofile" }, + { 0x026, "assertex" }, + { 0x027, "assertmsg" }, + { 0x028, "isdefined" }, + { 0x029, "isstring" }, + { 0x02A, "setdvar" }, + { 0x02B, "setdynamicdvar" }, + { 0x02C, "setdvarifuninitialized" }, + { 0x02D, "setdevdvar" }, + { 0x02E, "setdevdvarifuninitialized" }, + { 0x02F, "getdvar" }, + { 0x030, "getdvarint" }, + { 0x031, "getdvarfloat" }, + { 0x032, "getdvarvector" }, + { 0x033, "gettime" }, + { 0x034, "getentbynum" }, + { 0x035, "getweaponmodel" }, + { 0x036, "getculldist" }, + { 0x037, "sethalfresparticles" }, + { 0x038, "getmapsunlight" }, + { 0x039, "setsunlight" }, + { 0x03A, "resetsunlight" }, + { 0x03B, "getmapsundirection" }, + { 0x03C, "getmapsunangles" }, + { 0x03D, "setsundirection" }, + { 0x03E, "lerpsundirection" }, + { 0x03F, "lerpsunangles" }, + { 0x040, "resetsundirection" }, + { 0x041, "enableforcedsunshadows" }, + { 0x042, "enableforcednosunshadows" }, + { 0x043, "disableforcedsunshadows" }, + { 0x044, "enableouterspacemodellighting" }, + { 0x045, "disableouterspacemodellighting" }, + { 0x046, "remapstage" }, + { 0x047, "changelevel" }, + { 0x048, "missionsuccess" }, + { 0x049, "missionfailed" }, + { 0x04A, "cinematic" }, + { 0x04B, "cinematicingame" }, + { 0x04C, "cinematicingamesync" }, + { 0x04D, "cinematicingameloop" }, + { 0x04E, "cinematicingameloopresident" }, + { 0x04F, "iscinematicplaying" }, + { 0x050, "stopcinematicingame" }, + { 0x051, "getweaponhidetags" }, + { 0x052, "getanimlength" }, + { 0x053, "animhasnotetrack" }, + { 0x054, "getnotetracktimes" }, + { 0x055, "spawn" }, + { 0x056, "spawnloopsound" }, + { 0x057, "spawnloopingsound" }, + { 0x058, "bullettrace" }, + { 0x059, "target_setmaxsize" }, + { 0x05A, "target_setcolor" }, + { 0x05B, "target_setdelay" }, + { 0x05C, "getstartorigin" }, + { 0x05D, "getstartangles" }, + { 0x05E, "getcycleoriginoffset" }, + { 0x05F, "magicgrenade" }, + { 0x060, "magicgrenademanual" }, + { 0x061, "setblur" }, + { 0x062, "musicplay" }, + { 0x063, "musicstop" }, + { 0x064, "soundfade" }, + { 0x065, "soundsettimescalefactor" }, + { 0x066, "soundresettimescale" }, + { 0x067, "setocclusionpreset" }, + { 0x068, "levelsoundfade" }, + { 0x069, "precachenightvisioncodeassets" }, + { 0x06A, "precachedigitaldistortcodeassets" }, + { 0x06B, "precacheminimapsentrycodeassets" }, + { 0x06C, "savegame" }, + { 0x06D, "issavesuccessful" }, + { 0x06E, "issaverecentlyloaded" }, + { 0x06F, "savegamenocommit" }, + { 0x070, "commitsave" }, + { 0x071, "commitwouldbevalid" }, + { 0x072, "getfxvisibility" }, + { 0x073, "setculldist" }, + { 0x074, "bullettracepassed" }, + { 0x075, "sighttracepassed" }, + { 0x076, "physicstrace" }, + { 0x077, "playerphysicstrace" }, + { 0x078, "getgroundposition" }, + { 0x079, "getmovedelta" }, + { 0x07A, "getangledelta" }, + { 0x07B, "getnorthyaw" }, + { 0x07C, "getcommandfromkey" }, + { 0x07D, "getsticksconfig" }, + { 0x07E, "weaponfightdist" }, + { 0x07F, "weaponmaxdist" }, + { 0x080, "isturretactive" }, + { 0x081, "target_alloc" }, + { 0x082, "target_flush" }, + { 0x083, "target_set" }, + { 0x084, "target_remove" }, + { 0x085, "target_setshader" }, + { 0x086, "target_setoffscreenshader" }, + { 0x087, "target_isinrect" }, + { 0x088, "target_isincircle" }, + { 0x089, "target_startreticlelockon" }, + { 0x08A, "target_clearreticlelockon" }, + { 0x08B, "target_getarray" }, + { 0x08C, "target_istarget" }, + { 0x08D, "target_setattackmode" }, + { 0x08E, "target_setjavelinonly" }, + { 0x08F, "target_hidefromplayer" }, + { 0x090, "target_showtoplayer" }, + { 0x091, "target_setscaledrendermode" }, + { 0x092, "target_drawcornersonly" }, + { 0x093, "target_drawsquare" }, + { 0x094, "target_drawsingle" }, + { 0x095, "target_setminsize" }, + { 0x096, "setnorthyaw" }, + { 0x097, "setslowmotion" }, + { 0x098, "randomint" }, + { 0x099, "randomfloat" }, + { 0x09A, "randomintrange" }, + { 0x09B, "randomfloatrange" }, + { 0x09C, "sin" }, + { 0x09D, "cos" }, + { 0x09E, "tan" }, + { 0x09F, "asin" }, + { 0x0A0, "acos" }, + { 0x0A1, "atan" }, + { 0x0A2, "int" }, + { 0x0A3, "float" }, + { 0x0A4, "abs" }, + { 0x0A5, "min" }, + { 0x0A6, "objective_additionalcurrent" }, + { 0x0A7, "objective_ring" }, + { 0x0A8, "objective_setpointertextoverride" }, + { 0x0A9, "getnode" }, + { 0x0AA, "getnodearray" }, + { 0x0AB, "getallnodes" }, + { 0x0AC, "getnodesinradius" }, + { 0x0AD, "getnodesinradiussorted" }, + { 0x0AE, "getclosestnodeinsight" }, + { 0x0AF, "getreflectionlocs" }, + { 0x0B0, "getreflectionreferencelocs" }, + { 0x0B1, "getvehicletracksegment" }, + { 0x0B2, "getvehicletracksegmentarray" }, + { 0x0B3, "getallvehicletracksegments" }, + { 0x0B4, "isarray" }, + { 0x0B5, "isai" }, + { 0x0B6, "issentient" }, + { 0x0B7, "isgodmode" }, + { 0x0B8, "getdebugdvar" }, + { 0x0B9, "getdebugdvarint" }, + { 0x0BA, "getdebugdvarfloat" }, + { 0x0BB, "setsaveddvar" }, + { 0x0BC, "getfreeaicount" }, + { 0x0BD, "getaicount" }, + { 0x0BE, "getaiarray" }, + { 0x0BF, "getaispeciesarray" }, + { 0x0C0, "getspawnerarray" }, + { 0x0C1, "getcorpsearray" }, + { 0x0C2, "getspawnerteamarray" }, + { 0x0C3, "getweaponclipmodel" }, + { 0x0C4, "getbrushmodelcenter" }, + { 0x0C5, "getkeybinding" }, + { 0x0C6, "max" }, + { 0x0C7, "floor" }, + { 0x0C8, "ceil" }, + { 0x0C9, "exp" }, + { 0x0CA, "log" }, + { 0x0CB, "sqrt" }, + { 0x0CC, "squared" }, + { 0x0CD, "clamp" }, + { 0x0CE, "angleclamp" }, + { 0x0CF, "angleclamp180" }, + { 0x0D0, "vectorfromlinetopoint" }, + { 0x0D1, "pointonsegmentnearesttopoint" }, + { 0x0D2, "distance" }, + { 0x0D3, "distance2d" }, + { 0x0D4, "distancesquared" }, + { 0x0D5, "length" }, + { 0x0D6, "lengthsquared" }, + { 0x0D7, "closer" }, + { 0x0D8, "vectordot" }, + { 0x0D9, "visionsetthermal" }, + { 0x0DA, "visionsetpain" }, + { 0x0DB, "endlobby" }, + { 0x0DC, "setac130ambience" }, + { 0x0DD, "getmapcustom" }, + { 0x0DE, "updateskill" }, + { 0x0DF, "spawnsighttrace" }, + { 0x0E0, "incrementcounter" }, + { 0x0E1, "getcountertotal" }, + { 0x0E2, "getlevelticks" }, + { 0x0E3, "perlinnoise2d" }, + { 0x0E4, "calcrockingangles" }, + { 0x0E5, "sethudlighting" }, + { 0x0E6, "reconevent" }, + { 0x0E7, "reconspatialevent" }, + { 0x0E8, "setsunflareposition" }, + { 0x0E9, "createthreatbiasgroup" }, + { 0x0EA, "threatbiasgroupexists" }, + { 0x0EB, "getthreatbias" }, + { 0x0EC, "setthreatbias" }, + { 0x0ED, "setthreatbiasagainstall" }, + { 0x0EE, "setignoremegroup" }, + { 0x0EF, "isenemyteam" }, + { 0x0F0, "objective_additionalentity" }, + { 0x0F1, "objective_state_nomessage" }, + { 0x0F2, "objective_string" }, + { 0x0F3, "objective_string_nomessage" }, + { 0x0F4, "objective_additionalposition" }, + { 0x0F5, "objective_current_nomessage" }, + { 0x0F6, "vectornormalize" }, + { 0x0F7, "vectortoangles" }, + { 0x0F8, "vectortoyaw" }, + { 0x0F9, "vectorlerp" }, + { 0x0FA, "anglestoup" }, + { 0x0FB, "anglestoright" }, + { 0x0FC, "anglestoforward" }, + { 0x0FD, "combineangles" }, + { 0x0FE, "transformmove" }, + { 0x0FF, "issubstr" }, + { 0x100, "isendstr" }, + { 0x101, "getsubstr" }, + { 0x102, "tolower" }, + { 0x103, "strtok" }, + { 0x104, "stricmp" }, + { 0x105, "ambientplay" }, + { 0x106, "getuavstrengthmax" }, + { 0x107, "getuavstrengthlevelneutral" }, + { 0x108, "getuavstrengthlevelshowenemyfastsweep" }, + { 0x109, "getuavstrengthlevelshowenemydirectional" }, + { 0x10A, "blockteamradar" }, + { 0x10B, "unblockteamradar" }, + { 0x10C, "isteamradarblocked" }, + { 0x10D, "getassignedteam" }, + { 0x10E, "setmatchdata" }, + { 0x10F, "getmatchdata" }, + { 0x110, "sendmatchdata" }, + { 0x111, "clearmatchdata" }, + { 0x112, "setmatchdatadef" }, + { 0x113, "setmatchclientip" }, + { 0x114, "setmatchdataid" }, + { 0x115, "setclientmatchdata" }, + { 0x116, "getclientmatchdata" }, + { 0x117, "setclientmatchdatadef" }, + { 0x118, "sendclientmatchdata" }, + { 0x119, "getbuildversion" }, + { 0x11A, "getbuildnumber" }, + { 0x11B, "getsystemtime" }, + { 0x11C, "getmatchrulesdata" }, + { 0x11D, "isusingmatchrulesdata" }, + { 0x11E, "kick" }, + { 0x11F, "issplitscreen" }, + { 0x120, "setmapcenter" }, + { 0x121, "setgameendtime" }, + { 0x122, "visionsetnaked" }, + { 0x123, "visionsetnight" }, + { 0x124, "visionsetmissilecam" }, + { 0x125, "ambientstop" }, + { 0x126, "precachemodel" }, + { 0x127, "precacheshellshock" }, + { 0x128, "precacheitem" }, + { 0x129, "precacheshader" }, + { 0x12A, "precachestring" }, + { 0x12B, "precachemenu" }, + { 0x12C, "precacherumble" }, + { 0x12D, "precachelocationselector" }, + { 0x12E, "precacheleaderboards" }, + { 0x12F, "loadfx" }, + { 0x130, "playfx" }, + { 0x131, "playfxontag" }, + { 0x132, "stopfxontag" }, + { 0x133, "playloopedfx" }, + { 0x134, "spawnfx" }, + { 0x135, "triggerfx" }, + { 0x136, "playfxontagforclients" }, + { 0x137, "setwinningteam" }, + { 0x138, "announcement" }, + { 0x139, "clientannouncement" }, + { 0x13A, "getteamscore" }, + { 0x13B, "setteamscore" }, + { 0x13C, "setclientnamemode" }, + { 0x13D, "updateclientnames" }, + { 0x13E, "getteamplayersalive" }, + { 0x13F, "logprint" }, + { 0x140, "worldentnumber" }, + { 0x141, "obituary" }, + { 0x142, "positionwouldtelefrag" }, + { 0x143, "canspawn" }, + { 0x144, "getstarttime" }, + { 0x145, "precachestatusicon" }, + { 0x146, "precacheheadicon" }, + { 0x147, "precacheminimapicon" }, + { 0x148, "precachempanim" }, + { 0x149, "map_restart" }, + { 0x14A, "exitlevel" }, + { 0x14B, "addtestclient" }, + { 0x14C, "makedvarserverinfo" }, + { 0x14D, "setarchive" }, + { 0x14E, "allclientsprint" }, + { 0x14F, "clientprint" }, + { 0x150, "mapexists" }, + { 0x151, "isvalidgametype" }, + { 0x152, "matchend" }, + { 0x153, "setplayerteamrank" }, + { 0x154, "endparty" }, + { 0x155, "setteamradar" }, + { 0x156, "getteamradar" }, + { 0x157, "setteamradarstrength" }, + { 0x158, "getteamradarstrength" }, + { 0x159, "getuavstrengthmin" }, + { 0x15A, "physicsexplosionsphere" }, + { 0x15B, "physicsexplosioncylinder" }, + { 0x15C, "physicsjolt" }, + { 0x15D, "physicsjitter" }, + { 0x15E, "setexpfog" }, + { 0x15F, "isexplosivedamagemod" }, + { 0x160, "radiusdamage" }, + { 0x161, "setplayerignoreradiusdamage" }, + { 0x162, "glassradiusdamage" }, + { 0x163, "earthquake" }, + { 0x164, "getnumparts" }, + { 0x165, "objective_onentity" }, + { 0x166, "objective_team" }, + { 0x167, "objective_player" }, + { 0x168, "objective_playerteam" }, + { 0x169, "objective_playerenemyteam" }, + { 0x16A, "iprintln" }, + { 0x16B, "iprintlnbold" }, + { 0x16C, "logstring" }, + { 0x16D, "getent" }, + { 0x16E, "getentarray" }, + { 0x16F, "spawnplane" }, + { 0x170, "spawnstruct" }, + { 0x171, "spawnhelicopter" }, + { 0x172, "isalive" }, + { 0x173, "isspawner" }, + { 0x174, "missile_createattractorent" }, + { 0x175, "missile_createattractororigin" }, + { 0x176, "missile_createrepulsorent" }, + { 0x177, "missile_createrepulsororigin" }, + { 0x178, "missile_deleteattractor" }, + { 0x179, "playsoundatpos" }, + { 0x17A, "newhudelem" }, + { 0x17B, "newclienthudelem" }, + { 0x17C, "newteamhudelem" }, + { 0x17D, "resettimeout" }, + { 0x17E, "precachefxteamthermal" }, + { 0x17F, "isplayer" }, + { 0x180, "isplayernumber" }, + { 0x181, "setwinningplayer" }, + { 0x182, "getpartname" }, + { 0x183, "weaponfiretime" }, + { 0x184, "weaponclipsize" }, + { 0x185, "weaponisauto" }, + { 0x186, "weaponissemiauto" }, + { 0x187, "weaponisboltaction" }, + { 0x188, "weaponinheritsperks" }, + { 0x189, "weaponburstcount" }, + { 0x18A, "weapontype" }, + { 0x18B, "weaponclass" }, + { 0x18C, "getnextarraykey" }, + { 0x18D, "sortbydistance" }, + { 0x18E, "tablelookup" }, + { 0x18F, "tablelookupbyrow" }, + { 0x190, "tablelookupistring" }, + { 0x191, "tablelookupistringbyrow" }, + { 0x192, "tablelookuprownum" }, + { 0x193, "getmissileowner" }, + { 0x194, "magicbullet" }, + { 0x195, "getweaponflashtagname" }, + { 0x196, "averagepoint" }, + { 0x197, "averagenormal" }, + { 0x198, "vehicle_getspawnerarray" }, + { 0x199, "playrumbleonposition" }, + { 0x19A, "playrumblelooponposition" }, + { 0x19B, "stopallrumbles" }, + { 0x19C, "soundexists" }, + { 0x19D, "openfile" }, + { 0x19E, "closefile" }, + { 0x19F, "fprintln" }, + { 0x1A0, "fprintfields" }, + { 0x1A1, "freadln" }, + { 0x1A2, "fgetarg" }, + { 0x1A3, "setminimap" }, + { 0x1A4, "setthermalbodymaterial" }, + { 0x1A5, "getarraykeys" }, + { 0x1A6, "getfirstarraykey" }, + { 0x1A7, "getglass" }, + { 0x1A8, "getglassarray" }, + { 0x1A9, "getglassorigin" }, + { 0x1AA, "isglassdestroyed" }, + { 0x1AB, "destroyglass" }, + { 0x1AC, "deleteglass" }, + { 0x1AD, "getentchannelscount" }, + { 0x1AE, "getentchannelname" }, + { 0x1AF, "objective_add" }, + { 0x1B0, "objective_delete" }, + { 0x1B1, "objective_state" }, + { 0x1B2, "objective_icon" }, + { 0x1B3, "objective_position" }, + { 0x1B4, "objective_current" }, + { 0x1B5, "weaponinventorytype" }, + { 0x1B6, "weaponstartammo" }, + { 0x1B7, "weaponmaxammo" }, + { 0x1B8, "weaponaltweaponname" }, + { 0x1B9, "isweaponcliponly" }, + { 0x1BA, "isweapondetonationtimed" }, + { 0x1BB, "weaponhasthermalscope" }, + { 0x1BC, "getvehiclenode" }, + { 0x1BD, "getvehiclenodearray" }, + { 0x1BE, "getallvehiclenodes" }, + { 0x1BF, "getnumvehicles" }, + { 0x1C0, "precachevehicle" }, + { 0x1C1, "spawnvehicle" }, + { 0x1C2, "vehicle_getarray" }, + { 0x1C3, "gettimesincelastpaused" }, + { 0x1C4, "setlasermaterial" }, + { 0x1C5, "precachefxontag" }, + { 0x1C6, "precachetag" }, + { 0x1C7, "precachesound" }, +}}; + +const std::array method_list +{{ + { 0x8000, "thermaldrawdisable" }, + { 0x8001, "setturretdismountorg" }, + { 0x8002, "setdamagestate" }, + { 0x8003, "playsoundtoteam" }, + { 0x8004, "playsoundtoplayer" }, + { 0x8005, "playerhide" }, + { 0x8006, "showtoplayer" }, + { 0x8007, "enableplayeruse" }, + { 0x8008, "disableplayeruse" }, + { 0x8009, "makescrambler" }, + { 0x800A, "makeportableradar" }, + { 0x800B, "maketrophysystem" }, + { 0x800C, "placespawnpoint" }, + { 0x800D, "setteamfortrigger" }, + { 0x800E, "clientclaimtrigger" }, + { 0x800F, "clientreleasetrigger" }, + { 0x8010, "releaseclaimedtrigger" }, + { 0x8011, "isusingonlinedataoffline" }, + { 0x8012, "getrestedtime" }, + { 0x8013, "sendleaderboards" }, + { 0x8014, "isonladder" }, + { 0x8015, "getcorpseanim" }, + { 0x8016, "playerforcedeathanim" }, + { 0x8017, "attach" }, + { 0x8018, "attachshieldmodel" }, + { 0x8019, "getlightfovinner" }, + { 0x801A, "getlightfovouter" }, + { 0x801B, "setlightfovrange" }, + { 0x801C, "getlightexponent" }, + { 0x801D, "setlightexponent" }, + { 0x801E, "startragdoll" }, + { 0x801F, "startragdollfromimpact" }, + { 0x8020, "logstring" }, + { 0x8021, "laserhidefromclient" }, + { 0x8022, "stopsoundchannel" }, + { 0x8023, "thermaldrawenable" }, + { 0x8024, "detach" }, + { 0x8025, "detachshieldmodel" }, + { 0x8026, "moveshieldmodel" }, + { 0x8027, "detachall" }, + { 0x8028, "getattachsize" }, + { 0x8029, "getattachmodelname" }, + { 0x802A, "getattachtagname" }, + { 0x802B, "setturretcanaidetach" }, + { 0x802C, "setturretfov" }, + { 0x802D, "lerpfov" }, + { 0x802E, "getvalidcoverpeekouts" }, + { 0x802F, "gethighestnodestance" }, + { 0x8030, "doesnodeallowstance" }, + { 0x8031, "getgunangles" }, + { 0x8032, "magicgrenade" }, + { 0x8033, "magicgrenademanual" }, + { 0x8034, "setfriendlychain" }, + { 0x8035, "getentnum" }, + { 0x8036, "launch" }, + { 0x8037, "setsoundblend" }, + { 0x8038, "makefakeai" }, + { 0x8039, "spawndrone" }, + { 0x803A, "setcorpseremovetimer" }, + { 0x803B, "setlookattext" }, + { 0x803C, "setspawnerteam" }, + { 0x803D, "addaieventlistener" }, + { 0x803E, "removeaieventlistener" }, + { 0x803F, "getlightcolor" }, + { 0x8040, "setlightcolor" }, + { 0x8041, "getlightradius" }, + { 0x8042, "setlightradius" }, + { 0x8043, "getattachignorecollision" }, + { 0x8044, "hidepart" }, + { 0x8045, "hidepart_allinstances" }, + { 0x8046, "hideallparts" }, + { 0x8047, "showpart" }, + { 0x8048, "showallparts" }, + { 0x8049, "linkto" }, + { 0x804A, "linktoblendtotag" }, + { 0x804B, "unlink" }, + { 0x804C, "setnormalhealth" }, + { 0x804D, "dodamage" }, + { 0x804E, "kill" }, + { 0x804F, "show" }, + { 0x8050, "hide" }, + { 0x8051, "showonclient" }, + { 0x8052, "hideonclient" }, + { 0x8053, "laserforceon" }, + { 0x8054, "laserforceoff" }, + { 0x8055, "disconnectpaths" }, + { 0x8056, "connectpaths" }, + { 0x8057, "startusingheroonlylighting" }, + { 0x8058, "stopusingheroonlylighting" }, + { 0x8059, "startusinglessfrequentlighting" }, + { 0x805A, "stopusinglessfrequentlighting" }, + { 0x805B, "setthermalfog" }, + { 0x805C, "setnightvisionfog" }, + { 0x805D, "clearthermalfog" }, + { 0x805E, "clearnightvisionfog" }, + { 0x805F, "digitaldistortsetparams" }, + { 0x8060, "setmode" }, + { 0x8061, "getmode" }, + { 0x8062, "setturretignoregoals" }, + { 0x8063, "islinked" }, + { 0x8064, "enablelinkto" }, + { 0x8065, "playsoundatviewheight" }, + { 0x8066, "prefetchsound" }, + { 0x8067, "setpitch" }, + { 0x8068, "scalepitch" }, + { 0x8069, "setvolume" }, + { 0x806A, "scalevolume" }, + { 0x806B, "setspeakermapmonotostereo" }, + { 0x806C, "setspeakermapmonoto51" }, + { 0x806D, "setdistributed2dsound" }, + { 0x806E, "playsoundasmaster" }, + { 0x806F, "playloopsound" }, + { 0x8070, "eqon" }, + { 0x8071, "eqoff" }, + { 0x8072, "haseq" }, + { 0x8073, "iswaitingonsound" }, + { 0x8074, "getnormalhealth" }, + { 0x8075, "playerlinkto" }, + { 0x8076, "playerlinktodelta" }, + { 0x8077, "playerlinkweaponviewtodelta" }, + { 0x8078, "playerlinktoabsolute" }, + { 0x8079, "playerlinktoblend" }, + { 0x807A, "playerlinkedoffsetenable" }, + { 0x807B, "setwaypointedgestyle_secondaryarrow" }, + { 0x807C, "setwaypointiconoffscreenonly" }, + { 0x807D, "fadeovertime" }, + { 0x807E, "scaleovertime" }, + { 0x807F, "moveovertime" }, + { 0x8080, "reset" }, + { 0x8081, "destroy" }, + { 0x8082, "setpulsefx" }, + { 0x8083, "setplayernamestring" }, + { 0x8084, "changefontscaleovertime" }, + { 0x8085, "startignoringspotlight" }, + { 0x8086, "stopignoringspotlight" }, + { 0x8087, "dontcastshadows" }, + { 0x8088, "castshadows" }, + { 0x8089, "setstablemissile" }, + { 0x808A, "playersetgroundreferenceent" }, + { 0x808B, "dontinterpolate" }, + { 0x808C, "dospawn" }, + { 0x808D, "stalingradspawn" }, + { 0x808E, "getorigin" }, + { 0x808F, "getcentroid" }, + { 0x8090, "getshootatpos" }, + { 0x8091, "getdebugeye" }, + { 0x8092, "useby" }, + { 0x8093, "playsound" }, + { 0x8094, "playerlinkedoffsetdisable" }, + { 0x8095, "playerlinkedsetviewznear" }, + { 0x8096, "playerlinkedsetusebaseangleforviewclamp" }, + { 0x8097, "lerpviewangleclamp" }, + { 0x8098, "setviewangleresistance" }, + { 0x8099, "geteye" }, + { 0x809A, "istouching" }, + { 0x809B, "stoploopsound" }, + { 0x809C, "stopsounds" }, + { 0x809D, "playrumbleonentity" }, + { 0x809E, "playrumblelooponentity" }, + { 0x809F, "stoprumble" }, + { 0x80A0, "delete" }, + { 0x80A1, "setmodel" }, + { 0x80A2, "laseron" }, + { 0x80A3, "laseroff" }, + { 0x80A4, "laseraltviewon" }, + { 0x80A5, "laseraltviewoff" }, + { 0x80A6, "thermalvisionon" }, + { 0x80A7, "thermalvisionoff" }, + { 0x80A8, "thermalvisionfofoverlayon" }, + { 0x80A9, "thermalvisionfofoverlayoff" }, + { 0x80AA, "autospotoverlayon" }, + { 0x80AB, "autospotoverlayoff" }, + { 0x80AC, "setcontents" }, + { 0x80AD, "makeusable" }, + { 0x80AE, "makeunusable" }, + { 0x80AF, "setwhizbyprobabilities" }, + { 0x80B0, "visionsetnakedforplayer_lerp" }, + { 0x80B1, "setwaitnode" }, + { 0x80B2, "returnplayercontrol" }, + { 0x80B3, "vehphys_starttrack" }, + { 0x80B4, "vehphys_clearautodisable" }, + { 0x80B5, "vehicleusealtblendedaudio" }, + { 0x80B6, "settext" }, + { 0x80B7, "clearalltextafterhudelem" }, + { 0x80B8, "setshader" }, + { 0x80B9, "settargetent" }, + { 0x80BA, "cleartargetent" }, + { 0x80BB, "settimer" }, + { 0x80BC, "settimerup" }, + { 0x80BD, "settimerstatic" }, + { 0x80BE, "settenthstimer" }, + { 0x80BF, "settenthstimerup" }, + { 0x80C0, "settenthstimerstatic" }, + { 0x80C1, "setclock" }, + { 0x80C2, "setclockup" }, + { 0x80C3, "setvalue" }, + { 0x80C4, "setwaypoint" }, + { 0x80C5, "setwaypointedgestyle_rotatingicon" }, + { 0x80C6, "setcursorhint" }, + { 0x80C7, "sethintstring" }, + { 0x80C8, "forceusehinton" }, + { 0x80C9, "forceusehintoff" }, + { 0x80CA, "makesoft" }, + { 0x80CB, "makehard" }, + { 0x80CC, "willneverchange" }, + { 0x80CD, "startfiring" }, + { 0x80CE, "stopfiring" }, + { 0x80CF, "isfiringturret" }, + { 0x80D0, "startbarrelspin" }, + { 0x80D1, "stopbarrelspin" }, + { 0x80D2, "getbarrelspinrate" }, + { 0x80D3, "remotecontrolturret" }, + { 0x80D4, "remotecontrolturretoff" }, + { 0x80D5, "shootturret" }, + { 0x80D6, "getturretowner" }, + { 0x80D7, "enabledeathshield" }, + { 0x80D8, "nightvisiongogglesforceon" }, + { 0x80D9, "nightvisiongogglesforceoff" }, + { 0x80DA, "enableinvulnerability" }, + { 0x80DB, "disableinvulnerability" }, + { 0x80DC, "enablebreaching" }, + { 0x80DD, "disablebreaching" }, + { 0x80DE, "forceviewmodelanimation" }, + { 0x80DF, "disableturretdismount" }, + { 0x80E0, "enableturretdismount" }, + { 0x80E1, "uploadscore" }, + { 0x80E2, "uploadtime" }, + { 0x80E3, "uploadleaderboards" }, + { 0x80E4, "giveachievement" }, + { 0x80E5, "hidehud" }, + { 0x80E6, "showhud" }, + { 0x80E7, "mountvehicle" }, + { 0x80E8, "dismountvehicle" }, + { 0x80E9, "enableslowaim" }, + { 0x80EA, "disableslowaim" }, + { 0x80EB, "usehintsinvehicle" }, + { 0x80EC, "vehicleattackbuttonpressed" }, + { 0x80ED, "setwhizbyoffset" }, + { 0x80EE, "setsentryowner" }, + { 0x80EF, "setsentrycarrier" }, + { 0x80F0, "setturretminimapvisible" }, + { 0x80F1, "settargetentity" }, + { 0x80F2, "snaptotargetentity" }, + { 0x80F3, "cleartargetentity" }, + { 0x80F4, "getturrettarget" }, + { 0x80F5, "setplayerspread" }, + { 0x80F6, "setaispread" }, + { 0x80F7, "setsuppressiontime" }, + { 0x80F8, "setflaggedanimknobrestart" }, + { 0x80F9, "setflaggedanimknoblimitedrestart" }, + { 0x80FA, "setflaggedanimknoball" }, + { 0x80FB, "setflaggedanimknoballrestart" }, + { 0x80FC, "setflaggedanim" }, + { 0x80FD, "setflaggedanimlimited" }, + { 0x80FE, "setflaggedanimrestart" }, + { 0x80FF, "setflaggedanimlimitedrestart" }, + { 0x8100, "useanimtree" }, + { 0x8101, "stopuseanimtree" }, + { 0x8102, "setanimtime" }, + { 0x8103, "showviewmodel" }, + { 0x8104, "hideviewmodel" }, + { 0x8105, "allowstand" }, + { 0x8106, "allowcrouch" }, + { 0x8107, "allowprone" }, + { 0x8108, "allowlean" }, + { 0x8109, "setocclusion" }, + { 0x810A, "deactivateocclusion" }, + { 0x810B, "isocclusionenabled" }, + { 0x810C, "iseqenabled" }, + { 0x810D, "seteq" }, + { 0x810E, "seteqbands" }, + { 0x810F, "deactivateeq" }, + { 0x8110, "seteqlerp" }, + { 0x8111, "islookingat" }, + { 0x8112, "isthrowinggrenade" }, + { 0x8113, "isfiring" }, + { 0x8114, "ismeleeing" }, + { 0x8115, "setautopickup" }, + { 0x8116, "allowmelee" }, + { 0x8117, "allowfire" }, + { 0x8118, "enablehealthshield" }, + { 0x8119, "setconvergencetime" }, + { 0x811A, "setconvergenceheightpercent" }, + { 0x811B, "setturretteam" }, + { 0x811C, "maketurretsolid" }, + { 0x811D, "maketurretoperable" }, + { 0x811E, "maketurretinoperable" }, + { 0x811F, "makeentitysentient" }, + { 0x8120, "freeentitysentient" }, + { 0x8121, "isindoor" }, + { 0x8122, "getdroptofloorposition" }, + { 0x8123, "isbadguy" }, + { 0x8124, "animscripted" }, + { 0x8125, "animscriptedthirdperson" }, + { 0x8126, "animrelative" }, + { 0x8127, "stopanimscripted" }, + { 0x8128, "clearanim" }, + { 0x8129, "setanimknob" }, + { 0x812A, "setanimknoblimited" }, + { 0x812B, "setanimknobrestart" }, + { 0x812C, "setanimknoblimitedrestart" }, + { 0x812D, "setanimknoball" }, + { 0x812E, "setanimknoballlimited" }, + { 0x812F, "setanimknoballrestart" }, + { 0x8130, "setanimknoballlimitedrestart" }, + { 0x8131, "setanim" }, + { 0x8132, "setanimlimited" }, + { 0x8133, "setanimrestart" }, + { 0x8134, "setanimlimitedrestart" }, + { 0x8135, "getanimtime" }, + { 0x8136, "getanimweight" }, + { 0x8137, "getanimassettype" }, + { 0x8138, "setflaggedanimknob" }, + { 0x8139, "setflaggedanimknoblimited" }, + { 0x813A, "setturretaccuracy" }, + { 0x813B, "setrightarc" }, + { 0x813C, "setleftarc" }, + { 0x813D, "settoparc" }, + { 0x813E, "setbottomarc" }, + { 0x813F, "setautorotationdelay" }, + { 0x8140, "setdefaultdroppitch" }, + { 0x8141, "restoredefaultdroppitch" }, + { 0x8142, "turretfiredisable" }, + { 0x8143, "getfixednodesafevolume" }, + { 0x8144, "clearfixednodesafevolume" }, + { 0x8145, "isingoal" }, + { 0x8146, "setruntopos" }, + { 0x8147, "nearnode" }, + { 0x8148, "nearclaimnode" }, + { 0x8149, "nearclaimnodeandangle" }, + { 0x814A, "atdangerousnode" }, + { 0x814B, "getenemyinfo" }, + { 0x814C, "clearenemy" }, + { 0x814D, "setentitytarget" }, + { 0x814E, "clearentitytarget" }, + { 0x814F, "setpotentialthreat" }, + { 0x8150, "clearpotentialthreat" }, + { 0x8151, "setflashbanged" }, + { 0x8152, "setengagementmindist" }, + { 0x8153, "setengagementmaxdist" }, + { 0x8154, "isknownenemyinradius" }, + { 0x8155, "isknownenemyinvolume" }, + { 0x8156, "settalktospecies" }, + { 0x8157, "laseralton" }, + { 0x8158, "laseraltoff" }, + { 0x8159, "invisiblenotsolid" }, + { 0x815A, "visiblesolid" }, + { 0x815B, "setdefaultaimlimits" }, + { 0x815C, "initriotshieldhealth" }, + { 0x815D, "getenemysqdist" }, + { 0x815E, "getclosestenemysqdist" }, + { 0x815F, "setthreatbiasgroup" }, + { 0x8160, "getthreatbiasgroup" }, + { 0x8161, "turretfireenable" }, + { 0x8162, "setturretmodechangewait" }, + { 0x8163, "usetriggerrequirelookat" }, + { 0x8164, "getstance" }, + { 0x8165, "setstance" }, + { 0x8166, "itemweaponsetammo" }, + { 0x8167, "getammocount" }, + { 0x8168, "gettagorigin" }, + { 0x8169, "gettagangles" }, + { 0x816A, "shellshock" }, + { 0x816B, "stunplayer" }, + { 0x816C, "stopshellshock" }, + { 0x816D, "fadeoutshellshock" }, + { 0x816E, "setdepthoffield" }, + { 0x816F, "setviewmodeldepthoffield" }, + { 0x8170, "setmotionblurmovescale" }, + { 0x8171, "pickupgrenade" }, + { 0x8172, "useturret" }, + { 0x8173, "stopuseturret" }, + { 0x8174, "canuseturret" }, + { 0x8175, "traversemode" }, + { 0x8176, "animmode" }, + { 0x8177, "orientmode" }, + { 0x8178, "getmotionangle" }, + { 0x8179, "shouldfacemotion" }, + { 0x817A, "getanglestolikelyenemypath" }, + { 0x817B, "setturretanim" }, + { 0x817C, "getturret" }, + { 0x817D, "getgroundenttype" }, + { 0x817E, "animcustom" }, + { 0x817F, "isinscriptedstate" }, + { 0x8180, "canattackenemynode" }, + { 0x8181, "getnegotiationstartnode" }, + { 0x8182, "getnegotiationendnode" }, + { 0x8183, "getdoorpathnode" }, + { 0x8184, "comparenodedirtopathdir" }, + { 0x8185, "checkprone" }, + { 0x8186, "pushplayer" }, + { 0x8187, "checkgrenadethrowpos" }, + { 0x8188, "setgoalnode" }, + { 0x8189, "setgoalpos" }, + { 0x818A, "setgoalentity" }, + { 0x818B, "setgoalvolume" }, + { 0x818C, "setgoalvolumeauto" }, + { 0x818D, "getgoalvolume" }, + { 0x818E, "cleargoalvolume" }, + { 0x818F, "setfixednodesafevolume" }, + { 0x8190, "setmotionblurturnscale" }, + { 0x8191, "setmotionblurzoomscale" }, + { 0x8192, "viewkick" }, + { 0x8193, "localtoworldcoords" }, + { 0x8194, "getentitynumber" }, + { 0x8195, "getentityvelocity" }, + { 0x8196, "enablegrenadetouchdamage" }, + { 0x8197, "disablegrenadetouchdamage" }, + { 0x8198, "enableaimassist" }, + { 0x8199, "setlookatyawlimits" }, + { 0x819A, "stoplookat" }, + { 0x819B, "getmuzzlepos" }, + { 0x819C, "getmuzzleangle" }, + { 0x819D, "getmuzzlesideoffsetpos" }, + { 0x819E, "getaimangle" }, + { 0x819F, "canshoot" }, + { 0x81A0, "canshootenemy" }, + { 0x81A1, "cansee" }, + { 0x81A2, "seerecently" }, + { 0x81A3, "lastknowntime" }, + { 0x81A4, "lastknownpos" }, + { 0x81A5, "dropweapon" }, + { 0x81A6, "maymovetopoint" }, + { 0x81A7, "maymovefrompointtopoint" }, + { 0x81A8, "teleport" }, + { 0x81A9, "forceteleport" }, + { 0x81AA, "safeteleport" }, + { 0x81AB, "withinapproxpathdist" }, + { 0x81AC, "ispathdirect" }, + { 0x81AD, "allowedstances" }, + { 0x81AE, "isstanceallowed" }, + { 0x81AF, "issuppressionwaiting" }, + { 0x81B0, "issuppressed" }, + { 0x81B1, "ismovesuppressed" }, + { 0x81B2, "isgrenadepossafe" }, + { 0x81B3, "checkgrenadethrow" }, + { 0x81B4, "checkgrenadelaunch" }, + { 0x81B5, "checkgrenadelaunchpos" }, + { 0x81B6, "throwgrenade" }, + { 0x81B7, "disableaimassist" }, + { 0x81B8, "radiusdamage" }, + { 0x81B9, "detonate" }, + { 0x81BA, "damageconetrace" }, + { 0x81BB, "sightconetrace" }, + { 0x81BC, "missile_settargetent" }, + { 0x81BD, "missile_settargetpos" }, + { 0x81BE, "missile_cleartarget" }, + { 0x81BF, "missile_setflightmodedirect" }, + { 0x81C0, "missile_setflightmodetop" }, + { 0x81C1, "getlightintensity" }, + { 0x81C2, "setlightintensity" }, + { 0x81C3, "isragdoll" }, + { 0x81C4, "setmovespeedscale" }, + { 0x81C5, "cameralinkto" }, + { 0x81C6, "cameraunlink" }, + { 0x81C7, "startcoverarrival" }, + { 0x81C8, "starttraversearrival" }, + { 0x81C9, "checkcoverexitposwithpath" }, + { 0x81CA, "shoot" }, + { 0x81CB, "shootblank" }, + { 0x81CC, "melee" }, + { 0x81CD, "updateplayersightaccuracy" }, + { 0x81CE, "findshufflecovernode" }, + { 0x81CF, "findnearbycovernode" }, + { 0x81D0, "findcovernode" }, + { 0x81D1, "findbestcovernode" }, + { 0x81D2, "getcovernode" }, + { 0x81D3, "usecovernode" }, + { 0x81D4, "iscovervalidagainstenemy" }, + { 0x81D5, "reacquirestep" }, + { 0x81D6, "findreacquiredirectpath" }, + { 0x81D7, "trimpathtoattack" }, + { 0x81D8, "reacquiremove" }, + { 0x81D9, "findreacquireproximatepath" }, + { 0x81DA, "flagenemyunattackable" }, + { 0x81DB, "enterprone" }, + { 0x81DC, "exitprone" }, + { 0x81DD, "setproneanimnodes" }, + { 0x81DE, "updateprone" }, + { 0x81DF, "clearpitchorient" }, + { 0x81E0, "setlookatanimnodes" }, + { 0x81E1, "setlookat" }, + { 0x81E2, "setlookatentity" }, + { 0x81E3, "controlslinkto" }, + { 0x81E4, "controlsunlink" }, + { 0x81E5, "makevehiclesolidcapsule" }, + { 0x81E6, "makevehiclesolidsphere" }, + { 0x81E7, "makevehiclesolid" }, + { 0x81E8, "remotecontrolvehicle" }, + { 0x81E9, "remotecontrolvehicleoff" }, + { 0x81EA, "isfiringvehicleturret" }, + { 0x81EB, "drivevehicleandcontrolturret" }, + { 0x81EC, "drivevehicleandcontrolturretoff" }, + { 0x81ED, "getplayersetting" }, + { 0x81EE, "getlocalplayerprofiledata" }, + { 0x81EF, "setlocalplayerprofiledata" }, + { 0x81F0, "remotecamerasoundscapeon" }, + { 0x81F1, "remotecamerasoundscapeoff" }, + { 0x81F2, "radarjamon" }, + { 0x81F3, "radarjamoff" }, + { 0x81F4, "setmotiontrackervisible" }, + { 0x81F5, "getmotiontrackervisible" }, + { 0x81F6, "worldpointinreticle_circle" }, + { 0x81F7, "getpointinbounds" }, + { 0x81F8, "transfermarkstonewscriptmodel" }, + { 0x81F9, "setwatersheeting" }, + { 0x81FA, "setweaponhudiconoverride" }, + { 0x81FB, "getweaponhudiconoverride" }, + { 0x81FC, "setempjammed" }, + { 0x81FD, "playersetexpfog" }, + { 0x81FE, "isitemunlocked" }, + { 0x81FF, "getplayerdata" }, + { 0x8200, "vehicleturretcontroloff" }, + { 0x8201, "isturretready" }, + { 0x8202, "vehicledriveto" }, + { 0x8203, "dospawn" }, + { 0x8204, "isphysveh" }, + { 0x8205, "phys_crash" }, + { 0x8206, "phys_launch" }, + { 0x8207, "phys_disablecrashing" }, + { 0x8208, "phys_enablecrashing" }, + { 0x8209, "phys_setspeed" }, + { 0x820A, "phys_setconveyerbelt" }, + { 0x820B, "freehelicopter" }, + { 0x820C, "playerlinkedturretanglesenable" }, + { 0x820D, "playerlinkedturretanglesdisable" }, + { 0x820E, "playersetstreamorigin" }, + { 0x820F, "playerclearstreamorigin" }, + { 0x8210, "nightvisionviewon" }, + { 0x8211, "nightvisionviewoff" }, + { 0x8212, "painvisionon" }, + { 0x8213, "painvisionoff" }, + { 0x8214, "getplayerintelisfound" }, + { 0x8215, "setplayerintelfound" }, + { 0x8216, "newpip" }, + { 0x8217, "sethuddynlight" }, + { 0x8218, "startscriptedanim" }, + { 0x8219, "startcoverbehavior" }, + { 0x821A, "setplayerdata" }, + { 0x821B, "trackerupdate" }, + { 0x821C, "pingplayer" }, + { 0x821D, "buttonpressed" }, + { 0x821E, "sayall" }, + { 0x821F, "sayteam" }, + { 0x8220, "showscoreboard" }, + { 0x8221, "setspawnweapon" }, + { 0x8222, "dropitem" }, + { 0x8223, "dropscavengerbag" }, + { 0x8224, "setjitterparams" }, + { 0x8225, "sethoverparams" }, + { 0x8226, "joltbody" }, + { 0x8227, "freevehicle" }, + { 0x8228, "getwheelsurface" }, + { 0x8229, "getvehicleowner" }, + { 0x822A, "setvehiclelookattext" }, + { 0x822B, "setvehicleteam" }, + { 0x822C, "setneargoalnotifydist" }, + { 0x822D, "setvehgoalpos" }, + { 0x822E, "setgoalyaw" }, + { 0x822F, "cleargoalyaw" }, + { 0x8230, "settargetyaw" }, + { 0x8231, "cleartargetyaw" }, + { 0x8232, "vehicle_helisetai" }, + { 0x8233, "setturrettargetvec" }, + { 0x8234, "setturrettargetent" }, + { 0x8235, "clearturrettarget" }, + { 0x8236, "vehicle_canturrettargetpoint" }, + { 0x8237, "setlookatent" }, + { 0x8238, "clearlookatent" }, + { 0x8239, "setvehweapon" }, + { 0x823A, "fireweapon" }, + { 0x823B, "vehicleturretcontrolon" }, + { 0x823C, "finishplayerdamage" }, + { 0x823D, "suicide" }, + { 0x823E, "closeingamemenu" }, + { 0x823F, "iprintln" }, + { 0x8240, "iprintlnbold" }, + { 0x8241, "spawn" }, + { 0x8242, "setentertime" }, + { 0x8243, "cloneplayer" }, + { 0x8244, "istalking" }, + { 0x8245, "allowspectateteam" }, + { 0x8246, "getguid" }, + { 0x8247, "physicslaunchserver" }, + { 0x8248, "physicslaunchserveritem" }, + { 0x8249, "clonebrushmodeltoscriptmodel" }, + { 0x824A, "scriptmodelplayanim" }, + { 0x824B, "scriptmodelclearanim" }, + { 0x824C, "vehicle_teleport" }, + { 0x824D, "attachpath" }, + { 0x824E, "getattachpos" }, + { 0x824F, "startpath" }, + { 0x8250, "setswitchnode" }, + { 0x8251, "setwaitspeed" }, + { 0x8252, "vehicle_finishdamage" }, + { 0x8253, "vehicle_setspeed" }, + { 0x8254, "vehicle_setspeedimmediate" }, + { 0x8255, "vehicle_rotateyaw" }, + { 0x8256, "vehicle_getspeed" }, + { 0x8257, "vehicle_getvelocity" }, + { 0x8258, "vehicle_getbodyvelocity" }, + { 0x8259, "vehicle_getsteering" }, + { 0x825A, "vehicle_getthrottle" }, + { 0x825B, "vehicle_turnengineoff" }, + { 0x825C, "vehicle_turnengineon" }, + { 0x825D, "getgoalspeedmph" }, + { 0x825E, "setacceleration" }, + { 0x825F, "setdeceleration" }, + { 0x8260, "resumespeed" }, + { 0x8261, "setyawspeed" }, + { 0x8262, "setyawspeedbyname" }, + { 0x8263, "setmaxpitchroll" }, + { 0x8264, "setairresistance" }, + { 0x8265, "setturningability" }, + { 0x8266, "getxuid" }, + { 0x8267, "ishost" }, + { 0x8268, "getspectatingplayer" }, + { 0x8269, "predictstreampos" }, + { 0x826A, "updatescores" }, + { 0x826B, "updatedmscores" }, + { 0x826C, "setrank" }, + { 0x826D, "setcardtitle" }, + { 0x826E, "weaponlocknoclearance" }, + { 0x826F, "visionsyncwithplayer" }, + { 0x8270, "showhudsplash" }, + { 0x8271, "setperk" }, + { 0x8272, "hasperk" }, + { 0x8273, "clearperks" }, + { 0x8274, "unsetperk" }, + { 0x8275, "noclip" }, + { 0x8276, "ufo" }, + { 0x8277, "moveto" }, + { 0x8278, "movex" }, + { 0x8279, "movey" }, + { 0x827A, "movez" }, + { 0x827B, "movegravity" }, + { 0x827C, "moveslide" }, + { 0x827D, "stopmoveslide" }, + { 0x827E, "rotateto" }, + { 0x827F, "rotatepitch" }, + { 0x8280, "rotateyaw" }, + { 0x8281, "rotateroll" }, + { 0x8282, "addpitch" }, + { 0x8283, "addyaw" }, + { 0x8284, "addroll" }, + { 0x8285, "vibrate" }, + { 0x8286, "rotatevelocity" }, + { 0x8287, "solid" }, + { 0x8288, "notsolid" }, + { 0x8289, "setcandamage" }, + { 0x828A, "setcanradiusdamage" }, + { 0x828B, "physicslaunchclient" }, + { 0x828C, "setcardicon" }, + { 0x828D, "setcardnameplate" }, + { 0x828E, "setcarddisplayslot" }, + { 0x828F, "kc_regweaponforfxremoval" }, + { 0x8290, "laststandrevive" }, + { 0x8291, "setspectatedefaults" }, + { 0x8292, "getthirdpersoncrosshairoffset" }, + { 0x8293, "disableweaponpickup" }, + { 0x8294, "enableweaponpickup" }, + { 0x8295, "issplitscreenplayer" }, + { 0x8296, "getweaponslistoffhands" }, + { 0x8297, "getweaponslistitems" }, + { 0x8298, "getweaponslistexclusives" }, + { 0x8299, "getweaponslist" }, + { 0x829A, "canplayerplacesentry" }, + { 0x829B, "canplayerplacetank" }, + { 0x829C, "visionsetnakedforplayer" }, + { 0x829D, "visionsetnightforplayer" }, + { 0x829E, "visionsetmissilecamforplayer" }, + { 0x829F, "visionsetthermalforplayer" }, + { 0x82A0, "visionsetpainforplayer" }, + { 0x82A1, "setblurforplayer" }, + { 0x82A2, "getplayerweaponmodel" }, + { 0x82A3, "getplayerknifemodel" }, + { 0x82A4, "updateplayermodelwithweapons" }, + { 0x82A5, "notifyonplayercommand" }, + { 0x82A6, "canmantle" }, + { 0x82A7, "forcemantle" }, + { 0x82A8, "ismantling" }, + { 0x82A9, "playfx" }, + { 0x82AA, "player_recoilscaleon" }, + { 0x82AB, "player_recoilscaleoff" }, + { 0x82AC, "weaponlockstart" }, + { 0x82AD, "weaponlockfinalize" }, + { 0x82AE, "weaponlockfree" }, + { 0x82AF, "weaponlocktargettooclose" }, + { 0x82B0, "issplitscreenplayerprimary" }, + { 0x82B1, "getviewmodel" }, + { 0x82B2, "fragbuttonpressed" }, + { 0x82B3, "secondaryoffhandbuttonpressed" }, + { 0x82B4, "getcurrentweaponclipammo" }, + { 0x82B5, "setvelocity" }, + { 0x82B6, "getplayerviewheight" }, + { 0x82B7, "getnormalizedmovement" }, + { 0x82B8, "setchannelvolumes" }, + { 0x82B9, "deactivatechannelvolumes" }, + { 0x82BA, "playlocalsound" }, + { 0x82BB, "stoplocalsound" }, + { 0x82BC, "setweaponammoclip" }, + { 0x82BD, "setweaponammostock" }, + { 0x82BE, "getweaponammoclip" }, + { 0x82BF, "getweaponammostock" }, + { 0x82C0, "anyammoforweaponmodes" }, + { 0x82C1, "setclientdvar" }, + { 0x82C2, "setclientdvars" }, + { 0x82C3, "allowads" }, + { 0x82C4, "allowjump" }, + { 0x82C5, "allowsprint" }, + { 0x82C6, "setspreadoverride" }, + { 0x82C7, "resetspreadoverride" }, + { 0x82C8, "setaimspreadmovementscale" }, + { 0x82C9, "setactionslot" }, + { 0x82CA, "setviewkickscale" }, + { 0x82CB, "getviewkickscale" }, + { 0x82CC, "getweaponslistall" }, + { 0x82CD, "getweaponslistprimaries" }, + { 0x82CE, "getnormalizedcameramovement" }, + { 0x82CF, "giveweapon" }, + { 0x82D0, "takeweapon" }, + { 0x82D1, "takeallweapons" }, + { 0x82D2, "getcurrentweapon" }, + { 0x82D3, "getcurrentprimaryweapon" }, + { 0x82D4, "getcurrentoffhand" }, + { 0x82D5, "hasweapon" }, + { 0x82D6, "switchtoweapon" }, + { 0x82D7, "switchtoweaponimmediate" }, + { 0x82D8, "switchtooffhand" }, + { 0x82D9, "setoffhandsecondaryclass" }, + { 0x82DA, "getoffhandsecondaryclass" }, + { 0x82DB, "beginlocationselection" }, + { 0x82DC, "endlocationselection" }, + { 0x82DD, "disableweapons" }, + { 0x82DE, "enableweapons" }, + { 0x82DF, "disableoffhandweapons" }, + { 0x82E0, "enableoffhandweapons" }, + { 0x82E1, "disableweaponswitch" }, + { 0x82E2, "enableweaponswitch" }, + { 0x82E3, "openpopupmenu" }, + { 0x82E4, "openpopupmenunomouse" }, + { 0x82E5, "closepopupmenu" }, + { 0x82E6, "openmenu" }, + { 0x82E7, "closemenu" }, +// { 0x82E8, "__builtin_func_82E8" }, + { 0x82E9, "freezecontrols" }, + { 0x82EA, "disableusability" }, + { 0x82EB, "enableusability" }, + { 0x82EC, "setwhizbyspreads" }, + { 0x82ED, "setwhizbyradii" }, + { 0x82EE, "setreverb" }, + { 0x82EF, "deactivatereverb" }, + { 0x82F0, "setvolmod" }, + { 0x82F1, "setchannelvolume" }, + { 0x82F2, "givestartammo" }, + { 0x82F3, "givemaxammo" }, + { 0x82F4, "getfractionstartammo" }, + { 0x82F5, "getfractionmaxammo" }, + { 0x82F6, "isdualwielding" }, + { 0x82F7, "isreloading" }, + { 0x82F8, "isswitchingweapon" }, + { 0x82F9, "setorigin" }, + { 0x82FA, "getvelocity" }, + { 0x82FB, "setplayerangles" }, + { 0x82FC, "getplayerangles" }, + { 0x82FD, "usebuttonpressed" }, + { 0x82FE, "attackbuttonpressed" }, + { 0x82FF, "adsbuttonpressed" }, + { 0x8300, "meleebuttonpressed" }, + { 0x8301, "playerads" }, + { 0x8302, "isonground" }, + { 0x8303, "isusingturret" }, + { 0x8304, "setviewmodel" }, + { 0x8305, "setoffhandprimaryclass" }, + { 0x8306, "getoffhandprimaryclass" }, + { 0x8307, "startac130" }, + { 0x8308, "stopac130" }, + { 0x8309, "enablemousesteer" }, + { 0x830A, "setscriptmoverkillcam" }, + { 0x830B, "setmapnamestring" }, + { 0x830C, "setgametypestring" }, +}}; + +const std::array file_list +{{ + { 29, "maps/mp/gametypes/_tweakables" }, + { 30, "common_scripts/utility" }, + { 31, "common_scripts/_createfxmenu" }, + { 32, "common_scripts/_fx" }, + { 65, "maps/_utility" }, + { 66, "maps/_mgturret" }, + { 67, "maps/_bcs_location_trigs" }, + { 68, "maps/_anim" }, + { 69, "maps/_gameskill" }, + { 70, "common_scripts/_destructible" }, + { 94, "common_scripts/_destructible_types" }, + { 95, "maps/_vehicle" }, + { 96, "maps/_mg_penetration" }, + { 97, "maps/_rank" }, + { 98, "maps/_hud_util" }, + { 99, "maps/_hud" }, + { 100, "maps/_missions" }, + { 101, "maps/_colors" }, + { 102, "maps/_spawner" }, + { 103, "maps/_audio" }, + { 104, "maps/_audio_stream_manager" }, + { 133, "maps/_audio_dynamic_ambi" }, + { 134, "maps/_audio_reverb" }, + { 135, "maps/_audio_mix_manager" }, + { 136, "maps/_audio_presets_vehicles" }, + { 137, "maps/_specialops" }, + { 138, "maps/_lights" }, + { 139, "maps/_audio_zone_manager" }, + { 176, "maps/_audio_music" }, + { 177, "maps/_audio_whizby" }, + { 178, "maps/_audio_vehicles" }, + { 179, "maps/_specialops_code" }, + { 180, "maps/_specialops_battlechatter" }, + { 181, "maps/_endmission" }, + { 182, "maps/_utility_code" }, + { 183, "maps/_load" }, + { 184, "maps/_quotes" }, + { 185, "maps/_ambient" }, + { 196, "character/character_hero_europe_price_cc" }, + { 224, "maps/_coop" }, + { 225, "common_scripts/_artcommon" }, + { 226, "maps/_arcademode" }, + { 227, "maps/_damagefeedback" }, + { 228, "maps/_laststand" }, + { 229, "maps/_player_stats" }, + { 230, "maps/_art" }, + { 234, "character/character_tank_crew_a" }, + { 235, "character/character_tank_crew_b" }, + { 264, "maps/_noder" }, + { 265, "common_scripts/_painter" }, + { 266, "maps/_createfx" }, + { 267, "maps/_global_fx" }, + { 268, "maps/_detonategrenades" }, + { 269, "maps/_names" }, + { 270, "maps/_autosave" }, + { 271, "maps/_debug" }, + { 272, "maps/_loadout" }, + { 273, "common_scripts/_elevator" }, + { 314, "common_scripts/_pipes" }, + { 315, "common_scripts/_dynamic_world" }, + { 316, "maps/_introscreen" }, + { 317, "maps/_shutter" }, + { 318, "maps/_escalator" }, + { 319, "maps/_friendlyfire" }, + { 320, "maps/_interactive_objects" }, + { 321, "maps/_intelligence" }, + { 322, "maps/_animatedmodels" }, + { 323, "maps/_fx" }, + { 324, "codescripts/character" }, + { 325, "maps/_compass" }, + { 326, "maps/_hiding_door" }, + { 330, "character/character_opforce_henchmen_lmg_a" }, + { 331, "character/character_opforce_henchmen_lmg_b" }, + { 332, "character/character_hero_europe_price_a" }, + { 358, "maps/_drone" }, + { 359, "maps/_patrol" }, + { 360, "maps/_vehicle_aianim" }, + { 361, "maps/_helicopter_ai" }, + { 362, "maps/_helicopter_globals" }, + { 363, "vehicle_scripts/_attack_heli" }, +// maps/vehiclenames?? + { 365, "maps/_treadfx" }, + { 366, "maps/mp/_utility" }, + { 367, "maps/mp/gametypes/_rank" }, + { 368, "maps/mp/gametypes/_persistence" }, + { 375, "character/character_hero_europe_price_aa" }, + { 396, "maps/_dshk_player_rescue" }, + { 400, "maps/mp/gametypes/_gamelogic" }, + { 401, "maps/mp/killstreaks/_killstreaks" }, + { 402, "maps/mp/gametypes/_missions" }, + { 403, "maps/mp/gametypes/_hud_message" }, + { 404, "characters/mp_character_ally_ghillie_desert" }, + { 405, "characters/mp_character_op_ghillie_desert" }, + { 406, "character/mp_character_ally_ghillie_arctic" }, + { 407, "character/mp_character_op_ghillie_arctic" }, + { 408, "character/mp_character_ally_ghillie_urban" }, + { 409, "character/mp_character_op_ghillie_urban" }, + { 410, "character/mp_character_ally_ghillie_forest" }, + { 411, "character/mp_character_op_ghillie_forest" }, + { 412, "character/mp_character_op_ghillie_militia" }, + { 413, "xmodelalias/alias_delta_elite_heads" }, + { 450, "xmodelalias/alias_delta_elite_heads_longsleeves" }, + { 451, "character/mp_character_delta_elite_assault_aa" }, + { 452, "character/mp_character_delta_elite_assault_ab" }, + { 453, "character/mp_character_delta_elite_assault_ba" }, + { 454, "character/mp_character_delta_elite_assault_bb" }, + { 455, "character/mp_character_delta_elite_lmg_a" }, + { 456, "character/mp_character_delta_elite_lmg_b" }, + { 457, "character/mp_character_delta_elite_smg_a" }, + { 458, "character/mp_character_delta_elite_smg_b" }, + { 488, "character/mp_character_delta_elite_shotgun_a" }, + { 489, "character/mp_character_delta_elite_sniper" }, + { 490, "xmodelalias/alias_sas_heads" }, + { 491, "character/mp_character_sas_urban_assault" }, + { 501, "character/character_hero_europe_soap_injured" }, + { 512, "common_scripts/_createfx" }, +// ... + { 528, "maps/so_survival_mp_paris_precache" }, +// ... + { 532, "character/mp_character_sas_urban_lmg" }, + { 533, "character/mp_character_sas_urban_shotgun" }, + { 534, "character/mp_character_sas_urban_smg" }, + { 535, "character/mp_character_sas_urban_sniper" }, + { 536, "character/mp_character_gign_paris_assault" }, + { 537, "character/mp_character_gign_paris_lmg" }, + { 538, "character/mp_character_gign_paris_shotgun" }, + { 539, "character/mp_character_gign_paris_smg" }, + { 540, "character/mp_character_gign_paris_riot" }, + { 541, "xmodelalias/alias_pmc_africa_heads" }, + { 542, "character/mp_character_pmc_africa_assault_a" }, + { 543, "character/mp_character_pmc_africa_assault_aa" }, + { 544, "character/character_mp_ally_juggernaut" }, +// ... + { 545, "character/mp_character_pmc_africa_lmg_a" }, + { 546, "character/mp_character_pmc_africa_lmg_aa" }, + { 547, "character/mp_character_pmc_africa_smg_aa" }, + { 548, "character/mp_character_pmc_africa_shotgun_a" }, +// ... + { 566, "maps/castle_fx" }, + { 567, "maps/castle_precache" }, +// ... + { 591, "character/mp_character_pmc_africa_sniper" }, + { 592, "character/mp_character_opforce_air_assault" }, + { 593, "character/mp_character_opforce_air_lmg" }, + { 594, "character/mp_character_opforce_air_shotgun" }, + { 595, "character/mp_character_opforce_air_smg" }, + { 596, "character/mp_character_opforce_air_sniper" }, + { 597, "character/character_mp_opforce_juggernaut" }, + { 598, "xmodelalias/alias_russian_military_arctic_heads" }, + { 599, "character/mp_character_opforce_snow_assault" }, + { 600, "character/mp_character_opforce_snow_lmg" }, +// ... + { 610, "maps/so_survival_mp_plaza2_precache" }, + { 611, "maps/so_survival_mp_hardhat_precache" }, +// ... + { 621, "character/mp_character_opforce_snow_shotgun" }, + { 622, "character/mp_character_opforce_snow_smg" }, + { 623, "character/mp_character_opforce_snow_sniper" }, + { 624, "character/mp_character_opforce_urban_assault" }, + { 625, "character/mp_character_opforce_urban_lmg" }, + { 626, "character/mp_character_opforce_urban_shotgun" }, + { 627, "character/mp_character_opforce_urban_smg" }, + { 628, "character/mp_character_opforce_urban_sniper" }, + { 629, "character/mp_character_opforce_woods_assault" }, +// ... + { 651, "character/mp_character_opforce_woods_lmg" }, + { 652, "character/mp_character_opforce_woods_shotgun" }, + { 653, "character/mp_character_opforce_woods_smg" }, + { 654, "character/mp_character_opforce_woods_sniper" }, + { 655, "xmodelalias/alias_africa_militia_heads_mp" }, + { 656, "character/mp_character_africa_militia_assault_a" }, +// { + { 660, "character/mp_character_africa_militia_lmg_b" }, +// { + { 662, "character/mp_character_africa_militia_shotgun_b" }, +// { + { 664, "character/mp_character_africa_militia_smg_b" }, +// { + { 666, "character/mp_character_africa_militia_sniper" }, + { 667, "xmodelalias/alias_henchmen_heads_mp" }, + { 668, "character/mp_character_opforce_hench_assault_a" }, + { 669, "character/mp_character_opforce_hench_assault_b" }, + { 670, "character/mp_character_opforce_hench_assault_c" }, + { 671, "character/mp_character_opforce_hench_assault_d" }, + { 672, "character/mp_character_opforce_hench_lmg_a" }, + { 673, "character/mp_character_opforce_hench_lmg_b" }, + { 674, "character/mp_character_opforce_hench_shgn_a" }, + { 675, "character/mp_character_opforce_hench_shgn_b" }, +// ... + { 690, "character/mp_character_pmc_africa_smg_a" }, +// ... + { 709, "character/mp_character_opforce_hench_smg_a" }, + { 710, "character/mp_character_opforce_hench_smg_b" }, + { 711, "character/mp_character_opforce_hench_sniper" }, + { 712, "maps/mp/gametypes/_hostmigration" }, + { 713, "mptype/mptype_ally_ghillie_desert" }, + { 714, "mptype/mptype_opforce_ghillie_desert" }, + { 715, "mptype/mptype_ally_ghillie_arctic" }, + { 716, "mptype/mptype_opforce_ghillie_arctic" }, + { 717, "mptype/mptype_ally_ghillie_urban" }, + { 718, "mptype/mptype_opforce_ghillie_urban" }, + { 719, "mptype/mptype_ally_ghillie_forest" }, + { 720, "mptype/mptype_opforce_ghillie_forest" }, + { 721, "mptype/mptype_opforce_ghillie_militia" }, + { 722, "mptype/mptype_delta_multicam_assault" }, + { 723, "mptype/mptype_delta_multicam_lmg" }, + { 724, "mptype/mptype_delta_multicam_smg" }, + { 725, "mptype/mptype_delta_multicam_shotgun" }, + { 726, "mptype/mptype_delta_multicam_riot" }, + { 727, "mptype/mptype_ally_juggernaut" }, + { 728, "mptype/mptype_sas_urban_assault" }, + { 729, "mptype/mptype_sas_urban_lmg" }, + { 730, "mptype/mptype_sas_urban_shotgun" }, + { 731, "mptype/mptype_sas_urban_smg" }, + { 732, "mptype/mptype_sas_urban_sniper" }, + { 733, "mptype/mptype_gign_paris_assault" }, + { 734, "mptype/mptype_gign_paris_lmg" }, + { 735, "mptype/mptype_gign_paris_shotgun" }, + { 736, "mptype/mptype_gign_paris_smg" }, + { 737, "maps/so_survival_mp_alpha_precache" }, + { 738, "maps/so_survival_mp_carbon_precache" }, + { 739, "maps/so_survival_mp_village_precache" }, + { 740, "maps/so_survival_mp_seatown_precache" }, + { 741, "maps/so_survival_mp_lambeth_precache" }, + { 742, "maps/so_survival_mp_bootleg_precache" }, + { 743, "maps/so_survival_mp_exchange_precache" }, + { 744, "maps/so_survival_mp_mogadishu_precache" }, +// ... + { 750, "maps/so_survival_mp_underground_precache" }, + { 751, "maps/so_survival_mp_interchange_precache" }, +// ... + { 767, "mptype/mptype_gign_paris_sniper" }, + { 768, "mptype/mptype_gign_paris_riot" }, + { 769, "mptype/mptype_pmc_africa_assault" }, + { 770, "mptype/mptype_pmc_africa_lmg" }, + { 771, "mptype/mptype_pmc_africa_smg" }, + { 772, "mptype/mptype_pmc_africa_shotgun" }, + { 773, "mptype/mptype_pmc_africa_sniper" }, + { 774, "mptype/mptype_pmc_africa_riot" }, + { 775, "mptype/mptype_opforce_air_assault" }, + { 776, "mptype/mptype_opforce_air_lmg" }, + { 777, "mptype/mptype_opforce_air_shotgun" }, + { 778, "mptype/mptype_opforce_air_smg" }, + { 779, "mptype/mptype_opforce_air_sniper" }, + { 780, "mptype/mptype_opforce_air_riot" }, + { 781, "mptype/mptype_opforce_juggernaut" }, + { 782, "mptype/mptype_opforce_snow_assault" }, + { 783, "mptype/mptype_opforce_snow_lmg" }, + { 784, "mptype/mptype_opforce_snow_shotgun" }, + { 785, "mptype/mptype_opforce_snow_smg" }, + { 786, "mptype/mptype_opforce_snow_sniper" }, + { 787, "mptype/mptype_opforce_snow_riot" }, + { 788, "mptype/mptype_opforce_urban_assault" }, + { 789, "mptype/mptype_opforce_urban_lmg" }, + { 790, "mptype/mptype_opforce_urban_shotgun" }, + { 791, "mptype/mptype_opforce_urban_smg" }, + { 792, "mptype/mptype_opforce_urban_sniper" }, + { 793, "mptype/mptype_opforce_urban_riot" }, + { 794, "mptype/mptype_opforce_woodland_assault" }, + { 795, "mptype/mptype_opforce_woodland_lmg" }, + { 796, "mptype/mptype_opforce_woodland_shotgun" }, +// ... + { 816, "maps/so_survival_mp_dome_precache" }, + { 817, "maps/so_survival_mp_radar_precache" }, + { 818, "maps/so_survival_mp_bravo_precache" }, + { 819, "mptype/mptype_opforce_woodland_smg" }, + { 820, "mptype/mptype_opforce_woodland_sniper" }, + { 821, "mptype/mptype_opforce_woodland_riot" }, + { 822, "mptype/mptype_opforce_africa_assault" }, + { 823, "mptype/mptype_opforce_africa_lmg" }, + { 824, "mptype/mptype_opforce_africa_shotgun" }, + { 825, "mptype/mptype_opforce_africa_smg" }, + { 826, "mptype/mptype_opforce_africa_sniper" }, + { 827, "mptype/mptype_opforce_africa_riot" }, + { 828, "mptype/mptype_opforce_henchmen_assault" }, + { 829, "mptype/mptype_delta_multicam_sniper" }, + { 830, "mptype/mptype_opforce_henchmen_lmg" }, + { 831, "mptype/mptype_opforce_henchmen_shotgun" }, + { 832, "mptype/mptype_opforce_henchmen_smg" }, + { 833, "mptype/mptype_opforce_henchmen_sniper" }, + { 834, "mptype/mptype_opforce_henchmen_riot" }, + { 835, "maps/mp/gametypes/_weapons" }, + { 836, "maps/mp/_entityheadicons" }, + { 837, "maps/mp/gametypes/_damagefeedback" }, + { 838, "maps/mp/_stinger" }, + { 839, "maps/mp/_flashgrenades" }, + { 840, "maps/mp/_empgrenade" }, + { 841, "maps/mp/gametypes/_class" }, + { 842, "maps/mp/_equipment" }, + { 843, "maps/mp/_javelin" }, + { 844, "maps/mp/gametypes/_shellshock" }, + { 845, "maps/mp/_matchdata" }, + { 846, "maps/mp/killstreaks/_perkstreaks" }, + { 847, "maps/mp/perks/_perkfunctions" }, + { 848, "maps/mp/gametypes/_scrambler" }, + { 849, "maps/mp/gametypes/_portable_radar" }, + { 850, "maps/mp/gametypes/_objpoints" }, + { 851, "maps/mp/gametypes/_hud_util" }, + { 852, "maps/mp/gametypes/_gameobjects" }, +// ... + { 873, "maps/mp/gametypes/_quickmessages" }, + { 874, "maps/mp/gametypes/_playerlogic" }, + { 875, "maps/mp/gametypes/_spectating" }, + { 876, "maps/mp/gametypes/_spawnlogic" }, + { 877, "maps/mp/_events" }, + { 878, "maps/mp/gametypes/_gamescore" }, + { 879, "maps/mp/gametypes/_menus" }, + { 880, "maps/mp/_minefields" }, + { 881, "maps/mp/_radiation" }, + { 882, "maps/mp/_shutter" }, + { 883, "maps/mp/_destructables" }, + { 884, "maps/mp/_audio" }, + { 885, "maps/mp/_art" }, + { 886, "maps/mp/_createfx" }, + { 887, "maps/mp/_global_fx" }, + { 888, "maps/mp/_animatedmodels" }, + { 889, "maps/mp/killstreaks/_helicopter" }, + { 890, "maps/mp/_skill" }, + { 891, "maps/mp/killstreaks/_remoteuav" }, + { 892, "maps/mp/gametypes/_battlechatter_mp" }, + { 893, "maps/mp/gametypes/_deathicons" }, + { 894, "maps/mp/gametypes/_killcam" }, + { 895, "maps/mp/perks/_perks" }, + { 896, "maps/mp/gametypes/_damage" }, + { 897, "maps/mp/_highlights" }, + { 898, "maps/mp/killstreaks/_escortairdrop" }, + { 899, "maps/mp/killstreaks/_juggernaut" }, + { 900, "maps/mp/killstreaks/_autosentry" }, + { 901, "maps/mp/killstreaks/_airdrop" }, + { 902, "maps/mp/gametypes/_hud" }, + { 903, "maps/mp/_load" }, + { 904, "maps/mp/gametypes/_serversettings" }, +// { 905, "905" }, + { 906, "maps/mp/mp_plaza2_precache" }, + { 907, "maps/mp/mp_plaza2_fx" }, + { 908, "maps/mp/mp_carbon_precache" }, + { 909, "maps/mp/mp_carbon_fx" }, +// { 910, "910" }, +// { 911, "911" }, + { 912, "maps/mp/mp_village_precache" }, + { 913, "maps/mp/mp_village_fx" }, + { 914, "maps/mp/mp_seatown_precache" }, + { 915, "maps/mp/mp_seatown_fx" }, + { 916, "maps/mp/mp_lambeth_precache" }, + { 917, "maps/mp/mp_lambeth_fx" }, + { 918, "maps/mp/mp_hardhat_precache" }, + { 919, "maps/mp/mp_hardhat_fx" }, + { 920, "maps/mp/mp_bootleg_precache" }, + { 921, "maps/mp/mp_bootleg_fx" }, + { 922, "maps/mp/mp_exchange_precache" }, + { 923, "maps/mp/mp_exchange_fx" }, + { 924, "maps/mp/mp_mogadishu_precache" }, + { 925, "maps/mp/mp_mogadishu_fx" }, + { 926, "maps/mp/mp_underground_precache" }, + { 927, "maps/mp/mp_underground_fx" }, + { 928, "maps/mp/mp_interchange_precache" }, + { 929, "maps/mp/mp_interchange_fx" }, +// { 930, "930" }, +// { 931, "931" }, +// { 932, "932" }, +// { 933, "933" }, + { 934, "maps/mp/gametypes/_healthoverlay" }, + { 935, "maps/mp/gametypes/_music_and_dialog" }, + { 936, "maps/mp/_awards" }, + { 937, "maps/mp/_areas" }, + { 938, "maps/mp/_defcon" }, + { 939, "maps/mp/_matchevents" }, + { 940, "maps/mp/gametypes/_friendicons" }, + { 941, "maps/mp/gametypes/_scoreboard" }, + { 942, "maps/mp/killstreaks/_harrier" }, + { 943, "maps/mp/gametypes/_callbacksetup" }, + { 944, "maps/mp/killstreaks/_airstrike" }, + { 945, "maps/mp/killstreaks/_emp" }, + { 946, "maps/mp/killstreaks/_uav" }, + { 947, "maps/mp/killstreaks/_ac130" }, + { 948, "maps/mp/killstreaks/_remotemissile" }, + { 949, "maps/mp/killstreaks/_helicopter_flock" }, +// ... + { 967, "maps/mp/mp_dome_precache" }, + { 968, "maps/mp/mp_dome_fx" }, +// { 969, "969" }, +// { 970, "970" }, + { 971, "maps/mp/mp_radar_precache" }, + { 972, "maps/mp/mp_radar_fx" }, + { 973, "maps/mp/mp_paris_precache" }, + { 974, "maps/mp/mp_paris_fx" }, + { 975, "maps/mp/mp_bravo_precache" }, + { 976, "maps/mp/mp_bravo_fx" }, + { 977, "maps/mp/mp_alpha_precache" }, + { 978, "maps/mp/mp_alpha_fx" }, + { 979, "maps/mp/killstreaks/_helicopter_guard" }, + { 980, "maps/mp/killstreaks/_nuke" }, + { 981, "maps/mp/killstreaks/_remotemortar" }, + { 982, "maps/mp/killstreaks/_deployablebox" }, + { 983, "maps/mp/killstreaks/_ims" }, + { 984, "maps/mp/killstreaks/_remoteturret" }, + { 985, "maps/mp/killstreaks/_remotetank" }, + { 986, "maps/mp/gametypes/_playercards" }, + { 987, "maps/mp/gametypes/_globallogic" }, +// ... + { 998, "maps/mp/gametypes/_teams" }, +// ... + { 1216, "vehicle_scripts/_pavelow_noai" }, + { 1217, "maps/mp/_fx" }, + { 1218, "maps/mp/_compass" }, + { 1219, "maps/mp/_menus" }, + { 1220, "maps/mp/_crib" }, + { 1221, "maps/mp/killstreaks/_autoshotgun" }, + { 1222, "maps/mp/killstreaks/_tank" }, + { 1223, "maps/mp/killstreaks/_mobilemortar" }, + { 1224, "maps/mp/killstreaks/_a10" }, + { 1225, "maps/mp/killstreaks/_teamammorefill" }, +// { 1226, "1226" }, // maps/mp/gametypes/_clientids maybe + { 1227, "maps/mp/gametypes/_dev" }, +// { 1228, "1228" },// maps/mp/gametypes/_globalentities maybe +// { 1229, "1229" },// maps/mp/gametypes/_hardpoints maybe + { 1230, "maps/mp/killstreaks/_aamissile" }, + { 1231, "maps/mp/killstreaks/_aastrike" }, +// { 1232, "maps/mp/killstreaks/_ac130" }, // bad name! +// ... + { 1343, "xmodelalias/alias_gign_heads" }, + { 1344, "codescripts/delete" }, + { 1345, "codescripts/struct" }, +// ... + { 1443, "common_scripts/_destructible_types_anim_airconditioner" }, + { 1444, "maps/animated_models/fence_tarp_107x56_med_01" }, + { 1445, "maps/animated_models/fence_tarp_130x56_med_01" }, + { 1446, "maps/animated_models/fence_tarp_134x56_med_01" }, + { 1447, "maps/animated_models/fence_tarp_134x76_med_01" }, + { 1448, "maps/animated_models/fence_tarp_134x76_med_02" }, + { 1449, "maps/animated_models/fence_tarp_140x56_med_01" }, + { 1450, "maps/animated_models/fence_tarp_151x56_med_01" }, + { 1451, "maps/animated_models/fence_tarp_167x56_med_01" }, + { 1452, "maps/animated_models/foliage_desertbrush_1_sway" }, + { 1453, "maps/animated_models/foliage_pacific_bushtree01" }, + { 1454, "maps/animated_models/foliage_pacific_flowers06_sway" }, + { 1455, "maps/animated_models/oil_pump_jack01" }, + { 1456, "maps/animated_models/oil_pump_jack02" }, + { 1457, "maps/animated_models/windmill_spin_med" }, + { 1458, "maps/animated_models/windsock_large_wind_medium" }, + { 1459, "maps/createart/mp_dome_art" }, + { 1460, "maps/mp/_explosive_barrels" }, + { 1461, "maps/createfx/mp_dome_fx" }, + { 1462, "maps/createart/mp_dome_fog" }, +// ... + { 1568, "vehicle_scripts/_mi17" }, +// { 1636, "" }, +// { 1637, "" }, +// { 1638, "" }, + { 1639, "vehicle_scripts/_gaz_dshk" }, + { 1640, "vehicle_scripts/_hind" }, +// { 1641, "" }, + { 1642, "maps/animated_models/fence_tarp_108x76_med_01" }, +// { 1643, "maps/animated_models/fence_tarp_132x82_med_01" }, + { 1644, "maps/_predator2" }, +// { 1645, "maps/_xm25" }, + { 1646, "vehicle_scripts/_blackhawk_minigun" }, +// { 1647, "vehicle_scripts/_stryker50cal" }, +// ------- files chunck end --------- +// { 1721, +// ... + { 6358, "maps/createart/so_survival_mp_plaza2_art" }, + { 6359, "maps/createart/so_survival_mp_seatown_fog" }, + { 6360, "maps/createart/so_survival_mp_seatown_art" }, + { 6361, "maps/createart/so_survival_mp_underground_fog" }, + { 6362, "maps/createart/so_survival_mp_underground_art" }, + { 6363, "maps/createart/so_survival_mp_village_fog" }, + { 6364, "maps/createart/so_survival_mp_village_art" }, +// ... +// { 8217, +// { 8218, +// { 8219, +// ... + { 8224, "maps/createart/so_survival_mp_hardhat_fog" }, + { 8225, "maps/createart/so_survival_mp_hardhat_art" }, + { 8226, "maps/createart/so_survival_mp_alpha_fog" }, + { 8227, "maps/createart/so_survival_mp_alpha_art" }, + { 8228, "maps/createart/so_survival_mp_bootleg_fog" }, + { 8229, "maps/createart/so_survival_mp_bootleg_art" }, + { 8230, "maps/createart/so_survival_mp_bravo_fog" }, + { 8231, "maps/createart/so_survival_mp_bravo_art" }, + { 8232, "maps/createart/so_survival_mp_carbon_fog" }, + { 8233, "maps/createart/so_survival_mp_carbon_art" }, + { 8234, "maps/createart/so_survival_mp_exchange_fog" }, + { 8235, "maps/createart/so_survival_mp_exchange_art" }, + { 8236, "maps/createart/so_survival_mp_interchange_fog" }, + { 8237, "maps/createart/so_survival_mp_interchange_art" }, + { 8238, "maps/createart/so_survival_mp_lambeth_fog" }, + { 8239, "maps/createart/so_survival_mp_lambeth_art" }, + { 8240, "maps/createart/so_survival_mp_mogadishu_fog" }, + { 8241, "maps/createart/so_survival_mp_mogadishu_art" }, + { 8242, "maps/createart/so_survival_mp_paris_fog" }, + { 8243, "maps/createart/so_survival_mp_paris_art" }, + { 8244, "maps/createart/so_survival_mp_plaza2_fog" }, +// ... + { 18378, "maps/createart/so_survival_mp_dome_fog" }, + { 18379, "maps/createart/so_survival_mp_dome_art" }, + { 18380, "character/character_so_juggernaut_lite" }, +// ... + { 18649, "common_scripts/_destructible_types_anim_generator" }, + { 18650, "common_scripts/_destructible_types_anim_lockers" }, + { 18651, "maps/animated_models/fence_tarp_124x52_a_med_01" }, + { 18652, "maps/animated_models/fence_tarp_124x52_b_med_01" }, + { 18653, "maps/animated_models/fence_tarp_126x76_a_med_01" }, + { 18654, "maps/animated_models/fence_tarp_126x76_med_01" }, + { 18655, "maps/animated_models/radar_spinning" }, + { 18656, "maps/createart/mp_radar_art" }, + { 18657, "maps/createfx/mp_radar_fx" }, + { 18658, "maps/createart/mp_radar_fog" }, + { 18659, "maps/createart/so_survival_mp_radar_fog" }, + { 18660, "maps/createart/so_survival_mp_radar_art" }, + { 18661, "common_scripts/_destructible_types_anim_chicken" }, + { 18662, "maps/animated_models/hanging_sheet_wind_medium" }, + { 18663, "maps/createart/mp_village_art" }, + { 18664, "maps/createfx/mp_village_fx" }, + { 18665, "maps/createart/mp_village_fog" }, + { 18666, "common_scripts/_destructible_types_anim_security_camera" }, + { 18667, "maps/createart/mp_underground_art" }, +// { 18668, "" }, +// { 18669, "" }, + { 18670, "maps/createfx/mp_underground_fx" }, + { 18671, "maps/createart/mp_underground_fog" }, + { 18672, "vehicle_scripts/_80s_hatch1" }, + { 18673, "common_scripts/_destructible_types_anim_me_fanceil1_spin" }, + { 18674, "maps/animated_models/hanging_apron_wind_medium" }, + { 18675, "maps/animated_models/hanging_longsleeve_wind_medium" }, + { 18676, "maps/animated_models/hanging_shortsleeve_wind_medium" }, + { 18677, "maps/animated_models/seatown_canopy_1section_01_sway" }, + { 18678, "maps/animated_models/seatown_canopy_1section_02_sway" }, + { 18679, "maps/animated_models/seatown_canopy_3section_01_sway" }, + { 18680, "maps/animated_models/seatown_canopy_stand_01_sway" }, + { 18681, "maps/animated_models/seatown_canopy_stand_02_sway" }, + { 18682, "maps/animated_models/seatown_lrg_wiregrp_sway" }, + { 18683, "maps/animated_models/seatown_mid01_wiregrp_sway" }, + { 18684, "maps/animated_models/seatown_wire_flags1_sway" }, + { 18685, "maps/animated_models/seatown_wire_flags2_sway" }, + { 18686, "maps/createart/mp_seatown_art" }, + { 18687, "maps/createfx/mp_seatown_fx" }, + { 18688, "maps/createart/mp_seatown_fog" }, + { 18689, "common_scripts/_destructible_types_anim_wallfan" }, + { 18690, "maps/animated_models/mi24p_hind_plaza_destroy_animated" }, + { 18691, "maps/createart/mp_plaza2_art" }, + { 18692, "maps/createfx/mp_plaza2_fx" }, + { 18693, "maps/createart/mp_plaza2_fog" }, + { 18694, "maps/createart/mp_paris_art" }, + { 18695, "maps/createfx/mp_paris_fx" }, + { 18696, "maps/createart/mp_paris_fog" }, + { 18697, "common_scripts/_destructible_types_anim_motorcycle_01" }, + { 18698, "maps/createart/mp_mogadishu_art" }, + { 18699, "maps/createfx/mp_mogadishu_fx" }, + { 18700, "maps/createart/mp_mogadishu_fog" }, + { 18701, "maps/animated_models/com_roofvent2" }, + { 18702, "maps/animated_models/foliage_tree_river_birch_lg_a" }, + { 18703, "maps/animated_models/foliage_tree_river_birch_xl_a" }, + { 18704, "maps/createart/mp_lambeth_art" }, + { 18705, "maps/createfx/mp_lambeth_fx" }, + { 18706, "maps/createart/mp_lambeth_fog" }, + { 18707, "maps/createart/mp_interchange_art" }, + { 18708, "maps/createfx/mp_interchange_fx" }, + { 18709, "maps/createart/mp_interchange_fog" }, + { 18710, "maps/animated_models/fence_tarp_128x84_med_01" }, + { 18711, "maps/animated_models/fence_tarp_192x50_med_01" }, + { 18712, "maps/animated_models/fence_tarp_192x84_a_med_01" }, + { 18713, "maps/animated_models/fence_tarp_196x146_med_01" }, + { 18714, "maps/animated_models/fence_tarp_196x36_med_01" }, + { 18715, "maps/animated_models/fence_tarp_196x56_med_01" }, + { 18716, "maps/animated_models/fence_tarp_208x42_med_01" }, + { 18717, "maps/animated_models/fence_tarp_352x88_med_01" }, + { 18718, "maps/animated_models/fence_tarp_draping_224x116_01" }, + { 18719, "maps/animated_models/fence_tarp_draping_98x94_med_01" }, + { 18720, "maps/animated_models/fence_tarp_draping_98x94_med_02" }, + { 18721, "maps/animated_models/fence_tarp_rooftop_set_01_med_01" }, + { 18722, "maps/animated_models/hanging_dead_paratrooper01_animated" }, + { 18723, "maps/animated_models/plastic_fence_232x88_med_01" }, + { 18724, "maps/animated_models/plastic_fence_234x88_med_01" }, + { 18725, "maps/animated_models/plastic_fence_256x48_med_01" }, + { 18726, "maps/animated_models/plastic_fence_264x40_med_01" }, + { 18727, "maps/animated_models/plastic_fence_300x88_med_01" }, + { 18728, "maps/animated_models/plastic_fence_400x88_med_01" }, + { 18729, "maps/animated_models/plastic_fence_528x88_med_01" }, + { 18730, "maps/createart/mp_hardhat_art" }, + { 18731, "maps/createfx/mp_hardhat_fx" }, + { 18732, "maps/createart/mp_hardhat_fog" }, + { 18733, "maps/createart/mp_exchange_art" }, + { 18734, "maps/createfx/mp_exchange_fx" }, + { 18735, "maps/createart/mp_exchange_fog" }, + { 18736, "common_scripts/_destructible_types_anim_light_fluo_single" }, + { 18737, "maps/animated_models/fence_tarp_110x64_med_01" }, + { 18738, "maps/animated_models/fence_tarp_124x64_med_01" }, + { 18739, "maps/animated_models/fence_tarp_128x64_med_01" }, + { 18740, "maps/animated_models/fence_tarp_130x76_med_01" }, + { 18741, "maps/animated_models/fence_tarp_130x82_a_med_01" }, + { 18742, "maps/animated_models/fence_tarp_130x82_med_01" }, + { 18743, "maps/animated_models/fence_tarp_132x62_med_01" }, + { 18744, "maps/animated_models/fence_tarp_132x82_a_med_01" }, + { 18745, "maps/animated_models/fence_tarp_140x68_med_01" }, + { 18746, "maps/animated_models/fence_tarp_160x82_med_01" }, + { 18747, "maps/animated_models/fence_tarp_162x64_med_01" }, + { 18748, "maps/animated_models/fence_tarp_40x58_med_01" }, + { 18749, "maps/animated_models/fence_tarp_68x58_med_01" }, + { 18750, "maps/animated_models/fence_tarp_70x82_med_01" }, + { 18751, "maps/animated_models/fence_tarp_80x84_med_01" }, + { 18752, "maps/animated_models/fence_tarp_90x64_med_01" }, + { 18753, "maps/animated_models/fence_tarp_94x64_med_01" }, + { 18754, "maps/createart/mp_carbon_art" }, +// { 18755, "" }, +// { 18756, "" }, +// { 18757, "" }, + { 18758, "maps/createfx/mp_carbon_fx" }, + { 18759, "maps/createart/mp_carbon_fog" }, + { 18760, "maps/animated_models/foliage_cod5_tree_jungle_03" }, + { 18761, "maps/animated_models/foliage_pacific_bushtree01" }, + { 18762, "maps/animated_models/foliage_pacific_palms08" }, + { 18763, "maps/createart/mp_bravo_art" }, + { 18764, "maps/createfx/mp_bravo_fx" }, + { 18765, "maps/createart/mp_bravo_fog" }, + { 18766, "common_scripts/_destructible_types_anim_light_fluo_on" }, + { 18767, "maps/createart/mp_bootleg_art" }, + { 18768, "maps/createfx/mp_bootleg_fx" }, + { 18769, "maps/createart/mp_bootleg_fog" }, + { 18770, "maps/animated_models/alpha_hanging_civs_animated" }, + { 18771, "maps/createart/mp_alpha_art" }, + { 18772, "maps/createfx/mp_alpha_fx" }, + { 18773, "maps/createart/mp_alpha_fog" }, +// ... + { 21505, "vehicle_scripts/_btr80" }, + { 21688, "vehicle_scripts/_uaz_castle" }, +// ... + { 33361, "maps/mp/mp_italy_precache" }, + { 33362, "maps/createart/mp_italy_art" }, + { 33363, "maps/mp/mp_italy_fx" }, + { 33364, "maps/createfx/mp_italy_fx" }, + { 33365, "maps/createart/mp_italy_fog" }, + { 33366, "maps/mp/mp_park_precache" }, + { 33367, "maps/createart/mp_park_art" }, + { 33368, "maps/mp/mp_park_fx" }, + { 33369, "maps/createfx/mp_park_fx" }, + { 33370, "maps/createart/mp_park_fog" }, + { 33371, "maps/mp/mp_overwatch_precache" }, + { 33372, "maps/createart/mp_overwatch_art" }, + { 33373, "maps/mp/mp_overwatch_fx" }, + { 33374, "maps/createfx/mp_overwatch_fx" }, + { 33375, "maps/createart/mp_overwatch_fog" }, + { 33376, "maps/mp/mp_morningwood_precache" }, + { 33377, "maps/createart/mp_morningwood_art" }, + { 33378, "maps/mp/mp_morningwood_fx" }, + { 33379, "maps/createfx/mp_morningwood_fx" }, + { 33380, "maps/createart/mp_morningwood_fog" }, + { 33381, "maps/createart/so_survival_mp_italy_fog" }, + { 33382, "maps/createart/so_survival_mp_italy_art" }, + { 33383, "maps/so_survival_mp_italy_precache" }, + { 33384, "maps/createart/so_survival_mp_park_fog" }, + { 33385, "maps/createart/so_survival_mp_park_art" }, + { 33386, "maps/so_survival_mp_park_precache" }, +}}; + +const std::array token_list +{{ + { 1, "pl#" }, + { 17, "teamHasRemoteUAV" }, // was introduced in an IW patch, made up name + { 18, "carriedRemoteUAV" }, // was introduced in an IW patch, made up name + { 19, "imsBombSquadModel" }, // was introduced in an IW patch, made up name + { 20, "zonesCycling" }, + { 54, "_unk_field_ID54" }, // was introduced in an IW patch, used in _nuke.gsc and _rank.gsc + { 55, "isBuffEquippedOnWeapon" }, + { 56, "onDisconnect" }, + { 369, "gun_prevGuns" }, + { 370, "gun_curGun" }, + { 371, "getNextGun" }, + { 372, "addAttachments" }, + { 373, "gun_attachments" }, + { 416, "logKillsConfirmed" }, + { 417, "logKillsDenied" }, + { 418, "isPainted" }, + { 419, "lightWeightScalar" }, + { 420, "painted" }, + { 421, "hideCarryIconOnGameEnd" }, + { 422, "empTimeRemaining" }, + { 423, "juggRemoveRadarOnGameEnded" }, // was introduced in an IW patch, made up name, no way of knowing its official name + { 424, "airstrikessfx" }, + { 425, "airstrikeexplosion" }, // an educated name guess based off of opaque strings + { 426, "keepEMPTimeRemaining" }, + { 427, "nukeEmpTimeRemaining" }, + { 428, "keepNukeEMPTimeRemaining" }, + { 429, "handleToggleZoom" }, + { 430, "remote_mortar_toggleZoom" }, + { 431, "hintPickUp" }, + { 432, "pickup_message_deleted" }, + { 433, "getCustomClassLoc" }, + { 434, "isInUnlockTable" }, + { 435, "getChallengeFilter" }, + { 436, "getChallengeTable" }, + { 437, "getTierFromTable" }, + { 438, "getWeaponFromChallenge" }, + { 439, "getWeaponAttachmentFromChallenge" }, + { 440, "isKillstreakChallenge" }, + { 441, "getKillstreakFromChallenge" }, + { 442, "cac_getCustomClassLoc" }, + { 443, "reInitializeMatchRulesOnMigration" }, + { 444, "initializeMatchRules" }, + { 445, "matchRules_oneShotKill" }, + { 447, "matchRules_randomize" }, + { 448, "reInitializeScoreLimitOnMigration" }, + { 449, "gun_nextGuns" }, + { 464, "grnd_wasSpectator" }, + { 467, "grnd_previousCrateTypes" }, + { 520, "spawningAfterRemoteDeath" }, + { 521, "hideWorldIconOnGameEnd" }, + { 522, "fauxVehicleCount" }, + { 523, "incrementFauxVehicleCount" }, + { 524, "decrementFauxVehicleCount" }, + { 525, "crateTeamModelUpdater" }, + { 950, "getHighestProgressedPlayers" }, + { 951, "gun_progressDisplay" }, + { 1023, "delay_createfx_seconds" }, + { 1027, "lastVecToTarget" }, + { 1028, "markForDetete" }, +// ... + { 1648, "initFX" }, + { 1649, "func" }, + { 1650, "main" }, + { 1651, "CodeCallback_StartGameType" }, + { 1652, "CodeCallback_PlayerConnect" }, + { 1653, "CodeCallback_PlayerDisconnect" }, + { 1654, "CodeCallback_PlayerDamage" }, + { 1655, "CodeCallback_PlayerKilled" }, + { 1656, "CodeCallback_VehicleDamage" }, + { 1657, "CodeCallback_CodeEndGame" }, + { 1658, "CodeCallback_PlayerLastStand" }, + { 1659, "CodeCallback_PlayerMigrated" }, + { 1660, "CodeCallback_HostMigration" }, + { 1661, "InitStructs" }, + { 1662, "CreateStruct" }, + { 1664, "init" }, + { 1665, "precache" }, + { 1666, "spawner" }, + { 1667, "code_classname" }, // entity fields + { 1668, "classname" }, + { 1669, "origin" }, + { 1670, "model" }, + { 1671, "spawnflags" }, + { 1672, "target" }, + { 1673, "targetname" }, + { 1674, "count" }, + { 1675, "health" }, + { 1676, "dmg" }, + { 1677, "angles" }, + { 1678, "birthtime" }, + { 1679, "script_linkname" }, + { 1680, "slidevelocity" }, + { 1681, "name" }, // client fields + { 1682, "sessionteam" }, + { 1683, "sessionstate" }, + { 1684, "maxHealth" }, +// ... + { 1705, "bouncefraction" }, +// ... + { 1725, "score" }, + { 1726, "deaths" }, + { 1727, "statusicon" }, + { 1728, "headicon" }, + { 1729, "headiconteam" }, + { 1730, "canclimbladders" }, + { 1731, "kills" }, + { 1732, "assists" }, + { 1733, "hasradar" }, + { 1734, "isradarblocked" }, + { 1735, "radarstrength" }, + { 1736, "radarshowenemydirection" }, + { 1737, "radarmode" }, + { 1738, "forcespectatorclient" }, + { 1739, "killcamentity" }, + { 1740, "archivetime" }, + { 1741, "psoffsettime" }, + { 1742, "pers" }, + { 1743, "x" }, + { 1744, "y" }, + { 1745, "z" }, + { 1746, "fontScale" }, + { 1747, "font" }, + { 1748, "alignx" }, + { 1749, "aligny" }, + { 1750, "horzalign" }, + { 1751, "vertalign" }, + { 1752, "color" }, + { 1753, "alpha" }, + { 1754, "label" }, + { 1755, "sort" }, + { 1756, "foreground" }, + { 1757, "lowresbackground" }, + { 1758, "hidewhendead" }, + { 1759, "hidewheninmenu" }, + { 1760, "splatter" }, + { 1761, "glowcolor" }, + { 1762, "glowalpha" }, + { 1763, "archived" }, + { 1764, "hidein3rdperson" }, + { 1765, "hidewhenindemo" }, + { 1766, "veh_speed" }, + { 1767, "veh_pathspeed" }, + { 1768, "veh_transmission" }, + { 1769, "veh_pathdir" }, + { 1770, "veh_pathtype" }, + { 1771, "veh_topspeed" }, + { 1772, "veh_brake" }, + { 1773, "veh_throttle" }, + { 1774, "script_noteworthy" }, + { 1775, "speed" }, + { 1776, "lookahead" }, + { 1777, "ambienttrack" }, + { 1778, "ambienttrack_ac130" }, + { 1779, "message" }, + { 1780, "northyaw" }, + { 1781, "wait" }, + { 1782, "radius" }, + { 1783, "height" }, + { 1784, "accumulate" }, + { 1785, "threshold" }, + { 1786, "cursorhint" }, + { 1787, "hintstring" }, + { 1788, "script_delay" }, + { 1789, "script_visionset" }, + { 1790, "script_zone" }, + { 1791, "rightarc" }, + { 1792, "leftarc" }, + { 1793, "toparc" }, + { 1794, "bottomarc" }, + { 1795, "yawconvergencetime" }, + { 1796, "pitchconvergencetime" }, + { 1797, "suppressionTime" }, + { 1798, "maxrange" }, + { 1799, "aiSpread" }, + { 1800, "damage" }, + { 1801, "playerSpread" }, + { 1802, "convergencetime" }, + { 1803, "weaponinfo" }, + { 1804, "vehicletype" }, + { 1805, "type" }, + { 1806, "accuracy" }, + { 1807, "lookforward" }, + { 1808, "lookright" }, + { 1809, "lookup" }, + { 1810, "fovcosine" }, + { 1811, "fovcosinebusy" }, + { 1812, "upaimlimit" }, + { 1813, "downaimlimit" }, + { 1814, "rightaimlimit" }, + { 1815, "leftaimlimit" }, + { 1816, "maxsightdistsqrd" }, + { 1817, "sightlatency" }, + { 1818, "ignoreclosefoliage" }, + { 1819, "followmin" }, + { 1820, "followmax" }, + { 1821, "chainfallback" }, + { 1822, "chainnode" }, + { 1823, "interval" }, + { 1824, "teammovewaittime" }, + { 1825, "damagetaken" }, + { 1826, "damagedir" }, + { 1827, "damageyaw" }, + { 1828, "damagelocation" }, + { 1829, "damageweapon" }, + { 1830, "damagemod" }, + { 1831, "proneok" }, + { 1832, "walkdistfacingmotion" }, + { 1833, "killcamentitylookat" }, + { 1834, "walkdist" }, + { 1835, "desiredangle" }, + { 1836, "pacifist" }, + { 1837, "pacifistwait" }, + { 1838, "footstepdetectdist" }, + { 1839, "footstepdetectdistwalk" }, + { 1840, "footstepdetectdistsprint" }, + { 1841, "reactiontargetpos" }, + { 1842, "newenemyreactiondistsq" }, + { 1843, "ignoreexplosionevents" }, + { 1844, "ignoresuppression" }, + { 1845, "suppressionwait" }, + { 1846, "suppressionduration" }, + { 1847, "suppressionstarttime" }, + { 1848, "suppressionmeter" }, + { 1849, "weapon" }, + { 1850, "dontavoidplayer" }, + { 1851, "grenadeawareness" }, + { 1852, "grenade" }, + { 1853, "grenadeweapon" }, + { 1854, "grenadeammo" }, + { 1855, "favoriteenemy" }, + { 1856, "highlyawareradius" }, + { 1857, "minpaindamage" }, + { 1858, "allowpain" }, + { 1859, "allowdeath" }, + { 1860, "delayeddeath" }, + { 1861, "diequietly" }, + { 1862, "forceragdollimmediate" }, + { 1863, "providecoveringfire" }, + { 1864, "doingambush" }, + { 1865, "combatmode" }, + { 1866, "alertlevel" }, + { 1867, "alertlevelint" }, + { 1868, "useable" }, + { 1869, "ignoretriggers" }, + { 1870, "pushable" }, + { 1871, "script_pushable" }, + { 1872, "dropweapon" }, + { 1873, "drawoncompass" }, + { 1874, "groundtype" }, + { 1875, "anim_pose" }, + { 1876, "goalradius" }, + { 1877, "goalheight" }, + { 1878, "goalpos" }, + { 1879, "nodeoffsetpos" }, + { 1880, "ignoreforfixednodesafecheck" }, + { 1881, "fixednode" }, + { 1882, "fixednodesaferadius" }, + { 1883, "pathgoalpos" }, + { 1884, "pathrandompercent" }, + { 1885, "usechokepoints" }, + { 1886, "stopanimdistsq" }, + { 1887, "lastenemysightpos" }, + { 1888, "pathenemylookahead" }, + { 1889, "pathenemyfightdist" }, + { 1890, "meleeattackdist" }, + { 1891, "movemode" }, + { 1892, "usecombatscriptatcover" }, + { 1893, "safetochangescript" }, + { 1894, "keepclaimednode" }, + { 1895, "keepclaimednodeifvalid" }, + { 1896, "keepnodeduringscriptedanim" }, + { 1897, "dodangerreact" }, + { 1898, "dangerreactduration" }, + { 1899, "nododgemove" }, + { 1900, "leanamount" }, + { 1901, "turnrate" }, + { 1902, "badplaceawareness" }, + { 1903, "damageshield" }, + { 1904, "nogrenadereturnthrow" }, + { 1905, "noattackeraccuracymod" }, + { 1906, "frontshieldanglecos" }, + { 1907, "lookaheaddir" }, + { 1908, "lookaheaddist" }, + { 1909, "lookaheadhitsstairs" }, + { 1910, "velocity" }, + { 1911, "prevanimdelta" }, + { 1912, "exposedduration" }, + { 1913, "requestarrivalnotify" }, + { 1914, "scriptedarrivalent" }, + { 1915, "goingtoruntopos" }, + { 1916, "engagemindist" }, + { 1917, "engageminfalloffdist" }, + { 1918, "engagemaxdist" }, + { 1919, "engagemaxfalloffdist" }, + { 1920, "finalaccuracy" }, + { 1921, "facemotion" }, + { 1921, "gunblockedbywall" }, + { 1923, "relativedir" }, + { 1924, "lockorientation" }, + { 1925, "maxfaceenemydist" }, + { 1926, "stairsstate" }, + { 1927, "script" }, + { 1928, "prevscript" }, + { 1929, "threatbias" }, + { 1930, "syncedmeleetarget" }, + { 1931, "ignoreme" }, + { 1932, "ignoreall" }, + { 1933, "maxvisibledist" }, + { 1934, "surprisedbymedistsq" }, + { 1935, "ignorerandombulletdamage" }, + { 1936, "dodamagetoall" }, + { 1937, "turretinvulnerability" }, + { 1938, "onlygoodnearestnodes" }, + { 1938, "takedamage" }, + { 1940, "playername" }, + { 1941, "deathinvulnerabletime" }, + { 1942, "criticalbulletdamagedist" }, + { 1943, "attackercount" }, + { 1944, "damagemultiplier" }, + { 1945, "laststand" }, + { 1946, "motiontrackerenabled" }, + { 1947, "team" }, + { 1948, "threatbiasgroup" }, + { 1949, "node" }, + { 1950, "prevnode" }, + { 1951, "enemy" }, + { 1952, "lastattacker" }, + { 1953, "attackeraccuracy" }, + { 1954, "width" }, + { 1955, "enable" }, + { 1956, "freecamera" }, + { 1957, "fov" }, + { 1958, "dofnear" }, + { 1959, "doffar" }, + { 1960, "look" }, + { 1961, "up" }, + { 1962, "right" }, + { 1963, "thermalbodymaterial" }, + { 1964, "entity" }, + { 1965, "tag" }, + { 1966, "nearz" }, + { 1967, "blurradius" }, + { 1968, "lod" }, + { 1969, "clipdistance" }, + { 1970, "enableshadows" }, + { 1971, "visionsetnakedduration" }, + { 1972, "visionsetnaked" }, + { 1973, "visionsetnightduration" }, + { 1974, "visionsetnight" }, + { 1975, "visionsetmissilecamduration" }, + { 1976, "visionsetmissilecam" }, + { 1977, "visionsetthermalduration" }, + { 1978, "visionsetthermal" }, + { 1979, "visionsetpainduration" }, + { 1980, "visionsetpain" }, + { 1981, "activevisionset" }, + { 1982, "activevisionsetduration" }, + { 1983, "animscript" }, + { 1984, "anglelerprate" }, + { 1985, "activator" }, + { 1986, "gravity" }, + { 1987, "ambient" }, + { 1988, "diffusefraction" }, + { 1989, "sunlight" }, + { 1990, "suncolor" }, + { 1991, "sundirection" }, + { 1992, "reflection_clear_color" }, + { 1993, "minusedistsq" }, + { 1994, "owner" }, +// symbols + { 1995, "create_lock" }, + { 1996, "exploder_before_load" }, + { 1997, "exploderFunction" }, + { 1998, "exploder_after_load" }, + { 1999, "server_culled_sounds" }, + { 2000, "createFX_enabled" }, + { 2001, "createFXent" }, + { 2002, "set_forward_and_up_vectors" }, + { 2003, "v" }, + { 2004, "print_org" }, + { 2005, "OneShotfx" }, + { 2006, "exploderfx" }, + { 2007, "createExploder" }, + { 2008, "createFXexploders" }, + { 2009, "script_exploder" }, + { 2010, "script_fxid" }, + { 2011, "script_firefx" }, + { 2012, "script_firefxdelay" }, + { 2013, "script_firefxsound" }, + { 2014, "script_sound" }, + { 2015, "script_earthquake" }, + { 2016, "script_damage" }, + { 2017, "script_radius" }, + { 2018, "script_soundalias" }, + { 2019, "script_firefxtimeout" }, + { 2020, "script_repeat" }, + { 2021, "script_delay_min" }, + { 2022, "script_delay_max" }, + { 2023, "script_exploder_group" }, + { 2024, "targetPos" }, + { 2025, "_script_exploders" }, + { 2026, "createfx_showOrigin" }, + { 2027, "loopfx" }, + { 2028, "createLoopEffect" }, + { 2029, "create_looper" }, + { 2030, "_effect" }, + { 2031, "looper" }, + { 2032, "create_loopsound" }, + { 2033, "loop_fx_sound" }, + { 2034, "create_interval_sound" }, + { 2035, "loop_fx_sound_interval" }, + { 2036, "loopfxthread" }, + { 2037, "waitframe" }, + { 2038, "fxStart" }, + { 2039, "timeOut" }, + { 2040, "fxStop" }, + { 2041, "loopfxChangeID" }, + { 2042, "loopfxChangeOrg" }, + { 2043, "loopfxChangeDelay" }, + { 2044, "loopfxDeletion" }, + { 2045, "loopfxStop" }, + { 2046, "loopSound" }, + { 2047, "loopSoundthread" }, + { 2048, "gunfireloopfx" }, + { 2049, "gunfireloopfxthread" }, + { 2050, "gunfireloopfxVec" }, + { 2051, "gunfireloopfxVecthread" }, + { 2052, "fxfireloopmod" }, + { 2053, "setfireloopmod" }, + { 2054, "setup_fx" }, + { 2055, "script_fxcommand" }, + { 2056, "script_fxstart" }, + { 2057, "script_fxstop" }, + { 2058, "burnville_paratrooper_hack" }, + { 2059, "burnville_paratrooper_hack_loop" }, + { 2060, "create_triggerfx" }, + { 2061, "verify_effects_assignment" }, + { 2062, "_missing_FX" }, + { 2063, "verify_effects_assignment_print" }, + { 2064, "OneShotfxthread" }, + { 2065, "menu" }, + { 2066, "create_fx_menu" }, + { 2067, "setmenu" }, + { 2068, "button_is_clicked" }, + { 2069, "createLoopSound" }, + { 2070, "createNewExploder" }, + { 2071, "createIntervalSound" }, + { 2072, "last_displayed_ent" }, + { 2073, "clear_settable_fx" }, + { 2074, "clear_fx_hudElements" }, + { 2075, "_exit_menu" }, + { 2076, "clear_entity_selection" }, + { 2077, "update_selected_entities" }, + { 2078, "get_last_selected_entity" }, + { 2079, "selected_fx_ents" }, + { 2080, "menu_fx_creation" }, + { 2081, "func_get_level_fx" }, + { 2082, "effect_list_offset" }, + { 2083, "effect_list_offset_max" }, + { 2084, "createOneshotEffect" }, + { 2085, "finish_creating_entity" }, + { 2086, "post_entity_creation_function" }, + { 2087, "select_last_entity" }, + { 2088, "move_selection_to_cursor" }, + { 2089, "menu_init" }, + { 2090, "createFX_options" }, + { 2091, "mp_createfx" }, + { 2092, "createfxMasks" }, + { 2093, "get_last_selected_ent" }, + { 2094, "entities_are_selected" }, + { 2095, "menu_change_selected_fx" }, + { 2096, "prepare_option_for_change" }, + { 2097, "createfx_centerprint" }, + { 2098, "createfx_inputlocked" }, + { 2099, "createFxHudElements" }, + { 2100, "menu_fx_option_set" }, + { 2101, "apply_option_to_selected_fx" }, + { 2102, "set_option_index" }, + { 2103, "selected_fx_option_index" }, + { 2104, "get_selected_option" }, + { 2105, "mask" }, + { 2106, "addOption" }, + { 2107, "get_option" }, + { 2108, "display_fx_info" }, + { 2109, "set_fx_hudElement" }, + { 2110, "createFx_hudElements" }, + { 2111, "display_fx_add_options" }, + { 2112, "add_option_to_selected_entities" }, + { 2113, "menuNone" }, + { 2114, "draw_effects_list" }, + { 2115, "increment_list_offset" }, + { 2116, "createEffect" }, + { 2117, "drawn" }, + { 2118, "createFXbyFXID" }, + { 2119, "getLoopEffectDelayDefault" }, + { 2120, "getOneshotEffectDelayDefault" }, + { 2121, "getExploderDelayDefault" }, + { 2122, "getIntervalSoundDelayMinDefault" }, + { 2123, "getIntervalSoundDelayMaxDefault" }, + { 2124, "add_effect" }, + { 2125, "createExploderEx" }, + { 2126, "set_origin_and_angles" }, + { 2127, "createfx_common" }, + { 2128, "flag_init" }, + { 2129, "createFX" }, + { 2130, "createfx_loopcounter" }, + { 2131, "createFxLogic" }, + { 2132, "get_template_level" }, + { 2133, "func_position_player" }, + { 2134, "location" }, + { 2135, "clearTextMarker" }, + { 2136, "selectedMove_up" }, + { 2137, "selectedMove_forward" }, + { 2138, "selectedMove_right" }, + { 2139, "selectedRotate_pitch" }, + { 2140, "selectedRotate_roll" }, + { 2141, "selectedRotate_yaw" }, + { 2142, "selected_fx" }, + { 2143, "createfx_lockedList" }, + { 2144, "createfx_draw_enabled" }, + { 2145, "buttonIsHeld" }, + { 2146, "player" }, + { 2147, "fx_rotating" }, + { 2148, "createfx_selecting" }, + { 2149, "createfxCursor" }, + { 2150, "buttonClick" }, + { 2151, "button_is_kb" }, + { 2152, "fx_highLightedEnt" }, + { 2153, "func_process_fx_rotater" }, + { 2154, "func_position_player_get" }, + { 2155, "copy_angles_of_selected_ents" }, + { 2156, "reset_axis_of_selected_ents" }, + { 2157, "last_selected_entity_has_changed" }, + { 2158, "drop_selection_to_ground" }, + { 2159, "set_off_exploders" }, + { 2160, "exploder" }, + { 2161, "draw_distance" }, + { 2162, "createfx_autosave" }, + { 2163, "flag_waitopen" }, + { 2164, "rotate_over_time" }, + { 2165, "delete_pressed" }, + { 2166, "remove_selected_option" }, + { 2167, "remove_option" }, + { 2168, "delete_selection" }, + { 2169, "insert_effect" }, + { 2170, "show_help" }, + { 2171, "select_all_exploders_of_currently_selected" }, + { 2172, "copy_ents" }, + { 2173, "stored_ents" }, + { 2174, "textAlpha" }, + { 2175, "paste_ents" }, + { 2176, "add_and_select_entity" }, + { 2177, "get_center_of_array" }, + { 2178, "ent_draw_axis" }, + { 2179, "rotation_is_occuring" }, + { 2180, "print_fx_options" }, + { 2181, "createfxDefaults" }, + { 2182, "entity_highlight_disable" }, + { 2183, "entity_highlight_enable" }, + { 2184, "toggle_createfx_drawing" }, + { 2185, "manipulate_createfx_ents" }, + { 2186, "reset_fx_hud_colors" }, + { 2187, "button_is_held" }, + { 2188, "toggle_entity_selection" }, + { 2189, "select_entity" }, + { 2190, "ent_is_highlighted" }, + { 2191, "deselect_entity" }, + { 2192, "index_is_selected" }, + { 2193, "ent_is_selected" }, + { 2194, "draw_axis" }, + { 2195, "fxHudElements" }, + { 2196, "createfx_centerprint_thread" }, + { 2197, "buttonDown" }, + { 2198, "buttonPressed_internal" }, + { 2199, "get_selected_move_vector" }, + { 2200, "process_button_held_and_clicked" }, + { 2201, "locked" }, + { 2202, "kb_locked" }, + { 2203, "add_button" }, + { 2204, "add_kb_button" }, + { 2205, "set_anglemod_move_vector" }, + { 2206, "cfxprintlnStart" }, + { 2207, "fileprint_launcher_start_file" }, + { 2208, "cfxprintln" }, + { 2209, "fileprint_launcher" }, + { 2210, "cfxprintlnEnd" }, + { 2211, "fileprint_launcher_end_file" }, + { 2212, "func_updatefx" }, + { 2213, "hack_start" }, + { 2214, "get_player" }, + { 2215, "createfx_orgranize_array" }, + { 2216, "stop_fx_looper" }, + { 2217, "stop_loopsound" }, + { 2218, "_effect_keys" }, + { 2219, "alphabetize" }, + { 2220, "restart_fx_looper" }, + { 2221, "process_fx_rotater" }, + { 2222, "generate_fx_log" }, + { 2223, "scriptPrintln" }, + { 2224, "debugPrintln" }, + { 2225, "draw_debug_line" }, + { 2226, "waittillend" }, + { 2227, "noself_func" }, + { 2228, "self_func" }, + { 2229, "randomvector" }, + { 2230, "randomvectorrange" }, + { 2231, "angle_dif" }, + { 2232, "sign" }, + { 2233, "track" }, + { 2234, "current_target" }, + { 2235, "get_enemy_team" }, + { 2236, "clear_exception" }, + { 2237, "exception" }, + { 2238, "defaultException" }, + { 2239, "set_exception" }, + { 2240, "set_all_exceptions" }, + { 2241, "cointoss" }, + { 2242, "choose_from_weighted_array" }, + { 2243, "get_cumulative_weights" }, + { 2244, "waittill_string" }, + { 2245, "waittill_multiple" }, + { 2246, "threads" }, + { 2247, "waittill_multiple_ents" }, + { 2248, "waittill_any_return" }, + { 2249, "waittill_any_timeout" }, + { 2250, "_timeout" }, + { 2251, "waittill_any" }, + { 2252, "waittill_any_ents" }, + { 2253, "isFlashed" }, + { 2254, "flashEndTime" }, + { 2255, "flag_exist" }, + { 2256, "flag" }, + { 2257, "init_flags" }, + { 2258, "flags_lock" }, + { 2259, "generic_index" }, + { 2260, "sp_stat_tracking_func" }, + { 2261, "flag_struct" }, + { 2262, "trigger_flags" }, + { 2263, "empty_init_func" }, + { 2264, "issuffix" }, + { 2265, "flag_set" }, + { 2266, "assign_unique_id" }, + { 2267, "unique_id" }, + { 2268, "flag_wait" }, + { 2269, "flag_clear" }, + { 2270, "waittill_either" }, + { 2271, "array_thread" }, + { 2272, "array_call" }, + { 2273, "array_thread4" }, + { 2274, "array_thread5" }, + { 2275, "trigger_on" }, + { 2276, "trigger_on_proc" }, + { 2277, "realOrigin" }, + { 2278, "trigger_off" }, + { 2279, "trigger_off_proc" }, + { 2280, "set_trigger_flag_permissions" }, + { 2281, "update_trigger_based_on_flags" }, + { 2282, "script_flag_true" }, + { 2283, "script_flag_false" }, + { 2284, "trigger_func" }, + { 2285, "create_flags_and_return_tokens" }, + { 2286, "init_trigger_flags" }, + { 2287, "getstruct" }, + { 2288, "struct_class_names" }, + { 2289, "getstructarray" }, + { 2290, "struct_class_init" }, + { 2291, "struct" }, + { 2292, "fileprint_start" }, + { 2293, "fileprint_map_start" }, + { 2294, "fileprint_map_header" }, + { 2295, "fileprint_map_keypairprint" }, + { 2296, "fileprint_map_entity_start" }, + { 2297, "fileprint_map_entity_end" }, + { 2298, "fileprint_radiant_vec" }, + { 2299, "array_remove" }, + { 2300, "array_remove_array" }, + { 2301, "array_removeUndefined" }, + { 2302, "array_levelthread" }, + { 2303, "array_levelcall" }, + { 2304, "add_to_array" }, + { 2305, "flag_assert" }, + { 2306, "flag_wait_either" }, + { 2307, "flag_wait_either_return" }, + { 2308, "flag_wait_any" }, + { 2309, "flag_wait_any_return" }, + { 2310, "flag_wait_all" }, + { 2311, "flag_wait_or_timeout" }, + { 2312, "flag_waitopen_or_timeout" }, + { 2313, "wait_for_flag_or_time_elapses" }, + { 2314, "delayCall" }, + { 2315, "delayCall_proc" }, + { 2316, "noself_delayCall" }, + { 2317, "noself_delayCall_proc" }, + { 2318, "isSP" }, + { 2319, "isSP_TowerDefense" }, + { 2320, "string_starts_with" }, + { 2321, "plot_points" }, + { 2322, "draw_line_for_time" }, + { 2323, "array_combine" }, + { 2324, "flat_angle" }, + { 2325, "flat_origin" }, + { 2326, "draw_arrow_time" }, + { 2327, "get_linked_ents" }, + { 2328, "script_linkto" }, + { 2329, "get_linked_vehicle_nodes" }, + { 2330, "get_linked_ent" }, + { 2331, "get_linked_vehicle_node" }, + { 2332, "get_links" }, + { 2333, "run_thread_on_targetname" }, + { 2334, "getNodeArrayFunction" }, + { 2335, "run_thread_on_noteworthy" }, + { 2336, "draw_arrow" }, + { 2337, "getfx" }, + { 2338, "fxExists" }, + { 2339, "print_csv_asset" }, + { 2340, "csv_lines" }, + { 2341, "fileprint_csv_start" }, + { 2342, "_loadfx" }, + { 2343, "getLastWeapon" }, + { 2344, "saved_lastWeapon" }, + { 2345, "PlayerUnlimitedAmmoThread" }, + { 2346, "isUsabilityEnabled" }, + { 2347, "disabledUsability" }, + { 2348, "_disableUsability" }, + { 2349, "_enableUsability" }, + { 2350, "resetUsability" }, + { 2351, "_disableWeapon" }, + { 2352, "disabledWeapon" }, + { 2353, "_enableWeapon" }, + { 2354, "isWeaponEnabled" }, + { 2355, "_disableWeaponSwitch" }, + { 2356, "disabledWeaponSwitch" }, + { 2357, "_enableWeaponSwitch" }, + { 2358, "isWeaponSwitchEnabled" }, + { 2359, "_disableOffhandWeapons" }, + { 2360, "disabledOffhandWeapons" }, + { 2361, "_enableOffhandWeapons" }, + { 2362, "isOffhandWeaponEnabled" }, + { 2363, "random" }, + { 2364, "spawn_tag_origin" }, + { 2365, "waittill_notify_or_timeout" }, + { 2366, "fileprintlauncher_linecount" }, + { 2367, "launcher_write_clipboard" }, + { 2368, "isDestructible" }, + { 2369, "destructible_type" }, + { 2370, "pauseEffect" }, + { 2371, "activate_individual_exploder" }, + { 2372, "brush_delete" }, + { 2373, "connectPathsFunction" }, + { 2374, "exploded" }, + { 2375, "brush_throw" }, + { 2376, "get_target_ent" }, + { 2377, "getNodeFunction" }, + { 2378, "brush_show" }, + { 2379, "script_modelname" }, + { 2380, "brush_shown" }, + { 2381, "disconnect_paths" }, + { 2382, "disconnectPathsFunction" }, + { 2383, "exploder_earthquake" }, + { 2384, "do_earthquake" }, + { 2385, "earthquake" }, + { 2386, "exploder_rumble" }, + { 2387, "exploder_delay" }, + { 2388, "exploder_damage" }, + { 2389, "effect_loopsound" }, + { 2390, "loopsound_ent" }, + { 2391, "play_loopsound_in_space" }, + { 2392, "sound_effect" }, + { 2393, "effect_soundalias" }, + { 2394, "play_sound_in_space" }, + { 2395, "cannon_effect" }, + { 2396, "exploder_playSound" }, + { 2397, "fire_effect" }, + { 2398, "first_frame" }, + { 2399, "loop_sound_delete" }, + { 2400, "activate_exploder" }, + { 2401, "is_later_in_alphabet" }, + { 2402, "alphabet_compare" }, + { 2403, "play_loop_sound_on_entity" }, + { 2404, "stop_loop_sound_on_entity" }, + { 2405, "delete_on_death" }, + { 2406, "error" }, + { 2407, "create_dvar" }, + { 2408, "void" }, + { 2409, "tag_project" }, + { 2410, "ter_op" }, + { 2411, "lock" }, + { 2412, "max_count" }, + { 2413, "is_locked" }, + { 2414, "unlock_wait" }, + { 2415, "unlock" }, + { 2416, "unlock_thread" }, + { 2417, "template_script" }, + { 2418, "setParent" }, + { 2419, "parent" }, + { 2420, "point" }, + { 2421, "yOffset" }, + { 2422, "xOffset" }, + { 2423, "relativePoint" }, + { 2424, "getParent" }, + { 2425, "addChild" }, + { 2426, "children" }, + { 2427, "index" }, + { 2428, "removeChild" }, + { 2429, "setPoint" }, + { 2430, "uiParent" }, + { 2431, "elemType" }, + { 2432, "setPointBar" }, + { 2433, "bar" }, + { 2434, "padding" }, + { 2435, "frac" }, + { 2436, "updateBar" }, + { 2437, "shader" }, + { 2438, "hidebar" }, + { 2439, "orig_alpha" }, + { 2440, "createFontString" }, + { 2441, "fontHeight" }, + { 2442, "createServerClientFontString" }, + { 2443, "createClientTimer" }, + { 2444, "createServerFontString" }, + { 2445, "createServerTimer" }, + { 2446, "createIcon" }, + { 2447, "createClientIcon" }, + { 2448, "createIcon_Hudelem" }, + { 2449, "createBar" }, + { 2450, "flashFrac" }, + { 2451, "createClientProgressBar" }, + { 2452, "createClientBar" }, + { 2453, "setFlashFrac" }, + { 2454, "fade_over_time" }, + { 2455, "flashThread" }, + { 2456, "destroyElem" }, + { 2457, "setIconShader" }, + { 2458, "setWidth" }, + { 2459, "setHeight" }, + { 2460, "setSize" }, + { 2461, "updateChildren" }, + { 2462, "stance_carry_icon_enamble" }, + { 2463, "stance_carry" }, + { 2464, "console" }, +// ... + { 2556, "delayThread" }, + { 2562, "gameskill" }, + { 2574, "player_damage" }, + + { 2577, "players" }, +// ... + { 2609, "stats" }, + { 2623, "isPrimaryWeapon" }, + { 2664, "forward" }, +// ... + { 2700, "attacker" }, + { 2703, "updateOrigin" }, + { 2711, "A" }, + { 2738, "voice" }, + { 2755, "getRank" }, + { 2764, "priority" }, +// ... + { 2810, "sunradiosity" }, + { 2811, "skycolor" }, + { 2812, "skylight" }, + { 2813, "_color" }, + { 2814, "ltOrigin" }, + { 2815, "gndlt" }, + { 2816, "sound_csv_include" }, + { 2817, "csv_include" }, + { 2818, "precache_script" }, +// { 2819, "" }, + { 2820, "maxbounces" }, + { 2821, "radiosityscale" }, +// { 2822, "" }, + { 2823, "def" }, + { 2824, "exponent" }, + { 2825, "fov_inner" }, + { 2826, "fov_outer" }, + { 2827, "__smorigin" }, + { 2828, "__smangles" }, + { 2829, "__smname" }, + { 2830, "__smid" }, +// { 2831, "" }, +// { 2832, "" }, +// { 2833, "" }, +// { 2834, "" }, +// { 2835, "" }, + { 2836, "contrastGain" }, // MAYBE +// ... + { 2944, "isTeamSpeaking" }, // animscripts/battlechater_ai + + { 2961, "string" }, +// ... + { 3075, "getVectorRightAngle" }, + { 3105, "within_fov" }, + + { 3226, "primaryWeapon" }, +// ... + { 3297, "isSniper" }, +// ... + { 3360, "lastCarExplosionTime" }, + { 3361, "lastCarExplosionRange" }, + { 3362, "lastCarExplosionDamageLocation" }, + { 3363, "lastCarExplosionLocation" }, + + { 3445, "playDeathSound" }, + { 3460, "makeType" }, + { 3461, "getInfoIndex" }, + { 3463, "destructible_create" }, + { 3464, "destructible_state" }, + { 3465, "destructible_anim" }, + { 3466, "destructible_fx" }, + { 3467, "destructible_explode" }, + { 3469, "prop_ac_prs_enm_con_digger_a" }, + { 3470, "prop_ac_prs_enm_con_dump_truck_a" }, + { 3471, "prop_ac_prs_enm_fuel_tank_a" }, + { 3472, "prop_ac_prs_enm_hanger_a" }, + { 3473, "prop_ac_prs_enm_maz_a" }, + { 3474, "prop_ac_prs_enm_mi26_halo_a" }, + { 3475, "prop_ac_prs_enm_mstas_a" }, + { 3476, "prop_ac_prs_enm_radar_maz_a" }, + { 3477, "prop_ac_prs_enm_s300v_a" }, + { 3484, "prop_ac_prs_enm_truck_a" }, + { 3491, "prop_ac_prs_enm_mobile_crane_a" }, + { 3492, "prop_ac_prs_enm_landing_craft_a" }, + { 3493, "prop_ac_prs_enm_speed_boat_a" }, + { 3494, "prop_ac_prs_prp_satellite_dish_a_dish" }, +// ... + { 3509, "prop_ac_prs_enm_missile_boat_a" }, + { 3510, "toy_glass" }, + { 3511, "destructible_splash_damage_scaler" }, + { 3512, "destructible_sound" }, + { 3513, "destructible_part" }, + { 3514, "toy_dt_mirror" }, + { 3515, "toy_icbm_consolemonitor" }, + { 3516, "toy_tubetv_" }, + { 3517, "toy_tvs_flatscreen" }, + { 3518, "toy_tvs_flatscreen_sturdy" }, + { 3519, "toy_transformer_ratnest01" }, + { 3520, "destructible_loopfx" }, + { 3521, "destructible_loopsound" }, + { 3522, "destructible_healthdrain" }, + { 3523, "toy_transformer_small01" }, + { 3524, "toy_generator" }, + { 3525, "toy_generator_on" }, + { 3526, "toy_oxygen_tank" }, + { 3527, "toy_electricbox2" }, + { 3528, "toy_electricbox4" }, + { 3529, "toy_airconditioner" }, + { 3530, "toy_ceiling_fan" }, + { 3531, "toy_wall_fan" }, + { 3532, "toy_propane_tank02" }, + { 3533, "destructible_physics" }, + { 3534, "toy_propane_tank02_small" }, + { 3535, "toy_copier" }, + { 3536, "toy_firehydrant" }, + { 3537, "toy_parkingmeter" }, + { 3538, "damage_not" }, + { 3539, "toy_mailbox" }, + { 3540, "toy_mailbox2" }, + { 3541, "toy_newspaper_stand_red" }, + { 3542, "toy_newspaper_stand_blue" }, + { 3543, "toy_filecabinet" }, + { 3544, "toy_trashbin_01" }, + { 3545, "toy_trashbin_02" }, + { 3546, "toy_trashbag1" }, + { 3547, "toy_recyclebin_01" }, + { 3548, "toy_trashcan_metal_closed" }, + { 3549, "toy_water_collector" }, + { 3550, "toy_foliage_tree_oak_1" }, + { 3551, "toy_paris_tree_plane_large" }, + { 3552, "toy_usa_gas_station_trash_bin_01" }, + { 3553, "toy_usa_gas_station_trash_bin_02" }, + { 3554, "toy_light_ceiling_round" }, + { 3555, "destructible_lights_out" }, + { 3556, "toy_light_ceiling_fluorescent" }, + { 3557, "toy_light_ceiling_fluorescent_spotlight" }, + { 3558, "destructible_spotlight" }, + { 3559, "toy_light_ceiling_fluorescent_single" }, + { 3560, "toy_light_ceiling_fluorescent_single_spotlight" }, + { 3561, "toy_bookstore_bookstand4_books" }, + { 3562, "toy_locker_double" }, + { 3563, "toy_dubai_fish_sculpture" }, + { 3564, "toy_intro_concrete_chipaway" }, + { 3565, "toy_chicken" }, + { 3566, "toy_hide_with_fx" }, + { 3567, "vehicle_ac130_80s_sedan1" }, + { 3568, "vehicle_bus_destructible" }, + { 3569, "vehicle_80s_sedan1" }, + { 3570, "vehicle_80s_hatch1" }, + { 3571, "vehicle_80s_hatch2" }, + { 3572, "vehicle_80s_wagon1" }, + { 3573, "vehicle_civ_car_a" }, + { 3574, "vehicle_small_hatch" }, + { 3575, "vehicle_london_cab_black" }, + { 3576, "vehicle_pickup" }, + { 3577, "vehicle_hummer" }, + { 3578, "vehicle_gaz" }, + { 3579, "vehicle_gaz_harbor" }, + { 3580, "vehicle_bm21" }, + { 3581, "vehicle_moving_truck" }, + { 3582, "vehicle_subway_cart" }, + { 3583, "create_vehicle_subway_cart_window_single" }, + { 3584, "vehicle_subway_cart_windows" }, + { 3585, "vehicle_subway_cart_windows_small" }, + { 3586, "vehicle_luxurysedan" }, + { 3587, "destructible_car_alarm" }, + { 3588, "vehicle_mig29_landed" }, + { 3589, "vehicle_mack_truck_short" }, + { 3590, "vehicle_semi_truck" }, + { 3591, "vehicle_motorcycle" }, + { 3592, "vehicle_scooter" }, + { 3593, "vehicle_subcompact" }, + { 3594, "vehicle_van" }, + { 3595, "vehicle_uaz_van" }, + { 3596, "vehicle_van_iw5" }, + { 3597, "vehicle_delivery_theme_park_truck_destructible" }, + { 3598, "vehicle_suburban" }, + { 3599, "vehicle_snowmobile" }, + { 3600, "destructible_gaspump" }, + { 3601, "destructible_electrical_transformer_large" }, + { 3602, "get_precached_anim" }, + { 3603, "_destructible_preanims" }, + { 3604, "get_precached_animtree" }, + { 3605, "_destructible_preanimtree" }, + { 3606, "vehicle_coupe" }, + { 3607, "vehicle_mini" }, + { 3608, "vehicle_uk_truck" }, + { 3609, "vehicle_uk_police_estate" }, + { 3610, "vehicle_uaz_winter" }, + { 3611, "vehicle_uaz_fabric" }, + { 3612, "vehicle_uaz_hardtop" }, + { 3613, "vehicle_jeep" }, + { 3614, "vehicle_jeep_dusty" }, + { 3615, "vehicle_uaz_open" }, + { 3616, "vehicle_india_compact_destructible" }, + { 3617, "vehicle_india_rickshaw" }, + { 3618, "vehicle_tuk_tuk" }, + { 3619, "vehicle_india_suv" }, + { 3620, "vehicle_policecar" }, + { 3621, "vehicle_policecar_russia" }, + { 3622, "vehicle_taxi" }, + { 3623, "random_dynamic_attachment" }, + { 3624, "vehicle_taxi_dubai" }, + { 3625, "toy_security_camera" }, + { 3626, "toy_building_collapse_paris_ac130" }, + { 3627, "toy_poison_gas_attack" }, + { 3628, "toy_arcade_machine" }, + { 3629, "toy_pinball_machine" }, + { 3630, "toy_fortune_machine" }, + { 3631, "toy_trashcan_clown" }, + { 3632, "toy_afrShanty1" }, + { 3633, "vehicle_slava_ny_harbor_zonea" }, + { 3634, "rooftop_skylight_destructible" }, + { 3635, "satellite_dish_big_destructible" }, + { 3636, "dest_onestate" }, + { 3637, "dest_pb_planter" }, + { 3638, "berlin_hotel_lights_ceiling1" }, + { 3639, "rus_vx_gas_canister" }, + { 3640, "destructibleSpawnedEntsLimit" }, + { 3641, "destructibleSpawnedEnts" }, + { 3642, "currentCarAlarms" }, + { 3643, "commonStartTime" }, + { 3644, "fast_destructible_explode" }, + { 3645, "warn_about_old_destructible" }, + { 3646, "find_destructibles" }, + { 3647, "setup_destructibles" }, + { 3648, "modeldummyon" }, + { 3649, "destructibleInfo" }, + { 3650, "parts" }, + { 3651, "destructible_parts" }, + { 3652, "modeldummy" }, + { 3653, "add_key_to_destructible" }, + { 3654, "add_keypairs_to_destructible" }, + { 3655, "add_array_to_destructible" }, + { 3656, "destructible_info" }, + { 3657, "precache_destructibles" }, + { 3658, "add_destructible_fx" }, + { 3659, "canDamageDestructible" }, + { 3660, "destructibles" }, + { 3661, "destructible_think" }, + { 3662, "damageOwner" }, + { 3663, "gunner" }, + { 3664, "is_shotgun_damage" }, + { 3665, "enable_ai_shotgun_destructible_damage" }, + { 3666, "getPartAndStateIndex" }, + { 3667, "destructible_update_part" }, + { 3668, "non_player_damage" }, + { 3669, "waiting_for_queue" }, + { 3670, "exploding" }, + { 3671, "loopingSoundStopNotifies" }, + { 3672, "damage_type" }, + { 3673, "destructible_splash_rotatation" }, + { 3674, "destructible_splash_damage" }, + { 3675, "getAllActiveParts" }, + { 3676, "setDistanceOnParts" }, + { 3677, "getLowestPartDistance" }, + { 3678, "isValidSoundCause" }, + { 3679, "isAttackerValid" }, + { 3680, "forceExploding" }, + { 3681, "dontAllowExplode" }, + { 3682, "damageIsFromPlayer" }, + { 3683, "isAIfunc" }, + { 3684, "isValidDamageCause" }, + { 3685, "godmode" }, + { 3686, "script_bulletshield" }, + { 3687, "getDamageType" }, + { 3688, "damage_mirror" }, + { 3689, "add_damage_owner_recorder" }, + { 3690, "car_damage_owner_recorder" }, + { 3691, "loopfx_onTag" }, + { 3692, "health_drain" }, + { 3693, "destructible_badplace_radius_multiplier" }, + { 3694, "destructible_health_drain_amount_multiplier" }, + { 3695, "healthDrain" }, + { 3696, "disable_destructible_bad_places" }, + { 3697, "disableBadPlace" }, + { 3698, "badplace_cylinder_func" }, + { 3699, "badplace_remove" }, + { 3700, "badplace_delete_func" }, + { 3701, "physics_launch" }, + { 3702, "physics_object_remove" }, + { 3703, "explode" }, + { 3704, "destructible_explosion_radius_multiplier" }, + { 3705, "destructible_protection_func" }, + { 3706, "cleanupVars" }, + { 3707, "animsapplied" }, + { 3708, "caralarm" }, + { 3709, "destructible_cleans_up_more" }, + { 3710, "script_noflip" }, + { 3711, "car_alarm_org" }, + { 3712, "set_disable_friendlyfire_value_delayed" }, + { 3713, "friendlyFireDisabledForDestructible" }, + { 3714, "connectTraverses" }, + { 3715, "disconnectTraverses" }, + { 3716, "get_traverse_disconnect_brush" }, + { 3717, "script_destruct_collision" }, + { 3718, "hideapart" }, + { 3719, "showapart" }, + { 3720, "disable_explosion" }, + { 3721, "force_explosion" }, + { 3722, "get_dummy" }, + { 3723, "play_loop_sound_on_destructible" }, + { 3724, "force_stop_sound" }, + { 3725, "notifyDamageAfterFrame" }, + { 3726, "play_sound" }, + { 3727, "toString" }, + { 3728, "do_car_alarm" }, + { 3729, "lastCarAlarmTime" }, + { 3730, "car_alarm_timeout" }, + { 3731, "should_do_car_alarm" }, + { 3732, "do_random_dynamic_attachment" }, + { 3733, "get_closest_with_targetname" }, + { 3734, "player_touching_post_clip" }, + { 3735, "get_player_touching" }, + { 3736, "is_so" }, + { 3737, "destructible_handles_collision_brushes" }, + { 3738, "collision_brush_pre_explosion" }, + { 3739, "collision_brush_post_explosion" }, + { 3740, "func_destructible_crush_player" }, + { 3741, "debug_player_in_post_clip" }, + { 3742, "destructible_get_my_breakable_light" }, + { 3743, "breakable_light" }, + { 3744, "break_nearest_light" }, + { 3745, "debug_radiusdamage_circle" }, + { 3746, "debug_circle_drawlines" }, + { 3747, "debug_line" }, + { 3748, "spotlight_tag_origin_cleanup" }, + { 3749, "spotlight_fizzles_out" }, + { 3750, "destructible_spotlight_think" }, + { 3751, "is_valid_damagetype" }, + { 3752, "destructible_sound_think" }, + { 3753, "destructible_fx_think" }, + { 3754, "destructible_animation_think" }, + { 3755, "no_destructible_animation" }, + { 3756, "clear_anims" }, + { 3757, "init_destroyed_count" }, + { 3758, "destroyedCount" }, + { 3759, "destroyedCountTimeout" }, + { 3760, "init_destroyed_count" }, + { 3761, "add_to_destroyed_count" }, + { 3762, "get_destroyed_count" }, + { 3763, "get_max_destroyed_count" }, + { 3764, "init_destructible_frame_queue" }, + { 3765, "destructibleFrameQueue" }, + { 3766, "add_destructible_to_frame_queue" }, + { 3767, "entNum" }, + { 3768, "destructible" }, + { 3769, "totalDamage" }, + { 3770, "nearDistance" }, + { 3771, "fxCost" }, + { 3772, "handle_destructible_frame_queue" }, + { 3773, "sort_destructible_frame_queue" }, + { 3774, "get_better_destructible" }, + { 3775, "get_part_FX_cost_for_action_state" }, +// ... + { 3791, "hatModel" }, + + { 3844, "vehicle" }, + + { 3974, "rockets" }, + + { 4095, "secondaryWeapon" }, + { 4116, "startPos" }, + { 4145, "winner" }, + + { 4538, "scr_sound" }, + { 4570, "play_sound_on_entity" }, + { 4595, "play_sound_on_tag" }, + { 4630, "script_bombmode_original" }, + + { 4778, "challenge_targetVal" }, + { 4779, "challenge_rewardVal" }, + { 4780, "getChallengeStatus" }, + { 4781, "challengeData" }, + { 4782, "ch_getProgress" }, + { 4783, "ch_getState" }, + { 4784, "ch_setProgress" }, + { 4785, "ch_setState" }, + { 4786, "ch_getTarget" }, + { 4787, "buildChallengeTableInfo" }, + { 4788, "challengeInfo" }, + { 4790, "challengeSplashNotify" }, + { 4791, "optionalNumber" }, + { 4792, "sound" }, + { 4793, "slot" }, + { 4794, "actionNotify" }, + { 4795, "updateChallenges" }, + { 4797, "giveRankXpAfterWait" }, + { 4799, "processChallenge" }, + { 4800, "initNotifyMessage" }, + { 4802, "notifyTitle" }, + { 4803, "notifyText" }, + { 4804, "notifyText2" }, + { 4805, "notifyIcon" }, + { 4808, "doingSplash" }, + { 4809, "splashQueue" }, + { 4810, "maxRank" }, + { 4811, "rankTable" }, + { 4823, "scoreInfo" }, + { 4824, "xpScale" }, + { 4839, "fontPulseInit" }, + { 4840, "baseFontScale" }, + { 4841, "maxFontScale" }, + { 4842, "inFrames" }, + { 4843, "outFrames" }, + { 4844, "fontPulse" }, + { 4845, "updateRank" }, + { 4847, "updateRankAnnounceHUD" }, + { 4848, "titleText" }, + { 4849, "iconName" }, + { 4850, "duration" }, + { 4851, "textLabel" }, + { 4854, "notifyMessage" }, + { 4855, "stringToFloat" }, + { 4856, "actionNotifyMessage" }, + { 4857, "removeTypeFromQueue" }, + { 4858, "showNotifyMessage" }, + { 4859, "titleLabel" }, + { 4860, "titleIsString" }, + { 4861, "text2Label" }, + { 4862, "resetOnCancel" }, + { 4863, "waitRequireVisibility" }, + { 4864, "canReadText" }, + { 4865, "isFlashbanged" }, + { 4866, "dispatchNotify" }, + { 4867, "registerScoreInfo" }, + { 4868, "getScoreInfoValue" }, + { 4869, "getRankInfoMinXP" }, + { 4870, "getRankInfoXPAmt" }, + { 4871, "getRankInfoMaxXp" }, + { 4872, "getRankInfoFull" }, + { 4873, "getRankInfoIcon" }, + { 4874, "getRankForXp" }, + { 4875, "getRankXP" }, + + { 5170, "intensity" }, + { 5176, "start" }, + { 5177, "end" }, + { 5179, "time" }, + { 5182, "fx" }, + { 5192, "delayThread_proc" }, + { 5197, "currentNode" }, + { 5243, "prev" }, + { 5329, "mode" }, + { 5614, "offset" }, + { 5711, "_unk_field_ID5711" }, // was introduced in an IW patch, used in _destructible.gsc + { 5797, "_unk_field_ID5797" }, // was introduced in an IW patch, used in _destructible.gsc + { 5801, "inUse" }, + { 5972, "pos" }, + { 5980, "delay" }, +// ... + { 6070, "points" }, + { 6296, "icon" }, + { 6415, "ps3" }, + { 6695, "hud_damagefeedback" }, + { 6702, "updateDamageFeedback" }, + { 6797, "hidden" }, + { 6858, "artStartVisionFileExport" }, + { 6859, "artEndVisionFileExport" }, + { 6860, "artStartFogFileExport" }, + { 6861, "artEndFogFileExport" }, + { 6862, "artCommonfxprintln" }, + { 6863, "setfogsliders" }, + { 6864, "translateFogSlidersToScript" }, + { 6865, "fogexphalfplane" }, + { 6866, "fognearplane" }, + { 6867, "fogcolor" }, + { 6868, "fogmaxopacity" }, + { 6869, "sunFogEnabled" }, + { 6870, "sunFogColor" }, + { 6871, "sunFogDir" }, + { 6872, "sunFogBeginFadeAngle" }, + { 6873, "sunFogEndFadeAngle" }, + { 6874, "sunFogScale" }, + { 6875, "limit" }, + { 6876, "updateFogFromScript" }, + { 6877, "artfxprintlnFog" }, + { 6886, "tweakart" }, + { 6890, "startdist" }, + { 6891, "halfwaydist" }, + { 6892, "red" }, + { 6893, "green" }, + { 6894, "blue" }, + { 6895, "maxopacity" }, + { 6923, "fovslidercheck" }, + { 6930, "create_vision_set_fog" }, + { 6931, "transitionTime" }, + { 6932, "dumpsettings" }, + { 6943, "scale" }, + { 6973, "vision_set_fog_changes" }, +// ... + { 7122, "timeLimitOverride" }, + { 7156, "func_loopfxthread" }, + { 7157, "func_oneshotfxthread" }, + { 7158, "func_create_loopsound" }, + { 7159, "global_FX" }, + { 7162, "global_FX_create" }, + { 7163, "watchGrenadeUsage" }, + { 7164, "c4explodethisframe" }, + { 7165, "c4array" }, + { 7166, "throwingGrenade" }, + { 7177, "beginGrenadeTracking" }, + { 7178, "grenade_earthQuake" }, + { 7180, "beginC4Tracking" }, + { 7181, "watchC4" }, + { 7182, "c4Death" }, + { 7183, "array_remove_nokeys" }, + { 7184, "watchClaymores" }, + { 7187, "claymoreDetonation" }, + { 7190, "deleteOnDeath" }, + { 7191, "watchC4Detonation" }, + { 7192, "watchC4AltDetonation" }, + { 7193, "waitAndDetonate" }, + { 7194, "c4Damage" }, + { 7195, "resetC4ExplodeThisFrame" }, + { 7196, "saydamaged" }, + { 7200, "getDamageableEnts" }, + { 7201, "isPlayer" }, + { 7202, "isADestructable" }, + { 7203, "damageCenter" }, + { 7204, "weaponDamageTracePassed" }, + { 7205, "damageEnt" }, + { 7206, "damageOrigin" }, + { 7207, "callbackPlayerDamage" }, + { 7208, "debugline" }, + { 7209, "onWeaponDamage" }, + { 7210, "watchC4AltDetonate" }, + { 7352, "elevators" }, + { 7353, "elevator_callbutton_link_v" }, + { 7354, "elevator_callbutton_link_h" }, + { 7355, "elevator_update_global_dvars" }, + { 7356, "elevator_accel" }, + { 7357, "elevator_decel" }, + { 7358, "elevator_music" }, + { 7359, "elevator_speed" }, + { 7360, "elevator_innerdoorspeed" }, + { 7361, "elevator_outterdoorspeed" }, + { 7362, "elevator_return" }, + { 7363, "elevator_waittime" }, + { 7364, "elevator_aggressive_call" }, + { 7365, "elevator_debug" }, + { 7366, "elevator_motion_detection" }, + { 7367, "elevator_think" }, + { 7368, "elevator_call" }, + { 7369, "elevator_callbuttons" }, + { 7370, "floor_override" }, + { 7371, "overrider" }, + { 7372, "elevator_fsm" }, + { 7373, "eState" }, + { 7374, "moveto_floor" }, + { 7375, "motion_trigger" }, + { 7376, "elevator_interrupted" }, + { 7377, "monitor_callbutton" }, + { 7378, "e" }, + { 7379, "call_elevator" }, + { 7380, "get_floor" }, + { 7381, "elevator_interrupt" }, + { 7382, "elevator_floor_update" }, + { 7383, "elevator_sound_think" }, + { 7384, "listen_for" }, + { 7385, "position_elevators" }, + { 7386, "elevator_move" }, + { 7387, "close_inner_doors" }, + { 7388, "open_inner_doors" }, + { 7389, "close_outer_doors" }, + { 7390, "open_outer_doors" }, + { 7391, "build_elevators" }, + { 7392, "build_call_buttons" }, + { 7393, "setup_hints" }, + { 7394, "make_discrete_trigger" }, + { 7395, "enabled" }, + { 7396, "discrete_waittill" }, + { 7397, "discrete_enable_triggerwaittill" }, + { 7398, "disable_trigger" }, + { 7399, "disable_trigger_helper" }, + { 7400, "get_outer_doorset" }, + { 7401, "get_outer_doorsets" }, + { 7402, "get_outer_closedpos" }, + { 7403, "get_outer_leftdoor" }, + { 7404, "get_outer_rightdoor" }, + { 7405, "get_outer_leftdoor_openedpos" }, + { 7406, "get_outer_rightdoor_openedpos" }, + { 7407, "get_housing_children" }, + { 7408, "get_housing_mainframe" }, + { 7409, "get_housing_models" }, + { 7410, "get_housing_primarylight" }, + { 7411, "get_housing_musak_model" }, + { 7412, "get_housing_door_trigger" }, + { 7413, "get_housing_inside_trigger" }, + { 7414, "get_housing_closedpos" }, + { 7415, "get_housing_leftdoor" }, + { 7416, "get_housing_rightdoor" }, + { 7417, "get_housing_leftdoor_opened_pos" }, + { 7418, "get_housing_rightdoor_opened_pos" }, + { 7419, "get_curFloor" }, + { 7420, "get_initFloor" }, + { 7421, "waittill_finish_moving" }, + { 7422, "isInbound" }, + { 7423, "isInBoundingSpere" }, + { 7424, "waittill_or_timeout" }, + { 7425, "elevator_get_dvar_int" }, + { 7426, "elevator_get_dvar" }, + { 7427, "_pipe_fx_time" }, + { 7428, "_pipes" }, + { 7429, "num_pipe_fx" }, + { 7430, "pipesetup" }, + { 7431, "pipe_fx_array" }, + { 7432, "B" }, + { 7433, "pipe_wait_loop" }, + { 7434, "pipe_logic" }, + { 7435, "_pipe_methods" }, + { 7436, "pipefx" }, + { 7437, "fx_time" }, + { 7438, "_sound" }, + { 7439, "pipe_damage" }, + { 7440, "_dmg" }, + { 7441, "allow_pipe_damage" }, + { 7442, "pipesDamage" }, + { 7443, "methodsInit" }, + { 7444, "pipe_calc_ballistic" }, + { 7445, "pipe_calc_splash" }, + { 7446, "pipe_calc_nofx" }, + { 7447, "precacheFX" }, + { 7448, "onPlayerConnect" }, + { 7449, "player_init" }, + { 7450, "touchTriggers" }, + { 7451, "ai_init" }, + { 7452, "civilian_jet_flyby" }, + { 7453, "jet_init" }, + { 7454, "jet_parts" }, + { 7455, "jet_flyto" }, + { 7456, "engine_fxs" }, + { 7457, "flash_fxs" }, + { 7458, "jet_engine_fx" }, + { 7459, "jet_flash_fx_red" }, + { 7460, "jet_flash_fx_green" }, + { 7461, "jet_flash_fx_blink" }, + { 7462, "civilianJetFlyBy" }, + { 7463, "old_origin" }, + { 7464, "jet_fly_vec" }, + { 7465, "jet_flight_time" }, + { 7466, "jet_reset" }, + { 7467, "jet_timer" }, + { 7468, "civilianJetFlyBy_timer" }, + { 7469, "airstrikeInProgress" }, + { 7470, "ac130player" }, + { 7471, "chopper" }, + { 7472, "remoteMissileInProgress" }, + { 7473, "getTimeInterval" }, + { 7474, "getWatchedDvar" }, + { 7475, "gameType" }, + { 7476, "overrideWatchDvars" }, + { 7477, "watchDvars" }, + { 7478, "value" }, + { 7479, "jet_flyby" }, + { 7480, "mapCenter" }, + { 7481, "jet_planeSound" }, + { 7482, "playsound_float" }, + { 7483, "playsound_loop_on_ent" }, + { 7484, "targetIsInFront" }, + { 7485, "targetIsClose" }, + { 7486, "vending_machine" }, + { 7487, "vm_normal" }, + { 7488, "vm_launch_from" }, + { 7489, "vm_launch_to" }, + { 7490, "vm_fx_loc" }, + { 7491, "vm_normal_model" }, + { 7492, "vm_damaged_model" }, + { 7493, "vm_soda_model" }, + { 7494, "vm_soda_start_pos" }, + { 7495, "vm_soda_start_angle" }, + { 7496, "vm_soda_stop_pos" }, + { 7497, "vm_soda_stop_angle" }, + { 7498, "soda_array" }, + { 7499, "soda_count" }, + { 7500, "soda_slot" }, + { 7501, "hp" }, + { 7502, "vending_machine_damage_monitor" }, + { 7503, "spawn_soda" }, + { 7504, "soda_can_drop" }, + { 7505, "soda_can_eject" }, + { 7506, "ejected" }, + { 7507, "freefall" }, + { 7508, "metal_detector" }, + { 7509, "alarm_interval" }, + { 7510, "alarm_playing" }, + { 7511, "alarm_annoyance" }, + { 7512, "tolerance" }, + { 7513, "playsound_and_light" }, + { 7514, "annoyance_tracker" }, + { 7515, "waittill_any_or_timeout" }, + { 7516, "metal_detector_weapons" }, + { 7517, "waittill_weapon_placed" }, + { 7518, "weapon_notify_loop" }, + { 7519, "isInBound_single" }, + { 7520, "metal_detector_dmg_monitor" }, + { 7521, "metal_detector_touch_monitor" }, + { 7522, "alarm_validate_damage" }, + { 7523, "creaky_board" }, + { 7524, "do_creak" }, + { 7525, "motion_light" }, + { 7526, "moveTracker" }, + { 7527, "lightsOn" }, + { 7528, "lightRigs" }, + { 7529, "touchList" }, + { 7530, "distMoved" }, + { 7531, "motion_light_timeout" }, + { 7532, "outdoor_motion_dlight" }, + { 7533, "outdoor_motion_light" }, + { 7534, "lightEnt" }, + { 7535, "outdoor_motion_dlight_timeout" }, + { 7536, "dog_bark" }, + { 7537, "trigger_door" }, + { 7538, "doorEnt" }, + { 7539, "doorAngle" }, + { 7540, "baseYaw" }, + { 7541, "doorOpen" }, + { 7542, "doorClose" }, + { 7543, "getDoorSide" }, + { 7544, "use_toggle" }, + { 7545, "bird_startle" }, + { 7546, "photo_copier_init" }, + { 7547, "copier" }, + { 7548, "copy_bar" }, + { 7549, "start_pos" }, + { 7550, "light" }, + { 7551, "end_pos" }, + { 7552, "get_photo_copier" }, + { 7553, "waittill_copier_copies" }, + { 7554, "photo_copier" }, + { 7555, "photo_copier_no_light" }, + { 7556, "reset_copier" }, + { 7557, "photo_copier_copy_bar_goes" }, + { 7558, "photo_copier_light_on" }, + { 7559, "photo_copier_stop" }, + { 7560, "photo_light_flicker" }, + { 7561, "fan_blade_rotate" }, + { 7562, "triggerTouchThink" }, + { 7563, "finished_spawning" }, + { 7564, "playerTouchTriggerThink" }, + { 7565, "guid" }, + { 7566, "moveTrackers" }, + { 7567, "gameEnded" }, + { 7568, "movementTracker" }, + { 7569, "DisablemovementTracker" }, + { 7570, "anythingTouchingTrigger" }, + { 7571, "playerTouchingTrigger" }, + + { 7621, "inc" }, + { 7622, "startYaw" }, + { 7623, "windController" }, + { 7629, "shutterWanderLeft" }, + { 7630, "shutterWanderRight" }, + { 7632, "wireWander" }, + { 7644, "breakables_fx" }, + { 7647, "barrelExpSound" }, + { 7649, "barrelHealth" }, + { 7650, "precachemodeltype" }, + { 7651, "barrelExplodingThisFrame" }, + { 7652, "breakables_clip" }, + { 7656, "_breakable_utility_modelarray" }, + { 7657, "_breakable_utility_modelindex" }, + { 7658, "_breakable_utility_maxnum" }, + { 7674, "oil_spill_think" }, + { 7675, "barrel" }, + { 7676, "oilspill" }, + { 7677, "extra" }, + { 7678, "oil_spill_burn_after" }, + { 7679, "oil_spill_burn" }, + { 7680, "oil_spill_burn_section" }, + { 7681, "explodable_barrel_think" }, + { 7682, "explodable_barrel_burn" }, + { 7683, "explodable_barrel_explode" }, + { 7684, "remove" }, + { 7697, "flags" }, + + { 7706, "breakable_clip" }, + { 7712, "modelscale" }, + { 7714, "getClosestEnt" }, + { 7724, "item" }, + { 7743, "anim_prop_models" }, + { 7748, "weight" }, + { 7752, "animateModel" }, + { 7755, "script_print_fx" }, + { 7756, "script_playfx" }, + { 7757, "script_playfxontag" }, + { 7758, "GrenadeExplosionfx" }, + { 7759, "soundfx" }, + { 7760, "soundfxDelete" }, + { 7763, "blendDelete" }, + { 7765, "setModelFromArray" }, + { 7766, "precacheModelArray" }, + { 7767, "attachHead" }, + { 7768, "character_head_index" }, + { 7769, "script_char_index" }, + { 7770, "headModel" }, + { 7771, "attachHat" }, + { 7772, "character_hat_index" }, + { 7773, "new" }, + { 7774, "anim_gunHand" }, + { 7775, "PutGunInHand" }, + { 7776, "save" }, + { 7777, "anim_gunInHand" }, + { 7778, "load" }, + { 7779, "get_random_character" }, + { 7780, "script_char_group" }, + { 7781, "character_index_cache" }, + { 7782, "get_least_used_index" }, + { 7783, "initialize_character_group" }, + { 7784, "get_random_weapon" }, + { 7785, "setupMiniMap" }, + { 7787, "_loadStarted" }, + { 7791, "mapSize" }, + { 7809, "createClientFontString_func" }, + { 7810, "HUDsetPoint_func" }, + { 7813, "laserOn_func" }, + { 7814, "laserOff_func" }, + { 7829, "playerHealthRegen" }, + { 7864, "script_prefab_exploder" }, + { 7876, "script_accel" }, + { 7889, "exploder_load" }, + { 7890, "script_chance" }, + { 7900, "script_disconnectpaths" }, + { 7902, "setupExploders" }, + { 7907, "script_ender" }, +// ... + { 8106, "watchWeaponChange" }, + { 8160, "friendlyfire" }, + { 8366, "stance" }, + { 8377, "monitorFlash" }, + { 8440, "onDeath" }, + { 8677, "oldRadius" }, + { 8745, "debugprint" }, + + { 8809, "export" }, + { 8813, "deathtime" }, + { 8908, "is_in_array" }, + { 8951, "playerHealth_RegularRegenDelay" }, + { 8954, "healthOverlayCutoff" }, + { 9005, "text" }, + { 9469, "mgTurret" }, + { 9482, "script_team" }, + { 9808, "draw_line" }, + { 9844, "array_remove_index" }, + { 9870, "flashRumbleLoop" }, +// ... + { 10039, "xenon" }, + { 10226, "endOnDeath" }, + { 10234, "dirtEffect" }, + { 10302, "entityHeadIconOffset" }, + { 10304, "entityHeadIcon" }, + { 10338, "script_targetoffset_z" }, + { 10346, "currentWeapon" }, + { 10351, "cobra_missile_models" }, + { 10352, "fire_missile" }, + { 10359, "cosine" }, + { 10372, "attractor" }, + { 10381, "turretType" }, + { 10389, "turrets" }, + { 10396, "script_airspeed" }, + { 10437, "heli_damage_monitor" }, + { 10635, "_unk_field_ID10635" }, // was introduced in an IW patch, used in _destructible.gsc + { 10637, "_unk_field_ID10637" }, // was introduced in an IW patch, used in _destructible.gsc + { 10732, "notifyString" }, + { 11038, "init_animatedmodels" }, + { 11039, "animation" }, + { 11082, "strip_suffix" }, + { 11083, "updateBarScale" }, + { 11084, "rateOfChange" }, + { 11085, "lastUpdateTime" }, + { 11086, "createTimer" }, + { 11087, "baseWidth" }, + { 11088, "baseHeight" }, + { 11089, "createServerIcon" }, + { 11090, "createServerBar" }, + { 11091, "getCurrentFraction" }, + { 11092, "createPrimaryProgressBar" }, + { 11093, "primaryProgressBarHeight" }, + { 11094, "primaryProgressBarWidth" }, + { 11095, "primaryProgressBarY" }, + { 11096, "primaryProgressBarX" }, + { 11097, "createPrimaryProgressBarText" }, + { 11098, "primaryProgressBarFontSize" }, + { 11099, "primaryProgressBarTextY" }, + { 11100, "primaryProgressBarTextX" }, + { 11101, "createTeamProgressBar" }, + { 11102, "teamProgressBarHeight" }, + { 11103, "teamProgressBarWidth" }, + { 11104, "teamProgressBarY" }, + { 11105, "createTeamProgressBarText" }, + { 11106, "teamProgressBarFontSize" }, + { 11107, "teamProgressBarTextY" }, + { 11108, "hideElem" }, + { 11109, "showElem" }, + { 11110, "getIconShader" }, + { 11111, "setIconSize" }, + { 11112, "transitionReset" }, + { 11113, "transitionZoomIn" }, + { 11114, "transitionPulseFXIn" }, + { 11115, "transitionSlideIn" }, + { 11116, "transitionSlideOut" }, + { 11117, "transitionZoomOut" }, + { 11118, "transitionFadeIn" }, + { 11119, "maxAlpha" }, + { 11120, "transitionFadeOut" }, + { 11121, "getWeeklyRef" }, + { 11122, "getDailyRef" }, + { 11123, "hud" }, + { 11124, "splitscreen" }, + { 11125, "lowerTextYAlign" }, + { 11126, "lowerTextY" }, + { 11127, "lowerTextFontSize" }, + { 11128, "getHighestScoringPlayer" }, + { 11129, "placement" }, + { 11130, "getLosingPlayers" }, + { 11131, "givePlayerScore" }, + { 11132, "rankingEnabled" }, + { 11133, "hardcoreMode" }, + { 11134, "xpPointsPopup" }, + { 11135, "statAdd" }, + { 11136, "statSetChild" }, + { 11137, "teamBased" }, + { 11138, "checkPlayerScoreLimitSoon" }, + { 11139, "checkScoreLimit" }, + { 11140, "onPlayerScore" }, + { 11141, "objectivePointsMod" }, + { 11142, "_getPlayerScore" }, + { 11143, "_setPlayerScore" }, + { 11144, "giveTeamScoreForObjective" }, + { 11145, "otherTeam" }, + { 11146, "wasWinning" }, + { 11147, "lastStatusTime" }, + { 11148, "getScoreLimit" }, + { 11149, "leaderDialog" }, + { 11150, "getWinningTeam" }, + { 11151, "_setTeamScore" }, + { 11152, "overtimeScoreWinOverride" }, + { 11153, "onScoreLimit" }, + { 11154, "checkTeamScoreLimitSoon" }, + { 11155, "updateTeamScore" }, + { 11156, "isRoundBased" }, + { 11157, "isObjectiveBased" }, + { 11158, "_getTeamScore" }, + { 11159, "sendUpdatedTeamScores" }, + { 11160, "WaitTillSlowProcessAllowed" }, + { 11161, "sendUpdatedDMScores" }, + { 11162, "updatedDMScores" }, + { 11163, "removeDisconnectedPlayerFromPlacement" }, + { 11164, "updatePlacement" }, + { 11165, "connectedPostGame" }, + { 11166, "getBetterPlayer" }, + { 11167, "updateTeamPlacement" }, + { 11168, "initialDMScoreUpdate" }, + { 11169, "processAssist" }, + { 11170, "onXPEvent" }, + { 11171, "incPersStat" }, + { 11172, "getPersStat" }, + { 11173, "incPlayerStat" }, + { 11174, "giveAdrenaline" }, + { 11175, "playerAssist" }, + { 11176, "processShieldAssist" }, + { 11177, "splashNotifyDelayed" }, + { 11178, "getTweakableDVarValue" }, + { 11179, "rules" }, + { 11180, "dVar" }, + { 11181, "gameTweaks" }, + { 11182, "teamTweaks" }, + { 11183, "playerTweaks" }, + { 11184, "classTweaks" }, + { 11185, "weaponTweaks" }, + { 11186, "hardpointTweaks" }, + { 11187, "hudTweaks" }, + { 11188, "getTweakableDVar" }, + { 11189, "getTweakableValue" }, + { 11190, "getTweakableLastValue" }, + { 11191, "lastValue" }, + { 11192, "setTweakableValue" }, + { 11193, "setTweakableLastValue" }, + { 11194, "registerTweakable" }, + { 11195, "clientTweakables" }, + { 11196, "tweakablesInitialized" }, + { 11197, "minefields" }, + { 11198, "minefield_think" }, + { 11199, "minefield_kill" }, + { 11200, "minefield" }, + { 11201, "radiation" }, + { 11202, "numAreas" }, + { 11203, "playerEnterArea" }, + { 11204, "playerLeaveArea" }, + { 11205, "poison" }, + { 11206, "radiationOverlay" }, + { 11207, "soundWatcher" }, + { 11208, "radiationEffect" }, + { 11209, "radiationSound" }, + { 11210, "blackout" }, + { 11211, "doRadiationDamage" }, + { 11212, "fadeinBlackOut" }, + { 11213, "fadeoutBlackOut" }, + { 11214, "destructable_think" }, + { 11215, "script_accumulate" }, + { 11216, "script_threshold" }, + { 11217, "script_destructable_area" }, + { 11218, "destructable_destruct" }, + { 11219, "blockArea" }, + { 11220, "blockEntsInArea" }, + { 11221, "blockedoff" }, + { 11222, "unblockArea" }, + { 11223, "unblockEntsInArea" }, + { 11224, "Callback_HostMigration" }, + { 11225, "hostMigrationReturnedPlayerCount" }, + { 11226, "hostMigrationTimer" }, + { 11227, "UpdateTimerPausedness" }, + { 11228, "updateGameEvents" }, + { 11229, "hostMigrationWait" }, + { 11230, "inGracePeriod" }, + { 11231, "matchStartTimer" }, + { 11232, "hostMigrationWaitForPlayers" }, + { 11233, "hostMigrationTimerThink_Internal" }, + { 11234, "hostMigrationControlsFrozen" }, + { 11235, "isReallyAlive" }, + { 11236, "freezeControlsWrapper" }, + { 11237, "hostMigrationTimerThink" }, + { 11238, "waitTillHostMigrationDone" }, + { 11239, "waitTillHostMigrationDone" }, + { 11240, "waitLongDurationWithHostMigrationPause" }, + { 11241, "waitLongDurationWithGameEndTimeUpdate" }, + { 11242, "teamBalance" }, + { 11243, "maxClients" }, + { 11244, "freeplayers" }, + { 11245, "initScoreBoard" }, + { 11246, "onFreePlayerConnect" }, + { 11247, "onJoinedTeam" }, + { 11248, "onJoinedSpectators" }, + { 11249, "trackPlayedTime" }, + { 11250, "timePlayed" }, + { 11251, "gameFlagWait" }, + { 11252, "updatePlayerTimes" }, + { 11253, "rankedmatch" }, + { 11254, "updatePlayedTime" }, + { 11255, "statAddBuffered" }, + { 11256, "statAddChildBuffered" }, + { 11257, "bufferedChildStatsMax" }, + { 11258, "statAddChildBufferedWithMax" }, + { 11259, "bufferedStatsMax" }, + { 11260, "statAddBufferedWithMax" }, + { 11261, "updateTeamTime" }, + { 11262, "updateTeamBalanceDvar" }, + { 11263, "updateTeamBalance" }, + { 11264, "teamLimit" }, + { 11265, "getTeamBalance" }, + { 11266, "balanceTeams" }, + { 11267, "dont_auto_balance" }, + { 11268, "axis" }, + { 11269, "allies" }, + { 11270, "setGhillieModels" }, + { 11271, "environment" }, + { 11272, "setTeamModels" }, + { 11273, "setPlayerModels" }, + { 11274, "playerModelForWeapon" }, + { 11275, "isJuggernaut" }, + { 11276, "CountPlayers" }, + { 11277, "trackFreePlayedTime" }, + { 11278, "updateFreePlayerTimes" }, + { 11279, "updateFreePlayedTime" }, + { 11280, "getJoinTeamPermissions" }, + { 11281, "onPlayerSpawned" }, + { 11282, "getTeamName" }, + { 11283, "getTeamShortName" }, + { 11284, "getTeamForfeitedString" }, + { 11285, "getTeamEliminatedString" }, + { 11286, "getTeamIcon" }, + { 11287, "getTeamHudIcon" }, + { 11288, "getTeamHeadIcon" }, + { 11289, "getTeamVoicePrefix" }, + { 11290, "getTeamSpawnMusic" }, + { 11291, "getTeamWinMusic" }, + { 11292, "getTeamFlagModel" }, + { 11293, "getTeamFlagCarryModel" }, + { 11294, "getTeamFlagIcon" }, + { 11295, "getTeamFlagFX" }, + { 11296, "getTeamColor" }, + { 11297, "getTeamCrateModel" }, + { 11298, "getTeamDeployModel" }, + { 11299, "initedEntityHeadIcons" }, + { 11300, "setHeadIcon" }, + { 11301, "entityHeadIcons" }, + { 11302, "getPlayerForGuid" }, + { 11303, "destroyOnOwnerDisconnect" }, + { 11304, "destroyIconsOnDeath" }, + { 11305, "keepPositioned" }, + { 11306, "setTeamHeadIcon" }, + { 11307, "entityHeadIconTeam" }, + { 11308, "setPlayerHeadIcon" }, + { 11309, "keepIconPositioned" }, + { 11310, "destroyHeadIconsOnDeath" }, + { 11311, "updateHeadIconOrigin" }, + { 11312, "watchTrophyUsage" }, + { 11313, "trophyArray" }, + { 11314, "maxPerPlayerExplosives" }, + { 11315, "createBombSquadModel" }, + { 11316, "weaponName" }, + { 11317, "trophyRemainingAmmo" }, + { 11318, "ammo" }, + { 11319, "trigger" }, + { 11320, "c4EMPKillstreakWait" }, + { 11321, "trophyUseListener" }, + { 11322, "setSelfUsable" }, + { 11323, "notUsableForJoiningPlayers" }, + { 11324, "givePerk" }, + { 11325, "trophyPlayerSpawnWaiter" }, + { 11326, "trophyDisconnectWaiter" }, + { 11327, "trophyActive" }, + { 11328, "grenades" }, + { 11329, "missiles" }, + { 11330, "disabled" }, + { 11331, "combineArrays" }, + { 11332, "sentry_fire" }, + { 11333, "projectileExplode" }, + { 11334, "empGrenadeExplode" }, + { 11335, "mine_explode" }, + { 11336, "trophyDamage" }, + { 11337, "friendlyFireCheck" }, + { 11338, "iDFLAGS_PENETRATION" }, + { 11339, "wasDamagedFromBulletPenetration" }, + { 11340, "wasDamaged" }, + { 11341, "trophyBreak" }, + { 11342, "startMonitoringFlash" }, + { 11343, "stopMonitoringFlash" }, + { 11344, "usingRemote" }, + { 11345, "stunScaler" }, + { 11346, "applyFlash" }, + { 11347, "flashDuration" }, + { 11348, "flashRumbleDuration" }, + { 11349, "monitorEMPGrenade" }, + { 11350, "empEndTime" }, + { 11351, "_hasPerk" }, + { 11352, "applyEMP" }, + { 11353, "empDuration" }, + { 11354, "empGrenaded" }, + { 11355, "empGrenadeDeathWaiter" }, + { 11356, "checkToTurnOffEmp" }, + { 11357, "teamEMPed" }, + { 11358, "EMPPlayer" }, + { 11359, "empRumbleLoop" }, + { 11360, "isEMPGrenaded" }, + { 11361, "InitStingerUsage" }, + { 11362, "stingerStage" }, + { 11363, "stingerTarget" }, + { 11364, "stingerLockStartTime" }, + { 11365, "stingerLostSightlineTime" }, + { 11366, "stingerTargets" }, + { 11367, "ResetStingerLocking" }, + { 11368, "stingerUseEntered" }, + { 11369, "ResetStingerLockingOnDeath" }, + { 11370, "StillValidStingerLock" }, + { 11371, "ac130" }, + { 11372, "planemodel" }, + { 11373, "LoopStingerLockingFeedback" }, + { 11374, "LoopStingerLockedFeedback" }, + { 11375, "LockSightTest" }, + { 11376, "StingerDebugDraw" }, + { 11377, "SoftSightTest" }, + { 11378, "GetTargetList" }, + { 11379, "harriers" }, + { 11380, "uavmodels" }, + { 11381, "littleBirds" }, + { 11382, "ugvs" }, + { 11383, "StingerUsageLoop" }, + { 11384, "InitJavelinUsage" }, + { 11385, "javelinStage" }, + { 11386, "javelinPoints" }, + { 11387, "javelinNormals" }, + { 11388, "javelinLockMisses" }, + { 11389, "javelinTargetPoint" }, + { 11390, "javelinTargetNormal" }, + { 11391, "javelinLockStartTime" }, + { 11392, "ResetJavelinLocking" }, + { 11393, "javelinUseEntered" }, + { 11394, "currentlyLocking" }, + { 11395, "currentlyLocked" }, + { 11396, "javelinTarget" }, + { 11397, "EyeTraceForward" }, + { 11398, "LockMissesReset" }, + { 11399, "LockMissesIncr" }, + { 11400, "LockMissesPassedThreshold" }, + { 11401, "TargetPointTooClose" }, + { 11402, "LoopLocalSeekSound" }, + { 11403, "TopAttackPasses" }, + { 11404, "JavelinUsageLoop" }, + { 11405, "isEMPed" }, + { 11406, "javelinLostSightlineTime" }, + { 11407, "DebugSightLine" }, + { 11408, "VehicleLockSightTest" }, + { 11409, "javelinLockVehicle" }, + { 11410, "StillValidJavelinLock" }, + { 11411, "shellshockOnDamage" }, + { 11412, "shellShockReduction" }, + { 11413, "isUsingRemote" }, + { 11414, "bloodEffect" }, + { 11415, "c4_earthQuake" }, + { 11416, "barrel_earthQuake" }, + { 11417, "artillery_earthQuake" }, + { 11418, "attachmentGroup" }, + { 11419, "getAttachmentList" }, + { 11420, "scavenger_altmode" }, + { 11421, "scavenger_secondary" }, + { 11422, "getIntProperty" }, + { 11423, "riotShieldXPBullets" }, + { 11424, "weaponList" }, + { 11425, "claymoreDetectionDot" }, + { 11426, "claymoreDetectionMinDist" }, + { 11427, "claymoreDetectionGracePeriod" }, + { 11428, "claymoreDetonateRadius" }, + { 11429, "mineDetectionGracePeriod" }, + { 11430, "mineDetectionRadius" }, + { 11431, "mineDetectionHeight" }, + { 11432, "mineDamageRadius" }, + { 11433, "mineDamageMin" }, + { 11434, "mineDamageMax" }, + { 11435, "mineDamageHalfHeight" }, + { 11436, "mineSelfDestructTime" }, + { 11437, "mine_launch" }, + { 11438, "mine_spin" }, + { 11439, "mine_beacon" }, + { 11440, "delayMineTime" }, + { 11441, "stingerFXid" }, + { 11442, "primary_weapon_array" }, + { 11443, "side_arm_array" }, + { 11444, "grenade_array" }, + { 11445, "missile_array" }, + { 11446, "inventory_array" }, + { 11447, "mines" }, + { 11448, "dumpIt" }, + { 11449, "bombSquadWaiter" }, + { 11450, "bombSquadVisibilityUpdater" }, + { 11451, "hits" }, + { 11452, "hasDoneCombat" }, + { 11453, "currentWeaponAtSpawn" }, + { 11454, "concussionEndTime" }, + { 11455, "trackingWeaponName" }, + { 11456, "trackingWeaponShots" }, + { 11457, "trackingWeaponKills" }, + { 11458, "trackingWeaponHits" }, + { 11459, "trackingWeaponHeadShots" }, + { 11460, "trackingWeaponDeaths" }, + { 11461, "trackRiotShield" }, + { 11462, "lastHitTime" }, + { 11463, "droppedDeathWeapon" }, + { 11464, "tookWeaponFrom" }, + { 11465, "sniperDustWatcher" }, + { 11466, "getWeaponClass" }, + { 11467, "WatchStingerUsage" }, + { 11468, "WatchJavelinUsage" }, + { 11469, "lastDroppableWeapon" }, + { 11470, "hitsThisMag" }, + { 11471, "isCACPrimaryWeapon" }, + { 11472, "bothBarrels" }, + { 11473, "isKillstreakWeapon" }, + { 11474, "changingWeapon" }, + { 11475, "class_num" }, + { 11476, "loadoutPrimaryBuff" }, + { 11477, "cac_getWeapon" }, + { 11478, "_unsetPerk" }, + { 11479, "loadoutSecondaryBuff" }, + { 11480, "watchStartWeaponChange" }, + { 11481, "watchWeaponReload" }, + { 11482, "watchRangerUsage" }, + { 11483, "isHackWeapon" }, + { 11484, "mayDropWeapon" }, + { 11485, "dropWeaponForDeath" }, + { 11486, "blockWeaponDrops" }, + { 11487, "ownersattacker" }, + { 11488, "detachIfAttached" }, + { 11489, "deletePickupAfterAWhile" }, + { 11490, "getItemWeaponName" }, + { 11491, "watchPickup" }, + { 11492, "itemRemoveAmmoFromAltModes" }, + { 11493, "handleScavengerBagPickup" }, + { 11494, "dropScavengerForDeath" }, + { 11495, "getWeaponBasedGrenadeCount" }, + { 11496, "getWeaponBasedSmokeGrenadeCount" }, + { 11497, "getFragGrenadeCount" }, + { 11498, "getSmokeGrenadeCount" }, + { 11499, "setWeaponStat" }, + { 11500, "watchWeaponUsage" }, + { 11501, "statGetBuffered" }, + { 11502, "statSetBuffered" }, + { 11503, "lastStandParams" }, + { 11504, "lastStandStartTime" }, + { 11505, "updateMagShots" }, + { 11506, "checkHitsThisMag" }, + { 11507, "genericChallenge" }, + { 11508, "checkHit" }, + { 11509, "attackerCanDamageItem" }, + { 11510, "gotPullbackNotify" }, + { 11511, "claymorearray" }, + { 11512, "bouncingbettyArray" }, + { 11513, "isCooked" }, + { 11514, "originalOwner" }, + { 11515, "watchSmokeExplode" }, + { 11516, "inPlayerSmokeScreen" }, + { 11517, "waitSmokeTime" }, + { 11518, "AddMissileToSightTraces" }, + { 11519, "missilesForSightTraces" }, + { 11520, "watchMissileUsage" }, + { 11521, "setAltSceneObj" }, + { 11522, "watchSentryUsage" }, + { 11523, "empExplodeWaiter" }, + { 11524, "watchForThrowbacks" }, + { 11525, "threwBack" }, + { 11526, "activated" }, + { 11527, "c4EMPDamage" }, + { 11528, "setClaymoreTeamHeadIcon" }, + { 11529, "equipmentWatchUse" }, + { 11530, "shouldAffectClaymore" }, + { 11531, "c4Activate" }, + { 11532, "deleteC4AndClaymoresOnDisconnect" }, + { 11533, "wasChained" }, + { 11534, "waitTillEnabled" }, + { 11535, "c4DetectionTrigger" }, + { 11536, "detectId" }, + { 11537, "bombSquadIcon" }, + { 11538, "claymoreDetectionTrigger" }, + { 11539, "detectIconWaiter" }, + { 11540, "detectExplosives" }, + { 11541, "bombSquadIds" }, + { 11542, "setupBombSquad" }, + { 11543, "bombSquadIcons" }, + { 11544, "showHeadIcon" }, + { 11545, "get_damageable_player_pos" }, + { 11546, "get_damageable_player" }, + { 11547, "get_damageable_grenade_pos" }, + { 11548, "get_damageable_grenade" }, + { 11549, "get_damageable_sentry" }, + { 11550, "get_damageable_mine" }, + { 11551, "getEMPDamageEnts" }, + { 11552, "debugcircle" }, + { 11553, "isAltModeWeapon" }, + { 11554, "isInventoryWeapon" }, + { 11555, "isRiotShield" }, + { 11556, "isOffhandWeapon" }, + { 11557, "isSideArm" }, + { 11558, "isGrenade" }, + { 11559, "updateSavedLastWeapon" }, + { 11560, "updateWeaponRank" }, + { 11561, "getWeaponRank" }, + { 11562, "isDeathStreakWeapon" }, + { 11563, "clearEMPOnDeath" }, + { 11564, "updateMoveSpeedScale" }, + { 11565, "getBaseWeaponName" }, + { 11566, "weaponSpeed" }, + { 11567, "moveSpeedScaler" }, + { 11568, "stanceRecoilAdjuster" }, + { 11569, "setRecoilScale" }, + { 11570, "buildWeaponData" }, + { 11571, "baseName" }, + { 11572, "assetName" }, + { 11573, "variants" }, + { 11574, "monitorSemtex" }, + { 11575, "isStuck" }, + { 11576, "stuckEnemyEntity" }, + { 11577, "playerCardSplashNotify" }, + { 11578, "splashNotify" }, + { 11579, "turret_monitorUse" }, + { 11580, "turret_playerThread" }, + { 11581, "spawnMine" }, + { 11582, "killCamOffset" }, + { 11583, "killCamEnt" }, + { 11584, "equipmentMines" }, + { 11585, "killstreakMines" }, + { 11586, "mineDamageMonitor" }, + { 11587, "mineProximityTrigger" }, + { 11588, "mineDeleteTrigger" }, + { 11589, "mineSelfDestruct" }, + { 11590, "mineBounce" }, + { 11591, "mineExplode" }, + { 11592, "playSpinnerFX" }, + { 11593, "mineDamageDebug" }, + { 11594, "mineDamageHeightPassed" }, + { 11595, "getStanceCenter" }, + { 11596, "watchMineUsage" }, + { 11598, "mineThrown" }, + { 11599, "mineBeacon" }, + { 11600, "mineBeaconTeamUpdater" }, + { 11601, "MaxLives" }, + { 11602, "MaxNameLength" }, + { 11603, "MaxEvents" }, + { 11604, "MaxKillstreaks" }, + { 11605, "MaxLogClients" }, + { 11606, "MaxNumChallengesPerPlayer" }, + { 11607, "MaxNumAwardsPerPlayer" }, + { 11608, "getMatchDateTime" }, + { 11609, "logKillstreakEvent" }, + { 11610, "clientid" }, + { 11611, "logGameEvent" }, + { 11612, "logKillEvent" }, + { 11613, "logMultiKill" }, + { 11614, "logPlayerLife" }, + { 11615, "spawnPos" }, + { 11616, "wasTI" }, + { 11617, "spawnTime" }, + { 11618, "logPlayerXP" }, + { 11619, "logLoadout" }, + { 11620, "curClass" }, + { 11621, "getClassIndex" }, + { 11622, "cac_getWeaponAttachment" }, + { 11623, "cac_getWeaponAttachmentTwo" }, + { 11624, "cac_getOffhand" }, + { 11625, "cac_getPerk" }, + { 11626, "cac_getDeathstreak" }, + { 11627, "cac_getWeaponBuff" }, + { 11628, "cac_getKillstreak" }, + { 11629, "classTableName" }, + { 11630, "table_getWeapon" }, + { 11631, "table_getWeaponAttachment" }, + { 11632, "table_getOffhand" }, + { 11633, "table_getEquipment" }, + { 11634, "table_getPerk" }, + { 11635, "table_getDeathstreak" }, + { 11636, "table_getWeaponBuff" }, + { 11637, "table_getKillstreak" }, + { 11638, "validateAttachment" }, + { 11639, "logPlayerDeath" }, + { 11640, "isAttachment" }, + { 11641, "logPlayerData" }, + { 11642, "endOfGameSummaryLogger" }, + { 11643, "weaponsUsed" }, + { 11644, "weaponXpEarned" }, + { 11645, "challengesCompleted" }, + { 11646, "doubleBubbleSort" }, + { 11647, "gameEndListener" }, + { 11648, "getNextLifeId" }, + { 11649, "canLogClient" }, + { 11650, "canLogEvent" }, + { 11651, "canLogKillstreak" }, + { 11652, "canLogLife" }, + { 11653, "logWeaponStat" }, + { 11654, "logAttachmentStat" }, + { 11655, "buildBaseWeaponList" }, + { 11656, "logChallenge" }, + { 11657, "logAward" }, + { 11658, "killstreakFuncs" }, + { 11659, "tryUseAllPerks" }, + { 11660, "tryUseBlindEye" }, + { 11661, "tryUsePaint" }, + { 11662, "tryUseAssists" }, + { 11663, "tryUseSteadyAim" }, + { 11664, "tryUseStalker" }, + { 11665, "tryUseExtremeConditioning" }, + { 11666, "tryUseSleightOfHand" }, + { 11667, "tryUseScavenger" }, + { 11668, "tryUseHardline" }, + { 11669, "setStreakCountToNext" }, + { 11670, "tryUseColdBlooded" }, + { 11671, "tryUseQuickdraw" }, + { 11672, "tryUseBlastshield" }, + { 11673, "tryUseSitRep" }, + { 11674, "tryUseIronLungs" }, + { 11675, "tryUseAssassin" }, + { 11676, "tryUseDeadSilence" }, + { 11677, "doPerkFunctions" }, + { 11678, "watchDeath" }, + { 11679, "_unsetExtraPerks" }, + { 11680, "checkForPerkUpgrade" }, + { 11681, "getPerkUpgrade" }, + { 11682, "isPerkStreakOn" }, + { 11683, "streakName" }, + { 11684, "available" }, + { 11685, "setScrambler" }, + { 11686, "_giveWeapon" }, + { 11687, "unsetScrambler" }, + { 11688, "deleteScrambler" }, + { 11689, "inPlayerScrambler" }, + { 11690, "deployedScrambler" }, + { 11691, "scramblers" }, + { 11692, "cleanArray" }, + { 11693, "monitorScramblerUse" }, + { 11694, "scramblerSetup" }, + { 11695, "scramblerWatchOwner" }, + { 11696, "scramblerBeepSounds" }, + { 11697, "scramblerDamageListener" }, + { 11698, "deathEffect" }, + { 11699, "scramblerUseListener" }, + { 11700, "scramblerProximityTracker" }, + { 11701, "scramProxyActive" }, + { 11702, "scramProxyPerk" }, + { 11703, "setPortableRadar" }, + { 11704, "unsetPortableRadar" }, + { 11705, "deletePortableRadar" }, + { 11706, "inPlayerPortableRadar" }, + { 11707, "deployedPortableRadar" }, + { 11708, "monitorPortableRadarUse" }, + { 11709, "portableRadarSetup" }, + { 11710, "portableRadarWatchOwner" }, + { 11711, "portableRadarBeepSounds" }, + { 11712, "portableRadarDamageListener" }, + { 11713, "portableRadarUseListener" }, + { 11714, "portableRadarProximityTracker" }, + { 11715, "perkFuncs" }, + { 11716, "precacheModel" }, + { 11717, "spawnGlow" }, + { 11718, "spawnFire" }, + { 11719, "scriptPerks" }, + { 11720, "perkSetFuncs" }, + { 11721, "perkUnsetFuncs" }, + { 11722, "fauxPerks" }, + { 11723, "setBlastShield" }, + { 11724, "unsetBlastShield" }, + { 11725, "setSiege" }, + { 11726, "unsetSiege" }, + { 11727, "setFreefall" }, + { 11728, "unsetFreefall" }, + { 11729, "setLocalJammer" }, + { 11730, "unsetLocalJammer" }, + { 11731, "setThermal" }, + { 11732, "unsetThermal" }, + { 11733, "setBlackBox" }, + { 11734, "unsetBlackBox" }, + { 11735, "setLightWeight" }, + { 11736, "unsetLightWeight" }, + { 11737, "setSteelNerves" }, + { 11738, "unsetSteelNerves" }, + { 11739, "setDelayMine" }, + { 11740, "unsetDelayMine" }, + { 11741, "setChallenger" }, + { 11742, "unsetChallenger" }, + { 11743, "setSaboteur" }, + { 11744, "unsetSaboteur" }, + { 11745, "setEndGame" }, + { 11746, "unsetEndGame" }, + { 11747, "setRearView" }, + { 11748, "unsetRearView" }, + { 11749, "setAC130" }, + { 11750, "unsetAC130" }, + { 11751, "setSentryMinigun" }, + { 11752, "unsetSentryMinigun" }, + { 11753, "setPredatorMissile" }, + { 11754, "unsetPredatorMissile" }, + { 11755, "setTank" }, + { 11756, "unsetTank" }, + { 11757, "setPrecision_airstrike" }, + { 11758, "unsetPrecision_airstrike" }, + { 11759, "setHelicopterMinigun" }, + { 11760, "unsetHelicopterMinigun" }, + { 11761, "setOneManArmy" }, + { 11762, "unsetOneManArmy" }, + { 11763, "setLittlebirdSupport" }, + { 11764, "unsetLittlebirdSupport" }, + { 11765, "setTacticalInsertion" }, + { 11766, "unsetTacticalInsertion" }, + { 11767, "setSteadyAimPro" }, + { 11768, "unsetSteadyAimPro" }, + { 11769, "setStunResistance" }, + { 11770, "unsetStunResistance" }, + { 11771, "setMarksman" }, + { 11772, "unsetMarksman" }, + { 11773, "setDoubleLoad" }, + { 11774, "unsetDoubleLoad" }, + { 11775, "setSharpFocus" }, + { 11776, "unsetSharpFocus" }, + { 11777, "setHardShell" }, + { 11778, "unsetHardShell" }, + { 11779, "setRegenSpeed" }, + { 11780, "unsetRegenSpeed" }, + { 11781, "setAutoSpot" }, + { 11782, "unsetAutoSpot" }, + { 11783, "setEmpImmune" }, + { 11784, "unsetEmpImmune" }, + { 11785, "setOverkillPro" }, + { 11786, "unsetOverkillPro" }, + { 11787, "setCombatHigh" }, + { 11788, "unsetCombatHigh" }, + { 11789, "setLightArmor" }, + { 11790, "unsetLightArmor" }, + { 11791, "setRevenge" }, + { 11792, "unsetRevenge" }, + { 11793, "setC4Death" }, + { 11794, "unsetC4Death" }, + { 11795, "setFinalStand" }, + { 11796, "unsetFinalStand" }, + { 11797, "setJuiced" }, + { 11798, "unsetJuiced" }, + { 11799, "setCarePackage" }, + { 11800, "unsetCarePackage" }, + { 11801, "setStoppingPower" }, + { 11802, "unsetStoppingPower" }, + { 11803, "setUAV" }, + { 11804, "unsetUAV" }, + { 11805, "precacheShaders" }, + { 11806, "validatePerk" }, + { 11807, "perks" }, + { 11808, "omaClassChanged" }, + { 11809, "playerProximityTracker" }, + { 11810, "proximityActive" }, + { 11811, "drawLine" }, + { 11812, "cac_modified_damage" }, + { 11813, "xpScaler" }, + { 11814, "isBulletDamage" }, + { 11816, "setPainted" }, + { 11817, "bulletDamageMod" }, + { 11818, "armorVestMod" }, + { 11819, "explosiveDamageMod" }, + { 11820, "blastShieldMod" }, + { 11821, "dangerCloseMod" }, + { 11822, "hasLightArmor" }, + { 11823, "damageBlockedTotal" }, + { 11824, "initPerkDvars" }, + { 11825, "armorVestDefMod" }, + { 11826, "armorPiercingMod" }, + { 11827, "riotShieldMod" }, + { 11828, "cac_selector" }, + { 11829, "specialty" }, + { 11830, "gambitUseTracker" }, + { 11831, "giveBlindEyeAfterSpawn" }, + { 11832, "avoidKillstreakOnSpawnTimer" }, + { 11833, "objPointNames" }, + { 11834, "objPoints" }, + { 11835, "objPointSize" }, + { 11836, "objpoint_alpha_default" }, + { 11837, "objPointScale" }, + { 11838, "createTeamObjpoint" }, + { 11839, "isFlashing" }, + { 11840, "isShown" }, + { 11841, "baseAlpha" }, + { 11842, "deleteObjPoint" }, + { 11843, "setOriginByName" }, + { 11844, "getObjPointByName" }, + { 11845, "getObjPointByIndex" }, + { 11846, "startFlashing" }, + { 11847, "stopFlashing" }, + { 11848, "script_gameobjectname" }, + { 11849, "numGametypeReservedObjectives" }, + { 11850, "objIDStart" }, + { 11851, "carryObject" }, + { 11852, "claimTrigger" }, + { 11853, "canPickupObject" }, + { 11854, "killedInUse" }, + { 11855, "onPlayerDisconnect" }, + { 11856, "createCarryObject" }, + { 11857, "curOrigin" }, + { 11858, "ownerTeam" }, + { 11859, "triggerType" }, + { 11860, "baseOrigin" }, + { 11861, "useWeapon" }, + { 11862, "offset3d" }, + { 11863, "baseAngles" }, + { 11864, "visuals" }, + { 11865, "compassIcons" }, + { 11866, "objIDAllies" }, + { 11867, "objIDAxis" }, + { 11868, "objIDPingFriendly" }, + { 11869, "objIDPingEnemy" }, + { 11870, "carrier" }, + { 11871, "isResetting" }, + { 11872, "interactTeam" }, + { 11873, "allowWeapons" }, + { 11874, "worldIcons" }, + { 11875, "carrierVisible" }, + { 11876, "visibleTeam" }, + { 11877, "carryIcon" }, + { 11878, "onDrop" }, + { 11879, "onPickup" }, + { 11880, "onReset" }, + { 11881, "curProgress" }, + { 11882, "useTime" }, + { 11883, "useRate" }, + { 11884, "teamUseTimes" }, + { 11885, "teamUseTexts" }, + { 11886, "numTouching" }, + { 11887, "claimTeam" }, + { 11888, "claimPlayer" }, + { 11889, "lastClaimTeam" }, + { 11890, "lastClaimTime" }, + { 11891, "carryObjectUseThink" }, + { 11892, "carryObjectProxThink" }, + { 11893, "carryObjectProxThinkInstant" }, + { 11894, "carryObjectProxThinkDelayed" }, + { 11895, "onEndUse" }, + { 11896, "onUseUpdate" }, + { 11897, "pickupObjectDelay" }, + { 11898, "setPickedUp" }, + { 11899, "onPickupFailed" }, + { 11900, "updateCarryObjectOrigin" }, + { 11901, "wait_endon" }, + { 11902, "giveObject" }, + { 11903, "returnHome" }, + { 11904, "isHome" }, + { 11905, "setPosition" }, + { 11906, "onPlayerLastStand" }, + { 11907, "setDropped" }, + { 11908, "body" }, + { 11909, "safeOrigin" }, + { 11910, "setCarrier" }, + { 11911, "clearCarrier" }, + { 11912, "pickupTimeout" }, + { 11913, "autoResetTime" }, + { 11914, "takeObject" }, + { 11915, "trackCarrier" }, + { 11916, "manualDropThink" }, + { 11917, "deleteUseObject" }, + { 11918, "_objective_delete" }, + { 11919, "createUseObject" }, + { 11920, "keyObject" }, + { 11921, "onUse" }, + { 11922, "onCantUse" }, + { 11923, "useText" }, + { 11924, "setKeyObject" }, + { 11925, "useObjectUseThink" }, + { 11926, "onBeginUse" }, + { 11927, "cantUseHintThink" }, + { 11928, "getEarliestClaimPlayer" }, + { 11929, "startTime" }, + { 11930, "useObjectProxThink" }, + { 11931, "proxTriggerThink" }, + { 11932, "carryFlag" }, + { 11933, "proxTriggerLOS" }, + { 11934, "requiresLOS" }, + { 11935, "setClaimTeam" }, + { 11936, "getClaimTeam" }, + { 11937, "noUseBar" }, + { 11938, "updateProxBar" }, + { 11939, "proxBar" }, + { 11940, "proxBarText" }, + { 11941, "lastUseRate" }, + { 11942, "lastHostMigrationState" }, + { 11943, "updateUseRate" }, + { 11944, "objectiveScaler" }, + { 11945, "isArena" }, + { 11946, "attachUseModel" }, + { 11947, "attachedUseModel" }, + { 11948, "useHoldThink" }, + { 11949, "lastNonUseWeapon" }, + { 11950, "detachUseModels" }, + { 11951, "takeUseWeapon" }, + { 11952, "useHoldThinkLoop" }, + { 11953, "personalUseBar" }, + { 11954, "updateTrigger" }, + { 11955, "updateWorldIcons" }, + { 11956, "updateWorldIcon" }, + { 11957, "updateTimer" }, + { 11958, "updateCompassIcons" }, + { 11959, "updateCompassIcon" }, + { 11960, "shouldPingObject" }, + { 11961, "getUpdateTeams" }, + { 11962, "shouldShowCompassDueToRadar" }, + { 11963, "updateVisibilityAccordingToRadar" }, + { 11964, "setOwnerTeam" }, + { 11965, "getOwnerTeam" }, + { 11966, "setUseTime" }, + { 11967, "setUseText" }, + { 11968, "setTeamUseTime" }, + { 11969, "setTeamUseText" }, + { 11970, "setUseHintText" }, + { 11971, "allowCarry" }, + { 11972, "allowUse" }, + { 11973, "setVisibleTeam" }, + { 11974, "setModelVisibility" }, + { 11975, "_suicide" }, + { 11976, "makeSolid" }, + { 11977, "setCarrierVisible" }, + { 11978, "setCanUse" }, + { 11979, "useTeam" }, + { 11980, "set2DIcon" }, + { 11981, "set3DIcon" }, + { 11982, "set3DUseIcon" }, + { 11983, "worldUseIcons" }, + { 11984, "setCarryIcon" }, + { 11985, "disableObject" }, + { 11986, "enableObject" }, + { 11987, "getRelativeTeam" }, + { 11988, "isFriendlyTeam" }, + { 11989, "canInteractWith" }, + { 11990, "isTeam" }, + { 11991, "isRelativeTeam" }, + { 11992, "getEnemyTeam" }, + { 11993, "getNextObjID" }, + { 11994, "reclaimedReservedObjectives" }, + { 11995, "getLabel" }, + { 11996, "script_label" }, + { 11997, "autoSpotDeathWatcher" }, + { 11998, "autoSpotAdsWatcher" }, + { 11999, "recoilScale" }, + { 12000, "blastshieldUseTracker" }, + { 12001, "perkUseDeathTracker" }, + { 12002, "_usePerkEnabled" }, + { 12003, "endGame" }, + { 12004, "attackerTable" }, + { 12005, "endGameTimer" }, + { 12006, "endGameIcon" }, + { 12007, "revertVisionSet" }, + { 12008, "nukeDetonated" }, + { 12009, "nukeVisionSet" }, + { 12010, "endGameDeath" }, + { 12011, "trackSiegeEnable" }, + { 12012, "trackSiegeDissable" }, + { 12013, "stanceStateListener" }, + { 12014, "jumpStateListener" }, + { 12015, "killStreakScaler" }, + { 12016, "setBackShield" }, + { 12017, "unsetBackShield" }, + { 12018, "killstreakThink" }, + { 12019, "giveKillstreak" }, + { 12020, "killstreakSplashNotify" }, + { 12021, "oneManArmyWeaponChangeTracker" }, + { 12022, "isOneManArmyMenu" }, + { 12023, "selectOneManArmyClass" }, + { 12024, "closeOMAMenuOnDeath" }, + { 12025, "giveOneManArmyClass" }, + { 12026, "giveLoadout" }, + { 12027, "omaUseBar" }, + { 12028, "clearPreviousTISpawnpoint" }, + { 12029, "setSpawnpoint" }, + { 12030, "updateTISpawnPosition" }, + { 12031, "TISpawnPosition" }, + { 12032, "isValidTISpawnPosition" }, + { 12033, "monitorTIUse" }, + { 12034, "touchingBadTrigger" }, + { 12035, "enemyTrigger" }, + { 12036, "playerSpawnPos" }, + { 12037, "GlowStickSetupAndWaitForDeath" }, + { 12038, "GlowStickTeamUpdater" }, + { 12039, "GlowStickDamageListener" }, + { 12040, "leaderDialogOnPlayer" }, + { 12041, "GlowStickUseListener" }, + { 12042, "updateEnemyUse" }, + { 12043, "deleteTI" }, + { 12044, "dummyGlowStickDelete" }, + { 12045, "GlowStickEnemyUseListener" }, + { 12046, "makeEnemyUsable" }, + { 12047, "getOtherTeam" }, + { 12048, "watchPaintedDeath" }, + { 12049, "unsetPainted" }, + { 12050, "watchStoppingPowerKill" }, + { 12052, "juicedTimer" }, + { 12053, "juicedIcon" }, + { 12054, "unsetJuicedOnRide" }, + { 12055, "unsetJuicedOnDeath" }, + { 12056, "combatHighOverlay" }, + { 12057, "combatHighTimer" }, + { 12058, "combatHighIcon" }, + { 12059, "unsetCombatHighOnDeath" }, + { 12060, "unsetCombatHighOnRide" }, + { 12061, "giveLightArmor" }, + { 12062, "previousMaxHealth" }, + { 12063, "removeLightArmorOnDeath" }, + { 12064, "removeLightArmor" }, + { 12065, "lastKilledBy" }, + { 12066, "showTo" }, + { 12067, "constantSize" }, + { 12068, "pinToScreenEdge" }, + { 12069, "fadeOutPinnedIcon" }, + { 12070, "is3D" }, + { 12071, "revengeParams" }, + { 12072, "watchRevengeDeath" }, + { 12073, "watchRevengeKill" }, + { 12074, "watchRevengeDisconnected" }, + { 12075, "watchStopRevenge" }, + { 12076, "watchRevengeVictimDisconnected" }, + { 12077, "objIdFriendly" }, + { 12078, "spectateOverride" }, + { 12079, "onSpectatingClient" }, + { 12080, "updateSpectateSettings" }, + { 12081, "setSpectatePermissions" }, + { 12082, "gameEndTime" }, + { 12083, "allowFreeSpectate" }, + { 12084, "allowEnemySpectate" }, + { 12085, "registerAdrenalineInfo" }, + { 12086, "numKills" }, + { 12087, "killedPlayers" }, + { 12088, "killedPlayersCurrent" }, + { 12089, "killedBy" }, + { 12090, "greatestUniquePlayerKills" }, + { 12091, "recentKillCount" }, + { 12092, "lastKillTime" }, + { 12093, "damagedPlayers" }, + { 12094, "damagedPlayer" }, + { 12095, "killedPlayer" }, + { 12096, "lastKilledPlayer" }, + { 12097, "modifiers" }, + { 12098, "attackers" }, + { 12099, "attackerData" }, + { 12100, "firstTimeDamaged" }, + { 12101, "xpEventPopup" }, + { 12102, "assistedSuicide" }, + { 12103, "attackerPosition" }, + { 12104, "killstreaks" }, + { 12105, "setPlayerStat" }, + { 12106, "isLongShot" }, + { 12107, "checkMatchDataKills" }, + { 12108, "iDFlags" }, + { 12109, "inFinalStand" }, + { 12110, "loadoutPrimary" }, + { 12111, "loadoutSecondary" }, + { 12112, "matchMakingGame" }, + { 12113, "setPlayerStatIfLower" }, + { 12114, "setPlayerStatIfGreater" }, + { 12115, "checkMatchDataWeaponKills" }, + { 12116, "checkMatchDataEquipmentKills" }, + { 12117, "camperCheck" }, + { 12118, "lastKillWasCamping" }, + { 12119, "lastKillLocation" }, + { 12120, "lastCampKillTime" }, + { 12121, "consolation" }, + { 12122, "proximityAssist" }, + { 12123, "giveRankXP" }, + { 12124, "proximityKill" }, + { 12125, "longshot" }, + { 12126, "execution" }, + { 12127, "headShot" }, + { 12128, "avengedPlayer" }, + { 12129, "defendedPlayer" }, + { 12130, "postDeathKill" }, + { 12131, "backStab" }, + { 12132, "revenge" }, + { 12133, "multiKill" }, + { 12134, "teamPlayerCardSplash" }, + { 12135, "firstBlood" }, + { 12136, "winningShot" }, + { 12137, "buzzKill" }, + { 12138, "comeBack" }, + { 12139, "disconnected" }, + { 12140, "monitorHealed" }, + { 12141, "updateRecentKills" }, + { 12142, "monitorCrateJacking" }, + { 12143, "monitorObjectives" }, + { 12144, "quickcommands" }, + { 12145, "spamdelay" }, + { 12146, "quickstatements" }, + { 12147, "quickresponses" }, + { 12148, "doQuickMessage" }, + { 12149, "QuickMessageToAll" }, + { 12150, "saveHeadIcon" }, + { 12151, "oldheadicon" }, + { 12152, "oldheadiconteam" }, + { 12153, "restoreHeadIcon" }, + { 12154, "isOptionsMenu" }, + { 12155, "onMenuResponse" }, + { 12156, "forceEnd" }, + { 12157, "autoassign" }, + { 12158, "spectator" }, + { 12159, "selectedClass" }, + { 12160, "class" }, + { 12161, "getTeamAssignment" }, + { 12162, "menuAutoAssign" }, + { 12163, "closeMenus" }, + { 12164, "switching_teams" }, + { 12165, "joining_team" }, + { 12166, "leaving_team" }, + { 12167, "beginClassChoice" }, + { 12168, "allowClassChoice" }, + { 12169, "predictAboutToSpawnPlayerOverTime" }, + { 12170, "bypassClassChoice" }, + { 12171, "beginTeamChoice" }, + { 12172, "showMainMenuForTeam" }, + { 12173, "menuAllies" }, + { 12174, "hasSpawned" }, + { 12175, "menuAxis" }, + { 12176, "menuSpectator" }, + { 12177, "spawnSpectator" }, + { 12178, "menuClass" }, + { 12179, "getClassChoice" }, + { 12180, "getWeaponChoice" }, + { 12181, "lastClass" }, + { 12182, "setClass" }, + { 12183, "tag_stowed_back" }, + { 12184, "tag_stowed_hip" }, + { 12185, "isInKillcam" }, + { 12186, "spawnClient" }, + { 12187, "addToTeam" }, + { 12188, "removeFromTeamCount" }, + { 12189, "allowTeamChoice" }, + { 12190, "addToTeamCount" }, + { 12191, "updateObjectiveText" }, + { 12192, "updateMainMenu" }, + { 12193, "TimeUntilWaveSpawn" }, + { 12194, "lastWave" }, + { 12195, "waveDelay" }, + { 12196, "respawnTimerStartTime" }, + { 12197, "waveSpawnIndex" }, + { 12198, "TeamKillDelay" }, + { 12199, "maxAllowedTeamKills" }, + { 12200, "TimeUntilSpawn" }, + { 12201, "onRespawnDelay" }, + { 12202, "tiSpawnDelay" }, + { 12203, "maySpawn" }, + { 12204, "getGametypeNumLives" }, + { 12205, "disableSpawning" }, + { 12206, "gameHasStarted" }, + { 12207, "setLowerMessage" }, + { 12208, "isLastRound" }, + { 12209, "waitingToSpawn" }, + { 12210, "waitAndSpawnClient" }, + { 12211, "clearLowerMessage" }, + { 12212, "wavePlayerSpawnIndex" }, + { 12213, "waitForTimeOrNotify" }, + { 12214, "wantSafeSpawn" }, + { 12215, "waitRespawnButton" }, + { 12216, "removeSpawnMessageShortly" }, + { 12217, "lastStandRespawnPlayer" }, + { 12218, "dieHardMode" }, + { 12219, "revived" }, + { 12220, "standardmaxHealth" }, + { 12221, "freezePlayerForRoundEnd" }, + { 12222, "getDeathSpawnPoint" }, + { 12223, "showSpawnNotifies" }, + { 12224, "defconSplashNotify" }, + { 12225, "isRested" }, + { 12226, "predictedSpawnPoint" }, + { 12227, "predictedSpawnPointTime" }, + { 12228, "predictAboutToSpawnPlayer" }, + { 12229, "getSpawnpoint_Random" }, + { 12230, "getSpawnPoint" }, + { 12231, "checkPredictedSpawnpointCorrectness" }, + { 12232, "percentage" }, + { 12233, "printPredictedSpawnpointCorrectness" }, + { 12234, "getSpawnOrigin" }, + { 12235, "alternates" }, + { 12236, "tiValidationCheck" }, + { 12237, "spawnPlayer" }, + { 12238, "fauxDead" }, + { 12239, "killsThisLife" }, + { 12240, "ClearKillcamState" }, + { 12241, "cancelKillcam" }, + { 12242, "friendlydamage" }, + { 12243, "afk" }, + { 12244, "inC4Death" }, + { 12245, "inLastStand" }, + { 12246, "clampedHealth" }, + { 12247, "shieldDamage" }, + { 12248, "shieldBulletHits" }, + { 12249, "recentShieldXP" }, + { 12250, "wasAliveAtMatchStart" }, + { 12251, "getTimeLimit" }, + { 12252, "getTimePassed" }, + { 12253, "finalizeSpawnpointChoice" }, + { 12254, "lastspawntime" }, + { 12255, "onSpawnPlayer" }, + { 12256, "playerSpawned" }, + { 12257, "setThirdPersonDOF" }, + { 12258, "gameFlag" }, + { 12259, "getObjectiveHintText" }, + { 12260, "oldNotifyMessage" }, + { 12261, "hidePerksAfterTime" }, + { 12262, "hidePerksOnDeath" }, + { 12263, "hidePerksOnKill" }, + { 12264, "respawn_asSpectator" }, + { 12265, "in_spawnSpectator" }, + { 12266, "getPlayerFromClientNum" }, + { 12267, "onSpawnSpectator" }, + { 12268, "spawnIntermission" }, + { 12269, "clearLowerMessages" }, + { 12270, "postGamePromotion" }, + { 12271, "postGameNotifies" }, + { 12272, "spawnEndOfGame" }, + { 12273, "setSpawnVariables" }, + { 12274, "notifyConnecting" }, + { 12275, "Callback_PlayerDisconnect" }, + { 12276, "connected" }, + { 12277, "removePlayerOnDisconnect" }, + { 12278, "initClientDvars" }, + { 12279, "hitlocInited" }, + { 12280, "getLowestAvailableClientId" }, + { 12281, "Callback_PlayerConnect" }, + { 12282, "usingOnlineDataOffline" }, + { 12283, "resetAdrenaline" }, + { 12284, "leaderDialogQueue" }, + { 12285, "leaderDialogActive" }, + { 12286, "leaderDialogGroups" }, + { 12287, "leaderDialogGroup" }, + { 12288, "statGet" }, + { 12289, "kill_streak" }, + { 12290, "lastGrenadeSuicideTime" }, + { 12291, "teamkillsThisRound" }, + { 12292, "saved_actionSlotData" }, + { 12293, "updateLossStats" }, + { 12294, "OnPlayerConnectAudioInit" }, + { 12295, "isValidClass" }, + { 12296, "Callback_PlayerMigrated" }, + { 12297, "AddLevelsToExperience" }, + { 12298, "GetRestXPCap" }, + { 12299, "setRestXPGoal" }, + { 12300, "forceSpawn" }, + { 12301, "kickIfDontSpawn" }, + { 12302, "kickWait" }, + { 12303, "updateSessionState" }, + { 12304, "initPlayerStats" }, + { 12305, "initBufferedStats" }, + { 12306, "initPersStat" }, + { 12307, "suicides" }, + { 12308, "headshots" }, + { 12309, "captures" }, + { 12310, "returns" }, + { 12311, "defends" }, + { 12312, "plants" }, + { 12313, "defuses" }, + { 12314, "destructions" }, + { 12315, "confirmed" }, + { 12316, "denied" }, + { 12317, "statSetChildBuffered" }, + { 12318, "teamCount" }, + { 12319, "addToAliveCount" }, + { 12320, "aliveCount" }, + { 12321, "maxPlayerCount" }, + { 12322, "removeFromAliveCount" }, + { 12323, "addToLivesCount" }, + { 12324, "livesCount" }, + { 12325, "removeFromLivesCount" }, + { 12326, "removeAllFromLivesCount" }, + { 12327, "callbackStartGameType" }, + { 12328, "callbackPlayerConnect" }, + { 12329, "callbackPlayerDisconnect" }, + { 12330, "callbackPlayerKilled" }, + { 12331, "callbackCodeEndGame" }, + { 12332, "callbackPlayerLastStand" }, + { 12333, "callbackPlayerMigrated" }, + { 12334, "ufo_mode" }, + { 12335, "initGameFlags" }, + { 12336, "initLevelFlags" }, + { 12337, "requiredMapAspectRatio" }, + { 12338, "leaderDialogOnPlayer_func" }, + { 12339, "init_audio" }, + { 12340, "setMapCenterForReflections" }, + { 12341, "lanterns" }, + { 12342, "hurtPlayersThink" }, + { 12343, "setupDestructibleKillCamEnts" }, + { 12344, "deleteDestructibleKillCamEnt" }, + { 12345, "sendMatchData" }, + { 12346, "allowvote" }, + { 12347, "updateServerSettings" }, + { 12348, "constrainGameType" }, + { 12349, "script_gametype_dm" }, + { 12350, "script_gametype_tdm" }, + { 12351, "script_gametype_ctf" }, + { 12352, "script_gametype_hq" }, + { 12353, "script_gametype_sd" }, + { 12354, "script_gametype_koth" }, + { 12355, "killcam" }, + { 12356, "showingFinalKillcam" }, + { 12357, "killcamlength" }, + { 12358, "kc_timer" }, + { 12359, "kc_skiptext" }, + { 12360, "kc_othertext" }, + { 12361, "kc_icon" }, + { 12362, "doFinalKillCamFX" }, + { 12363, "doingFinalKillcamFx" }, + { 12364, "calculateKillCamTime" }, + { 12365, "waittillKillcamOver" }, + { 12366, "setKillCamEntity" }, + { 12367, "waitSkipKillcamButton" }, + { 12368, "waitKCCopyCatButton" }, + { 12369, "waitDeathCopyCatButton" }, + { 12370, "waitCopyCatButton" }, + { 12371, "waitSkipKillcamSafeSpawnButton" }, + { 12372, "endKillcamIfNothingToShow" }, + { 12373, "spawnedKillcamCleanup" }, + { 12374, "endedKillcamCleanup" }, + { 12375, "killcamCleanup" }, + { 12376, "cancelKillCamOnUse" }, + { 12377, "cancelKillCamUseButton" }, + { 12378, "cancelKillCamSafeSpawnButton" }, + { 12379, "cancelKillCamCallback" }, + { 12380, "cancelKillCamSafeSpawnCallback" }, + { 12381, "cancelKillCamOnUse_specificButton" }, + { 12382, "initKCElements" }, + { 12383, "selfDeathIcons" }, + { 12384, "updateDeathIconsEnabled" }, + { 12385, "addDeathIcon" }, + { 12386, "lastDeathIcon" }, + { 12387, "destroySlowly" }, + { 12388, "connectTime" }, + { 12389, "targets" }, + { 12390, "onPlayerDisconnect" }, + { 12391, "onWeaponFired" }, + { 12392, "processKill" }, + { 12393, "heli_types" }, + { 12394, "heli_start_nodes" }, + { 12395, "heli_loop_nodes" }, + { 12396, "heli_leave_nodes" }, + { 12397, "heli_crash_nodes" }, + { 12398, "heli_missile_rof" }, + { 12399, "heli_maxhealth" }, + { 12400, "heli_debug" }, + { 12401, "heli_targeting_delay" }, + { 12402, "heli_turretReloadTime" }, + { 12403, "heli_turretClipSize" }, + { 12404, "heli_visual_range" }, + { 12405, "heli_target_spawnprotection" }, + { 12406, "heli_target_recognition" }, + { 12407, "heli_missile_friendlycare" }, + { 12408, "heli_missile_target_cone" }, + { 12409, "heli_armor_bulletdamage" }, + { 12410, "heli_attract_strength " }, + { 12411, "heli_attract_range" }, + { 12412, "heli_angle_offset" }, + { 12413, "heli_forced_wait" }, + { 12414, "chopper_fx" }, + { 12415, "fx_heli_dust" }, + { 12416, "fx_heli_water" }, + { 12417, "heliDialog" }, + { 12418, "lastHeliDialogTime" }, + { 12419, "queueCreate" }, + { 12420, "makeHeliType" }, + { 12421, "lightFxFunc" }, + { 12422, "addAirExplosion" }, + { 12423, "pavelowLightFx" }, + { 12424, "defaultLightFX" }, + { 12425, "useHelicopter" }, + { 12426, "useHelicopterBlackbox" }, + { 12427, "useHelicopterFlares" }, + { 12428, "useHelicopterMinigun" }, + { 12429, "useHelicopterMK19" }, + { 12430, "tryUseHelicopter" }, + { 12431, "isAirDenied" }, + { 12432, "updateKillstreaks" }, + { 12433, "lifeId" }, + { 12434, "heliType" }, + { 12435, "queueAdd" }, + { 12438, "setUsingRemote" }, + { 12436, "currentActiveVehicleCount" }, + { 12437, "maxVehiclesAllowed" }, + { 12439, "initRideKillstreak" }, + { 12440, "clearUsingRemote" }, + { 12441, "deleteOnEntNotify" }, + { 12442, "startHelicopter" }, + { 12443, "precacheHelicopter" }, + { 12444, "heli_sound" }, + { 12445, "spawn_helicopter" }, + { 12446, "heli_type" }, + { 12447, "zOffset" }, + { 12448, "heliRide" }, + { 12449, "heliRideLifeId" }, + { 12450, "thermalVision" }, + { 12451, "enhanced_vision" }, + { 12452, "thermal_vision" }, + { 12453, "weaponLockThink" }, + { 12454, "heliTargetOrigin" }, + { 12455, "remoteHeliLOS" }, + { 12456, "endRide" }, + { 12457, "getKillstreakWeapon" }, + { 12458, "endRideOnHelicopterDone" }, + { 12459, "getPosNearEnemies" }, + { 12460, "remoteHeliDist" }, + { 12461, "updateAreaNodes" }, + { 12462, "validPlayers" }, + { 12463, "nodeScore" }, + { 12464, "heli_think" }, + { 12465, "targeting_delay" }, + { 12466, "primaryTarget" }, + { 12467, "secondaryTarget" }, + { 12468, "currentstate" }, + { 12469, "makeGunShip" }, + { 12470, "mgTurretLeft" }, + { 12471, "mgTurretRight" }, + { 12472, "deleteTurretsWhenDone" }, + { 12473, "sentry_attackTargets" }, + { 12474, "sentry_burstFireStart" }, + { 12475, "sentry_burstFireStop" }, + { 12476, "heli_existance" }, + { 12477, "queueRemoveFirst" }, + { 12478, "usedKillstreak" }, + { 12479, "heli_targeting" }, + { 12480, "canTarget_turret" }, + { 12481, "getBestPrimaryTarget" }, + { 12482, "threatlevel" }, + { 12483, "update_player_threat" }, + { 12484, "antithreat" }, + { 12485, "heli_reset" }, + { 12486, "addRecentDamage" }, + { 12487, "recentDamageAmount" }, + { 12488, "largeProjectileDamage" }, + { 12489, "vehicleKilled" }, + { 12490, "heli_health" }, + { 12491, "laststate" }, + { 12492, "heli_crash" }, + { 12493, "heli_secondary_explosions" }, + { 12494, "heli_spin" }, + { 12495, "spinSoundShortly" }, + { 12496, "heli_explode" }, + { 12497, "check_owner" }, + { 12498, "heli_leave_on_disconnect" }, + { 12499, "heli_leave_on_changeTeams" }, + { 12500, "heli_leave_on_spawned" }, + { 12501, "heli_leave_on_gameended" }, + { 12502, "heli_leave_on_timeout" }, + { 12503, "attack_targets" }, + { 12504, "attack_secondary" }, + { 12505, "missileTarget" }, + { 12506, "missile_target_sight_check" }, + { 12507, "missile_support" }, + { 12508, "attack_primary" }, + { 12509, "waitOnTargetOrDeath" }, + { 12510, "fireMissile" }, + { 12511, "getOriginOffsets" }, + { 12512, "travelToNode" }, + { 12513, "heli_fly_simple_path" }, + { 12514, "heli_fly_loop_path" }, + { 12515, "desired_speed" }, + { 12516, "desired_accel" }, + { 12517, "heli_loop_speed_control" }, + { 12518, "heli_is_threatened" }, + { 12519, "heli_fly_well" }, + { 12520, "get_best_area_attack_node" }, + { 12521, "heli_leave" }, + { 12522, "pathGoal" }, + { 12523, "wait_and_delete" }, + { 12524, "debug_print3d" }, + { 12525, "debug_print3d_simple" }, + { 12526, "draw_text" }, + { 12527, "addToHeliList" }, + { 12528, "helis" }, + { 12529, "removeFromHeliList" }, + { 12530, "addToLittleBirdList" }, + { 12531, "removeFromLittleBirdListOnDeath" }, + { 12532, "exceededMaxLittlebirds" }, + { 12533, "playFlareFx" }, + { 12534, "deployFlares" }, + { 12535, "heli_flares_monitor" }, + { 12536, "numFlares" }, + { 12537, "handleIncomingStinger" }, + { 12538, "watchStingerProximity" }, + { 12539, "handleIncomingSAM" }, + { 12540, "watchSAMProximity" }, + { 12541, "deleteAfterTime" }, + { 12542, "pavelowMadeSelectionVO" }, + { 12543, "RemoteUAV_fx" }, + { 12544, "RemoteUAV_dialog" }, + { 12545, "RemoteUAV_lastDialogTime" }, + { 12546, "RemoteUAV_noDeployZones" }, + { 12547, "remote_uav" }, + { 12548, "useRemoteUAV" }, + { 12549, "tryUseRemoteUAV" }, + { 12550, "nukeIncoming" }, + { 12551, "isCarrying" }, + { 12552, "giveCarryRemoteUAV" }, + { 12553, "createCarryRemoteUAV" }, + { 12554, "sentryType" }, + { 12555, "canBePlaced" }, + { 12556, "inHeliProximity" }, + { 12557, "rangeTrigger" }, + { 12558, "maxHeight" }, + { 12559, "maxDistance" }, + { 12560, "setCarryingRemoteUAV" }, + { 12561, "carriedBy" }, + { 12562, "carryRemoteUAV_setCarried" }, + { 12563, "isInRemoteNoDeploy" }, + { 12564, "updateCarryRemoteUAVPlacement" }, + { 12565, "carryRemoteUAV_handleExistence" }, + { 12566, "removeRemoteWeapon" }, + { 12567, "startRemoteUAV" }, + { 12568, "remoteUAV_clearRideIntro" }, + { 12569, "lockPlayerForRemoteUAVLaunch" }, + { 12570, "clearPlayerLockFromRemoteUAVLaunch" }, + { 12571, "createRemoteUAV" }, + { 12572, "destroyed" }, + { 12573, "specialDamageCallback" }, + { 12574, "scrambler" }, + { 12575, "smoking" }, + { 12576, "markedPlayers" }, + { 12577, "hasIncoming" }, + { 12578, "incomingMissiles" }, + { 12579, "remoteUAV_Ride" }, + { 12580, "playerLinked" }, + { 12581, "restoreAngles" }, + { 12582, "juggernautOverlay" }, + { 12583, "remote_uav_rideLifeId" }, + { 12584, "remoteUAV" }, + { 12585, "remoteUAV_delayLaunchDialog" }, + { 12586, "remoteUAV_endride" }, + { 12587, "remoteUAV_freezeBuffer" }, + { 12588, "remoteUAV_playerExit" }, + { 12589, "remoteUAV_Track" }, + { 12590, "lastTrackingDialogTime" }, + { 12591, "lockedTarget" }, + { 12592, "trace" }, + { 12593, "remoteUAV_trackEntities" }, + { 12594, "uavType" }, + { 12595, "UAVRemoteMarkedBy" }, + { 12596, "isLeaving" }, + { 12597, "remoteUAV_canTargetUAV" }, + { 12598, "remoteUAV_Fire" }, + { 12599, "remoteUAV_Rumble" }, + { 12600, "remoteUAV_markPlayer" }, + { 12601, "birth_time" }, + { 12602, "remoteUAVMarkedObjID01" }, + { 12603, "remoteUAVMarkedObjID02" }, + { 12604, "remoteUAVMarkedObjID03" }, + { 12605, "remoteUAV_processTaggedAssist" }, + { 12606, "remoteUAV_unmarkRemovedPlayer" }, + { 12607, "remoteUAV_clearMarkedForOwner" }, + { 12608, "remoteUAV_operationRumble" }, + { 12609, "remoteUAV_watch_distance" }, + { 12610, "centerRef" }, + { 12611, "rangeCountdownActive" }, + { 12612, "heliInProximity" }, + { 12613, "remoteUAV_in_range" }, + { 12614, "remoteUAV_staticFade" }, + { 12615, "remoteUAV_rangeCountdown" }, + { 12616, "remoteUAV_explode_on_disconnect" }, + { 12617, "remoteUAV_explode_on_changeTeams" }, + { 12618, "remoteUAV_clear_marked_on_gameEnded" }, + { 12619, "remoteUAV_leave_on_timeout" }, + { 12620, "remoteUAV_leave" }, + { 12621, "remoteUAV_explode_on_death" }, + { 12622, "remoteUAV_cleanup" }, + { 12623, "remoteUAV_light_fx" }, + { 12624, "remoteUAV_handleIncomingStinger" }, + { 12625, "remoteUAV_handleIncomingSAM" }, + { 12626, "remoteUAV_clearIncomingWarning" }, + { 12627, "missile_isIncoming" }, + { 12628, "remoteUAV_watchHeliProximity" }, + { 12629, "remoteUAV_handleDamage" }, + { 12630, "Callback_VehicleDamage" }, + { 12631, "speakers" }, + { 12632, "bcSounds" }, + { 12633, "grenadeProximityTracking" }, + { 12634, "suppressingFireTracking" }, + { 12635, "suppressWaiter" }, + { 12636, "claymoreTracking" }, + { 12637, "reloadTracking" }, + { 12638, "grenadeTracking" }, + { 12639, "sayLocalSoundDelayed" }, + { 12640, "sayLocalSound" }, + { 12641, "doSound" }, + { 12642, "timeHack" }, + { 12643, "isSpeakerInRange" }, + { 12644, "addSpeaker" }, + { 12645, "removeSpeaker" }, + { 12646, "isSwitchingTeams" }, + { 12647, "isTeamSwitchBalanced" }, + { 12648, "isFriendlyFire" }, + { 12649, "killedSelf" }, + { 12650, "isHeadShot" }, + { 12651, "isEnvironmentWeapon" }, + { 12652, "handleTeamChangeDeath" }, + { 12653, "handleWorldDeath" }, + { 12654, "onNormalDeath" }, + { 12655, "handleSuicideDeath" }, + { 12656, "handleFriendlyFireDeath" }, + { 12657, "gracePeriod" }, + { 12658, "handleNormalDeath" }, + { 12659, "updatePersRatio" }, + { 12660, "cloneLoadout" }, + { 12661, "streakType" }, + { 12662, "killShouldAddToKillstreak" }, + { 12663, "setPersStat" }, + { 12664, "statGetChild" }, + { 12665, "statSet" }, + { 12666, "lastAttackedShieldPlayer" }, + { 12667, "lastAttackedShieldTime" }, + { 12668, "isPlayerWeapon" }, + { 12669, "Callback_PlayerKilled" }, + { 12670, "QueueShieldForRemoval" }, + { 12671, "shieldTrashArray" }, + { 12672, "LaunchShield" }, + { 12673, "hasRiotShield" }, + { 12674, "hasRiotShieldEquipped" }, + { 12675, "PlayerKilled_internal" }, + { 12676, "useLastStandParams" }, + { 12677, "eInflictor" }, + { 12678, "iDamage" }, + { 12679, "sMeansOfDeath" }, + { 12680, "sWeapon" }, + { 12681, "sPrimaryWeapon" }, + { 12682, "vDir" }, + { 12683, "sHitLoc" }, + { 12684, "lasttimedamaged" }, + { 12685, "nuked" }, + { 12686, "playerKilled" }, + { 12687, "previousPrimary" }, + { 12688, "trackLeaderBoardDeathStats" }, + { 12689, "trackAttackerLeaderBoardDeathStats" }, + { 12690, "lastDeathPos" }, + { 12691, "sameShotDamage" }, + { 12692, "streakTypeResetsOnDeath" }, + { 12693, "onPlayerKilled" }, + { 12694, "timeUntilRoundEnd" }, + { 12695, "checkForceBleedout" }, + { 12696, "checkKillSteal" }, + { 12697, "attackerEnt" }, + { 12698, "initFinalKillCam" }, + { 12699, "finalKillCam_delay" }, + { 12700, "finalKillCam_victim" }, + { 12701, "finalKillCam_attacker" }, + { 12702, "finalKillCam_attackerNum" }, + { 12703, "finalKillCam_killCamEntityIndex" }, + { 12704, "finalKillCam_killCamEntityStartTime" }, + { 12705, "finalKillCam_sWeapon" }, + { 12706, "finalKillCam_deathTimeOffset" }, + { 12707, "finalKillCam_psOffsetTime" }, + { 12708, "finalKillCam_timeRecorded" }, + { 12709, "finalKillCam_timeGameEnded" }, + { 12710, "finalKillCam_winner" }, + { 12711, "recordFinalKillCam" }, + { 12712, "getSecondsPassed" }, + { 12713, "eraseFinalKillCam" }, + { 12714, "doFinalKillcam" }, + { 12715, "finalKill" }, + { 12716, "anyPlayersInKillcam" }, + { 12717, "resetPlayerVariables" }, + { 12718, "getKillcamEntity" }, + { 12719, "samTurret" }, + { 12720, "imsKillCamEnt" }, + { 12721, "attackerInRemoteKillstreak" }, + { 12722, "remote_mortar" }, + { 12723, "using_remote_turret" }, + { 12724, "using_remote_tank" }, + { 12725, "HitlocDebug" }, + { 12726, "damageInfo" }, + { 12727, "hitloc" }, + { 12728, "bp" }, + { 12729, "jugg" }, + { 12730, "colorIndex" }, + { 12731, "damageInfoColorIndex" }, + { 12732, "damageInfoVictim" }, + { 12733, "giveRecentShieldXP" }, + { 12734, "Callback_PlayerDamage_internal" }, + { 12735, "iDFLAGS_STUN" }, + { 12736, "iDFLAGS_SHIELD_EXPLOSIVE_IMPACT" }, + { 12737, "iDFLAGS_SHIELD_EXPLOSIVE_IMPACT_HUGE" }, + { 12738, "iDFLAGS_SHIELD_EXPLOSIVE_SPLASH" }, + { 12739, "modifyPlayerDamage" }, + { 12740, "iDFlagsTime" }, + { 12741, "canDoCombat" }, + { 12742, "iDFLAGS_NO_KNOCKBACK" }, + { 12743, "killstreakSpawnShield" }, + { 12744, "iDFLAGS_NO_PROTECTION" }, + { 12745, "lastspawnpoint" }, + { 12746, "explosiveInfo" }, + { 12747, "setInflictorStat" }, + { 12748, "lastDamageWasFromEnemy" }, + { 12749, "lastLegitimateAttacker" }, + { 12750, "wasCooked" }, + { 12751, "playerDamaged" }, + { 12752, "useStartSpawn" }, + { 12753, "shouldWeaponFeedback" }, + { 12754, "checkVictimStutter" }, + { 12755, "findIsFacing" }, + { 12756, "stutterStep" }, + { 12757, "inStutter" }, + { 12758, "addAttacker" }, + { 12759, "isPrimary" }, + { 12760, "vPoint" }, + { 12761, "resetAttackerList" }, + { 12762, "Callback_PlayerDamage" }, + { 12763, "finishPlayerDamageWrapper" }, + { 12764, "Callback_PlayerLastStand" }, + { 12765, "dieAfterTime" }, + { 12766, "detonateOnUse" }, + { 12767, "detonateOnDeath" }, + { 12768, "c4DeathDetonate" }, + { 12769, "c4DeathEffect" }, + { 12770, "enableLastStandWeapons" }, + { 12771, "lastStandTimer" }, + { 12772, "maxHealthOverlay" }, + { 12773, "lastStandBleedOut" }, + { 12774, "beingRevived" }, + { 12775, "lastStandAllowSuicide" }, + { 12776, "lastStandKeepOverlay" }, + { 12777, "lastStandWaittillDeath" }, + { 12778, "mayDoLastStand" }, + { 12779, "ensureLastStandParamsValidity" }, + { 12780, "getHitLocHeight" }, + { 12781, "delayStartRagdoll" }, + { 12782, "noRagdollEnts" }, + { 12783, "getMostKilledBy" }, + { 12784, "getMostKilled" }, + { 12785, "damageShellshockAndRumble" }, + { 12786, "reviveSetup" }, + { 12787, "deleteOnReviveOrDeathOrDisconnect" }, + { 12788, "updateUsableByTeam" }, + { 12789, "trackTeamChanges" }, + { 12790, "trackLastStandChanges" }, + { 12791, "reviveTriggerThink" }, + { 12792, "Callback_KillingBlow" }, + { 12793, "combatHigh" }, + { 12794, "emitFallDamage" }, + { 12795, "isFlankKill" }, + { 12796, "_obituary" }, + { 12797, "logPrintPlayerDeath" }, + { 12798, "destroyOnReviveEntDeath" }, + { 12799, "gamemodeModifyPlayerDamage" }, + { 12800, "matchRules_damageMultiplier" }, + { 12801, "matchRules_vampirism" }, + { 12802, "healthRegenDisabled" }, + { 12803, "healthRegenLevel" }, + { 12804, "regenSpeed" }, + { 12805, "atBrinkOfDeath" }, + { 12806, "breathingManager" }, + { 12807, "breathingStopTime" }, + { 12808, "healthRegeneration" }, + { 12809, "healthRegenerated" }, + { 12810, "wait_for_not_using_remote" }, + { 12811, "playerPainBreathingSound" }, + { 12812, "playedStartingMusic" }, + { 12813, "onLastAlive" }, + { 12814, "onRoundSwitch" }, + { 12815, "onGameEnded" }, + { 12816, "playSoundOnPlayers" }, + { 12817, "roundWinnerDialog" }, + { 12818, "roundEndDelay" }, + { 12819, "gameWinnerDialog" }, + { 12820, "postRoundTime" }, + { 12821, "musicController" }, + { 12822, "leaderDialogOnPlayers" }, + { 12823, "suspenseMusic" }, + { 12824, "finalKillcamMusic" }, + { 12825, "giveHighlight" }, + { 12826, "clientMatchDataId" }, + { 12827, "awards" }, + { 12828, "defaultvalue" }, + { 12829, "initPlayerStat" }, + { 12830, "prevPos" }, + { 12831, "previousDeaths" }, + { 12832, "altitudePolls" }, + { 12833, "totalAltitudeSum" }, + { 12834, "usedWeapons" }, + { 12835, "initAwards" }, + { 12836, "initGametypeAwards" }, + { 12837, "initBaseAward" }, + { 12838, "winners" }, + { 12839, "exclusive" }, + { 12840, "initAwardProcess" }, + { 12841, "process" }, + { 12842, "var1" }, + { 12843, "var2" }, + { 12844, "initStat" }, + { 12845, "initStatAward" }, + { 12846, "initDerivedAward" }, + { 12847, "initAwardFlag" }, + { 12848, "initMultiAward" }, + { 12849, "award1_ref" }, + { 12850, "award2_ref" }, + { 12851, "initThresholdAward" }, + { 12852, "setMatchRecordIfGreater" }, + { 12853, "getPlayerStat" }, + { 12854, "getPlayerStatTime" }, + { 12855, "setMatchRecordIfLower" }, + { 12856, "getDecodedRatio" }, + { 12857, "setPersonalBestIfGreater" }, + { 12858, "setPersonalBestIfLower" }, + { 12859, "incPlayerRecord" }, + { 12860, "addAwardWinner" }, + { 12861, "getAwardWinners" }, + { 12862, "clearAwardWinners" }, + { 12863, "setAwardRecord" }, + { 12864, "getAwardRecord" }, + { 12865, "getAwardRecordTime" }, + { 12866, "assignAwards" }, + { 12867, "playerForClientId" }, + { 12868, "assignAward" }, + { 12869, "getAwardType" }, + { 12870, "isMultiAward" }, + { 12871, "isStatAward" }, + { 12872, "isThresholdAward" }, + { 12873, "isAwardFlag" }, + { 12874, "isAwardExclusive" }, + { 12875, "hasDisplayValue" }, + { 12876, "giveAward" }, + { 12877, "getFormattedValue" }, + { 12878, "limitDecimalPlaces" }, + { 12879, "highestWins" }, + { 12880, "lowestWins" }, + { 12881, "lowestWithHalfPlayedTime" }, + { 12882, "statValueChanged" }, + { 12883, "isAtleast" }, + { 12884, "isAtMost" }, + { 12885, "isAtMostWithHalfPlayedTime" }, + { 12886, "setRatio" }, + { 12887, "getKillstreakAwardRef" }, + { 12888, "monitorReloads" }, + { 12889, "monitorShotsFired" }, + { 12890, "monitorSwaps" }, + { 12891, "monitorMovementDistance" }, + { 12892, "monitorPositionCamping" }, + { 12893, "lastCampChecked" }, + { 12894, "positionArray" }, + { 12895, "encodeRatio" }, + { 12896, "getRatioHiVal" }, + { 12897, "getRatioLoVal" }, + { 12898, "monitorEnemyDistance" }, + { 12900, "monitorExplosionsSurvived" }, + { 12901, "monitorShieldBlocks" }, + { 12902, "monitorFlashHits" }, + { 12903, "monitorStunHits" }, + { 12904, "monitorStanceTime" }, + { 12905, "softLandingTriggers" }, + { 12906, "script_type" }, + { 12907, "softLanding" }, + { 12908, "playerEnterSoftLanding" }, + { 12909, "playerLeaveSoftLanding" }, + { 12910, "softLandingWaiter" }, + { 12911, "defconMode" }, + { 12912, "defconStreakAdd" }, + { 12913, "defconPointMod" }, + { 12914, "defconKillstreakWait" }, + { 12915, "defconKillstreakThread" }, + { 12916, "updateDefcon" }, + { 12917, "juggSettings" }, + { 12918, "splashUsedName" }, + { 12920, "overlay" }, + { 12921, "giveJuggernaut" }, + { 12922, "isJuggernautRecon" }, + { 12923, "personalRadar" }, + { 12924, "matchRules_showJuggRadarIcon" }, + { 12925, "objIdEnemy" }, + { 12926, "clearKillstreaks" }, + { 12927, "juggernautSounds" }, + { 12928, "radarMover" }, + { 12929, "juggRemover" }, + { 12930, "isJuggernautDef" }, + { 12931, "isJuggernautGL" }, + { 12932, "juggRemoveOnGameEnded" }, + { 12933, "sentrySettings" }, + { 12934, "burstMin" }, + { 12935, "burstMax" }, + { 12936, "pauseMin" }, + { 12937, "pauseMax" }, + { 12938, "sentryModeOn" }, + { 12939, "sentryModeOff" }, + { 12940, "spinupTime" }, + { 12941, "overheatTime" }, + { 12942, "cooldownTime" }, + { 12943, "fxTime" }, + { 12944, "modelBase" }, + { 12945, "modelPlacement" }, + { 12946, "modelPlacementFailed" }, + { 12947, "modelDestroyed" }, + { 12948, "teamSplash" }, + { 12949, "shouldSplash" }, + { 12950, "voDestroyed" }, + { 12951, "ownerHintString" }, + { 12952, "tryUseAutoSentry" }, + { 12953, "tryUseSAM" }, + { 12954, "giveSentry" }, + { 12955, "validateUseStreak" }, + { 12956, "last_sentry" }, + { 12957, "setCarryingSentry" }, + { 12958, "removeWeapons" }, + { 12959, "restoreWeapon" }, + { 12960, "removePerks" }, + { 12961, "restorePerk" }, + { 12962, "restoreWeapons" }, + { 12963, "restorePerks" }, + { 12964, "waitRestorePerks" }, + { 12965, "createSentryForPlayer" }, + { 12966, "sentry_initSentry" }, + { 12967, "laser_on" }, + { 12968, "momentum" }, + { 12969, "heatLevel" }, + { 12970, "overheated" }, + { 12971, "cooldownWaitTime" }, + { 12972, "sentry_handleDamage" }, + { 12973, "sentry_watchDisabled" }, + { 12974, "sentry_handleDeath" }, + { 12975, "ownerTrigger" }, + { 12976, "forceDisable" }, + { 12977, "inUseBy" }, + { 12978, "turret_overheat_bar" }, + { 12979, "sentry_handleUse" }, + { 12980, "turret_handlePickup" }, + { 12981, "turret_handleUse" }, + { 12982, "sentry_handleOwnerDisconnect" }, + { 12983, "sentry_setOwner" }, + { 12984, "sentry_setPlaced" }, + { 12985, "sentry_setCancelled" }, + { 12986, "sentry_setCarried" }, + { 12987, "updateSentryPlacement" }, + { 12988, "sentry_onCarrierDeath" }, + { 12989, "sentry_onCarrierDisconnect" }, + { 12990, "sentry_onCarrierChangedTeam" }, + { 12991, "sentry_onGameEnded" }, + { 12992, "sentry_setActive" }, + { 12993, "sentry_setInactive" }, + { 12994, "sentry_makeSolid" }, + { 12995, "sentry_makeNotSolid" }, + { 12996, "isFriendlyToSentry" }, + { 12997, "addToTurretList" }, + { 12998, "removeFromTurretList" }, + { 12999, "sentry_timeOut" }, + { 13000, "sentry_targetLockSound" }, + { 13001, "sentry_spinUp" }, + { 13002, "sentry_spinDown" }, + { 13003, "turret_shotMonitor" }, + { 13004, "sentry_heatMonitor" }, + { 13005, "turret_heatMonitor" }, + { 13006, "turret_coolMonitor" }, + { 13007, "PlayHeatFX" }, + { 13008, "playSmokeFX" }, + { 13009, "sentry_beepSounds" }, + { 13010, "sam_attackTargets" }, + { 13011, "samTargetEnt" }, + { 13012, "samMissileGroups" }, + { 13013, "sam_acquireTarget" }, + { 13014, "ac130InUse" }, + { 13015, "sam_fireOnTarget" }, + { 13016, "samMissileGroup" }, + { 13017, "sam_watchLineOfSight" }, + { 13018, "sam_watchLaser" }, + { 13019, "sam_watchCrashing" }, + { 13020, "sam_watchLeaving" }, + { 13021, "airDropCrates" }, + { 13022, "oldAirDropCrates" }, + { 13023, "airDropCrateCollision" }, + { 13024, "numDropCrates" }, + { 13025, "crateTypes" }, + { 13026, "crateMaxVal" }, + { 13027, "lowSpawn" }, + { 13028, "addCrateType" }, + { 13029, "crateFuncs" }, + { 13030, "getRandomCrateType" }, + { 13031, "getCrateTypeForDropType" }, + { 13032, "tryUseAssaultAirdrop" }, + { 13033, "tryUseSupportAirdrop" }, + { 13034, "tryUseAirdropPredatorMissile" }, + { 13035, "tryUseAirdropSentryMinigun" }, + { 13036, "tryUseJuggernautAirdrop" }, + { 13037, "tryUseJuggernautGLAirdrop" }, + { 13038, "tryUseJuggernautReconAirdrop" }, + { 13039, "tryUseJuggernautDefAirdrop" }, + { 13040, "tryUseTrophyAirdrop" }, + { 13041, "tryUseMegaAirdrop" }, + { 13042, "tryUseAirdropTrap" }, + { 13043, "tryUseAirdropRemoteTank" }, + { 13044, "tryUseAmmo" }, + { 13045, "tryUseExplosiveAmmo" }, + { 13046, "tryUseLightArmor" }, + { 13047, "tryUseAirdrop" }, + { 13048, "watchDisconnect" }, + { 13049, "beginAirdropViaMarker" }, + { 13050, "threwAirDropMarker" }, + { 13051, "watchAirDropWeaponChange" }, + { 13052, "isChangingWeapon" }, + { 13053, "watchAirDropMarkerUsage" }, + { 13054, "watchAirDropMarker" }, + { 13055, "beginAirDropMarkerTracking" }, + { 13056, "airDropMarkerActivate" }, + { 13057, "finishSupportEscortUsage" }, + { 13058, "initAirDropCrate" }, + { 13059, "collision" }, + { 13060, "deleteOnOwnerDeath" }, + { 13061, "crateModelTeamUpdater" }, + { 13062, "crateModelPlayerUpdater" }, + { 13063, "crateUseTeamUpdater" }, + { 13064, "crateUseJuggernautUpdater" }, + { 13065, "crateType" }, + { 13066, "crateUsePostJuggernautUpdater" }, + { 13067, "createAirDropCrate" }, + { 13068, "dropType" }, + { 13069, "friendlyModel" }, + { 13070, "enemyModel" }, + { 13071, "dropCrateExistence" }, + { 13072, "trap_createBombSquadModel" }, + { 13073, "crateSetupForUse" }, + { 13074, "setUsableByTeam" }, + { 13075, "dropTheCrate" }, + { 13076, "waitForDropCrateMsg" }, + { 13077, "physicsWaiter" }, + { 13078, "dropTimeOut" }, + { 13079, "getPathStart" }, + { 13080, "getPathEnd" }, + { 13081, "getFlyHeightOffset" }, + { 13082, "airstrikeHeightScale" }, + { 13083, "doFlyBy" }, + { 13084, "leaving" }, + { 13085, "doMegaFlyBy" }, + { 13086, "doC130FlyBy" }, + { 13087, "doMegaC130FlyBy" }, + { 13088, "dropNuke" }, + { 13089, "stopLoopAfter" }, + { 13090, "playloopOnEnt" }, + { 13091, "c130Setup" }, + { 13092, "c130" }, + { 13093, "heliSetup" }, + { 13094, "isAirdrop" }, + { 13095, "watchTimeOut" }, + { 13096, "heli_existence" }, + { 13097, "heli_handleDamage" }, + { 13098, "alreadyDead" }, + { 13099, "heliDestroyed" }, + { 13100, "lbExplode" }, + { 13101, "lbSpin" }, + { 13102, "nukeCaptureThink" }, + { 13103, "crateOtherCaptureThink" }, + { 13104, "isCapturingCrate" }, + { 13105, "crateOwnerCaptureThink" }, + { 13106, "validateOpenConditions" }, + { 13107, "killstreakCrateThink" }, + { 13108, "getKillstreakCrateIcon" }, + { 13109, "getStreakCost" }, + { 13110, "nukeCrateThink" }, + { 13111, "gtnw" }, + { 13112, "capturedNuke" }, + { 13113, "trophyCrateThink" }, + { 13114, "juggernautCrateThink" }, + { 13115, "sentryCrateThink" }, + { 13116, "trapNullFunc" }, + { 13117, "trapCrateThink" }, + { 13118, "bomb" }, + { 13119, "detonateTrap" }, + { 13120, "deleteCrate" }, + { 13121, "sentryUseTracker" }, + { 13122, "giveLocalTrophy" }, + { 13123, "activeTrophy" }, + { 13124, "trophyAmmo" }, + { 13125, "hijackNotify" }, + { 13126, "refillAmmo" }, + { 13127, "isAirdropMarker" }, + { 13128, "createUseEnt" }, + { 13129, "deleteUseEnt" }, + { 13130, "airdropDetonateOnStuck" }, + { 13131, "personalTrophyActive" }, + { 13132, "ospreySettings" }, + { 13133, "modelBlades" }, + { 13134, "tagHatchL" }, + { 13135, "tagHatchR" }, + { 13136, "tagDropCrates" }, + { 13137, "prompt" }, + { 13138, "air_support_locs" }, + { 13139, "tryUseEscortAirdrop" }, + { 13140, "tryUseOspreyGunner" }, + { 13141, "finishOspreyGunnerUsage" }, + { 13142, "stopSelectionWatcher" }, + { 13143, "selectDropLocation" }, + { 13144, "_beginLocationSelection" }, + { 13145, "stopLocationSelection" }, + { 13146, "showIcons" }, + { 13147, "locationObjectives" }, + { 13148, "createAirship" }, + { 13149, "ospreyType" }, + { 13150, "airshipFX" }, + { 13151, "useSupportEscortAirdrop" }, + { 13152, "useOspreyGunner" }, + { 13153, "rideGunner" }, + { 13154, "waitSetThermal" }, + { 13155, "showDefendPrompt" }, + { 13156, "escort_prompt" }, + { 13157, "airShipPitchPropsUp" }, + { 13158, "airShipPitchPropsDown" }, + { 13159, "airShipPitchHatchUp" }, + { 13160, "airShipPitchHatchDown" }, + { 13161, "getBestHeight" }, + { 13162, "bestHeight" }, + { 13163, "airshipFlyDefense" }, + { 13164, "killGuysNearCrates" }, + { 13165, "aiShootPlayer" }, + { 13166, "targetDeathWaiter" }, + { 13167, "waitForConfirmation" }, + { 13168, "airshipFlyGunner" }, + { 13169, "ospreyDropCratesLowImpulse" }, + { 13170, "ospreyDropCrates" }, + { 13171, "endRideOnAirshipDone" }, + { 13172, "match_events_fx" }, + { 13173, "matchEvents" }, + { 13174, "matchEventStarted" }, + { 13175, "getMapCenter" }, + { 13176, "getStartSpawns" }, + { 13177, "doMortar" }, + { 13178, "playSoundinSpace" }, + { 13179, "doSmoke" }, + { 13180, "doAirstrike" }, + { 13181, "doAirstrikeFlyBy" }, + { 13182, "spawnpoints" }, + { 13183, "playPlaneFx" }, + { 13184, "fx_airstrike_afterburner" }, + { 13185, "fx_airstrike_contrail" }, + { 13186, "doPavelow" }, + { 13187, "doHeliInsertion" }, + { 13188, "doOspreyInsertion" }, + { 13189, "drawfriend" }, + { 13190, "showFriendIcon" }, + { 13191, "updateFriendIconSettings" }, + { 13192, "updateFriendIcons" }, + { 13193, "processLobbyScoreboards" }, + { 13194, "setPlayerScoreboardInfo" }, + { 13195, "buildScoreboardType" }, + { 13196, "onForfeit" }, + { 13197, "forfeitInProgress" }, + { 13198, "forfeit_aborted" }, + { 13199, "forcedEnd" }, + { 13200, "forfeitWaitforAbort" }, + { 13201, "matchForfeitTimer" }, + { 13202, "matchForfeitText" }, + { 13203, "matchForfeitTimer_Internal" }, + { 13204, "default_onDeadEvent" }, + { 13205, "default_onOneLeftEvent" }, + { 13206, "getLastLivingPlayer" }, + { 13207, "default_onTimeLimit" }, + { 13208, "default_onHalfTime" }, + { 13209, "hostForcedEnd" }, + { 13210, "onDeadEvent" }, + { 13211, "oneLeftTime" }, + { 13212, "onOneLeftEvent" }, + { 13213, "getPotentialLivingPlayers" }, + { 13214, "waittillFinalKillcamDone" }, + { 13215, "timeLimitClock_Intermission" }, + { 13216, "waitForPlayers" }, + { 13217, "prematchPeriod" }, + { 13218, "hintMessage" }, + { 13219, "gameFlagSet" }, + { 13220, "updateWinStats" }, + { 13221, "updateTieStats" }, + { 13222, "updateWinLossStats" }, + { 13223, "privateMatch" }, + { 13224, "wasLastRound" }, + { 13225, "updateMatchBonusScores" }, + { 13226, "endGameUpdate" }, + { 13227, "getSPM" }, + { 13228, "matchBonus" }, + { 13229, "giveMatchBonus" }, + { 13230, "setXenonRanks" }, + { 13231, "checkTimeLimit" }, + { 13232, "getHalfTime" }, + { 13233, "onHalfTime" }, + { 13234, "onTimeLimit" }, + { 13235, "checkHalfTime" }, + { 13236, "getTimeRemaining" }, + { 13237, "scoreLimitOverride" }, + { 13238, "updateGametypeDvars" }, + { 13239, "matchStartTimerPC" }, + { 13240, "prematchPeriodEnd" }, + { 13241, "matchStartTimer_Internal" }, + { 13242, "matchStartTimerSkip" }, + { 13243, "halftimeSubCaption" }, + { 13244, "halftimeType" }, + { 13245, "checkRoundSwitch" }, + { 13246, "roundSwitch" }, + { 13247, "timePaused" }, + { 13248, "freeGameplayHudElems" }, + { 13249, "perkicon" }, + { 13250, "perkname" }, + { 13251, "lowerMessage" }, + { 13252, "lowerTimer" }, + { 13253, "getHostPlayer" }, + { 13254, "hostIdledOut" }, + { 13255, "roundEndWait" }, + { 13256, "isDoingSplash" }, + { 13257, "roundEndDoF" }, + { 13258, "Callback_StartGameType" }, + { 13259, "levelFlagInit" }, + { 13260, "intermission" }, + { 13261, "onPrecacheGameType" }, + { 13262, "killstreakRewards" }, + { 13263, "alivePlayers" }, + { 13264, "activePlayers" }, + { 13265, "gameFlagInit" }, + { 13266, "halftimeRoundEndDelay" }, + { 13267, "onStartGameType" }, + { 13268, "updateWatchedDvars" }, + { 13269, "Callback_CodeEndGame" }, + { 13270, "timeLimitThread" }, + { 13271, "updateUIScoreLimit" }, + { 13272, "playTickingSound" }, + { 13273, "bombTimer" }, + { 13274, "stopTickingSound" }, + { 13275, "timeLimitClock" }, + { 13276, "timerStopped" }, + { 13277, "gameTimer" }, + { 13278, "discardTime" }, + { 13279, "timerStoppedForGameMode" }, + { 13280, "timerPauseTime" }, + { 13281, "pauseTimer" }, + { 13282, "resumeTimer" }, + { 13283, "startGame" }, + { 13284, "spawnPerFrameUpdate" }, + { 13285, "roundBegin" }, + { 13286, "waveSpawnTimer" }, + { 13287, "getBetterTeam" }, + { 13288, "rankedMatchUpdates" }, + { 13289, "displayRoundEnd" }, + { 13290, "teamOutcomeNotify" }, + { 13291, "outcomeNotify" }, + { 13292, "displayGameEnd" }, + { 13293, "displayRoundSwitch" }, + { 13294, "endGameOvertime" }, + { 13295, "endGameHalfTime" }, + { 13296, "levelFlagSet" }, + { 13297, "wasOnlyRound" }, + { 13298, "levelFlagClear" }, + { 13299, "roundEnd" }, + { 13300, "updateEndReasonText" }, + { 13301, "hitRoundLimit" }, + { 13302, "hitWinLimit" }, + { 13303, "estimatedTimeTillScoreLimit" }, + { 13304, "getScorePerMinute" }, + { 13305, "getScorePerRemaining" }, + { 13306, "giveLastOnTeamWarning" }, + { 13307, "waitTillRecoveredHealth" }, + { 13308, "processLobbyData" }, + { 13309, "incrementWeaponStat" }, + { 13310, "updateWeaponBufferedStats" }, + { 13311, "incrementAttachmentStat" }, + { 13312, "playerAffectedArray" }, + { 13313, "threadedSetWeaponStatByName" }, + { 13314, "checkForPersonalBests" }, + { 13315, "xpGains" }, + { 13316, "checkForBestWeapon" }, + { 13317, "gametypestarted" }, + { 13318, "damageCallback" }, + { 13319, "callbackHostMigration" }, + { 13320, "SetupDamageFlags" }, + { 13321, "iDFLAGS_RADIUS" }, + { 13322, "iDFLAGS_NO_ARMOR" }, + { 13323, "iDFLAGS_NO_TEAM_PROTECTION" }, + { 13324, "iDFLAGS_PASSTHRU" }, + { 13325, "SetupCallbacks" }, + { 13326, "SetDefaultCallbacks" }, + { 13327, "AbortLevel" }, + { 13328, "callbackVoid" }, + { 13329, "beginHarrier" }, + { 13330, "getCorrectHeight" }, + { 13331, "spawnDefensiveHarrier" }, + { 13332, "accel" }, + { 13333, "defendLoc" }, + { 13334, "defendLocation" }, + { 13335, "closeToGoalCheck" }, + { 13336, "engageGround" }, + { 13337, "harrierLeave" }, + { 13338, "airPlane" }, + { 13339, "harrierDelete" }, + { 13340, "harrierTimer" }, + { 13341, "randomHarrierMovement" }, + { 13342, "getNewPoint" }, + { 13343, "bestTarget" }, + { 13344, "traceNewPoint" }, + { 13345, "traceGroundPoint" }, + { 13346, "playHarrierFx" }, + { 13347, "harrier_afterburnerfx" }, + { 13348, "stopHarrierWingFx" }, + { 13349, "startHarrierWingFx" }, + { 13350, "fireOnTarget" }, + { 13351, "isReadyToFire" }, + { 13352, "acquireGroundTarget" }, + { 13353, "backToDefendLocation" }, + { 13354, "wouldCollide" }, + { 13355, "watchTargetDeath" }, + { 13356, "watchTargetLOS" }, + { 13357, "breakTarget" }, + { 13358, "harrierGetTargets" }, + { 13359, "nonTarget" }, + { 13360, "isTarget" }, + { 13361, "getBestTarget" }, + { 13362, "targetEnt" }, + { 13363, "checkForFriendlies" }, + { 13364, "playDamageEfx" }, + { 13365, "harrier_smoke" }, + { 13366, "harrierDestroyed" }, + { 13367, "harrierExplode" }, + { 13368, "harrier_deathfx" }, + { 13369, "harrierSpin" }, + { 13370, "engageVehicle" }, + { 13371, "fireOnVehicleTarget" }, + { 13372, "acquireVehicleTarget" }, + { 13373, "watchVehTargetCrash" }, + { 13374, "watchVehTargetDeath" }, + { 13375, "breakVehTarget" }, + { 13376, "evasiveManuverOne" }, + { 13377, "removeFromHeliListOnDeath" }, + { 13378, "onfirefx" }, + { 13379, "airstrikefx" }, + { 13380, "mortareffect" }, + { 13381, "bombstrike" }, + { 13382, "stealthbombfx" }, + { 13383, "planes" }, + { 13384, "dangerMaxRadius" }, + { 13385, "dangerMinRadius" }, + { 13386, "dangerForwardPush" }, + { 13387, "dangerOvalScale" }, + { 13388, "artilleryDangerCenters" }, + { 13389, "tryUseDefaultAirstrike" }, + { 13390, "tryUsePrecisionAirstrike" }, + { 13391, "tryUseSuperAirstrike" }, + { 13392, "tryUseHarrierAirstrike" }, + { 13393, "tryUseStealthAirstrike" }, + { 13394, "tryUseAirstrike" }, + { 13395, "clearProgress" }, + { 13396, "getAirstrikeDanger" }, + { 13397, "getSingleAirstrikeDanger" }, + { 13398, "pointIsInAirstrikeArea" }, + { 13399, "losRadiusDamage" }, + { 13400, "isSentry" }, + { 13401, "airStrikeDamagedEntsCount" }, + { 13402, "airStrikeDamagedEnts" }, + { 13403, "airstrikeDamageEntsThread" }, + { 13404, "airstrikeDamagedEntsIndex" }, + { 13405, "radiusArtilleryShellshock" }, + { 13406, "artilleryShellshock" }, + { 13407, "beingArtilleryShellshocked" }, + { 13408, "doBomberStrike" }, + { 13409, "bomberDropBombs" }, + { 13410, "playBombFx" }, + { 13411, "stealthBomber_killCam" }, + { 13412, "airstrikeType" }, + { 13413, "callStrike_bomb" }, + { 13414, "doPlaneStrike" }, + { 13415, "handleDeath" }, + { 13416, "addPlaneToList" }, + { 13417, "removePlaneFromList" }, + { 13418, "callStrike_bombEffect" }, + { 13419, "spawnbomb" }, + { 13420, "callStrike" }, + { 13421, "getExplodeDistance" }, + { 13422, "targetGetDist" }, + { 13423, "waitForAirstrikeCancel" }, + { 13424, "selectAirstrikeLocation" }, + { 13425, "finishAirstrikeUsage" }, + { 13426, "useAirstrike" }, + { 13427, "handleEMP" }, + { 13428, "airstrikeMadeSelectionVO" }, + { 13429, "findBoxCenter" }, + { 13430, "expandMins" }, + { 13431, "expandMaxs" }, + { 13432, "addSpawnPoints" }, + { 13433, "teamSpawnPoints" }, + { 13434, "inited" }, + { 13435, "spawnMins" }, + { 13436, "spawnMaxs" }, + { 13437, "placeSpawnPoints" }, + { 13438, "startSpawnPoints" }, + { 13439, "getSpawnpointArray" }, + { 13440, "extraspawnpoints" }, + { 13441, "expandSpawnpointBounds" }, + { 13442, "spawnPointInit" }, + { 13443, "sightTracePoint" }, + { 13444, "lastspawnedplayer" }, + { 13445, "outside" }, + { 13446, "AddAlternateSpawnpoint" }, + { 13447, "getTeamSpawnPoints" }, + { 13448, "getSpawnpoint_Final" }, + { 13449, "getBestWeightedSpawnpoint" }, + { 13450, "sights" }, + { 13451, "lastSightTraceTime" }, + { 13452, "getAllOtherPlayers" }, + { 13453, "initWeights" }, + { 13454, "getSpawnpoint_NearTeam" }, + { 13455, "numPlayersAtLastUpdate" }, + { 13456, "weightedDistSum" }, + { 13457, "distSum" }, + { 13458, "favorCloseSpawnEnt" }, + { 13459, "favorCloseSpawnScalar" }, + { 13460, "getSpawnpoint_SafeSpawn" }, + { 13461, "minDist" }, + { 13462, "safeSpawnDangerDist" }, + { 13463, "getSpawnpoint_DM" }, + { 13464, "Spawnlogic_Begin" }, + { 13465, "spawnlogic_deaths" }, + { 13466, "spawnlogic_spawnkills" }, + { 13467, "pipebombs" }, + { 13468, "tanks" }, + { 13469, "ims" }, + { 13470, "safespawns" }, + { 13471, "sightCheckCost" }, + { 13472, "watchSpawnProfile" }, + { 13473, "spawnProfile" }, + { 13474, "spawnGraphCheck" }, + { 13475, "spawnGraph" }, + { 13476, "secondfloor" }, + { 13477, "fake" }, + { 13478, "drawSpawnGraph" }, + { 13479, "setupSpawnGraphPoint" }, + { 13480, "visible" }, + { 13481, "spawnGraphLine" }, + { 13482, "loopbotspawns" }, + { 13483, "trackGrenades" }, + { 13484, "trackMissiles" }, + { 13485, "isPointVulnerable" }, + { 13486, "claymoremodelcenteroffset" }, + { 13487, "claymoreDetectionRadius" }, + { 13488, "claymoreDetectionConeAngle" }, + { 13489, "avoidWeaponDamage" }, + { 13490, "adjustSightValue" }, + { 13491, "spawnPointUpdate" }, + { 13492, "getFloatProperty" }, + { 13493, "nearbyPenalty" }, + { 13494, "attackHeightPos" }, + { 13495, "getLosPenalty" }, + { 13496, "lastMinuteSightTraces" }, + { 13497, "getRevengeSpawnPenalty" }, + { 13498, "getRevengeSpawnDistanceSq" }, + { 13499, "avoidRevengeSpawn" }, + { 13500, "avoidRevengeSpawnStage2" }, + { 13501, "avoidVisibleEnemies" }, + { 13502, "forceSpawnNearTeammates" }, + { 13503, "avoidSpawnReuse" }, + { 13504, "avoidSameSpawn" }, + { 13505, "SetupKillstreakSpawnShield" }, + { 13506, "ac130_use_duration" }, + { 13507, "ac130_num_flares" }, + { 13508, "radioForcedTransmissionQueue" }, + { 13509, "enemiesKilledInTimeWindow" }, + { 13510, "lastRadioTransmission" }, + { 13511, "HUDItem" }, + { 13512, "physicsSphereRadius" }, + { 13513, "physicsSphereForce" }, + { 13514, "weaponReloadTime" }, + { 13515, "ac130_Speed" }, + { 13516, "ac130Queue" }, + { 13517, "tryUseAC130" }, + { 13564, "crashed" }, + { 13565, "init_sounds" }, + { 13566, "add_context_sensative_dialog" }, + { 13567, "played" }, + { 13568, "sounds" }, + { 13569, "add_context_sensative_timeout" }, + { 13570, "context_sensative_dialog_timeouts" }, + { 13571, "groups" }, + { 13572, "deleteOnAC130PlayerRemoved" }, + { 13573, "setAC130Player" }, + { 13574, "incomingMissile" }, + { 13575, "playAC130Effects" }, + { 13576, "AC130_AltScene" }, + { 13577, "cameraModel" }, + { 13578, "removeAC130PlayerOnGameEnd" }, + { 13579, "removeAC130PlayerOnGameCleanup" }, + { 13580, "removeAC130PlayerOnDeath" }, + { 13581, "removeAC130PlayerOnCrash" }, + { 13582, "removeAC130PlayerOnDisconnect" }, + { 13583, "removeAC130PlayerOnChangeTeams" }, + { 13584, "removeAC130PlayerOnSpectate" }, + { 13585, "removeAC130PlayerAfterTime" }, + { 13586, "removeAC130Player" }, + { 13587, "darkScreenOverlay" }, + { 13588, "damageTracker" }, + { 13589, "ac130_spawn" }, + { 13590, "overlay_coords" }, + { 13591, "updateAimingCoords" }, + { 13592, "ac130ShellShock" }, + { 13593, "rotatePlane" }, + { 13594, "attachPlayer" }, + { 13595, "changeWeapons" }, + { 13596, "weaponFiredThread" }, + { 13597, "weaponReload" }, + { 13598, "clouds" }, + { 13599, "clouds_create" }, + { 13600, "playerWeapon" }, + { 13601, "gun_fired_and_ready_105mm" }, + { 13602, "shotFired" }, + { 13603, "shotFiredPhysicsSphere" }, + { 13604, "shotFiredDarkScreenOverlay" }, + { 13605, "add_beacon_effect" }, + { 13606, "context_Sensative_Dialog" }, + { 13607, "context_Sensative_Dialog_Guy_In_Sight" }, + { 13608, "context_Sensative_Dialog_Guy_In_Sight_Check" }, + { 13609, "context_Sensative_Dialog_Guy_Crawling" }, + { 13610, "context_Sensative_Dialog_Guy_Pain" }, + { 13611, "context_Sensative_Dialog_Secondary_Explosion_Vehicle" }, + { 13612, "enemy_killed_thread" }, + { 13613, "context_Sensative_Dialog_Kill" }, + { 13614, "context_Sensative_Dialog_Kill_Thread" }, + { 13615, "context_Sensative_Dialog_Locations" }, + { 13616, "context_Sensative_Dialog_Locations_Thread" }, + { 13617, "context_Sensative_Dialog_Locations_Add_Notify_Event" }, + { 13618, "context_Sensative_Dialog_VehicleSpawn" }, + { 13619, "context_Sensative_Dialog_VehicleDeath" }, + { 13620, "context_Sensative_Dialog_Filler" }, + { 13621, "radio_in_use" }, + { 13622, "context_Sensative_Dialog_Play_Random_Group_Sound" }, + { 13623, "context_Sensative_Dialog_Timedout" }, + { 13624, "playSoundOverRadio" }, + { 13625, "playAliasOverRadio" }, + { 13626, "debug_circle" }, + { 13627, "stingerProximityDetonate" }, + { 13628, "samProximityDetonate" }, + { 13629, "crashPlane" }, + { 13630, "angelFlarePrecache" }, + { 13631, "angel_flare" }, + { 13632, "missileRemoteLaunchVert" }, + { 13633, "missileRemoteLaunchHorz" }, + { 13634, "missileRemoteLaunchTargetDist" }, + { 13635, "remotemissile_fx" }, + { 13636, "tryUsePredatorMissile" }, + { 13637, "getBestSpawnPoint" }, + { 13638, "spawnScore" }, + { 13639, "_fire" }, + { 13640, "_fire_noplayer" }, + { 13641, "MissileEyes" }, + { 13642, "delayedFOFOverlay" }, + { 13643, "staticEffect" }, + { 13644, "archive" }, + { 13645, "Player_CleanupOnTeamChange" }, + { 13646, "Rocket_CleanupOnDeath" }, + { 13647, "Player_CleanupOnGameEnded" }, + { 13648, "radarViewTime" }, + { 13649, "uavBlockTime" }, + { 13650, "uav_fx" }, + { 13651, "killstreakSetupFuncs" }, + { 13652, "UAVRig" }, + { 13653, "activeUAVs" }, + { 13654, "activeCounterUAVs" }, + { 13655, "rotateUAVRig" }, + { 13656, "launchUAV" }, + { 13657, "timeToAdd" }, + { 13658, "spawnFxDelay" }, + { 13659, "monitorUAVStrike" }, + { 13660, "showLazeMessage" }, + { 13661, "waitForLazeDiscard" }, + { 13662, "waitForLazedTarget" }, + { 13663, "waitFxEntDie" }, + { 13664, "waittill_notify_or_timeout_hostmigration_pause" }, + { 13665, "updateUAVModelVisibility" }, + { 13666, "tryUseUAV" }, + { 13667, "tryUseUAVSupport" }, + { 13668, "tryUseDoubleUAV" }, + { 13669, "tryUseTripleUAV" }, + { 13670, "tryUseCounterUAV" }, + { 13671, "UAVStrikeSetup" }, + { 13672, "usedStrikeUAV" }, + { 13673, "tryUseUAVStrike" }, + { 13674, "tryUseDirectionalUAV" }, + { 13675, "useUAV" }, + { 13676, "UAVTracker" }, + { 13677, "_getRadarStrength" }, + { 13678, "updateTeamUAVStatus" }, + { 13679, "updatePlayersUAVStatus" }, + { 13680, "blockPlayerUAV" }, + { 13681, "updateTeamUAVType" }, + { 13682, "usePlayerUAV" }, + { 13683, "setTeamRadarWrapper" }, + { 13684, "addUAVModel" }, + { 13685, "removeUAVModel" }, + { 13686, "addActiveUAV" }, + { 13687, "addActiveCounterUAV" }, + { 13688, "removeActiveUAV" }, + { 13689, "removeActiveCounterUAV" }, + { 13690, "tryUseLbFlock" }, + { 13691, "selectLbStrikeLocation" }, + { 13692, "littlebirdMadeSelectionVO" }, + { 13693, "finishLbStrikeUsage" }, + { 13695, "getFlightPath" }, + { 13696, "doLbStrike" }, + { 13697, "spawnAttackLittleBird" }, + { 13698, "killCount" }, + { 13699, "mgTurret1" }, + { 13700, "monitorKills" }, + { 13701, "startLbFiring1" }, + { 13702, "flock_handleDamage" }, + { 13703, "trail_fx" }, + { 13704, "removeLittlebird" }, + { 13705, "lbStrike" }, + { 13706, "heliGuardSettings" }, + { 13707, "weaponInfo" }, + { 13708, "weaponModelLeft" }, + { 13709, "weaponModelRight" }, + { 13710, "weaponTagLeft" }, + { 13711, "weaponTagRight" }, + { 13712, "sentryMode" }, + { 13713, "tryUseLBSupport" }, + { 13714, "littlebirdGuard" }, + { 13715, "air_node_mesh" }, + { 13716, "createLBGuard" }, + { 13717, "followSpeed" }, + { 13718, "heliGuardType" }, + { 13719, "targettingRadius" }, + { 13720, "attract_strength" }, + { 13721, "attract_range" }, + { 13722, "hasDodged" }, + { 13723, "lbSupport_lightFX" }, + { 13724, "startLBSupport" }, + { 13725, "lbSupport_followPlayer" }, + { 13726, "lbSupport_moveToPlayer" }, + { 13727, "inTransit" }, + { 13728, "lbSupport_watchDeath" }, + { 13729, "lbSupport_watchTimeout" }, + { 13730, "lbSupport_watchOwnerLoss" }, + { 13731, "lbSupport_watchOwnerDamage" }, + { 13732, "lbSupport_watchRoundEnd" }, + { 13733, "lbSupport_leave" }, + { 13734, "lbSupport_handleDamage" }, + { 13735, "marker" }, + { 13736, "lbSupport_watchSAMProximity" }, + { 13737, "lbSupport_getClosestStartNode" }, + { 13738, "air_start_nodes" }, + { 13739, "lbSupport_getClosestNode" }, + { 13740, "lbSupport_getClosestLinkedNode" }, + { 13741, "neighbors" }, + { 13742, "lbSupport_arrayContains" }, + { 13743, "lbSupport_getLinkedStructs" }, + { 13744, "lbSupport_setAirStartNodes" }, + { 13745, "lbSupport_setAirNodeMesh" }, + { 13746, "lbSupport_attackTargets" }, + { 13747, "lbSupport_burstFireStart" }, + { 13748, "lbSupport_burstFireStop" }, + { 13749, "empTimeout" }, + { 13750, "EMP_Use" }, + { 13751, "EMP_JamTeam" }, + { 13752, "EMP_JamPlayers" }, + { 13753, "empPlayerFFADisconnect" }, + { 13754, "empEffects" }, + { 13755, "empEffect" }, + { 13756, "EMP_TeamTracker" }, + { 13757, "EMP_PlayerTracker" }, + { 13758, "destroyActiveVehicles" }, + { 13759, "nukeTimer" }, + { 13760, "cancelMode" }, + { 13761, "teamNukeEMPed" }, + { 13762, "nukeEmpTimeout" }, + { 13763, "nukeInfo" }, + { 13764, "tryUseNuke" }, + { 13765, "delaythread_nuke" }, + { 13766, "doNuke" }, + { 13767, "cancelNukeOnDeath" }, + { 13768, "nukeSoundIncoming" }, + { 13769, "nukeSoundExplosion" }, + { 13770, "nukeEffects" }, + { 13771, "nukeEffect" }, + { 13772, "nukeAftermathEffect" }, + { 13773, "nukeSlowMo" }, + { 13774, "nukeVision" }, + { 13775, "nukeVisionInProgress" }, + { 13776, "nukeDeath" }, + { 13777, "nukeEarthquake" }, + { 13778, "nuke_EMPJam" }, + { 13779, "nuke_EMPTeamTracker" }, + { 13780, "update_ui_timers" }, + { 13781, "remote_mortar_fx" }, + { 13782, "tryUseRemoteMortar" }, + { 13783, "startRemoteMortar" }, + { 13784, "spawnRemote" }, + { 13785, "lookCenter" }, + { 13786, "remoteRide" }, + { 13787, "remoteTargeting" }, + { 13788, "remoteFiring" }, + { 13789, "firingReaper" }, + { 13790, "remoteZoom" }, + { 13791, "zoomed" }, + { 13792, "remoteMissileDistance" }, + { 13793, "remoteMissileLife" }, + { 13794, "remoteEndRide" }, + { 13795, "handleTimeout" }, + { 13796, "handleOwnerChangeTeam" }, + { 13797, "handleOwnerDisconnect" }, + { 13798, "removeRemote" }, + { 13799, "remoteLeave" }, + { 13800, "boxSettings" }, + { 13801, "capturingString" }, + { 13802, "eventString" }, + { 13803, "splashName" }, + { 13804, "shaderName" }, + { 13805, "lifeSpan" }, + { 13806, "xp" }, + { 13807, "tryUseDeployableVest" }, + { 13808, "beginDeployableViaMarker" }, + { 13809, "watchMarkerUsage" }, + { 13810, "watchMarker" }, + { 13811, "takeWeaponOnStuck" }, + { 13812, "beginMarkerTracking" }, + { 13813, "markerActivate" }, + { 13814, "isMarker" }, + { 13815, "createBoxForPlayer" }, + { 13816, "boxType" }, + { 13817, "box_setActive" }, + { 13818, "isUsable" }, + { 13819, "box_playerConnected" }, + { 13820, "box_playerJoinedTeam" }, + { 13821, "box_setInactive" }, + { 13822, "box_handleDamage" }, + { 13823, "box_handleDeath" }, + { 13824, "box_handleOwnerDisconnect" }, + { 13825, "boxThink" }, + { 13826, "doubleDip" }, + { 13827, "boxCaptureThink" }, + { 13828, "isFriendlyToBox" }, + { 13829, "box_timeOut" }, + { 13830, "box_ModelTeamUpdater" }, + { 13831, "boxParams" }, + { 13832, "disableWhenJuggernaut" }, + { 13833, "imsSettings" }, + { 13834, "modelBombSquad" }, + { 13835, "placeString" }, + { 13836, "cannotPlaceString" }, + { 13837, "attacks" }, + { 13838, "modelExplosive1" }, + { 13839, "modelExplosive2" }, + { 13840, "modelExplosive3" }, + { 13841, "modelExplosive4" }, + { 13842, "modelLid1" }, + { 13843, "modelLid2" }, + { 13844, "modelLid3" }, + { 13845, "modelLid4" }, + { 13846, "tagExplosive1" }, + { 13847, "tagExplosive2" }, + { 13848, "tagExplosive3" }, + { 13849, "tagExplosive4" }, + { 13850, "tagLid1" }, + { 13851, "tagLid2" }, + { 13852, "tagLid3" }, + { 13853, "tagLid4" }, + { 13854, "tryUseIMS" }, + { 13855, "imsList" }, + { 13856, "giveIMS" }, + { 13857, "setCarryingIMS" }, + { 13858, "createIMSForPlayer" }, + { 13859, "imsType" }, + { 13860, "createIMS" }, + { 13861, "lid1" }, + { 13862, "lid2" }, + { 13863, "lid3" }, + { 13864, "lid4" }, + { 13865, "explosive1" }, + { 13866, "explosive2" }, + { 13867, "explosive3" }, + { 13868, "explosive4" }, + { 13869, "ims_createBombSquadModel" }, + { 13870, "ims_handleDamage" }, + { 13871, "ims_handleDeath" }, + { 13872, "ims_handleUse" }, + { 13873, "ims_handleOwnerDisconnect" }, + { 13874, "ims_setPlaced" }, + { 13875, "ims_setCancelled" }, + { 13876, "ims_setCarried" }, + { 13877, "updateIMSPlacement" }, + { 13878, "ims_onCarrierDeath" }, + { 13879, "ims_onCarrierDisconnect" }, + { 13880, "ims_onGameEnded" }, + { 13881, "ims_setActive" }, + { 13882, "attackTrigger" }, + { 13883, "attackMoveTime" }, + { 13884, "ims_playerConnected" }, + { 13885, "ims_playerJoinedTeam" }, + { 13886, "ims_blinky_light" }, + { 13887, "ims_setInactive" }, + { 13888, "isFriendlyToIMS" }, + { 13889, "ims_attackTargets" }, + { 13890, "fire_sensor" }, + { 13891, "ims_timeOut" }, + { 13892, "addToIMSList" }, + { 13893, "removeFromIMSList" }, + { 13894, "ims_hideAllParts" }, + { 13895, "ims_showAllParts" }, + { 13896, "turretSettings" }, + { 13897, "hintEnter" }, + { 13898, "hintExit" }, + { 13899, "laptopInfo" }, + { 13900, "remoteInfo" }, + { 13901, "tryUseRemoteMGTurret" }, + { 13902, "takeKillstreakWeapons" }, + { 13903, "takeKillstreakWeaponIfNoDupe" }, + { 13904, "tryUseRemoteTurret" }, + { 13905, "setCarryingTurret" }, + { 13906, "restoreWeaponClipAmmo" }, + { 13907, "restoreWeaponStockAmmo" }, + { 13908, "waitRestoreWeapons" }, + { 13909, "turret_setPlaced" }, + { 13910, "turret_setCancelled" }, + { 13911, "turret_setCarried" }, + { 13912, "updateTurretPlacement" }, + { 13913, "turret_onCarrierDeath" }, + { 13914, "turret_onCarrierDisconnect" }, + { 13915, "turret_onCarrierChangedTeam" }, + { 13916, "turret_onGameEnded" }, + { 13917, "createTurretForPlayer" }, + { 13918, "stunned" }, + { 13919, "stunnedTime" }, + { 13920, "damageFade" }, + { 13921, "turret_setActive" }, + { 13922, "remoteTurretList" }, + { 13923, "startUsingRemoteTurret" }, + { 13924, "stopUsingRemoteTurret" }, + { 13925, "using_remote_turret_when_died" }, + { 13926, "watchOwnerMessageOnDeath" }, + { 13927, "watchEnterAndExit" }, + { 13928, "enter_message_deleted" }, + { 13929, "turret_blinky_light" }, + { 13930, "turret_setInactive" }, + { 13931, "clearRideIntro" }, + { 13932, "turret_handleOwnerDisconnect" }, + { 13933, "turret_timeOut" }, + { 13934, "turret_handleDeath" }, + { 13935, "target_ent" }, + { 13936, "turret_handleDamage" }, + { 13937, "turret_incrementDamageFade" }, + { 13938, "turret_watchLowHealth" }, + { 13939, "turret_stun" }, + { 13940, "tankSettings" }, + { 13941, "mgTurretInfo" }, + { 13942, "glTurretInfo" }, + { 13943, "modelMGTurret" }, + { 13944, "stringPlace" }, + { 13945, "stringCannotPlace" }, + { 13946, "remote_tank_armor_bulletdamage" }, + { 13947, "tryUseRemoteTank" }, + { 13948, "giveTank" }, + { 13949, "createTankForPlayer" }, + { 13950, "tankType" }, + { 13951, "setCarryingTank" }, + { 13952, "tank_setCarried" }, + { 13953, "updateTankPlacement" }, + { 13954, "tank_onCarrierDeath" }, + { 13955, "tank_onCarrierDisconnect" }, + { 13956, "tank_onGameEnded" }, + { 13957, "tank_setCancelled" }, + { 13958, "tank_setPlaced" }, + { 13959, "tank_giveWeaponOnPlaced" }, + { 13960, "createTank" }, + { 13961, "tank" }, + { 13962, "tank_setActive" }, + { 13963, "startUsingTank" }, + { 13964, "tank_blinkyLightAntenna" }, + { 13965, "tank_blinkyLightCamera" }, + { 13966, "tank_setInactive" }, + { 13967, "tank_freezeBuffer" }, + { 13968, "tank_handleDisconnect" }, + { 13969, "tank_handleChangeTeams" }, + { 13970, "tank_handleTimeout" }, + { 13971, "tank_handleDeath" }, + { 13972, "tank_incrementDamageFade" }, + { 13973, "tank_watchLowHealth" }, + { 13974, "tank_handleDamage" }, + { 13975, "tank_turret_handleDamage" }, + { 13976, "tank_WatchFiring" }, + { 13977, "tank_FireMissiles" }, + { 13978, "tank_Earthquake" }, + { 13979, "addToUGVList" }, + { 13980, "removeFromUGVList" }, + { 13981, "tank_playerExit" }, + { 13982, "killstreakWeapons" }, + { 13983, "killstreakWeildWeapons" }, + { 13984, "killstreakChainingWeapons" }, + { 13985, "killstreakRoundDelay" }, + { 13986, "initKillstreakData" }, + { 13987, "curDefValue" }, + { 13988, "spUpdateTotal" }, + { 13989, "earnedStreakLevel" }, + { 13990, "adrenaline" }, + { 13991, "initPlayerKillstreaks" }, + { 13992, "earned" }, + { 13993, "awardxp" }, + { 13994, "kID" }, + { 13995, "isGimme" }, + { 13996, "isSpecialist" }, + { 13997, "nextSlot" }, + { 13998, "updateStreakCount" }, + { 13999, "previousAdrenaline" }, + { 14000, "resetStreakCount" }, + { 14001, "getNextStreakName" }, + { 14002, "getMaxStreakCost" }, + { 14003, "updateStreakSlots" }, + { 14004, "killstreakIndexWeapon" }, + { 14005, "waitForChangeTeam" }, + { 14006, "isRideKillstreak" }, + { 14007, "isCarryKillstreak" }, + { 14008, "deadlyKillstreak" }, + { 14009, "killstreakUsePressed" }, + { 14010, "selectingLocation" }, + { 14011, "useHardpoint" }, + { 14012, "updateSpecialistKillstreaks" }, + { 14013, "getFirstPrimaryWeapon" }, + { 14014, "killstreakUseWaiter" }, + { 14015, "lastKillStreak" }, + { 14016, "waitTakeKillstreakWeapon" }, + { 14017, "shouldSwitchWeaponPostKillstreak" }, + { 14018, "finishDeathWaiter" }, + { 14019, "checkStreakReward" }, + { 14020, "killstreakEarned" }, + { 14021, "firstKillstreakEarned" }, + { 14022, "earnKillstreak" }, + { 14023, "isPerkUpgraded" }, + { 14024, "giveKillstreakWeapon" }, + { 14025, "_setActionSlot" }, + { 14026, "isAssaultKillstreak" }, + { 14027, "isSupportKillstreak" }, + { 14028, "isSpecialistKillstreak" }, + { 14029, "getKillstreakHint" }, + { 14030, "getKillstreakInformEnemy" }, + { 14031, "getKillstreakSound" }, + { 14032, "getKillstreakDialog" }, + { 14033, "getKillstreakIcon" }, + { 14034, "getKillstreakDpadIcon" }, + { 14035, "getKillstreakIndex" }, + { 14036, "giveOwnedKillstreakItem" }, + { 14037, "initRideKillstreak_internal" }, + { 14038, "isNuked" }, + { 14039, "giveSelectedKillstreakItem" }, + { 14040, "showSelectedStreakHint" }, + { 14041, "leaderSound" }, + { 14042, "leaderSoundGroup" }, + { 14043, "getKillstreakCount" }, + { 14044, "shuffleKillstreaksUp" }, + { 14045, "shuffleKillstreaksDown" }, + { 14046, "streakSelectUpTracker" }, + { 14047, "streakSelectDownTracker" }, + { 14048, "streakNotifyTracker" }, + { 14049, "adrenalineInfo" }, + { 14050, "giveAllPerks" }, + { 14051, "setAdrenaline" }, + { 14052, "notifyOverlay" }, + { 14053, "promotionSplashNotify" }, + { 14054, "weaponPromotionSplashNotify" }, + { 14055, "textGlowColor" }, + { 14056, "iconOverlay" }, + { 14058, "playerCardPlayer" }, + { 14059, "resetOnDeath" }, + { 14060, "resetNotify" }, + { 14061, "hintMessageDeathThink" }, + { 14062, "lowerMessageThink" }, + { 14063, "lowerMessages" }, + { 14064, "outcomeOverlay" }, + { 14065, "matchOutcomeNotify" }, + { 14066, "resetOutcomeNotify" }, + { 14067, "resetTeamOutcomeNotify" }, + { 14068, "updateOutcome" }, + { 14069, "canShowSplash" }, + { 14070, "missionCallbacks" }, + { 14071, "createPerkMap" }, + { 14072, "perkMap" }, + { 14073, "mayProcessChallenges" }, + { 14074, "patientZeroName" }, + { 14075, "infected" }, + { 14076, "plague" }, + { 14077, "monitorScavengerPickup" }, + { 14078, "monitorStreakReward" }, + { 14079, "monitorBlastShieldSurvival" }, + { 14080, "monitorTacInsertionsDestroyed" }, + { 14081, "monitorFinalStandSurvival" }, + { 14082, "initMissionData" }, + { 14083, "registerMissionCallback" }, + { 14084, "ch_assists" }, + { 14085, "ch_hardpoints" }, + { 14086, "hardpointType" }, + { 14087, "ch_vehicle_kills" }, + { 14088, "victim" }, + { 14089, "ch_vehicle_killed" }, + { 14090, "clearIDShortly" }, + { 14091, "explosiveKills" }, + { 14092, "MGKill" }, + { 14093, "endMGStreakWhenLeaveMG" }, + { 14094, "endMGStreak" }, + { 14095, "killedBestEnemyPlayer" }, + { 14096, "isHighestScoringPlayer" }, + { 14097, "ch_kills" }, + { 14098, "isCACSecondaryWeapon" }, + { 14099, "brinkOfDeathKillStreak" }, + { 14100, "isStrStart" }, + { 14101, "getWeaponAttachments" }, + { 14102, "anglesOnDeath" }, + { 14103, "anglesOnKill" }, + { 14104, "isBuffUnlockedForWeapon" }, + { 14105, "holdingBreath" }, + { 14106, "adsTime" }, + { 14107, "isPlanting" }, + { 14108, "isDefusing" }, + { 14109, "isBombCarrier" }, + { 14110, "dd" }, + { 14111, "lastPrimaryWeaponSwapTime" }, + { 14112, "lastFlashedTime" }, + { 14113, "lastConcussedTime" }, + { 14114, "lastSprintEndTime" }, + { 14115, "ch_bulletDamageCommon" }, + { 14116, "victimOnGround" }, + { 14117, "attackerOnGround" }, + { 14118, "attackerStance" }, + { 14119, "ch_roundplayed" }, + { 14120, "place" }, + { 14121, "ch_roundwin" }, + { 14122, "attackerInLastStand" }, + { 14123, "waitAndProcessPlayerKilledCallback" }, + { 14124, "processingKilledChallenges" }, + { 14125, "doMissionCallback" }, + { 14126, "monitorSprintDistance" }, + { 14127, "sprintDistThisSprint" }, + { 14128, "monitorSingleSprintDistance" }, + { 14129, "monitorSprintTime" }, + { 14130, "monitorFallDistance" }, + { 14131, "lastManSD" }, + { 14132, "monitorBombUse" }, + { 14133, "monitorLiveTime" }, + { 14134, "survivalistChallenge" }, + { 14135, "monitorStreaks" }, + { 14136, "monitorMisc" }, + { 14137, "monitorMiscSingle" }, + { 14138, "monitorMiscCallback" }, + { 14139, "healthRegenerationStreak" }, + { 14140, "resetBrinkOfDeathKillStreakShortly" }, + { 14141, "playerDied" }, + { 14142, "isAtBrinkOfDeath" }, + { 14143, "getMarksmanUnlockAttachment" }, + { 14144, "getWeaponAttachment" }, + { 14145, "masteryChallengeProcess" }, + { 14146, "isAttachmentUnlocked" }, + { 14147, "buildChallegeInfo" }, + { 14148, "monitorProcessChallenge" }, + { 14149, "monitorKillstreakProgress" }, + { 14150, "monitorKilledKillstreak" }, + { 14151, "playerHasAmmo" }, + { 14152, "monitorADSTime" }, + { 14153, "monitorHoldBreath" }, + { 14154, "monitorMantle" }, + { 14155, "mantling" }, + { 14156, "monitorWeaponSwap" }, + { 14157, "monitorFlashbang" }, + { 14158, "monitorConcussion" }, + { 14159, "monitorMineTriggering" }, + { 14160, "waitDelayMineTime" }, + { 14161, "weaponRankTable" }, + { 14162, "maxPrestige" }, + { 14163, "patientZeroWaiter" }, + { 14164, "isRegisteredEvent" }, + { 14165, "getScoreInfoLabel" }, + { 14166, "getWeaponRankInfoMinXP" }, + { 14167, "getWeaponRankInfoXPAmt" }, + { 14168, "getWeaponRankInfoMaxXp" }, + { 14169, "getRankInfoLevel" }, + { 14170, "xpUpdateTotal" }, + { 14171, "bonusUpdateTotal" }, + { 14172, "hud_xpPointsPopup" }, + { 14173, "hud_xpEventPopup" }, + { 14174, "prestigeDoubleXp" }, + { 14175, "prestigeDoubleWeaponXp" }, + { 14176, "setGamesPlayed" }, + { 14177, "roundUp" }, + { 14178, "weaponShouldGetXP" }, + { 14179, "levelFlag" }, + { 14180, "updateWeaponRankAnnounceHUD" }, + { 14181, "createXpPointsPopup" }, + { 14182, "createXpEventPopup" }, + { 14183, "removeRankHUD" }, + { 14184, "levelForExperience" }, + { 14185, "weaponLevelForExperience" }, + { 14186, "getCurrentWeaponXP" }, + { 14187, "getWeaponRankForXp" }, + { 14188, "getPrestigeLevel" }, + { 14189, "getWeaponRankXP" }, + { 14190, "getWeaponMaxRankXP" }, + { 14191, "isWeaponMaxRank" }, + { 14192, "incRankXP" }, + { 14193, "isCheater" }, + { 14194, "getRestXPAward" }, + { 14195, "isLastRestXPAward" }, + { 14196, "syncXPStat" }, + { 14197, "isWeaponChallenge" }, + { 14198, "isValidPrimary" }, + { 14199, "isValidSecondary" }, + { 14200, "classMap" }, + { 14201, "defaultClass" }, + { 14202, "logClassChoice" }, + { 14203, "cac_getWeaponCamo" }, + { 14204, "cac_getWeaponReticle" }, + { 14205, "recipe_getKillstreak" }, + { 14206, "table_getWeaponCamo" }, + { 14207, "table_getWeaponReticle" }, + { 14208, "table_getTeamPerk" }, + { 14209, "loadoutFakePerks" }, + { 14210, "getLoadoutStreakTypeFromStreakType" }, + { 14211, "recipeClassApplyJuggernaut" }, + { 14212, "classTableNum" }, + { 14213, "loadoutPrimaryCamo" }, + { 14214, "loadoutSecondaryCamo" }, + { 14215, "loadoutPrimaryReticle" }, + { 14216, "loadoutSecondaryReticle" }, + { 14217, "_clearPerks" }, + { 14218, "_detachAll" }, + { 14219, "loadoutAllPerks" }, + { 14220, "loadoutPerk1" }, + { 14221, "loadoutPerk2" }, + { 14222, "loadoutPerk3" }, + { 14223, "loadoutPerkEquipment" }, + { 14224, "tryAttach" }, + { 14225, "tryDetach" }, + { 14226, "buildWeaponName" }, + { 14227, "letterToNumber" }, + { 14228, "getAttachmentType" }, + { 14229, "buildWeaponNameCamo" }, + { 14230, "buildWeaponNameReticle" }, + { 14231, "makeLettersToNumbers" }, + { 14232, "setKillstreaks" }, + { 14233, "replenishLoadout" }, + { 14234, "classGrenades" }, + { 14235, "onPlayerConnecting" }, + { 14236, "fadeAway" }, + { 14237, "getPerkForClass" }, + { 14238, "classHasPerk" }, + { 14239, "isValidAttachment" }, + { 14240, "isValidWeaponBuff" }, + { 14241, "isWeaponBuffUnlocked" }, + { 14242, "isValidCamo" }, + { 14243, "isValidReticle" }, + { 14244, "isCamoUnlocked" }, + { 14245, "isValidEquipment" }, + { 14246, "isValidOffhand" }, + { 14247, "isValidPerk1" }, + { 14248, "isValidPerk2" }, + { 14249, "isValidPerk3" }, + { 14250, "isValidDeathStreak" }, + { 14251, "isValidWeapon" }, + { 14252, "weaponRefs" }, + { 14253, "isValidKillstreak" }, + { 14254, "persistentDataInfo" }, + { 14255, "bufferedStats" }, + { 14256, "bufferedChildStats" }, + { 14257, "statAddChild" }, + { 14258, "statGetChildBuffered" }, + { 14259, "updateBufferedStats" }, + { 14260, "writeBufferedStats" }, + { 14261, "uploadGlobalStatCounters" }, + { 14262, "exploder_sound" }, + { 14263, "streakMsg" }, + { 14264, "endSelectionOnEMP" }, + { 14265, "endSelectionOnAction" }, + { 14266, "endSelectionOnEndGame" }, + { 14267, "getPlant" }, + { 14268, "orientToNormal" }, + { 14269, "deletePlacedEntity" }, + { 14270, "sortLowerMessages" }, + { 14271, "addLowerMessage" }, + { 14272, "addTime" }, + { 14273, "showTimer" }, + { 14274, "shouldFade" }, + { 14275, "fadeToAlpha" }, + { 14276, "fadeToAlphaTime" }, + { 14277, "removeLowerMessage" }, + { 14278, "getLowerMessage" }, + { 14279, "updateLowerMessage" }, + { 14280, "clearOnDeath" }, + { 14281, "clearAfterFade" }, + { 14282, "printOnTeam" }, + { 14283, "printBoldOnTeam" }, + { 14284, "printBoldOnTeamArg" }, + { 14285, "printOnTeamArg" }, + { 14286, "printOnPlayers" }, + { 14287, "printAndSoundOnEveryone" }, + { 14288, "printAndSoundOnTeam" }, + { 14289, "printAndSoundOnPlayer" }, + { 14290, "_playLocalSound" }, + { 14291, "dvarIntValue" }, + { 14292, "dvarFloatValue" }, + { 14293, "updatePersRatioBuffered" }, + { 14294, "lastSlowProcessFrame" }, + { 14295, "isExcluded" }, + { 14296, "leaderDialogBothTeams" }, + { 14297, "playLeaderDialogOnPlayer" }, + { 14298, "leaderDialogLocalSound" }, + { 14299, "setObjectiveText" }, + { 14300, "setObjectiveScoreText" }, + { 14301, "setObjectiveHintText" }, + { 14302, "getObjectiveText" }, + { 14303, "getObjectiveScoreText" }, + { 14304, "getMinutesPassed" }, + { 14305, "getValueInRange" }, + { 14306, "waitForTimeOrNotifies" }, + { 14307, "logXPGains" }, + { 14308, "registerRoundSwitchDvar" }, + { 14309, "roundswitchDvar" }, + { 14310, "roundswitchMin" }, + { 14311, "roundswitchMax" }, + { 14312, "registerRoundLimitDvar" }, + { 14313, "registerWinLimitDvar" }, + { 14314, "registerScoreLimitDvar" }, + { 14315, "registerTimeLimitDvar" }, + { 14316, "registerHalfTimeDvar" }, + { 14317, "registerNumLivesDvar" }, + { 14318, "setOverTimeLimitDvar" }, + { 14319, "getDvarVec" }, + { 14320, "_takeWeaponsExcept" }, + { 14321, "saveData" }, + { 14322, "offhandClass" }, + { 14323, "actionSlots" }, + { 14324, "weapons" }, + { 14325, "clipAmmoR" }, + { 14326, "clipAmmoL" }, + { 14327, "stockAmmo" }, + { 14328, "script_saveData" }, + { 14329, "restoreData" }, + { 14330, "isFloat" }, + { 14331, "registerWatchDvarInt" }, + { 14332, "registerWatchDvarFloat" }, + { 14333, "registerWatchDvar" }, + { 14334, "setOverrideWatchDvar" }, + { 14335, "onlyRoundOverride" }, + { 14336, "hitScoreLimit" }, + { 14337, "getRoundsWon" }, + { 14338, "objectiveBased" }, + { 14339, "bombexploded" }, + { 14340, "ddTimeToAdd" }, + { 14341, "inOvertime" }, + { 14342, "getAverageOrigin" }, + { 14343, "getLivingPlayers" }, + { 14344, "getRemoteName" }, + { 14345, "queues" }, + { 14346, "_setPerk" }, + { 14347, "_setExtraPerks" }, + { 14348, "quickSort" }, + { 14349, "quickSortMid" }, + { 14350, "swap" }, + { 14351, "onlinegame" }, + { 14352, "endSceneOnDeath" }, + { 14353, "giveCombatHigh" }, + { 14354, "arrayInsertion" }, + { 14355, "getProperty" }, + { 14356, "statusMenu" }, + { 14357, "_statusMenu" }, // a typo by IW should be statusMenu + { 14358, "streakShouldChain" }, + { 14359, "fixAkimboString" }, + { 14360, "roundDecimalPlaces" }, + { 14361, "makeTeamUsable" }, + { 14362, "_updateTeamUsable" }, + { 14363, "_updateEnemyUsable" }, + { 14364, "gameFlagClear" }, + { 14365, "isPrimaryDamage" }, + { 14366, "levelFlags" }, + { 14367, "levelFlagWait" }, + { 14368, "levelFlagWaitOpen" }, + { 14369, "killTrigger" }, + { 14370, "setCommonRulesFromMatchRulesData" }, + { 14371, "matchRules_allowCustomClasses" }, + { 14372, "GetMatchRulesSpecialClass" }, + { 14374, "audio" }, + { 14375, "init_reverb" }, + { 14376, "add_reverb" }, + { 14377, "reverb_settings" }, + { 14378, "is_roomtype_valid" }, + { 14379, "apply_reverb" }, + { 14380, "init_whizby" }, + { 14381, "whizby_settings" }, + { 14382, "set_whizby_radius" }, + { 14383, "set_whizby_spread" }, + { 14384, "apply_whizby" }, + { 14385, "radial_button_definitions" }, + { 14386, "radial_init" }, + { 14387, "radial_button_group" }, + { 14388, "pos_angle" }, + { 14389, "end_angle" }, + { 14390, "start_angle" }, + { 14391, "debug_toggle" }, + { 14392, "crib_debug" }, + { 14393, "observer" }, + { 14394, "return_hud" }, + { 14395, "readyPlayer" }, + { 14396, "get_right_stick_angle" }, + { 14397, "rs_angle" }, + { 14398, "newRadialButtonGroup" }, + { 14399, "radial_button_group_info" }, + { 14400, "newRadialButton" }, + { 14401, "font_size" }, + { 14402, "font_color" }, + { 14403, "action_func" }, + { 14404, "radius_pos" }, + { 14405, "updateSelectedButton" }, + { 14406, "radial_button_current_group" }, + { 14407, "active_button" }, + { 14408, "watchSelectButtonPress" }, + { 14409, "watchBackButtonPress" }, + { 14410, "sort_buttons_by_angle" }, + { 14411, "button_switch" }, + { 14412, "draw_radial_buttons" }, + { 14413, "draw_radial_button" }, + { 14414, "zoom_to_radial_menu" }, + { 14415, "radial_button_previous_group" }, + { 14416, "getRadialAngleFromEnt" }, + { 14417, "radial_angle_to_vector" }, + { 14418, "getMidAngle" }, + { 14419, "isInRange" }, + { 14420, "action_back" }, + { 14421, "action_weapons_primary" }, + { 14422, "action_weapons_secondary" }, + { 14423, "action_gears" }, + { 14424, "action_killstreak" }, + { 14425, "action_leaderboards" }, + { 14426, "view_path_setup" }, + { 14427, "view_paths" }, + { 14428, "build_path_by_targetname" }, + { 14429, "go_path_by_targetname" }, + { 14430, "dummy_mover" }, + { 14431, "go_path_by_targetname_reverse" }, + { 14432, "travel_view_fx" }, + { 14433, "blur_sine" }, + { 14434, "force_player_angles" }, + { 14435, "shotgunSetup" }, + { 14436, "tryUseAutoShotgun" }, + { 14437, "thumperSetup" }, + { 14438, "tryUseThumper" }, + { 14439, "saveWeaponAmmoOnDeath" }, + { 14440, "removeWeaponOnOutOfAmmo" }, + { 14441, "spawnArmor" }, + { 14442, "standardSpeed" }, + { 14443, "deleteOnZ" }, + { 14444, "useTank" }, + { 14445, "tryUseTank" }, + { 14446, "tankInUse" }, + { 14447, "tankSpawner" }, + { 14448, "startTank" }, + { 14449, "nodes" }, + { 14450, "objID" }, + { 14451, "timeLastFired" }, + { 14452, "neutralTarget" }, + { 14453, "waitForChangeTeams" }, + { 14454, "waitForDisco" }, + { 14455, "setDirection" }, + { 14456, "setEngagementSpeed" }, + { 14457, "changingDirection" }, + { 14458, "speedType" }, + { 14459, "setMiniEngagementSpeed" }, + { 14460, "setStandardSpeed" }, + { 14461, "setEvadeSpeed" }, + { 14462, "setDangerSpeed" }, + { 14463, "stopToReverse" }, + { 14464, "stopToForward" }, + { 14465, "checkDanger" }, + { 14466, "numEnemiesClose" }, + { 14467, "tankUpdate" }, + { 14468, "graphNodes" }, + { 14469, "endNode" }, + { 14470, "tankDamageMonitor" }, + { 14471, "forcedTarget" }, + { 14472, "handleThreat" }, + { 14473, "tankCover" }, + { 14474, "handlePossibleThreat" }, + { 14475, "relativeAngle" }, + { 14476, "watchForThreat" }, + { 14477, "checkOwner" }, + { 14478, "modifyDamage" }, + { 14479, "destroyTank" }, + { 14480, "tankFire" }, + { 14481, "onHitPitchClamp" }, + { 14482, "waitForTurretReady" }, + { 14483, "tankGetTargets" }, + { 14484, "harrier" }, + { 14485, "acquireTarget" }, + { 14486, "setNoTarget" }, + { 14487, "explicitAbandonTarget" }, + { 14488, "badTarget" }, + { 14489, "badTargetReset" }, + { 14490, "removeTarget" }, + { 14491, "lastLostTime" }, + { 14492, "isVehicleTarget" }, + { 14493, "turretSightTrace" }, + { 14494, "isMiniTarget" }, + { 14495, "tankGetMiniTargets" }, + { 14496, "getBestMiniTarget" }, + { 14497, "acquireMiniTarget" }, + { 14498, "bestMiniTarget" }, + { 14499, "fireMiniOnTarget" }, + { 14500, "watchMiniTargetDeath" }, + { 14501, "watchMiniTargetDistance" }, + { 14502, "watchMiniTargetThreat" }, + { 14503, "explicitAbandonMiniTarget" }, + { 14504, "addToTankList" }, + { 14505, "removeFromTankList" }, + { 14506, "getNodeNearEnemies" }, + { 14507, "dist" }, + { 14508, "setupPaths" }, + { 14509, "branchNodes" }, + { 14510, "next" }, + { 14511, "length" }, + { 14512, "graphId" }, + { 14513, "getRandomBranchNode" }, + { 14514, "links" }, + { 14515, "linkDirs" }, + { 14516, "getNextNodeForEndNode" }, + { 14517, "g" }, + { 14518, "otherDir" }, + { 14519, "handleBranchNode" }, + { 14520, "linkStartNodes" }, + { 14521, "handleCapNode" }, + { 14522, "nodeTracker" }, + { 14523, "forwardGraphId" }, + { 14524, "reverseGraphId" }, + { 14525, "forceTrigger" }, + { 14526, "getForwardGraphNode" }, + { 14527, "getReverseGraphNode" }, + { 14528, "getNextNode" }, + { 14529, "getPrevNode" }, + { 14530, "initNodeGraph" }, + { 14531, "linkInfos" }, + { 14532, "linkLengths" }, + { 14533, "addLinkNode" }, + { 14534, "toGraphNode" }, + { 14535, "toGraphId" }, + { 14536, "direction" }, + { 14537, "startNode" }, + { 14538, "generatePath" }, + { 14539, "openList" }, + { 14540, "closedList" }, + { 14541, "h" }, + { 14542, "f" }, + { 14543, "parentNode" }, + { 14544, "addToOpenList" }, + { 14545, "openListID" }, + { 14546, "closedListID" }, + { 14547, "addToClosedList" }, + { 14548, "getHValue" }, + { 14549, "getGValue" }, + { 14550, "drawPath" }, + { 14551, "drawGraph" }, + { 14552, "drawLink" }, + { 14553, "debugPrintLn2" }, + { 14554, "debugPrint3D" }, + { 14555, "drawTankGraphIds" }, + { 14556, "tankExplode" }, + { 14557, "tankFlash" }, + { 14558, "tankDust1" }, + { 14559, "tankDust2" }, + { 14560, "ground_support_locs" }, + { 14561, "tryUseMobileMortar" }, + { 14562, "mobileMortar" }, + { 14563, "selectEntranceLocation" }, + { 14564, "createMobileMortar" }, + { 14565, "playersAttacked" }, + { 14566, "lastTarget" }, + { 14567, "lowX" }, + { 14568, "highX" }, + { 14569, "lowY" }, + { 14570, "highY" }, + { 14571, "moveToPosition" }, + { 14572, "fxEnt" }, + { 14573, "findTarget" }, + { 14574, "findRandomTarget" }, + { 14575, "mortarAttack" }, + { 14576, "fireMortar" }, + { 14577, "watchProjectileOnMiniMap" }, + { 14578, "mortarRecoil" }, + { 14579, "watchProximity" }, + { 14580, "watchDamage" }, + { 14581, "a10_fx" }, + { 14582, "a10MaxHealth" }, + { 14583, "a10Speed" }, + { 14584, "a10SpeedReduction" }, + { 14585, "a10StartPointOffset" }, + { 14586, "a10ImpactFXDelay" }, + { 14587, "a10Damage" }, + { 14588, "a10DamageRadius" }, + { 14589, "a10DamageDelay" }, + { 14590, "a10BulletRainDelay" }, + { 14591, "a10BulletImpactsDelay" }, + { 14592, "a10EarthquakeMagnitude" }, + { 14593, "a10EarthquakeDuration" }, + { 14594, "a10EarthquakeDelay" }, + { 14595, "a10DirtEffectRadius" }, + { 14596, "a10ShootingGroundSoundDelay" }, + { 14597, "a10StartPositionScalar" }, + { 14598, "a10SupportSetup" }, + { 14599, "usedUavA10" }, + { 14600, "tryUseA10Strike" }, + { 14601, "selectA10StrikeLocation" }, + { 14602, "finishA10StrikeUsage" }, + { 14603, "callA10Strike" }, + { 14604, "doA10Strike" }, + { 14605, "a10" }, + { 14606, "a10StartMove" }, + { 14607, "initialDelay" }, + { 14608, "startPoint" }, + { 14609, "attackPoint" }, + { 14610, "endPoint" }, + { 14611, "a10PlayEngineFX" }, + { 14612, "spawnA10" }, + { 14613, "fakeA10" }, + { 14614, "startA10Shooting" }, + { 14615, "a10ShootingPos" }, + { 14616, "playBulletRain" }, + { 14617, "manageShootingLoopSound" }, + { 14618, "manageShootingGroundSound" }, + { 14619, "a10Earthquake" }, + { 14620, "a10Destroyed" }, + { 14621, "a10Explode" }, + { 14622, "removeA10" }, + { 14623, "tryUseTeamAmmoRefill" }, + { 14624, "giveTeamAmmoRefill" }, + { 14625, "showSpawnpoint" }, + { 14626, "showSpawnpoints" }, + { 14627, "print3DUntilNotified" }, + { 14628, "lineUntilNotified" }, + { 14629, "hideSpawnpoints" }, + { 14630, "updateReflectionProbe" }, + { 14631, "reflectionProbeButtons" }, + { 14632, "gotoNextSpawn" }, + { 14633, "gotoPrevSpawn" }, + { 14634, "endGameOnTimeLimit" }, + { 14635, "playersLookingForSafeSpawn" }, + { 14636, "registerDvars" }, + { 14637, "blank" }, + { 14638, "testMenu" }, + { 14639, "testShock" }, + { 14640, "fakeLag" }, + { 14641, "spawn_all" }, + { 14642, "spawn_axis_start" }, + { 14643, "spawn_allies_start" }, + { 14644, "flagBaseFXid" }, + { 14645, "bestSpawnFlag" }, + { 14646, "nearbyspawns" }, + { 14647, "domFlags" }, + { 14648, "lastStatus" }, + { 14649, "baseeffectforward" }, + { 14650, "baseeffectright" }, + { 14651, "baseeffectpos" }, + { 14652, "useObj" }, + { 14653, "adjflags" }, + { 14654, "getUnownedFlagNearestStart" }, + { 14655, "didStatusNotify" }, + { 14656, "statusDialog" }, + { 14657, "resetFlagBaseEffect" }, + { 14658, "baseeffect" }, + { 14659, "captureTime" }, + { 14660, "giveFlagCaptureXP" }, + { 14661, "delayedLeaderDialog" }, + { 14662, "delayedLeaderDialogBothTeams" }, + { 14663, "updateDomScores" }, + { 14664, "getOwnedDomFlags" }, + { 14665, "getTeamFlagCount" }, + { 14666, "getFlagTeam" }, + { 14667, "getBoundaryFlags" }, + { 14668, "getBoundaryFlagSpawns" }, + { 14669, "getSpawnsBoundingFlag" }, + { 14670, "getOwnedAndBoundingFlagSpawns" }, + { 14671, "getOwnedFlagSpawns" }, + { 14672, "flagSetup" }, + { 14673, "descriptor" }, + { 14674, "updateCPM" }, + { 14675, "CPM" }, + { 14676, "numCaps" }, + { 14677, "getCapXPScale" }, + { 14678, "multiBomb" }, + { 14679, "bombPlanted" }, + { 14680, "sd_loadout" }, + { 14681, "checkAllowSpectating" }, + { 14682, "sd_endGame" }, + { 14683, "bombZones" }, + { 14684, "killCamEntNum" }, + { 14685, "bombDefused" }, + { 14686, "plantTime" }, + { 14687, "defuseTime" }, + { 14688, "removeBombZoneC" }, + { 14689, "relatedBrushModel" }, + { 14690, "bombs" }, + { 14691, "sdBomb" }, + { 14692, "exploderIndex" }, + { 14693, "bombDefuseTrig" }, + { 14694, "otherBombZones" }, + { 14695, "setupKillCamEnt" }, + { 14696, "sdBombModel" }, + { 14697, "onUsePlantObject" }, + { 14698, "bombOwner" }, + { 14699, "bombPlantedTime" }, + { 14700, "applyBombCarrierClass" }, + { 14701, "removeBombCarrierClass" }, + { 14702, "onUseDefuseObject" }, + { 14703, "tickingObject" }, + { 14704, "BombTimerWait" }, + { 14705, "handleHostMigration" }, + { 14706, "setSpecialLoadout" }, + { 14707, "spawn_axis" }, + { 14708, "spawn_axis_planted" }, + { 14709, "spawn_allies" }, + { 14710, "spawn_allies_planted" }, + { 14711, "otSpawned" }, + { 14712, "sab_loadouts" }, + { 14713, "printOTHint" }, + { 14714, "hotPotato" }, + { 14715, "scoreMode" }, + { 14716, "sabotage" }, + { 14717, "sabBomb" }, + { 14718, "getClosestSite" }, + { 14719, "distanceToSite" }, + { 14720, "scoreThread" }, + { 14721, "bombDistance" }, + { 14722, "createBombZone" }, + { 14723, "abandonmentThink" }, + { 14724, "overtimeThread" }, + { 14725, "bombDistanceThread" }, + { 14726, "dangerTeam" }, + { 14727, "resetBombsite" }, + { 14728, "setUpForDefusing" }, + { 14729, "setSpecialLoadouts" }, + { 14730, "doPrematch" }, + { 14731, "hqAutoDestroyTime" }, + { 14732, "hqSpawnTime" }, + { 14733, "kothMode" }, + { 14734, "destroyTime" }, + { 14735, "delayPlayer" }, + { 14736, "spawnDelay" }, + { 14737, "extraDelay" }, + { 14738, "proMode" }, + { 14739, "iconoffset" }, + { 14740, "updateObjectiveHintMessages" }, + { 14741, "getRespawnDelay" }, + { 14742, "radioObject" }, + { 14743, "hqDestroyTime" }, + { 14744, "objectiveHintPrepareHQ" }, + { 14745, "objectiveHintCaptureHQ" }, + { 14746, "objectiveHintDestroyHQ" }, + { 14747, "objectiveHintDefendHQ" }, + { 14748, "HQMainLoop" }, + { 14749, "hqRevealTime" }, + { 14750, "timerDisplay" }, + { 14751, "gameobject" }, + { 14752, "trigorigin" }, + { 14753, "hqDestroyedByTimer" }, + { 14754, "hideTimerDisplayOnGameEnd" }, + { 14755, "forceSpawnTeam" }, + { 14756, "onRadioCapture" }, + { 14757, "onRadioDestroy" }, + { 14758, "DestroyHQAfterTime" }, + { 14759, "awardHQPoints" }, + { 14760, "nearSpawns" }, + { 14761, "outerSpawns" }, + { 14762, "SetupRadios" }, + { 14763, "trig" }, + { 14764, "radios" }, + { 14765, "prevradio" }, + { 14766, "prevradio2" }, + { 14767, "makeRadioActive" }, + { 14768, "makeRadioInactive" }, + { 14769, "setUpNearbySpawns" }, + { 14770, "distsq" }, + { 14771, "PickRadioToSpawn" }, + { 14772, "flagReturnTime" }, + { 14773, "usingObj" }, + { 14774, "oneflag_ctf" }, + { 14775, "flagModel" }, + { 14776, "icon2D" }, + { 14777, "iconCapture3D" }, + { 14778, "iconCapture2D" }, + { 14779, "iconDefend3D" }, + { 14780, "iconDefend2D" }, + { 14781, "iconTarget3D" }, + { 14782, "iconTarget2D" }, + { 14783, "teamFlags" }, + { 14784, "capZones" }, + { 14785, "flagCaptured" }, + { 14786, "createTeamFlag" }, + { 14787, "createCapZone" }, + { 14788, "returnFlag" }, + { 14789, "attachFlag" }, + { 14790, "detachFlag" }, + { 14791, "ctf_loadouts" }, + { 14792, "ctf" }, + { 14793, "iconEscort3D" }, + { 14794, "iconEscort2D" }, + { 14795, "iconKill3D" }, + { 14796, "iconKill2D" }, + { 14797, "iconCaptureFlag3D" }, + { 14798, "iconCaptureFlag2D" }, + { 14799, "iconDefendFlag3D" }, + { 14800, "iconDefendFlag2D" }, + { 14801, "iconReturnFlag3D" }, + { 14802, "iconReturnFlag2D" }, + { 14803, "iconWaitForFlag3D" }, + { 14804, "iconWaitForFlag2D" }, + { 14805, "friendlyFlagStatusIcon" }, + { 14806, "friendlyFlagStatusText" }, + { 14807, "enemyFlagStatusIcon" }, + { 14808, "enemyFlagStatusText" }, + { 14809, "returnAfterTime" }, + { 14810, "applyFlagCarrierClass" }, + { 14811, "removeFlagCarrierClass" }, + { 14812, "ctfPro" }, + { 14813, "iconFlagBase2D" }, + { 14814, "iconFlagBase3D" }, + { 14815, "createTeamFlags" }, + { 14816, "atHome" }, + { 14817, "createCapZones" }, + { 14818, "zoneHeadIcon" }, + { 14819, "zoneMapIcon" }, + { 14820, "cappedFlag" }, + { 14821, "giveScore" }, + { 14822, "matchRules_initialAmmo" }, + { 14823, "matchRules_rewardAmmo" }, + { 14824, "oic_firstSpawn" }, + { 14825, "oic_rewardAmmo" }, + { 14826, "oic_loadouts" }, + { 14827, "waitLoadoutDone" }, + { 14828, "oic_gun" }, + { 14829, "waitGiveAmmo" }, + { 14830, "giveAmmo" }, + { 14831, "watchElimination" }, + { 14832, "setGun" }, + { 14833, "matchRules_dropTime" }, + { 14834, "matchRules_zoneSwitchTime" }, + { 14835, "grnd_fx" }, + { 14836, "grnd_centerLoc" }, + { 14838, "initFirstZone" }, + { 14839, "zonesCycling" }, + { 14840, "grnd_dropZones" }, + { 14841, "grnd_initialIndex" }, + { 14842, "grnd_zone" }, + { 14843, "initZones" }, + { 14844, "grnd_zones" }, + { 14845, "inGrindZone" }, + { 14846, "setPlayerMessages" }, + { 14847, "inGrindZonePoints" }, + { 14849, "grndHeadIcon" }, + { 14850, "grndObjId" }, + { 14851, "getNextZone" }, + { 14852, "distToZone" }, + { 14853, "cycleZones" }, + { 14854, "grndTracking" }, + { 14855, "locationScoring" }, + { 14856, "randomDrops" }, + { 14857, "getBestPlayer" }, + { 14858, "getDropZoneCrateType" }, + { 14859, "hideHudElementOnGameEnd" }, + { 14860, "createZones" }, + { 14861, "matchRules_enemyFlagRadar" }, + { 14862, "tdef" }, + { 14863, "tdef_loadouts" }, + { 14864, "tdef_flagTime" }, + { 14865, "portable_radar" }, + { 14866, "currentCarrier" }, + { 14867, "currentTeam" }, + { 14868, "watchForEndGame" }, + { 14869, "createFlag" }, + { 14870, "flagAttachRadar" }, + { 14871, "getFlagRadarOwner" }, + { 14872, "flagRadarMover" }, + { 14873, "flagWatchRadarOwnerLost" }, + { 14874, "conf_fx" }, + { 14875, "dogtags" }, + { 14876, "spawnDogTags" }, + { 14877, "victimTeam" }, + { 14878, "showToTeam" }, + { 14879, "bounce" }, + { 14880, "clearOnVictimDisconnect" }, + { 14881, "matchRules_numInitialInfected" }, + { 14882, "infect_timerDisplay" }, + { 14883, "infect_choseFirstInfected" }, + { 14884, "infect_choosingFirstInfected" }, + { 14885, "infect_firstSpawn" }, + { 14886, "isInitialInfected" }, + { 14887, "infect_loadouts" }, + { 14888, "chooseFirstInfected" }, + { 14889, "infect_isBeingChosen" }, + { 14890, "setInitialToNormalInfected" }, + { 14891, "updateTeamScores" }, + { 14894, "matchRules_respawnNewJugg" }, + { 14895, "matchRules_showJuggWorldIcon" }, + { 14896, "jugg_juggernaut" }, + { 14897, "jugg_choosingJugg" }, + { 14898, "jugg_timerDisplay" }, + { 14899, "chooseInitialJugg" }, + { 14900, "jugg_juggScore" }, + { 14901, "jugg_firstSpawn" }, + { 14902, "jugg_loadouts" }, + { 14903, "jugg_headIcon" }, + { 14904, "resetJugg" }, + { 14905, "giveJuggLoadout" }, + { 14906, "updateJuggScores" }, + { 14907, "gun_firstSpawn" }, + { 14908, "gunGameGunIndex" }, + { 14909, "gunGamePrevGunIndex" }, + { 14910, "gun_loadouts" }, + { 14911, "giveNextGun" }, + { 14912, "gun_guns" }, + { 14914, "refillSingleCountAmmo" }, + { 14915, "initGunHUD" }, + { 14917, "updateGunHUD" }, + { 14919, "hideOnGameEnd" }, + { 14920, "setGuns" }, + { 14921, "matchRules_juggSwitchTime" }, + { 14922, "jugg_available" }, + { 14923, "jugg_attackers" }, + { 14924, "jugg_currJugg" }, + { 14925, "tjugg_timerDisplay" }, + { 14926, "jugg_alligience" }, + { 14927, "isJuggModeJuggernaut" }, + { 14928, "tjugg_loadouts" }, + { 14929, "nextJuggTimeout" }, + { 14930, "respawnOldJugg" }, + { 14931, "rewardTeammateProximity" }, + { 14932, "logAttackers" }, + { 14933, "resetJuggLoadoutOnDisconnect" }, + { 14934, "getBestTeammate" }, + { 14935, "precacheFlag" }, + { 14936, "arenaTimeFlagWaiter" }, + { 14937, "arenaFlagWaiter" }, + { 14938, "arenaFlag" }, + { 14939, "setupDomFlag" }, + { 14940, "arena_endGame" }, + { 14941, "bombsPlanted" }, + { 14942, "ddBombModel" }, + { 14943, "spawn_defenders" }, + { 14944, "spawn_defenders_a" }, + { 14945, "spawn_defenders_b" }, + { 14946, "spawn_attackers" }, + { 14947, "spawn_attackers_a" }, + { 14948, "spawn_attackers_b" }, + { 14949, "spawn_defenders_start" }, + { 14950, "spawn_attackers_start" }, + { 14951, "aPlanted" }, + { 14952, "bPlanted" }, + { 14953, "waitToProcess" }, + { 14954, "dd_endGame" }, + { 14955, "verifyBombzones" }, + { 14956, "ddBomb" }, + { 14957, "onUseObject" }, + { 14958, "resetBombZone" }, + { 14959, "defusing" }, + { 14960, "timePauseStart" }, + { 14961, "destroyedObject" }, + { 14962, "bombHandler" }, + { 14963, "playDemolitionTickingSound" }, + { 14964, "waitTime" }, + { 14965, "setBombTimerDvar" }, + { 14966, "dropBombModel" }, + { 14967, "restartTimer" }, + { 14968, "skipWait" }, + { 14969, "isVip" }, + { 14970, "vip_endGame" }, + { 14971, "vipSelection" }, + { 14972, "setupVip" }, + { 14973, "extractionZone" }, + { 14974, "setVIPUse" }, + { 14975, "handleTimer" }, + { 14976, "extractionTime" }, + { 14977, "forceVIPSpawn" }, + { 14978, "gtnw_endGame" }, + { 14979, "useBar" }, + { 14980, "useBarText" }, + { 14981, "setupNukeSite" }, + { 14982, "nukeSite" }, + { 14983, "endGameTime" }, + { 14984, "scoreCounter" }, + { 14985, "activateNuke" }, + { 14986, "setUseBarScore" }, + { 14987, "updateHudElems" }, + { 14988, "AAMissileLaunchVert" }, + { 14989, "AAMissileLaunchHorz" }, + { 14990, "AAMissileLaunchTargetDist" }, + { 14991, "tryUseAAMissile" }, + { 14992, "getTargets" }, + { 14993, "aa_missile_fire" }, + { 14994, "AAMmissileLaunchTargetDist" }, // this is a misspelling in original script + { 14995, "teamAirDenied" }, + { 14996, "tryUseAAStrike" }, + { 14997, "cycleTargets" }, + { 14998, "findTargets" }, + { 14999, "earlyAbortWatcher" }, + { 15000, "airDeniedPlayer" }, + { 15001, "finishAAStrike" }, + { 15002, "fireAtTarget" }, + { 15003, "AASoundManager" }, + { 15006, "tweakfile" }, + { 15007, "damagetype" }, + { 15008, "audio_settings" }, + { 15107, "meleeingPlayer" }, + { 17433, "attachmentMap" }, + { 17434, "checkRoundWin" }, + { 25827, "_unk_field_ID25827" }, // was introduced in an IW patch, used in _destructible.gsc +}}; + +struct __init__ +{ + __init__() + { + static bool init = false; + if(init) return; + init = true; + + opcode_map.reserve(opcode_list.size()); + opcode_map_rev.reserve(opcode_list.size()); + function_map.reserve(function_list.size()); + function_map_rev.reserve(function_list.size()); + method_map.reserve(method_list.size()); + method_map_rev.reserve(method_list.size()); + file_map.reserve(file_list.size()); + file_map_rev.reserve(file_list.size()); + token_map.reserve(token_list.size()); + token_map_rev.reserve(token_list.size()); + + for(const auto& entry : opcode_list) + { + opcode_map.insert({ entry.key, entry.value }); + opcode_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : function_list) + { + function_map.insert({ entry.key, entry.value }); + function_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : method_list) + { + method_map.insert({ entry.key, entry.value }); + method_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : file_list) + { + file_map.insert({ entry.key, entry.value }); + file_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : token_list) + { + token_map.insert({ entry.key, entry.value }); + token_map_rev.insert({ utils::string::to_lower(entry.value), entry.key }); + } + } +}; + +__init__ _; + +} // namespace xsk::gsc::iw5 + +/* unmaped files */ + +// "character/character_mp_ally_juggernaut" +// "xmodelalias\\alias_us_army_heads" +// "character\\mp_character_us_army_assault_a" +// "character\\mp_character_us_army_assault_b" +// "character\\mp_character_us_army_assault_c" +// "character\\mp_character_us_army_lmg" +// "character\\mp_character_us_army_lmg_b" +// "character\\mp_character_us_army_lmg_c" +// "character\\mp_character_us_army_shotgun" +// "character\\mp_character_us_army_shotgun_b" +// "character\\mp_character_us_army_shotgun_c" +// "xmodelalias\\alias_us_army_riot" +// "character\\mp_character_us_army_riot" +// "character\\mp_character_us_army_smg" +// "character\\mp_character_us_army_smg_b" +// "character\\mp_character_us_army_smg_c" +// "character\\mp_character_us_army_sniper" +// "xmodelalias\\alias_opforce_arctic_heads" +// "character\\mp_character_opforce_arctic_assault_a" +// "character\\mp_character_opforce_arctic_assault_b" +// "character\\mp_character_opforce_arctic_assault_c" +// "character\\mp_character_opforce_arctic_lmg" +// "character\\mp_character_opforce_arctic_lmg_b" +// "character\\mp_character_opforce_arctic_lmg_c" +// "character\\mp_character_opforce_arctic_shotgun" +// "character\\mp_character_opforce_arctic_shotgun_b" +// "character\\mp_character_opforce_arctic_shotgun_c" +// "character\\mp_character_opforce_arctic_smg" +// "character\\mp_character_opforce_arctic_smg_b" +// "character\\mp_character_opforce_arctic_smg_c" +// "character\\mp_character_op_arctic_sniper" +// "character\\mp_character_op_arctic_riot" +// "xmodelalias\\alias_seal_udt_heads" +// "character\\mp_character_seal_udt_assault_a" +// "character\\mp_character_seal_udt_lmg" +// "character\\mp_character_seal_udt_assault_b" +// "character\\mp_character_seal_udt_smg" +// "character\\mp_character_seal_udt_sniper" +// "character\\mp_character_udt_riot" +// "xmodelalias\\alias_opforce_arab_heads" +// "character\\mp_character_composite_assault_a" +// "character\\mp_character_composite_lmg" +// "character\\mp_character_composite_shotgun" +// "character\\mp_character_composite_smg" +// "character\\mp_character_op_arab_sniper" +// "character\\mp_character_op_arab_riot" +// "xmodelalias\\alias_airborne_heads" +// "character\\mp_character_airborne_assault_a" +// "character\\mp_character_airborne_assault_b" +// "character\\mp_character_airborne_assault_c" +// "character\\mp_character_airborne_lmg" +// "character\\mp_character_airborne_lmg_b" +// "character\\mp_character_airborne_lmg_c" +// "character\\mp_character_airborne_shotgun" +// "character\\mp_character_airborne_shotgun_b" +// "character\\mp_character_airborne_shotgun_c" +// "character\\mp_character_airborne_smg" +// "character\\mp_character_airborne_smg_b" +// "character\\mp_character_airborne_smg_c" +// "character\\mp_character_op_airborne_sniper" +// "character\\mp_character_op_airborne_riot" +// "xmodelalias\\alias_opforce_militia_heads_blk" +// "xmodelalias\\alias_opforce_militia_heads_wht" +// "character\\mp_character_militia_assault_aa_blk" +// "character\\mp_character_militia_assault_aa_wht" +// "character\\mp_character_militia_assault_ab_blk" +// "character\\mp_character_militia_assault_ac_blk" +// "character\\mp_character_militia_lmg_aa_blk" +// "character\\mp_character_militia_lmg_ab_blk" +// "character\\mp_character_militia_lmg_ac_blk" +// "character\\mp_character_militia_shotgun_aa_blk" +// "character\\mp_character_militia_shotgun_aa_wht" +// "character\\mp_character_militia_smg_aa_blk" +// "character\\mp_character_militia_smg_aa_wht" +// "character\\mp_character_militia_smg_ab_blk" +// "character\\mp_character_militia_smg_ac_blk" +// "character\\mp_character_op_militia_sniper" +// "character\\mp_character_op_militia_riot" +// "xmodelalias\\alias_tf141_heads_arctic" +// "character\\mp_character_tf_141_arctic_assault_a" +// "character\\mp_character_tf_141_arctic_assault_b" +// "character\\mp_character_tf_141_arctic_lmg" +// "character\\mp_character_tf_141_arctic_shotgun" +// "character\\mp_character_tf_141_arctic_smg" +// "character\\mp_character_tf141_arctic_sniper" +// "character\\mp_character_tf141_arctic_riot" +// "xmodelalias\\alias_tf141_heads_desert" +// "character\\mp_character_tf_141_desert_assault_a" +// "character\\mp_character_tf_141_desert_assault_b" +// "character\\mp_character_tf_141_desert_lmg" +// "character\\mp_character_tf_141_desert_shotgun" +// "character\\mp_character_tf_141_desert_smg" +// "character\\mp_character_tf141_desert_sniper" +// "character\\mp_character_tf141_desert_riot" +// "xmodelalias\\alias_tf141_heads_forest" +// "character\\mp_character_tf_141_forest_assault_a" +// "character\\mp_character_tf_141_forest_assault_b" +// "character\\mp_character_tf_141_forest_lmg" +// "character\\mp_character_tf_141_forest_shotgun" +// "character\\mp_character_tf_141_forest_smg" +// "character\\mp_character_tf141_forest_sniper" +// "character\\mp_character_tf141_forest_riot" +// "xmodelalias\\alias_delta_heads" +// "xmodelalias\\alias_delta_heads_longsleeves" +// "character\\mp_character_delta_urban_assault_a" +// "character\\mp_character_delta_urban_assault_b" +// "character\\mp_character_delta_urban_lmg_a" +// "character\\mp_character_delta_urban_lmg_b" +// "character\\mp_character_delta_urban_shotgun" +// "character\\mp_character_delta_urban_smg_a" +// "character\\mp_character_delta_urban_smg_b" +// "character\\mp_character_delta_urban_smg_c" +// "character\\mp_character_delta_urban_riot" +// "mptype\\mptype_us_army_assault" +// "mptype\\mptype_us_army_lmg" +// "mptype\\mptype_us_army_shotgun" +// "mptype\\mptype_us_army_riot" +// "mptype\\mptype_us_army_smg" +// "mptype\\mptype_us_army_sniper" +// "mptype\\mptype_opforce_arctic_assault" +// "mptype\\mptype_opforce_arctic_lmg" +// "mptype\\mptype_opforce_arctic_shotgun" +// "mptype\\mptype_opforce_arctic_smg" +// "mptype\\mptype_opforce_arctic_sniper" +// "mptype\\mptype_opforce_arctic_riot" +// "mptype\\mptype_seal_udt_assault" +// "mptype\\mptype_seal_udt_lmg" +// "mptype\\mptype_seal_udt_shotgun" +// "mptype\\mptype_seal_udt_smg" +// "mptype\\mptype_seal_udt_sniper" +// "mptype\\mptype_seal_udt_riot" +// "mptype\\mptype_opforce_comp_assault" +// "mptype\\mptype_opforce_comp_lmg" +// "mptype\\mptype_opforce_comp_shotgun" +// "mptype\\mptype_opforce_comp_smg" +// "mptype\\mptype_opforce_comp_sniper" +// "mptype\\mptype_opforce_comp_riot" +// "character\\mp_character_composite_sniper" +// "mptype\\mptype_opforce_airborne_assault" +// "mptype\\mptype_opforce_airborne_lmg" +// "mptype\\mptype_opforce_airborne_shotgun" +// "mptype\\mptype_opforce_airborne_smg" +// "mptype\\mptype_opforce_airborne_sniper" +// "mptype\\mptype_opforce_airborne_riot" +// "mptype\\mptype_opforce_militia_assault" +// "mptype\\mptype_opforce_militia_lmg" +// "mptype\\mptype_opforce_militia_shotgun" +// "mptype\\mptype_opforce_militia_smg" +// "mptype\\mptype_opforce_militia_sniper" +// "mptype\\mptype_opforce_militia_riot" +// "mptype\\mptype_tf141_arctic_assault" +// "mptype\\mptype_tf141_arctic_lmg" +// "mptype\\mptype_tf141_arctic_shotgun" +// "mptype\\mptype_tf141_arctic_smg" +// "mptype\\mptype_tf141_arctic_sniper" +// "mptype\\mptype_tf141_arctic_riot" +// "mptype\\mptype_tf141_desert_assault" +// "mptype\\mptype_tf141_desert_lmg" +// "mptype\\mptype_tf141_desert_shotgun" +// "mptype\\mptype_tf141_desert_smg" +// "mptype\\mptype_tf141_desert_sniper" +// "mptype\\mptype_tf141_desert_riot" +// "mptype\\mptype_tf141_forest_assault" +// "mptype\\mptype_tf141_forest_lmg" +// "mptype\\mptype_tf141_forest_shotgun" +// "mptype\\mptype_tf141_forest_smg" +// "mptype\\mptype_tf141_forest_sniper" +// "mptype\\mptype_tf141_forest_riot" +// "mptype\\mptype_delta_ucp_assault" +// "mptype\\mptype_delta_ucp_lmg" +// "mptype\\mptype_delta_ucp_shotgun" +// "mptype\\mptype_delta_ucp_smg" +// "mptype\\mptype_delta_ucp_sniper" +// "mptype\\mptype_delta_ucp_riot" +// "character\\mp_character_delta_urban_assault_c" +// "vehicle_scripts\\_empty" +// "maps\\_breach" +// "maps\\_briefing" +// "maps\\_cagedchickens" +// "maps\\_carry_ai" +// "maps\\_deadbody" +// "maps\\_drone_ai" +// "maps\\_drone_civilian" +// "maps\\_flare" +// "maps\\_flashbang" +// "maps\\_float" +// "maps\\_heli_ride" +// "maps\\_hiding_door_anims" +// "maps\\_hud_weapons" +// "maps\\_inventory" +// "maps\\_leak" +// "maps\\_menus" +// "maps\\_shellshock" +// "maps\\_mortar" +// "maps\\_overheat" +// "maps\\_props" +// "maps\\_radiation" +// "maps\\_sea" +// "maps\\_stealth_utility" +// "maps\\_stealth_shared_utilities" +// "maps\\_stealth_animation_funcs" +// "maps\\_stealth_threat_enemy" +// "maps\\_stealth_visibility_enemy" +// "maps\\_stealth_visibility_friendly" +// "maps\\_stealth_behavior_friendly" +// "maps\\_stealth_behavior_enemy" +// "maps\\_stealth_corpse_enemy" +// "maps\\_stealth_corpse_system" +// "maps\\_stealth_event_enemy" +// "maps\\_stealth_color_friendly" +// "maps\\_stealth_accuracy_friendly" +// "maps\\_stealth_smartstance_friendly" +// "maps\\_stealth_visibility_system" +// "maps\\_stealth_vehicle" +// "maps\\_treeburst" +// "maps\\_vehicle_missile" +// "maps\\_vehicle_spline" +// "maps\\_vehicledrive" +// "maps\\_weather" +// "maps\\_wood" +// "maps\\_audio_presets_music" +// "maps\\_shg_common" +// "xmodelalias\\alias_so_martyrdom_smg_bodies" +// "character\\character_so_martyrdom" +// "xmodelalias\\alias_africa_militia_heads_a" +// "xmodelalias\\alias_africa_militia_hats_a" +// "xmodelalias\\alias_africa_militia_hats_b" +// "xmodelalias\\alias_africa_militia_hats_c" +// "character\\character_africa_militia_smg_a" +// "character\\character_africa_militia_smg_b" +// "character\\character_africa_militia_smg_c" +// "xmodelalias\\alias_so_regular_smg_heads" +// "character\\character_so_regular_smg" +// "maps\\_rambo" +// "xmodelalias\\alias_so_veteran_ar_heads" +// "character\\character_so_veteran_ar" +// "character\\character_sp_juggernaut" +// "maps\\_juggernaut" +// "character\\character_so_juggernaut_mid" +// "maps\\_riotshield" +// "character\\character_so_juggernaut_explosive" +// "character\\character_so_juggernaut_headshot" +// "xmodelalias\\alias_chemwar_russian_heads_masked" +// "character\\character_chemwar_russian_assault_a" +// "character\\character_chemwar_russian_assault_m_b" +// "character\\character_chemwar_russian_assault_m_c" +// "character\\character_chemwar_russian_assault_m_d" +// "character\\character_chemwar_russian_assault_m_e" +// "character\\character_chemwar_russian_assault_aa" +// "character\\character_chemwar_russian_assault_m_bb" +// "character\\character_chemwar_russian_assault_m_cc" +// "character\\character_chemwar_russian_assault_m_dd" +// "character\\character_chemwar_russian_assault_m_ee" +// "xmodelalias\\alias_so_russian_naval_bodies" +// "xmodelalias\\alias_russian_naval_heads" +// "character\\character_so_russian_naval_assault" +// "xmodelalias\\alias_chemwar_russian_heads_so" +// "character\\character_chemwar_m_d_so" +// "character\\character_chemwar_m_dd_so" +// "xmodelalias\\alias_so_hardened_ar_heads" +// "character\\character_so_hardened_ar" +// "character\\character_gign_paris_smg" +// "character\\character_gign_paris_assault" +// "character\\character_delta_elite_assault_aa" +// "character\\character_delta_elite_assault_ab" +// "character\\character_delta_elite_assault_ba" +// "character\\character_delta_elite_assault_bb" +// "character\\character_sp_german_sheperd_dog" +// "maps\\_utility_joec" +// "maps\\_squad_enemies" +// "maps\\_sp_killstreaks" +// "maps\\_remotemissile_utility" +// "maps\\_remotemissile" +// "maps\\_sp_airdrop" +// "maps\\_so_survival_perks" +// "common_scripts\\_sentry" +// "maps\\_sp_airstrike" +// "maps\\_so_survival_code" +// "maps\\_chopperboss" +// "maps\\_so_survival_loot" +// "maps\\_so_survival_ai" +// "vehicle_scripts\\_mi17_noai" +// "vehicle_scripts\\_littlebird" +// "vehicle_scripts\\_ucav" +// "vehicle_scripts\\_mi17" +// "vehicle_scripts\\_blackhawk" +// "maps\\_air_support_strobe" +// "maps\\_so_survival" +// "maps\\_so_survival_armory" +// "maps\\_so_survival_challenge" +// "maps\\_so_survival_dialog" +// "vehicle_scripts\\_littlebird_player" +// "maps\\_shg_fx" +// "maps\\createart\\ny_manhattan_fog" +// "maps\\createart\\ny_manhattan_art" +// SCR_OPAQUE_FILE3_maps_cinematic_setups_nym_hind_finale = 0x295, +// SCR_OPAQUE_FILE3_maps_cinematic_setups_nym_sewer_exit = 0x296, +// "maps\\_c4" +// "xmodelalias\\alias_russian_military_manhattan_heads" +// "character\\character_opforce_manhattan_assault_a" +// "character\\character_russian_military_rpg_a" +// "character\\character_opforce_manhattan_shgn_a" +// "character\\character_opforce_manhattan_lmg_a" +// "xmodelalias\\alias_rangers_heads" +// "character\\character_rangers_bdu_assault_a" +// "xmodelalias\\alias_air_crew_heads" +// "character\\character_air_crew_manhattan" +// "character\\character_opforce_manhattan_rpg_a" +// "character\\character_delta_elite_smg_a" +// "character\\character_delta_elite_smg_b" +// "maps\\_minigun_viewmodel" +// "maps\\_minigun" +// "maps\\createfx\\ny_manhattan_fx" +// "vehicle_scripts\\_gaz_dshk" +// "vehicle_scripts\\_hind" +// "vehicle_scripts\\_ss_n_12" +// "maps\\animated_models\\fence_tarp_108x76_med_01" +// "maps\\animated_models\\fence_tarp_132x82_med_01" +// "maps\\_predator2" +// "maps\\_xm25" +// "vehicle_scripts\\_blackhawk_minigun" +// "vehicle_scripts\\_stryker50cal" +// "character\\character_opforce_rushwood_assault_a" +// "maps\\createart\\so_survival_mp_dome_art" +// "character\\character_so_juggernaut_lite" +// "xmodelalias\\alias_russian_naval_bodies" +// "vehicle_scripts\\_submarine_sdv" +// "vehicle_scripts\\_super_dvora" +// "vehicle_scripts\\_zodiac" +// "maps\\_ocean" +// "vehicle_scripts\\_zubr" +// "character\\character_sp_opforce_e" +// "character\\character_sp_opforce_f" +// "character\\character_sp_opforce_derik" +// "character\\character_opforce_rushwood_ass_dust_a" +// "character\\character_opforce_rushwood_smg_dust_a" +// "maps\\createart\\berlin_fog" +// "xmodelalias\\alias_russian_military_gasmask_heads" +// "character\\character_opforce_paris_gasmask" +// "maps\\createart\\so_jeep_paris_b_fog" +// "maps\\createart\\so_jeep_paris_b_art" +// "vehicle_scripts\\_mig29" +// "vehicle_scripts\\_t72" +// "vehicle_scripts\\_btr80" +// "maps\\createfx\\prague_fx" +// "maps\\_stealth_anims" +// "maps\\_idle_lean_smoke" +// "maps\\_idle_sleep" +// "maps\\_idle_smoke_balcony" +// "vehicle_scripts\\_technical_aa" +// "vehicle_scripts\\_technical_payback" +// "maps\\animated_models\\highrise_fencetarp_03" +// "maps\\createart\\so_littlebird_payback_fog" +// "vehicle_scripts\\_uk_delivery_truck" +// "vehicle_scripts\\_uk_utility_truck" +// "maps\\createart\\london_art" +// "maps\\_nightvision" +// "maps\\createart\\so_timetrial_london_art" +// "character\\character_fso_vest_nopacks_alt" +// "maps\\createart\\hijack_art" +// "character\\character_africa_militia_assault_a" +// "character\\character_africa_militia_assault_b" +// "character\\character_africa_militia_rpg_a" +// "maps\\_stinger" +// "vehicle_scripts\\_cobra" +// "character\\character_opforce_rescue_assault_b" +// "character\\character_hero_delta_sandman" +// "character\\character_delta_elite_snow_assault_aa" +// "vehicle_scripts\\_bm21" +// "xmodelalias\\alias_henchmen_heads" +// "maps\\_javelin" +// "common_scripts\\_destructible_types_anim_prop_radar_maz" +// "character\\character_hero_africa_price" +// "maps\\_slowmo_breach_payback" +// "maps\\_underwater_debris" +// "character\\character_hero_delta_sandman_udt" +// "vehicle_scripts\\_russian_torpedo" +// "maps\\_credits" +// "maps\\createart\\paris_a_art" +// diff --git a/src/iw5/xsk/resolver.hpp b/src/iw5/xsk/resolver.hpp new file mode 100644 index 00000000..2727428d --- /dev/null +++ b/src/iw5/xsk/resolver.hpp @@ -0,0 +1,33 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::iw5 +{ + +class resolver +{ +public: + static auto opcode_id(const std::string& name) -> std::uint8_t; + static auto opcode_name(std::uint8_t id) -> std::string; + + static auto function_id(const std::string& name) -> std::uint16_t; + static auto function_name(std::uint16_t id) -> std::string; + + static auto method_id(const std::string& name) -> std::uint16_t; + static auto method_name(std::uint16_t id) -> std::string; + + static auto file_id(const std::string& name) -> std::uint16_t; + static auto file_name(std::uint16_t id) -> std::string; + + static auto token_id(const std::string& name) -> std::uint16_t; + static auto token_name(std::uint16_t id) -> std::string; + + static auto find_function(const std::string& name) -> bool; + static auto find_method(const std::string& name) -> bool; +}; + +} // namespace xsk::gsc::iw5 diff --git a/src/iw6/stdafx.cpp b/src/iw6/stdafx.cpp new file mode 100644 index 00000000..0f0f08c2 --- /dev/null +++ b/src/iw6/stdafx.cpp @@ -0,0 +1,6 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" diff --git a/src/iw6/stdafx.hpp b/src/iw6/stdafx.hpp new file mode 100644 index 00000000..0a737729 --- /dev/null +++ b/src/iw6/stdafx.hpp @@ -0,0 +1,38 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +// Warnings +#ifdef _WIN32 +#pragma warning(disable:4244) +#pragma warning(disable:4267) +#pragma warning(disable:4005) +#pragma warning(disable:4065) +#define _CRT_SECURE_NO_WARNINGS +#endif + +// C/C++ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Ext +using namespace std::literals; + +#include "xsk/iw6.hpp" diff --git a/src/iw6/xsk/assembler.cpp b/src/iw6/xsk/assembler.cpp new file mode 100644 index 00000000..c30fb59e --- /dev/null +++ b/src/iw6/xsk/assembler.cpp @@ -0,0 +1,603 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw6.hpp" + +namespace xsk::gsc::iw6 +{ + +auto assembler::output_script() -> std::vector +{ + std::vector script; + + if(script_ == nullptr) return script; + + script.resize(script_->pos()); + memcpy(script.data(), script_->buffer().data(), script.size()); + + return script; +} + +auto assembler::output_stack() -> std::vector +{ + std::vector stack; + + if(stack_ == nullptr) return stack; + + stack.resize(stack_->pos()); + memcpy(stack.data(), stack_->buffer().data(), stack.size()); + + return stack; +} + +void assembler::assemble(const std::string& file, std::vector& data) +{ + std::vector assembly = utils::string::clean_buffer_lines(data); + std::vector functions; + gsc::function_ptr func = nullptr; + std::uint32_t index = 1; + std::uint16_t switchnum = 0; + + for (auto& line : assembly) + { + if (line == "" || line.substr(0, 2) == "//") + { + continue; + } + else if (line.substr(0, 4) == "sub_") + { + func = std::make_unique(); + func->index = index; + func->name = line.substr(4); + } + else if (line.substr(0, 4) == "end_") + { + if (func != nullptr) + { + func->size = index - func->index; + functions.push_back(std::move(func)); + } + } + else if (line.substr(0, 4) == "loc_") + { + func->labels[index] = line; + } + else + { + auto data = utils::string::parse_code(line); + + if (switchnum) + { + if (data[0] == "case" || data[0] == "default") + { + for (auto& entry : data) + { + func->instructions.back()->data.push_back(entry); + } + switchnum--; + continue; + } + + throw gsc::asm_error("invalid instruction inside endswitch \""s + line + "\"!"); + } + else + { + auto inst = std::make_unique(); + inst->index = index; + inst->opcode = static_cast(resolver::opcode_id(data[0])); + inst->size = opcode_size(inst->opcode); + data.erase(data.begin()); + inst->data = std::move(data); + + if (opcode(inst->opcode) == opcode::OP_endswitch) + { + switchnum = static_cast(std::stoul(inst->data[0])); + inst->size += 7 * switchnum; + } + + index += inst->size; + func->instructions.push_back(std::move(inst)); + } + } + } + + this->assemble(file, functions); +} + +void assembler::assemble(const std::string& file, std::vector& functions) +{ + script_ = std::make_unique(0x100000); + stack_ = std::make_unique(0x100000); + filename_ = file; + functions_ = std::move(functions); + + script_->write(static_cast(opcode::OP_End)); + stack_->write(0x69773630); + + for (const auto& func : functions_) + { + this->assemble_function(func); + } +} + +void assembler::assemble_function(const gsc::function_ptr& func) +{ + labels_ = func->labels; + + stack_->write(func->size); + + func->id = func->name.substr(0, 3) == "_ID" ? std::stoul(func->name.substr(3)) : resolver::token_id(func->name); + stack_->write(func->id); + + if (func->id == 0) + { + stack_->write_c_string(func->name); + } + + for (const auto& inst : func->instructions) + { + this->assemble_instruction(inst); + } +} + +void assembler::assemble_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_Return: + case opcode::OP_BoolNot: + case opcode::OP_CastBool: + case opcode::OP_inequality: + case opcode::OP_GetThisthread: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_checkclearparams: + case opcode::OP_CastFieldObject: + case opcode::OP_End: + case opcode::OP_size: + case opcode::OP_EmptyArray: + case opcode::OP_bit_and: + case opcode::OP_less_equal: + case opcode::OP_voidCodepos: + case opcode::OP_ClearVariableField: + case opcode::OP_divide: + case opcode::OP_GetSelf: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_plus: + case opcode::OP_BoolComplement: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_inc: + case opcode::OP_clearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_endon: + case opcode::OP_greater_equal: + case opcode::OP_GetSelfObject: + case opcode::OP_SetVariableField: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_less: + case opcode::OP_GetGameRef: + case opcode::OP_waittillFrameEnd: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_notify: + case opcode::OP_DecTop: + case opcode::OP_shift_left: + case opcode::OP_greater: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_minus: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_multiply: + case opcode::OP_mod: + case opcode::OP_GetGame: + case opcode::OP_waittill: + case opcode::OP_dec: + case opcode::OP_PreScriptCall: + case opcode::OP_GetAnim: + case opcode::OP_GetUndefined: + case opcode::OP_GetAnimObject: + case opcode::OP_GetLevelObject: + case opcode::OP_bit_ex_or: + case opcode::OP_equality: + case opcode::OP_ClearArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalArray: + case opcode::OP_vector: + case opcode::OP_bit_or: + case opcode::OP_AddArray: + case opcode::OP_waittillmatch2: + case opcode::OP_shift_right: + script_->write(static_cast(inst->opcode)); + break; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetInteger: + script_->write(static_cast(inst->opcode)); + script_->write(std::stoi(inst->data[0])); + break; + case opcode::OP_GetFloat: + script_->write(static_cast(inst->opcode)); + script_->write(std::stof(inst->data[0])); + break; + case opcode::OP_GetVector: + script_->write(static_cast(inst->opcode)); + script_->write(std::stof(inst->data[0])); + script_->write(std::stof(inst->data[1])); + script_->write(std::stof(inst->data[2])); + break; + case opcode::OP_GetString: + case opcode::OP_GetIString: + script_->write(static_cast(inst->opcode)); + script_->write(0); + stack_->write_c_string(utils::string::to_code(inst->data[0])); + break; + case opcode::OP_GetAnimation: + script_->write(static_cast(inst->opcode)); + script_->write(0); + script_->write(0); + stack_->write_c_string(utils::string::unquote(inst->data[0])); + stack_->write_c_string(utils::string::unquote(inst->data[1])); + break; + case opcode::OP_GetAnimTree: + script_->write(static_cast(inst->opcode)); + script_->write(0); + stack_->write_c_string(utils::string::unquote(inst->data[0])); + break; + case opcode::OP_waittillmatch: + script_->write(static_cast(inst->opcode)); + script_->write(0); + break; + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_EvalLocalArrayCached: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + this->assemble_field_variable(inst); + break; + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + this->assemble_local_call(inst, false); + break; + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + this->assemble_local_call(inst, true); + break; + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + this->assemble_far_call(inst, false); + break; + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + this->assemble_far_call(inst, true); + break; + case opcode::OP_CallBuiltin: + this->assemble_builtin_call(inst, false, true); + break; + case opcode::OP_CallBuiltinMethod: + this->assemble_builtin_call(inst, true, true); + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + this->assemble_builtin_call(inst, false, false); + break; + case opcode::OP_GetBuiltinMethod: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + this->assemble_builtin_call(inst, true, false); + break; + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + this->assemble_jump(inst, true, false); + break; + case opcode::OP_jumpback: + this->assemble_jump(inst, false, true); + break; + case opcode::OP_jump: + this->assemble_jump(inst, false, false); + break; + case opcode::OP_switch: + this->assemble_switch(inst); + break; + case opcode::OP_endswitch: + this->assemble_end_switch(inst); + break; + default: + throw gsc::asm_error(utils::string::va("Unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); + } +} + +void assembler::assemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num) +{ + script_->write(static_cast(inst->opcode)); + + std::uint16_t id = 0; + + if (arg_num) + { + script_->write(static_cast(std::stol(inst->data[0]))); + + if (method) + id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::method_id(inst->data[1]); + else + id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::function_id(inst->data[1]); + } + else + { + if (method) + id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::method_id(inst->data[0]); + else + id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::function_id(inst->data[0]); + } + + script_->write(id); +} + +void assembler::assemble_local_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_function(inst->data[0]); + + std::int32_t offset = addr - inst->index - 1; + + this->assemble_offset(offset); + + if (thread) + { + script_->write(static_cast(std::stol(inst->data[1]))); + } +} + +void assembler::assemble_far_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->write(static_cast(inst->opcode)); + script_->write(0); + script_->write(0); + + std::uint16_t file_id = 0; + std::uint16_t func_id = 0; + + if (thread) + { + script_->write(static_cast(std::stol(inst->data[0]))); + + file_id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::file_id(inst->data[1]); + func_id = inst->data[2].substr(0, 3) == "_ID" ? std::stol(inst->data[2].substr(3)) : resolver::token_id(inst->data[2]); + } + else + { + file_id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::file_id(inst->data[0]); + func_id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::token_id(inst->data[1]); + } + + stack_->write(file_id); + if (file_id == 0) stack_->write_c_string(thread ? inst->data[1] : inst->data[0]); + stack_->write(func_id); + if (func_id == 0) stack_->write_c_string(thread ? inst->data[2] : inst->data[1]); +} + +void assembler::assemble_switch(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_label(inst->data[0]); + + script_->write(addr - inst->index - 4); +} + +void assembler::assemble_end_switch(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::uint16_t casenum = 0; + + if (utils::string::is_number(inst->data[0])) + { + casenum = std::stol(inst->data[0]); + } + else + { + throw gsc::asm_error("invalid endswitch number!"); + } + + script_->write(casenum); + + std::uint32_t internal_index = inst->index + 3; + + for (std::uint16_t i = 0; i < casenum; i++) + { + if (inst->data[1 + (3 * i)] == "case") + { + if (utils::string::is_number(inst->data[1 + (3 * i) + 1])) + { + script_->write((std::stol(inst->data[1 + (3 * i) + 1]) & 0xFFFFFF) + 0x800000); + } + else + { + script_->write(i + 1); + stack_->write_c_string(utils::string::unquote(inst->data[1 + (3 * i) + 1])); + } + + internal_index += 4; + + std::int32_t addr = this->resolve_label(inst->data[1 + (3 * i) + 2]); + + this->assemble_offset(addr - internal_index); + + internal_index += 3; + } + else if (inst->data[1 + (3 * i)] == "default") + { + script_->write(0); + stack_->write_c_string("\x01"); + + internal_index += 4; + std::int32_t addr = this->resolve_label(inst->data[1 + (3 * i) + 1]); + + this->assemble_offset(addr - internal_index); + + internal_index += 3; + } + } +} + +void assembler::assemble_field_variable(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::uint16_t field_id = 0; + + if (inst->data[0].substr(0, 3) == "_ID") + { + field_id = (std::uint16_t)std::stol(inst->data[0].substr(3)); + } + else + { + field_id = resolver::token_id(inst->data[0]); + + if (field_id == 0) + { + field_id = 0xFFFF; + } + } + + script_->write(field_id); + + if (field_id > 38305) + { + stack_->write(0); + stack_->write_c_string(inst->data[0]); + } +} + +void assembler::assemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_label(inst->data[0]); + + if (expr) + { + script_->write(addr - inst->index - 3); + } + else if (back) + { + script_->write((inst->index + 3) - addr); + } + else + { + script_->write(addr - inst->index - 5); + } +} + +void assembler::assemble_offset(std::int32_t offset) +{ + std::array bytes = {}; + + offset = (offset << 10) >> 8; + + *reinterpret_cast(bytes.data()) = offset; + + script_->write(bytes[0]); + script_->write(bytes[1]); + script_->write(bytes[2]); +} + +auto assembler::resolve_function(const std::string& name) -> std::uint32_t +{ + auto temp = name.substr(0, 4) == "sub_" ? name.substr(4) : name; + + for (const auto& func : functions_) + { + if (func->name == temp) + { + return func->index; + } + } + + throw gsc::asm_error("Couldn't resolve local function address of '" + temp + "'!"); +} + +auto assembler::resolve_label(const std::string& name) -> std::uint32_t +{ + for (auto& func : labels_) + { + if (func.second == name) + { + return func.first; + } + } + + throw gsc::asm_error("Couldn't resolve label address of '" + name + "'!"); +} + +} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/assembler.hpp b/src/iw6/xsk/assembler.hpp new file mode 100644 index 00000000..f7738869 --- /dev/null +++ b/src/iw6/xsk/assembler.hpp @@ -0,0 +1,40 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::iw6 +{ + +class assembler : public gsc::assembler +{ + std::string filename_; + utils::byte_buffer_ptr script_; + utils::byte_buffer_ptr stack_; + std::vector functions_; + std::unordered_map labels_; + +public: + auto output_script() -> std::vector; + auto output_stack() -> std::vector; + void assemble(const std::string& file, std::vector& data); + void assemble(const std::string& file, std::vector& functions); + +private: + void assemble_function(const gsc::function_ptr& func); + void assemble_instruction(const gsc::instruction_ptr& inst); + void assemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num); + void assemble_local_call(const gsc::instruction_ptr& inst, bool thread); + void assemble_far_call(const gsc::instruction_ptr& inst, bool thread); + void assemble_switch(const gsc::instruction_ptr& inst); + void assemble_end_switch(const gsc::instruction_ptr& inst); + void assemble_field_variable(const gsc::instruction_ptr& inst); + void assemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back); + void assemble_offset(std::int32_t offset); + auto resolve_function(const std::string& name) -> std::uint32_t; + auto resolve_label(const std::string& name) -> std::uint32_t; +}; + +} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/compiler.cpp b/src/iw6/xsk/compiler.cpp new file mode 100644 index 00000000..56bf5acf --- /dev/null +++ b/src/iw6/xsk/compiler.cpp @@ -0,0 +1,2289 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw6.hpp" +#include "parser.hpp" +#include "lexer.hpp" + +namespace xsk::gsc::iw6 +{ + +auto compiler::output() -> std::vector +{ + return std::move(assembly_); +} + +void compiler::compile(const std::string& file, std::vector& data) +{ + filename_ = file; + + auto result = parse_buffer(filename_, data); + + compile_program(result); +} + +void compiler::set_readf_callback(std::function(const std::string&)> func) +{ + callback_readf_ = func; +} + +auto compiler::parse_buffer(const std::string& file, std::vector& data) -> gsc::program_ptr +{ + yyscan_t scanner; + gsc::location loc; + gsc::program_ptr result(nullptr); + + loc.initialize(&file); + // Add the two NULL terminators, required by flex. + data.push_back(0); + data.push_back(0); + + if (iw6_lex_init(&scanner)) + exit(1); + + YY_BUFFER_STATE yybuffer = iw6__scan_buffer(reinterpret_cast(data.data()), data.size(), scanner); + + parser parser(scanner, loc, result); + + if(parser.parse() || result == nullptr) + { + throw gsc::comp_error(loc, "An unknown error ocurred while parsing gsc file."); + } + + iw6__delete_buffer(yybuffer, scanner); + iw6_lex_destroy(scanner); + + return result; +} + +auto compiler::parse_file(const std::string& file) -> gsc::program_ptr +{ + auto buffer = callback_readf_(file); + auto result = parse_buffer(file, buffer); + + return result; +} + +void compiler::compile_program(const gsc::program_ptr& program) +{ + assembly_.clear(); + includes_.clear(); + animtrees_.clear(); + constants_.clear(); + local_functions_.clear(); + index_ = 1; + + for(const auto& def : program->definitions) + { + if(def.as_node->type == gsc::node_t::thread) + { + local_functions_.push_back(def.as_thread->name->value); + } + } + + for(const auto& include : program->includes) + { + emit_include(include); + } + + for(const auto& def : program->definitions) + { + emit_define(def); + } + +#ifdef DEBUG_GSC_COMPILER + print_debug_info(); +#endif +} + +void compiler::emit_include(const gsc::include_ptr& include) +{ + const auto& path = include->file->value; + + for(const auto& inc : includes_) + { + if(inc.name == path) + { + throw gsc::comp_error(include->loc, "error duplicated include file '" + path + "'."); + } + } + + if(map_known_includes(path)) return; + + try + { + auto program = parse_file(path); + + std::vector funcs; + + for(const auto& def : program->definitions) + { + if(def.as_node->type == gsc::node_t::thread) + { + funcs.push_back(def.as_thread->name->value); + } + } + + if(funcs.size() == 0) + { + throw gsc::comp_error(include->loc, "error empty include file '" + path + "'."); + } + + includes_.push_back(include_t(path, funcs)); + } + catch(const std::exception& e) + { + throw gsc::comp_error(include->loc, "error parsing include file '" + path + "': " + e.what()); + } +} + +void compiler::emit_define(const gsc::define_ptr& define) +{ + switch(define.as_node->type) + { + case gsc::node_t::usingtree: emit_usingtree(define.as_usingtree); break; + case gsc::node_t::constant: emit_constant(define.as_constant); break; + case gsc::node_t::thread: emit_thread(define.as_thread); break; + default: break; + } +} + +void compiler::emit_usingtree(const gsc::usingtree_ptr& animtree) +{ + animtrees_.push_back({ animtree->animtree->value, false }); +} + +void compiler::emit_constant(const gsc::constant_ptr& constant) +{ + constants_.insert({ constant->name->value, std::move(constant->value) }); +} + +void compiler::emit_thread(const gsc::thread_ptr& thread) +{ + function_ = std::make_unique(); + function_->index = index_; + function_->name = thread->name->value; + + auto ctx = std::make_unique(); + stack_idx_ = 0; + label_idx_ = 0; + can_break_ = false; + can_continue_ = false; + local_stack_.clear(); + break_ctxs_.clear(); + continue_ctxs_.clear(); + + process_thread(ctx, thread); + + emit_parameters(ctx, thread->params); + emit_stmt_list(ctx, thread->block, true); + emit_opcode(ctx, opcode::OP_End); + + function_->size = index_ - function_->index; + assembly_.push_back(std::move(function_)); +} + +void compiler::emit_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + initialize_variable(ctx, param); + emit_opcode(ctx, opcode::OP_SafeCreateVariableFieldCached, variable_create_index(ctx, param)); + } + + emit_opcode(ctx, opcode::OP_checkclearparams); +} + +void compiler::emit_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt, bool last) +{ + switch(stmt.as_node->type) + { + case gsc::node_t::stmt_list: emit_stmt_list(ctx, stmt.as_list, last); break; + case gsc::node_t::stmt_call: emit_stmt_call(ctx, stmt.as_call); break; + case gsc::node_t::stmt_assign: emit_stmt_assign(ctx, stmt.as_assign); break; + case gsc::node_t::stmt_endon: emit_stmt_endon(ctx, stmt.as_endon); break; + case gsc::node_t::stmt_notify: emit_stmt_notify(ctx, stmt.as_notify); break; + case gsc::node_t::stmt_wait: emit_stmt_wait(ctx, stmt.as_wait); break; + case gsc::node_t::stmt_waittill: emit_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_waittillmatch: emit_stmt_waittillmatch(ctx, stmt.as_waittillmatch); break; + case gsc::node_t::stmt_waittillframeend: emit_stmt_waittillframeend(ctx, stmt.as_waittillframeend); break; + case gsc::node_t::stmt_if: emit_stmt_if(ctx, stmt.as_if, last); break; + case gsc::node_t::stmt_ifelse: emit_stmt_ifelse(ctx, stmt.as_ifelse, last); break; + case gsc::node_t::stmt_while: emit_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: emit_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: emit_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: emit_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_case: emit_stmt_case(ctx, stmt.as_case); break; + case gsc::node_t::stmt_default: emit_stmt_default(ctx, stmt.as_default); break; + case gsc::node_t::stmt_break: emit_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_continue: emit_stmt_continue(ctx, stmt.as_continue); break; + case gsc::node_t::stmt_return: emit_stmt_return(ctx, stmt.as_return); break; + default: break; + } +} + +void compiler::emit_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt, bool last) +{ + for (const auto& entry : stmt->stmts) + { + bool last_ = (&entry == &stmt->stmts.back() && last) ? true : false; + emit_stmt(ctx, entry, last_); + } +} + +void compiler::emit_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt) +{ + if(stmt->expr->func.as_node->type == gsc::node_t::expr_call_function) + { + const auto& name = stmt->expr->func.as_func->name->value; + + if(name == "assert" || name == "assertex" || name == "assertmsg") return; + } + + emit_expr_call(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_DecTop); +} + +void compiler::emit_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt) +{ + emit_expr_assign(ctx, stmt->expr); +} + +void compiler::emit_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_endon); +} + +void compiler::emit_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt) +{ + emit_opcode(ctx, opcode::OP_voidCodepos); + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + emit_expr(ctx, arg); + } + + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_notify); +} + +void compiler::emit_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_wait); +} + +void compiler::emit_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_waittill); + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + create_variable(ctx, arg.as_name); + emit_opcode(ctx, opcode::OP_SafeSetWaittillVariableFieldCached, variable_access_index(ctx, arg.as_name)); + } + + emit_opcode(ctx, opcode::OP_clearparams); +} + +void compiler::emit_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt) +{ + emit_expr_arguments(ctx, stmt->args); + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_waittillmatch); + emit_opcode(ctx, opcode::OP_clearparams); +} + +void compiler::emit_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt) +{ + emit_opcode(ctx, opcode::OP_waittillFrameEnd); +} + +void compiler::emit_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt, bool last) +{ + auto end_loc = create_label(); + + if(stmt->expr.as_node->type == gsc::node_t::expr_not) + { + emit_expr(ctx, stmt->expr.as_not->rvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrue, end_loc); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, end_loc); + } + + ctx->transfer(stmt->ctx); + stmt->ctx->is_last = last; + + emit_stmt(stmt->ctx, stmt->stmt, last); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_remove_local_vars(stmt->ctx); + + insert_label(end_loc); +} + +void compiler::emit_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt, bool last) +{ + std::vector childs; + auto else_loc = create_label(); + auto end_loc = create_label(); + + if(stmt->expr.as_node->type == gsc::node_t::expr_not) + { + emit_expr(ctx, stmt->expr.as_not->rvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrue, else_loc); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, else_loc); + } + + ctx->transfer(stmt->ctx_if); + stmt->ctx_if->is_last = last; + + emit_stmt(stmt->ctx_if, stmt->stmt_if, last); + + emit_remove_local_vars(stmt->ctx_if); + + if(stmt->ctx_if->abort == abort_t::abort_none) + childs.push_back(stmt->ctx_if.get()); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_opcode(ctx, opcode::OP_jump, end_loc); + + insert_label(else_loc); + + ctx->transfer(stmt->ctx_else); + stmt->ctx_else->is_last = last; + + emit_stmt(stmt->ctx_else, stmt->stmt_else, last); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_remove_local_vars(stmt->ctx_else); + + if(stmt->ctx_else->abort == abort_t::abort_none) + childs.push_back(stmt->ctx_else.get()); + + insert_label(end_loc); + + ctx->init_from_child(childs); +} + +void compiler::emit_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = true; + can_continue_ = true; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + + auto begin_loc = insert_label(); + + bool const_cond = is_constant_condition(stmt->expr); + + if(!const_cond) + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + } + + emit_stmt(stmt->ctx, stmt->stmt, false); + + insert_label(continue_loc); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + + if(const_cond) + ctx->init_from_child(break_ctxs_); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = false; + can_continue_ = false; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + emit_stmt(ctx, stmt->pre_expr, false); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + ctx->transfer(stmt->ctx_post); + + auto begin_loc = insert_label(); + + bool const_cond = is_constant_condition(stmt->expr); + + if(!const_cond) + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + } + + can_break_ = true; + can_continue_ = true; + + emit_stmt(stmt->ctx, stmt->stmt, false); + + if(stmt->ctx->abort == abort_t::abort_none) + continue_ctxs_.push_back(stmt->ctx.get()); + + can_break_ = false; + can_continue_ = false; + + insert_label(continue_loc); + + stmt->ctx_post->init_from_child(continue_ctxs_); + + emit_stmt(stmt->ctx_post, stmt->post_expr, false); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + + if(const_cond) + ctx->init_from_child(break_ctxs_); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = false; + can_continue_ = false; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + emit_expr(ctx, stmt->array_expr); + emit_variable_ref(ctx, stmt->array, true); + emit_variable(ctx, stmt->array); + emit_opcode(ctx, opcode::OP_CallBuiltin1, "getfirstarraykey"); + emit_variable_ref(ctx, stmt->key_expr, true); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + + ctx->transfer(stmt->ctx_post); + + auto begin_loc = insert_label(); + + emit_variable(ctx, stmt->key_expr); + emit_opcode(ctx, opcode::OP_CallBuiltin1, "isdefined"); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + + can_break_ = true; + can_continue_ = true; + + emit_variable(stmt->ctx, stmt->key_expr); + emit_opcode(stmt->ctx, opcode::OP_EvalLocalArrayCached, variable_access_index(stmt->ctx, stmt->array.as_name)); + emit_variable_ref(stmt->ctx, stmt->value_expr, true); + emit_stmt(stmt->ctx, stmt->stmt, false); + + if(stmt->ctx->abort == abort_t::abort_none) + continue_ctxs_.push_back(stmt->ctx.get()); + + can_break_ = false; + can_continue_ = false; + + insert_label(continue_loc); + + stmt->ctx_post->init_from_child(continue_ctxs_); + + emit_variable(stmt->ctx_post, stmt->key_expr); + emit_variable(stmt->ctx_post, stmt->array); + emit_opcode(stmt->ctx_post, opcode::OP_CallBuiltin2, "getnextarraykey"); + emit_variable_ref(stmt->ctx_post, stmt->key_expr, true); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + emit_clear_local_variable(ctx, stmt->array.as_name); + if(!stmt->use_key) emit_clear_local_variable(ctx, stmt->key_expr.as_name); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_break = can_break_; + break_ctxs_.clear(); + can_break_ = false; + + auto jmptable_loc = create_label(); + auto break_loc = create_label(); + + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_switch, jmptable_loc); + + can_break_ = true; + + std::vector data; + data.push_back(utils::string::va("%d", stmt->stmt->stmts.size())); + + bool has_default = false; + gsc::context* default_ctx = nullptr; + + for(auto i = 0; i < stmt->stmt->stmts.size(); i++) + { + auto& entry = stmt->stmt->stmts[i]; + + if(entry.as_node->type == gsc::node_t::stmt_case) + { + auto& case_ = entry.as_case; + if(case_->value.as_node->type == gsc::node_t::data_integer) + { + auto loc = insert_label(); + data.push_back("case"); + data.push_back(case_->value.as_integer->value); + data.push_back(loc); + } + else if(case_->value.as_node->type == gsc::node_t::data_string) + { + auto loc = insert_label(); + data.push_back("case"); + data.push_back(case_->value.as_string->value); + data.push_back(loc); + } + else + { + throw gsc::comp_error(stmt->loc, "case type must be int or string"); + } + + ctx->transfer(case_->ctx); + case_->ctx->loc_break = break_loc; + emit_stmt_list(case_->ctx, case_->stmt, false); + if(case_->stmt->stmts.size() > 0) + emit_remove_local_vars(case_->ctx); + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + auto loc = insert_label(); + data.push_back("default"); + data.push_back(loc); + + has_default = true; + default_ctx = entry.as_default->ctx.get(); + + ctx->transfer(entry.as_default->ctx); + entry.as_default->ctx->loc_break = break_loc; + emit_stmt_list(entry.as_default->ctx, entry.as_default->stmt, false); + if(entry.as_default->stmt->stmts.size() > 0) + emit_remove_local_vars(entry.as_default->ctx); + } + else + { + throw gsc::comp_error(entry.as_node->loc, "missing case statement"); + } + } + + if(has_default) + { + if(default_ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(default_ctx); + } + ctx->init_from_child(break_ctxs_); + } + + insert_label(jmptable_loc); + + emit_opcode(ctx, opcode::OP_endswitch, data); + + auto offset = 7 * stmt->stmt->stmts.size(); + function_->instructions.back()->size += offset; + index_ += offset; + + insert_label(break_loc); + + can_break_ = old_break; + break_ctxs_ = old_breaks; +} + +void compiler::emit_stmt_case(const gsc::context_ptr& ctx, const gsc::stmt_case_ptr& stmt) +{ + throw gsc::comp_error(stmt->loc, "illegal case statement"); +} + +void compiler::emit_stmt_default(const gsc::context_ptr& ctx, const gsc::stmt_default_ptr& stmt) +{ + throw gsc::comp_error(stmt->loc, "illegal default statement"); +} + +void compiler::emit_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + if(can_break_ && ctx->abort == abort_t::abort_none && ctx->loc_break != "") + { + break_ctxs_.push_back(ctx.get()); + emit_remove_local_vars(ctx); + ctx->abort = abort_t::abort_break; + emit_opcode(ctx, opcode::OP_jump, ctx->loc_break); + } + else + { + throw gsc::comp_error(stmt->loc, "illegal break statement"); + } +} + +void compiler::emit_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt) +{ + if(can_break_ && ctx->abort == abort_t::abort_none && ctx->loc_continue != "") + { + continue_ctxs_.push_back(ctx.get()); + emit_remove_local_vars(ctx); + ctx->abort = abort_t::abort_continue; + emit_opcode(ctx, opcode::OP_jump, ctx->loc_continue); + } + else + { + throw gsc::comp_error(stmt->loc, "illegal continue statement"); + } +} + +void compiler::emit_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + ctx->abort = abort_t::abort_return; + } + + if(stmt->expr.as_node->type == gsc::node_t::null) + { + emit_opcode(ctx, opcode::OP_End); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_Return); + } +} + +void compiler::emit_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_and: emit_expr_and(ctx, expr.as_and); break; + case gsc::node_t::expr_or: emit_expr_or(ctx, expr.as_or); break; + case gsc::node_t::expr_equality: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_inequality: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less_equal: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater_equal: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_or: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_and: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_exor: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_left: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_right: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_add: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_sub: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mult: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_div: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mod: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_complement: emit_expr_complement(ctx, expr.as_complement); break; + case gsc::node_t::expr_not: emit_expr_not(ctx, expr.as_not); break; + case gsc::node_t::expr_call: emit_expr_call(ctx, expr.as_call); break; + case gsc::node_t::expr_function: emit_expr_function(ctx, expr.as_function); break; + case gsc::node_t::expr_add_array: emit_expr_add_array(ctx, expr.as_add_array); break; + case gsc::node_t::expr_array: emit_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: emit_field_variable(ctx, expr.as_field); break; + case gsc::node_t::expr_size: emit_expr_size(ctx, expr.as_size); break; + case gsc::node_t::data_thisthread: emit_opcode(ctx, opcode::OP_GetThisthread); break; + case gsc::node_t::data_empty_array: emit_opcode(ctx, opcode::OP_EmptyArray); break; + case gsc::node_t::data_undefined: emit_opcode(ctx, opcode::OP_GetUndefined); break; + case gsc::node_t::data_game: emit_opcode(ctx, opcode::OP_GetGame); break; + case gsc::node_t::data_self: emit_opcode(ctx, opcode::OP_GetSelf); break; + case gsc::node_t::data_anim: emit_opcode(ctx, opcode::OP_GetAnim); break; + case gsc::node_t::data_level: emit_opcode(ctx, opcode::OP_GetLevel); break; + case gsc::node_t::data_animation: emit_animation(ctx, expr.as_animation); break; + case gsc::node_t::data_animtree: emit_animtree(ctx, expr.as_animtree); break; + case gsc::node_t::data_name: emit_local_variable(ctx, expr.as_name); break; + case gsc::node_t::data_istring: emit_istring(ctx, expr.as_istring); break; + case gsc::node_t::data_string: emit_string(ctx, expr.as_string); break; + case gsc::node_t::data_vector: emit_vector(ctx, expr.as_vector); break; + case gsc::node_t::data_float: emit_float(ctx, expr.as_float); break; + case gsc::node_t::data_integer: emit_integer(ctx, expr.as_integer); break; + case gsc::node_t::data_false: emit_false(ctx, expr.as_false); break; + case gsc::node_t::data_true: emit_true(ctx, expr.as_true); break; + default: throw gsc::comp_error(expr.as_node->loc, "unknown expression"); break; + } +} + +void compiler::emit_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr) +{ + if(expr->type == gsc::node_t::expr_increment) + { + emit_variable_ref(ctx, expr->lvalue, false); + emit_opcode(ctx, opcode::OP_inc); + emit_opcode(ctx, opcode::OP_SetVariableField); + } + else if(expr->type == gsc::node_t::expr_decrement) + { + emit_variable_ref(ctx, expr->lvalue, false); + emit_opcode(ctx, opcode::OP_dec); + emit_opcode(ctx, opcode::OP_SetVariableField); + } + else if(expr->type == gsc::node_t::expr_assign_equal) + { + if(expr->rvalue.as_node->type == gsc::node_t::data_undefined) + { + emit_expr_clear_variable(ctx, expr->lvalue); + } + else + { + emit_expr(ctx, expr->rvalue); + emit_variable_ref(ctx, expr->lvalue, true); + } + } + else + { + emit_expr(ctx, expr->lvalue); + emit_expr(ctx, expr->rvalue); + + switch(expr->type) + { + case gsc::node_t::expr_assign_add: emit_opcode(ctx, opcode::OP_plus); break; + case gsc::node_t::expr_assign_sub: emit_opcode(ctx, opcode::OP_minus); break; + case gsc::node_t::expr_assign_mult: emit_opcode(ctx, opcode::OP_multiply); break; + case gsc::node_t::expr_assign_div: emit_opcode(ctx, opcode::OP_divide); break; + case gsc::node_t::expr_assign_mod: emit_opcode(ctx, opcode::OP_mod); break; + case gsc::node_t::expr_assign_shift_left: emit_opcode(ctx, opcode::OP_shift_left); break; + case gsc::node_t::expr_assign_shift_right: emit_opcode(ctx, opcode::OP_shift_right); break; + case gsc::node_t::expr_assign_bitwise_or: emit_opcode(ctx, opcode::OP_bit_or); break; + case gsc::node_t::expr_assign_bitwise_and: emit_opcode(ctx, opcode::OP_bit_and); break; + case gsc::node_t::expr_assign_bitwise_exor: emit_opcode(ctx, opcode::OP_bit_ex_or); break; + default: throw gsc::comp_error(expr->loc, "unknown assign operation"); break; + } + + emit_variable_ref(ctx, expr->lvalue, true); + } +} + +void compiler::emit_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr) +{ + emit_expr(ctx, expr->lvalue); + emit_expr(ctx, expr->rvalue); + + switch(expr->type) + { + case gsc::node_t::expr_equality: emit_opcode(ctx, opcode::OP_equality); break; + case gsc::node_t::expr_inequality: emit_opcode(ctx, opcode::OP_inequality); break; + case gsc::node_t::expr_less: emit_opcode(ctx, opcode::OP_less); break; + case gsc::node_t::expr_greater: emit_opcode(ctx, opcode::OP_greater); break; + case gsc::node_t::expr_less_equal: emit_opcode(ctx, opcode::OP_less_equal); break; + case gsc::node_t::expr_greater_equal: emit_opcode(ctx, opcode::OP_greater_equal); break; + case gsc::node_t::expr_bitwise_or: emit_opcode(ctx, opcode::OP_bit_or); break; + case gsc::node_t::expr_bitwise_and: emit_opcode(ctx, opcode::OP_bit_and); break; + case gsc::node_t::expr_bitwise_exor: emit_opcode(ctx, opcode::OP_bit_ex_or); break; + case gsc::node_t::expr_shift_left: emit_opcode(ctx, opcode::OP_shift_left); break; + case gsc::node_t::expr_shift_right: emit_opcode(ctx, opcode::OP_shift_right); break; + case gsc::node_t::expr_add: emit_opcode(ctx, opcode::OP_plus); break; + case gsc::node_t::expr_sub: emit_opcode(ctx, opcode::OP_minus); break; + case gsc::node_t::expr_mult: emit_opcode(ctx, opcode::OP_multiply); break; + case gsc::node_t::expr_div: emit_opcode(ctx, opcode::OP_divide); break; + case gsc::node_t::expr_mod: emit_opcode(ctx, opcode::OP_mod); break; + default: throw gsc::comp_error(expr->loc, "unknown binary expression"); break; + } +} + +void compiler::emit_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr) +{ + auto label = create_label(); + + emit_expr(ctx, expr->lvalue); + emit_opcode(ctx, opcode::OP_JumpOnFalseExpr, label); + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_CastBool); + + insert_label(label); +} + +void compiler::emit_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr) +{ + auto label = create_label(); + + emit_expr(ctx, expr->lvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrueExpr, label); + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_CastBool); + + insert_label(label); +} + +void compiler::emit_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr) +{ + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_BoolComplement); +} + +void compiler::emit_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr) +{ + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_BoolNot); +} + +void compiler::emit_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + if(expr->func.as_node->type == gsc::node_t::expr_call_pointer) + { + emit_expr_call_pointer(ctx, expr); + } + else + { + emit_expr_call_function(ctx, expr); + } +} + +void compiler::emit_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + bool thread = expr->thread; + bool child = expr->child; + bool method = expr->obj.as_node->type != gsc::node_t::null ? true : false; + bool builtin = builtin = expr->func.as_pointer->builtin; + std::uint32_t args = expr->func.as_pointer->args->list.size(); + + if(thread && child || thread && builtin || child && builtin) + throw gsc::comp_error(expr->loc, "function call have more than 1 type (thread, childthread, builtin)"); + + if(!thread && !child && !builtin) emit_opcode(ctx, opcode::OP_PreScriptCall); + + emit_expr_arguments(ctx, expr->func.as_pointer->args); + + if(method) emit_expr(ctx, expr->obj); + + emit_expr(ctx, expr->func.as_pointer->expr); + emit_expr_call_pointer_type(ctx, args, builtin, method, thread, child); +} + +void compiler::emit_expr_call_pointer_type(const gsc::context_ptr& ctx, int args, bool builtin, bool method, bool thread, bool child) +{ + if(builtin && !method) + { + emit_opcode(ctx, opcode::OP_CallBuiltinPointer, utils::string::va("%d", args)); + } + else if(builtin && method) + { + emit_opcode(ctx, opcode::OP_CallBuiltinMethodPointer, utils::string::va("%d", args)); + } + else if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptThreadCallPointer, utils::string::va("%d", args)); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptMethodThreadCallPointer, utils::string::va("%d", args)); + } + else if (child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptChildThreadCallPointer, utils::string::va("%d", args)); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptMethodChildThreadCallPointer, utils::string::va("%d", args)); + } + else + { + method ? emit_opcode(ctx, opcode::OP_ScriptMethodCallPointer) : emit_opcode(ctx, opcode::OP_ScriptFunctionCallPointer); + } +} + +void compiler::emit_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + bool thread = expr->thread; + bool child = expr->child; + bool method = expr->obj.as_node->type != gsc::node_t::null ? true : false; + std::uint32_t args = expr->func.as_func->args->list.size(); + auto name = expr->func.as_func->name->value; + auto file = expr->func.as_func->file->value; + + bool builtin = false, far = false, local = false; + + if(file != "") far = true; + else + { + if(is_local_call(name)) local = true; + else if(method && is_builtin_method(name)) builtin = true; + else if(!method && is_builtin_func(name)) builtin = true; + else + { + for(const auto& inc : includes_) + { + for(const auto& fun : inc.funcs) + { + if(name == fun) + { + far = true; + file = inc.name; + break; + } + } + } + + if(!builtin && !far && !local) + throw gsc::comp_error(expr->loc, "unknown function call " + name); + } + } + + if(thread && child || thread && builtin || child && builtin) + throw gsc::comp_error(expr->loc, "function call have more than 1 type (thread, childthread, builtin)"); + + if(!thread && !child && !builtin && !(!method && args == 0)) + emit_opcode(ctx, opcode::OP_PreScriptCall); + + emit_expr_arguments(ctx, expr->func.as_func->args); + + if(method) emit_expr(ctx, expr->obj); + + if(builtin) emit_expr_call_function_builtin(ctx, name, args, method); + else if(local) emit_expr_call_function_local(ctx, name, args, method, thread, child); + else if(far) emit_expr_call_function_far(ctx, file, name, args, method, thread, child); +} + +void compiler::emit_expr_call_function_builtin(const gsc::context_ptr& ctx, const std::string& func, int args, bool method) +{ + if(method) + { + switch(args) + { + case 0: emit_opcode(ctx, opcode::OP_CallBuiltinMethod0, func); break; + case 1: emit_opcode(ctx, opcode::OP_CallBuiltinMethod1, func); break; + case 2: emit_opcode(ctx, opcode::OP_CallBuiltinMethod2, func); break; + case 3: emit_opcode(ctx, opcode::OP_CallBuiltinMethod3, func); break; + case 4: emit_opcode(ctx, opcode::OP_CallBuiltinMethod4, func); break; + case 5: emit_opcode(ctx, opcode::OP_CallBuiltinMethod5, func); break; + default: emit_opcode(ctx, opcode::OP_CallBuiltinMethod, { utils::string::va("%d", args), func }); break; + } + } + else + { + switch(args) + { + case 0: emit_opcode(ctx, opcode::OP_CallBuiltin0, func); break; + case 1: emit_opcode(ctx, opcode::OP_CallBuiltin1, func); break; + case 2: emit_opcode(ctx, opcode::OP_CallBuiltin2, func); break; + case 3: emit_opcode(ctx, opcode::OP_CallBuiltin3, func); break; + case 4: emit_opcode(ctx, opcode::OP_CallBuiltin4, func); break; + case 5: emit_opcode(ctx, opcode::OP_CallBuiltin5, func); break; + default: emit_opcode(ctx, opcode::OP_CallBuiltin, { utils::string::va("%d", args), func }); break; + } + } +} + +void compiler::emit_expr_call_function_local(const gsc::context_ptr& ctx, const std::string& func, int args, bool method, bool thread, bool child) +{ + if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalThreadCall, { func, utils::string::va("%d", args) }); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodThreadCall, { func, utils::string::va("%d", args) }); + } + else if(child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptLocalChildThreadCall, { func, utils::string::va("%d", args) }); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodChildThreadCall, { func, utils::string::va("%d", args) }); + } + else if(method && !thread && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodCall, func); + } + else if(!thread && !child && !method && args == 0) + { + emit_opcode(ctx, opcode::OP_ScriptLocalFunctionCall2, func); + } + else if(!thread && !child && !method && args != 0) + { + emit_opcode(ctx, opcode::OP_ScriptLocalFunctionCall, func); + } +} + +void compiler::emit_expr_call_function_far(const gsc::context_ptr& ctx, const std::string& file, const std::string& func, int args, bool method, bool thread, bool child) +{ + if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptFarThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptFarChildThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodChildThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(!thread && !child && method) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodCall, { file, func }); + } + else if(!thread && !child && !method && args == 0) + { + emit_opcode(ctx, opcode::OP_ScriptFarFunctionCall2, { file, func }); + } + else if(!thread && !child && !method && args != 0) + { + emit_opcode(ctx, opcode::OP_ScriptFarFunctionCall, { file, func }); + } +} + +void compiler::emit_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& args) +{ + std::reverse(args->list.begin(), args->list.end()); + + for(auto& arg : args->list) + { + emit_expr(ctx, arg); + } +} + +void compiler::emit_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& expr) +{ + bool far = false, local = false, builtin = false, method = false; + auto name = expr->name->value; + auto file = expr->file->value; + + if(file != "") + { + far = true; + } + else if(is_builtin_method(name)) + { + builtin = true; + method = true; + } + else if(is_builtin_func(name)) + { + builtin = true; + } + else if(is_local_call(name)) + { + local = true; + } + + if(local) + { + emit_opcode(ctx, opcode::OP_GetLocalFunction, name); + } + else if(far) + { + emit_opcode(ctx, opcode::OP_GetFarFunction, { file, name } ); + } + else if(builtin && method) + { + emit_opcode(ctx, opcode::OP_GetBuiltinMethod, name); + } + else if(builtin && !method) + { + emit_opcode(ctx, opcode::OP_GetBuiltinFunction, name); + } +} + +void compiler::emit_expr_clear_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& lvalue) +{ + switch(lvalue.as_node->type) + { + case gsc::node_t::expr_array: + emit_expr(ctx, lvalue.as_array->key); + lvalue.as_array->obj.as_node->type == gsc::node_t::data_game ? emit_opcode(ctx, opcode::OP_GetGameRef) : emit_variable_ref(ctx, lvalue.as_array->obj, false); + emit_opcode(ctx, opcode::OP_ClearArray); + break; + case gsc::node_t::expr_field: + emit_object(ctx, lvalue.as_field->obj); + emit_opcode(ctx, opcode::OP_ClearFieldVariable,lvalue.as_field->field->value); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_GetUndefined); + emit_local_variable_ref(ctx, lvalue.as_name, true); + break; + default: + throw gsc::comp_error(lvalue.as_node->loc, "unknown clear variable lvalue"); + break; + } +} + +void compiler::emit_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr) +{ + if(expr->args->list.size() <= 0) + { + throw gsc::comp_error(expr->loc, "invalid empty add array. did u mean '[]' ?"); + } + + emit_opcode(ctx, opcode::OP_EmptyArray); + + for(const auto& arg : expr->args->list) + { + emit_expr(ctx, arg); + emit_opcode(ctx, opcode::OP_AddArray); + } +} + +void compiler::emit_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr) +{ + emit_variable(ctx, expr->obj); + emit_opcode(ctx, opcode::OP_size); +} + +void compiler::emit_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr, bool set) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_array: emit_array_variable_ref(ctx, expr.as_array, set); break; + case gsc::node_t::expr_field: emit_field_variable_ref(ctx, expr.as_field, set); break; + case gsc::node_t::data_name: emit_local_variable_ref(ctx, expr.as_name, set); break; + default: throw gsc::comp_error(expr.as_node->loc, "invalid variable reference type."); break; + } +} + +void compiler::emit_array_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr, bool set) +{ + emit_expr(ctx, expr->key); + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_game: + emit_opcode(ctx, opcode::OP_GetGameRef); + emit_opcode(ctx, opcode::OP_EvalArrayRef); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_array: + case gsc::node_t::expr_field: + emit_variable_ref(ctx, expr->obj, false); + emit_opcode(ctx, opcode::OP_EvalArrayRef); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::data_name: + { + if(!variable_initialized(ctx, expr->obj.as_name)) + { + initialize_variable(ctx, expr->obj.as_name); + emit_opcode(ctx, opcode::OP_EvalNewLocalArrayRefCached0, variable_create_index(ctx, expr->obj.as_name)); + + if(!set) + { + throw gsc::comp_error(expr->loc, "INTERNAL: VAR CREATED BUT NOT SET!"); + } + } + else if(variable_stack_index(ctx, expr->obj.as_name) == 0) + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayRefCached0); + } + else + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayRefCached, variable_access_index(ctx, expr->obj.as_name)); + } + + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + } + break; + case gsc::node_t::expr_call: + throw gsc::comp_error(expr->loc, "call result can't be referenced."); + break; + default: + throw gsc::comp_error(expr->loc, "unknown array object type"); + break; + } +} + +void compiler::emit_field_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr, bool set) +{ + const auto& field = expr->field->value; + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_level: + set ? emit_opcode(ctx, opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalLevelFieldVariableRef, field); + break; + case gsc::node_t::data_anim: + set ? emit_opcode(ctx, opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalAnimFieldVariableRef, field); + break; + case gsc::node_t::data_self: + set ? emit_opcode(ctx, opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalSelfFieldVariableRef, field); + break; + case gsc::node_t::expr_array: + emit_array_variable(ctx, expr->obj.as_array); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_field: + emit_field_variable(ctx, expr->obj.as_field); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr->obj.as_name)); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_call: + throw gsc::comp_error(expr->loc, "function call result can't be referenced"); + break; + default: + throw gsc::comp_error(expr->loc, "unknown field variable object type"); + break; + } +} + +void compiler::emit_local_variable_ref(const gsc::context_ptr& ctx, const gsc::name_ptr& expr, bool set) +{ + const auto itr = constants_.find(expr->value); + + if (itr != constants_.end()) + { + throw gsc::comp_error(expr->loc, "variable name already defined as constant " + expr->value); + } + + if(set) + { + if(!variable_initialized(ctx, expr)) + { + initialize_variable(ctx, expr); + emit_opcode(ctx, opcode::OP_SetNewLocalVariableFieldCached0, variable_create_index(ctx, expr)); + } + else if(variable_stack_index(ctx, expr) == 0) + { + emit_opcode(ctx, opcode::OP_SetLocalVariableFieldCached0); + } + else + { + emit_opcode(ctx, opcode::OP_SetLocalVariableFieldCached, variable_access_index(ctx, expr)); + } + } + else + { + auto index = variable_stack_index(ctx, expr); + + if(index == 0) + emit_opcode(ctx, opcode::OP_EvalLocalVariableRefCached0); + else + emit_opcode(ctx, opcode::OP_EvalLocalVariableRefCached, variable_access_index(ctx, expr)); + } +} + +void compiler::emit_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + // for obj.size + switch(expr.as_node->type) + { + case gsc::node_t::expr_array: emit_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: emit_field_variable(ctx, expr.as_field); break; + case gsc::node_t::data_name: emit_local_variable(ctx, expr.as_name); break; + case gsc::node_t::expr_call: emit_expr_call(ctx, expr.as_call); break; + default: throw gsc::comp_error(expr.as_node->loc, "invalid variable type."); break; + } +} + +void compiler::emit_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr) +{ + emit_expr(ctx, expr->key); + + if(expr->obj.as_node->type == gsc::node_t::data_name) + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayCached, variable_access_index(ctx, expr->obj.as_name)); + } + else + { + emit_expr(ctx, expr->obj); + emit_opcode(ctx, opcode::OP_EvalArray); + } +} + +void compiler::emit_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr) +{ + const auto& field = expr->field->value; + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_level: + emit_opcode(ctx, opcode::OP_EvalLevelFieldVariable, field); + break; + case gsc::node_t::data_anim: + emit_opcode(ctx, opcode::OP_EvalAnimFieldVariable, field); + break; + case gsc::node_t::data_self: + emit_opcode(ctx, opcode::OP_EvalSelfFieldVariable, field); + break; + case gsc::node_t::expr_array: + emit_array_variable(ctx, expr->obj.as_array); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::expr_field: + emit_field_variable(ctx, expr->obj.as_field); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::expr_call: + emit_expr_call(ctx, expr->obj.as_call); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr->obj.as_name)); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + default: + throw gsc::comp_error(expr->loc, "unknown field variable object type"); + break; + } +} + +void compiler::emit_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + // is constant ( should only allow: string, loc string, number, vector) + const auto itr = constants_.find(expr->value); + + if (itr != constants_.end()) + { + const auto& value = itr->second; + emit_expr(ctx, value); + return; + } + + // is local var + auto index = variable_stack_index(ctx, expr); + + switch(index) + { + case 0: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached0); break; + case 1: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached1); break; + case 2: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached2); break; + case 3: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached3); break; + case 4: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached4); break; + case 5: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached5); break; + default: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached, variable_access_index(ctx, expr)); break; + } +} + +void compiler::emit_clear_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + auto index = variable_stack_index(ctx, expr); + + if(index == 0) + { + emit_opcode(ctx, opcode::OP_ClearLocalVariableFieldCached0); + } + else + { + emit_opcode(ctx, opcode::OP_ClearLocalVariableFieldCached, variable_access_index(ctx, expr)); + } +} + +void compiler::emit_create_local_vars(const gsc::context_ptr& ctx) +{ + if ( ctx->local_vars_create_count != ctx->local_vars_public_count ) + { + for(auto i = ctx->local_vars_create_count; i < ctx->local_vars_public_count; i++) + { + auto data = utils::string::va("%d", ctx->local_vars.at(i).create); + emit_opcode(ctx, opcode::OP_CreateLocalVariable, data); + ctx->local_vars.at(i).init = true; + } + ctx->local_vars_create_count = ctx->local_vars_public_count; + } +} + +void compiler::emit_remove_local_vars(const gsc::context_ptr& ctx) +{ + if(ctx->abort == abort_t::abort_none) + { + auto count = ctx->local_vars_create_count - ctx->local_vars_public_count; + + if(count > 0) + { + auto data = utils::string::va("%d", count); + emit_opcode(ctx, opcode::OP_RemoveLocalVariables, data); + } + } +} + +void compiler::emit_object(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + // need revision used for clear variable + switch(expr.as_node->type) + { + case gsc::node_t::data_level: + emit_opcode(ctx, opcode::OP_GetLevelObject); + break; + case gsc::node_t::data_anim: + emit_opcode(ctx, opcode::OP_GetAnimObject); + break; + case gsc::node_t::data_self: + emit_opcode(ctx, opcode::OP_GetSelfObject); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr.as_name)); + break; + case gsc::node_t::expr_call: + emit_expr_call(ctx, expr.as_call); + emit_opcode(ctx, opcode::OP_CastFieldObject); + break; + // array ? + // field ? + default: + throw gsc::comp_error(expr.as_node->loc, "unknown object type"); + break; + } +} + +void compiler::emit_animtree(const gsc::context_ptr& ctx, const gsc::animtree_ptr& animtree) +{ + if(animtrees_.size() == 0) + { + throw gsc::comp_error( animtree->loc, "trying to use animtree without specified using animtree"); + } + + auto& tree = animtrees_.back(); + + if(tree.loaded) + { + emit_opcode(ctx, opcode::OP_GetAnimTree, "''"); + } + else + { + emit_opcode(ctx, opcode::OP_GetAnimTree, tree.name); + tree.loaded = true; + } +} + +void compiler::emit_animation(const gsc::context_ptr& ctx, const gsc::animation_ptr& animation) +{ + if(animtrees_.size() == 0) + { + throw gsc::comp_error(animation->loc, "trying to use animation without specified using animtree"); + } + + auto& tree = animtrees_.back(); + + if(tree.loaded) + { + emit_opcode(ctx, opcode::OP_GetAnimation, { "''", animation->value }); + } + else + { + emit_opcode(ctx, opcode::OP_GetAnimation, { tree.name, animation->value }); + tree.loaded = true; + } +} + +void compiler::emit_istring(const gsc::context_ptr& ctx, const gsc::istring_ptr& str) +{ + emit_opcode(ctx, opcode::OP_GetIString, str->value); +} + +void compiler::emit_string(const gsc::context_ptr& ctx, const gsc::string_ptr& str) +{ + emit_opcode(ctx, opcode::OP_GetString, str->value); +} + +void compiler::emit_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec) +{ + std::vector data; + + bool expr = false; + + if(vec->x.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->x.as_integer->value); + else if(vec->x.as_node->type == gsc::node_t::data_float) + data.push_back(vec->x.as_float->value); + else expr = true; + + if(vec->y.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->y.as_integer->value); + else if(vec->y.as_node->type == gsc::node_t::data_float) + data.push_back(vec->y.as_float->value); + else expr = true; + + if(vec->z.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->z.as_integer->value); + else if(vec->z.as_node->type == gsc::node_t::data_float) + data.push_back(vec->z.as_float->value); + else expr = true; + + if(!expr) + { + emit_opcode(ctx, opcode::OP_GetVector, data); + } + else + { + emit_expr(ctx, vec->z); + emit_expr(ctx, vec->y); + emit_expr(ctx, vec->x); + emit_opcode(ctx, opcode::OP_vector); + } +} + +void compiler::emit_float(const gsc::context_ptr& ctx, const gsc::float_ptr& num) +{ + emit_opcode(ctx, opcode::OP_GetFloat, num->value); +} + +void compiler::emit_integer(const gsc::context_ptr& ctx, const gsc::integer_ptr& num) +{ + auto value = std::atoi(num->value.data()); + + if(value == 0) + { + emit_opcode(ctx, opcode::OP_GetZero); + } + else if(value > 0 && value < 256) + { + emit_opcode(ctx, opcode::OP_GetByte, num->value); + } + else if(value < 0 && value > -256) + { + emit_opcode(ctx, opcode::OP_GetNegByte, num->value.substr(1)); + } + else if(value < 65536) + { + emit_opcode(ctx, opcode::OP_GetUnsignedShort, num->value); + } + else if(value < 0 && value > -65536) + { + emit_opcode(ctx, opcode::OP_GetNegUnsignedShort, num->value.substr(1)); + } + else + { + emit_opcode(ctx, opcode::OP_GetInteger, num->value); + } +} + +void compiler::emit_false(const gsc::context_ptr& ctx, const gsc::false_ptr& expr) +{ + emit_opcode(ctx, opcode::OP_GetZero); +} + +void compiler::emit_true(const gsc::context_ptr& ctx, const gsc::true_ptr& expr) +{ + emit_opcode(ctx, opcode::OP_GetByte, "1"); +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + + index_ += inst->size; +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::string& data) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + inst->data.push_back(data); + + index_ += inst->size; +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::vector& data) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + inst->data = data; + + index_ += inst->size; +} + +void compiler::process_thread(const gsc::context_ptr& ctx, const gsc::thread_ptr& thread) +{ + process_parameters(ctx, thread->params); + process_stmt_list(ctx, thread->block); +} + +void compiler::process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + register_variable(ctx, param->value); + } +} + +void compiler::process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt) +{ + switch (stmt.as_node->type) + { + case gsc::node_t::stmt_list: process_stmt_list(ctx, stmt.as_list); break; + case gsc::node_t::stmt_assign: process_expr(ctx, stmt.as_assign->expr->lvalue); break; + case gsc::node_t::stmt_waittill: process_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_if: process_stmt_if(ctx, stmt.as_if); break; + case gsc::node_t::stmt_ifelse: process_stmt_ifelse(ctx, stmt.as_ifelse); break; + case gsc::node_t::stmt_while: process_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: process_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: process_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: process_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_break: process_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_continue: process_stmt_continue(ctx, stmt.as_continue); break; + case gsc::node_t::stmt_return: process_stmt_return(ctx, stmt.as_return); break; + default: break; + } +} + +void compiler::process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + for (const auto& entry : stmt->stmts) + { + process_stmt(ctx, entry); + } +} + +void compiler::process_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + if(expr.as_node->type == gsc::node_t::data_name) + { + register_variable(ctx, expr.as_name->value); + } + else if(expr.as_node->type == gsc::node_t::expr_array) + { + process_expr(ctx, expr.as_array->obj); + } +} + +void compiler::process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + register_variable(ctx, arg.as_name->value); + } + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); +} + +void compiler::process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt) +{ + stmt->ctx = std::make_unique(); + + ctx->copy(stmt->ctx); + process_stmt(stmt->ctx, stmt->stmt); + + std::vector childs({ stmt->ctx.get() }); + ctx->merge(childs); +} + +void compiler::process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt) +{ + std::vector childs; + auto abort = abort_t::abort_return; + + stmt->ctx_if = std::make_unique(); + stmt->ctx_else = std::make_unique(); + + ctx->copy(stmt->ctx_if); + process_stmt(stmt->ctx_if, stmt->stmt_if); + + if(stmt->ctx_if->abort <= abort_t::abort_return) + { + abort = stmt->ctx_if->abort; + if(abort == abort_t::abort_none) + childs.push_back(stmt->ctx_if.get()); + } + + ctx->copy(stmt->ctx_else); + process_stmt(stmt->ctx_else, stmt->stmt_else); + + if(stmt->ctx_else->abort <= abort) + { + abort = stmt->ctx_else->abort; + if(abort == abort_t::abort_none) + childs.push_back(stmt->ctx_else.get()); + } + + if(ctx->abort == abort_t::abort_none) + ctx->abort = abort; + + ctx->append(childs); + ctx->merge(childs); +} + +void compiler::process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + bool const_cond = is_constant_condition(stmt->expr); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + stmt->ctx = std::make_unique(); + + ctx->copy(stmt->ctx); + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + if(const_cond) ctx->append(break_ctxs_); + + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + bool const_cond = is_constant_condition(stmt->expr); + + stmt->ctx = std::make_unique(); + stmt->ctx_post = std::make_unique(); + + process_stmt(ctx, stmt->pre_expr); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + ctx->copy(stmt->ctx); + ctx->copy(stmt->ctx_post); + + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + process_stmt(stmt->ctx_post, stmt->post_expr); + + ctx->append({ stmt->ctx_post.get() }); + ctx->merge({ stmt->ctx_post.get() }); + + if(const_cond) ctx->append(break_ctxs_); + + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + auto array_name = utils::string::va("temp_%d", ++label_idx_); + auto key_name = utils::string::va("temp_%d", ++label_idx_); + + stmt->array = expr_ptr(std::make_unique(stmt->loc, array_name)); + + if(!stmt->use_key) + stmt->key_expr = expr_ptr(std::make_unique(stmt->loc, key_name)); + + key_name = stmt->key_expr.as_name->value; + + // calculate variables + + stmt->ctx = std::make_unique(); + stmt->ctx_post = std::make_unique(); + + // calculate pre_expr variables + process_expr(ctx, stmt->array); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + ctx->copy(stmt->ctx); + ctx->copy(stmt->ctx_post); + + // calculate stmt variables & add missing array access as first stmt + process_expr(stmt->ctx, stmt->value_expr); + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + process_expr(stmt->ctx_post, stmt->key_expr); + + ctx->append({ stmt->ctx_post.get() }); + ctx->merge({ stmt->ctx_post.get() }); + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + auto stmt_list = std::make_unique(stmt->stmt->loc); + auto current_case = gsc::stmt_ptr(std::make_unique()); + + auto num = stmt->stmt->stmts.size(); + + for(auto i = 0; i < num; i++) + { + auto& entry = stmt->stmt->stmts[0]; + + if(entry.as_node->type == gsc::node_t::stmt_case || entry.as_node->type == gsc::node_t::stmt_default) + { + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + current_case = std::move(stmt->stmt->stmts[0]); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + else + { + if(current_case.as_node->type != gsc::node_t::null) + { + if(current_case.as_node->type == gsc::node_t::stmt_case) + { + current_case.as_case->stmt->stmts.push_back(std::move(entry)); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + else + { + current_case.as_default->stmt->stmts.push_back(std::move(entry)); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + } + else + { + gsc::comp_error(entry.as_node->loc, "missing case statement"); + } + } + } + + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + // calculate variables + stmt->ctx = std::make_unique(); + std::vector childs; + auto abort = abort_t::abort_return; + bool has_default = false; + gsc::context* default_ctx = nullptr; + auto old_breaks = break_ctxs_; + break_ctxs_.clear(); + + for(auto i = 0; i < stmt_list->stmts.size(); i++) + { + auto& entry = stmt_list->stmts[i]; + + if(entry.as_node->type == gsc::node_t::stmt_case) + { + entry.as_case->ctx = std::make_unique(); + ctx->copy(entry.as_case->ctx); + process_stmt_list(entry.as_case->ctx, entry.as_case->stmt); + + if (entry.as_case->ctx->abort != abort_t::abort_none) + { + if (entry.as_case->ctx->abort == abort_t::abort_break ) + { + entry.as_case->ctx->abort = abort_t::abort_none; + abort = abort_t::abort_none; + childs.push_back(entry.as_case->ctx.get()); + } + else if (entry.as_case->ctx->abort <= abort ) + { + abort = entry.as_case->ctx->abort; + } + } + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + entry.as_default->ctx = std::make_unique(); + ctx->copy(entry.as_default->ctx); + process_stmt_list(entry.as_default->ctx, entry.as_default->stmt); + has_default = true; + default_ctx = entry.as_default->ctx.get(); + + if (entry.as_default->ctx->abort != abort_t::abort_none) + { + if (entry.as_default->ctx->abort == abort_t::abort_break ) + { + entry.as_default->ctx->abort = abort_t::abort_none; + abort = abort_t::abort_none; + childs.push_back(entry.as_default->ctx.get()); + } + else if (entry.as_default->ctx->abort <= abort ) + { + abort = entry.as_default->ctx->abort; + } + } + } + } + + stmt->stmt =std::move(stmt_list); + + if(has_default) + { + if(default_ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(default_ctx); + + if(ctx->abort == abort_t::abort_none) + ctx->abort = abort; + } + + ctx->append(break_ctxs_); + ctx->merge(childs); + } + + break_ctxs_ = old_breaks; +} + +void compiler::process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(ctx.get()); + ctx->abort = abort_t::abort_break; + } +} + +void compiler::process_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + continue_ctxs_.push_back(ctx.get()); + ctx->abort = abort_t::abort_continue; + } +} + +void compiler::process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + ctx->abort = abort_t::abort_return; + } +} + +void compiler::register_variable(const gsc::context_ptr& ctx, const std::string& name) +{ + auto it = std::find_if(ctx->local_vars.begin(), ctx->local_vars.end(), + [&](const gsc::local_var& v) { return v.name == name; }); + + if(it == ctx->local_vars.end()) + { + auto found = false; + for(std::size_t i = 0; i < local_stack_.size(); i++) + { + if(local_stack_[i] == name) + { + ctx->local_vars.push_back({ name, static_cast(i), false }); + found = true; + break; + } + } + + if(!found) + { + ctx->local_vars.push_back({ name, stack_idx_, false }); + local_stack_.push_back(name); + stack_idx_++; + } + } +} + +void compiler::initialize_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name) +{ + for(std::uint32_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(!ctx->local_vars[i].init) + { + for(std::uint32_t j = 0; j < i; j++) + { + if(!ctx->local_vars[j].init) + { + emit_opcode(ctx, opcode::OP_CreateLocalVariable, utils::string::va("%d", ctx->local_vars[j].create)); + ctx->local_vars[j].init = true; + //ctx->local_vars_create_count++; + } + } + ctx->local_vars[i].init = true; + ctx->local_vars_create_count = i + 1; + return; + } + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +void compiler::create_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name) +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + auto& var = ctx->local_vars.at(i); + if(var.name == name->value) + { + if(!var.init) + { + emit_opcode(ctx, opcode::OP_CreateLocalVariable, utils::string::va("%d", var.create)); + var.init = true; + ctx->local_vars_create_count++; + } + return; + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_stack_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::uint8_t +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(ctx->local_vars.at(i).init) + { + return ctx->local_vars_create_count - 1 - i; + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not initialized."); + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_create_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + return utils::string::va("%d", ctx->local_vars[i].create); + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_access_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(ctx->local_vars.at(i).init) + { + return utils::string::va("%d", ctx->local_vars_create_count - 1 - i); + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not initialized."); + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_initialized(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> bool +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + return ctx->local_vars.at(i).init; + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::is_local_call(const std::string& name) -> bool +{ + for(const auto& f : local_functions_) + { + if(f == name) return true; + } + + return false; +} + +auto compiler::is_builtin_call(const std::string& name) -> bool +{ + if(is_builtin_func(name)) return true; + + if(is_builtin_method(name)) return true; + + return false; +} + +auto compiler::is_builtin_func(const std::string& name) -> bool +{ + return resolver::find_function(name); +} +auto compiler::is_builtin_method(const std::string& name) -> bool +{ + return resolver::find_method(name); +} + +auto compiler::is_constant_condition(const gsc::expr_ptr& expr) -> bool +{ + switch(expr.as_node->type) + { + case gsc::node_t::null: + case gsc::node_t::data_true: + return true; + case gsc::node_t::data_false: + throw gsc::comp_error(expr.as_node->loc, "condition can't be always false!"); + case gsc::node_t::data_integer: + { + auto num = std::stoi(expr.as_integer->value); + if(num != 0) + return true; + else + throw gsc::comp_error(expr.as_node->loc, "condition can't be always false!"); + } + default: + break; + } + + return false; +} + +auto compiler::create_label() -> std::string +{ + label_idx_++; + auto name = utils::string::va("loc_%d", label_idx_); + return name; +} + +auto compiler::insert_label() -> std::string +{ + const auto itr = function_->labels.find(index_); + + if (itr != function_->labels.end()) + { + return itr->second; + } + else + { + label_idx_++; + auto name = utils::string::va("loc_%d", label_idx_); + function_->labels.insert({index_, name}); + return name; + } +} + +void compiler::insert_label(const std::string& name) +{ + const auto itr = function_->labels.find(index_); + + if (itr != function_->labels.end()) + { + for(auto& inst : function_->instructions) + { + switch (opcode(inst->opcode)) + { + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_jump: + case opcode::OP_jumpback: + case opcode::OP_switch: + if(inst->data[0] == name) + inst->data[0] = itr->second; + break; + case opcode::OP_endswitch: + default: + break; + } + } + } + else + { + function_->labels.insert({index_, name}); + } +} + +auto compiler::map_known_includes(const std::string& include) -> bool +{ + return false; +} + +} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/compiler.hpp b/src/iw6/xsk/compiler.hpp new file mode 100644 index 00000000..f3068538 --- /dev/null +++ b/src/iw6/xsk/compiler.hpp @@ -0,0 +1,145 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::iw6 +{ + +enum class opcode : std::uint8_t; + +class compiler : public gsc::compiler +{ + std::string filename_; + std::vector assembly_; + gsc::function_ptr function_; + std::uint32_t index_; + std::uint32_t label_idx_; + std::uint8_t stack_idx_; + std::vector local_stack_; + std::vector local_functions_; + std::vector includes_; + std::vector animtrees_; + std::unordered_map constants_; + std::function(const std::string&)> callback_readf_; + std::vector break_ctxs_; + std::vector continue_ctxs_; + bool can_break_; + bool can_continue_; + +public: + auto output() -> std::vector; + void compile(const std::string& file, std::vector& data); + void set_readf_callback(std::function(const std::string&)> func); + +private: + auto parse_buffer(const std::string& file, std::vector& data) -> gsc::program_ptr; + auto parse_file(const std::string& file) -> gsc::program_ptr; + void compile_program(const gsc::program_ptr& program); + void emit_include(const gsc::include_ptr& include); + void emit_define(const gsc::define_ptr& define); + void emit_usingtree(const gsc::usingtree_ptr& animtree); + void emit_constant(const gsc::constant_ptr& constant); + void emit_thread(const gsc::thread_ptr& thread); + void emit_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void emit_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt, bool last); + void emit_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt, bool last); + void emit_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt); + void emit_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt); + void emit_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt); + void emit_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt); + void emit_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt); + void emit_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void emit_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt); + void emit_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt); + void emit_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt, bool last); + void emit_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt, bool last); + void emit_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void emit_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void emit_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void emit_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void emit_stmt_case(const gsc::context_ptr& ctx, const gsc::stmt_case_ptr& stmt); + void emit_stmt_default(const gsc::context_ptr& ctx, const gsc::stmt_default_ptr& stmt); + void emit_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void emit_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt); + void emit_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void emit_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr); + void emit_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr); + void emit_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr); + void emit_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr); + void emit_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr); + void emit_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr); + void emit_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_pointer_type(const gsc::context_ptr& ctx, int args, bool builtin, bool method, bool thread, bool child); + void emit_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_function_builtin(const gsc::context_ptr& ctx, const std::string& func, int args, bool method); + void emit_expr_call_function_local(const gsc::context_ptr& ctx, const std::string& func, int args, bool method, bool thread, bool child); + void emit_expr_call_function_far(const gsc::context_ptr& ctx, const std::string& file, const std::string& func, int args, bool method, bool thread, bool child); + void emit_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& arg_list); + void emit_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& node); + void emit_expr_clear_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& lvalue); + void emit_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr); + void emit_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr); + void emit_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr, bool set); + void emit_array_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr, bool set); + void emit_field_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr, bool set); + void emit_local_variable_ref(const gsc::context_ptr& ctx, const gsc::name_ptr& expr, bool set); + void emit_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr); + void emit_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr); + void emit_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void emit_clear_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void emit_create_local_vars(const gsc::context_ptr& ctx); + void emit_remove_local_vars(const gsc::context_ptr& ctx); + void emit_object(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_animtree(const gsc::context_ptr& ctx, const gsc::animtree_ptr& animtree); + void emit_animation(const gsc::context_ptr& ctx, const gsc::animation_ptr& animation); + void emit_istring(const gsc::context_ptr& ctx, const gsc::istring_ptr& str); + void emit_string(const gsc::context_ptr& ctx, const gsc::string_ptr& str); + void emit_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec); + void emit_float(const gsc::context_ptr& ctx, const gsc::float_ptr& num); + void emit_integer(const gsc::context_ptr& ctx, const gsc::integer_ptr& num); + void emit_false(const gsc::context_ptr& ctx, const gsc::false_ptr& expr); + void emit_true(const gsc::context_ptr& ctx, const gsc::true_ptr& expr); + void emit_opcode(const gsc::context_ptr& ctx, opcode op); + void emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::string& data); + void emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::vector& data); + void process_thread(const gsc::context_ptr& ctx, const gsc::thread_ptr& thread); + void process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt); + void process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt); + void process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt); + void process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void process_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt); + void process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void register_variable(const gsc::context_ptr& ctx, const std::string& name); + void initialize_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name); + void create_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name); + auto variable_stack_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::uint8_t; + auto variable_create_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string; + auto variable_access_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string; + auto variable_initialized(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> bool; + auto is_local_call(const std::string& name) -> bool; + auto is_builtin_call(const std::string& name) -> bool; + auto is_builtin_func(const std::string& name) -> bool; + auto is_builtin_method(const std::string& name) -> bool; + auto is_constant_condition(const gsc::expr_ptr& expr) -> bool; + auto create_label() -> std::string; + auto insert_label() -> std::string; + void insert_label(const std::string& label); + + auto map_known_includes(const std::string& include) -> bool; +}; + +} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/decompiler.cpp b/src/iw6/xsk/decompiler.cpp new file mode 100644 index 00000000..18f2e8ed --- /dev/null +++ b/src/iw6/xsk/decompiler.cpp @@ -0,0 +1,3154 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw6.hpp" + +namespace xsk::gsc::iw6 +{ + +auto decompiler::output() -> std::vector +{ + std::vector output; + + auto data = std::make_unique(0x100000); + data->write_string("// IW6 PC GSC\n// Decompiled by https://github.com/xensik/gsc-tool\n"); + data->write_string(program_->print()); + + output.resize(data->pos()); + std::memcpy(output.data(), data->buffer().data(), output.size()); + + return output; +} + +void decompiler::decompile(const std::string& file, std::vector& functions) +{ + filename_ = file; + program_ = std::make_unique(); + + for (auto& func : functions) + { + auto name = std::make_unique(func->name.substr(4)); + auto params = std::make_unique(); + auto block = std::make_unique(); + func_ = std::make_unique(std::move(name),std::move(params),std::move(block)); + + labels_ = func->labels; + expr_labels_.clear(); + stack_ = std::stack(); + + this->decompile_function(func); + + this->process_stack(func_); + + program_->definitions.push_back(gsc::define_ptr(std::move(func_))); + } +} + +void decompiler::decompile_function(const gsc::function_ptr& func) +{ + this->decompile_statements(func); + + if(stack_.size() > 0) + { + throw gsc::decomp_error("stack not emty at function end"); + } + + auto& block = func_->block; + + gsc::context ctx; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.back().as_node->loc.begin.line); + + // remove last return + block->stmts.pop_back(); + + // hotfix empty else block at func end + if(block->stmts.size() > 0 && block->stmts.back().as_node->type == gsc::node_t::asm_jump) + { + if(block->stmts.back().as_jump->value == ctx.loc_end) + block->stmts.pop_back(); + } + + blocks_.push_back(ctx); + this->decompile_block(block); + blocks_.pop_back(); +} + +void decompiler::decompile_statements(const gsc::function_ptr& func) +{ + std::uint32_t last_null_loc = 0; + + for (auto& inst : func->instructions) + { + auto loc = gsc::location(&filename_, inst->index); + + const auto itr = func->labels.find(inst->index); + + if (itr != func->labels.end()) + { + for(auto& entry : expr_labels_) + { + if(entry == itr->second) + { + decompile_expr(); + } + } + } + + switch (opcode(inst->opcode)) + { + case opcode::OP_End: + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::make_unique())); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_Return: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + auto stmt = gsc::stmt_ptr(std::make_unique(expr->loc, std::move(expr))); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_GetZero: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetByte: + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetInteger: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetNegByte: + case opcode::OP_GetNegUnsignedShort: + { + auto node = std::make_unique(loc, "-" + inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetFloat: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetVector: + { + auto x = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto y = gsc::expr_ptr(std::make_unique(loc, inst->data[1])); + auto z = gsc::expr_ptr(std::make_unique(loc, inst->data[2])); + auto node = std::make_unique(loc, std::move(x), std::move(y), std::move(z)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetString: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetIString: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetUndefined: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EmptyArray: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetLevel: + case opcode::OP_GetLevelObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnim: + case opcode::OP_GetAnimObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetSelf: + case opcode::OP_GetSelfObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetGame: + case opcode::OP_GetGameRef: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnimation: + { + auto tree = utils::string::unquote(inst->data[0]); + + if(tree != "") + { + auto treename = std::make_unique(loc, inst->data[0]); + auto animtree = std::make_unique(loc, std::move(treename)); + program_->definitions.push_back(gsc::define_ptr(std::move(animtree))); + } + + auto node = std::make_unique(loc, utils::string::unquote(inst->data[1])); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnimTree: + { + auto tree = utils::string::unquote(inst->data[0]); + + if(tree != "") + { + auto treename = std::make_unique(loc, inst->data[0]); + auto animtree = std::make_unique(loc, std::move(treename)); + program_->definitions.push_back(gsc::define_ptr(std::move(animtree))); + } + + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetThisthread: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_GetBuiltinMethod: + { + auto file = std::make_unique(loc); + auto func = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_GetLocalFunction: + { + auto file = std::make_unique(loc); + auto func = std::make_unique(loc, inst->data[0].substr(4)); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_GetFarFunction: + { + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + auto func = std::make_unique(loc, inst->data[1]); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + }; + break; + case opcode::OP_CreateLocalVariable: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_RemoveLocalVariables: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_EvalLocalVariableCached0: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached1: + { + auto node = std::make_unique(loc, "1"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached2: + { + auto node = std::make_unique(loc, "2"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached3: + { + auto node = std::make_unique(loc, "3"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached4: + { + auto node = std::make_unique(loc, "4"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached5: + { + auto node = std::make_unique(loc, "5"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayCached: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalArray: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalNewLocalArrayRefCached0: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayRefCached0: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, "0")); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayRefCached: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalArrayRef: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_ClearArray: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = key.as_node->loc; + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(key))); + auto rvalue = gsc::expr_ptr(std::make_unique(loc)); + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr))); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_AddArray: + { + auto var = std::move(stack_.top()); + stack_.pop(); + auto array = std::move(stack_.top()); + stack_.pop(); + + if (array->type == gsc::node_t::data_empty_array) + { + auto args = std::make_unique(loc); + args->list.push_back(std::move(var)); + auto expr = std::make_unique(array->loc, std::move(args)); + stack_.push(std::move(expr)); + } + else if (array->type == gsc::node_t::expr_add_array) + { + (*(gsc::expr_add_array_ptr*)&array)->args->list.push_back(std::move(var)); + stack_.push(std::move(array)); + } + else + { + throw gsc::decomp_error("unknown add array type (could be an array variable name?)"); + } + } + break; + case opcode::OP_PreScriptCall: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_ScriptLocalFunctionCall2: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalFunctionCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalChildThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodThreadCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodChildThreadCall: + { + // TODO: child things... + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarFunctionCall2: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarFunctionCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarMethodCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[2]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[1])); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarMethodThreadCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[2]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[1])); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFunctionCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodCallPointer: + { + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptChildThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodChildThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto obj = gsc::expr_ptr(std::make_unique()); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, true, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethodPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, true, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin0: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin1: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 1; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin2: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 2; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin3: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 3; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin4: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 4; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin5: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 5; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod0: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod1: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 1; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod2: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 2; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod3: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 3; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod4: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 4; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod5: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 5; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_DecTop: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + loc = expr->loc; + auto stmt = std::make_unique(loc, std::move(*(gsc::expr_call_ptr*)&expr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_inc: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_dec: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_or: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_ex_or: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_and: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_equality: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_inequality: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_less: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_greater: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_less_equal: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_greater_equal: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_shift_left: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_shift_right: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_plus: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_minus: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_multiply: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_divide: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_mod: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_wait: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + loc = expr->loc; + auto stmt = std::make_unique(loc, std::move(expr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_waittillFrameEnd: + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_waittill: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = nstr.as_node->loc; + auto args = std::make_unique(loc); + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr), std::move(args)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_waittillmatch: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto expr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = expr.as_node->loc; + + gsc::expr_arguments_ptr args = std::make_unique(); + args->loc = loc; + + while(stack_.size() > 0) + { + auto node = std::move(stack_.top()); + stack_.pop(); + args->loc = node->loc; + args->list.push_back(std::move(node)); + + } + loc = args->loc; + + auto stmt = std::make_unique(loc, std::move(obj), std::move(expr), std::move(args)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_clearparams: + { + auto args = std::make_unique(loc); + auto var = std::move(stack_.top()); + stack_.pop(); + + while(var->type != gsc::node_t::stmt_waittill && var->type != gsc::node_t::stmt_waittillmatch) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + } + + if(var->type == gsc::node_t::stmt_waittill) + { + (*(gsc::stmt_waittill_ptr*)&var)->args = std::move(args); + } + + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(var))); + } + break; + case opcode::OP_checkclearparams: + { + // no needed + } + break; + case opcode::OP_notify: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_voidcodepos) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr), std::move(args)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_endon: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = nstr.as_node->loc; + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_voidCodepos: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_vector: + { + auto x = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto y = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto z = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = z.as_node->loc; + auto expr = std::make_unique(loc, std::move(x), std::move(y), std::move(z)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_size: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_EvalLevelFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalAnimFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalSelfFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalFieldVariable: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalLevelFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalAnimFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalSelfFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_ClearFieldVariable: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto expr = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto undef = gsc::expr_ptr(std::make_unique(loc)); + auto e = std::make_unique(loc, std::move(expr), std::move(undef)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::make_unique(loc, std::move(e)))); + } + break; + case opcode::OP_SafeCreateVariableFieldCached: + { + func_->params->list.push_back(std::make_unique(loc, "var_" + inst->data[0])); + } + break; + case opcode::OP_SafeSetWaittillVariableFieldCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableRefCached0: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableRefCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_SetLevelFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc,std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetVariableField: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + + if(lvalue.as_node->type == gsc::node_t::expr_increment) + { + auto stmt = std::make_unique(loc, std::move(lvalue.as_increment)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + else if(lvalue.as_node->type == gsc::node_t::expr_decrement) + { + auto stmt = std::make_unique(loc, std::move(lvalue.as_decrement)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + else + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + } + break; + case opcode::OP_SetAnimFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetSelfFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetLocalVariableFieldCached0: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, "0")); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetNewLocalVariableFieldCached0: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + + if(func_->block->stmts.size() > 0) + { + std::vector creates; + + while(func_->block->stmts.back().as_node->type == gsc::node_t::asm_create) + { + auto& entry = func_->block->stmts.back(); + if(loc.begin.line < entry.as_node->loc.begin.line) + { + creates.push_back(entry.as_asm_create->index); + func_->block->stmts.pop_back(); + continue; + } + break; + } + + std::reverse(creates.begin(), creates.end()); + lvalue.as_asm_create->vars = creates; + } + + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetLocalVariableFieldCached: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_ClearLocalVariableFieldCached: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_ClearLocalVariableFieldCached0: + { + auto stmt = std::make_unique(loc,"0"); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_EvalLocalVariableObjectCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_CastFieldObject: + case opcode::OP_CastBool: + { + //continue; + } + break; + case opcode::OP_BoolNot: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_BoolComplement: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_switch: + { + auto expr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = expr.as_node->loc; + auto sw = std::make_unique(loc, std::move(expr), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(sw))); + } + break; + case opcode::OP_endswitch: + { + auto count = inst->data[0]; + inst->data.erase(inst->data.begin()); + auto data = inst->data; + auto end = std::make_unique(loc, data, count); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(end))); + } + break; + case opcode::OP_jump: + { + auto expr = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + + } + break; + case opcode::OP_jumpback: + { + auto expr = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnTrue: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto e_not = gsc::expr_ptr(std::make_unique(loc, std::move(lvalue))); + auto expr = std::make_unique(loc, std::move(e_not), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnFalse: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnTrueExpr: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + stack_.push(std::move(expr)); + expr_labels_.push_back(inst->data[0]); + } + break; + case opcode::OP_JumpOnFalseExpr: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + stack_.push(std::move(expr)); + expr_labels_.push_back(inst->data[0]); + } + break; + default: + throw gsc::decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); + break; + } + } +} + +void decompiler::decompile_expr() +{ + auto expr = std::move(stack_.top()); + stack_.pop(); + + auto jump_expr = std::move(stack_.top()); + stack_.pop(); + auto loc = jump_expr->loc; + + if(jump_expr->type == gsc::node_t::asm_jump_true_expr) + { + auto lvalue = std::move((*(gsc::asm_jump_true_expr_ptr*)&jump_expr)->expr); + auto rvalue = gsc::expr_ptr(std::move(expr)); + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(e)); + } + else if(jump_expr->type == gsc::node_t::asm_jump_false_expr) + { + auto lvalue = std::move((*(gsc::asm_jump_false_expr_ptr*)&jump_expr)->expr); + auto rvalue = gsc::expr_ptr(std::move(expr)); + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(e)); + } + else + { + throw gsc::decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); + } +} + +void decompiler::decompile_block(const gsc::stmt_list_ptr& block) +{ + this->decompile_search_infinite(block); + this->decompile_search_loop(block); + this->decompile_search_switch(block); + this->decompile_search_ifelse(block); + this->decompile_break_continue(block); + this->decompile_nulls(block); +} + +void decompiler::decompile_nulls(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::null) + { + block->stmts.erase(block->stmts.begin() + index); + } + else index++; + } +} + +void decompiler::decompile_search_infinite(const gsc::stmt_list_ptr& block) +{ + std::int32_t index = block->stmts.size() - 1; + + while(index >= 0) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_jump_back) + { + auto break_loc = last_location_index(block, index) ? blocks_.back().loc_end : utils::string::va("loc_%X", block->stmts.at(index+1).as_node->loc.begin.line); + auto begin_loc = block->stmts.at(index).as_jump_back->value; + auto start = find_location_index(block, begin_loc); + + if(block->stmts.at(start).as_node->type != gsc::node_t::asm_jump_cond) + { + decompile_infinite(block, start, index); + index = start; + } + else if (block->stmts.at(start).as_cond->value != break_loc) + { + decompile_infinite(block, start, index); + index = start; + } + } + + index--; + } +} + +void decompiler::decompile_search_loop(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + auto& stmt = block->stmts.at(index); + + if(stmt.as_node->type == gsc::node_t::asm_jump_cond) + { + std::uint32_t end; + if(stmt.as_cond->value == blocks_.back().loc_end) + { + end = block->stmts.size() - 1; + } + else + { + end = find_location_index(block, stmt.as_cond->value) - 1; + } + + if(block->stmts.at(end).as_node->type == gsc::node_t::asm_jump_back + && utils::string::va("loc_%X", block->stmts.at(index).as_node->loc.begin.line) == block->stmts.at(end).as_jump_back->value) + { + decompile_loop(block, index, end); + index = 0; + } + } + index++; + } +} + +void decompiler::decompile_search_switch(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_switch) + { + decompile_switch(block, index); + } + + index++; + } +} + +void decompiler::decompile_search_ifelse(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + auto& stmt = block->stmts.at(index); + + if(stmt.as_node->type == gsc::node_t::asm_jump_cond) + { + std::uint32_t end; + if(stmt.as_cond->value == blocks_.back().loc_end) + { + end = block->stmts.size() - 1; + } + else + { + end = find_location_index(block, stmt.as_cond->value) - 1; + } + + auto last_loc = blocks_.back().loc_end; + + if(block->stmts.at(end).as_node->type == gsc::node_t::asm_jump) + { + // if block is a loop check break, continue + if(block->stmts.at(end).as_jump->value == blocks_.back().loc_continue) + { + // last if/else inside a loop still trigger this :( + decompile_if(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == blocks_.back().loc_break) + { + decompile_if(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == blocks_.back().loc_end) + { + decompile_ifelse(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == stmt.as_cond->value) + { + decompile_if(block, index, end); // if block, have a last empty else inside + } + else + { + decompile_ifelse(block, index, end); // TODO: if else block is empty, convert it to only if! + } + } + else if(block->stmts.at(end).as_node->type == gsc::node_t::stmt_return + && block->stmts.at(end).as_return->expr.as_node->type == gsc::node_t::null) + { + if(blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") + { + decompile_if(block, index, end); // inside a loop cant be last + } + else if(end - index == 1) + { + decompile_if(block, index, end); // only one explicit return + } + else if(block->stmts.back().as_node->type != gsc::node_t::stmt_return) + { + decompile_if(block, index, end); // block end is not a last return + } + else if(blocks_.back().is_last && block->stmts.back().as_node->type != gsc::node_t::stmt_return) + { + decompile_if(block, index, end); // inside a last block but is not and inner last + } + else if(find_location_reference(block, end, block->stmts.size(), last_loc)) + { + decompile_if(block, index, end); // reference to func end after the if + } + else if(blocks_.size() > 1 && !blocks_.back().is_last) + { + decompile_if(block, index, end); // IW6 _bots::think, fake last ifelse + } + else + { + decompile_last_ifelse(block, index, end); // special case + } + } + else + { + decompile_if(block, index, end); + } + } + index++; + } +} + +void decompiler::decompile_break_continue(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_jump) + { + auto loc = block->stmts.at(index).as_node->loc; + auto jump_loc = block->stmts.at(index).as_jump->value; + + if(jump_loc == blocks_.back().loc_continue) + { + block->stmts.erase(block->stmts.begin() + index); + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + block->stmts.insert(block->stmts.begin() + index, std::move(stmt)); + } + else if(jump_loc == blocks_.back().loc_break) + { + block->stmts.erase(block->stmts.begin() + index); + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + block->stmts.insert(block->stmts.begin() + index, std::move(stmt)); + } + } + + index++; + } +} + +void decompiler::decompile_if(const gsc::stmt_list_ptr& block, std::uint32_t begin, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_end = block->stmts.at(begin).as_cond->value; + ctx.loc_break = blocks_.back().loc_break; + ctx.loc_continue = blocks_.back().loc_continue; + + auto loc = block->stmts.at(begin).as_node->loc; + auto expr = std::move(block->stmts.at(begin).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + begin); // remove condition + + auto if_block = std::make_unique(loc); + + for(auto i = begin; i < end; i++) + { + if_block->stmts.push_back(std::move(block->stmts[begin])); + block->stmts.erase(block->stmts.begin() + begin); + } + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)))); + block->stmts.insert(block->stmts.begin() + begin, std::move(stmt)); +} + +void decompiler::decompile_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_break = blocks_.back().loc_break; + ctx.loc_continue = blocks_.back().loc_continue; + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto if_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) // skip the jump + { + if_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + auto end_loc = block->stmts.at(start).as_jump->value; + + block->stmts.erase(block->stmts.begin() + start); // remove jump + + std::uint32_t end_index; + + if(end_loc == blocks_.back().loc_end) + { + end_index = block->stmts.size(); + } + else + { + end_index = find_location_index(block, end_loc); + } + + gsc::context ctx2; + ctx2.loc_end = end_loc; + ctx2.loc_break = blocks_.back().loc_break; + ctx2.loc_continue = blocks_.back().loc_continue; + + auto else_block = std::make_unique(loc); + + for(auto i = start; i < end_index; i++) + { + else_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx2); + decompile_block(else_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)), gsc::stmt_ptr(std::move(else_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_last_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.is_last = true; + + auto inner_end = find_location_index(block, block->stmts.at(start).as_cond->value) - 1; + ctx.loc_end = utils::string::va("loc_%X",block->stmts.at(inner_end).as_node->loc.begin.line); + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto if_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + if_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + block->stmts.erase(block->stmts.begin() + start); // remove if block return; + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + if(start == block->stmts.size()) + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); + } + else + { + gsc::context ctx2; + ctx2.is_last = true; + + auto else_block = std::make_unique(loc); + + end = block->stmts.size(); + ctx2.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); // return is the block end + + for(auto i = start; i < end; i++) + { + else_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + else_block->stmts.pop_back(); // remove else return; + + blocks_.push_back(ctx2); + decompile_block(else_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)), gsc::stmt_ptr(std::move(else_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); + } +} + +void decompiler::decompile_infinite(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = last_location_index(block, end) ? blocks_.back().loc_end : utils::string::va("loc_%X", block->stmts.at(end+1).as_node->loc.begin.line); + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + + auto loc = block->stmts.at(start).as_node->loc; + + block->stmts.erase(block->stmts.begin() + end); // remove jump back + + auto for_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + for_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(for_block); + blocks_.pop_back(); + + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + auto expr = gsc::expr_ptr(std::make_unique()); + auto post_expr = gsc::stmt_ptr(std::make_unique()); + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(pre_expr), std::move(expr), std::move(post_expr), gsc::stmt_ptr(std::move(for_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + auto& last_stmt = block->stmts.at(end-1); + if(last_stmt.as_node->type == gsc::node_t::stmt_assign) + { + if(last_stmt.as_assign->expr->type == gsc::node_t::expr_assign_equal) + { + auto& rval = last_stmt.as_assign->expr->rvalue; + if(rval.as_node->type == gsc::node_t::expr_call) + { + if(rval.as_call->func.as_node->type == gsc::node_t::expr_call_function) + { + if(utils::string::to_lower(rval.as_call->func.as_func->name->value) == "getnextarraykey") + { + auto ref2 = utils::string::va("loc_%X", block->stmts.at(start).as_node->loc.begin.line); + if(find_location_reference(block, 0, start, ref2)) + { + // begin is at condition, not pre-expr + //decompile_while(block, start, end); + //return; + } + else + { + decompile_foreach(block, start, end); + return; + } + } + } + } + } + + if(start > 0) // while at func start + { + auto index = 1; + while(block->stmts.at(start - index).as_node->type == gsc::node_t::asm_create) + { + if(start - index > 0) + index++; + } + + if(block->stmts.at(start - index).as_node->type == gsc::node_t::stmt_assign) + { + auto ref = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + auto ref2 = utils::string::va("loc_%X", block->stmts.at(start).as_node->loc.begin.line); + + if(find_location_reference(block, start, end, ref)) + { + // continue is at jumpback, not post-expr + decompile_while(block, start, end); + return; + } + else if(find_location_reference(block, 0, start, ref2)) + { + // begin is at condition, not pre-expr + decompile_while(block, start, end); + return; + } + else + { + decompile_for(block, start, end); + return; + } + } + } + } + + decompile_while(block, start, end); +} + +void decompiler::decompile_while(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(start).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X",block->stmts.at(end).as_node->loc.begin.line); + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + end); // remove jump back + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto while_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + while_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(while_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(while_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_for(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(start).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + + // remove emit local var_creates + std::vector creates; + while(block->stmts.at(start - 1).as_node->type == gsc::node_t::asm_create) + { + creates.push_back(block->stmts.at(start - 1).as_asm_create->index); + block->stmts.erase(block->stmts.begin() + start - 1); + start--; + end--; + } + + std::reverse(creates.begin(), creates.end()); + + auto loc = block->stmts.at(start - 1).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + pre_expr.as_list->stmts.push_back(std::move(block->stmts.at(start - 1))); + pre_expr.as_list->is_expr = true; + auto post_expr = gsc::stmt_ptr(std::make_unique()); + post_expr.as_list->stmts.push_back(std::move(block->stmts.at(end - 1))); + post_expr.as_list->is_expr = true; + + start = start - 1; + end = end - 2; + for(auto i = start; i < start + 2; i++) // remove prologue (pre-expr, condition) + { + block->stmts.erase(block->stmts.begin() + start); + } + + end = end - 1; // set end in post-expr + for(auto i = end; i < end + 2; i++) // remove epilogue (post-expr, jump back) + { + block->stmts.erase(block->stmts.begin() + end); + } + + auto for_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + for_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(for_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(pre_expr), std::move(expr), std::move(post_expr), gsc::stmt_ptr(std::move(for_block)))); + stmt.as_for->vars = creates; + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_foreach(const gsc::stmt_list_ptr& block, std::uint32_t begin, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(begin).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + + // remove local var_creates + std::vector creates; + while(block->stmts.at(begin - 1).as_node->type == gsc::node_t::asm_create) + { + creates.push_back(block->stmts.at(begin - 1).as_asm_create->index); + block->stmts.erase(block->stmts.begin() + begin - 1); + begin--; + end--; + } + + std::reverse(creates.begin(), creates.end()); + + auto loc = block->stmts.at(begin - 2).as_node->loc; + + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + pre_expr.as_list->stmts.push_back(std::move(block->stmts[begin-2])); + pre_expr.as_list->stmts.push_back(std::move(block->stmts[begin-1])); + auto stmt0 = std::move(block->stmts[begin+1]); + + begin = begin - 2; + end = end - 4; + for(auto i = begin; i < begin + 4; i++) // remove prologue ( array, elem, cond, elemRef) + { + block->stmts.erase(block->stmts.begin() + begin); + } + + end = end - 1; // set end to post-expr + + for(auto i = end; i < end + 2; i++) // remove epilogue ( post-expr, jump back) + { + block->stmts.erase(block->stmts.begin() + end); + } + + if(block->stmts.size() > end && block->stmts.at(end).as_node->type == gsc::node_t::asm_clear) + { + block->stmts.erase(block->stmts.begin() + end); + } + + auto use_key = true; + + if(block->stmts.size() > end && block->stmts.at(end).as_node->type == gsc::node_t::asm_clear) + { + block->stmts.erase(block->stmts.begin() + end); + use_key = false; + } + + auto foreach_block = std::make_unique(loc); + + for(auto i = begin; i < end; i++) + { + foreach_block->stmts.push_back(std::move(block->stmts[begin])); + block->stmts.erase(block->stmts.begin() + begin); + } + + blocks_.push_back(ctx); + decompile_block(foreach_block); + blocks_.pop_back(); + + auto foreach_stmt = gsc::stmt_ptr(std::make_unique(loc, gsc::stmt_ptr(std::move(foreach_block)), use_key)); + foreach_stmt.as_foreach->vars = creates; + foreach_stmt.as_foreach->pre_expr = std::move(pre_expr); + foreach_stmt.as_foreach->stmt0 = std::move(stmt0); + + block->stmts.insert(block->stmts.begin() + begin, std::move(foreach_stmt)); +} + +void decompiler::decompile_switch(const gsc::stmt_list_ptr& block, std::uint32_t start) +{ + gsc::context ctx; + ctx.loc_continue = blocks_.back().loc_continue; + ctx.loc_end = block->stmts.at(start).as_asm_switch->value; + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_asm_switch->expr); + auto end_loc = block->stmts.at(start).as_asm_switch->value; + auto end = find_location_index(block, end_loc); + + if(end == block->stmts.size() - 1) + { + ctx.loc_break = blocks_.back().loc_end; + } + else + { + ctx.loc_break = utils::string::va("loc_%X", block->stmts.at(end + 1).as_node->loc.begin.line); + } + + // collect cases + auto casenum = std::atol(block->stmts.at(end).as_asm_endswitch->count.data()); + auto data = block->stmts.at(end).as_asm_endswitch->data; + auto idx = 0; + + for(auto i = 0; i < casenum; i++) + { + if(data.at(idx) == "case") + { + auto loc_str = data.at(idx+2); + auto loc_idx = find_location_index(block, loc_str); + auto loc_pos = gsc::location(&filename_, std::stol(loc_str.substr(4), 0, 16)); + auto value = gsc::expr_ptr(std::make_unique(loc_pos, data.at(idx+1))); + auto list = std::make_unique(loc); + list->is_case = true; + auto stmt = gsc::stmt_ptr(std::make_unique(loc_pos, std::move(value), std::move(list))); + block->stmts.insert(block->stmts.begin() + loc_idx, std::move(stmt)); + idx += 3; + } + else if(data.at(idx) == "default") + { + auto loc_str = data.at(idx+1); + auto loc_idx = find_location_index(block, loc_str); + auto loc_pos = gsc::location(&filename_, std::stol(loc_str.substr(4), 0, 16)); + auto list = std::make_unique(loc); + list->is_case = true; + auto stmt = gsc::stmt_ptr(std::make_unique(loc_pos, std::move(list))); + block->stmts.insert(block->stmts.begin() + loc_idx, std::move(stmt)); + idx += 2; + } + } + + end = find_location_index(block, end_loc) - 1; // update end; + block->stmts.erase(block->stmts.begin() + start); // remove switch + block->stmts.erase(block->stmts.begin() + end); // remove endswitch + + //decompile block + auto sw_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + sw_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(sw_block); + blocks_.pop_back(); + + auto stmt_list = std::make_unique(loc); + gsc::stmt_ptr current_case = gsc::stmt_ptr(std::make_unique()); + + auto num = sw_block->stmts.size(); + for(auto i = 0; i < num; i++) + { + auto& entry = sw_block->stmts[0]; + + if(entry.as_node->type == gsc::node_t::stmt_case || entry.as_node->type == gsc::node_t::stmt_default) + { + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + current_case = std::move(sw_block->stmts[0]); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + else + { + if(current_case.as_node->type != gsc::node_t::null) + { + if(current_case.as_node->type == gsc::node_t::stmt_case) + { + current_case.as_case->stmt->stmts.push_back(std::move(sw_block->stmts[0])); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + else + { + current_case.as_default->stmt->stmts.push_back(std::move(sw_block->stmts[0])); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + } + else + { + gsc::decomp_error("missing case before stmt inside switch!"); + } + } + } + + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), std::move(stmt_list))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +auto decompiler::find_location_reference(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end, const std::string& location) -> bool +{ + for(auto i = start; i < end; i++) + { + if(block->stmts.at(i).as_node->type == gsc::node_t::asm_jump_cond) + { + if(block->stmts.at(i).as_cond->value == location) + return true; + } + else if(block->stmts.at(i).as_node->type == gsc::node_t::asm_jump) + { + if(block->stmts.at(i).as_jump->value == location) + return true; + } + } + + return false; +} + +auto decompiler::find_location_index(const gsc::stmt_list_ptr& block, const std::string& location) -> std::uint32_t +{ + auto index = 0; + + if(location == blocks_.back().loc_end) + return block->stmts.size(); + + for(auto& stmt : block->stmts) + { + if(stmt.as_node->loc.begin.line == std::stol(location.substr(4), 0, 16)) + return index; + + index++; + } + + throw gsc::decomp_error("LOCATION NOT FOUND! (" + location + ")"); +} + +auto decompiler::last_location_index(const gsc::stmt_list_ptr& block, std::uint32_t index) -> bool +{ + if(index == block->stmts.size() - 1) + return true; + + return false; +} + +void decompiler::process_stack(const gsc::thread_ptr& thread) +{ + auto ctx = std::make_unique(); + + process_parameters(ctx, thread->params); + process_stmt_list(ctx, thread->block); + +} + +void decompiler::process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + ctx->local_vars.push_back({ param->value, static_cast(std::stoi(param->value.substr(4))), true }); + ctx->local_vars_create_count++; + } +} + +void decompiler::process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt) +{ + switch(stmt.as_node->type) + { + case gsc::node_t::stmt_list: process_stmt_list(ctx, stmt.as_list); break; + case gsc::node_t::stmt_call: process_stmt_call(ctx, stmt.as_call); break; + case gsc::node_t::stmt_assign: process_stmt_assign(ctx, stmt.as_assign); break; + case gsc::node_t::stmt_endon: process_stmt_endon(ctx, stmt.as_endon); break; + case gsc::node_t::stmt_notify: process_stmt_notify(ctx, stmt.as_notify); break; + case gsc::node_t::stmt_wait: process_stmt_wait(ctx, stmt.as_wait); break; + case gsc::node_t::stmt_waittill: process_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_waittillmatch: process_stmt_waittillmatch(ctx, stmt.as_waittillmatch); break; + case gsc::node_t::stmt_if: process_stmt_if(ctx, stmt.as_if); break; + case gsc::node_t::stmt_ifelse: process_stmt_ifelse(ctx, stmt.as_ifelse); break; + case gsc::node_t::stmt_while: process_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: process_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: process_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: process_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_break: process_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_return: process_stmt_return(ctx, stmt.as_return); break; + case gsc::node_t::asm_remove: process_var_remove(ctx, stmt.as_asm_remove); break; + case gsc::node_t::asm_create: + { + auto expr = gsc::expr_ptr(std::make_unique(stmt.as_asm_create->index)); + process_var_create(ctx, expr, true); + } + break; + default: break; + } +} + +void decompiler::process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + for (const auto& entry : stmt->stmts) + { + process_stmt(ctx, entry); + } + + for(auto i = 0; i < stmt->stmts.size(); i++) + { + auto type = stmt->stmts.at(i).as_node->type; + + if(type == gsc::node_t::asm_create || type == gsc::node_t::asm_remove) + { + stmt->stmts.erase(stmt->stmts.begin() + i); + i--; + } + } +} + +void decompiler::process_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt) +{ + process_expr_call(ctx, stmt->expr); +} + +void decompiler::process_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt) +{ + process_expr_assign(ctx, stmt->expr); +} + +void decompiler::process_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt) +{ + process_expr_arguments(ctx, stmt->args); + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt) +{ + process_expr(ctx, stmt->expr); +} + +void decompiler::process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); + process_expr_arguments(ctx, stmt->args); +} + +void decompiler::process_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt) +{ + process_expr_arguments(ctx, stmt->args); + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx_if = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx_if); + + process_stmt(stmt->ctx_if, stmt->stmt_if); + + stmt->ctx_else = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx_else); + + process_stmt(stmt->ctx_else, stmt->stmt_else); + + std::vector childs({stmt->ctx_if.get(), stmt->ctx_else.get()}); + ctx->append(childs); + + if(stmt->stmt_if.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt_if.as_list->stmts.at(0))) + { + stmt->stmt_if = std::move(stmt->stmt_if.as_list->stmts.back()); + } + + if(stmt->stmt_else.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt_noif(stmt->stmt_else.as_list->stmts.at(0))) + { + stmt->stmt_else = std::move(stmt->stmt_else.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt); + + std::vector childs({ stmt->ctx.get() }); + + if(stmt->expr.as_node->type == gsc::node_t::null) + ctx->append_decompiler(stmt->ctx); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + process_stmt(ctx, stmt->pre_expr); + + for(auto& index : stmt->vars) + { + auto var = utils::string::va("var_%d", std::stoi(index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(index)), true }); + ctx->local_vars_create_count++; + } + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_expr(ctx, stmt->expr); + + process_stmt(stmt->ctx, stmt->stmt); + + process_stmt(ctx, stmt->post_expr); + + if(stmt->expr.as_node->type == gsc::node_t::null) + ctx->append_decompiler(stmt->ctx); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + process_stmt(ctx, stmt->pre_expr); + + for(auto& index : stmt->vars) + { + auto var1 = utils::string::va("var_%d", std::stoi(index)); + ctx->local_vars.push_back({ var1, static_cast(std::stoi(index)), true }); + ctx->local_vars_create_count++; + } + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt0); + process_stmt(stmt->ctx, stmt->stmt); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } + + stmt->array_expr = std::move(stmt->pre_expr.as_list->stmts[0].as_assign->expr->rvalue); + stmt->value_expr = std::move(stmt->stmt0.as_assign->expr->lvalue); + stmt->key_expr = std::move(stmt->pre_expr.as_list->stmts[1].as_assign->expr->lvalue); +} + +void decompiler::process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt_cases(stmt->ctx, stmt->stmt); + + ctx->append_decompiler(stmt->ctx, true); +} + +void decompiler::process_stmt_cases(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + std::vector childs; + + for(auto& entry : stmt->stmts) + { + if(entry.as_node->type == gsc::node_t::stmt_case) + { + entry.as_case->ctx = std::make_unique(); + ctx->transfer_decompiler(entry.as_case->ctx); + + process_stmt_list(entry.as_case->ctx, entry.as_case->stmt); + + if(entry.as_case->ctx->abort == gsc::abort_t::abort_break) + { + childs.push_back(entry.as_case->ctx.get()); + } + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + entry.as_default->ctx = std::make_unique(); + ctx->transfer_decompiler(entry.as_default->ctx); + + process_stmt_list(entry.as_default->ctx, entry.as_default->stmt); + + if(entry.as_default->ctx->abort == gsc::abort_t::abort_break) + { + childs.push_back(entry.as_default->ctx.get()); + } + } + } + + ctx->append(childs); +} + +void decompiler::process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + ctx->abort = gsc::abort_t::abort_break; +} + +void decompiler::process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(stmt->expr.as_node->type == gsc::node_t::null) + { + return; + } + + process_expr(ctx, stmt->expr); +} + +void decompiler::process_expr(const gsc::context_ptr& ctx, gsc::expr_ptr& expr) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_increment: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_decrement: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_equal: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_add: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_sub: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_mult: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_div: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_mod: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_shift_left: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_shift_right: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_or: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_and: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_exor: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_and: process_expr_and(ctx, expr.as_and); break; + case gsc::node_t::expr_or: process_expr_or(ctx, expr.as_or); break; + case gsc::node_t::expr_equality: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_inequality: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less_equal: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater_equal: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_or: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_and: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_exor: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_left: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_right: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_add: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_sub: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mult: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_div: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mod: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_complement: process_expr_complement(ctx, expr.as_complement); break; + case gsc::node_t::expr_not: process_expr_not(ctx, expr.as_not); break; + case gsc::node_t::expr_call: process_expr_call(ctx, expr.as_call); break; + case gsc::node_t::expr_function: process_expr_function(ctx, expr.as_function); break; + case gsc::node_t::expr_add_array: process_expr_add_array(ctx, expr.as_add_array); break; + case gsc::node_t::expr_array: process_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: process_field_variable(ctx, expr.as_field); break; + case gsc::node_t::expr_size: process_expr_size(ctx, expr.as_size); break; + case gsc::node_t::data_name: process_local_variable(ctx, expr.as_name); break; + case gsc::node_t::data_vector: process_vector(ctx, expr.as_vector); break; + case gsc::node_t::asm_create: process_var_create(ctx, expr); break; + case gsc::node_t::asm_access: process_var_access(ctx, expr); break; + default: break; + } +} + +void decompiler::process_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr) +{ + if(expr->type == gsc::node_t::expr_increment) + { + process_expr(ctx, expr->lvalue); + } + else if(expr->type == gsc::node_t::expr_decrement) + { + process_expr(ctx, expr->lvalue); + } + else + { + process_expr(ctx, expr->rvalue); + process_expr(ctx, expr->lvalue); + } +} + +void decompiler::process_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr) +{ + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr) +{ + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + if(expr->func.as_node->type == gsc::node_t::expr_call_pointer) + { + process_expr_call_pointer(ctx, expr); + } + else + { + process_expr_call_function(ctx, expr); + } +} + +void decompiler::process_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + process_expr_arguments(ctx, expr->func.as_pointer->args); + + if(expr->obj.as_node->type != gsc::node_t::null) + process_expr(ctx, expr->obj); + + process_expr(ctx, expr->func.as_pointer->expr); +} + +void decompiler::process_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + process_expr_arguments(ctx, expr->func.as_func->args); + + if(expr->obj.as_node->type != gsc::node_t::null) + process_expr(ctx, expr->obj); +} + +void decompiler::process_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& args) +{ + for(auto i = args->list.size(); i > 0; i--) + { + process_expr(ctx, args->list.at(i - 1)); + } +} + +void decompiler::process_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& expr) +{ + return; +} + +void decompiler::process_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr) +{ + for(auto& arg : expr->args->list) + { + process_expr(ctx, arg); + } +} + +void decompiler::process_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr) +{ + process_expr(ctx, expr->obj); +} + +void decompiler::process_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr) +{ + process_expr(ctx, expr->key); + process_expr(ctx, expr->obj); +} + +void decompiler::process_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr) +{ + process_expr(ctx, expr->obj); +} + +void decompiler::process_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + return; +} + +void decompiler::process_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec) +{ + process_expr(ctx, vec->z); + process_expr(ctx, vec->y); + process_expr(ctx, vec->x); +} + +void decompiler::process_var_create(const gsc::context_ptr& ctx, gsc::expr_ptr& expr, bool fromstmt) +{ + if(fromstmt) + { + auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); + ctx->local_vars_create_count++; + } + else + { + for(auto& entry : expr.as_asm_create->vars) + { + ctx->local_vars.push_back({ utils::string::va("var_%d", std::stoi(entry)), static_cast(std::stoi(entry)), true }); + ctx->local_vars_create_count++; + } + + auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); + ctx->local_vars_create_count++; + + expr = gsc::expr_ptr(std::make_unique(var)); + } +} + +void decompiler::process_var_access(const gsc::context_ptr& ctx, gsc::expr_ptr& expr) +{ + if(ctx->local_vars.size() <= std::stoi(expr.as_asm_access->index)) + { + printf("WARNING: bad local var access\n"); + } + else + { + auto var = ctx->local_vars.at(ctx->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; + expr = gsc::expr_ptr(std::make_unique(var)); + } +} + +void decompiler::process_var_remove(const gsc::context_ptr& ctx, const gsc::asm_remove_ptr& expr) +{ + ctx->local_vars_public_count = ctx->local_vars.size() - std::stoi(expr->index); +} + +} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/decompiler.hpp b/src/iw6/xsk/decompiler.hpp new file mode 100644 index 00000000..75e9e628 --- /dev/null +++ b/src/iw6/xsk/decompiler.hpp @@ -0,0 +1,93 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::iw6 +{ + +class decompiler : public gsc::decompiler +{ + std::string filename_; + std::unique_ptr output_; + gsc::program_ptr program_; + gsc::thread_ptr func_; + std::unordered_map labels_; + std::vector expr_labels_; + std::stack stack_; + std::vector blocks_; + +public: + auto output() -> std::vector; + void decompile(const std::string& file, std::vector& functions); + +private: + void decompile_function(const gsc::function_ptr& func); + void decompile_statements(const gsc::function_ptr& func); + void decompile_expr(); + void decompile_block(const gsc::stmt_list_ptr& block); + void decompile_nulls(const gsc::stmt_list_ptr& block); + void decompile_search_infinite(const gsc::stmt_list_ptr& block); + void decompile_search_loop(const gsc::stmt_list_ptr& block); + void decompile_search_switch(const gsc::stmt_list_ptr& block); + void decompile_search_ifelse(const gsc::stmt_list_ptr& block); + void decompile_break_continue(const gsc::stmt_list_ptr& block); + void decompile_if(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_last_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_infinite(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_while(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_for(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_foreach(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_switch(const gsc::stmt_list_ptr& block, std::uint32_t start); + auto find_location_reference(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end, const std::string& location) -> bool; + auto find_location_index(const gsc::stmt_list_ptr& block, const std::string& location) -> std::uint32_t; + auto last_location_index(const gsc::stmt_list_ptr& block, std::uint32_t index) -> bool; + void process_stack(const gsc::thread_ptr& thread); + void process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt); + void process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt); + void process_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt); + void process_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt); + void process_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt); + void process_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt); + void process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void process_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt); + void process_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt); + void process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt); + void process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt); + void process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void process_stmt_cases(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void process_expr(const gsc::context_ptr& ctx, gsc::expr_ptr& expr); + void process_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr); + void process_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr); + void process_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr); + void process_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr); + void process_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr); + void process_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr); + void process_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& arg_list); + void process_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& node); + void process_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr); + void process_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr); + void process_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr); + void process_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr); + void process_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void process_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec); + void process_var_create(const gsc::context_ptr& ctx, gsc::expr_ptr& expr, bool fromstmt = false); + void process_var_access(const gsc::context_ptr& ctx, gsc::expr_ptr& expr); + void process_var_remove(const gsc::context_ptr& ctx, const gsc::asm_remove_ptr& expr); +}; + +} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/disassembler.cpp b/src/iw6/xsk/disassembler.cpp new file mode 100644 index 00000000..da0e64d0 --- /dev/null +++ b/src/iw6/xsk/disassembler.cpp @@ -0,0 +1,571 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw6.hpp" + +namespace xsk::gsc::iw6 +{ + +auto disassembler::output() -> std::vector +{ + return std::move(functions_); +} + +auto disassembler::output_data() -> std::vector +{ + output_ = std::make_unique(0x100000); + + output_->write_string("// IW6 PC GSCASM\n"); + output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); + + for (auto& func : functions_) + { + this->print_function(func); + } + + std::vector output; + + output.resize(output_->pos()); + memcpy(output.data(), output_->buffer().data(), output.size()); + + return output; +} + +void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) +{ + filename_ = file; + script_ = std::make_unique(script); + stack_ = std::make_unique(stack); + functions_.clear(); + + script_->seek(1); + + while (stack_->is_avail() && script_->is_avail()) + { + functions_.push_back(std::make_unique()); + auto& func = functions_.back(); + + func->index = static_cast(script_->pos()); + func->size = stack_->read(); + func->id = stack_->read(); + func->name = "sub_"s + (func->id == 0 ? stack_->read_c_string() : resolver::token_name(func->id)); + + this->dissasemble_function(func); + + func->labels = labels_; + labels_.clear(); + } + + this->resolve_local_functions(); +} + +void disassembler::dissasemble_function(const gsc::function_ptr& func) +{ + auto size = func->size; + + while (size > 0) + { + func->instructions.push_back(std::make_unique()); + + auto& inst = func->instructions.back(); + inst->index = static_cast(script_->pos()); + inst->opcode = script_->read(); + inst->size = opcode_size(inst->opcode); + + this->dissasemble_instruction(inst); + + size -= inst->size; + } +} + +void disassembler::dissasemble_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_Return: + case opcode::OP_BoolNot: + case opcode::OP_CastBool: + case opcode::OP_inequality: + case opcode::OP_GetThisthread: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_checkclearparams: + case opcode::OP_CastFieldObject: + case opcode::OP_End: + case opcode::OP_size: + case opcode::OP_EmptyArray: + case opcode::OP_bit_and: + case opcode::OP_less_equal: + case opcode::OP_voidCodepos: + case opcode::OP_ClearVariableField: + case opcode::OP_divide: + case opcode::OP_GetSelf: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_plus: + case opcode::OP_BoolComplement: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_inc: + case opcode::OP_clearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_endon: + case opcode::OP_greater_equal: + case opcode::OP_GetSelfObject: + case opcode::OP_SetVariableField: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_less: + case opcode::OP_GetGameRef: + case opcode::OP_waittillFrameEnd: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_notify: + case opcode::OP_DecTop: + case opcode::OP_shift_left: + case opcode::OP_greater: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_minus: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_multiply: + case opcode::OP_mod: + case opcode::OP_GetGame: + case opcode::OP_waittill: + case opcode::OP_dec: + case opcode::OP_PreScriptCall: + case opcode::OP_GetAnim: + case opcode::OP_GetUndefined: + case opcode::OP_GetAnimObject: + case opcode::OP_GetLevelObject: + case opcode::OP_bit_ex_or: + case opcode::OP_equality: + case opcode::OP_ClearArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalArray: + case opcode::OP_vector: + case opcode::OP_bit_or: + case opcode::OP_AddArray: + case opcode::OP_waittillmatch2: + case opcode::OP_shift_right: + break; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetInteger: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetFloat: + inst->data.push_back(utils::string::va("%g", script_->read())); + break; + case opcode::OP_GetVector: + inst->data.push_back(utils::string::va("%g", script_->read())); + inst->data.push_back(utils::string::va("%g", script_->read())); + inst->data.push_back(utils::string::va("%g", script_->read())); + break; + case opcode::OP_GetString: + case opcode::OP_GetIString: + script_->seek(4); + inst->data.push_back(utils::string::to_literal(stack_->read_c_string())); + break; + case opcode::OP_GetAnimation: + script_->seek(8); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + break; + case opcode::OP_GetAnimTree: + script_->seek(1); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + break; + case opcode::OP_waittillmatch: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_EvalLocalArrayCached: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + this->disassemble_field_variable(inst); + break; + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + this->disassemble_local_call(inst, false); + break; + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + this->disassemble_local_call(inst, true); + break; + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + this->disassemble_far_call(inst, false); + break; + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + this->disassemble_far_call(inst, true); + break; + case opcode::OP_CallBuiltin: + this->disassemble_builtin_call(inst, false, true); + break; + case opcode::OP_CallBuiltinMethod: + this->disassemble_builtin_call(inst, true, true); + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + this->disassemble_builtin_call(inst, false, false); + break; + case opcode::OP_GetBuiltinMethod: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + this->disassemble_builtin_call(inst, true, false); + break; + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + this->disassemble_jump(inst, true, false); + break; + case opcode::OP_jumpback: + this->disassemble_jump(inst, false, true); + break; + case opcode::OP_jump: + this->disassemble_jump(inst, false, false); + break; + case opcode::OP_switch: + this->disassemble_switch(inst); + break; + case opcode::OP_endswitch: + this->disassemble_end_switch(inst); + break; + default: + throw gsc::disasm_error(utils::string::va("Unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); + } +} + +void disassembler::disassemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num) +{ + if (arg_num) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } + + if (method) + { + inst->data.push_back(resolver::method_name(script_->read())); + } + else + { + inst->data.push_back(resolver::function_name(script_->read())); + } +} + +void disassembler::disassemble_local_call(const gsc::instruction_ptr& inst, bool thread) +{ + std::int32_t offset = this->disassemble_offset(); + + inst->data.push_back(utils::string::va("%X", offset + inst->index + 1)); + + if (thread) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } +} + +void disassembler::disassemble_far_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->seek(3); + + if (thread) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } + + auto file_id = stack_->read(); + auto file_name = file_id == 0 ? stack_->read_c_string() : resolver::file_name(file_id); + auto func_id = stack_->read(); + auto func_name = func_id == 0 ? stack_->read_c_string() : resolver::token_name(func_id); + + inst->data.push_back(file_name != "" ? file_name : utils::string::va("_ID%i", file_id)); + inst->data.push_back(func_name != "" ? func_name : utils::string::va("_ID%i", func_id)); +} + +void disassembler::disassemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back) +{ + std::int32_t addr; + std::string label; + + if (expr) + { + addr = inst->index + 3 + script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + else if (back) + { + addr = inst->index + 3 - script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + else + { + addr = inst->index + 5 + script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + + labels_.insert({addr, label}); +} + +void disassembler::disassemble_field_variable(const gsc::instruction_ptr& inst) +{ + std::uint16_t field_id = script_->read(); + std::string field_name; + + if(field_id > 38305) + { + auto temp = stack_->read(); + field_name = temp == 0 ? stack_->read_c_string() : std::to_string(temp); + } + else + { + field_name = resolver::token_name(field_id); + } + + inst->data.push_back(field_name != "" ? field_name : utils::string::va("_ID%i", field_id)); +} + +void disassembler::disassemble_switch(const gsc::instruction_ptr& inst) +{ + std::int32_t addr = inst->index + 4 + script_->read(); + std::string label = utils::string::va("loc_%X", addr); + + inst->data.push_back(label); + labels_.insert({addr, label}); +} + +void disassembler::disassemble_end_switch(const gsc::instruction_ptr& inst) +{ + std::uint16_t case_num = script_->read(); + inst->data.push_back(utils::string::va("%i", case_num)); + + std::uint32_t internal_index = inst->index + 3; + + if (case_num) + { + for (auto i = case_num; i > 0; i--) + { + std::uint32_t case_label = script_->read(); + + if (case_label < 0x40000 && case_label > 0) + { + inst->data.push_back("case"); + inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); + } + else if (case_label == 0) + { + inst->data.push_back("default"); + stack_->read(); + } + else + { + inst->data.push_back("case"); + inst->data.push_back(utils::string::va("%i", (case_label - 0x800000) & 0xFFFFFF)); + } + + inst->size += 4; + internal_index += 4; + + auto addr = this->disassemble_offset() + internal_index; + std::string label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + + labels_.insert({addr, label}); + + inst->size += 3; + internal_index += 3; + } + } +} + +auto disassembler::disassemble_offset() -> std::int32_t +{ + std::array bytes = {}; + + for (auto i = 0; i < 3; i++) + { + bytes[i] = script_->read(); + } + + std::int32_t offset = *reinterpret_cast(bytes.data()); + + offset = (offset << 8) >> 10; + + return offset; +} + +void disassembler::resolve_local_functions() +{ + for (auto& func : functions_) + { + for (auto& inst : func->instructions) + { + switch (opcode(inst->opcode)) + { + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + inst->data.at(0) = this->resolve_function(inst->data[0]); + break; + default: + break; + } + } + } +} + +auto disassembler::resolve_function(const std::string& index) -> std::string +{ + if (utils::string::is_hex_number(index)) + { + std::uint32_t idx = std::stoul(index, nullptr, 16); + + for (auto& func : functions_) + { + if (func->index == idx) + { + return func->name; + } + } + + throw gsc::disasm_error(utils::string::va("Couldn't resolve function name at index '0x%04X'!", idx)); + } + + throw gsc::disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); +} + +void disassembler::print_function(const gsc::function_ptr& func) +{ + output_->write_string("\n"); + output_->write_string(utils::string::va("%s\n", func->name.data())); + + for (auto& inst : func->instructions) + { + const auto itr = func->labels.find(inst->index); + + if (itr != func->labels.end()) + { + output_->write_string(utils::string::va("\t%s\n", itr->second.data())); + } + + this->print_instruction(inst); + } + + output_->write_string("\n"); + output_->write_string(utils::string::va("end_%s\n", func->name.substr(4).data())); +} + +void disassembler::print_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_endswitch: + output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); + output_->write_string(utils::string::va(" %s\n", inst->data[0].data())); + { + std::uint32_t totalcase = std::stoul(inst->data[0]); + auto index = 0; + for (auto casenum = 0u; casenum < totalcase; casenum++) + { + if (inst->data[1 + index] == "case") + { + output_->write_string(utils::string::va("\t\t\t%s %s %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data(), inst->data[1 + index + 2].data())); + index += 3; + } + else if (inst->data[1 + index] == "default") + { + output_->write_string(utils::string::va("\t\t\t%s %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data())); + index += 2; + } + if (casenum != totalcase - 1) + { + output_->write_string("\n"); + } + } + } + break; + default: + output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); + for (auto& d : inst->data) + { + output_->write_string(utils::string::va(" %s", d.data())); + } + break; + } + + output_->write_string("\n"); +} + +} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/disassembler.hpp b/src/iw6/xsk/disassembler.hpp new file mode 100644 index 00000000..5e0a1584 --- /dev/null +++ b/src/iw6/xsk/disassembler.hpp @@ -0,0 +1,42 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::iw6 +{ + +class disassembler : public gsc::disassembler +{ + std::string filename_; + utils::byte_buffer_ptr script_; + utils::byte_buffer_ptr stack_; + utils::byte_buffer_ptr output_; + std::vector functions_; + std::unordered_map labels_; + +public: + auto output() -> std::vector; + auto output_data() -> std::vector; + void disassemble(const std::string& file, std::vector& script, std::vector& stack); + +private: + void dissasemble_function(const gsc::function_ptr& func); + void dissasemble_instruction(const gsc::instruction_ptr& inst); + void disassemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num); + void disassemble_local_call(const gsc::instruction_ptr& inst, bool thread); + void disassemble_far_call(const gsc::instruction_ptr& inst, bool thread); + void disassemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back); + void disassemble_field_variable(const gsc::instruction_ptr& inst); + void disassemble_switch(const gsc::instruction_ptr& inst); + void disassemble_end_switch(const gsc::instruction_ptr& inst); + auto disassemble_offset() -> std::int32_t; + void resolve_local_functions(); + auto resolve_function(const std::string& index) -> std::string; + void print_function(const gsc::function_ptr& func); + void print_instruction(const gsc::instruction_ptr& inst); +}; + +} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/iw6.cpp b/src/iw6/xsk/iw6.cpp new file mode 100644 index 00000000..bbd7ea41 --- /dev/null +++ b/src/iw6/xsk/iw6.cpp @@ -0,0 +1,181 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw6.hpp" + +namespace xsk::gsc::iw6 +{ + +auto opcode_size(std::uint8_t id) -> std::uint32_t +{ + switch (opcode(id)) + { + case opcode::OP_Return: + case opcode::OP_BoolNot: + case opcode::OP_CastBool: + case opcode::OP_inequality: + case opcode::OP_GetThisthread: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_checkclearparams: + case opcode::OP_CastFieldObject: + case opcode::OP_End: + case opcode::OP_size: + case opcode::OP_EmptyArray: + case opcode::OP_bit_and: + case opcode::OP_less_equal: + case opcode::OP_voidCodepos: + case opcode::OP_ClearVariableField: + case opcode::OP_divide: + case opcode::OP_GetSelf: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_plus: + case opcode::OP_BoolComplement: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_inc: + case opcode::OP_clearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_endon: + case opcode::OP_greater_equal: + case opcode::OP_GetSelfObject: + case opcode::OP_SetVariableField: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_less: + case opcode::OP_GetGameRef: + case opcode::OP_waittillFrameEnd: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_notify: + case opcode::OP_DecTop: + case opcode::OP_shift_left: + case opcode::OP_greater: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_minus: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_multiply: + case opcode::OP_mod: + case opcode::OP_GetGame: + case opcode::OP_waittill: + case opcode::OP_dec: + case opcode::OP_PreScriptCall: + case opcode::OP_GetAnim: + case opcode::OP_GetUndefined: + case opcode::OP_GetAnimObject: + case opcode::OP_GetLevelObject: + case opcode::OP_bit_ex_or: + case opcode::OP_equality: + case opcode::OP_ClearArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalArray: + case opcode::OP_vector: + case opcode::OP_bit_or: + case opcode::OP_AddArray: + case opcode::OP_waittillmatch2: + case opcode::OP_shift_right: + return 1; + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_CallBuiltinPointer: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_ScriptMethodChildThreadCallPointer: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_GetNegByte: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_EvalLocalArrayCached: + case opcode::OP_GetByte: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_GetAnimTree: + return 2; + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_GetUnsignedShort: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_GetBuiltinFunction: + case opcode::OP_jumpback: + case opcode::OP_GetBuiltinMethod: + case opcode::OP_waittillmatch: + case opcode::OP_GetNegUnsignedShort: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + case opcode::OP_JumpOnFalse: + case opcode::OP_endswitch: + return 3; + case opcode::OP_CallBuiltin: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_GetLocalFunction: + case opcode::OP_CallBuiltinMethod: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarMethodCall: + return 4; + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_GetFloat: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_switch: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + case opcode::OP_jump: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_GetInteger: + case opcode::OP_GetString: + case opcode::OP_GetIString: + return 5; + case opcode::OP_GetAnimation: + return 9; + case opcode::OP_GetVector: + return 13; + default: + throw std::runtime_error("Couldn't resolve instruction size for " + std::to_string(id)); + } +} + +} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/iw6.hpp b/src/iw6/xsk/iw6.hpp new file mode 100644 index 00000000..ba98f558 --- /dev/null +++ b/src/iw6/xsk/iw6.hpp @@ -0,0 +1,179 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "utils/xsk/utils.hpp" + +#include "assembler.hpp" +#include "disassembler.hpp" +#include "compiler.hpp" +#include "decompiler.hpp" +#include "resolver.hpp" + +namespace xsk::gsc::iw6 +{ + +enum class opcode : std::uint8_t +{ + OP_SetNewLocalVariableFieldCached0 = 0x17, + OP_EvalSelfFieldVariable = 0x18, + OP_Return = 0x19, + OP_CallBuiltin0 = 0x1A, + OP_CallBuiltin1 = 0x1B, + OP_CallBuiltin2 = 0x1C, + OP_CallBuiltin3 = 0x1D, + OP_CallBuiltin4 = 0x1E, + OP_CallBuiltin5 = 0x1F, + OP_CallBuiltin = 0x20, + OP_BoolNot = 0x21, + OP_ScriptFarMethodThreadCall = 0x22, + OP_JumpOnTrueExpr = 0x23, + OP_SetLevelFieldVariableField = 0x24, + OP_CastBool = 0x25, + OP_EvalNewLocalArrayRefCached0 = 0x26, + OP_CallBuiltinPointer = 0x27, + OP_inequality = 0x28, + OP_GetThisthread = 0x29, + OP_ClearFieldVariable = 0x2A, + OP_GetFloat = 0x2B, + OP_SafeCreateVariableFieldCached = 0x2C, + OP_ScriptFarFunctionCall2 = 0x2D, + OP_ScriptFarFunctionCall = 0x2E, + OP_ScriptFarChildThreadCall = 0x2F, + OP_ClearLocalVariableFieldCached0 = 0x30, + OP_ClearLocalVariableFieldCached = 0x31, + OP_checkclearparams = 0x32, + OP_CastFieldObject = 0x33, + OP_End = 0x34, + OP_size = 0x35, + OP_EmptyArray = 0x36, + OP_bit_and = 0x37, + OP_less_equal = 0x38, + OP_voidCodepos = 0x39, + OP_ScriptMethodThreadCallPointer = 0x3A, + OP_endswitch = 0x3B, + OP_ClearVariableField = 0x3C, + OP_divide = 0x3D, + OP_ScriptFarMethodChildThreadCall = 0x3E, + OP_GetUnsignedShort = 0x3F, + OP_JumpOnTrue = 0x40, + OP_GetSelf = 0x41, + OP_ScriptFarThreadCall = 0x42, + OP_ScriptLocalThreadCall = 0x43, + OP_SetLocalVariableFieldCached0 = 0x44, + OP_SetLocalVariableFieldCached = 0x45, + OP_plus = 0x46, + OP_BoolComplement = 0x47, + OP_ScriptMethodCallPointer = 0x48, + OP_inc = 0x49, + OP_RemoveLocalVariables = 0x4A, + OP_JumpOnFalseExpr = 0x4B, + OP_switch = 0x4C, + OP_clearparams = 0x4D, + OP_EvalLocalVariableRefCached0 = 0x4E, + OP_EvalLocalVariableRefCached = 0x4F, + OP_ScriptLocalMethodCall = 0x50, + OP_EvalFieldVariable = 0x51, + OP_EvalFieldVariableRef = 0x52, + OP_GetString = 0x53, + OP_ScriptFunctionCallPointer = 0x54, + OP_EvalLevelFieldVariable = 0x55, + OP_GetVector = 0x56, + OP_endon = 0x57, + OP_greater_equal = 0x58, + OP_GetSelfObject = 0x59, + OP_SetAnimFieldVariableField = 0x5A, + OP_SetVariableField = 0x5B, + OP_ScriptLocalFunctionCall2 = 0x5C, + OP_ScriptLocalFunctionCall = 0x5D, + OP_EvalLocalArrayRefCached0 = 0x5E, + OP_EvalLocalArrayRefCached = 0x5F, + OP_GetFarFunction = 0x60, + OP_less = 0x61, + OP_GetGameRef = 0x62, + OP_waittillFrameEnd = 0x63, + OP_SafeSetVariableFieldCached0 = 0x64, + OP_SafeSetVariableFieldCached = 0x65, + OP_ScriptMethodChildThreadCallPointer = 0x66, + OP_GetLevel = 0x67, + OP_notify = 0x68, + OP_DecTop = 0x69, + OP_shift_left = 0x6A, + OP_ScriptLocalMethodThreadCall = 0x6B, + OP_ScriptLocalMethodChildThreadCall = 0x6C, + OP_greater = 0x6D, + OP_EvalLocalVariableCached0 = 0x6E, + OP_EvalLocalVariableCached1 = 0x6F, + OP_EvalLocalVariableCached2 = 0x70, + OP_EvalLocalVariableCached3 = 0x71, + OP_EvalLocalVariableCached4 = 0x72, + OP_EvalLocalVariableCached5 = 0x73, + OP_EvalLocalVariableCached = 0x74, + OP_SafeSetWaittillVariableFieldCached = 0x75, + OP_jump = 0x76, + OP_ScriptThreadCallPointer = 0x77, + OP_GetZero = 0x78, + OP_wait = 0x79, + OP_minus = 0x7A, + OP_SetSelfFieldVariableField = 0x7B, + OP_EvalNewLocalVariableRefCached0 = 0x7C, + OP_multiply = 0x7D, + OP_CreateLocalVariable = 0x7E, + OP_ScriptLocalChildThreadCall = 0x7F, + OP_GetInteger = 0x80, + OP_mod = 0x81, + OP_EvalAnimFieldVariableRef = 0x82, + OP_GetBuiltinFunction = 0x83, + OP_GetGame = 0x84, + OP_waittill = 0x85, + OP_dec = 0x86, + OP_EvalLocalVariableObjectCached = 0x87, + OP_PreScriptCall = 0x88, + OP_GetAnim = 0x89, + OP_GetUndefined = 0x8A, + OP_EvalLevelFieldVariableRef = 0x8B, + OP_GetAnimObject = 0x8C, + OP_GetLevelObject = 0x8D, + OP_bit_ex_or = 0x8E, + OP_equality = 0x8F, + OP_ClearArray = 0x90, + OP_jumpback = 0x91, + OP_GetAnimation = 0x92, + OP_EvalAnimFieldVariable = 0x93, + OP_GetAnimTree = 0x94, + OP_GetIString = 0x95, + OP_EvalArrayRef = 0x96, + OP_EvalSelfFieldVariableRef = 0x97, + OP_GetNegByte = 0x98, + OP_GetBuiltinMethod = 0x99, + OP_CallBuiltinMethodPointer = 0x9A, + OP_EvalArray = 0x9B, + OP_vector = 0x9C, + OP_ScriptFarMethodCall = 0x9D, + OP_EvalLocalArrayCached = 0x9E, + OP_GetByte = 0x9F, + OP_ScriptChildThreadCallPointer = 0xA0, + OP_bit_or = 0xA1, + OP_AddArray = 0xA2, + OP_waittillmatch2 = 0xA3, + OP_waittillmatch = 0xA4, + OP_GetLocalFunction = 0xA5, + OP_GetNegUnsignedShort = 0xA6, + OP_shift_right = 0xA7, + OP_CallBuiltinMethod0 = 0xA8, + OP_CallBuiltinMethod1 = 0xA9, + OP_CallBuiltinMethod2 = 0xAA, + OP_CallBuiltinMethod3 = 0xAB, + OP_CallBuiltinMethod4 = 0xAC, + OP_CallBuiltinMethod5 = 0xAD, + OP_CallBuiltinMethod = 0xAE, + OP_JumpOnFalse = 0xAF, + OP_Count = 0xB0, +}; + +auto opcode_size(std::uint8_t op) -> std::uint32_t; + +} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/lexer.cpp b/src/iw6/xsk/lexer.cpp new file mode 100644 index 00000000..8f060935 --- /dev/null +++ b/src/iw6/xsk/lexer.cpp @@ -0,0 +1,2816 @@ +#line 1 "lexer.cpp" +#include "stdafx.hpp" +#include "iw6.hpp" +#include "parser.hpp" +using namespace xsk::gsc; + +#line 7 "lexer.cpp" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define iw6__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer iw6__create_buffer +#endif + +#ifdef yy_delete_buffer +#define iw6__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer iw6__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define iw6__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer iw6__scan_buffer +#endif + +#ifdef yy_scan_string +#define iw6__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string iw6__scan_string +#endif + +#ifdef yy_scan_bytes +#define iw6__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes iw6__scan_bytes +#endif + +#ifdef yy_init_buffer +#define iw6__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer iw6__init_buffer +#endif + +#ifdef yy_flush_buffer +#define iw6__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer iw6__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define iw6__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state iw6__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define iw6__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer iw6__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define iw6_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state iw6_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define iw6_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state iw6_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define iw6_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack iw6_ensure_buffer_stack +#endif + +#ifdef yylex +#define iw6_lex_ALREADY_DEFINED +#else +#define yylex iw6_lex +#endif + +#ifdef yyrestart +#define iw6_restart_ALREADY_DEFINED +#else +#define yyrestart iw6_restart +#endif + +#ifdef yylex_init +#define iw6_lex_init_ALREADY_DEFINED +#else +#define yylex_init iw6_lex_init +#endif + +#ifdef yylex_init_extra +#define iw6_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra iw6_lex_init_extra +#endif + +#ifdef yylex_destroy +#define iw6_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy iw6_lex_destroy +#endif + +#ifdef yyget_debug +#define iw6_get_debug_ALREADY_DEFINED +#else +#define yyget_debug iw6_get_debug +#endif + +#ifdef yyset_debug +#define iw6_set_debug_ALREADY_DEFINED +#else +#define yyset_debug iw6_set_debug +#endif + +#ifdef yyget_extra +#define iw6_get_extra_ALREADY_DEFINED +#else +#define yyget_extra iw6_get_extra +#endif + +#ifdef yyset_extra +#define iw6_set_extra_ALREADY_DEFINED +#else +#define yyset_extra iw6_set_extra +#endif + +#ifdef yyget_in +#define iw6_get_in_ALREADY_DEFINED +#else +#define yyget_in iw6_get_in +#endif + +#ifdef yyset_in +#define iw6_set_in_ALREADY_DEFINED +#else +#define yyset_in iw6_set_in +#endif + +#ifdef yyget_out +#define iw6_get_out_ALREADY_DEFINED +#else +#define yyget_out iw6_get_out +#endif + +#ifdef yyset_out +#define iw6_set_out_ALREADY_DEFINED +#else +#define yyset_out iw6_set_out +#endif + +#ifdef yyget_leng +#define iw6_get_leng_ALREADY_DEFINED +#else +#define yyget_leng iw6_get_leng +#endif + +#ifdef yyget_text +#define iw6_get_text_ALREADY_DEFINED +#else +#define yyget_text iw6_get_text +#endif + +#ifdef yyget_lineno +#define iw6_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno iw6_get_lineno +#endif + +#ifdef yyset_lineno +#define iw6_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno iw6_set_lineno +#endif + +#ifdef yyget_column +#define iw6_get_column_ALREADY_DEFINED +#else +#define yyget_column iw6_get_column +#endif + +#ifdef yyset_column +#define iw6_set_column_ALREADY_DEFINED +#else +#define yyset_column iw6_set_column +#endif + +#ifdef yywrap +#define iw6_wrap_ALREADY_DEFINED +#else +#define yywrap iw6_wrap +#endif + +#ifdef yyalloc +#define iw6_alloc_ALREADY_DEFINED +#else +#define yyalloc iw6_alloc +#endif + +#ifdef yyrealloc +#define iw6_realloc_ALREADY_DEFINED +#else +#define yyrealloc iw6_realloc +#endif + +#ifdef yyfree +#define iw6_free_ALREADY_DEFINED +#else +#define yyfree iw6_free +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. + */ +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yyg->yy_start = 1 + 2 * +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yyg->yy_start - 1) / 2) +#define YYSTATE YY_START +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +#define yy_new_buffer yy_create_buffer +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define iw6_wrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; + +typedef int yy_state_type; + +#define yytext_ptr yytext_r + +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yyg->yy_c_buf_p = yy_cp; +#define YY_NUM_RULES 96 +#define YY_END_OF_BUFFER 97 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[281] = + { 0, + 0, 0, 0, 0, 0, 0, 97, 95, 1, 2, + 84, 95, 95, 83, 87, 95, 45, 46, 81, 79, + 51, 80, 52, 82, 94, 54, 55, 68, 78, 69, + 90, 49, 50, 88, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, 90, 47, + 86, 48, 85, 5, 6, 5, 9, 10, 9, 65, + 0, 92, 0, 0, 0, 0, 74, 0, 63, 0, + 76, 0, 0, 72, 56, 70, 57, 71, 93, 8, + 4, 3, 73, 93, 94, 0, 0, 53, 60, 66, + 64, 67, 61, 90, 77, 90, 90, 90, 90, 90, + + 90, 90, 90, 90, 90, 90, 21, 26, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, 90, 75, + 62, 7, 11, 0, 92, 0, 0, 0, 0, 0, + 91, 0, 0, 0, 0, 92, 0, 93, 3, 93, + 93, 89, 58, 59, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 24, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, 0, 0, + 0, 0, 91, 0, 0, 91, 0, 43, 90, 36, + 28, 90, 90, 90, 22, 90, 90, 90, 41, 90, + 90, 90, 42, 40, 90, 90, 90, 37, 90, 17, + + 90, 0, 0, 0, 30, 90, 90, 90, 15, 38, + 90, 44, 90, 90, 90, 90, 90, 90, 90, 23, + 0, 0, 0, 90, 90, 90, 90, 16, 32, 27, + 90, 33, 90, 90, 0, 0, 0, 90, 90, 29, + 25, 90, 90, 90, 0, 12, 0, 90, 31, 90, + 90, 18, 14, 0, 90, 90, 39, 90, 90, 0, + 90, 35, 90, 90, 0, 34, 90, 90, 0, 90, + 90, 0, 90, 19, 0, 90, 13, 90, 20, 0 + } ; + +static const YY_CHAR yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 5, 6, 1, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, + 22, 23, 1, 1, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 25, 26, 27, 28, 29, 1, 30, 31, 32, 33, + + 34, 35, 36, 37, 38, 24, 39, 40, 41, 42, + 43, 24, 24, 44, 45, 46, 47, 48, 49, 24, + 50, 51, 52, 53, 54, 55, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static const YY_CHAR yy_meta[56] = + { 0, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 1, 4, 1, 1, + 1, 1, 1, 4, 1, 5, 1, 1, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 1, 1, 1, 1 + } ; + +static const flex_int16_t yy_base[295] = + { 0, + 0, 0, 53, 54, 55, 56, 530, 531, 531, 531, + 507, 55, 33, 506, 64, 58, 531, 531, 505, 55, + 531, 60, 508, 73, 71, 506, 531, 70, 502, 71, + 497, 531, 531, 500, 57, 44, 70, 72, 75, 78, + 48, 76, 86, 79, 90, 93, 88, 84, 103, 531, + 81, 531, 531, 531, 531, 504, 531, 531, 503, 531, + 104, 531, 132, 477, 476, 472, 531, 118, 531, 119, + 531, 127, 138, 531, 531, 531, 531, 531, 120, 531, + 531, 0, 531, 121, 133, 134, 0, 531, 494, 531, + 531, 531, 493, 488, 531, 38, 120, 117, 135, 126, + + 137, 122, 143, 139, 140, 144, 487, 486, 145, 148, + 149, 151, 152, 154, 160, 155, 156, 161, 162, 531, + 531, 531, 531, 185, 191, 202, 473, 478, 471, 192, + 531, 203, 200, 207, 204, 205, 212, 531, 0, 201, + 531, 482, 531, 531, 186, 194, 197, 206, 199, 196, + 215, 209, 208, 218, 220, 221, 222, 223, 224, 227, + 226, 231, 233, 232, 238, 239, 241, 242, 466, 466, + 463, 264, 265, 271, 266, 270, 277, 478, 255, 477, + 476, 262, 263, 257, 475, 258, 259, 272, 474, 273, + 279, 157, 473, 472, 280, 281, 285, 471, 282, 283, + + 284, 450, 448, 458, 467, 290, 293, 294, 466, 465, + 296, 464, 295, 297, 300, 304, 298, 306, 312, 463, + 444, 454, 457, 314, 299, 307, 317, 459, 458, 457, + 316, 456, 321, 322, 447, 446, 449, 323, 330, 452, + 451, 331, 332, 329, 442, 531, 433, 342, 448, 344, + 326, 345, 531, 435, 347, 346, 446, 349, 352, 430, + 355, 444, 357, 358, 423, 429, 359, 363, 363, 364, + 365, 372, 371, 377, 365, 366, 531, 368, 370, 531, + 408, 413, 418, 423, 426, 428, 433, 438, 443, 448, + 453, 357, 458, 463 + + } ; + +static const flex_int16_t yy_def[295] = + { 0, + 280, 1, 281, 281, 282, 282, 280, 280, 280, 280, + 280, 283, 280, 280, 280, 284, 280, 280, 280, 280, + 280, 280, 280, 280, 285, 280, 280, 280, 280, 280, + 286, 280, 280, 280, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 286, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 283, 280, 287, 280, 280, 280, 280, 288, 280, 289, + 280, 284, 290, 280, 280, 280, 280, 280, 280, 280, + 280, 291, 280, 280, 285, 285, 292, 280, 280, 280, + 280, 280, 280, 286, 280, 286, 286, 286, 286, 286, + + 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 286, 280, + 280, 280, 280, 283, 283, 287, 280, 280, 280, 288, + 280, 293, 289, 294, 284, 284, 290, 280, 291, 280, + 280, 292, 280, 280, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 280, 280, + 280, 288, 288, 293, 289, 289, 294, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, + + 286, 280, 280, 280, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, + 280, 280, 280, 286, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 280, 280, 280, 286, 286, 286, + 286, 286, 286, 286, 280, 280, 280, 286, 286, 286, + 286, 286, 280, 280, 286, 286, 286, 286, 286, 280, + 286, 286, 286, 286, 280, 286, 286, 286, 280, 286, + 286, 280, 286, 286, 280, 286, 280, 286, 286, 0, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280 + + } ; + +static const flex_int16_t yy_nxt[587] = + { 0, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 8, 33, 34, 31, 35, + 36, 37, 38, 39, 40, 41, 31, 42, 31, 43, + 31, 44, 31, 45, 46, 47, 48, 31, 49, 31, + 31, 50, 51, 52, 53, 55, 55, 58, 58, 62, + 59, 59, 64, 87, 56, 56, 62, 75, 68, 87, + 65, 69, 70, 87, 77, 145, 76, 106, 80, 66, + 63, 78, 87, 73, 81, 71, 84, 97, 85, 82, + 89, 90, 92, 93, 83, 87, 87, 87, 96, 98, + + 87, 87, 120, 87, 87, 101, 99, 104, 62, 87, + 107, 87, 100, 87, 102, 87, 103, 108, 87, 109, + 105, 110, 131, 111, 115, 117, 112, 131, 87, 63, + 113, 116, 118, 121, 61, 62, 125, 79, 140, 119, + 72, 114, 87, 132, 134, 87, 136, 87, 84, 280, + 85, 87, 73, 146, 138, 141, 147, 126, 87, 87, + 87, 148, 87, 137, 87, 87, 152, 150, 87, 87, + 87, 151, 149, 87, 87, 153, 87, 87, 154, 87, + 87, 87, 87, 155, 156, 87, 87, 87, 166, 62, + 160, 162, 157, 158, 159, 62, 131, 163, 167, 168, + + 214, 165, 161, 164, 61, 130, 125, 173, 131, 133, + 63, 87, 62, 62, 72, 176, 63, 132, 140, 87, + 136, 87, 87, 179, 87, 134, 178, 126, 174, 73, + 73, 87, 177, 87, 87, 141, 180, 137, 182, 181, + 87, 183, 185, 87, 184, 87, 87, 87, 87, 87, + 186, 87, 87, 188, 189, 190, 87, 87, 87, 194, + 191, 193, 187, 87, 87, 197, 87, 87, 131, 131, + 192, 198, 199, 130, 131, 173, 195, 196, 131, 133, + 87, 201, 87, 87, 87, 176, 200, 87, 87, 132, + 132, 134, 210, 205, 206, 134, 174, 87, 87, 209, + + 207, 211, 177, 208, 87, 87, 87, 87, 87, 87, + 87, 215, 212, 213, 217, 87, 218, 220, 87, 87, + 87, 87, 87, 87, 87, 87, 216, 227, 219, 87, + 232, 87, 87, 226, 225, 224, 230, 87, 229, 87, + 231, 87, 87, 233, 228, 239, 87, 87, 87, 234, + 238, 87, 240, 241, 87, 87, 87, 87, 257, 242, + 142, 244, 243, 249, 250, 251, 248, 87, 252, 87, + 87, 87, 87, 256, 87, 255, 261, 87, 262, 258, + 87, 264, 87, 87, 87, 259, 267, 266, 87, 87, + 87, 87, 263, 87, 271, 87, 87, 273, 277, 270, + + 279, 274, 87, 268, 276, 275, 272, 278, 54, 54, + 54, 54, 54, 57, 57, 57, 57, 57, 61, 61, + 61, 61, 61, 72, 72, 72, 72, 72, 86, 86, + 86, 94, 94, 124, 124, 124, 124, 124, 130, 130, + 130, 130, 130, 133, 133, 133, 133, 133, 135, 135, + 135, 135, 135, 139, 87, 139, 139, 139, 172, 172, + 172, 172, 172, 175, 175, 175, 175, 175, 269, 87, + 265, 87, 260, 87, 254, 253, 87, 87, 247, 246, + 245, 87, 87, 87, 87, 237, 236, 235, 87, 87, + 87, 87, 87, 223, 222, 221, 87, 87, 87, 87, + + 87, 87, 87, 87, 204, 203, 202, 87, 171, 170, + 169, 87, 87, 87, 144, 143, 129, 128, 127, 123, + 122, 95, 87, 91, 88, 79, 74, 67, 60, 280, + 7, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280 + } ; + +static const flex_int16_t yy_chk[587] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 4, 5, 6, 12, + 5, 6, 13, 96, 3, 4, 16, 20, 15, 36, + 13, 15, 15, 41, 22, 96, 20, 41, 24, 13, + 12, 22, 35, 16, 24, 15, 25, 36, 25, 24, + 28, 28, 30, 30, 24, 37, 25, 38, 35, 37, + + 39, 42, 51, 40, 44, 38, 37, 40, 61, 48, + 42, 43, 37, 47, 39, 45, 39, 42, 46, 43, + 40, 44, 68, 45, 47, 48, 46, 70, 49, 61, + 46, 47, 49, 51, 63, 72, 63, 79, 84, 49, + 73, 46, 98, 68, 70, 97, 73, 102, 85, 86, + 85, 100, 72, 97, 79, 84, 98, 63, 85, 86, + 99, 98, 101, 73, 104, 105, 102, 100, 103, 106, + 109, 101, 99, 110, 111, 103, 112, 113, 104, 114, + 116, 117, 192, 105, 106, 115, 118, 119, 117, 124, + 112, 114, 109, 110, 111, 125, 130, 115, 118, 119, + + 192, 116, 113, 115, 126, 132, 126, 132, 133, 134, + 124, 145, 135, 136, 137, 134, 125, 130, 140, 146, + 137, 150, 147, 146, 149, 133, 145, 126, 132, 135, + 136, 148, 134, 153, 152, 140, 147, 137, 149, 148, + 151, 150, 152, 154, 151, 155, 156, 157, 158, 159, + 153, 161, 160, 155, 156, 157, 162, 164, 163, 161, + 158, 160, 154, 165, 166, 164, 167, 168, 172, 173, + 159, 165, 166, 174, 175, 174, 162, 163, 176, 177, + 179, 168, 184, 186, 187, 177, 167, 182, 183, 172, + 173, 175, 187, 179, 182, 176, 174, 188, 190, 186, + + 183, 188, 177, 184, 191, 195, 196, 199, 200, 201, + 197, 195, 190, 191, 197, 206, 199, 201, 207, 208, + 213, 211, 214, 217, 225, 215, 196, 211, 200, 216, + 217, 218, 226, 208, 207, 206, 215, 219, 214, 224, + 216, 231, 227, 218, 213, 225, 233, 234, 238, 219, + 224, 251, 226, 227, 244, 239, 242, 243, 251, 231, + 292, 234, 233, 239, 242, 243, 238, 248, 244, 250, + 252, 256, 255, 250, 258, 248, 255, 259, 256, 252, + 261, 259, 263, 264, 267, 252, 263, 261, 268, 270, + 271, 276, 258, 278, 268, 279, 273, 270, 275, 267, + + 278, 271, 274, 264, 273, 272, 269, 276, 281, 281, + 281, 281, 281, 282, 282, 282, 282, 282, 283, 283, + 283, 283, 283, 284, 284, 284, 284, 284, 285, 285, + 285, 286, 286, 287, 287, 287, 287, 287, 288, 288, + 288, 288, 288, 289, 289, 289, 289, 289, 290, 290, + 290, 290, 290, 291, 266, 291, 291, 291, 293, 293, + 293, 293, 293, 294, 294, 294, 294, 294, 265, 262, + 260, 257, 254, 249, 247, 245, 241, 240, 237, 236, + 235, 232, 230, 229, 228, 223, 222, 221, 220, 212, + 210, 209, 205, 204, 203, 202, 198, 194, 193, 189, + + 185, 181, 180, 178, 171, 170, 169, 142, 129, 128, + 127, 108, 107, 94, 93, 89, 66, 65, 64, 59, + 56, 34, 31, 29, 26, 23, 19, 14, 11, 7, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280 + } ; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +#line 1 "lexer.lpp" +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ +#define YY_NO_INPUT 1 +#define YY_NO_UNISTD_H 1 + +#line 23 "lexer.lpp" +#define YY_USER_ACTION loc.columns(yyleng); +#line 869 "lexer.cpp" + +#line 871 "lexer.cpp" + +#define INITIAL 0 +#define COMMENT_BLOCK_STATE 1 +#define DEVELOPER_BLOCK_STATE 2 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +/* Holds the entire state of the reentrant scanner. */ +struct yyguts_t + { + + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; + + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + int yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + int yylineno_r; + int yy_flex_debug_r; + + char *yytext_r; + int yy_more_flag; + int yy_more_len; + + }; /* end struct yyguts_t */ + +static int yy_init_globals ( yyscan_t yyscanner ); + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput ( yyscan_t yyscanner ); +#else +static int input ( yyscan_t yyscanner ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + int n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK /*LINTED*/break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_load_buffer_state( yyscanner ); + } + + { +#line 36 "lexer.lpp" + + + +#line 40 "lexer.lpp" + loc.step(); + + +#line 1139 "lexer.cpp" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yyg->yy_start; +yy_match: + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 281 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + ++yy_cp; + } + while ( yy_current_state != 280 ); + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 43 "lexer.lpp" +{ loc.step(); } + YY_BREAK +case 2: +/* rule 2 can match eol */ +YY_RULE_SETUP +#line 45 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 47 "lexer.lpp" + + YY_BREAK +case 4: +YY_RULE_SETUP +#line 49 "lexer.lpp" +{ BEGIN(COMMENT_BLOCK_STATE); } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 50 "lexer.lpp" + + YY_BREAK +case 6: +/* rule 6 can match eol */ +YY_RULE_SETUP +#line 51 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 52 "lexer.lpp" +{ BEGIN(INITIAL); } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 54 "lexer.lpp" +{ BEGIN(DEVELOPER_BLOCK_STATE); } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 55 "lexer.lpp" + + YY_BREAK +case 10: +/* rule 10 can match eol */ +YY_RULE_SETUP +#line 56 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 57 "lexer.lpp" +{ BEGIN(INITIAL); } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 59 "lexer.lpp" +{ return iw6::parser::make_INCLUDE(loc); } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 60 "lexer.lpp" +{ return iw6::parser::make_USINGTREE(loc); } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 61 "lexer.lpp" +{ return iw6::parser::make_ANIMTREE(loc); } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 62 "lexer.lpp" +{ return iw6::parser::make_ENDON(loc); } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 63 "lexer.lpp" +{ return iw6::parser::make_NOTIFY(loc); } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 64 "lexer.lpp" +{ return iw6::parser::make_WAIT(loc); } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 65 "lexer.lpp" +{ return iw6::parser::make_WAITTILL(loc); } + YY_BREAK +case 19: +YY_RULE_SETUP +#line 66 "lexer.lpp" +{ return iw6::parser::make_WAITTILLMATCH(loc); } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 67 "lexer.lpp" +{ return iw6::parser::make_WAITTILLFRAMEEND(loc); } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 68 "lexer.lpp" +{ return iw6::parser::make_IF(loc); } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 69 "lexer.lpp" +{ return iw6::parser::make_ELSE(loc); } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 70 "lexer.lpp" +{ return iw6::parser::make_WHILE(loc); } + YY_BREAK +case 24: +YY_RULE_SETUP +#line 71 "lexer.lpp" +{ return iw6::parser::make_FOR(loc); } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 72 "lexer.lpp" +{ return iw6::parser::make_FOREACH(loc); } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 73 "lexer.lpp" +{ return iw6::parser::make_IN(loc); } + YY_BREAK +case 27: +YY_RULE_SETUP +#line 74 "lexer.lpp" +{ return iw6::parser::make_SWITCH(loc); } + YY_BREAK +case 28: +YY_RULE_SETUP +#line 75 "lexer.lpp" +{ return iw6::parser::make_CASE(loc); } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 76 "lexer.lpp" +{ return iw6::parser::make_DEFAULT(loc); } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 77 "lexer.lpp" +{ return iw6::parser::make_BREAK(loc); } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 78 "lexer.lpp" +{ return iw6::parser::make_CONTINUE(loc); } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 79 "lexer.lpp" +{ return iw6::parser::make_RETURN(loc); } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 80 "lexer.lpp" +{ return iw6::parser::make_THREAD(loc); } + YY_BREAK +case 34: +YY_RULE_SETUP +#line 81 "lexer.lpp" +{ return iw6::parser::make_CHILDTHREAD(loc); } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 82 "lexer.lpp" +{ return iw6::parser::make_THISTHREAD(loc); } + YY_BREAK +case 36: +YY_RULE_SETUP +#line 83 "lexer.lpp" +{ return iw6::parser::make_CALL(loc); } + YY_BREAK +case 37: +YY_RULE_SETUP +#line 84 "lexer.lpp" +{ return iw6::parser::make_TRUE(loc); } + YY_BREAK +case 38: +YY_RULE_SETUP +#line 85 "lexer.lpp" +{ return iw6::parser::make_FALSE(loc); } + YY_BREAK +case 39: +YY_RULE_SETUP +#line 86 "lexer.lpp" +{ return iw6::parser::make_UNDEFINED(loc); } + YY_BREAK +case 40: +YY_RULE_SETUP +#line 87 "lexer.lpp" +{ return iw6::parser::make_SIZE(loc); } + YY_BREAK +case 41: +YY_RULE_SETUP +#line 88 "lexer.lpp" +{ return iw6::parser::make_GAME(loc); } + YY_BREAK +case 42: +YY_RULE_SETUP +#line 89 "lexer.lpp" +{ return iw6::parser::make_SELF(loc); } + YY_BREAK +case 43: +YY_RULE_SETUP +#line 90 "lexer.lpp" +{ return iw6::parser::make_ANIM(loc); } + YY_BREAK +case 44: +YY_RULE_SETUP +#line 91 "lexer.lpp" +{ return iw6::parser::make_LEVEL(loc); } + YY_BREAK +case 45: +YY_RULE_SETUP +#line 92 "lexer.lpp" +{ return iw6::parser::make_LPAREN(loc); } + YY_BREAK +case 46: +YY_RULE_SETUP +#line 93 "lexer.lpp" +{ return iw6::parser::make_RPAREN(loc); } + YY_BREAK +case 47: +YY_RULE_SETUP +#line 94 "lexer.lpp" +{ return iw6::parser::make_LBRACE(loc); } + YY_BREAK +case 48: +YY_RULE_SETUP +#line 95 "lexer.lpp" +{ return iw6::parser::make_RBRACE(loc); } + YY_BREAK +case 49: +YY_RULE_SETUP +#line 96 "lexer.lpp" +{ return iw6::parser::make_LBRACKET(loc); } + YY_BREAK +case 50: +YY_RULE_SETUP +#line 97 "lexer.lpp" +{ return iw6::parser::make_RBRACKET(loc); } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 98 "lexer.lpp" +{ return iw6::parser::make_COMMA(loc); } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 99 "lexer.lpp" +{ return iw6::parser::make_DOT(loc); } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 100 "lexer.lpp" +{ return iw6::parser::make_DOUBLECOLON(loc); } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 101 "lexer.lpp" +{ return iw6::parser::make_COLON(loc); } + YY_BREAK +case 55: +YY_RULE_SETUP +#line 102 "lexer.lpp" +{ return iw6::parser::make_SEMICOLON(loc); } + YY_BREAK +case 56: +YY_RULE_SETUP +#line 103 "lexer.lpp" +{ return iw6::parser::make_INCREMENT(loc); } + YY_BREAK +case 57: +YY_RULE_SETUP +#line 104 "lexer.lpp" +{ return iw6::parser::make_DECREMENT(loc); } + YY_BREAK +case 58: +YY_RULE_SETUP +#line 105 "lexer.lpp" +{ return iw6::parser::make_ASSIGN_LSHIFT(loc); } + YY_BREAK +case 59: +YY_RULE_SETUP +#line 106 "lexer.lpp" +{ return iw6::parser::make_ASSIGN_RSHIFT(loc); } + YY_BREAK +case 60: +YY_RULE_SETUP +#line 107 "lexer.lpp" +{ return iw6::parser::make_LSHIFT(loc); } + YY_BREAK +case 61: +YY_RULE_SETUP +#line 108 "lexer.lpp" +{ return iw6::parser::make_RSHIFT(loc); } + YY_BREAK +case 62: +YY_RULE_SETUP +#line 109 "lexer.lpp" +{ return iw6::parser::make_OR(loc); } + YY_BREAK +case 63: +YY_RULE_SETUP +#line 110 "lexer.lpp" +{ return iw6::parser::make_AND(loc); } + YY_BREAK +case 64: +YY_RULE_SETUP +#line 111 "lexer.lpp" +{ return iw6::parser::make_EQUALITY(loc); } + YY_BREAK +case 65: +YY_RULE_SETUP +#line 112 "lexer.lpp" +{ return iw6::parser::make_INEQUALITY(loc); } + YY_BREAK +case 66: +YY_RULE_SETUP +#line 113 "lexer.lpp" +{ return iw6::parser::make_LESS_EQUAL(loc); } + YY_BREAK +case 67: +YY_RULE_SETUP +#line 114 "lexer.lpp" +{ return iw6::parser::make_GREATER_EQUAL(loc); } + YY_BREAK +case 68: +YY_RULE_SETUP +#line 115 "lexer.lpp" +{ return iw6::parser::make_LESS(loc); } + YY_BREAK +case 69: +YY_RULE_SETUP +#line 116 "lexer.lpp" +{ return iw6::parser::make_GREATER(loc); } + YY_BREAK +case 70: +YY_RULE_SETUP +#line 117 "lexer.lpp" +{ return iw6::parser::make_ASSIGN_ADD(loc); } + YY_BREAK +case 71: +YY_RULE_SETUP +#line 118 "lexer.lpp" +{ return iw6::parser::make_ASSIGN_SUB(loc); } + YY_BREAK +case 72: +YY_RULE_SETUP +#line 119 "lexer.lpp" +{ return iw6::parser::make_ASSIGN_MULT(loc); } + YY_BREAK +case 73: +YY_RULE_SETUP +#line 120 "lexer.lpp" +{ return iw6::parser::make_ASSIGN_DIV(loc); } + YY_BREAK +case 74: +YY_RULE_SETUP +#line 121 "lexer.lpp" +{ return iw6::parser::make_ASSIGN_MOD(loc); } + YY_BREAK +case 75: +YY_RULE_SETUP +#line 122 "lexer.lpp" +{ return iw6::parser::make_ASSIGN_BITWISE_OR(loc); } + YY_BREAK +case 76: +YY_RULE_SETUP +#line 123 "lexer.lpp" +{ return iw6::parser::make_ASSIGN_BITWISE_AND(loc); } + YY_BREAK +case 77: +YY_RULE_SETUP +#line 124 "lexer.lpp" +{ return iw6::parser::make_ASSIGN_BITWISE_EXOR(loc); } + YY_BREAK +case 78: +YY_RULE_SETUP +#line 125 "lexer.lpp" +{ return iw6::parser::make_ASSIGN(loc); } + YY_BREAK +case 79: +YY_RULE_SETUP +#line 126 "lexer.lpp" +{ return iw6::parser::make_ADD(loc); } + YY_BREAK +case 80: +YY_RULE_SETUP +#line 127 "lexer.lpp" +{ return iw6::parser::make_SUB(loc); } + YY_BREAK +case 81: +YY_RULE_SETUP +#line 128 "lexer.lpp" +{ return iw6::parser::make_MULT(loc); } + YY_BREAK +case 82: +YY_RULE_SETUP +#line 129 "lexer.lpp" +{ return iw6::parser::make_DIV(loc); } + YY_BREAK +case 83: +YY_RULE_SETUP +#line 130 "lexer.lpp" +{ return iw6::parser::make_MOD(loc); } + YY_BREAK +case 84: +YY_RULE_SETUP +#line 131 "lexer.lpp" +{ return iw6::parser::make_NOT(loc); } + YY_BREAK +case 85: +YY_RULE_SETUP +#line 132 "lexer.lpp" +{ return iw6::parser::make_COMPLEMENT(loc); } + YY_BREAK +case 86: +YY_RULE_SETUP +#line 133 "lexer.lpp" +{ return iw6::parser::make_BITWISE_OR(loc); } + YY_BREAK +case 87: +YY_RULE_SETUP +#line 134 "lexer.lpp" +{ return iw6::parser::make_BITWISE_AND(loc); } + YY_BREAK +case 88: +YY_RULE_SETUP +#line 135 "lexer.lpp" +{ return iw6::parser::make_BITWISE_EXOR(loc); } + YY_BREAK +case 89: +YY_RULE_SETUP +#line 136 "lexer.lpp" +{ return iw6::parser::make_FILE(utils::string::fordslash(yytext), loc); } + YY_BREAK +case 90: +YY_RULE_SETUP +#line 137 "lexer.lpp" +{ return iw6::parser::make_NAME((std::string(yytext, 3) == "_ID") ? std::string(yytext) : utils::string::to_lower(yytext), loc); } + YY_BREAK +case 91: +/* rule 91 can match eol */ +YY_RULE_SETUP +#line 138 "lexer.lpp" +{ return iw6::parser::make_ISTRING(std::string(yytext).substr(1), loc); } + YY_BREAK +case 92: +/* rule 92 can match eol */ +YY_RULE_SETUP +#line 139 "lexer.lpp" +{ return iw6::parser::make_STRING(std::string(yytext), loc); } + YY_BREAK +case 93: +YY_RULE_SETUP +#line 140 "lexer.lpp" +{ return iw6::parser::make_FLOAT(std::string(yytext), loc); } + YY_BREAK +case 94: +YY_RULE_SETUP +#line 141 "lexer.lpp" +{ return iw6::parser::make_INTEGER(std::string(yytext), loc); } + YY_BREAK +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(COMMENT_BLOCK_STATE): +case YY_STATE_EOF(DEVELOPER_BLOCK_STATE): +#line 142 "lexer.lpp" +{ return iw6::parser::make_IW6EOF(loc); } + YY_BREAK +case 95: +/* rule 95 can match eol */ +YY_RULE_SETUP +#line 143 "lexer.lpp" +{ throw iw6::parser::syntax_error(loc, "bad token: \'" + std::string(yytext) + "\'"); } + YY_BREAK +case 96: +YY_RULE_SETUP +#line 145 "lexer.lpp" +ECHO; + YY_BREAK +#line 1684 "lexer.cpp" + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( yywrap( yyscanner ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + yyg->yy_n_chars, num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin , yyscanner); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) +{ + yy_state_type yy_current_state; + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_current_state = yyg->yy_start; + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 281 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) +{ + int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + char *yy_cp = yyg->yy_c_buf_p; + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 281 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 280); + + (void)yyg; + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (yyscan_t yyscanner) +#else + static int input (yyscan_t yyscanner) +#endif + +{ + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin , yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( yyscanner ) ) + return 0; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(yyscanner); +#else + return input(yyscanner); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * @param yyscanner The scanner object. + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * @param yyscanner The scanner object. + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( yyscanner ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yyg->yy_did_buffer_switch_on_eof = 1; +} + +static void yy_load_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyg->yy_hold_char = *yyg->yy_c_buf_p; +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * @param yyscanner The scanner object. + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file , yyscanner); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * @param yyscanner The scanner object. + */ + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf , yyscanner ); + + yyfree( (void *) b , yyscanner ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + +{ + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_flush_buffer( b , yyscanner); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param yyscanner The scanner object. + */ + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( yyscanner ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * @param yyscanner The scanner object. + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(yyscanner); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * @param yyscanner The scanner object. + */ +void yypop_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (yyscan_t yyscanner) +{ + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (!yyg->yy_buffer_stack) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->yy_buffer_stack_max = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b , yyscanner ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n , yyscanner); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the user-defined data for this scanner. + * @param yyscanner The scanner object. + */ +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; +} + +/** Get the current line number. + * @param yyscanner The scanner object. + */ +int yyget_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; +} + +/** Get the current column number. + * @param yyscanner The scanner object. + */ +int yyget_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; +} + +/** Get the input stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; +} + +/** Get the output stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; +} + +/** Get the length of the current token. + * @param yyscanner The scanner object. + */ +int yyget_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; +} + +/** Get the current token. + * @param yyscanner The scanner object. + */ + +char *yyget_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; +} + +/** Set the user-defined data. This data is never touched by the scanner. + * @param user_defined The data to be associated with this scanner. + * @param yyscanner The scanner object. + */ +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; +} + +/** Set the current line number. + * @param _line_number line number + * @param yyscanner The scanner object. + */ +void yyset_lineno (int _line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + + yylineno = _line_number; +} + +/** Set the current column. + * @param _column_no column number + * @param yyscanner The scanner object. + */ +void yyset_column (int _column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + + yycolumn = _column_no; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * @param yyscanner The scanner object. + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * _in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; +} + +void yyset_out (FILE * _out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; +} + +int yyget_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; +} + +void yyset_debug (int _bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; +} + +/* Accessor methods for yylval and yylloc */ + +/* User-visible API */ + +/* yylex_init is special because it creates the scanner itself, so it is + * the ONLY reentrant function that doesn't take the scanner as the last argument. + * That's why we explicitly handle the declaration, instead of using our macros. + */ +int yylex_init(yyscan_t* ptr_yy_globals) +{ + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + return yy_init_globals ( *ptr_yy_globals ); +} + +/* yylex_init_extra has the same functionality as yylex_init, but follows the + * convention of taking the scanner as the last argument. Note however, that + * this is a *pointer* to a scanner, as it will be allocated by this call (and + * is the reason, too, why this function also must handle its own declaration). + * The user defined value in the first argument will be available to yyalloc in + * the yyextra field. + */ +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) +{ + struct yyguts_t dummy_yyguts; + + yyset_extra (yy_user_defined, &dummy_yyguts); + + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + yyset_extra (yy_user_defined, *ptr_yy_globals); + + return yy_init_globals ( *ptr_yy_globals ); +} + +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + yyg->yy_buffer_stack = NULL; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = NULL; + yyg->yy_init = 0; + yyg->yy_start = 0; + + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = NULL; + yyout = NULL; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(yyscanner); + } + + /* Destroy the stack itself. */ + yyfree(yyg->yy_buffer_stack , yyscanner); + yyg->yy_buffer_stack = NULL; + + /* Destroy the start condition stack. */ + yyfree( yyg->yy_start_stack , yyscanner ); + yyg->yy_start_stack = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( yyscanner); + + /* Destroy the main struct (reentrant only). */ + yyfree ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); +} + +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); +} + +void yyfree (void * ptr , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 145 "lexer.lpp" + + diff --git a/src/iw6/xsk/lexer.hpp b/src/iw6/xsk/lexer.hpp new file mode 100644 index 00000000..4d1eb27a --- /dev/null +++ b/src/iw6/xsk/lexer.hpp @@ -0,0 +1,708 @@ +#ifndef iw6_HEADER_H +#define iw6_HEADER_H 1 +#define iw6_IN_HEADER 1 + +#line 5 "lexer.hpp" +#include "stdafx.hpp" +#include "iw6.hpp" +#include "parser.hpp" +using namespace xsk::gsc; + +#line 11 "lexer.hpp" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define iw6__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer iw6__create_buffer +#endif + +#ifdef yy_delete_buffer +#define iw6__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer iw6__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define iw6__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer iw6__scan_buffer +#endif + +#ifdef yy_scan_string +#define iw6__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string iw6__scan_string +#endif + +#ifdef yy_scan_bytes +#define iw6__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes iw6__scan_bytes +#endif + +#ifdef yy_init_buffer +#define iw6__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer iw6__init_buffer +#endif + +#ifdef yy_flush_buffer +#define iw6__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer iw6__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define iw6__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state iw6__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define iw6__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer iw6__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define iw6_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state iw6_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define iw6_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state iw6_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define iw6_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack iw6_ensure_buffer_stack +#endif + +#ifdef yylex +#define iw6_lex_ALREADY_DEFINED +#else +#define yylex iw6_lex +#endif + +#ifdef yyrestart +#define iw6_restart_ALREADY_DEFINED +#else +#define yyrestart iw6_restart +#endif + +#ifdef yylex_init +#define iw6_lex_init_ALREADY_DEFINED +#else +#define yylex_init iw6_lex_init +#endif + +#ifdef yylex_init_extra +#define iw6_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra iw6_lex_init_extra +#endif + +#ifdef yylex_destroy +#define iw6_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy iw6_lex_destroy +#endif + +#ifdef yyget_debug +#define iw6_get_debug_ALREADY_DEFINED +#else +#define yyget_debug iw6_get_debug +#endif + +#ifdef yyset_debug +#define iw6_set_debug_ALREADY_DEFINED +#else +#define yyset_debug iw6_set_debug +#endif + +#ifdef yyget_extra +#define iw6_get_extra_ALREADY_DEFINED +#else +#define yyget_extra iw6_get_extra +#endif + +#ifdef yyset_extra +#define iw6_set_extra_ALREADY_DEFINED +#else +#define yyset_extra iw6_set_extra +#endif + +#ifdef yyget_in +#define iw6_get_in_ALREADY_DEFINED +#else +#define yyget_in iw6_get_in +#endif + +#ifdef yyset_in +#define iw6_set_in_ALREADY_DEFINED +#else +#define yyset_in iw6_set_in +#endif + +#ifdef yyget_out +#define iw6_get_out_ALREADY_DEFINED +#else +#define yyget_out iw6_get_out +#endif + +#ifdef yyset_out +#define iw6_set_out_ALREADY_DEFINED +#else +#define yyset_out iw6_set_out +#endif + +#ifdef yyget_leng +#define iw6_get_leng_ALREADY_DEFINED +#else +#define yyget_leng iw6_get_leng +#endif + +#ifdef yyget_text +#define iw6_get_text_ALREADY_DEFINED +#else +#define yyget_text iw6_get_text +#endif + +#ifdef yyget_lineno +#define iw6_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno iw6_get_lineno +#endif + +#ifdef yyset_lineno +#define iw6_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno iw6_set_lineno +#endif + +#ifdef yyget_column +#define iw6_get_column_ALREADY_DEFINED +#else +#define yyget_column iw6_get_column +#endif + +#ifdef yyset_column +#define iw6_set_column_ALREADY_DEFINED +#else +#define yyset_column iw6_set_column +#endif + +#ifdef yywrap +#define iw6_wrap_ALREADY_DEFINED +#else +#define yywrap iw6_wrap +#endif + +#ifdef yyalloc +#define iw6_alloc_ALREADY_DEFINED +#else +#define yyalloc iw6_alloc +#endif + +#ifdef yyrealloc +#define iw6_realloc_ALREADY_DEFINED +#else +#define yyrealloc iw6_realloc +#endif + +#ifdef yyfree +#define iw6_free_ALREADY_DEFINED +#else +#define yyfree iw6_free +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +/* Begin user sect3 */ + +#define iw6_wrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP + +#define yytext_ptr yytext_r + +#ifdef YY_HEADER_EXPORT_START_CONDITIONS +#define INITIAL 0 +#define COMMENT_BLOCK_STATE 1 +#define DEVELOPER_BLOCK_STATE 2 + +#endif + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +#undef YY_NEW_FILE +#undef YY_FLUSH_BUFFER +#undef yy_set_bol +#undef yy_new_buffer +#undef yy_set_interactive +#undef YY_DO_BEFORE_ACTION + +#ifdef YY_DECL_IS_OURS +#undef YY_DECL_IS_OURS +#undef YY_DECL +#endif + +#ifndef iw6__create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef iw6__delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef iw6__scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef iw6__scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef iw6__scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef iw6__init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef iw6__flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef iw6__load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef iw6__switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef iw6_push_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef iw6_pop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef iw6_ensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef iw6_lex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef iw6_restart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef iw6_lex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef iw6_lex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef iw6_lex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef iw6_get_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef iw6_set_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef iw6_get_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef iw6_set_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef iw6_get_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef iw6_set_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef iw6_get_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef iw6_set_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef iw6_get_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef iw6_get_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef iw6_get_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef iw6_set_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef iw6_get_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef iw6_set_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef iw6_wrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef iw6_get_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef iw6_set_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef iw6_get_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef iw6_set_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef iw6_alloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef iw6_realloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef iw6_free_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef iw6_text_ALREADY_DEFINED +#undef yytext +#endif +#ifndef iw6_leng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef iw6_in_ALREADY_DEFINED +#undef yyin +#endif +#ifndef iw6_out_ALREADY_DEFINED +#undef yyout +#endif +#ifndef iw6__flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef iw6_lineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef iw6_tables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef iw6_tables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef iw6_TABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + +#line 145 "lexer.lpp" + + +#line 706 "lexer.hpp" +#undef iw6_IN_HEADER +#endif /* iw6_HEADER_H */ diff --git a/src/iw6/xsk/parser.cpp b/src/iw6/xsk/parser.cpp new file mode 100644 index 00000000..5a3fb229 --- /dev/null +++ b/src/iw6/xsk/parser.cpp @@ -0,0 +1,3956 @@ +// A Bison parser, made by GNU Bison 3.7.5. + +// Skeleton implementation for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. + +// 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 . + +// As a special exception, you may create a larger work that contains +// part or all of the Bison parser skeleton and distribute that work +// under terms of your choice, so long as that work isn't itself a +// parser generator using the skeleton or a modified version thereof +// as a parser skeleton. Alternatively, if you modify or redistribute +// the parser skeleton itself, you may (at your option) remove this +// special exception, which will cause the skeleton and the resulting +// Bison output files to be licensed under the GNU General Public +// License without this special exception. + +// This special exception was added by the Free Software Foundation in +// version 2.2 of Bison. + +// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, +// especially those whose name start with YY_ or yy_. They are +// private implementation details that can be changed or removed. + +// "%code top" blocks. +#line 40 "parser.ypp" + +#include "stdafx.hpp" +#include "parser.hpp" +#include "lexer.hpp" +using namespace xsk::gsc; +xsk::gsc::iw6::parser::symbol_type IW6lex(yyscan_t yyscanner, xsk::gsc::location& loc); + +#line 47 "parser.cpp" + +// Take the name prefix into account. +#define yylex IW6lex + + + +#include "parser.hpp" + + + + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include // FIXME: INFRINGES ON USER NAME SPACE. +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + + +// Whether we are compiled with exception support. +#ifndef YY_EXCEPTIONS +# if defined __GNUC__ && !defined __EXCEPTIONS +# define YY_EXCEPTIONS 0 +# else +# define YY_EXCEPTIONS 1 +# endif +#endif + +#define YYRHSLOC(Rhs, K) ((Rhs)[K].location) +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +# ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).begin = YYRHSLOC (Rhs, 1).begin; \ + (Current).end = YYRHSLOC (Rhs, N).end; \ + } \ + else \ + { \ + (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ + } \ + while (false) +# endif + + +// Enable debugging if requested. +#if IW6DEBUG + +// A pseudo ostream that takes yydebug_ into account. +# define YYCDEBUG if (yydebug_) (*yycdebug_) + +# define YY_SYMBOL_PRINT(Title, Symbol) \ + do { \ + if (yydebug_) \ + { \ + *yycdebug_ << Title << ' '; \ + yy_print_ (*yycdebug_, Symbol); \ + *yycdebug_ << '\n'; \ + } \ + } while (false) + +# define YY_REDUCE_PRINT(Rule) \ + do { \ + if (yydebug_) \ + yy_reduce_print_ (Rule); \ + } while (false) + +# define YY_STACK_PRINT() \ + do { \ + if (yydebug_) \ + yy_stack_print_ (); \ + } while (false) + +#else // !IW6DEBUG + +# define YYCDEBUG if (false) std::cerr +# define YY_SYMBOL_PRINT(Title, Symbol) YY_USE (Symbol) +# define YY_REDUCE_PRINT(Rule) static_cast (0) +# define YY_STACK_PRINT() static_cast (0) + +#endif // !IW6DEBUG + +#define yyerrok (yyerrstatus_ = 0) +#define yyclearin (yyla.clear ()) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYRECOVERING() (!!yyerrstatus_) + +#line 13 "parser.ypp" +namespace xsk { namespace gsc { namespace iw6 { +#line 149 "parser.cpp" + + /// Build a parser object. + parser::parser (yyscan_t yyscanner_yyarg, xsk::gsc::location& loc_yyarg, xsk::gsc::program_ptr& ast_yyarg) +#if IW6DEBUG + : yydebug_ (false), + yycdebug_ (&std::cerr), +#else + : +#endif + yy_lac_established_ (false), + yyscanner (yyscanner_yyarg), + loc (loc_yyarg), + ast (ast_yyarg) + {} + + parser::~parser () + {} + + parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW + {} + + /*---------------. + | symbol kinds. | + `---------------*/ + + + + // by_state. + parser::by_state::by_state () YY_NOEXCEPT + : state (empty_state) + {} + + parser::by_state::by_state (const by_state& that) YY_NOEXCEPT + : state (that.state) + {} + + void + parser::by_state::clear () YY_NOEXCEPT + { + state = empty_state; + } + + void + parser::by_state::move (by_state& that) + { + state = that.state; + that.clear (); + } + + parser::by_state::by_state (state_type s) YY_NOEXCEPT + : state (s) + {} + + parser::symbol_kind_type + parser::by_state::kind () const YY_NOEXCEPT + { + if (state == empty_state) + return symbol_kind::S_YYEMPTY; + else + return YY_CAST (symbol_kind_type, yystos_[+state]); + } + + parser::stack_symbol_type::stack_symbol_type () + {} + + parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) + : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.YY_MOVE_OR_COPY< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.YY_MOVE_OR_COPY< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.YY_MOVE_OR_COPY< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.YY_MOVE_OR_COPY< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.YY_MOVE_OR_COPY< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.YY_MOVE_OR_COPY< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.YY_MOVE_OR_COPY< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.YY_MOVE_OR_COPY< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.YY_MOVE_OR_COPY< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.YY_MOVE_OR_COPY< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.YY_MOVE_OR_COPY< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.YY_MOVE_OR_COPY< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.YY_MOVE_OR_COPY< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.YY_MOVE_OR_COPY< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.YY_MOVE_OR_COPY< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.YY_MOVE_OR_COPY< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.YY_MOVE_OR_COPY< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.YY_MOVE_OR_COPY< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.YY_MOVE_OR_COPY< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.YY_MOVE_OR_COPY< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.YY_MOVE_OR_COPY< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.YY_MOVE_OR_COPY< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.YY_MOVE_OR_COPY< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.YY_MOVE_OR_COPY< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.YY_MOVE_OR_COPY< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.YY_MOVE_OR_COPY< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.YY_MOVE_OR_COPY< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.YY_MOVE_OR_COPY< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.YY_MOVE_OR_COPY< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.YY_MOVE_OR_COPY< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.YY_MOVE_OR_COPY< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.YY_MOVE_OR_COPY< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.YY_MOVE_OR_COPY< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.YY_MOVE_OR_COPY< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.YY_MOVE_OR_COPY< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.YY_MOVE_OR_COPY< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.YY_MOVE_OR_COPY< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.YY_MOVE_OR_COPY< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.YY_MOVE_OR_COPY< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.YY_MOVE_OR_COPY< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.YY_MOVE_OR_COPY< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.YY_MOVE_OR_COPY< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.YY_MOVE_OR_COPY< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.YY_MOVE_OR_COPY< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.YY_MOVE_OR_COPY< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.YY_MOVE_OR_COPY< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.YY_MOVE_OR_COPY< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.YY_MOVE_OR_COPY< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.YY_MOVE_OR_COPY< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.YY_MOVE_OR_COPY< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.YY_MOVE_OR_COPY< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.YY_MOVE_OR_COPY< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + +#if 201103L <= YY_CPLUSPLUS + // that is emptied. + that.state = empty_state; +#endif + } + + parser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that) + : super_type (s, YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + + // that is emptied. + that.kind_ = symbol_kind::S_YYEMPTY; + } + +#if YY_CPLUSPLUS < 201103L + parser::stack_symbol_type& + parser::stack_symbol_type::operator= (const stack_symbol_type& that) + { + state = that.state; + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.copy< anim_ptr > (that.value); + break; + + case symbol_kind::S_animation: // animation + value.copy< animation_ptr > (that.value); + break; + + case symbol_kind::S_animtree: // animtree + value.copy< animtree_ptr > (that.value); + break; + + case symbol_kind::S_constant: // constant + value.copy< constant_ptr > (that.value); + break; + + case symbol_kind::S_define: // define + value.copy< define_ptr > (that.value); + break; + + case symbol_kind::S_empty_array: // empty_array + value.copy< empty_array_ptr > (that.value); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.copy< expr_arguments_ptr > (that.value); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.copy< expr_assign_ptr > (that.value); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.copy< expr_call_ptr > (that.value); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.copy< expr_call_type_ptr > (that.value); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.copy< expr_ptr > (that.value); + break; + + case symbol_kind::S_false: // false + value.copy< false_ptr > (that.value); + break; + + case symbol_kind::S_file: // file + value.copy< file_ptr > (that.value); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.copy< float_ptr > (that.value); + break; + + case symbol_kind::S_game: // game + value.copy< game_ptr > (that.value); + break; + + case symbol_kind::S_include: // include + value.copy< include_ptr > (that.value); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.copy< integer_ptr > (that.value); + break; + + case symbol_kind::S_istring: // istring + value.copy< istring_ptr > (that.value); + break; + + case symbol_kind::S_level: // level + value.copy< level_ptr > (that.value); + break; + + case symbol_kind::S_name: // name + value.copy< name_ptr > (that.value); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.copy< node_ptr > (that.value); + break; + + case symbol_kind::S_parameters: // parameters + value.copy< parameters_ptr > (that.value); + break; + + case symbol_kind::S_program: // program + value.copy< program_ptr > (that.value); + break; + + case symbol_kind::S_self: // self + value.copy< self_ptr > (that.value); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.copy< std::string > (that.value); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.copy< stmt_assign_ptr > (that.value); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.copy< stmt_break_ptr > (that.value); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.copy< stmt_call_ptr > (that.value); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.copy< stmt_case_ptr > (that.value); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.copy< stmt_continue_ptr > (that.value); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.copy< stmt_default_ptr > (that.value); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.copy< stmt_endon_ptr > (that.value); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.copy< stmt_for_ptr > (that.value); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.copy< stmt_foreach_ptr > (that.value); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.copy< stmt_if_ptr > (that.value); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.copy< stmt_ifelse_ptr > (that.value); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.copy< stmt_list_ptr > (that.value); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.copy< stmt_notify_ptr > (that.value); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.copy< stmt_ptr > (that.value); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.copy< stmt_return_ptr > (that.value); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.copy< stmt_switch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.copy< stmt_wait_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.copy< stmt_waittill_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.copy< stmt_waittillframeend_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.copy< stmt_waittillmatch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.copy< stmt_while_ptr > (that.value); + break; + + case symbol_kind::S_string: // string + value.copy< string_ptr > (that.value); + break; + + case symbol_kind::S_thisthread: // thisthread + value.copy< thisthread_ptr > (that.value); + break; + + case symbol_kind::S_thread: // thread + value.copy< thread_ptr > (that.value); + break; + + case symbol_kind::S_true: // true + value.copy< true_ptr > (that.value); + break; + + case symbol_kind::S_undefined: // undefined + value.copy< undefined_ptr > (that.value); + break; + + case symbol_kind::S_usingtree: // usingtree + value.copy< usingtree_ptr > (that.value); + break; + + case symbol_kind::S_vector: // vector + value.copy< vector_ptr > (that.value); + break; + + default: + break; + } + + location = that.location; + return *this; + } + + parser::stack_symbol_type& + parser::stack_symbol_type::operator= (stack_symbol_type& that) + { + state = that.state; + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (that.value); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (that.value); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (that.value); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (that.value); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (that.value); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (that.value); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (that.value); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (that.value); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (that.value); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (that.value); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (that.value); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (that.value); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (that.value); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (that.value); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (that.value); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (that.value); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (that.value); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (that.value); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (that.value); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (that.value); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (that.value); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (that.value); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (that.value); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (that.value); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (that.value); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (that.value); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (that.value); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (that.value); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (that.value); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (that.value); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (that.value); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (that.value); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (that.value); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (that.value); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (that.value); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (that.value); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (that.value); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (that.value); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (that.value); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (that.value); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (that.value); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (that.value); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (that.value); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (that.value); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (that.value); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (that.value); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (that.value); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (that.value); + break; + + default: + break; + } + + location = that.location; + // that is emptied. + that.state = empty_state; + return *this; + } +#endif + + template + void + parser::yy_destroy_ (const char* yymsg, basic_symbol& yysym) const + { + if (yymsg) + YY_SYMBOL_PRINT (yymsg, yysym); + } + +#if IW6DEBUG + template + void + parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const + { + std::ostream& yyoutput = yyo; + YY_USE (yyoutput); + if (yysym.empty ()) + yyo << "empty symbol"; + else + { + symbol_kind_type yykind = yysym.kind (); + yyo << (yykind < YYNTOKENS ? "token" : "nterm") + << ' ' << yysym.name () << " (" + << yysym.location << ": "; + YY_USE (yykind); + yyo << ')'; + } + } +#endif + + void + parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) + { + if (m) + YY_SYMBOL_PRINT (m, sym); + yystack_.push (YY_MOVE (sym)); + } + + void + parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) + { +#if 201103L <= YY_CPLUSPLUS + yypush_ (m, stack_symbol_type (s, std::move (sym))); +#else + stack_symbol_type ss (s, sym); + yypush_ (m, ss); +#endif + } + + void + parser::yypop_ (int n) + { + yystack_.pop (n); + } + +#if IW6DEBUG + std::ostream& + parser::debug_stream () const + { + return *yycdebug_; + } + + void + parser::set_debug_stream (std::ostream& o) + { + yycdebug_ = &o; + } + + + parser::debug_level_type + parser::debug_level () const + { + return yydebug_; + } + + void + parser::set_debug_level (debug_level_type l) + { + yydebug_ = l; + } +#endif // IW6DEBUG + + parser::state_type + parser::yy_lr_goto_state_ (state_type yystate, int yysym) + { + int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; + if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) + return yytable_[yyr]; + else + return yydefgoto_[yysym - YYNTOKENS]; + } + + bool + parser::yy_pact_value_is_default_ (int yyvalue) + { + return yyvalue == yypact_ninf_; + } + + bool + parser::yy_table_value_is_error_ (int yyvalue) + { + return yyvalue == yytable_ninf_; + } + + int + parser::operator() () + { + return parse (); + } + + int + parser::parse () + { + int yyn; + /// Length of the RHS of the rule being reduced. + int yylen = 0; + + // Error handling. + int yynerrs_ = 0; + int yyerrstatus_ = 0; + + /// The lookahead symbol. + symbol_type yyla; + + /// The locations where the error started and ended. + stack_symbol_type yyerror_range[3]; + + /// The return value of parse (). + int yyresult; + + /// Discard the LAC context in case there still is one left from a + /// previous invocation. + yy_lac_discard_ ("init"); + +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + YYCDEBUG << "Starting parse\n"; + + + /* Initialize the stack. The initial state will be set in + yynewstate, since the latter expects the semantical and the + location values to have been already stored, initialize these + stacks with a primary value. */ + yystack_.clear (); + yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); + + /*-----------------------------------------------. + | yynewstate -- push a new symbol on the stack. | + `-----------------------------------------------*/ + yynewstate: + YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; + YY_STACK_PRINT (); + + // Accept? + if (yystack_[0].state == yyfinal_) + YYACCEPT; + + goto yybackup; + + + /*-----------. + | yybackup. | + `-----------*/ + yybackup: + // Try to take a decision without lookahead. + yyn = yypact_[+yystack_[0].state]; + if (yy_pact_value_is_default_ (yyn)) + goto yydefault; + + // Read a lookahead token. + if (yyla.empty ()) + { + YYCDEBUG << "Reading a token\n"; +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + symbol_type yylookahead (yylex (yyscanner, loc)); + yyla.move (yylookahead); + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + goto yyerrlab1; + } +#endif // YY_EXCEPTIONS + } + YY_SYMBOL_PRINT ("Next token is", yyla); + + if (yyla.kind () == symbol_kind::S_YYerror) + { + // The scanner already issued an error message, process directly + // to error recovery. But do not keep the error token as + // lookahead, it is too special and may lead us to an endless + // loop in error recovery. */ + yyla.kind_ = symbol_kind::S_YYUNDEF; + goto yyerrlab1; + } + + /* If the proper action on seeing token YYLA.TYPE is to reduce or + to detect an error, take that action. */ + yyn += yyla.kind (); + if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) + { + if (!yy_lac_establish_ (yyla.kind ())) + goto yyerrlab; + goto yydefault; + } + + // Reduce or error. + yyn = yytable_[yyn]; + if (yyn <= 0) + { + if (yy_table_value_is_error_ (yyn)) + goto yyerrlab; + if (!yy_lac_establish_ (yyla.kind ())) + goto yyerrlab; + + yyn = -yyn; + goto yyreduce; + } + + // Count tokens shifted since error; after three, turn off error status. + if (yyerrstatus_) + --yyerrstatus_; + + // Shift the lookahead token. + yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); + yy_lac_discard_ ("shift"); + goto yynewstate; + + + /*-----------------------------------------------------------. + | yydefault -- do the default action for the current state. | + `-----------------------------------------------------------*/ + yydefault: + yyn = yydefact_[+yystack_[0].state]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + + /*-----------------------------. + | yyreduce -- do a reduction. | + `-----------------------------*/ + yyreduce: + yylen = yyr2_[yyn]; + { + stack_symbol_type yylhs; + yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); + /* Variants are always initialized to an empty instance of the + correct type. The default '$$ = $1' action is NOT applied + when using variants. */ + switch (yyr1_[yyn]) + { + case symbol_kind::S_anim: // anim + yylhs.value.emplace< anim_ptr > (); + break; + + case symbol_kind::S_animation: // animation + yylhs.value.emplace< animation_ptr > (); + break; + + case symbol_kind::S_animtree: // animtree + yylhs.value.emplace< animtree_ptr > (); + break; + + case symbol_kind::S_constant: // constant + yylhs.value.emplace< constant_ptr > (); + break; + + case symbol_kind::S_define: // define + yylhs.value.emplace< define_ptr > (); + break; + + case symbol_kind::S_empty_array: // empty_array + yylhs.value.emplace< empty_array_ptr > (); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + yylhs.value.emplace< expr_arguments_ptr > (); + break; + + case symbol_kind::S_expr_assign: // expr_assign + yylhs.value.emplace< expr_assign_ptr > (); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + yylhs.value.emplace< expr_call_ptr > (); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + yylhs.value.emplace< expr_call_type_ptr > (); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + yylhs.value.emplace< expr_ptr > (); + break; + + case symbol_kind::S_false: // false + yylhs.value.emplace< false_ptr > (); + break; + + case symbol_kind::S_file: // file + yylhs.value.emplace< file_ptr > (); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + yylhs.value.emplace< float_ptr > (); + break; + + case symbol_kind::S_game: // game + yylhs.value.emplace< game_ptr > (); + break; + + case symbol_kind::S_include: // include + yylhs.value.emplace< include_ptr > (); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + yylhs.value.emplace< integer_ptr > (); + break; + + case symbol_kind::S_istring: // istring + yylhs.value.emplace< istring_ptr > (); + break; + + case symbol_kind::S_level: // level + yylhs.value.emplace< level_ptr > (); + break; + + case symbol_kind::S_name: // name + yylhs.value.emplace< name_ptr > (); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + yylhs.value.emplace< node_ptr > (); + break; + + case symbol_kind::S_parameters: // parameters + yylhs.value.emplace< parameters_ptr > (); + break; + + case symbol_kind::S_program: // program + yylhs.value.emplace< program_ptr > (); + break; + + case symbol_kind::S_self: // self + yylhs.value.emplace< self_ptr > (); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + yylhs.value.emplace< std::string > (); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + yylhs.value.emplace< stmt_assign_ptr > (); + break; + + case symbol_kind::S_stmt_break: // stmt_break + yylhs.value.emplace< stmt_break_ptr > (); + break; + + case symbol_kind::S_stmt_call: // stmt_call + yylhs.value.emplace< stmt_call_ptr > (); + break; + + case symbol_kind::S_stmt_case: // stmt_case + yylhs.value.emplace< stmt_case_ptr > (); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + yylhs.value.emplace< stmt_continue_ptr > (); + break; + + case symbol_kind::S_stmt_default: // stmt_default + yylhs.value.emplace< stmt_default_ptr > (); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + yylhs.value.emplace< stmt_endon_ptr > (); + break; + + case symbol_kind::S_stmt_for: // stmt_for + yylhs.value.emplace< stmt_for_ptr > (); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + yylhs.value.emplace< stmt_foreach_ptr > (); + break; + + case symbol_kind::S_stmt_if: // stmt_if + yylhs.value.emplace< stmt_if_ptr > (); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + yylhs.value.emplace< stmt_ifelse_ptr > (); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + yylhs.value.emplace< stmt_list_ptr > (); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + yylhs.value.emplace< stmt_notify_ptr > (); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + yylhs.value.emplace< stmt_ptr > (); + break; + + case symbol_kind::S_stmt_return: // stmt_return + yylhs.value.emplace< stmt_return_ptr > (); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + yylhs.value.emplace< stmt_switch_ptr > (); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + yylhs.value.emplace< stmt_wait_ptr > (); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + yylhs.value.emplace< stmt_waittill_ptr > (); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + yylhs.value.emplace< stmt_waittillframeend_ptr > (); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + yylhs.value.emplace< stmt_waittillmatch_ptr > (); + break; + + case symbol_kind::S_stmt_while: // stmt_while + yylhs.value.emplace< stmt_while_ptr > (); + break; + + case symbol_kind::S_string: // string + yylhs.value.emplace< string_ptr > (); + break; + + case symbol_kind::S_thisthread: // thisthread + yylhs.value.emplace< thisthread_ptr > (); + break; + + case symbol_kind::S_thread: // thread + yylhs.value.emplace< thread_ptr > (); + break; + + case symbol_kind::S_true: // true + yylhs.value.emplace< true_ptr > (); + break; + + case symbol_kind::S_undefined: // undefined + yylhs.value.emplace< undefined_ptr > (); + break; + + case symbol_kind::S_usingtree: // usingtree + yylhs.value.emplace< usingtree_ptr > (); + break; + + case symbol_kind::S_vector: // vector + yylhs.value.emplace< vector_ptr > (); + break; + + default: + break; + } + + + // Default location. + { + stack_type::slice range (yystack_, yylen); + YYLLOC_DEFAULT (yylhs.location, range, yylen); + yyerror_range[1].location = yylhs.location; + } + + // Perform the reduction. + YY_REDUCE_PRINT (yyn); +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + switch (yyn) + { + case 2: // root: program +#line 231 "parser.ypp" + { ast = std::move(yystack_[0].value.as < program_ptr > ()); } +#line 1731 "parser.cpp" + break; + + case 3: // root: %empty +#line 232 "parser.ypp" + { ast = std::make_unique(yylhs.location); } +#line 1737 "parser.cpp" + break; + + case 4: // program: program include +#line 237 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::move(yystack_[1].value.as < program_ptr > ()); yylhs.value.as < program_ptr > ()->includes.push_back(std::move(yystack_[0].value.as < include_ptr > ())); } +#line 1743 "parser.cpp" + break; + + case 5: // program: program define +#line 239 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::move(yystack_[1].value.as < program_ptr > ()); yylhs.value.as < program_ptr > ()->definitions.push_back(std::move(yystack_[0].value.as < define_ptr > ())); } +#line 1749 "parser.cpp" + break; + + case 6: // program: include +#line 241 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < program_ptr > ()->includes.push_back(std::move(yystack_[0].value.as < include_ptr > ())); } +#line 1755 "parser.cpp" + break; + + case 7: // program: define +#line 243 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < program_ptr > ()->definitions.push_back(std::move(yystack_[0].value.as < define_ptr > ())); } +#line 1761 "parser.cpp" + break; + + case 8: // include: "#include" file ";" +#line 248 "parser.ypp" + { yylhs.value.as < include_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < file_ptr > ())); } +#line 1767 "parser.cpp" + break; + + case 9: // define: usingtree +#line 252 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_usingtree = std::move(yystack_[0].value.as < usingtree_ptr > ()); } +#line 1773 "parser.cpp" + break; + + case 10: // define: constant +#line 253 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_constant = std::move(yystack_[0].value.as < constant_ptr > ()); } +#line 1779 "parser.cpp" + break; + + case 11: // define: thread +#line 254 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_thread = std::move(yystack_[0].value.as < thread_ptr > ()); } +#line 1785 "parser.cpp" + break; + + case 12: // usingtree: "#using_animtree" "(" string ")" ";" +#line 259 "parser.ypp" + { yylhs.value.as < usingtree_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < string_ptr > ())); } +#line 1791 "parser.cpp" + break; + + case 13: // constant: name "=" expr ";" +#line 264 "parser.ypp" + { yylhs.value.as < constant_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 1797 "parser.cpp" + break; + + case 14: // thread: name "(" parameters ")" stmt_block +#line 269 "parser.ypp" + { yylhs.value.as < thread_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < name_ptr > ()), std::move(yystack_[2].value.as < parameters_ptr > ()), std::move(yystack_[0].value.as < stmt_list_ptr > ())); } +#line 1803 "parser.cpp" + break; + + case 15: // parameters: parameters "," name +#line 274 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::move(yystack_[2].value.as < parameters_ptr > ()); yylhs.value.as < parameters_ptr > ()->list.push_back(std::move(yystack_[0].value.as < name_ptr > ())); } +#line 1809 "parser.cpp" + break; + + case 16: // parameters: name +#line 276 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < parameters_ptr > ()->list.push_back(std::move(yystack_[0].value.as < name_ptr > ())); } +#line 1815 "parser.cpp" + break; + + case 17: // parameters: %empty +#line 278 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::make_unique(yylhs.location); } +#line 1821 "parser.cpp" + break; + + case 18: // stmt: stmt_block +#line 282 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_list = std::move(yystack_[0].value.as < stmt_list_ptr > ()); } +#line 1827 "parser.cpp" + break; + + case 19: // stmt: stmt_call +#line 283 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_call = std::move(yystack_[0].value.as < stmt_call_ptr > ()); } +#line 1833 "parser.cpp" + break; + + case 20: // stmt: stmt_assign +#line 284 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_assign = std::move(yystack_[0].value.as < stmt_assign_ptr > ()); } +#line 1839 "parser.cpp" + break; + + case 21: // stmt: stmt_endon +#line 285 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_endon = std::move(yystack_[0].value.as < stmt_endon_ptr > ()); } +#line 1845 "parser.cpp" + break; + + case 22: // stmt: stmt_notify +#line 286 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_notify = std::move(yystack_[0].value.as < stmt_notify_ptr > ()); } +#line 1851 "parser.cpp" + break; + + case 23: // stmt: stmt_wait +#line 287 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_wait = std::move(yystack_[0].value.as < stmt_wait_ptr > ()); } +#line 1857 "parser.cpp" + break; + + case 24: // stmt: stmt_waittill +#line 288 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittill = std::move(yystack_[0].value.as < stmt_waittill_ptr > ()); } +#line 1863 "parser.cpp" + break; + + case 25: // stmt: stmt_waittillmatch +#line 289 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittillmatch = std::move(yystack_[0].value.as < stmt_waittillmatch_ptr > ()); } +#line 1869 "parser.cpp" + break; + + case 26: // stmt: stmt_waittillframeend +#line 290 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittillframeend = std::move(yystack_[0].value.as < stmt_waittillframeend_ptr > ()); } +#line 1875 "parser.cpp" + break; + + case 27: // stmt: stmt_if +#line 291 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_if = std::move(yystack_[0].value.as < stmt_if_ptr > ()); } +#line 1881 "parser.cpp" + break; + + case 28: // stmt: stmt_ifelse +#line 292 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_ifelse = std::move(yystack_[0].value.as < stmt_ifelse_ptr > ()); } +#line 1887 "parser.cpp" + break; + + case 29: // stmt: stmt_while +#line 293 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_while = std::move(yystack_[0].value.as < stmt_while_ptr > ()); } +#line 1893 "parser.cpp" + break; + + case 30: // stmt: stmt_for +#line 294 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_for = std::move(yystack_[0].value.as < stmt_for_ptr > ()); } +#line 1899 "parser.cpp" + break; + + case 31: // stmt: stmt_foreach +#line 295 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_foreach = std::move(yystack_[0].value.as < stmt_foreach_ptr > ()); } +#line 1905 "parser.cpp" + break; + + case 32: // stmt: stmt_switch +#line 296 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_switch = std::move(yystack_[0].value.as < stmt_switch_ptr > ()); } +#line 1911 "parser.cpp" + break; + + case 33: // stmt: stmt_case +#line 297 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_case = std::move(yystack_[0].value.as < stmt_case_ptr > ()); } +#line 1917 "parser.cpp" + break; + + case 34: // stmt: stmt_default +#line 298 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_default = std::move(yystack_[0].value.as < stmt_default_ptr > ()); } +#line 1923 "parser.cpp" + break; + + case 35: // stmt: stmt_break +#line 299 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_break = std::move(yystack_[0].value.as < stmt_break_ptr > ()); } +#line 1929 "parser.cpp" + break; + + case 36: // stmt: stmt_continue +#line 300 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_continue = std::move(yystack_[0].value.as < stmt_continue_ptr > ()); } +#line 1935 "parser.cpp" + break; + + case 37: // stmt: stmt_return +#line 301 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_return = std::move(yystack_[0].value.as < stmt_return_ptr > ()); } +#line 1941 "parser.cpp" + break; + + case 38: // stmt_block: "{" stmt_list "}" +#line 305 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::move(yystack_[1].value.as < stmt_list_ptr > ()); } +#line 1947 "parser.cpp" + break; + + case 39: // stmt_block: "{" "}" +#line 306 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::make_unique(yylhs.location); } +#line 1953 "parser.cpp" + break; + + case 40: // stmt_list: stmt_list stmt +#line 311 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::move(yystack_[1].value.as < stmt_list_ptr > ()); yylhs.value.as < stmt_list_ptr > ()->stmts.push_back(std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 1959 "parser.cpp" + break; + + case 41: // stmt_list: stmt +#line 313 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < stmt_list_ptr > ()->stmts.push_back(std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 1965 "parser.cpp" + break; + + case 42: // stmt_call: expr_call ";" +#line 318 "parser.ypp" + { yylhs.value.as < stmt_call_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_call_ptr > ())); } +#line 1971 "parser.cpp" + break; + + case 43: // stmt_call: expr_call_thread ";" +#line 320 "parser.ypp" + { yylhs.value.as < stmt_call_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_call_ptr > ())); } +#line 1977 "parser.cpp" + break; + + case 44: // stmt_assign: expr_assign ";" +#line 325 "parser.ypp" + { yylhs.value.as < stmt_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_assign_ptr > ())); } +#line 1983 "parser.cpp" + break; + + case 45: // stmt_endon: object "endon" "(" expr ")" ";" +#line 330 "parser.ypp" + { yylhs.value.as < stmt_endon_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ())); } +#line 1989 "parser.cpp" + break; + + case 46: // stmt_notify: object "notify" "(" expr "," expr_arguments ")" ";" +#line 335 "parser.ypp" + { yylhs.value.as < stmt_notify_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 1995 "parser.cpp" + break; + + case 47: // stmt_notify: object "notify" "(" expr ")" ";" +#line 337 "parser.ypp" + { yylhs.value.as < stmt_notify_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2001 "parser.cpp" + break; + + case 48: // stmt_wait: "wait" expr ";" +#line 342 "parser.ypp" + { yylhs.value.as < stmt_wait_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2007 "parser.cpp" + break; + + case 49: // stmt_waittill: object "waittill" "(" expr "," expr_arguments ")" ";" +#line 347 "parser.ypp" + { yylhs.value.as < stmt_waittill_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 2013 "parser.cpp" + break; + + case 50: // stmt_waittill: object "waittill" "(" expr ")" ";" +#line 349 "parser.ypp" + { yylhs.value.as < stmt_waittill_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2019 "parser.cpp" + break; + + case 51: // stmt_waittillmatch: object "waittillmatch" "(" expr "," expr_arguments ")" ";" +#line 354 "parser.ypp" + { yylhs.value.as < stmt_waittillmatch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 2025 "parser.cpp" + break; + + case 52: // stmt_waittillmatch: object "waittillmatch" "(" expr ")" ";" +#line 356 "parser.ypp" + { yylhs.value.as < stmt_waittillmatch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2031 "parser.cpp" + break; + + case 53: // stmt_waittillframeend: "waittillframeend" ";" +#line 361 "parser.ypp" + { yylhs.value.as < stmt_waittillframeend_ptr > () = std::make_unique(yylhs.location); } +#line 2037 "parser.cpp" + break; + + case 54: // stmt_if: "if" "(" expr ")" stmt +#line 366 "parser.ypp" + { yylhs.value.as < stmt_if_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2043 "parser.cpp" + break; + + case 55: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt +#line 371 "parser.ypp" + { yylhs.value.as < stmt_ifelse_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < stmt_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2049 "parser.cpp" + break; + + case 56: // stmt_while: "while" "(" expr ")" stmt +#line 376 "parser.ypp" + { yylhs.value.as < stmt_while_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2055 "parser.cpp" + break; + + case 57: // stmt_for: "for" "(" for_stmt ";" for_expr ";" for_stmt ")" stmt +#line 381 "parser.ypp" + { yylhs.value.as < stmt_for_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[6].value.as < stmt_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < stmt_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2061 "parser.cpp" + break; + + case 58: // stmt_foreach: "foreach" "(" name "in" expr ")" stmt +#line 386 "parser.ypp" + { yylhs.value.as < stmt_foreach_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[4].value.as < name_ptr > ())), std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2067 "parser.cpp" + break; + + case 59: // stmt_foreach: "foreach" "(" name "," name "in" expr ")" stmt +#line 388 "parser.ypp" + { yylhs.value.as < stmt_foreach_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[6].value.as < name_ptr > ())), expr_ptr(std::move(yystack_[4].value.as < name_ptr > ())), std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2073 "parser.cpp" + break; + + case 60: // stmt_switch: "switch" "(" expr ")" stmt_block +#line 393 "parser.ypp" + { yylhs.value.as < stmt_switch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_list_ptr > ())); } +#line 2079 "parser.cpp" + break; + + case 61: // stmt_case: "case" integer ":" +#line 398 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < integer_ptr > ())), std::make_unique(yylhs.location)); } +#line 2085 "parser.cpp" + break; + + case 62: // stmt_case: "case" neg_integer ":" +#line 400 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < integer_ptr > ())), std::make_unique(yylhs.location)); } +#line 2091 "parser.cpp" + break; + + case 63: // stmt_case: "case" string ":" +#line 402 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < string_ptr > ())), std::make_unique(yylhs.location)); } +#line 2097 "parser.cpp" + break; + + case 64: // stmt_default: "default" ":" +#line 407 "parser.ypp" + { yylhs.value.as < stmt_default_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } +#line 2103 "parser.cpp" + break; + + case 65: // stmt_break: "break" ";" +#line 412 "parser.ypp" + { yylhs.value.as < stmt_break_ptr > () = std::make_unique(yylhs.location); } +#line 2109 "parser.cpp" + break; + + case 66: // stmt_continue: "continue" ";" +#line 417 "parser.ypp" + { yylhs.value.as < stmt_continue_ptr > () = std::make_unique(yylhs.location); } +#line 2115 "parser.cpp" + break; + + case 67: // stmt_return: "return" expr ";" +#line 422 "parser.ypp" + { yylhs.value.as < stmt_return_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2121 "parser.cpp" + break; + + case 68: // stmt_return: "return" ";" +#line 424 "parser.ypp" + { yylhs.value.as < stmt_return_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } +#line 2127 "parser.cpp" + break; + + case 69: // for_stmt: expr_assign +#line 428 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_list = std::make_unique(yylhs.location); yylhs.value.as < stmt_ptr > ().as_list->stmts.push_back(stmt_ptr(std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_assign_ptr > ())))); } +#line 2133 "parser.cpp" + break; + + case 70: // for_stmt: %empty +#line 429 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_node = std::make_unique(yylhs.location); } +#line 2139 "parser.cpp" + break; + + case 71: // for_expr: expr +#line 433 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2145 "parser.cpp" + break; + + case 72: // for_expr: %empty +#line 434 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location); } +#line 2151 "parser.cpp" + break; + + case 73: // expr: expr_compare +#line 438 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2157 "parser.cpp" + break; + + case 74: // expr: expr_binary +#line 439 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2163 "parser.cpp" + break; + + case 75: // expr: expr_primitive +#line 440 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2169 "parser.cpp" + break; + + case 76: // expr_assign: "++" object +#line 444 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < node_ptr > ())); } +#line 2175 "parser.cpp" + break; + + case 77: // expr_assign: "--" object +#line 445 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < node_ptr > ())); } +#line 2181 "parser.cpp" + break; + + case 78: // expr_assign: object "++" +#line 446 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < node_ptr > ())); } +#line 2187 "parser.cpp" + break; + + case 79: // expr_assign: object "--" +#line 447 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < node_ptr > ())); } +#line 2193 "parser.cpp" + break; + + case 80: // expr_assign: object "=" expr +#line 448 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2199 "parser.cpp" + break; + + case 81: // expr_assign: object "|=" expr +#line 449 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2205 "parser.cpp" + break; + + case 82: // expr_assign: object "&=" expr +#line 450 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2211 "parser.cpp" + break; + + case 83: // expr_assign: object "^=" expr +#line 451 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2217 "parser.cpp" + break; + + case 84: // expr_assign: object "<<=" expr +#line 452 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()),std::move( yystack_[0].value.as < expr_ptr > ())); } +#line 2223 "parser.cpp" + break; + + case 85: // expr_assign: object ">>=" expr +#line 453 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2229 "parser.cpp" + break; + + case 86: // expr_assign: object "+=" expr +#line 454 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2235 "parser.cpp" + break; + + case 87: // expr_assign: object "-=" expr +#line 455 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2241 "parser.cpp" + break; + + case 88: // expr_assign: object "*=" expr +#line 456 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2247 "parser.cpp" + break; + + case 89: // expr_assign: object "/=" expr +#line 457 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2253 "parser.cpp" + break; + + case 90: // expr_assign: object "%=" expr +#line 458 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2259 "parser.cpp" + break; + + case 91: // expr_compare: expr "||" expr +#line 462 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2265 "parser.cpp" + break; + + case 92: // expr_compare: expr "&&" expr +#line 463 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2271 "parser.cpp" + break; + + case 93: // expr_compare: expr "==" expr +#line 464 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2277 "parser.cpp" + break; + + case 94: // expr_compare: expr "!=" expr +#line 465 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2283 "parser.cpp" + break; + + case 95: // expr_compare: expr "<=" expr +#line 466 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2289 "parser.cpp" + break; + + case 96: // expr_compare: expr ">=" expr +#line 467 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2295 "parser.cpp" + break; + + case 97: // expr_compare: expr "<" expr +#line 468 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2301 "parser.cpp" + break; + + case 98: // expr_compare: expr ">" expr +#line 469 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2307 "parser.cpp" + break; + + case 99: // expr_binary: expr "|" expr +#line 473 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2313 "parser.cpp" + break; + + case 100: // expr_binary: expr "&" expr +#line 474 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2319 "parser.cpp" + break; + + case 101: // expr_binary: expr "^" expr +#line 475 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2325 "parser.cpp" + break; + + case 102: // expr_binary: expr "<<" expr +#line 476 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2331 "parser.cpp" + break; + + case 103: // expr_binary: expr ">>" expr +#line 477 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2337 "parser.cpp" + break; + + case 104: // expr_binary: expr "+" expr +#line 478 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2343 "parser.cpp" + break; + + case 105: // expr_binary: expr "-" expr +#line 479 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2349 "parser.cpp" + break; + + case 106: // expr_binary: expr "*" expr +#line 480 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2355 "parser.cpp" + break; + + case 107: // expr_binary: expr "/" expr +#line 481 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2361 "parser.cpp" + break; + + case 108: // expr_binary: expr "%" expr +#line 482 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2367 "parser.cpp" + break; + + case 109: // expr_primitive: "(" expr ")" +#line 486 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[1].value.as < expr_ptr > ()); } +#line 2373 "parser.cpp" + break; + + case 110: // expr_primitive: "~" expr +#line 487 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2379 "parser.cpp" + break; + + case 111: // expr_primitive: "!" expr +#line 488 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2385 "parser.cpp" + break; + + case 112: // expr_primitive: expr_call +#line 489 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2391 "parser.cpp" + break; + + case 113: // expr_primitive: expr_call_thread +#line 490 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2397 "parser.cpp" + break; + + case 114: // expr_primitive: expr_call_childthread +#line 491 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2403 "parser.cpp" + break; + + case 115: // expr_primitive: expr_function +#line 492 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2409 "parser.cpp" + break; + + case 116: // expr_primitive: expr_add_array +#line 493 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2415 "parser.cpp" + break; + + case 117: // expr_primitive: expr_array +#line 494 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2421 "parser.cpp" + break; + + case 118: // expr_primitive: expr_field +#line 495 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2427 "parser.cpp" + break; + + case 119: // expr_primitive: expr_size +#line 496 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2433 "parser.cpp" + break; + + case 120: // expr_primitive: thisthread +#line 497 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < thisthread_ptr > ()); } +#line 2439 "parser.cpp" + break; + + case 121: // expr_primitive: empty_array +#line 498 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < empty_array_ptr > ()); } +#line 2445 "parser.cpp" + break; + + case 122: // expr_primitive: undefined +#line 499 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < undefined_ptr > ()); } +#line 2451 "parser.cpp" + break; + + case 123: // expr_primitive: game +#line 500 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < game_ptr > ()); } +#line 2457 "parser.cpp" + break; + + case 124: // expr_primitive: self +#line 501 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < self_ptr > ()); } +#line 2463 "parser.cpp" + break; + + case 125: // expr_primitive: anim +#line 502 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < anim_ptr > ()); } +#line 2469 "parser.cpp" + break; + + case 126: // expr_primitive: level +#line 503 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < level_ptr > ()); } +#line 2475 "parser.cpp" + break; + + case 127: // expr_primitive: animation +#line 504 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < animation_ptr > ()); } +#line 2481 "parser.cpp" + break; + + case 128: // expr_primitive: animtree +#line 505 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < animtree_ptr > ()); } +#line 2487 "parser.cpp" + break; + + case 129: // expr_primitive: name +#line 506 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < name_ptr > ()); } +#line 2493 "parser.cpp" + break; + + case 130: // expr_primitive: istring +#line 507 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < istring_ptr > ()); } +#line 2499 "parser.cpp" + break; + + case 131: // expr_primitive: string +#line 508 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < string_ptr > ()); } +#line 2505 "parser.cpp" + break; + + case 132: // expr_primitive: vector +#line 509 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < vector_ptr > ()); } +#line 2511 "parser.cpp" + break; + + case 133: // expr_primitive: neg_float +#line 510 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < float_ptr > ()); } +#line 2517 "parser.cpp" + break; + + case 134: // expr_primitive: neg_integer +#line 511 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < integer_ptr > ()); } +#line 2523 "parser.cpp" + break; + + case 135: // expr_primitive: float +#line 512 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < float_ptr > ()); } +#line 2529 "parser.cpp" + break; + + case 136: // expr_primitive: integer +#line 513 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < integer_ptr > ()); } +#line 2535 "parser.cpp" + break; + + case 137: // expr_primitive: false +#line 514 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < false_ptr > ()); } +#line 2541 "parser.cpp" + break; + + case 138: // expr_primitive: true +#line 515 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < true_ptr > ()); } +#line 2547 "parser.cpp" + break; + + case 139: // expr_call: expr_call_function +#line 519 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2553 "parser.cpp" + break; + + case 140: // expr_call: expr_call_pointer +#line 520 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2559 "parser.cpp" + break; + + case 141: // expr_call: object expr_call_function +#line 521 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::move(yystack_[1].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2565 "parser.cpp" + break; + + case 142: // expr_call: object expr_call_pointer +#line 522 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::move(yystack_[1].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2571 "parser.cpp" + break; + + case 143: // expr_call_thread: "thread" expr_call_function +#line 526 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2577 "parser.cpp" + break; + + case 144: // expr_call_thread: "thread" expr_call_pointer +#line 527 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2583 "parser.cpp" + break; + + case 145: // expr_call_thread: object "thread" expr_call_function +#line 528 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2589 "parser.cpp" + break; + + case 146: // expr_call_thread: object "thread" expr_call_pointer +#line 529 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2595 "parser.cpp" + break; + + case 147: // expr_call_childthread: "childthread" expr_call_function +#line 533 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2601 "parser.cpp" + break; + + case 148: // expr_call_childthread: "childthread" expr_call_pointer +#line 534 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2607 "parser.cpp" + break; + + case 149: // expr_call_childthread: object "childthread" expr_call_function +#line 535 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2613 "parser.cpp" + break; + + case 150: // expr_call_childthread: object "childthread" expr_call_pointer +#line 536 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2619 "parser.cpp" + break; + + case 151: // expr_call_function: name "(" expr_arguments ")" +#line 541 "parser.ypp" + {yylhs.value.as < expr_call_type_ptr > ().as_func = std::make_unique(yylhs.location, std::make_unique(), std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2625 "parser.cpp" + break; + + case 152: // expr_call_function: file "::" name "(" expr_arguments ")" +#line 543 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_func = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < file_ptr > ()), std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2631 "parser.cpp" + break; + + case 153: // expr_call_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 548 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_pointer = std::make_unique(yylhs.location, false, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2637 "parser.cpp" + break; + + case 154: // expr_call_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 550 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_pointer = std::make_unique(yylhs.location, true, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2643 "parser.cpp" + break; + + case 155: // expr_arguments: expr_arguments_filled +#line 554 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[0].value.as < expr_arguments_ptr > ()); } +#line 2649 "parser.cpp" + break; + + case 156: // expr_arguments: expr_arguments_empty +#line 555 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[0].value.as < expr_arguments_ptr > ()); } +#line 2655 "parser.cpp" + break; + + case 157: // expr_arguments_filled: expr_arguments "," expr +#line 560 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[2].value.as < expr_arguments_ptr > ()); yylhs.value.as < expr_arguments_ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2661 "parser.cpp" + break; + + case 158: // expr_arguments_filled: expr +#line 562 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < expr_arguments_ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2667 "parser.cpp" + break; + + case 159: // expr_arguments_empty: %empty +#line 567 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::make_unique(yylhs.location); } +#line 2673 "parser.cpp" + break; + + case 160: // expr_function: "::" name +#line 572 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2679 "parser.cpp" + break; + + case 161: // expr_function: file "::" name +#line 574 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < file_ptr > ()), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2685 "parser.cpp" + break; + + case 162: // expr_add_array: "[" expr_arguments_filled "]" +#line 579 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2691 "parser.cpp" + break; + + case 163: // expr_array: object "[" expr "]" +#line 584 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < node_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2697 "parser.cpp" + break; + + case 164: // expr_field: object "." name +#line 589 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2703 "parser.cpp" + break; + + case 165: // expr_size: object "." "size" +#line 594 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ())); } +#line 2709 "parser.cpp" + break; + + case 166: // object: expr_call +#line 598 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2715 "parser.cpp" + break; + + case 167: // object: expr_array +#line 599 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2721 "parser.cpp" + break; + + case 168: // object: expr_field +#line 600 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2727 "parser.cpp" + break; + + case 169: // object: game +#line 601 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < game_ptr > ()); } +#line 2733 "parser.cpp" + break; + + case 170: // object: self +#line 602 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < self_ptr > ()); } +#line 2739 "parser.cpp" + break; + + case 171: // object: anim +#line 603 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < anim_ptr > ()); } +#line 2745 "parser.cpp" + break; + + case 172: // object: level +#line 604 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < level_ptr > ()); } +#line 2751 "parser.cpp" + break; + + case 173: // object: name +#line 605 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < name_ptr > ()); } +#line 2757 "parser.cpp" + break; + + case 174: // thisthread: "thisthread" +#line 608 "parser.ypp" + { yylhs.value.as < thisthread_ptr > () = std::make_unique(yylhs.location); } +#line 2763 "parser.cpp" + break; + + case 175: // empty_array: "[" "]" +#line 609 "parser.ypp" + { yylhs.value.as < empty_array_ptr > () = std::make_unique(yylhs.location); } +#line 2769 "parser.cpp" + break; + + case 176: // undefined: "undefined" +#line 610 "parser.ypp" + { yylhs.value.as < undefined_ptr > () = std::make_unique(yylhs.location); } +#line 2775 "parser.cpp" + break; + + case 177: // game: "game" +#line 611 "parser.ypp" + { yylhs.value.as < game_ptr > () = std::make_unique(yylhs.location); } +#line 2781 "parser.cpp" + break; + + case 178: // self: "self" +#line 612 "parser.ypp" + { yylhs.value.as < self_ptr > () = std::make_unique(yylhs.location); } +#line 2787 "parser.cpp" + break; + + case 179: // anim: "anim" +#line 613 "parser.ypp" + { yylhs.value.as < anim_ptr > () = std::make_unique(yylhs.location); } +#line 2793 "parser.cpp" + break; + + case 180: // level: "level" +#line 614 "parser.ypp" + { yylhs.value.as < level_ptr > () = std::make_unique(yylhs.location); } +#line 2799 "parser.cpp" + break; + + case 181: // animation: "%" "identifier" +#line 615 "parser.ypp" + { yylhs.value.as < animation_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2805 "parser.cpp" + break; + + case 182: // animtree: "#animtree" +#line 616 "parser.ypp" + { yylhs.value.as < animtree_ptr > () = std::make_unique(yylhs.location); } +#line 2811 "parser.cpp" + break; + + case 183: // name: "identifier" +#line 617 "parser.ypp" + { yylhs.value.as < name_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2817 "parser.cpp" + break; + + case 184: // file: "file path" +#line 618 "parser.ypp" + { yylhs.value.as < file_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2823 "parser.cpp" + break; + + case 185: // istring: "localized string" +#line 619 "parser.ypp" + { yylhs.value.as < istring_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2829 "parser.cpp" + break; + + case 186: // string: "string literal" +#line 620 "parser.ypp" + { yylhs.value.as < string_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2835 "parser.cpp" + break; + + case 187: // vector: "(" expr "," expr "," expr ")" +#line 621 "parser.ypp" + { yylhs.value.as < vector_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[3].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2841 "parser.cpp" + break; + + case 188: // neg_float: "-" "float" +#line 622 "parser.ypp" + { yylhs.value.as < float_ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 2847 "parser.cpp" + break; + + case 189: // neg_integer: "-" "int" +#line 623 "parser.ypp" + { yylhs.value.as < integer_ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 2853 "parser.cpp" + break; + + case 190: // float: "float" +#line 624 "parser.ypp" + { yylhs.value.as < float_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2859 "parser.cpp" + break; + + case 191: // integer: "int" +#line 625 "parser.ypp" + { yylhs.value.as < integer_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2865 "parser.cpp" + break; + + case 192: // false: "false" +#line 626 "parser.ypp" + { yylhs.value.as < false_ptr > () = std::make_unique(yylhs.location); } +#line 2871 "parser.cpp" + break; + + case 193: // true: "true" +#line 627 "parser.ypp" + { yylhs.value.as < true_ptr > () = std::make_unique(yylhs.location); } +#line 2877 "parser.cpp" + break; + + +#line 2881 "parser.cpp" + + default: + break; + } + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + YYERROR; + } +#endif // YY_EXCEPTIONS + YY_SYMBOL_PRINT ("-> $$ =", yylhs); + yypop_ (yylen); + yylen = 0; + + // Shift the result of the reduction. + yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); + } + goto yynewstate; + + + /*--------------------------------------. + | yyerrlab -- here on detecting error. | + `--------------------------------------*/ + yyerrlab: + // If not already recovering from an error, report this error. + if (!yyerrstatus_) + { + ++yynerrs_; + context yyctx (*this, yyla); + std::string msg = yysyntax_error_ (yyctx); + error (yyla.location, YY_MOVE (msg)); + } + + + yyerror_range[1].location = yyla.location; + if (yyerrstatus_ == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + // Return failure if at end of input. + if (yyla.kind () == symbol_kind::S_YYEOF) + YYABORT; + else if (!yyla.empty ()) + { + yy_destroy_ ("Error: discarding", yyla); + yyla.clear (); + } + } + + // Else will try to reuse lookahead token after shifting the error token. + goto yyerrlab1; + + + /*---------------------------------------------------. + | yyerrorlab -- error raised explicitly by YYERROR. | + `---------------------------------------------------*/ + yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and + the label yyerrorlab therefore never appears in user code. */ + if (false) + YYERROR; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + yypop_ (yylen); + yylen = 0; + YY_STACK_PRINT (); + goto yyerrlab1; + + + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ + yyerrlab1: + yyerrstatus_ = 3; // Each real token shifted decrements this. + // Pop stack until we find a state that shifts the error token. + for (;;) + { + yyn = yypact_[+yystack_[0].state]; + if (!yy_pact_value_is_default_ (yyn)) + { + yyn += symbol_kind::S_YYerror; + if (0 <= yyn && yyn <= yylast_ + && yycheck_[yyn] == symbol_kind::S_YYerror) + { + yyn = yytable_[yyn]; + if (0 < yyn) + break; + } + } + + // Pop the current state because it cannot handle the error token. + if (yystack_.size () == 1) + YYABORT; + + yyerror_range[1].location = yystack_[0].location; + yy_destroy_ ("Error: popping", yystack_[0]); + yypop_ (); + YY_STACK_PRINT (); + } + { + stack_symbol_type error_token; + + yyerror_range[2].location = yyla.location; + YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); + + // Shift the error token. + yy_lac_discard_ ("error recovery"); + error_token.state = state_type (yyn); + yypush_ ("Shifting", YY_MOVE (error_token)); + } + goto yynewstate; + + + /*-------------------------------------. + | yyacceptlab -- YYACCEPT comes here. | + `-------------------------------------*/ + yyacceptlab: + yyresult = 0; + goto yyreturn; + + + /*-----------------------------------. + | yyabortlab -- YYABORT comes here. | + `-----------------------------------*/ + yyabortlab: + yyresult = 1; + goto yyreturn; + + + /*-----------------------------------------------------. + | yyreturn -- parsing is finished, return the result. | + `-----------------------------------------------------*/ + yyreturn: + if (!yyla.empty ()) + yy_destroy_ ("Cleanup: discarding lookahead", yyla); + + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + yypop_ (yylen); + YY_STACK_PRINT (); + while (1 < yystack_.size ()) + { + yy_destroy_ ("Cleanup: popping", yystack_[0]); + yypop_ (); + } + + return yyresult; + } +#if YY_EXCEPTIONS + catch (...) + { + YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; + // Do not try to display the values of the reclaimed symbols, + // as their printers might throw an exception. + if (!yyla.empty ()) + yy_destroy_ (YY_NULLPTR, yyla); + + while (1 < yystack_.size ()) + { + yy_destroy_ (YY_NULLPTR, yystack_[0]); + yypop_ (); + } + throw; + } +#endif // YY_EXCEPTIONS + } + + void + parser::error (const syntax_error& yyexc) + { + error (yyexc.location, yyexc.what ()); + } + + const char * + parser::symbol_name (symbol_kind_type yysymbol) + { + static const char *const yy_sname[] = + { + "end of file", "error", "invalid token", "#include", "#using_animtree", + "#animtree", "endon", "notify", "wait", "waittill", "waittillmatch", + "waittillframeend", "if", "else", "while", "for", "foreach", "in", + "switch", "case", "default", "break", "continue", "return", "thread", + "childthread", "thisthread", "call", "true", "false", "undefined", + "size", "game", "self", "anim", "level", "(", ")", "{", "}", "[", "]", + ",", ".", "::", ":", ";", "++", "--", "<<", ">>", "||", "&&", "==", "!=", + "<=", ">=", "<", ">", "!", "~", "=", "+=", "-=", "*=", "/=", "%=", "|=", + "&=", "^=", ">>=", "<<=", "|", "&", "^", "+", "-", "*", "/", "%", + "file path", "identifier", "string literal", "localized string", "float", + "int", "ADD_ARRAY", "THEN", "NEG", "ANIMREF", "PREINC", "PREDEC", + "POSTINC", "POSTDEC", "$accept", "root", "program", "include", "define", + "usingtree", "constant", "thread", "parameters", "stmt", "stmt_block", + "stmt_list", "stmt_call", "stmt_assign", "stmt_endon", "stmt_notify", + "stmt_wait", "stmt_waittill", "stmt_waittillmatch", + "stmt_waittillframeend", "stmt_if", "stmt_ifelse", "stmt_while", + "stmt_for", "stmt_foreach", "stmt_switch", "stmt_case", "stmt_default", + "stmt_break", "stmt_continue", "stmt_return", "for_stmt", "for_expr", + "expr", "expr_assign", "expr_compare", "expr_binary", "expr_primitive", + "expr_call", "expr_call_thread", "expr_call_childthread", + "expr_call_function", "expr_call_pointer", "expr_arguments", + "expr_arguments_filled", "expr_arguments_empty", "expr_function", + "expr_add_array", "expr_array", "expr_field", "expr_size", "object", + "thisthread", "empty_array", "undefined", "game", "self", "anim", + "level", "animation", "animtree", "name", "file", "istring", "string", + "vector", "neg_float", "neg_integer", "float", "integer", "false", + "true", YY_NULLPTR + }; + return yy_sname[yysymbol]; + } + + + + // parser::context. + parser::context::context (const parser& yyparser, const symbol_type& yyla) + : yyparser_ (yyparser) + , yyla_ (yyla) + {} + + int + parser::context::expected_tokens (symbol_kind_type yyarg[], int yyargn) const + { + // Actual number of expected tokens + int yycount = 0; + +#if IW6DEBUG + // Execute LAC once. We don't care if it is successful, we + // only do it for the sake of debugging output. + if (!yyparser_.yy_lac_established_) + yyparser_.yy_lac_check_ (yyla_.kind ()); +#endif + + for (int yyx = 0; yyx < YYNTOKENS; ++yyx) + { + symbol_kind_type yysym = YY_CAST (symbol_kind_type, yyx); + if (yysym != symbol_kind::S_YYerror + && yysym != symbol_kind::S_YYUNDEF + && yyparser_.yy_lac_check_ (yysym)) + { + if (!yyarg) + ++yycount; + else if (yycount == yyargn) + return 0; + else + yyarg[yycount++] = yysym; + } + } + if (yyarg && yycount == 0 && 0 < yyargn) + yyarg[0] = symbol_kind::S_YYEMPTY; + return yycount; + } + + + bool + parser::yy_lac_check_ (symbol_kind_type yytoken) const + { + // Logically, the yylac_stack's lifetime is confined to this function. + // Clear it, to get rid of potential left-overs from previous call. + yylac_stack_.clear (); + // Reduce until we encounter a shift and thereby accept the token. +#if IW6DEBUG + YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; +#endif + std::ptrdiff_t lac_top = 0; + while (true) + { + state_type top_state = (yylac_stack_.empty () + ? yystack_[lac_top].state + : yylac_stack_.back ()); + int yyrule = yypact_[+top_state]; + if (yy_pact_value_is_default_ (yyrule) + || (yyrule += yytoken) < 0 || yylast_ < yyrule + || yycheck_[yyrule] != yytoken) + { + // Use the default action. + yyrule = yydefact_[+top_state]; + if (yyrule == 0) + { + YYCDEBUG << " Err\n"; + return false; + } + } + else + { + // Use the action from yytable. + yyrule = yytable_[yyrule]; + if (yy_table_value_is_error_ (yyrule)) + { + YYCDEBUG << " Err\n"; + return false; + } + if (0 < yyrule) + { + YYCDEBUG << " S" << yyrule << '\n'; + return true; + } + yyrule = -yyrule; + } + // By now we know we have to simulate a reduce. + YYCDEBUG << " R" << yyrule - 1; + // Pop the corresponding number of values from the stack. + { + std::ptrdiff_t yylen = yyr2_[yyrule]; + // First pop from the LAC stack as many tokens as possible. + std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); + if (yylen < lac_size) + { + yylac_stack_.resize (std::size_t (lac_size - yylen)); + yylen = 0; + } + else if (lac_size) + { + yylac_stack_.clear (); + yylen -= lac_size; + } + // Only afterwards look at the main stack. + // We simulate popping elements by incrementing lac_top. + lac_top += yylen; + } + // Keep top_state in sync with the updated stack. + top_state = (yylac_stack_.empty () + ? yystack_[lac_top].state + : yylac_stack_.back ()); + // Push the resulting state of the reduction. + state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); + YYCDEBUG << " G" << int (state); + yylac_stack_.push_back (state); + } + } + + // Establish the initial context if no initial context currently exists. + bool + parser::yy_lac_establish_ (symbol_kind_type yytoken) + { + /* Establish the initial context for the current lookahead if no initial + context is currently established. + + We define a context as a snapshot of the parser stacks. We define + the initial context for a lookahead as the context in which the + parser initially examines that lookahead in order to select a + syntactic action. Thus, if the lookahead eventually proves + syntactically unacceptable (possibly in a later context reached via a + series of reductions), the initial context can be used to determine + the exact set of tokens that would be syntactically acceptable in the + lookahead's place. Moreover, it is the context after which any + further semantic actions would be erroneous because they would be + determined by a syntactically unacceptable token. + + yy_lac_establish_ should be invoked when a reduction is about to be + performed in an inconsistent state (which, for the purposes of LAC, + includes consistent states that don't know they're consistent because + their default reductions have been disabled). + + For parse.lac=full, the implementation of yy_lac_establish_ is as + follows. If no initial context is currently established for the + current lookahead, then check if that lookahead can eventually be + shifted if syntactic actions continue from the current context. */ + if (!yy_lac_established_) + { +#if IW6DEBUG + YYCDEBUG << "LAC: initial context established for " + << symbol_name (yytoken) << '\n'; +#endif + yy_lac_established_ = true; + return yy_lac_check_ (yytoken); + } + return true; + } + + // Discard any previous initial lookahead context. + void + parser::yy_lac_discard_ (const char* evt) + { + /* Discard any previous initial lookahead context because of Event, + which may be a lookahead change or an invalidation of the currently + established initial context for the current lookahead. + + The most common example of a lookahead change is a shift. An example + of both cases is syntax error recovery. That is, a syntax error + occurs when the lookahead is syntactically erroneous for the + currently established initial context, so error recovery manipulates + the parser stacks to try to find a new initial context in which the + current lookahead is syntactically acceptable. If it fails to find + such a context, it discards the lookahead. */ + if (yy_lac_established_) + { + YYCDEBUG << "LAC: initial context discarded due to " + << evt << '\n'; + yy_lac_established_ = false; + } + } + + int + parser::yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const + { + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yyla) is + if this state is a consistent state with a default action. + Thus, detecting the absence of a lookahead is sufficient to + determine that there is no unexpected or expected token to + report. In that case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is + a consistent state with a default action. There might have + been a previous inconsistent state, consistent state with a + non-default action, or user semantic action that manipulated + yyla. (However, yyla is currently not documented for users.) + In the first two cases, it might appear that the current syntax + error should have been detected in the previous state when + yy_lac_check was invoked. However, at that time, there might + have been a different syntax error that discarded a different + initial context during error recovery, leaving behind the + current lookahead. + */ + + if (!yyctx.lookahead ().empty ()) + { + if (yyarg) + yyarg[0] = yyctx.token (); + int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); + return yyn + 1; + } + return 0; + } + + // Generate an error message. + std::string + parser::yysyntax_error_ (const context& yyctx) const + { + // Its maximum. + enum { YYARGS_MAX = 5 }; + // Arguments of yyformat. + symbol_kind_type yyarg[YYARGS_MAX]; + int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); + + char const* yyformat = YY_NULLPTR; + switch (yycount) + { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + default: // Avoid compiler warnings. + YYCASE_ (0, YY_("syntax error")); + YYCASE_ (1, YY_("syntax error, unexpected %s")); + YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +#undef YYCASE_ + } + + std::string yyres; + // Argument number. + std::ptrdiff_t yyi = 0; + for (char const* yyp = yyformat; *yyp; ++yyp) + if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) + { + yyres += symbol_name (yyarg[yyi++]); + ++yyp; + } + else + yyres += *yyp; + return yyres; + } + + + const short parser::yypact_ninf_ = -232; + + const short parser::yytable_ninf_ = -174; + + const short + parser::yypact_[] = + { + -2, -68, -15, -232, 42, -2, -232, -232, -232, -232, + -232, -23, -232, 7, -35, -232, -232, -232, -24, 663, + -232, -232, 23, -12, -232, -232, -3, -3, -232, 28, + -232, -232, -232, -232, -232, -232, -232, 663, 539, -24, + 663, 663, -76, -8, -232, -232, -232, 1372, -232, -232, + -232, 40, -232, -232, -232, -232, -232, -232, 251, 387, + -232, 407, -232, -232, -232, 416, 449, 474, 562, -232, + -232, 19, 25, -232, -232, -232, -232, -232, -232, -232, + -232, -232, 55, 78, -24, 63, -232, -232, 59, 75, + -232, -232, 83, 975, 539, -232, 1450, 87, 92, -232, + -232, -232, -232, -232, -232, -232, -232, 663, 663, 663, + 663, 663, 663, 663, 663, 663, 663, 663, 663, 663, + 663, 663, 663, 663, 663, -3, -3, 725, -9, -232, + -232, 663, -24, -232, 842, -232, -232, 663, -24, 663, + -232, 663, 659, 663, -232, 66, 66, 1460, 1008, 535, + 535, 322, 322, 322, 322, 1051, 1491, 1501, 10, 10, + -232, -232, -232, -232, -232, -232, -232, 1282, -232, -232, + 14, -232, 88, 663, 89, 100, 101, 110, 111, 114, + -62, 112, 113, 116, 601, -232, 121, 121, -232, -232, + 880, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + 117, 136, 139, -232, -232, 771, -232, -232, -232, -232, + 59, 659, 88, 1321, 1359, 119, 1450, -232, -232, 663, + 1406, -232, 663, 663, 1, -24, 663, 73, 143, 144, + 152, -232, -232, -232, -232, 1419, -232, 31, 31, -232, + -232, -232, -232, -232, 170, 171, 173, 174, -24, -232, + -232, 663, 663, 663, 663, 663, 663, 663, 663, 663, + 663, 663, 167, 663, 175, 33, -232, 1114, 1147, 166, + -232, 940, 12, 1157, -232, -232, -232, -232, 663, 663, + 663, 663, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, + 1450, 1450, 1450, 182, 1190, 663, -232, 918, 918, 663, + 663, -24, 78, 1200, 1018, 1061, 1104, 663, -232, 48, + 209, -232, 177, 1450, 1233, 207, -232, 181, 192, 663, + 194, 663, 199, 663, 49, -232, 918, 1, 918, 663, + -232, -232, 65, -232, 76, -232, 85, -232, -232, 191, + -232, 1243, 200, 204, 211, 918, 918, -232, -232, -232, + -232, -232 + }; + + const unsigned char + parser::yydefact_[] = + { + 3, 0, 0, 183, 0, 2, 6, 7, 9, 10, + 11, 0, 184, 0, 0, 1, 4, 5, 17, 0, + 8, 186, 0, 0, 16, 182, 0, 0, 174, 0, + 193, 192, 176, 177, 178, 179, 180, 0, 159, 0, + 0, 0, 0, 0, 185, 190, 191, 0, 73, 74, + 75, 112, 113, 114, 139, 140, 115, 116, 117, 118, + 119, 0, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 0, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 0, 0, 0, 0, 143, 144, 0, 0, + 147, 148, 0, 0, 159, 175, 158, 0, 155, 156, + 160, 111, 110, 188, 189, 181, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, + 142, 159, 0, 12, 0, 14, 15, 0, 0, 0, + 109, 0, 158, 0, 162, 102, 103, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 104, 105, + 106, 107, 108, 145, 146, 149, 150, 0, 165, 164, + 0, 155, 161, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 39, 0, 0, 41, 18, + 0, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 0, 166, 0, 167, 168, 0, 169, 170, 171, 172, + 173, 0, 0, 0, 0, 0, 157, 163, 151, 159, + 0, 53, 0, 0, 70, 0, 0, 0, 0, 0, + 0, 64, 65, 66, 68, 0, 166, 76, 77, 38, + 40, 44, 42, 43, 0, 0, 0, 0, 0, 78, + 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 48, 0, 0, 0, + 69, 0, 0, 0, 63, 62, 61, 67, 0, 0, + 0, 0, 80, 86, 87, 88, 89, 90, 81, 82, + 83, 85, 84, 0, 0, 159, 152, 0, 0, 72, + 0, 0, 0, 0, 0, 0, 0, 159, 187, 0, + 54, 56, 0, 71, 0, 0, 60, 0, 0, 159, + 0, 159, 0, 159, 0, 153, 0, 70, 0, 0, + 45, 47, 0, 50, 0, 52, 0, 154, 55, 0, + 58, 0, 0, 0, 0, 0, 0, 46, 49, 51, + 57, 59 + }; + + const short + parser::yypgoto_[] = + { + -232, -232, -232, 224, 246, -232, -232, -232, -232, -41, + -79, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -77, -232, 57, -231, -232, -232, -232, -94, 69, + -232, -16, -11, -112, -31, -232, -232, -232, -82, 82, + -232, 115, -232, -232, -232, 172, 183, 195, 205, -232, + -232, 0, 5, -232, 3, -232, -232, 84, -232, 91, + -232, -232 + }; + + const short + parser::yydefgoto_[] = + { + 0, 4, 5, 6, 7, 8, 9, 10, 23, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 279, 322, 96, 210, 48, 49, 50, 51, 52, + 53, 54, 55, 97, 171, 99, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81 + }; + + const short + parser::yytable_[] = + { + 11, 1, 2, 280, 135, 11, 13, 98, 103, 104, + 86, 90, 12, 18, 237, 87, 91, 22, 24, 170, + 21, 14, 168, 46, 29, 83, 88, 88, 29, 310, + 84, 89, 89, 33, 34, 35, 36, 85, 19, 100, + 211, 85, 15, -173, -173, 129, -173, 21, 186, 187, + 130, 228, 213, 20, 311, 131, 143, 3, 29, -173, + 82, 88, -173, 98, -166, -166, 89, -166, 92, 132, + 306, 127, 3, 105, 258, 143, 47, 12, 3, 3, + -166, 12, 3, -166, 136, 335, 347, 122, 123, 124, + 143, 143, 246, 246, 93, 131, 211, 101, 102, -173, + -173, 133, 352, 137, 213, 213, 280, 143, 213, 163, + 165, 12, 3, 353, 164, 166, 134, 275, 143, 138, + -166, -166, 354, 139, 229, 88, 88, 143, 169, 143, + 89, 89, 172, 144, 220, 231, 232, 233, 222, 89, + 246, 120, 121, 122, 123, 124, 234, 235, 29, 250, + 236, 142, 213, 33, 34, 35, 36, 241, 104, 242, + 274, 85, 243, 251, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 252, 238, 167, 253, 220, 220, 284, 285, + 220, 89, 89, 319, 221, 89, 223, 286, 224, 129, + 226, 12, 3, 212, 130, 334, 288, 289, 303, 290, + 291, 305, 309, 211, 211, 88, 214, 342, 317, 344, + 89, 346, 336, 337, 339, 213, 213, 340, 355, 16, + 230, 129, 129, 326, 220, 282, 130, 130, 341, 89, + 343, 245, 211, 246, 211, 345, 357, 88, 88, 215, + 358, 17, 89, 89, 213, 213, 213, 359, 169, 212, + 349, 211, 211, 0, 239, 129, 320, 321, 214, 214, + 130, 240, 214, 213, 213, -167, -167, 0, -167, 0, + 0, 88, 0, 0, 0, 0, 89, 0, 0, 277, + 278, -167, 0, 283, -167, 348, 0, 350, 0, 0, + 0, 247, 248, 0, 0, 215, 216, 220, 220, 0, + 0, 325, 89, 89, 360, 361, 214, 217, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 218, + 304, -167, -167, 0, 0, 0, 220, 220, 220, 219, + 0, 89, 89, 89, 0, 313, 314, 315, 316, 281, + 0, 0, 0, 0, 0, 220, 220, 0, 216, 216, + 89, 89, 216, 0, 0, 0, 323, 324, 0, 217, + 217, 107, 108, 217, 0, 0, 212, 212, 0, 0, + 0, 218, 218, 0, 0, 218, 0, 0, 0, 214, + 214, 219, 219, 0, 0, 219, 351, 120, 121, 122, + 123, 124, 0, 0, 0, 212, 216, 212, 0, 0, + 0, -168, -168, 0, -168, 0, 0, 217, 214, 214, + 214, 0, 215, 215, 212, 212, 0, -168, 0, 218, + -168, 125, 126, 0, 29, 0, 0, 214, 214, 219, + -169, -169, 0, -169, 0, 0, 0, 127, 0, 0, + 128, 215, 281, 215, 0, 0, -169, 0, 0, -169, + 0, 0, 0, 0, 0, 0, 0, -168, -168, 0, + 215, 215, 0, -170, -170, 0, -170, 0, 0, 216, + 216, 0, 0, 0, 0, 0, 0, 12, 3, -170, + 217, 217, -170, 0, 0, 0, -169, -169, -171, -171, + 0, -171, 218, 218, 0, 0, 0, 0, 216, 216, + 216, 0, 219, 219, -171, 0, 0, -171, 0, 217, + 217, 217, 0, 0, 0, 0, 0, 216, 216, -170, + -170, 218, 218, 218, 0, 0, 0, 0, 217, 217, + 0, 219, 219, 219, 25, 0, 0, 0, 0, 0, + 218, 218, 0, 0, -171, -171, 0, 0, 0, 0, + 219, 219, 0, 26, 27, 28, 29, 30, 31, 32, + 0, 33, 34, 35, 36, 37, 0, 0, 0, 94, + 95, 0, 0, 39, 107, 108, -172, -172, 0, -172, + 113, 114, 115, 116, 0, 0, 0, 0, 40, 41, + 0, 0, -172, 0, 0, -172, 25, 0, 0, 0, + 120, 121, 122, 123, 124, 42, 0, 0, 43, 12, + 3, 21, 44, 45, 46, 26, 27, 28, 29, 30, + 31, 32, 0, 33, 34, 35, 36, 37, 0, 0, + 0, 38, -172, -172, 0, 39, 0, 244, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 40, 41, 0, 0, 0, 0, 0, 0, 25, 0, + 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, + 43, 12, 3, 21, 44, 45, 46, 26, 27, 28, + 29, 30, 31, 32, 0, 33, 34, 35, 36, 37, + 225, 0, 0, 38, 0, 0, 0, 39, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 0, 0, + 0, 0, 40, 41, 0, 0, 0, 0, 0, 0, + 25, 117, 118, 119, 120, 121, 122, 123, 124, 42, + 0, 0, 43, 12, 3, 21, 44, 45, 46, 26, + 27, 28, 29, 30, 31, 32, 0, 33, 34, 35, + 36, 37, 0, 0, 0, 94, 0, 0, 0, 39, + 0, 0, 0, 0, 0, 0, 0, 254, 255, 0, + 256, 257, 0, 0, 40, 41, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 125, 0, 0, 29, 0, + 0, 42, 0, 0, 43, 12, 3, 21, 44, 45, + 46, 127, 0, 0, 258, 0, 0, 0, 259, 260, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 0, 0, 0, 0, 0, 0, 0, + 173, 12, 3, 174, 175, 0, 176, 177, 178, 0, + 179, 180, 181, 182, 183, 184, 26, 0, 0, 29, + 0, 0, 0, 0, 33, 34, 35, 36, 0, 0, + 134, 185, 85, 0, 0, 0, 0, 0, 173, 186, + 187, 174, 175, 0, 176, 177, 178, 0, 179, 180, + 181, 182, 183, 184, 26, 0, 0, 29, 0, 0, + 0, 0, 33, 34, 35, 36, 0, 0, 134, 249, + 85, 0, 12, 3, 0, 0, 173, 186, 187, 174, + 175, 0, 176, 177, 178, 0, 179, 180, 181, 182, + 183, 184, 26, 0, 0, 29, 0, 0, 0, 0, + 33, 34, 35, 36, 0, 0, 134, 0, 85, 0, + 12, 3, 0, 0, 0, 186, 187, 29, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 127, 0, 0, 258, 0, 0, 0, 259, 260, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 12, 3, + 0, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 140, 0, 0, 0, 0, 141, 0, 0, + 12, 3, 0, 0, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 117, 118, 119, + 120, 121, 122, 123, 124, 328, 0, 107, 108, 0, + 329, 111, 112, 113, 114, 115, 116, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 0, 0, 0, + 117, 118, 119, 120, 121, 122, 123, 124, 0, 0, + 117, 118, 119, 120, 121, 122, 123, 124, 330, 0, + 107, 108, 0, 331, 111, 112, 113, 114, 115, 116, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 0, 0, 0, 0, 118, 119, 120, 121, 122, 123, + 124, 0, 0, 117, 118, 119, 120, 121, 122, 123, + 124, 332, 0, 0, 0, 0, 333, 0, 0, 0, + 0, 307, 0, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 0, 0, 0, 117, 118, 119, 120, + 121, 122, 123, 124, 308, 0, 117, 118, 119, 120, + 121, 122, 123, 124, 312, 0, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 0, 0, 0, 117, + 118, 119, 120, 121, 122, 123, 124, 318, 0, 117, + 118, 119, 120, 121, 122, 123, 124, 327, 0, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 0, + 0, 0, 117, 118, 119, 120, 121, 122, 123, 124, + 338, 0, 117, 118, 119, 120, 121, 122, 123, 124, + 356, 0, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 0, 0, 0, 117, 118, 119, 120, 121, + 122, 123, 124, 0, 0, 117, 118, 119, 120, 121, + 122, 123, 124, 227, 0, 0, 0, 0, 0, 0, + 0, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 117, 118, 119, 120, 121, 122, + 123, 124, 272, 0, 0, 0, 0, 0, 0, 0, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, + 124, 273, 0, 0, 0, 0, 0, 0, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 106, 0, + 0, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 0, + 0, 0, 0, 0, 117, 118, 119, 120, 121, 122, + 123, 124, 276, 0, 0, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 287, 0, 0, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 0, 0, 0, 0, + 0, 117, 118, 119, 120, 121, 122, 123, 124, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 107, + 108, 0, 110, 111, 112, 113, 114, 115, 116, 0, + 0, 0, 117, 118, 119, 120, 121, 122, 123, 124, + 0, 0, 117, 118, 119, 120, 121, 122, 123, 124, + 107, 108, 0, 0, 111, 112, 113, 114, 115, 116, + 107, 108, 0, 0, 111, 112, 113, 114, 115, 116, + 0, 0, 0, 0, 0, 119, 120, 121, 122, 123, + 124, 0, 0, 0, 0, 0, 120, 121, 122, 123, + 124 + }; + + const short + parser::yycheck_[] = + { + 0, 3, 4, 234, 83, 5, 1, 38, 84, 85, + 26, 27, 80, 36, 76, 26, 27, 14, 18, 131, + 82, 36, 31, 85, 27, 37, 26, 27, 27, 17, + 42, 26, 27, 32, 33, 34, 35, 40, 61, 39, + 134, 40, 0, 24, 25, 61, 27, 82, 47, 48, + 61, 37, 134, 46, 42, 36, 42, 81, 27, 40, + 37, 61, 43, 94, 24, 25, 61, 27, 40, 44, + 37, 40, 81, 81, 43, 42, 19, 80, 81, 81, + 40, 80, 81, 43, 84, 37, 37, 77, 78, 79, + 42, 42, 186, 187, 37, 36, 190, 40, 41, 80, + 81, 46, 37, 40, 186, 187, 337, 42, 190, 125, + 126, 80, 81, 37, 125, 126, 38, 229, 42, 44, + 80, 81, 37, 40, 36, 125, 126, 42, 128, 42, + 125, 126, 132, 41, 134, 46, 36, 36, 138, 134, + 234, 75, 76, 77, 78, 79, 36, 36, 27, 190, + 36, 94, 234, 32, 33, 34, 35, 45, 85, 46, + 41, 40, 46, 46, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 46, 180, 127, 46, 186, 187, 45, 45, + 190, 186, 187, 305, 137, 190, 139, 45, 141, 215, + 143, 80, 81, 134, 215, 317, 36, 36, 41, 36, + 36, 36, 46, 307, 308, 215, 134, 329, 36, 331, + 215, 333, 13, 46, 17, 307, 308, 46, 37, 5, + 173, 247, 248, 312, 234, 235, 247, 248, 46, 234, + 46, 184, 336, 337, 338, 46, 46, 247, 248, 134, + 46, 5, 247, 248, 336, 337, 338, 46, 258, 190, + 337, 355, 356, -1, 180, 281, 307, 308, 186, 187, + 281, 180, 190, 355, 356, 24, 25, -1, 27, -1, + -1, 281, -1, -1, -1, -1, 281, -1, -1, 232, + 233, 40, -1, 236, 43, 336, -1, 338, -1, -1, + -1, 186, 187, -1, -1, 190, 134, 307, 308, -1, + -1, 311, 307, 308, 355, 356, 234, 134, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 134, + 273, 80, 81, -1, -1, -1, 336, 337, 338, 134, + -1, 336, 337, 338, -1, 288, 289, 290, 291, 234, + -1, -1, -1, -1, -1, 355, 356, -1, 186, 187, + 355, 356, 190, -1, -1, -1, 309, 310, -1, 186, + 187, 49, 50, 190, -1, -1, 307, 308, -1, -1, + -1, 186, 187, -1, -1, 190, -1, -1, -1, 307, + 308, 186, 187, -1, -1, 190, 339, 75, 76, 77, + 78, 79, -1, -1, -1, 336, 234, 338, -1, -1, + -1, 24, 25, -1, 27, -1, -1, 234, 336, 337, + 338, -1, 307, 308, 355, 356, -1, 40, -1, 234, + 43, 24, 25, -1, 27, -1, -1, 355, 356, 234, + 24, 25, -1, 27, -1, -1, -1, 40, -1, -1, + 43, 336, 337, 338, -1, -1, 40, -1, -1, 43, + -1, -1, -1, -1, -1, -1, -1, 80, 81, -1, + 355, 356, -1, 24, 25, -1, 27, -1, -1, 307, + 308, -1, -1, -1, -1, -1, -1, 80, 81, 40, + 307, 308, 43, -1, -1, -1, 80, 81, 24, 25, + -1, 27, 307, 308, -1, -1, -1, -1, 336, 337, + 338, -1, 307, 308, 40, -1, -1, 43, -1, 336, + 337, 338, -1, -1, -1, -1, -1, 355, 356, 80, + 81, 336, 337, 338, -1, -1, -1, -1, 355, 356, + -1, 336, 337, 338, 5, -1, -1, -1, -1, -1, + 355, 356, -1, -1, 80, 81, -1, -1, -1, -1, + 355, 356, -1, 24, 25, 26, 27, 28, 29, 30, + -1, 32, 33, 34, 35, 36, -1, -1, -1, 40, + 41, -1, -1, 44, 49, 50, 24, 25, -1, 27, + 55, 56, 57, 58, -1, -1, -1, -1, 59, 60, + -1, -1, 40, -1, -1, 43, 5, -1, -1, -1, + 75, 76, 77, 78, 79, 76, -1, -1, 79, 80, + 81, 82, 83, 84, 85, 24, 25, 26, 27, 28, + 29, 30, -1, 32, 33, 34, 35, 36, -1, -1, + -1, 40, 80, 81, -1, 44, -1, 46, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 59, 60, -1, -1, -1, -1, -1, -1, 5, -1, + -1, -1, -1, -1, -1, -1, -1, 76, -1, -1, + 79, 80, 81, 82, 83, 84, 85, 24, 25, 26, + 27, 28, 29, 30, -1, 32, 33, 34, 35, 36, + 41, -1, -1, 40, -1, -1, -1, 44, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, -1, -1, + -1, -1, 59, 60, -1, -1, -1, -1, -1, -1, + 5, 72, 73, 74, 75, 76, 77, 78, 79, 76, + -1, -1, 79, 80, 81, 82, 83, 84, 85, 24, + 25, 26, 27, 28, 29, 30, -1, 32, 33, 34, + 35, 36, -1, -1, -1, 40, -1, -1, -1, 44, + -1, -1, -1, -1, -1, -1, -1, 6, 7, -1, + 9, 10, -1, -1, 59, 60, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 24, -1, -1, 27, -1, + -1, 76, -1, -1, 79, 80, 81, 82, 83, 84, + 85, 40, -1, -1, 43, -1, -1, -1, 47, 48, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, -1, -1, -1, -1, -1, -1, -1, + 8, 80, 81, 11, 12, -1, 14, 15, 16, -1, + 18, 19, 20, 21, 22, 23, 24, -1, -1, 27, + -1, -1, -1, -1, 32, 33, 34, 35, -1, -1, + 38, 39, 40, -1, -1, -1, -1, -1, 8, 47, + 48, 11, 12, -1, 14, 15, 16, -1, 18, 19, + 20, 21, 22, 23, 24, -1, -1, 27, -1, -1, + -1, -1, 32, 33, 34, 35, -1, -1, 38, 39, + 40, -1, 80, 81, -1, -1, 8, 47, 48, 11, + 12, -1, 14, 15, 16, -1, 18, 19, 20, 21, + 22, 23, 24, -1, -1, 27, -1, -1, -1, -1, + 32, 33, 34, 35, -1, -1, 38, -1, 40, -1, + 80, 81, -1, -1, -1, 47, 48, 27, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 40, -1, -1, 43, -1, -1, -1, 47, 48, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 80, 81, + -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 37, -1, -1, -1, -1, 42, -1, -1, + 80, 81, -1, -1, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 72, 73, 74, + 75, 76, 77, 78, 79, 37, -1, 49, 50, -1, + 42, 53, 54, 55, 56, 57, 58, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, -1, -1, -1, + 72, 73, 74, 75, 76, 77, 78, 79, -1, -1, + 72, 73, 74, 75, 76, 77, 78, 79, 37, -1, + 49, 50, -1, 42, 53, 54, 55, 56, 57, 58, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + -1, -1, -1, -1, 73, 74, 75, 76, 77, 78, + 79, -1, -1, 72, 73, 74, 75, 76, 77, 78, + 79, 37, -1, -1, -1, -1, 42, -1, -1, -1, + -1, 37, -1, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, -1, -1, -1, 72, 73, 74, 75, + 76, 77, 78, 79, 37, -1, 72, 73, 74, 75, + 76, 77, 78, 79, 37, -1, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, -1, -1, -1, 72, + 73, 74, 75, 76, 77, 78, 79, 37, -1, 72, + 73, 74, 75, 76, 77, 78, 79, 37, -1, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, -1, + -1, -1, 72, 73, 74, 75, 76, 77, 78, 79, + 37, -1, 72, 73, 74, 75, 76, 77, 78, 79, + 37, -1, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, -1, -1, -1, 72, 73, 74, 75, 76, + 77, 78, 79, -1, -1, 72, 73, 74, 75, 76, + 77, 78, 79, 41, -1, -1, -1, -1, -1, -1, + -1, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 72, 73, 74, 75, 76, 77, + 78, 79, 41, -1, -1, -1, -1, -1, -1, -1, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 72, 73, 74, 75, 76, 77, 78, + 79, 42, -1, -1, -1, -1, -1, -1, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 46, -1, + -1, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 72, 73, 74, 75, 76, 77, 78, 79, -1, + -1, -1, -1, -1, 72, 73, 74, 75, 76, 77, + 78, 79, 46, -1, -1, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 46, -1, -1, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 72, 73, + 74, 75, 76, 77, 78, 79, -1, -1, -1, -1, + -1, 72, 73, 74, 75, 76, 77, 78, 79, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 49, + 50, -1, 52, 53, 54, 55, 56, 57, 58, -1, + -1, -1, 72, 73, 74, 75, 76, 77, 78, 79, + -1, -1, 72, 73, 74, 75, 76, 77, 78, 79, + 49, 50, -1, -1, 53, 54, 55, 56, 57, 58, + 49, 50, -1, -1, 53, 54, 55, 56, 57, 58, + -1, -1, -1, -1, -1, 74, 75, 76, 77, 78, + 79, -1, -1, -1, -1, -1, 75, 76, 77, 78, + 79 + }; + + const unsigned char + parser::yystos_[] = + { + 0, 3, 4, 81, 95, 96, 97, 98, 99, 100, + 101, 155, 80, 156, 36, 0, 97, 98, 36, 61, + 46, 82, 158, 102, 155, 5, 24, 25, 26, 27, + 28, 29, 30, 32, 33, 34, 35, 36, 40, 44, + 59, 60, 76, 79, 83, 84, 85, 127, 129, 130, + 131, 132, 133, 134, 135, 136, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 37, 37, 42, 40, 135, 136, 155, 156, + 135, 136, 40, 127, 40, 41, 127, 137, 138, 139, + 155, 127, 127, 84, 85, 81, 46, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 72, 73, 74, + 75, 76, 77, 78, 79, 24, 25, 40, 43, 135, + 136, 36, 44, 46, 38, 104, 155, 40, 44, 40, + 37, 42, 127, 42, 41, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 135, 136, 135, 136, 127, 31, 155, + 137, 138, 155, 8, 11, 12, 14, 15, 16, 18, + 19, 20, 21, 22, 23, 39, 47, 48, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 128, 132, 133, 142, 143, 145, 149, 150, 151, 152, + 155, 127, 155, 127, 127, 41, 127, 41, 37, 36, + 127, 46, 36, 36, 36, 36, 36, 76, 158, 161, + 163, 45, 46, 46, 46, 127, 132, 145, 145, 39, + 103, 46, 46, 46, 6, 7, 9, 10, 43, 47, + 48, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 41, 42, 41, 137, 46, 127, 127, 125, + 128, 145, 155, 127, 45, 45, 45, 46, 36, 36, + 36, 36, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 41, 127, 36, 37, 37, 37, 46, + 17, 42, 37, 127, 127, 127, 127, 36, 37, 137, + 103, 103, 126, 127, 127, 155, 104, 37, 37, 42, + 37, 42, 37, 42, 137, 37, 13, 46, 37, 17, + 46, 46, 137, 46, 137, 46, 137, 37, 103, 125, + 103, 127, 37, 37, 37, 37, 37, 46, 46, 46, + 103, 103 + }; + + const unsigned char + parser::yyr1_[] = + { + 0, 94, 95, 95, 96, 96, 96, 96, 97, 98, + 98, 98, 99, 100, 101, 102, 102, 102, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 104, 104, + 105, 105, 106, 106, 107, 108, 109, 109, 110, 111, + 111, 112, 112, 113, 114, 115, 116, 117, 118, 118, + 119, 120, 120, 120, 121, 122, 123, 124, 124, 125, + 125, 126, 126, 127, 127, 127, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 129, 129, 129, 129, 129, 129, 129, 129, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 132, + 132, 132, 132, 133, 133, 133, 133, 134, 134, 134, + 134, 135, 135, 136, 136, 137, 137, 138, 138, 139, + 140, 140, 141, 142, 143, 144, 145, 145, 145, 145, + 145, 145, 145, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165 + }; + + const signed char + parser::yyr2_[] = + { + 0, 2, 1, 0, 2, 2, 1, 1, 3, 1, + 1, 1, 5, 4, 5, 3, 1, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, + 2, 1, 2, 2, 2, 6, 8, 6, 3, 8, + 6, 8, 6, 2, 5, 7, 5, 9, 7, 9, + 5, 3, 3, 3, 2, 2, 2, 3, 2, 1, + 0, 1, 0, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 2, 2, 2, 3, 3, 2, 2, 3, + 3, 4, 6, 8, 9, 1, 1, 3, 1, 0, + 2, 3, 3, 4, 3, 3, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, + 1, 2, 1, 1, 1, 1, 1, 7, 2, 2, + 1, 1, 1, 1 + }; + + + + +#if IW6DEBUG + const short + parser::yyrline_[] = + { + 0, 231, 231, 232, 236, 238, 240, 242, 247, 252, + 253, 254, 258, 263, 268, 273, 275, 278, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 305, 306, + 310, 312, 317, 319, 324, 329, 334, 336, 341, 346, + 348, 353, 355, 360, 365, 370, 375, 380, 385, 387, + 392, 397, 399, 401, 406, 411, 416, 421, 423, 428, + 429, 433, 434, 438, 439, 440, 444, 445, 446, 447, + 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 462, 463, 464, 465, 466, 467, 468, 469, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 519, + 520, 521, 522, 526, 527, 528, 529, 533, 534, 535, + 536, 540, 542, 547, 549, 554, 555, 559, 561, 567, + 571, 573, 578, 583, 588, 593, 598, 599, 600, 601, + 602, 603, 604, 605, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627 + }; + + void + parser::yy_stack_print_ () const + { + *yycdebug_ << "Stack now"; + for (stack_type::const_iterator + i = yystack_.begin (), + i_end = yystack_.end (); + i != i_end; ++i) + *yycdebug_ << ' ' << int (i->state); + *yycdebug_ << '\n'; + } + + void + parser::yy_reduce_print_ (int yyrule) const + { + int yylno = yyrline_[yyrule]; + int yynrhs = yyr2_[yyrule]; + // Print the symbols being reduced, and their result. + *yycdebug_ << "Reducing stack by rule " << yyrule - 1 + << " (line " << yylno << "):\n"; + // The symbols being reduced. + for (int yyi = 0; yyi < yynrhs; yyi++) + YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", + yystack_[(yynrhs) - (yyi + 1)]); + } +#endif // IW6DEBUG + + +#line 13 "parser.ypp" +} } } // xsk::gsc::iw6 +#line 3949 "parser.cpp" + +#line 629 "parser.ypp" + + +void xsk::gsc::iw6::parser::error(const xsk::gsc::location& loc, const std::string& msg) +{ + throw xsk::gsc::comp_error(loc, msg); +} diff --git a/src/iw6/xsk/parser.hpp b/src/iw6/xsk/parser.hpp new file mode 100644 index 00000000..06dcf875 --- /dev/null +++ b/src/iw6/xsk/parser.hpp @@ -0,0 +1,4717 @@ +// A Bison parser, made by GNU Bison 3.7.5. + +// Skeleton interface for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. + +// 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 . + +// As a special exception, you may create a larger work that contains +// part or all of the Bison parser skeleton and distribute that work +// under terms of your choice, so long as that work isn't itself a +// parser generator using the skeleton or a modified version thereof +// as a parser skeleton. Alternatively, if you modify or redistribute +// the parser skeleton itself, you may (at your option) remove this +// special exception, which will cause the skeleton and the resulting +// Bison output files to be licensed under the GNU General Public +// License without this special exception. + +// This special exception was added by the Free Software Foundation in +// version 2.2 of Bison. + + +/** + ** \file parser.hpp + ** Define the xsk::gsc::iw6::parser class. + */ + +// C++ LALR(1) parser skeleton written by Akim Demaille. + +// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, +// especially those whose name start with YY_ or yy_. They are +// private implementation details that can be changed or removed. + +#ifndef YY_IW6_PARSER_HPP_INCLUDED +# define YY_IW6_PARSER_HPP_INCLUDED +// "%code requires" blocks. +#line 33 "parser.ypp" + +#include "iw6.hpp" +typedef void *yyscan_t; +#define YY_DECL xsk::gsc::iw6::parser::symbol_type IW6lex(yyscan_t yyscanner, xsk::gsc::location& loc) + +#line 55 "parser.hpp" + +# include +# include // std::abort +# include +# include +# include +# include + +#if defined __cplusplus +# define YY_CPLUSPLUS __cplusplus +#else +# define YY_CPLUSPLUS 199711L +#endif + +// Support move semantics when possible. +#if 201103L <= YY_CPLUSPLUS +# define YY_MOVE std::move +# define YY_MOVE_OR_COPY move +# define YY_MOVE_REF(Type) Type&& +# define YY_RVREF(Type) Type&& +# define YY_COPY(Type) Type +#else +# define YY_MOVE +# define YY_MOVE_OR_COPY copy +# define YY_MOVE_REF(Type) Type& +# define YY_RVREF(Type) const Type& +# define YY_COPY(Type) const Type& +#endif + +// Support noexcept when possible. +#if 201103L <= YY_CPLUSPLUS +# define YY_NOEXCEPT noexcept +# define YY_NOTHROW +#else +# define YY_NOEXCEPT +# define YY_NOTHROW throw () +#endif + +// Support constexpr when possible. +#if 201703 <= YY_CPLUSPLUS +# define YY_CONSTEXPR constexpr +#else +# define YY_CONSTEXPR +#endif + +#include +#ifndef IW6_ASSERT +# include +# define IW6_ASSERT assert +#endif + + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YY_USE(E) ((void) (E)) +#else +# define YY_USE(E) /* empty */ +#endif + +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +/* Debug traces. */ +#ifndef IW6DEBUG +# if defined YYDEBUG +#if YYDEBUG +# define IW6DEBUG 1 +# else +# define IW6DEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define IW6DEBUG 1 +# endif /* ! defined YYDEBUG */ +#endif /* ! defined IW6DEBUG */ + +#line 13 "parser.ypp" +namespace xsk { namespace gsc { namespace iw6 { +#line 198 "parser.hpp" + + + + + /// A Bison parser. + class parser + { + public: +#ifndef IW6STYPE + /// A buffer to store and retrieve objects. + /// + /// Sort of a variant, but does not keep track of the nature + /// of the stored data, since that knowledge is available + /// via the current parser state. + class semantic_type + { + public: + /// Type of *this. + typedef semantic_type self_type; + + /// Empty construction. + semantic_type () YY_NOEXCEPT + : yybuffer_ () + , yytypeid_ (YY_NULLPTR) + {} + + /// Construct and fill. + template + semantic_type (YY_RVREF (T) t) + : yytypeid_ (&typeid (T)) + { + IW6_ASSERT (sizeof (T) <= size); + new (yyas_ ()) T (YY_MOVE (t)); + } + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + semantic_type (const self_type&) = delete; + /// Non copyable. + self_type& operator= (const self_type&) = delete; +#endif + + /// Destruction, allowed only if empty. + ~semantic_type () YY_NOEXCEPT + { + IW6_ASSERT (!yytypeid_); + } + +# if 201103L <= YY_CPLUSPLUS + /// Instantiate a \a T in here from \a t. + template + T& + emplace (U&&... u) + { + IW6_ASSERT (!yytypeid_); + IW6_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (std::forward (u)...); + } +# else + /// Instantiate an empty \a T in here. + template + T& + emplace () + { + IW6_ASSERT (!yytypeid_); + IW6_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (); + } + + /// Instantiate a \a T in here from \a t. + template + T& + emplace (const T& t) + { + IW6_ASSERT (!yytypeid_); + IW6_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (t); + } +# endif + + /// Instantiate an empty \a T in here. + /// Obsolete, use emplace. + template + T& + build () + { + return emplace (); + } + + /// Instantiate a \a T in here from \a t. + /// Obsolete, use emplace. + template + T& + build (const T& t) + { + return emplace (t); + } + + /// Accessor to a built \a T. + template + T& + as () YY_NOEXCEPT + { + IW6_ASSERT (yytypeid_); + IW6_ASSERT (*yytypeid_ == typeid (T)); + IW6_ASSERT (sizeof (T) <= size); + return *yyas_ (); + } + + /// Const accessor to a built \a T (for %printer). + template + const T& + as () const YY_NOEXCEPT + { + IW6_ASSERT (yytypeid_); + IW6_ASSERT (*yytypeid_ == typeid (T)); + IW6_ASSERT (sizeof (T) <= size); + return *yyas_ (); + } + + /// Swap the content with \a that, of same type. + /// + /// Both variants must be built beforehand, because swapping the actual + /// data requires reading it (with as()), and this is not possible on + /// unconstructed variants: it would require some dynamic testing, which + /// should not be the variant's responsibility. + /// Swapping between built and (possibly) non-built is done with + /// self_type::move (). + template + void + swap (self_type& that) YY_NOEXCEPT + { + IW6_ASSERT (yytypeid_); + IW6_ASSERT (*yytypeid_ == *that.yytypeid_); + std::swap (as (), that.as ()); + } + + /// Move the content of \a that to this. + /// + /// Destroys \a that. + template + void + move (self_type& that) + { +# if 201103L <= YY_CPLUSPLUS + emplace (std::move (that.as ())); +# else + emplace (); + swap (that); +# endif + that.destroy (); + } + +# if 201103L <= YY_CPLUSPLUS + /// Move the content of \a that to this. + template + void + move (self_type&& that) + { + emplace (std::move (that.as ())); + that.destroy (); + } +#endif + + /// Copy the content of \a that to this. + template + void + copy (const self_type& that) + { + emplace (that.as ()); + } + + /// Destroy the stored \a T. + template + void + destroy () + { + as ().~T (); + yytypeid_ = YY_NULLPTR; + } + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + semantic_type (const self_type&); + /// Non copyable. + self_type& operator= (const self_type&); +#endif + + /// Accessor to raw memory as \a T. + template + T* + yyas_ () YY_NOEXCEPT + { + void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + /// Const accessor to raw memory as \a T. + template + const T* + yyas_ () const YY_NOEXCEPT + { + const void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + /// An auxiliary type to compute the largest semantic type. + union union_type + { + // anim + char dummy1[sizeof (anim_ptr)]; + + // animation + char dummy2[sizeof (animation_ptr)]; + + // animtree + char dummy3[sizeof (animtree_ptr)]; + + // constant + char dummy4[sizeof (constant_ptr)]; + + // define + char dummy5[sizeof (define_ptr)]; + + // empty_array + char dummy6[sizeof (empty_array_ptr)]; + + // expr_arguments + // expr_arguments_filled + // expr_arguments_empty + char dummy7[sizeof (expr_arguments_ptr)]; + + // expr_assign + char dummy8[sizeof (expr_assign_ptr)]; + + // expr_call + // expr_call_thread + // expr_call_childthread + char dummy9[sizeof (expr_call_ptr)]; + + // expr_call_function + // expr_call_pointer + char dummy10[sizeof (expr_call_type_ptr)]; + + // for_expr + // expr + // expr_compare + // expr_binary + // expr_primitive + char dummy11[sizeof (expr_ptr)]; + + // false + char dummy12[sizeof (false_ptr)]; + + // file + char dummy13[sizeof (file_ptr)]; + + // neg_float + // float + char dummy14[sizeof (float_ptr)]; + + // game + char dummy15[sizeof (game_ptr)]; + + // include + char dummy16[sizeof (include_ptr)]; + + // neg_integer + // integer + char dummy17[sizeof (integer_ptr)]; + + // istring + char dummy18[sizeof (istring_ptr)]; + + // level + char dummy19[sizeof (level_ptr)]; + + // name + char dummy20[sizeof (name_ptr)]; + + // expr_function + // expr_add_array + // expr_array + // expr_field + // expr_size + // object + char dummy21[sizeof (node_ptr)]; + + // parameters + char dummy22[sizeof (parameters_ptr)]; + + // program + char dummy23[sizeof (program_ptr)]; + + // self + char dummy24[sizeof (self_ptr)]; + + // "file path" + // "identifier" + // "string literal" + // "localized string" + // "float" + // "int" + char dummy25[sizeof (std::string)]; + + // stmt_assign + char dummy26[sizeof (stmt_assign_ptr)]; + + // stmt_break + char dummy27[sizeof (stmt_break_ptr)]; + + // stmt_call + char dummy28[sizeof (stmt_call_ptr)]; + + // stmt_case + char dummy29[sizeof (stmt_case_ptr)]; + + // stmt_continue + char dummy30[sizeof (stmt_continue_ptr)]; + + // stmt_default + char dummy31[sizeof (stmt_default_ptr)]; + + // stmt_endon + char dummy32[sizeof (stmt_endon_ptr)]; + + // stmt_for + char dummy33[sizeof (stmt_for_ptr)]; + + // stmt_foreach + char dummy34[sizeof (stmt_foreach_ptr)]; + + // stmt_if + char dummy35[sizeof (stmt_if_ptr)]; + + // stmt_ifelse + char dummy36[sizeof (stmt_ifelse_ptr)]; + + // stmt_block + // stmt_list + char dummy37[sizeof (stmt_list_ptr)]; + + // stmt_notify + char dummy38[sizeof (stmt_notify_ptr)]; + + // stmt + // for_stmt + char dummy39[sizeof (stmt_ptr)]; + + // stmt_return + char dummy40[sizeof (stmt_return_ptr)]; + + // stmt_switch + char dummy41[sizeof (stmt_switch_ptr)]; + + // stmt_wait + char dummy42[sizeof (stmt_wait_ptr)]; + + // stmt_waittill + char dummy43[sizeof (stmt_waittill_ptr)]; + + // stmt_waittillframeend + char dummy44[sizeof (stmt_waittillframeend_ptr)]; + + // stmt_waittillmatch + char dummy45[sizeof (stmt_waittillmatch_ptr)]; + + // stmt_while + char dummy46[sizeof (stmt_while_ptr)]; + + // string + char dummy47[sizeof (string_ptr)]; + + // thisthread + char dummy48[sizeof (thisthread_ptr)]; + + // thread + char dummy49[sizeof (thread_ptr)]; + + // true + char dummy50[sizeof (true_ptr)]; + + // undefined + char dummy51[sizeof (undefined_ptr)]; + + // usingtree + char dummy52[sizeof (usingtree_ptr)]; + + // vector + char dummy53[sizeof (vector_ptr)]; + }; + + /// The size of the largest semantic type. + enum { size = sizeof (union_type) }; + + /// A buffer to store semantic values. + union + { + /// Strongest alignment constraints. + long double yyalign_me; + /// A buffer large enough to store any of the semantic values. + char yyraw[size]; + } yybuffer_; + + /// Whether the content is built: if defined, the name of the stored type. + const std::type_info *yytypeid_; + }; + +#else + typedef IW6STYPE semantic_type; +#endif + /// Symbol locations. + typedef xsk::gsc::location location_type; + + /// Syntax errors thrown from user actions. + struct syntax_error : std::runtime_error + { + syntax_error (const location_type& l, const std::string& m) + : std::runtime_error (m) + , location (l) + {} + + syntax_error (const syntax_error& s) + : std::runtime_error (s.what ()) + , location (s.location) + {} + + ~syntax_error () YY_NOEXCEPT YY_NOTHROW; + + location_type location; + }; + + /// Token kinds. + struct token + { + enum token_kind_type + { + IW6EMPTY = -2, + IW6EOF = 0, // "end of file" + IW6error = 1, // error + IW6UNDEF = 2, // "invalid token" + INCLUDE = 3, // "#include" + USINGTREE = 4, // "#using_animtree" + ANIMTREE = 5, // "#animtree" + ENDON = 6, // "endon" + NOTIFY = 7, // "notify" + WAIT = 8, // "wait" + WAITTILL = 9, // "waittill" + WAITTILLMATCH = 10, // "waittillmatch" + WAITTILLFRAMEEND = 11, // "waittillframeend" + IF = 12, // "if" + ELSE = 13, // "else" + WHILE = 14, // "while" + FOR = 15, // "for" + FOREACH = 16, // "foreach" + IN = 17, // "in" + SWITCH = 18, // "switch" + CASE = 19, // "case" + DEFAULT = 20, // "default" + BREAK = 21, // "break" + CONTINUE = 22, // "continue" + RETURN = 23, // "return" + THREAD = 24, // "thread" + CHILDTHREAD = 25, // "childthread" + THISTHREAD = 26, // "thisthread" + CALL = 27, // "call" + TRUE = 28, // "true" + FALSE = 29, // "false" + UNDEFINED = 30, // "undefined" + SIZE = 31, // "size" + GAME = 32, // "game" + SELF = 33, // "self" + ANIM = 34, // "anim" + LEVEL = 35, // "level" + LPAREN = 36, // "(" + RPAREN = 37, // ")" + LBRACE = 38, // "{" + RBRACE = 39, // "}" + LBRACKET = 40, // "[" + RBRACKET = 41, // "]" + COMMA = 42, // "," + DOT = 43, // "." + DOUBLECOLON = 44, // "::" + COLON = 45, // ":" + SEMICOLON = 46, // ";" + INCREMENT = 47, // "++" + DECREMENT = 48, // "--" + LSHIFT = 49, // "<<" + RSHIFT = 50, // ">>" + OR = 51, // "||" + AND = 52, // "&&" + EQUALITY = 53, // "==" + INEQUALITY = 54, // "!=" + LESS_EQUAL = 55, // "<=" + GREATER_EQUAL = 56, // ">=" + LESS = 57, // "<" + GREATER = 58, // ">" + NOT = 59, // "!" + COMPLEMENT = 60, // "~" + ASSIGN = 61, // "=" + ASSIGN_ADD = 62, // "+=" + ASSIGN_SUB = 63, // "-=" + ASSIGN_MULT = 64, // "*=" + ASSIGN_DIV = 65, // "/=" + ASSIGN_MOD = 66, // "%=" + ASSIGN_BITWISE_OR = 67, // "|=" + ASSIGN_BITWISE_AND = 68, // "&=" + ASSIGN_BITWISE_EXOR = 69, // "^=" + ASSIGN_RSHIFT = 70, // ">>=" + ASSIGN_LSHIFT = 71, // "<<=" + BITWISE_OR = 72, // "|" + BITWISE_AND = 73, // "&" + BITWISE_EXOR = 74, // "^" + ADD = 75, // "+" + SUB = 76, // "-" + MULT = 77, // "*" + DIV = 78, // "/" + MOD = 79, // "%" + FILE = 80, // "file path" + NAME = 81, // "identifier" + STRING = 82, // "string literal" + ISTRING = 83, // "localized string" + FLOAT = 84, // "float" + INTEGER = 85, // "int" + ADD_ARRAY = 86, // ADD_ARRAY + THEN = 87, // THEN + NEG = 88, // NEG + ANIMREF = 89, // ANIMREF + PREINC = 90, // PREINC + PREDEC = 91, // PREDEC + POSTINC = 92, // POSTINC + POSTDEC = 93 // POSTDEC + }; + /// Backward compatibility alias (Bison 3.6). + typedef token_kind_type yytokentype; + }; + + /// Token kind, as returned by yylex. + typedef token::yytokentype token_kind_type; + + /// Backward compatibility alias (Bison 3.6). + typedef token_kind_type token_type; + + /// Symbol kinds. + struct symbol_kind + { + enum symbol_kind_type + { + YYNTOKENS = 94, ///< Number of tokens. + S_YYEMPTY = -2, + S_YYEOF = 0, // "end of file" + S_YYerror = 1, // error + S_YYUNDEF = 2, // "invalid token" + S_INCLUDE = 3, // "#include" + S_USINGTREE = 4, // "#using_animtree" + S_ANIMTREE = 5, // "#animtree" + S_ENDON = 6, // "endon" + S_NOTIFY = 7, // "notify" + S_WAIT = 8, // "wait" + S_WAITTILL = 9, // "waittill" + S_WAITTILLMATCH = 10, // "waittillmatch" + S_WAITTILLFRAMEEND = 11, // "waittillframeend" + S_IF = 12, // "if" + S_ELSE = 13, // "else" + S_WHILE = 14, // "while" + S_FOR = 15, // "for" + S_FOREACH = 16, // "foreach" + S_IN = 17, // "in" + S_SWITCH = 18, // "switch" + S_CASE = 19, // "case" + S_DEFAULT = 20, // "default" + S_BREAK = 21, // "break" + S_CONTINUE = 22, // "continue" + S_RETURN = 23, // "return" + S_THREAD = 24, // "thread" + S_CHILDTHREAD = 25, // "childthread" + S_THISTHREAD = 26, // "thisthread" + S_CALL = 27, // "call" + S_TRUE = 28, // "true" + S_FALSE = 29, // "false" + S_UNDEFINED = 30, // "undefined" + S_SIZE = 31, // "size" + S_GAME = 32, // "game" + S_SELF = 33, // "self" + S_ANIM = 34, // "anim" + S_LEVEL = 35, // "level" + S_LPAREN = 36, // "(" + S_RPAREN = 37, // ")" + S_LBRACE = 38, // "{" + S_RBRACE = 39, // "}" + S_LBRACKET = 40, // "[" + S_RBRACKET = 41, // "]" + S_COMMA = 42, // "," + S_DOT = 43, // "." + S_DOUBLECOLON = 44, // "::" + S_COLON = 45, // ":" + S_SEMICOLON = 46, // ";" + S_INCREMENT = 47, // "++" + S_DECREMENT = 48, // "--" + S_LSHIFT = 49, // "<<" + S_RSHIFT = 50, // ">>" + S_OR = 51, // "||" + S_AND = 52, // "&&" + S_EQUALITY = 53, // "==" + S_INEQUALITY = 54, // "!=" + S_LESS_EQUAL = 55, // "<=" + S_GREATER_EQUAL = 56, // ">=" + S_LESS = 57, // "<" + S_GREATER = 58, // ">" + S_NOT = 59, // "!" + S_COMPLEMENT = 60, // "~" + S_ASSIGN = 61, // "=" + S_ASSIGN_ADD = 62, // "+=" + S_ASSIGN_SUB = 63, // "-=" + S_ASSIGN_MULT = 64, // "*=" + S_ASSIGN_DIV = 65, // "/=" + S_ASSIGN_MOD = 66, // "%=" + S_ASSIGN_BITWISE_OR = 67, // "|=" + S_ASSIGN_BITWISE_AND = 68, // "&=" + S_ASSIGN_BITWISE_EXOR = 69, // "^=" + S_ASSIGN_RSHIFT = 70, // ">>=" + S_ASSIGN_LSHIFT = 71, // "<<=" + S_BITWISE_OR = 72, // "|" + S_BITWISE_AND = 73, // "&" + S_BITWISE_EXOR = 74, // "^" + S_ADD = 75, // "+" + S_SUB = 76, // "-" + S_MULT = 77, // "*" + S_DIV = 78, // "/" + S_MOD = 79, // "%" + S_FILE = 80, // "file path" + S_NAME = 81, // "identifier" + S_STRING = 82, // "string literal" + S_ISTRING = 83, // "localized string" + S_FLOAT = 84, // "float" + S_INTEGER = 85, // "int" + S_ADD_ARRAY = 86, // ADD_ARRAY + S_THEN = 87, // THEN + S_NEG = 88, // NEG + S_ANIMREF = 89, // ANIMREF + S_PREINC = 90, // PREINC + S_PREDEC = 91, // PREDEC + S_POSTINC = 92, // POSTINC + S_POSTDEC = 93, // POSTDEC + S_YYACCEPT = 94, // $accept + S_root = 95, // root + S_program = 96, // program + S_include = 97, // include + S_define = 98, // define + S_usingtree = 99, // usingtree + S_constant = 100, // constant + S_thread = 101, // thread + S_parameters = 102, // parameters + S_stmt = 103, // stmt + S_stmt_block = 104, // stmt_block + S_stmt_list = 105, // stmt_list + S_stmt_call = 106, // stmt_call + S_stmt_assign = 107, // stmt_assign + S_stmt_endon = 108, // stmt_endon + S_stmt_notify = 109, // stmt_notify + S_stmt_wait = 110, // stmt_wait + S_stmt_waittill = 111, // stmt_waittill + S_stmt_waittillmatch = 112, // stmt_waittillmatch + S_stmt_waittillframeend = 113, // stmt_waittillframeend + S_stmt_if = 114, // stmt_if + S_stmt_ifelse = 115, // stmt_ifelse + S_stmt_while = 116, // stmt_while + S_stmt_for = 117, // stmt_for + S_stmt_foreach = 118, // stmt_foreach + S_stmt_switch = 119, // stmt_switch + S_stmt_case = 120, // stmt_case + S_stmt_default = 121, // stmt_default + S_stmt_break = 122, // stmt_break + S_stmt_continue = 123, // stmt_continue + S_stmt_return = 124, // stmt_return + S_for_stmt = 125, // for_stmt + S_for_expr = 126, // for_expr + S_expr = 127, // expr + S_expr_assign = 128, // expr_assign + S_expr_compare = 129, // expr_compare + S_expr_binary = 130, // expr_binary + S_expr_primitive = 131, // expr_primitive + S_expr_call = 132, // expr_call + S_expr_call_thread = 133, // expr_call_thread + S_expr_call_childthread = 134, // expr_call_childthread + S_expr_call_function = 135, // expr_call_function + S_expr_call_pointer = 136, // expr_call_pointer + S_expr_arguments = 137, // expr_arguments + S_expr_arguments_filled = 138, // expr_arguments_filled + S_expr_arguments_empty = 139, // expr_arguments_empty + S_expr_function = 140, // expr_function + S_expr_add_array = 141, // expr_add_array + S_expr_array = 142, // expr_array + S_expr_field = 143, // expr_field + S_expr_size = 144, // expr_size + S_object = 145, // object + S_thisthread = 146, // thisthread + S_empty_array = 147, // empty_array + S_undefined = 148, // undefined + S_game = 149, // game + S_self = 150, // self + S_anim = 151, // anim + S_level = 152, // level + S_animation = 153, // animation + S_animtree = 154, // animtree + S_name = 155, // name + S_file = 156, // file + S_istring = 157, // istring + S_string = 158, // string + S_vector = 159, // vector + S_neg_float = 160, // neg_float + S_neg_integer = 161, // neg_integer + S_float = 162, // float + S_integer = 163, // integer + S_false = 164, // false + S_true = 165 // true + }; + }; + + /// (Internal) symbol kind. + typedef symbol_kind::symbol_kind_type symbol_kind_type; + + /// The number of tokens. + static const symbol_kind_type YYNTOKENS = symbol_kind::YYNTOKENS; + + /// A complete symbol. + /// + /// Expects its Base type to provide access to the symbol kind + /// via kind (). + /// + /// Provide access to semantic value and location. + template + struct basic_symbol : Base + { + /// Alias to Base. + typedef Base super_type; + + /// Default constructor. + basic_symbol () + : value () + , location () + {} + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + basic_symbol (basic_symbol&& that) + : Base (std::move (that)) + , value () + , location (std::move (that.location)) + { + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (std::move (that.value)); + break; + + default: + break; + } + + } +#endif + + /// Copy constructor. + basic_symbol (const basic_symbol& that); + + /// Constructors for typed symbols. +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, location_type&& l) + : Base (t) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const location_type& l) + : Base (t) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, anim_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const anim_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, animation_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const animation_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, animtree_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const animtree_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, constant_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const constant_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, define_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const define_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, empty_array_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const empty_array_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_arguments_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_arguments_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_assign_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_assign_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_call_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_call_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_call_type_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_call_type_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, false_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const false_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, file_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const file_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, float_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const float_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, game_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const game_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, include_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const include_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, integer_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const integer_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, istring_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const istring_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, level_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const level_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, name_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const name_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, node_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const node_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, parameters_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const parameters_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, program_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const program_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, self_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const self_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_assign_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_assign_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_break_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_break_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_call_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_call_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_case_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_case_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_continue_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_continue_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_default_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_default_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_endon_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_endon_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_for_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_for_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_foreach_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_foreach_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_if_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_if_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_ifelse_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_ifelse_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_list_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_list_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_notify_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_notify_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_return_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_return_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_switch_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_switch_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_wait_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_wait_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittill_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittill_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittillframeend_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittillframeend_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittillmatch_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittillmatch_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_while_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_while_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, string_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const string_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, thisthread_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const thisthread_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, thread_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const thread_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, true_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const true_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, undefined_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const undefined_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, usingtree_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const usingtree_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, vector_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const vector_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + + /// Destroy the symbol. + ~basic_symbol () + { + clear (); + } + + /// Destroy contents, and record that is empty. + void clear () YY_NOEXCEPT + { + // User destructor. + symbol_kind_type yykind = this->kind (); + basic_symbol& yysym = *this; + (void) yysym; + switch (yykind) + { + default: + break; + } + + // Value type destructor. +switch (yykind) + { + case symbol_kind::S_anim: // anim + value.template destroy< anim_ptr > (); + break; + + case symbol_kind::S_animation: // animation + value.template destroy< animation_ptr > (); + break; + + case symbol_kind::S_animtree: // animtree + value.template destroy< animtree_ptr > (); + break; + + case symbol_kind::S_constant: // constant + value.template destroy< constant_ptr > (); + break; + + case symbol_kind::S_define: // define + value.template destroy< define_ptr > (); + break; + + case symbol_kind::S_empty_array: // empty_array + value.template destroy< empty_array_ptr > (); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.template destroy< expr_arguments_ptr > (); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.template destroy< expr_assign_ptr > (); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.template destroy< expr_call_ptr > (); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.template destroy< expr_call_type_ptr > (); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.template destroy< expr_ptr > (); + break; + + case symbol_kind::S_false: // false + value.template destroy< false_ptr > (); + break; + + case symbol_kind::S_file: // file + value.template destroy< file_ptr > (); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.template destroy< float_ptr > (); + break; + + case symbol_kind::S_game: // game + value.template destroy< game_ptr > (); + break; + + case symbol_kind::S_include: // include + value.template destroy< include_ptr > (); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.template destroy< integer_ptr > (); + break; + + case symbol_kind::S_istring: // istring + value.template destroy< istring_ptr > (); + break; + + case symbol_kind::S_level: // level + value.template destroy< level_ptr > (); + break; + + case symbol_kind::S_name: // name + value.template destroy< name_ptr > (); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.template destroy< node_ptr > (); + break; + + case symbol_kind::S_parameters: // parameters + value.template destroy< parameters_ptr > (); + break; + + case symbol_kind::S_program: // program + value.template destroy< program_ptr > (); + break; + + case symbol_kind::S_self: // self + value.template destroy< self_ptr > (); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.template destroy< std::string > (); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.template destroy< stmt_assign_ptr > (); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.template destroy< stmt_break_ptr > (); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.template destroy< stmt_call_ptr > (); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.template destroy< stmt_case_ptr > (); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.template destroy< stmt_continue_ptr > (); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.template destroy< stmt_default_ptr > (); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.template destroy< stmt_endon_ptr > (); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.template destroy< stmt_for_ptr > (); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.template destroy< stmt_foreach_ptr > (); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.template destroy< stmt_if_ptr > (); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.template destroy< stmt_ifelse_ptr > (); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.template destroy< stmt_list_ptr > (); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.template destroy< stmt_notify_ptr > (); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.template destroy< stmt_ptr > (); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.template destroy< stmt_return_ptr > (); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.template destroy< stmt_switch_ptr > (); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.template destroy< stmt_wait_ptr > (); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.template destroy< stmt_waittill_ptr > (); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.template destroy< stmt_waittillframeend_ptr > (); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.template destroy< stmt_waittillmatch_ptr > (); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.template destroy< stmt_while_ptr > (); + break; + + case symbol_kind::S_string: // string + value.template destroy< string_ptr > (); + break; + + case symbol_kind::S_thisthread: // thisthread + value.template destroy< thisthread_ptr > (); + break; + + case symbol_kind::S_thread: // thread + value.template destroy< thread_ptr > (); + break; + + case symbol_kind::S_true: // true + value.template destroy< true_ptr > (); + break; + + case symbol_kind::S_undefined: // undefined + value.template destroy< undefined_ptr > (); + break; + + case symbol_kind::S_usingtree: // usingtree + value.template destroy< usingtree_ptr > (); + break; + + case symbol_kind::S_vector: // vector + value.template destroy< vector_ptr > (); + break; + + default: + break; + } + + Base::clear (); + } + + /// The user-facing name of this symbol. + const char *name () const YY_NOEXCEPT + { + return parser::symbol_name (this->kind ()); + } + + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; + + /// Whether empty. + bool empty () const YY_NOEXCEPT; + + /// Destructive move, \a s is emptied into this. + void move (basic_symbol& s); + + /// The semantic value. + semantic_type value; + + /// The location. + location_type location; + + private: +#if YY_CPLUSPLUS < 201103L + /// Assignment operator. + basic_symbol& operator= (const basic_symbol& that); +#endif + }; + + /// Type access provider for token (enum) based symbols. + struct by_kind + { + /// Default constructor. + by_kind (); + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + by_kind (by_kind&& that); +#endif + + /// Copy constructor. + by_kind (const by_kind& that); + + /// The symbol kind as needed by the constructor. + typedef token_kind_type kind_type; + + /// Constructor from (external) token numbers. + by_kind (kind_type t); + + /// Record that this symbol is empty. + void clear () YY_NOEXCEPT; + + /// Steal the symbol kind from \a that. + void move (by_kind& that); + + /// The (internal) type number (corresponding to \a type). + /// \a empty when empty. + symbol_kind_type kind () const YY_NOEXCEPT; + + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; + + /// The symbol kind. + /// \a S_YYEMPTY when empty. + symbol_kind_type kind_; + }; + + /// Backward compatibility for a private implementation detail (Bison 3.6). + typedef by_kind by_type; + + /// "External" symbols: returned by the scanner. + struct symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + + /// Empty symbol. + symbol_type () {} + + /// Constructor for valueless symbols, and symbols from each type. +#if 201103L <= YY_CPLUSPLUS + symbol_type (int tok, location_type l) + : super_type(token_type (tok), std::move (l)) +#else + symbol_type (int tok, const location_type& l) + : super_type(token_type (tok), l) +#endif + { + IW6_ASSERT (tok == token::IW6EOF + || (token::IW6error <= tok && tok <= token::MOD) + || (token::ADD_ARRAY <= tok && tok <= token::POSTDEC)); + } +#if 201103L <= YY_CPLUSPLUS + symbol_type (int tok, std::string v, location_type l) + : super_type(token_type (tok), std::move (v), std::move (l)) +#else + symbol_type (int tok, const std::string& v, const location_type& l) + : super_type(token_type (tok), v, l) +#endif + { + IW6_ASSERT ((token::FILE <= tok && tok <= token::INTEGER)); + } + }; + + /// Build a parser object. + parser (yyscan_t yyscanner_yyarg, xsk::gsc::location& loc_yyarg, xsk::gsc::program_ptr& ast_yyarg); + virtual ~parser (); + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + parser (const parser&) = delete; + /// Non copyable. + parser& operator= (const parser&) = delete; +#endif + + /// Parse. An alias for parse (). + /// \returns 0 iff parsing succeeded. + int operator() (); + + /// Parse. + /// \returns 0 iff parsing succeeded. + virtual int parse (); + +#if IW6DEBUG + /// The current debugging stream. + std::ostream& debug_stream () const YY_ATTRIBUTE_PURE; + /// Set the current debugging stream. + void set_debug_stream (std::ostream &); + + /// Type for debugging levels. + typedef int debug_level_type; + /// The current debugging level. + debug_level_type debug_level () const YY_ATTRIBUTE_PURE; + /// Set the current debugging level. + void set_debug_level (debug_level_type l); +#endif + + /// Report a syntax error. + /// \param loc where the syntax error is found. + /// \param msg a description of the syntax error. + virtual void error (const location_type& loc, const std::string& msg); + + /// Report a syntax error. + void error (const syntax_error& err); + + /// The user-facing name of the symbol whose (internal) number is + /// YYSYMBOL. No bounds checking. + static const char *symbol_name (symbol_kind_type yysymbol); + + // Implementation of make_symbol for each symbol type. +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IW6EOF (location_type l) + { + return symbol_type (token::IW6EOF, std::move (l)); + } +#else + static + symbol_type + make_IW6EOF (const location_type& l) + { + return symbol_type (token::IW6EOF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IW6error (location_type l) + { + return symbol_type (token::IW6error, std::move (l)); + } +#else + static + symbol_type + make_IW6error (const location_type& l) + { + return symbol_type (token::IW6error, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IW6UNDEF (location_type l) + { + return symbol_type (token::IW6UNDEF, std::move (l)); + } +#else + static + symbol_type + make_IW6UNDEF (const location_type& l) + { + return symbol_type (token::IW6UNDEF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INCLUDE (location_type l) + { + return symbol_type (token::INCLUDE, std::move (l)); + } +#else + static + symbol_type + make_INCLUDE (const location_type& l) + { + return symbol_type (token::INCLUDE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_USINGTREE (location_type l) + { + return symbol_type (token::USINGTREE, std::move (l)); + } +#else + static + symbol_type + make_USINGTREE (const location_type& l) + { + return symbol_type (token::USINGTREE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIMTREE (location_type l) + { + return symbol_type (token::ANIMTREE, std::move (l)); + } +#else + static + symbol_type + make_ANIMTREE (const location_type& l) + { + return symbol_type (token::ANIMTREE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ENDON (location_type l) + { + return symbol_type (token::ENDON, std::move (l)); + } +#else + static + symbol_type + make_ENDON (const location_type& l) + { + return symbol_type (token::ENDON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NOTIFY (location_type l) + { + return symbol_type (token::NOTIFY, std::move (l)); + } +#else + static + symbol_type + make_NOTIFY (const location_type& l) + { + return symbol_type (token::NOTIFY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAIT (location_type l) + { + return symbol_type (token::WAIT, std::move (l)); + } +#else + static + symbol_type + make_WAIT (const location_type& l) + { + return symbol_type (token::WAIT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILL (location_type l) + { + return symbol_type (token::WAITTILL, std::move (l)); + } +#else + static + symbol_type + make_WAITTILL (const location_type& l) + { + return symbol_type (token::WAITTILL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILLMATCH (location_type l) + { + return symbol_type (token::WAITTILLMATCH, std::move (l)); + } +#else + static + symbol_type + make_WAITTILLMATCH (const location_type& l) + { + return symbol_type (token::WAITTILLMATCH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILLFRAMEEND (location_type l) + { + return symbol_type (token::WAITTILLFRAMEEND, std::move (l)); + } +#else + static + symbol_type + make_WAITTILLFRAMEEND (const location_type& l) + { + return symbol_type (token::WAITTILLFRAMEEND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IF (location_type l) + { + return symbol_type (token::IF, std::move (l)); + } +#else + static + symbol_type + make_IF (const location_type& l) + { + return symbol_type (token::IF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ELSE (location_type l) + { + return symbol_type (token::ELSE, std::move (l)); + } +#else + static + symbol_type + make_ELSE (const location_type& l) + { + return symbol_type (token::ELSE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WHILE (location_type l) + { + return symbol_type (token::WHILE, std::move (l)); + } +#else + static + symbol_type + make_WHILE (const location_type& l) + { + return symbol_type (token::WHILE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FOR (location_type l) + { + return symbol_type (token::FOR, std::move (l)); + } +#else + static + symbol_type + make_FOR (const location_type& l) + { + return symbol_type (token::FOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FOREACH (location_type l) + { + return symbol_type (token::FOREACH, std::move (l)); + } +#else + static + symbol_type + make_FOREACH (const location_type& l) + { + return symbol_type (token::FOREACH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IN (location_type l) + { + return symbol_type (token::IN, std::move (l)); + } +#else + static + symbol_type + make_IN (const location_type& l) + { + return symbol_type (token::IN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SWITCH (location_type l) + { + return symbol_type (token::SWITCH, std::move (l)); + } +#else + static + symbol_type + make_SWITCH (const location_type& l) + { + return symbol_type (token::SWITCH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CASE (location_type l) + { + return symbol_type (token::CASE, std::move (l)); + } +#else + static + symbol_type + make_CASE (const location_type& l) + { + return symbol_type (token::CASE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DEFAULT (location_type l) + { + return symbol_type (token::DEFAULT, std::move (l)); + } +#else + static + symbol_type + make_DEFAULT (const location_type& l) + { + return symbol_type (token::DEFAULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BREAK (location_type l) + { + return symbol_type (token::BREAK, std::move (l)); + } +#else + static + symbol_type + make_BREAK (const location_type& l) + { + return symbol_type (token::BREAK, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CONTINUE (location_type l) + { + return symbol_type (token::CONTINUE, std::move (l)); + } +#else + static + symbol_type + make_CONTINUE (const location_type& l) + { + return symbol_type (token::CONTINUE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RETURN (location_type l) + { + return symbol_type (token::RETURN, std::move (l)); + } +#else + static + symbol_type + make_RETURN (const location_type& l) + { + return symbol_type (token::RETURN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THREAD (location_type l) + { + return symbol_type (token::THREAD, std::move (l)); + } +#else + static + symbol_type + make_THREAD (const location_type& l) + { + return symbol_type (token::THREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CHILDTHREAD (location_type l) + { + return symbol_type (token::CHILDTHREAD, std::move (l)); + } +#else + static + symbol_type + make_CHILDTHREAD (const location_type& l) + { + return symbol_type (token::CHILDTHREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THISTHREAD (location_type l) + { + return symbol_type (token::THISTHREAD, std::move (l)); + } +#else + static + symbol_type + make_THISTHREAD (const location_type& l) + { + return symbol_type (token::THISTHREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CALL (location_type l) + { + return symbol_type (token::CALL, std::move (l)); + } +#else + static + symbol_type + make_CALL (const location_type& l) + { + return symbol_type (token::CALL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_TRUE (location_type l) + { + return symbol_type (token::TRUE, std::move (l)); + } +#else + static + symbol_type + make_TRUE (const location_type& l) + { + return symbol_type (token::TRUE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FALSE (location_type l) + { + return symbol_type (token::FALSE, std::move (l)); + } +#else + static + symbol_type + make_FALSE (const location_type& l) + { + return symbol_type (token::FALSE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_UNDEFINED (location_type l) + { + return symbol_type (token::UNDEFINED, std::move (l)); + } +#else + static + symbol_type + make_UNDEFINED (const location_type& l) + { + return symbol_type (token::UNDEFINED, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SIZE (location_type l) + { + return symbol_type (token::SIZE, std::move (l)); + } +#else + static + symbol_type + make_SIZE (const location_type& l) + { + return symbol_type (token::SIZE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GAME (location_type l) + { + return symbol_type (token::GAME, std::move (l)); + } +#else + static + symbol_type + make_GAME (const location_type& l) + { + return symbol_type (token::GAME, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SELF (location_type l) + { + return symbol_type (token::SELF, std::move (l)); + } +#else + static + symbol_type + make_SELF (const location_type& l) + { + return symbol_type (token::SELF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIM (location_type l) + { + return symbol_type (token::ANIM, std::move (l)); + } +#else + static + symbol_type + make_ANIM (const location_type& l) + { + return symbol_type (token::ANIM, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LEVEL (location_type l) + { + return symbol_type (token::LEVEL, std::move (l)); + } +#else + static + symbol_type + make_LEVEL (const location_type& l) + { + return symbol_type (token::LEVEL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LPAREN (location_type l) + { + return symbol_type (token::LPAREN, std::move (l)); + } +#else + static + symbol_type + make_LPAREN (const location_type& l) + { + return symbol_type (token::LPAREN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RPAREN (location_type l) + { + return symbol_type (token::RPAREN, std::move (l)); + } +#else + static + symbol_type + make_RPAREN (const location_type& l) + { + return symbol_type (token::RPAREN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LBRACE (location_type l) + { + return symbol_type (token::LBRACE, std::move (l)); + } +#else + static + symbol_type + make_LBRACE (const location_type& l) + { + return symbol_type (token::LBRACE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RBRACE (location_type l) + { + return symbol_type (token::RBRACE, std::move (l)); + } +#else + static + symbol_type + make_RBRACE (const location_type& l) + { + return symbol_type (token::RBRACE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LBRACKET (location_type l) + { + return symbol_type (token::LBRACKET, std::move (l)); + } +#else + static + symbol_type + make_LBRACKET (const location_type& l) + { + return symbol_type (token::LBRACKET, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RBRACKET (location_type l) + { + return symbol_type (token::RBRACKET, std::move (l)); + } +#else + static + symbol_type + make_RBRACKET (const location_type& l) + { + return symbol_type (token::RBRACKET, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COMMA (location_type l) + { + return symbol_type (token::COMMA, std::move (l)); + } +#else + static + symbol_type + make_COMMA (const location_type& l) + { + return symbol_type (token::COMMA, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DOT (location_type l) + { + return symbol_type (token::DOT, std::move (l)); + } +#else + static + symbol_type + make_DOT (const location_type& l) + { + return symbol_type (token::DOT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DOUBLECOLON (location_type l) + { + return symbol_type (token::DOUBLECOLON, std::move (l)); + } +#else + static + symbol_type + make_DOUBLECOLON (const location_type& l) + { + return symbol_type (token::DOUBLECOLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COLON (location_type l) + { + return symbol_type (token::COLON, std::move (l)); + } +#else + static + symbol_type + make_COLON (const location_type& l) + { + return symbol_type (token::COLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SEMICOLON (location_type l) + { + return symbol_type (token::SEMICOLON, std::move (l)); + } +#else + static + symbol_type + make_SEMICOLON (const location_type& l) + { + return symbol_type (token::SEMICOLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INCREMENT (location_type l) + { + return symbol_type (token::INCREMENT, std::move (l)); + } +#else + static + symbol_type + make_INCREMENT (const location_type& l) + { + return symbol_type (token::INCREMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DECREMENT (location_type l) + { + return symbol_type (token::DECREMENT, std::move (l)); + } +#else + static + symbol_type + make_DECREMENT (const location_type& l) + { + return symbol_type (token::DECREMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LSHIFT (location_type l) + { + return symbol_type (token::LSHIFT, std::move (l)); + } +#else + static + symbol_type + make_LSHIFT (const location_type& l) + { + return symbol_type (token::LSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RSHIFT (location_type l) + { + return symbol_type (token::RSHIFT, std::move (l)); + } +#else + static + symbol_type + make_RSHIFT (const location_type& l) + { + return symbol_type (token::RSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_OR (location_type l) + { + return symbol_type (token::OR, std::move (l)); + } +#else + static + symbol_type + make_OR (const location_type& l) + { + return symbol_type (token::OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_AND (location_type l) + { + return symbol_type (token::AND, std::move (l)); + } +#else + static + symbol_type + make_AND (const location_type& l) + { + return symbol_type (token::AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_EQUALITY (location_type l) + { + return symbol_type (token::EQUALITY, std::move (l)); + } +#else + static + symbol_type + make_EQUALITY (const location_type& l) + { + return symbol_type (token::EQUALITY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INEQUALITY (location_type l) + { + return symbol_type (token::INEQUALITY, std::move (l)); + } +#else + static + symbol_type + make_INEQUALITY (const location_type& l) + { + return symbol_type (token::INEQUALITY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LESS_EQUAL (location_type l) + { + return symbol_type (token::LESS_EQUAL, std::move (l)); + } +#else + static + symbol_type + make_LESS_EQUAL (const location_type& l) + { + return symbol_type (token::LESS_EQUAL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GREATER_EQUAL (location_type l) + { + return symbol_type (token::GREATER_EQUAL, std::move (l)); + } +#else + static + symbol_type + make_GREATER_EQUAL (const location_type& l) + { + return symbol_type (token::GREATER_EQUAL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LESS (location_type l) + { + return symbol_type (token::LESS, std::move (l)); + } +#else + static + symbol_type + make_LESS (const location_type& l) + { + return symbol_type (token::LESS, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GREATER (location_type l) + { + return symbol_type (token::GREATER, std::move (l)); + } +#else + static + symbol_type + make_GREATER (const location_type& l) + { + return symbol_type (token::GREATER, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NOT (location_type l) + { + return symbol_type (token::NOT, std::move (l)); + } +#else + static + symbol_type + make_NOT (const location_type& l) + { + return symbol_type (token::NOT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COMPLEMENT (location_type l) + { + return symbol_type (token::COMPLEMENT, std::move (l)); + } +#else + static + symbol_type + make_COMPLEMENT (const location_type& l) + { + return symbol_type (token::COMPLEMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN (location_type l) + { + return symbol_type (token::ASSIGN, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN (const location_type& l) + { + return symbol_type (token::ASSIGN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_ADD (location_type l) + { + return symbol_type (token::ASSIGN_ADD, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_ADD (const location_type& l) + { + return symbol_type (token::ASSIGN_ADD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_SUB (location_type l) + { + return symbol_type (token::ASSIGN_SUB, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_SUB (const location_type& l) + { + return symbol_type (token::ASSIGN_SUB, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_MULT (location_type l) + { + return symbol_type (token::ASSIGN_MULT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_MULT (const location_type& l) + { + return symbol_type (token::ASSIGN_MULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_DIV (location_type l) + { + return symbol_type (token::ASSIGN_DIV, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_DIV (const location_type& l) + { + return symbol_type (token::ASSIGN_DIV, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_MOD (location_type l) + { + return symbol_type (token::ASSIGN_MOD, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_MOD (const location_type& l) + { + return symbol_type (token::ASSIGN_MOD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_OR (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_OR, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_OR (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_AND (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_AND, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_AND (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_EXOR (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_EXOR, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_EXOR (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_EXOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_RSHIFT (location_type l) + { + return symbol_type (token::ASSIGN_RSHIFT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_RSHIFT (const location_type& l) + { + return symbol_type (token::ASSIGN_RSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_LSHIFT (location_type l) + { + return symbol_type (token::ASSIGN_LSHIFT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_LSHIFT (const location_type& l) + { + return symbol_type (token::ASSIGN_LSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_OR (location_type l) + { + return symbol_type (token::BITWISE_OR, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_OR (const location_type& l) + { + return symbol_type (token::BITWISE_OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_AND (location_type l) + { + return symbol_type (token::BITWISE_AND, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_AND (const location_type& l) + { + return symbol_type (token::BITWISE_AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_EXOR (location_type l) + { + return symbol_type (token::BITWISE_EXOR, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_EXOR (const location_type& l) + { + return symbol_type (token::BITWISE_EXOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ADD (location_type l) + { + return symbol_type (token::ADD, std::move (l)); + } +#else + static + symbol_type + make_ADD (const location_type& l) + { + return symbol_type (token::ADD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SUB (location_type l) + { + return symbol_type (token::SUB, std::move (l)); + } +#else + static + symbol_type + make_SUB (const location_type& l) + { + return symbol_type (token::SUB, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_MULT (location_type l) + { + return symbol_type (token::MULT, std::move (l)); + } +#else + static + symbol_type + make_MULT (const location_type& l) + { + return symbol_type (token::MULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DIV (location_type l) + { + return symbol_type (token::DIV, std::move (l)); + } +#else + static + symbol_type + make_DIV (const location_type& l) + { + return symbol_type (token::DIV, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_MOD (location_type l) + { + return symbol_type (token::MOD, std::move (l)); + } +#else + static + symbol_type + make_MOD (const location_type& l) + { + return symbol_type (token::MOD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FILE (std::string v, location_type l) + { + return symbol_type (token::FILE, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_FILE (const std::string& v, const location_type& l) + { + return symbol_type (token::FILE, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NAME (std::string v, location_type l) + { + return symbol_type (token::NAME, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_NAME (const std::string& v, const location_type& l) + { + return symbol_type (token::NAME, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_STRING (std::string v, location_type l) + { + return symbol_type (token::STRING, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_STRING (const std::string& v, const location_type& l) + { + return symbol_type (token::STRING, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ISTRING (std::string v, location_type l) + { + return symbol_type (token::ISTRING, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_ISTRING (const std::string& v, const location_type& l) + { + return symbol_type (token::ISTRING, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FLOAT (std::string v, location_type l) + { + return symbol_type (token::FLOAT, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_FLOAT (const std::string& v, const location_type& l) + { + return symbol_type (token::FLOAT, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INTEGER (std::string v, location_type l) + { + return symbol_type (token::INTEGER, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_INTEGER (const std::string& v, const location_type& l) + { + return symbol_type (token::INTEGER, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ADD_ARRAY (location_type l) + { + return symbol_type (token::ADD_ARRAY, std::move (l)); + } +#else + static + symbol_type + make_ADD_ARRAY (const location_type& l) + { + return symbol_type (token::ADD_ARRAY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THEN (location_type l) + { + return symbol_type (token::THEN, std::move (l)); + } +#else + static + symbol_type + make_THEN (const location_type& l) + { + return symbol_type (token::THEN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NEG (location_type l) + { + return symbol_type (token::NEG, std::move (l)); + } +#else + static + symbol_type + make_NEG (const location_type& l) + { + return symbol_type (token::NEG, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIMREF (location_type l) + { + return symbol_type (token::ANIMREF, std::move (l)); + } +#else + static + symbol_type + make_ANIMREF (const location_type& l) + { + return symbol_type (token::ANIMREF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_PREINC (location_type l) + { + return symbol_type (token::PREINC, std::move (l)); + } +#else + static + symbol_type + make_PREINC (const location_type& l) + { + return symbol_type (token::PREINC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_PREDEC (location_type l) + { + return symbol_type (token::PREDEC, std::move (l)); + } +#else + static + symbol_type + make_PREDEC (const location_type& l) + { + return symbol_type (token::PREDEC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_POSTINC (location_type l) + { + return symbol_type (token::POSTINC, std::move (l)); + } +#else + static + symbol_type + make_POSTINC (const location_type& l) + { + return symbol_type (token::POSTINC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_POSTDEC (location_type l) + { + return symbol_type (token::POSTDEC, std::move (l)); + } +#else + static + symbol_type + make_POSTDEC (const location_type& l) + { + return symbol_type (token::POSTDEC, l); + } +#endif + + + class context + { + public: + context (const parser& yyparser, const symbol_type& yyla); + const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; } + symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); } + const location_type& location () const YY_NOEXCEPT { return yyla_.location; } + + /// Put in YYARG at most YYARGN of the expected tokens, and return the + /// number of tokens stored in YYARG. If YYARG is null, return the + /// number of expected tokens (guaranteed to be less than YYNTOKENS). + int expected_tokens (symbol_kind_type yyarg[], int yyargn) const; + + private: + const parser& yyparser_; + const symbol_type& yyla_; + }; + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + parser (const parser&); + /// Non copyable. + parser& operator= (const parser&); +#endif + + /// Check the lookahead yytoken. + /// \returns true iff the token will be eventually shifted. + bool yy_lac_check_ (symbol_kind_type yytoken) const; + /// Establish the initial context if no initial context currently exists. + /// \returns true iff the token will be eventually shifted. + bool yy_lac_establish_ (symbol_kind_type yytoken); + /// Discard any previous initial lookahead context because of event. + /// \param event the event which caused the lookahead to be discarded. + /// Only used for debbuging output. + void yy_lac_discard_ (const char* event); + + /// Stored state numbers (used for stacks). + typedef short state_type; + + /// The arguments of the error message. + int yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const; + + /// Generate an error message. + /// \param yyctx the context in which the error occurred. + virtual std::string yysyntax_error_ (const context& yyctx) const; + /// Compute post-reduction state. + /// \param yystate the current state + /// \param yysym the nonterminal to push on the stack + static state_type yy_lr_goto_state_ (state_type yystate, int yysym); + + /// Whether the given \c yypact_ value indicates a defaulted state. + /// \param yyvalue the value to check + static bool yy_pact_value_is_default_ (int yyvalue); + + /// Whether the given \c yytable_ value indicates a syntax error. + /// \param yyvalue the value to check + static bool yy_table_value_is_error_ (int yyvalue); + + static const short yypact_ninf_; + static const short yytable_ninf_; + + /// Convert a scanner token kind \a t to a symbol kind. + /// In theory \a t should be a token_kind_type, but character literals + /// are valid, yet not members of the token_type enum. + static symbol_kind_type yytranslate_ (int t); + + + + // Tables. + // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + // STATE-NUM. + static const short yypact_[]; + + // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + // Performed when YYTABLE does not specify something else to do. Zero + // means the default is an error. + static const unsigned char yydefact_[]; + + // YYPGOTO[NTERM-NUM]. + static const short yypgoto_[]; + + // YYDEFGOTO[NTERM-NUM]. + static const short yydefgoto_[]; + + // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + // positive, shift that token. If negative, reduce the rule whose + // number is the opposite. If YYTABLE_NINF, syntax error. + static const short yytable_[]; + + static const short yycheck_[]; + + // YYSTOS[STATE-NUM] -- The (internal number of the) accessing + // symbol of state STATE-NUM. + static const unsigned char yystos_[]; + + // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + static const unsigned char yyr1_[]; + + // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + static const signed char yyr2_[]; + + +#if IW6DEBUG + // YYRLINE[YYN] -- Source line where rule number YYN was defined. + static const short yyrline_[]; + /// Report on the debug stream that the rule \a r is going to be reduced. + virtual void yy_reduce_print_ (int r) const; + /// Print the state stack on the debug stream. + virtual void yy_stack_print_ () const; + + /// Debugging level. + int yydebug_; + /// Debug stream. + std::ostream* yycdebug_; + + /// \brief Display a symbol kind, value and location. + /// \param yyo The output stream. + /// \param yysym The symbol. + template + void yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const; +#endif + + /// \brief Reclaim the memory associated to a symbol. + /// \param yymsg Why this token is reclaimed. + /// If null, print nothing. + /// \param yysym The symbol. + template + void yy_destroy_ (const char* yymsg, basic_symbol& yysym) const; + + private: + /// Type access provider for state based symbols. + struct by_state + { + /// Default constructor. + by_state () YY_NOEXCEPT; + + /// The symbol kind as needed by the constructor. + typedef state_type kind_type; + + /// Constructor. + by_state (kind_type s) YY_NOEXCEPT; + + /// Copy constructor. + by_state (const by_state& that) YY_NOEXCEPT; + + /// Record that this symbol is empty. + void clear () YY_NOEXCEPT; + + /// Steal the symbol kind from \a that. + void move (by_state& that); + + /// The symbol kind (corresponding to \a state). + /// \a symbol_kind::S_YYEMPTY when empty. + symbol_kind_type kind () const YY_NOEXCEPT; + + /// The state number used to denote an empty symbol. + /// We use the initial state, as it does not have a value. + enum { empty_state = 0 }; + + /// The state. + /// \a empty when empty. + state_type state; + }; + + /// "Internal" symbol: element of the stack. + struct stack_symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + /// Construct an empty symbol. + stack_symbol_type (); + /// Move or copy construction. + stack_symbol_type (YY_RVREF (stack_symbol_type) that); + /// Steal the contents from \a sym to build this. + stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym); +#if YY_CPLUSPLUS < 201103L + /// Assignment, needed by push_back by some old implementations. + /// Moves the contents of that. + stack_symbol_type& operator= (stack_symbol_type& that); + + /// Assignment, needed by push_back by other implementations. + /// Needed by some other old implementations. + stack_symbol_type& operator= (const stack_symbol_type& that); +#endif + }; + + /// A stack with random access from its top. + template > + class stack + { + public: + // Hide our reversed order. + typedef typename S::iterator iterator; + typedef typename S::const_iterator const_iterator; + typedef typename S::size_type size_type; + typedef typename std::ptrdiff_t index_type; + + stack (size_type n = 200) + : seq_ (n) + {} + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + stack (const stack&) = delete; + /// Non copyable. + stack& operator= (const stack&) = delete; +#endif + + /// Random access. + /// + /// Index 0 returns the topmost element. + const T& + operator[] (index_type i) const + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Random access. + /// + /// Index 0 returns the topmost element. + T& + operator[] (index_type i) + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Steal the contents of \a t. + /// + /// Close to move-semantics. + void + push (YY_MOVE_REF (T) t) + { + seq_.push_back (T ()); + operator[] (0).move (t); + } + + /// Pop elements from the stack. + void + pop (std::ptrdiff_t n = 1) YY_NOEXCEPT + { + for (; 0 < n; --n) + seq_.pop_back (); + } + + /// Pop all elements from the stack. + void + clear () YY_NOEXCEPT + { + seq_.clear (); + } + + /// Number of elements on the stack. + index_type + size () const YY_NOEXCEPT + { + return index_type (seq_.size ()); + } + + /// Iterator on top of the stack (going downwards). + const_iterator + begin () const YY_NOEXCEPT + { + return seq_.begin (); + } + + /// Bottom of the stack. + const_iterator + end () const YY_NOEXCEPT + { + return seq_.end (); + } + + /// Present a slice of the top of a stack. + class slice + { + public: + slice (const stack& stack, index_type range) + : stack_ (stack) + , range_ (range) + {} + + const T& + operator[] (index_type i) const + { + return stack_[range_ - i]; + } + + private: + const stack& stack_; + index_type range_; + }; + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + stack (const stack&); + /// Non copyable. + stack& operator= (const stack&); +#endif + /// The wrapped container. + S seq_; + }; + + + /// Stack type. + typedef stack stack_type; + + /// The stack. + stack_type yystack_; + /// The stack for LAC. + /// Logically, the yy_lac_stack's lifetime is confined to the function + /// yy_lac_check_. We just store it as a member of this class to hold + /// on to the memory and to avoid frequent reallocations. + /// Since yy_lac_check_ is const, this member must be mutable. + mutable std::vector yylac_stack_; + /// Whether an initial LAC context was established. + bool yy_lac_established_; + + + /// Push a new state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param sym the symbol + /// \warning the contents of \a s.value is stolen. + void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym); + + /// Push a new look ahead token on the state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param s the state + /// \param sym the symbol (for its value and location). + /// \warning the contents of \a sym.value is stolen. + void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); + + /// Pop \a n symbols from the stack. + void yypop_ (int n = 1); + + /// Constants. + enum + { + yylast_ = 1580, ///< Last index in yytable_. + yynnts_ = 72, ///< Number of nonterminal symbols. + yyfinal_ = 15 ///< Termination state number. + }; + + + // User arguments. + yyscan_t yyscanner; + xsk::gsc::location& loc; + xsk::gsc::program_ptr& ast; + + }; + + inline + parser::symbol_kind_type + parser::yytranslate_ (int t) + { + return static_cast (t); + } + + // basic_symbol. + template + parser::basic_symbol::basic_symbol (const basic_symbol& that) + : Base (that) + , value () + , location (that.location) + { + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.copy< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.copy< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.copy< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.copy< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.copy< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.copy< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.copy< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.copy< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.copy< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.copy< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.copy< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.copy< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.copy< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.copy< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.copy< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.copy< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.copy< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.copy< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.copy< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.copy< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.copy< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.copy< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.copy< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.copy< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.copy< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.copy< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.copy< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.copy< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.copy< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.copy< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.copy< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.copy< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.copy< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.copy< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.copy< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.copy< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.copy< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.copy< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.copy< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.copy< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.copy< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.copy< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.copy< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.copy< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.copy< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.copy< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.copy< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.copy< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.copy< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.copy< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.copy< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.copy< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.copy< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + + } + + + + template + parser::symbol_kind_type + parser::basic_symbol::type_get () const YY_NOEXCEPT + { + return this->kind (); + } + + template + bool + parser::basic_symbol::empty () const YY_NOEXCEPT + { + return this->kind () == symbol_kind::S_YYEMPTY; + } + + template + void + parser::basic_symbol::move (basic_symbol& s) + { + super_type::move (s); + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (YY_MOVE (s.value)); + break; + + default: + break; + } + + location = YY_MOVE (s.location); + } + + // by_kind. + inline + parser::by_kind::by_kind () + : kind_ (symbol_kind::S_YYEMPTY) + {} + +#if 201103L <= YY_CPLUSPLUS + inline + parser::by_kind::by_kind (by_kind&& that) + : kind_ (that.kind_) + { + that.clear (); + } +#endif + + inline + parser::by_kind::by_kind (const by_kind& that) + : kind_ (that.kind_) + {} + + inline + parser::by_kind::by_kind (token_kind_type t) + : kind_ (yytranslate_ (t)) + {} + + inline + void + parser::by_kind::clear () YY_NOEXCEPT + { + kind_ = symbol_kind::S_YYEMPTY; + } + + inline + void + parser::by_kind::move (by_kind& that) + { + kind_ = that.kind_; + that.clear (); + } + + inline + parser::symbol_kind_type + parser::by_kind::kind () const YY_NOEXCEPT + { + return kind_; + } + + inline + parser::symbol_kind_type + parser::by_kind::type_get () const YY_NOEXCEPT + { + return this->kind (); + } + +#line 13 "parser.ypp" +} } } // xsk::gsc::iw6 +#line 4713 "parser.hpp" + + + + +#endif // !YY_IW6_PARSER_HPP_INCLUDED diff --git a/src/iw6/xsk/resolver.cpp b/src/iw6/xsk/resolver.cpp new file mode 100644 index 00000000..c817a2ea --- /dev/null +++ b/src/iw6/xsk/resolver.cpp @@ -0,0 +1,16722 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw6.hpp" + +namespace xsk::gsc::iw6 +{ + +std::unordered_map opcode_map; +std::unordered_map function_map; +std::unordered_map method_map; +std::unordered_map file_map; +std::unordered_map token_map; +std::unordered_map opcode_map_rev; +std::unordered_map function_map_rev; +std::unordered_map method_map_rev; +std::unordered_map file_map_rev; +std::unordered_map token_map_rev; + +auto resolver::opcode_id(const std::string& name) -> std::uint8_t +{ + const auto itr = opcode_map_rev.find(name); + + if (itr != opcode_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve opcode id for name '%s'!", name.data())); +} + +auto resolver::opcode_name(std::uint8_t id) -> std::string +{ + const auto itr = opcode_map.find(id); + + if (itr != opcode_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve opcode name for id '0x%hhX'!", id)); +} + +auto resolver::function_id(const std::string& name) -> std::uint16_t +{ + const auto itr = function_map_rev.find(name); + + if (itr != function_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin function id for name '%s'!", name.data())); +} + +auto resolver::function_name(std::uint16_t id) -> std::string +{ + const auto itr = function_map.find(id); + + if (itr != function_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin function name for id '%i'!", id)); +} + +auto resolver::method_id(const std::string& name) -> std::uint16_t +{ + const auto itr = method_map_rev.find(name); + + if (itr != method_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin method id for name '%s'!", name.data())); +} + +auto resolver::method_name(std::uint16_t id) -> std::string +{ + const auto itr = method_map.find(id); + + if (itr != method_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin method name for id '%i'!", id)); +} + +auto resolver::file_id(const std::string& name) -> std::uint16_t +{ + const auto itr = file_map_rev.find(name); + + if (itr != file_map_rev.end()) + { + return itr->second; + } + + return 0; +} + +auto resolver::file_name(std::uint16_t id) -> std::string +{ + const auto itr = file_map.find(id); + + if (itr != file_map.end()) + { + return itr->second; + } + + return utils::string::va("_ID%i", id); +} + +auto resolver::token_id(const std::string& name) -> std::uint16_t +{ + const auto itr = token_map_rev.find(name); + + if (itr != token_map_rev.end()) + { + return itr->second; + } + + return 0; +} + +auto resolver::token_name(std::uint16_t id) -> std::string +{ + const auto itr = token_map.find(id); + + if (itr != token_map.end()) + { + return itr->second; + } + + return utils::string::va("_ID%i", id); +} + +auto resolver::find_function(const std::string& name) -> bool +{ + const auto itr = function_map_rev.find(name); + + if (itr != function_map_rev.end()) + { + return true; + } + + return false; +} + +auto resolver::find_method(const std::string& name) -> bool +{ + const auto itr = method_map_rev.find(name); + + if (itr != method_map_rev.end()) + { + return true; + } + + return false; +} + +const std::array opcode_list +{{ + { std::uint8_t(opcode::OP_End),"END" }, + { std::uint8_t(opcode::OP_Return),"RETN" }, + { std::uint8_t(opcode::OP_GetByte),"GET_BYTE" }, + { std::uint8_t(opcode::OP_GetNegByte),"GET_NBYTE" }, + { std::uint8_t(opcode::OP_GetUnsignedShort),"GET_USHORT" }, + { std::uint8_t(opcode::OP_GetNegUnsignedShort),"GET_NUSHORT" }, + { std::uint8_t(opcode::OP_GetInteger),"GET_INT" }, + { std::uint8_t(opcode::OP_GetBuiltinFunction),"GET_BUILTIN_FUNC" }, + { std::uint8_t(opcode::OP_GetBuiltinMethod),"GET_BUILTIN_METHOD" }, + { std::uint8_t(opcode::OP_GetFloat),"GET_FLOAT" }, + { std::uint8_t(opcode::OP_GetString),"GET_STRING" }, + { std::uint8_t(opcode::OP_GetUndefined),"GET_UNDEFINED" }, + { std::uint8_t(opcode::OP_GetZero),"GET_ZERO" }, + { std::uint8_t(opcode::OP_waittillFrameEnd),"WAITTILLFRAMEEND" }, + { std::uint8_t(opcode::OP_CreateLocalVariable),"CREATE_LOCAL_VARIABLE" }, + { std::uint8_t(opcode::OP_RemoveLocalVariables),"REMOVE_LOCAL_VARIABLES" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached0),"EVAL_LOCAL_VARIABLE_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached1),"EVAL_LOCAL_VARIABLE_CACHED1" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached2),"EVAL_LOCAL_VARIABLE_CACHED2" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached3),"EVAL_LOCAL_VARIABLE_CACHED3" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached4),"EVAL_LOCAL_VARIABLE_CACHED4" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached5),"EVAL_LOCAL_VARIABLE_CACHED5" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached),"EVAL_LOCAL_VARIABLE_CACHED" }, + { std::uint8_t(opcode::OP_EvalLocalArrayCached),"EVAL_LOCAL_ARRAY_CACHED" }, + { std::uint8_t(opcode::OP_EvalArray),"EVAL_ARRAY" }, + { std::uint8_t(opcode::OP_EvalNewLocalArrayRefCached0),"EVAL_NEW_LOCAL_ARRAY_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalArrayRefCached0),"EVAL_LOCAL_ARRAY_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalArrayRefCached),"EVAL_LOCAL_ARRAY_REF_CACHED" }, + { std::uint8_t(opcode::OP_EvalArrayRef),"EVAL_ARRAY_REF" }, + { std::uint8_t(opcode::OP_ClearArray),"CLEAR_ARRAY" }, + { std::uint8_t(opcode::OP_EmptyArray),"EMPTY_ARRAY" }, + { std::uint8_t(opcode::OP_AddArray),"ADD_ARRAY" }, + { std::uint8_t(opcode::OP_PreScriptCall),"PRE_CALL" }, + { std::uint8_t(opcode::OP_ScriptLocalFunctionCall2),"CALL_LOCAL_FUNC2" }, + { std::uint8_t(opcode::OP_ScriptLocalFunctionCall),"CALL_LOCAL_FUNC" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodCall),"CALL_LOCAL_METHOD" }, + { std::uint8_t(opcode::OP_ScriptLocalThreadCall),"CALL_LOCAL_FUNC_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalChildThreadCall),"CALL_LOCAL_FUNC_CHILD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodThreadCall),"CALL_LOCAL_METHOD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodChildThreadCall),"CALL_LOCAL_METHOD_CHILD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptFarFunctionCall2),"CALL_FAR_FUNC2" }, + { std::uint8_t(opcode::OP_ScriptFarFunctionCall),"CALL_FAR_FUNC" }, + { std::uint8_t(opcode::OP_ScriptFarMethodCall),"CALL_FAR_METHOD" }, + { std::uint8_t(opcode::OP_ScriptFarThreadCall),"CALL_FAR_FUNC_THREAD" }, + { std::uint8_t(opcode::OP_ScriptFarChildThreadCall),"CALL_FAR_FUNC_CHILD_THREAD"}, + { std::uint8_t(opcode::OP_ScriptFarMethodThreadCall),"CALL_FAR_METHOD_THEAD" }, + { std::uint8_t(opcode::OP_ScriptFarMethodChildThreadCall),"CALL_FAR_METHOD_CHILD_THEAD" }, + { std::uint8_t(opcode::OP_ScriptFunctionCallPointer),"CALL_FUNC_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodCallPointer),"CALL_METHOD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptThreadCallPointer),"CALL_FUNC_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptChildThreadCallPointer),"CALL_FUNC_CHILD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodThreadCallPointer),"CALL_METHOD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodChildThreadCallPointer),"CALL_METHOD_CHILD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_CallBuiltinPointer),"CALL_BUILTIN_FUNC_POINTER" }, + { std::uint8_t(opcode::OP_CallBuiltinMethodPointer),"CALL_BUILTIN_METHOD_POINTER" }, + { std::uint8_t(opcode::OP_GetIString),"GET_ISTRING" }, + { std::uint8_t(opcode::OP_GetVector),"GET_VECTOR" }, + { std::uint8_t(opcode::OP_GetLevelObject),"GET_LEVEL_OBJ" }, + { std::uint8_t(opcode::OP_GetAnimObject),"GET_ANIM_OBJ" }, + { std::uint8_t(opcode::OP_GetSelf),"GET_SELF" }, + { std::uint8_t(opcode::OP_GetThisthread),"GET_THISTHREAD" }, + { std::uint8_t(opcode::OP_GetLevel),"GET_LEVEL" }, + { std::uint8_t(opcode::OP_GetGame),"GET_GAME" }, + { std::uint8_t(opcode::OP_GetAnim),"GET_ANIM" }, + { std::uint8_t(opcode::OP_GetAnimation),"GET_ANIMATION" }, + { std::uint8_t(opcode::OP_GetGameRef),"GET_GAME_REF" }, + { std::uint8_t(opcode::OP_inc),"INC" }, + { std::uint8_t(opcode::OP_dec),"DEC" }, + { std::uint8_t(opcode::OP_bit_or),"BIT_OR" }, + { std::uint8_t(opcode::OP_JumpOnFalseExpr),"JMP_EXPR_FALSE" }, + { std::uint8_t(opcode::OP_bit_ex_or),"BIT_EXOR" }, + { std::uint8_t(opcode::OP_bit_and),"BIT_AND" }, + { std::uint8_t(opcode::OP_equality),"EQUALITY" }, + { std::uint8_t(opcode::OP_inequality),"INEQUALITY" }, + { std::uint8_t(opcode::OP_less),"LESS" }, + { std::uint8_t(opcode::OP_greater),"GREATER" }, + { std::uint8_t(opcode::OP_JumpOnTrueExpr),"JMP_EXPR_TRUE" }, + { std::uint8_t(opcode::OP_less_equal),"LESSEQUAL" }, + { std::uint8_t(opcode::OP_jumpback),"JMP_BACK" }, + { std::uint8_t(opcode::OP_waittillmatch2),"WAITTILLMATCH2" }, + { std::uint8_t(opcode::OP_waittill),"WAITTILL" }, + { std::uint8_t(opcode::OP_notify),"NOTIFY" }, + { std::uint8_t(opcode::OP_endon),"ENDON" }, + { std::uint8_t(opcode::OP_voidCodepos),"VOIDCODEPOS" }, + { std::uint8_t(opcode::OP_switch),"SWITCH" }, + { std::uint8_t(opcode::OP_endswitch),"ENDSWITCH" }, + { std::uint8_t(opcode::OP_vector),"VECTOR" }, + { std::uint8_t(opcode::OP_JumpOnFalse),"JMP_FALSE" }, + { std::uint8_t(opcode::OP_greater_equal),"GREATEREQUAL" }, + { std::uint8_t(opcode::OP_shift_left),"SHIFT_LEFT" }, + { std::uint8_t(opcode::OP_shift_right),"SHIFT_RIGHT" }, + { std::uint8_t(opcode::OP_plus),"PLUS" }, + { std::uint8_t(opcode::OP_jump),"JMP" }, + { std::uint8_t(opcode::OP_minus),"MINUS" }, + { std::uint8_t(opcode::OP_multiply),"MULT" }, + { std::uint8_t(opcode::OP_divide),"DIV" }, + { std::uint8_t(opcode::OP_mod),"MOD" }, + { std::uint8_t(opcode::OP_JumpOnTrue),"JMP_TRUE" }, + { std::uint8_t(opcode::OP_size),"SIZE" }, + { std::uint8_t(opcode::OP_waittillmatch),"WAITTILLMATCH" }, + { std::uint8_t(opcode::OP_GetLocalFunction),"GET_LOCAL_FUNC" }, + { std::uint8_t(opcode::OP_GetFarFunction),"GET_FAR_FUNC" }, + { std::uint8_t(opcode::OP_GetSelfObject),"GET_SELF_OBJ" }, + { std::uint8_t(opcode::OP_EvalLevelFieldVariable),"EVAL_LEVEL_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalAnimFieldVariable),"EVAL_ANIM_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalSelfFieldVariable),"EVAL_SELF_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalFieldVariable),"EVAL_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalLevelFieldVariableRef),"EVAL_LEVEL_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalAnimFieldVariableRef),"EVAL_ANIM_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalSelfFieldVariableRef),"EVAL_SELF_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalFieldVariableRef),"EVAL_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_ClearFieldVariable),"CLEAR_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_SafeCreateVariableFieldCached),"SAFE_CREATE_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_SafeSetVariableFieldCached0),"SAFE_SET_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SafeSetVariableFieldCached),"SAFE_SET_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_SafeSetWaittillVariableFieldCached),"SAFE_SET_WAITTILL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_GetAnimTree),"GET_ANIMTREE" }, + { std::uint8_t(opcode::OP_clearparams),"CLEAR_PARAMS" }, + { std::uint8_t(opcode::OP_checkclearparams),"CHECK_CLEAR_PARAMS" }, + { std::uint8_t(opcode::OP_EvalLocalVariableRefCached0),"EVAL_LOCAL_VARIABLE_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalNewLocalVariableRefCached0),"EVAL_NEW_LOCAL_VARIABLE_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalVariableRefCached),"EVAL_LOCAL_VARIABLE_REF_CACHED" }, + { std::uint8_t(opcode::OP_SetLevelFieldVariableField),"SET_LEVEL_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetVariableField),"SET_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_ClearVariableField),"CLEAR_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetAnimFieldVariableField),"SET_ANIM_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetSelfFieldVariableField),"SET_SELF_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetLocalVariableFieldCached0),"SET_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SetNewLocalVariableFieldCached0),"SET_NEW_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SetLocalVariableFieldCached),"SET_LOCAL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_ClearLocalVariableFieldCached),"CLEAR_LOCAL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_ClearLocalVariableFieldCached0),"CLEAR_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_CallBuiltin0),"CALL_BUILTIN_FUNC_0" }, + { std::uint8_t(opcode::OP_CallBuiltin1),"CALL_BUILTIN_FUNC_1" }, + { std::uint8_t(opcode::OP_CallBuiltin2),"CALL_BUILTIN_FUNC_2" }, + { std::uint8_t(opcode::OP_CallBuiltin3),"CALL_BUILTIN_FUNC_3" }, + { std::uint8_t(opcode::OP_CallBuiltin4),"CALL_BUILTIN_FUNC_4" }, + { std::uint8_t(opcode::OP_CallBuiltin5),"CALL_BUILTIN_FUNC_5" }, + { std::uint8_t(opcode::OP_CallBuiltin),"CALL_BUILTIN_FUNC" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod0),"CALL_BUILTIN_METHOD_0" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod1),"CALL_BUILTIN_METHOD_1" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod2),"CALL_BUILTIN_METHOD_2" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod3),"CALL_BUILTIN_METHOD_3" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod4),"CALL_BUILTIN_METHOD_4" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod5),"CALL_BUILTIN_METHOD_5" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod),"CALL_BUILTIN_METHOD" }, + { std::uint8_t(opcode::OP_wait),"WAIT" }, + { std::uint8_t(opcode::OP_DecTop),"DEC_TOP" }, + { std::uint8_t(opcode::OP_CastFieldObject),"CAST_FIELD_OBJ" }, + { std::uint8_t(opcode::OP_EvalLocalVariableObjectCached),"EVAL_LOCAL_VARIABLE_OBJECT_CACHED" }, + { std::uint8_t(opcode::OP_CastBool),"CAST_BOOL" }, + { std::uint8_t(opcode::OP_BoolNot),"BOOL_NOT" }, + { std::uint8_t(opcode::OP_BoolComplement),"BOOL_COMPLEMENT" }, +}}; + +const std::array function_list +{{ + { 0x001, "precacheturret" }, + { 0x002, "getweaponarray" }, + { 0x003, "createprintchannel" }, + { 0x004, "updategamerprofileall" }, + { 0x005, "clearlocalizedstrings" }, + { 0x006, "setphysicsgravitydir" }, + { 0x007, "gettimescale" }, + { 0x008, "settimescale" }, + { 0x009, "setslowmotionview" }, + { 0x00A, "teleportscene" }, + { 0x00B, "forcesharedammo" }, + { 0x00C, "refreshhudcompass" }, + { 0x00D, "refreshhudammocounter" }, + { 0x00E, "notifyoncommand" }, + { 0x00F, "setprintchannel" }, + { 0x010, "print" }, + { 0x011, "println" }, + { 0x012, "print3d" }, + { 0x013, "line" }, + { 0x014, "box" }, + { 0x015, "orientedbox" }, + { 0x016, "sphere" }, + { 0x017, "cylinder" }, + { 0x018, "spawnturret" }, + { 0x019, "canspawnturret" }, + { 0x01A, "assert" }, + { 0x01B, "pausecinematicingame" }, + { 0x01C, "drawcompassfriendlies" }, + { 0x01D, "bulletspread" }, + { 0x01E, "bullettracer" }, + { 0x01F, "badplace_delete" }, + { 0x020, "badplace_cylinder" }, + { 0x021, "badplace_arc" }, + { 0x022, "badplace_brush" }, + { 0x023, "clearallcorpses" }, + { 0x024, "setturretnode" }, + { 0x025, "unsetturretnode" }, + { 0x026, "setnodepriority" }, + { 0x027, "isnodeoccupied" }, + { 0x028, "setdebugorigin" }, + { 0x029, "setdebugangles" }, + { 0x02A, "updategamerprofile" }, + { 0x02B, "assertex" }, + { 0x02C, "assertmsg" }, + { 0x02D, "isdefined" }, + { 0x02E, "isvalidmissile" }, + { 0x02F, "isstring" }, + { 0x030, "setomnvar" }, + { 0x031, "getomnvar" }, + { 0x032, "setdvar" }, + { 0x033, "setdynamicdvar" }, + { 0x034, "setdvarifuninitialized" }, + { 0x035, "setdevdvar" }, + { 0x036, "setdevdvarifuninitialized" }, + { 0x037, "getdvar" }, + { 0x038, "getdvarint" }, + { 0x039, "getdvarfloat" }, + { 0x03A, "getdvarvector" }, + { 0x03B, "gettime" }, + { 0x03C, "getentbynum" }, + { 0x03D, "getweaponmodel" }, + { 0x03E, "getculldist" }, + { 0x03F, "sethalfresparticles" }, + { 0x040, "getmapsunlight" }, + { 0x041, "setsunlight" }, + { 0x042, "resetsunlight" }, + { 0x043, "getmapsundirection" }, + { 0x044, "getmapsunangles" }, + { 0x045, "setsundirection" }, + { 0x046, "lerpsundirection" }, + { 0x047, "lerpsunangles" }, + { 0x048, "resetsundirection" }, + { 0x049, "enableforcedsunshadows" }, + { 0x04A, "enableforcednosunshadows" }, + { 0x04B, "disableforcedsunshadows" }, + { 0x04C, "enableouterspacemodellighting" }, + { 0x04D, "disableouterspacemodellighting" }, + { 0x04E, "remapstage" }, + { 0x04F, "changelevel" }, + { 0x050, "missionsuccess" }, + { 0x051, "missionfailed" }, + { 0x052, "cinematic" }, + { 0x053, "cinematicingame" }, + { 0x054, "cinematicingamesync" }, + { 0x055, "cinematicingameloop" }, + { 0x056, "cinematicingameloopresident" }, + { 0x057, "iscinematicplaying" }, + { 0x058, "stopcinematicingame" }, + { 0x059, "getweapondisplayname" }, + { 0x05A, "getweaponbasename" }, + { 0x05B, "getweaponattachments" }, + { 0x05C, "getweaponattachmentdisplaynames" }, + { 0x05D, "getweaponcamoname" }, + { 0x05E, "getweaponreticlename" }, + { 0x05F, "getweaponhidetags" }, + { 0x060, "getanimlength" }, + { 0x061, "animhasnotetrack" }, + { 0x062, "getnotetracktimes" }, + { 0x063, "spawn" }, + { 0x064, "spawnloopsound" }, + { 0x065, "spawnloopingsound" }, + { 0x066, "bullettrace" }, + { 0x067, "target_setmaxsize" }, + { 0x068, "target_setcolor" }, + { 0x069, "target_setdelay" }, + { 0x06A, "getstartorigin" }, + { 0x06B, "getstartangles" }, + { 0x06C, "getcycleoriginoffset" }, + { 0x06D, "magicgrenade" }, + { 0x06E, "magicgrenademanual" }, + { 0x06F, "setblur" }, + { 0x070, "musicplay" }, + { 0x071, "musicstop" }, + { 0x072, "soundfade" }, + { 0x073, "soundsettimescalefactor" }, + { 0x074, "soundresettimescale" }, + { 0x075, "setocclusionpreset" }, + { 0x076, "levelsoundfade" }, + { 0x077, "precachenightvisioncodeassets" }, + { 0x078, "precachedigitaldistortcodeassets" }, + { 0x079, "precacheminimapsentrycodeassets" }, + { 0x07A, "savegame" }, + { 0x07B, "issavesuccessful" }, + { 0x07C, "issaverecentlyloaded" }, + { 0x07D, "savegamenocommit" }, + { 0x07E, "commitsave" }, + { 0x07F, "commitwouldbevalid" }, + { 0x080, "getfxvisibility" }, + { 0x081, "setculldist" }, + { 0x082, "bullettracepassed" }, + { 0x083, "sighttracepassed" }, + { 0x084, "physicstrace" }, + { 0x085, "playerphysicstrace" }, + { 0x086, "getgroundposition" }, + { 0x087, "getmovedelta" }, + { 0x088, "getangledelta" }, + { 0x089, "getnorthyaw" }, + { 0x08A, "getcommandfromkey" }, + { 0x08B, "getsticksconfig" }, + { 0x08C, "weaponfightdist" }, + { 0x08D, "weaponmaxdist" }, + { 0x08E, "isturretactive" }, + { 0x08F, "target_alloc" }, + { 0x090, "target_flush" }, + { 0x091, "target_set" }, + { 0x092, "target_remove" }, + { 0x093, "target_setshader" }, + { 0x094, "target_setoffscreenshader" }, + { 0x095, "target_isinrect" }, + { 0x096, "target_isincircle" }, + { 0x097, "target_startreticlelockon" }, + { 0x098, "target_clearreticlelockon" }, + { 0x099, "target_getarray" }, + { 0x09A, "target_istarget" }, + { 0x09B, "target_setattackmode" }, + { 0x09C, "target_setjavelinonly" }, + { 0x09D, "target_hidefromplayer" }, + { 0x09E, "target_showtoplayer" }, + { 0x09F, "target_setscaledrendermode" }, + { 0x0A0, "target_drawcornersonly" }, + { 0x0A1, "target_drawsquare" }, + { 0x0A2, "target_drawsingle" }, + { 0x0A3, "target_setminsize" }, + { 0x0A4, "setnorthyaw" }, + { 0x0A5, "setslowmotion" }, + { 0x0A6, "randomint" }, + { 0x0A7, "randomfloat" }, + { 0x0A8, "randomintrange" }, + { 0x0A9, "randomfloatrange" }, + { 0x0AA, "sin" }, + { 0x0AB, "cos" }, + { 0x0AC, "tan" }, + { 0x0AD, "asin" }, + { 0x0AE, "acos" }, + { 0x0AF, "atan" }, + { 0x0B0, "int" }, + { 0x0B1, "float" }, + { 0x0B2, "abs" }, + { 0x0B3, "min" }, + { 0x0B4, "objective_additionalcurrent" }, + { 0x0B5, "objective_ring" }, + { 0x0B6, "objective_setpointertextoverride" }, + { 0x0B7, "getnode" }, + { 0x0B8, "getnodearray" }, + { 0x0B9, "getallnodes" }, + { 0x0BA, "getnodesinradius" }, + { 0x0BB, "getnodesinradiussorted" }, + { 0x0BC, "getclosestnodeinsight" }, + { 0x0BD, "getreflectionlocs" }, + { 0x0BE, "getreflectionreferencelocs" }, + { 0x0BF, "getvehicletracksegment" }, + { 0x0C0, "getvehicletracksegmentarray" }, + { 0x0C1, "getallvehicletracksegments" }, + { 0x0C2, "isarray" }, + { 0x0C3, "isai" }, + { 0x0C4, "getindexforluincstring" }, + { 0x0C5, "issentient" }, + { 0x0C6, "isgodmode" }, + { 0x0C7, "getdebugdvar" }, + { 0x0C8, "getdebugdvarint" }, + { 0x0C9, "getdebugdvarfloat" }, + { 0x0CA, "setsaveddvar" }, + { 0x0CB, "getfreeaicount" }, + { 0x0CC, "getaicount" }, + { 0x0CD, "getaiarray" }, + { 0x0CE, "getaispeciesarray" }, + { 0x0CF, "getspawnerarray" }, + { 0x0D0, "getcorpsearray" }, + { 0x0D1, "getspawnerteamarray" }, + { 0x0D2, "getweaponclipmodel" }, + { 0x0D3, "getbrushmodelcenter" }, + { 0x0D4, "getkeybinding" }, + { 0x0D5, "max" }, + { 0x0D6, "floor" }, + { 0x0D7, "ceil" }, + { 0x0D8, "exp" }, + { 0x0D9, "log" }, + { 0x0DA, "sqrt" }, + { 0x0DB, "squared" }, + { 0x0DC, "clamp" }, + { 0x0DD, "angleclamp" }, + { 0x0DE, "angleclamp180" }, + { 0x0DF, "vectorfromlinetopoint" }, + { 0x0E0, "pointonsegmentnearesttopoint" }, + { 0x0E1, "distance" }, + { 0x0E2, "distance2d" }, + { 0x0E3, "distancesquared" }, + { 0x0E4, "length" }, + { 0x0E5, "length2d" }, + { 0x0E6, "lengthsquared" }, + { 0x0E7, "length2dsquared" }, + { 0x0E8, "closer" }, + { 0x0E9, "vectordot" }, + { 0x0EA, "vectorcross" }, + { 0x0EB, "axistoangles" }, + { 0x0EC, "visionsetthermal" }, + { 0x0ED, "visionsetpain" }, + { 0x0EE, "endlobby" }, + { 0x0EF, "setac130ambience" }, + { 0x0F0, "getmapcustom" }, + { 0x0F1, "spawnsighttrace" }, + { 0x0F2, "incrementcounter" }, + { 0x0F3, "getcountertotal" }, + { 0x0F4, "getlevelticks" }, + { 0x0F5, "perlinnoise2d" }, + { 0x0F6, "calcrockingangles" }, + { 0x0F7, "reconevent" }, + { 0x0F8, "reconspatialevent" }, + { 0x0F9, "setsunflareposition" }, + { 0x0FA, "createthreatbiasgroup" }, + { 0x0FB, "threatbiasgroupexists" }, + { 0x0FC, "getthreatbias" }, + { 0x0FD, "setthreatbias" }, + { 0x0FE, "setthreatbiasagainstall" }, + { 0x0FF, "setignoremegroup" }, + { 0x100, "isenemyteam" }, + { 0x101, "objective_additionalentity" }, + { 0x102, "objective_state_nomessage" }, + { 0x103, "objective_string" }, + { 0x104, "objective_string_nomessage" }, + { 0x105, "objective_additionalposition" }, + { 0x106, "objective_current_nomessage" }, + { 0x107, "vectornormalize" }, + { 0x108, "vectortoangles" }, + { 0x109, "vectortoyaw" }, + { 0x10A, "vectorlerp" }, + { 0x10B, "anglestoup" }, + { 0x10C, "anglestoright" }, + { 0x10D, "anglestoforward" }, + { 0x10E, "anglesdelta" }, + { 0x10F, "combineangles" }, + { 0x110, "transformmove" }, + { 0x111, "rotatevector" }, + { 0x112, "rotatepointaroundvector" }, + { 0x113, "issubstr" }, + { 0x114, "isendstr" }, + { 0x115, "getsubstr" }, + { 0x116, "tolower" }, + { 0x117, "strtok" }, + { 0x118, "stricmp" }, + { 0x119, "ambientplay" }, + { 0x11A, "getuavstrengthmax" }, + { 0x11B, "getuavstrengthlevelneutral" }, + { 0x11C, "getuavstrengthlevelshowenemyfastsweep" }, + { 0x11D, "getuavstrengthlevelshowenemydirectional" }, + { 0x11E, "blockteamradar" }, + { 0x11F, "unblockteamradar" }, + { 0x120, "isteamradarblocked" }, + { 0x121, "getassignedteam" }, + { 0x122, "setmatchdata" }, + { 0x123, "getmatchdata" }, + { 0x124, "sendmatchdata" }, + { 0x125, "clearmatchdata" }, + { 0x126, "setmatchdatadef" }, + { 0x127, "setmatchclientip" }, + { 0x128, "setmatchdataid" }, + { 0x129, "setclientmatchdata" }, + { 0x12A, "getclientmatchdata" }, + { 0x12B, "setclientmatchdatadef" }, + { 0x12C, "sendclientmatchdata" }, + { 0x12D, "getbuildversion" }, + { 0x12E, "getbuildnumber" }, + { 0x12F, "getsystemtime" }, + { 0x130, "getmatchrulesdata" }, + { 0x131, "isusingmatchrulesdata" }, + { 0x132, "kick" }, + { 0x133, "issplitscreen" }, + { 0x134, "setmapcenter" }, + { 0x135, "setgameendtime" }, + { 0x136, "visionsetnaked" }, + { 0x137, "visionsetnight" }, + { 0x138, "visionsetmissilecam" }, + { 0x139, "ambientstop" }, + { 0x13A, "precachemodel" }, + { 0x13B, "precacheshellshock" }, + { 0x13C, "precacheitem" }, + { 0x13D, "precacheshader" }, + { 0x13E, "precachestring" }, + { 0x13F, "precachemenu" }, + { 0x140, "precacherumble" }, + { 0x141, "precachelocationselector" }, + { 0x142, "precacheleaderboards" }, + { 0x143, "loadfx" }, + { 0x144, "playfx" }, + { 0x145, "playfxontag" }, + { 0x146, "stopfxontag" }, + { 0x147, "killfxontag" }, + { 0x148, "playloopedfx" }, + { 0x149, "spawnfx" }, + { 0x14A, "triggerfx" }, + { 0x14B, "playfxontagforclients" }, + { 0x14C, "setwinningteam" }, + { 0x14D, "announcement" }, + { 0x14E, "clientannouncement" }, + { 0x14F, "setteammode" }, + { 0x150, "getteamscore" }, + { 0x151, "setteamscore" }, + { 0x152, "setclientnamemode" }, + { 0x153, "updateclientnames" }, + { 0x154, "getteamplayersalive" }, + { 0x155, "logprint" }, + { 0x156, "worldentnumber" }, + { 0x157, "obituary" }, + { 0x158, "positionwouldtelefrag" }, + { 0x159, "canspawn" }, + { 0x15A, "getstarttime" }, + { 0x15B, "precachestatusicon" }, + { 0x15C, "precacheheadicon" }, + { 0x15D, "precacheminimapicon" }, + { 0x15E, "precachempanim" }, + { 0x15F, "map_restart" }, + { 0x160, "exitlevel" }, + { 0x161, "addtestclient" }, + { 0x162, "addagent" }, + { 0x163, "setarchive" }, + { 0x164, "allclientsprint" }, + { 0x165, "clientprint" }, + { 0x166, "mapexists" }, + { 0x167, "isvalidgametype" }, + { 0x168, "matchend" }, + { 0x169, "setplayerteamrank" }, + { 0x16A, "endparty" }, + { 0x16B, "setteamradar" }, + { 0x16C, "getteamradar" }, + { 0x16D, "setteamradarstrength" }, + { 0x16E, "getteamradarstrength" }, + { 0x16F, "getuavstrengthmin" }, + { 0x170, "physicsexplosionsphere" }, + { 0x171, "physicsexplosioncylinder" }, + { 0x172, "physicsjolt" }, + { 0x173, "physicsjitter" }, + { 0x174, "setexpfog" }, + { 0x175, "isexplosivedamagemod" }, + { 0x176, "radiusdamage" }, + { 0x177, "setplayerignoreradiusdamage" }, + { 0x178, "glassradiusdamage" }, + { 0x179, "earthquake" }, + { 0x17A, "getnumparts" }, + { 0x17B, "objective_onentity" }, + { 0x17C, "objective_onentitywithrotation" }, + { 0x17D, "objective_team" }, + { 0x17E, "objective_player" }, + { 0x17F, "objective_playerteam" }, + { 0x180, "objective_playerenemyteam" }, + { 0x181, "objective_playermask_hidefromall" }, + { 0x182, "objective_playermask_hidefrom" }, + { 0x183, "objective_playermask_showtoall" }, + { 0x184, "objective_playermask_showto" }, + { 0x185, "iprintln" }, + { 0x186, "iprintlnbold" }, + { 0x187, "logstring" }, + { 0x188, "getent" }, + { 0x189, "getentarray" }, + { 0x18A, "getspawnarray" }, + { 0x18B, "spawnplane" }, + { 0x18C, "spawnstruct" }, + { 0x18D, "spawnhelicopter" }, + { 0x18E, "isalive" }, + { 0x18F, "isspawner" }, + { 0x190, "missile_createattractorent" }, + { 0x191, "missile_createattractororigin" }, + { 0x192, "missile_createrepulsorent" }, + { 0x193, "missile_createrepulsororigin" }, + { 0x194, "missile_deleteattractor" }, + { 0x195, "playsoundatpos" }, + { 0x196, "newhudelem" }, + { 0x197, "newclienthudelem" }, + { 0x198, "newteamhudelem" }, + { 0x199, "resettimeout" }, + { 0x19A, "isplayer" }, + { 0x19B, "isplayernumber" }, + { 0x19C, "getpartname" }, + { 0x19D, "weaponfiretime" }, + { 0x19E, "weaponclipsize" }, + { 0x19F, "weaponisauto" }, + { 0x1A0, "weaponissemiauto" }, + { 0x1A1, "weaponisboltaction" }, + { 0x1A2, "weaponinheritsperks" }, + { 0x1A3, "weaponburstcount" }, + { 0x1A4, "weapontype" }, + { 0x1A5, "weaponclass" }, + { 0x1A6, "getnextarraykey" }, + { 0x1A7, "sortbydistance" }, + { 0x1A8, "tablelookup" }, + { 0x1A9, "tablelookupbyrow" }, + { 0x1AA, "tablelookupistring" }, + { 0x1AB, "tablelookupistringbyrow" }, + { 0x1AC, "tablelookuprownum" }, + { 0x1AD, "tableexists" }, + { 0x1AE, "getmissileowner" }, + { 0x1AF, "magicbullet" }, + { 0x1B0, "getweaponflashtagname" }, + { 0x1B1, "averagepoint" }, + { 0x1B2, "averagenormal" }, + { 0x1B3, "vehicle_getspawnerarray" }, + { 0x1B4, "playrumbleonposition" }, + { 0x1B5, "playrumblelooponposition" }, + { 0x1B6, "stopallrumbles" }, + { 0x1B7, "soundexists" }, + { 0x1B8, "openfile" }, + { 0x1B9, "closefile" }, + { 0x1BA, "fprintln" }, + { 0x1BB, "fprintfields" }, + { 0x1BC, "freadln" }, + { 0x1BD, "fgetarg" }, + { 0x1BE, "setminimap" }, + { 0x1BF, "setthermalbodymaterial" }, + { 0x1C0, "getarraykeys" }, + { 0x1C1, "getfirstarraykey" }, + { 0x1C2, "getglass" }, + { 0x1C3, "getglassarray" }, + { 0x1C4, "getglassorigin" }, + { 0x1C5, "isglassdestroyed" }, + { 0x1C6, "destroyglass" }, + { 0x1C7, "deleteglass" }, + { 0x1C8, "getentchannelscount" }, + { 0x1C9, "getentchannelname" }, + { 0x1CA, "objective_add" }, + { 0x1CB, "objective_delete" }, + { 0x1CC, "objective_state" }, + { 0x1CD, "objective_icon" }, + { 0x1CE, "objective_position" }, + { 0x1CF, "objective_current" }, + { 0x1D0, "weaponinventorytype" }, + { 0x1D1, "weaponstartammo" }, + { 0x1D2, "weaponmaxammo" }, + { 0x1D3, "weaponaltweaponname" }, + { 0x1D4, "isweaponcliponly" }, + { 0x1D5, "isweapondetonationtimed" }, + { 0x1D6, "weaponhasthermalscope" }, + { 0x1D7, "getvehiclenode" }, + { 0x1D8, "getvehiclenodearray" }, + { 0x1D9, "getallvehiclenodes" }, + { 0x1DA, "getnumvehicles" }, + { 0x1DB, "precachevehicle" }, + { 0x1DC, "spawnvehicle" }, + { 0x1DD, "vehicle_getarray" }, + { 0x1DE, "pow" }, + { 0x1DF, "botgetmemoryevents" }, + { 0x1E0, "botautoconnectenabled" }, + { 0x1E1, "botzonegetcount" }, + { 0x1E2, "botzonesetteam" }, + { 0x1E3, "botzonenearestcount" }, + { 0x1E4, "botmemoryflags" }, + { 0x1E5, "botflagmemoryevents" }, + { 0x1E6, "botzonegetindoorpercent" }, + { 0x1E7, "botsentientswap" }, + { 0x1E8, "isbot" }, + { 0x1E9, "isagent" }, + { 0x1EA, "getmaxagents" }, + { 0x1EB, "botdebugdrawtrigger" }, + { 0x1EC, "botgetclosestnavigablepoint" }, + { 0x1ED, "gettnodesintrigger" }, + { 0x1EE, "nodesvisible" }, + { 0x1EF, "getnodesonpath" }, + { 0x1F0, "getzonecount" }, + { 0x1F1, "getzonenearest" }, + { 0x1F2, "getzonenodes" }, + { 0x1F3, "getzonepath" }, + { 0x1F4, "getzoneorigin" }, + { 0x1F5, "getnodezone" }, + { 0x1F6, "getzonenodesbydist" }, + { 0x1F7, "getzonenodeforindex" }, + { 0x1F8, "getweaponexplosionradius" }, + { 0x1F9, "markdangerousnodes" }, + { 0x1FA, "markdangerousnodesintrigger" }, + { 0x1FB, "nodeexposedtosky" }, + { 0x1FC, "findentrances" }, + { 0x1FD, "badplace_global" }, + { 0x1FE, "getpathdist" }, + { 0x1FF, "getlinkednodes" }, + { 0x200, "disconnectnodepair" }, + { 0x201, "connectnodepair" }, + { 0x202, "drawsoundshape" }, + { 0x203, "gettimesincelastpaused" }, + { 0x204, "setlasermaterial" }, + { 0x205, "precachefxontag" }, + { 0x206, "precachetag" }, + { 0x207, "precachesound" }, + { 0x208, "devsetminimapdvarsettings" }, + { 0x209, "loadtransient" }, + { 0x20A, "unloadtransient" }, + { 0x20B, "unloadalltransients" }, + { 0x20C, "synctransients" }, + { 0x20D, "istransientqueued" }, + { 0x20E, "istransientloaded" }, + { 0x20F, "loadstartpointtransient" }, + { 0x210, "distance2dsquared" }, + { 0x211, "getangledelta3d" }, + { 0x212, "activateclientexploder" }, + { 0x213, "trajectorycalculateinitialvelocity" }, + { 0x214, "trajectorycalculateminimumvelocity" }, + { 0x215, "trajectorycalculateexitangle" }, + { 0x216, "trajectoryestimatedesiredinairtime" }, + { 0x217, "trajectorycomputedeltaheightattime" }, + { 0x218, "trajectorycanattemptaccuratejump" }, + { 0x219, "adddebugcommand" }, + { 0x21A, "ispointinvolume" }, + { 0x21B, "cinematicgettimeinmsec" }, + { 0x21C, "cinematicgetframe" }, + { 0x21D, "iscinematicloaded" }, + { 0x21E, "bbprint" }, + { 0x21F, "getenemysquaddata" }, + { 0x220, "lookupsoundlength" }, + { 0x221, "getscriptablearray" }, + { 0x222, "clearfog" }, + { 0x223, "setleveldopplerpreset" }, + { 0x224, "screenshake" }, + { 0x225, "anglestoaxis" }, + { 0x226, "visionsetwater" }, + { 0x227, "sendscriptusageanalysisdata" }, + { 0x228, "resetscriptusageanalysisdata" }, + { 0x229, "instantlylogusageanalysisdata" }, + { 0x22A, "invertangles" }, + { 0x22B, "rotatevectorinverted" }, + { 0x22C, "calculatestartorientation" }, + { 0x22D, "getcsplinecount" }, + { 0x22E, "getcsplinepointcount" }, + { 0x22F, "getcsplinelength" }, + { 0x230, "getcsplinepointid" }, + { 0x231, "getcsplinepointlabel" }, + { 0x232, "getcsplinepointtension" }, + { 0x233, "getcsplinepointposition" }, + { 0x234, "getcsplinepointcorridordims" }, + { 0x235, "getcsplinepointtangent" }, + { 0x236, "getcsplinepointdisttonextpoint" }, + { 0x237, "calccsplineposition" }, + { 0x238, "calccsplinetangent" }, + { 0x239, "calccsplinecorridor" }, + { 0x23A, "setnojipscore" }, + { 0x23B, "setnojiptime" }, + { 0x23C, "getpredictedentityposition" }, + { 0x23D, "gamedvrprohibitrecording" }, + { 0x23E, "gamedvrstartrecording" }, + { 0x23F, "gamedvrstoprecording" }, + { 0x240, "gamedvrsetvideometadata" }, + { 0x241, "gamedvrprohibitscreenshots" }, + { 0x242, "gamedvrsetscreenshotmetadata" }, + { 0x243, "queuedialog" }, + { 0x244, "speechenablegrammar" }, + { 0x245, "speechenable" }, + { 0x246, "livestreamingenable" }, + { 0x247, "livestreamingsetbitrate" }, + { 0x248, "triggerportableradarping" }, + { 0x249, "setglaregrimematerial" }, + { 0x24A, "botgetteamlimit" }, + { 0x24B, "spawnfxforclient" }, + { 0x24C, "botgetteamdifficulty" }, + { 0x24D, "getsquadassaultelo" }, + { 0x24E, "loadluifile" }, + { 0x24F, "isdedicatedserver" }, + { 0x250, "getplaylistversion" }, + { 0x251, "getplaylistid" }, + { 0x252, "getactiveclientcount" }, + { 0x253, "issquadsmode" }, + { 0x254, "getsquadassaultsquadindex" }, + { 0x255, "visionsetpostapply" }, + { 0x256, "addbot" }, + { 0x257, "ishairrunning" }, + { 0x258, "getsquadassaultenemyprestige" }, + { 0x259, "playcinematicforall" }, + { 0x25A, "preloadcinematicforall" }, + { 0x25B, "stopcinematicforall" }, + { 0x25C, "getenemysquaddogtype" }, + { 0x25D, "capsuletracepassed" }, +}}; + +const std::array method_list +{{ + { 0x8000, "thermaldrawdisable" }, + { 0x8001, "setturretdismountorg" }, + { 0x8002, "setdamagestage" }, + { 0x8003, "playsoundtoteam" }, + { 0x8004, "playsoundtoplayer" }, + { 0x8005, "playerhide" }, + { 0x8006, "showtoplayer" }, + { 0x8007, "enableplayeruse" }, + { 0x8008, "disableplayeruse" }, + { 0x8009, "makescrambler" }, + { 0x800A, "makeportableradar" }, + { 0x800B, "clearscrambler" }, + { 0x800C, "clearportableradar" }, + { 0x800D, "placespawnpoint" }, + { 0x800E, "setteamfortrigger" }, + { 0x800F, "clientclaimtrigger" }, + { 0x8010, "clientreleasetrigger" }, + { 0x8011, "releaseclaimedtrigger" }, + { 0x8012, "isusingonlinedataoffline" }, + { 0x8013, "getrestedtime" }, + { 0x8014, "sendleaderboards" }, + { 0x8015, "isonladder" }, + { 0x8016, "getcorpseanim" }, + { 0x8017, "playerforcedeathanim" }, + { 0x8018, "attach" }, + { 0x8019, "attachshieldmodel" }, + { 0x801A, "getlightfovinner" }, + { 0x801B, "getlightfovouter" }, + { 0x801C, "setlightfovrange" }, + { 0x801D, "getlightexponent" }, + { 0x801E, "setlightexponent" }, + { 0x801F, "startragdoll" }, + { 0x8020, "startragdollfromimpact" }, + { 0x8021, "queryshouldearlyragdoll" }, + { 0x8022, "logstring" }, + { 0x8023, "laserhidefromclient" }, + { 0x8024, "stopsoundchannel" }, + { 0x8025, "thermaldrawenable" }, + { 0x8026, "detach" }, + { 0x8027, "detachshieldmodel" }, + { 0x8028, "moveshieldmodel" }, + { 0x8029, "detachall" }, + { 0x802A, "getattachsize" }, + { 0x802B, "getattachmodelname" }, + { 0x802C, "getattachtagname" }, + { 0x802D, "setturretcanaidetach" }, + { 0x802E, "setturretfov" }, + { 0x802F, "lerpfov" }, + { 0x8030, "getvalidcoverpeekouts" }, + { 0x8031, "gethighestnodestance" }, + { 0x8032, "doesnodeallowstance" }, + { 0x8033, "getgunangles" }, + { 0x8034, "magicgrenade" }, + { 0x8035, "magicgrenademanual" }, + { 0x8036, "getentnum" }, + { 0x8037, "launch" }, + { 0x8038, "setsoundblend" }, + { 0x8039, "makefakeai" }, + { 0x803A, "spawndrone" }, + { 0x803B, "setcorpseremovetimer" }, + { 0x803C, "setlookattext" }, + { 0x803D, "setspawnerteam" }, + { 0x803E, "addaieventlistener" }, + { 0x803F, "removeaieventlistener" }, + { 0x8040, "getlightcolor" }, + { 0x8041, "setlightcolor" }, + { 0x8042, "getlightradius" }, + { 0x8043, "setlightradius" }, + { 0x8044, "getattachignorecollision" }, + { 0x8045, "hidepart" }, + { 0x8046, "hidepart_allinstances" }, + { 0x8047, "hideallparts" }, + { 0x8048, "showpart" }, + { 0x8049, "showallparts" }, + { 0x804A, "linkto" }, + { 0x804B, "linktoblendtotag" }, + { 0x804C, "unlink" }, + { 0x804D, "setnormalhealth" }, + { 0x804E, "dodamage" }, + { 0x804F, "kill" }, + { 0x8050, "show" }, + { 0x8051, "hide" }, + { 0x8052, "showonclient" }, + { 0x8053, "hideonclient" }, + { 0x8054, "laserforceon" }, + { 0x8055, "laserforceoff" }, + { 0x8056, "disconnectpaths" }, + { 0x8057, "connectpaths" }, + { 0x8058, "disconnectnode" }, + { 0x8059, "connectnode" }, + { 0x805A, "startusingheroonlylighting" }, + { 0x805B, "stopusingheroonlylighting" }, + { 0x805C, "startusinglessfrequentlighting" }, + { 0x805D, "stopusinglessfrequentlighting" }, + { 0x805E, "setmovingplatformplayerturnrate" }, + { 0x805F, "setthermalfog" }, + { 0x8060, "setnightvisionfog" }, + { 0x8061, "clearthermalfog" }, + { 0x8062, "clearnightvisionfog" }, + { 0x8063, "digitaldistortsetparams" }, + { 0x8064, "setmode" }, + { 0x8065, "getmode" }, + { 0x8066, "setturretignoregoals" }, + { 0x8067, "islinked" }, + { 0x8068, "enablelinkto" }, + { 0x8069, "playsoundatviewheight" }, + { 0x806A, "prefetchsound" }, + { 0x806B, "setpitch" }, + { 0x806C, "scalepitch" }, + { 0x806D, "setvolume" }, + { 0x806E, "scalevolume" }, + { 0x806F, "setspeakermapmonotostereo" }, + { 0x8070, "setspeakermapmonoto51" }, + { 0x8071, "setdistributed2dsound" }, + { 0x8072, "playsoundasmaster" }, + { 0x8073, "playloopsound" }, + { 0x8074, "eqon" }, + { 0x8075, "eqoff" }, + { 0x8076, "haseq" }, + { 0x8077, "iswaitingonsound" }, + { 0x8078, "getnormalhealth" }, + { 0x8079, "playerlinkto" }, + { 0x807A, "playerlinktodelta" }, + { 0x807B, "playerlinkweaponviewtodelta" }, + { 0x807C, "playerlinktoabsolute" }, + { 0x807D, "playerlinktoblend" }, + { 0x807E, "playerlinkedoffsetenable" }, + { 0x807F, "setwaypointedgestyle_secondaryarrow" }, + { 0x8080, "setwaypointiconoffscreenonly" }, + { 0x8081, "fadeovertime" }, + { 0x8082, "scaleovertime" }, + { 0x8083, "moveovertime" }, + { 0x8084, "reset" }, + { 0x8085, "destroy" }, + { 0x8086, "setpulsefx" }, + { 0x8087, "setplayernamestring" }, + { 0x8088, "changefontscaleovertime" }, + { 0x8089, "startignoringspotlight" }, + { 0x808A, "stopignoringspotlight" }, + { 0x808B, "dontcastshadows" }, + { 0x808C, "castshadows" }, + { 0x808D, "setstablemissile" }, + { 0x808E, "playersetgroundreferenceent" }, + { 0x808F, "dontinterpolate" }, + { 0x8090, "dospawn" }, + { 0x8091, "stalingradspawn" }, + { 0x8092, "getorigin" }, + { 0x8093, "getcentroid" }, + { 0x8094, "getshootatpos" }, + { 0x8095, "getdebugeye" }, + { 0x8096, "useby" }, + { 0x8097, "playsound" }, + { 0x8098, "playerlinkedoffsetdisable" }, + { 0x8099, "playerlinkedsetviewznear" }, + { 0x809A, "playerlinkedsetusebaseangleforviewclamp" }, + { 0x809B, "lerpviewangleclamp" }, + { 0x809C, "setviewangleresistance" }, + { 0x809D, "springcamenabled" }, + { 0x809E, "springcamdisabled" }, + { 0x809F, "linktoplayerview" }, + { 0x80A0, "unlinkfromplayerview" }, + { 0x80A1, "geteye" }, + { 0x80A2, "istouching" }, + { 0x80A3, "getistouchingentities" }, + { 0x80A4, "stoploopsound" }, + { 0x80A5, "stopsounds" }, + { 0x80A6, "playrumbleonentity" }, + { 0x80A7, "playrumblelooponentity" }, + { 0x80A8, "stoprumble" }, + { 0x80A9, "delete" }, + { 0x80AA, "setmodel" }, + { 0x80AB, "laseron" }, + { 0x80AC, "laseroff" }, + { 0x80AD, "laseraltviewon" }, + { 0x80AE, "laseraltviewoff" }, + { 0x80AF, "thermalvisionon" }, + { 0x80B0, "thermalvisiononshadowoff" }, + { 0x80B1, "thermalvisionoff" }, + { 0x80B2, "thermalvisionfofoverlayon" }, + { 0x80B3, "thermalvisionfofoverlayoff" }, + { 0x80B4, "autospotoverlayon" }, + { 0x80B5, "autospotoverlayoff" }, + { 0x80B6, "seteyesonuplinkenabled" }, + { 0x80B7, "setcontents" }, + { 0x80B8, "makeusable" }, + { 0x80B9, "makeunusable" }, + { 0x80BA, "setwhizbyprobabilities" }, + { 0x80BB, "visionsetnakedforplayer_lerp" }, + { 0x80BC, "setwaitnode" }, + { 0x80BD, "returnplayercontrol" }, + { 0x80BE, "vehphys_starttrack" }, + { 0x80BF, "vehphys_clearautodisable" }, + { 0x80C0, "vehicleusealtblendedaudio" }, + { 0x80C1, "settext" }, + { 0x80C2, "clearalltextafterhudelem" }, + { 0x80C3, "setshader" }, + { 0x80C4, "settargetent" }, + { 0x80C5, "cleartargetent" }, + { 0x80C6, "settimer" }, + { 0x80C7, "settimerup" }, + { 0x80C8, "settimerstatic" }, + { 0x80C9, "settenthstimer" }, + { 0x80CA, "settenthstimerup" }, + { 0x80CB, "settenthstimerstatic" }, + { 0x80CC, "setclock" }, + { 0x80CD, "setclockup" }, + { 0x80CE, "setvalue" }, + { 0x80CF, "setwaypoint" }, + { 0x80D0, "setwaypointedgestyle_rotatingicon" }, + { 0x80D1, "setcursorhint" }, + { 0x80D2, "sethintstring" }, + { 0x80D3, "forceusehinton" }, + { 0x80D4, "forceusehintoff" }, + { 0x80D5, "makesoft" }, + { 0x80D6, "makehard" }, + { 0x80D7, "willneverchange" }, + { 0x80D8, "startfiring" }, + { 0x80D9, "stopfiring" }, + { 0x80DA, "isfiringturret" }, + { 0x80DB, "startbarrelspin" }, + { 0x80DC, "stopbarrelspin" }, + { 0x80DD, "getbarrelspinrate" }, + { 0x80DE, "remotecontrolturret" }, + { 0x80DF, "remotecontrolturretoff" }, + { 0x80E0, "shootturret" }, + { 0x80E1, "getturretowner" }, + { 0x80E2, "enabledeathshield" }, + { 0x80E3, "nightvisiongogglesforceon" }, + { 0x80E4, "nightvisiongogglesforceoff" }, + { 0x80E5, "enableinvulnerability" }, + { 0x80E6, "disableinvulnerability" }, + { 0x80E7, "enablebreaching" }, + { 0x80E8, "disablebreaching" }, + { 0x80E9, "forceviewmodelanimation" }, + { 0x80EA, "disableturretdismount" }, + { 0x80EB, "enableturretdismount" }, + { 0x80EC, "uploadscore" }, + { 0x80ED, "uploadtime" }, + { 0x80EE, "uploadleaderboards" }, + { 0x80EF, "giveachievement" }, + { 0x80F0, "hidehud" }, + { 0x80F1, "showhud" }, + { 0x80F2, "mountvehicle" }, + { 0x80F3, "dismountvehicle" }, + { 0x80F4, "enableslowaim" }, + { 0x80F5, "disableslowaim" }, + { 0x80F6, "usehintsinvehicle" }, + { 0x80F7, "vehicleattackbuttonpressed" }, + { 0x80F8, "setwhizbyoffset" }, + { 0x80F9, "setsentryowner" }, + { 0x80FA, "setsentrycarrier" }, + { 0x80FB, "setturretminimapvisible" }, + { 0x80FC, "settargetentity" }, + { 0x80FD, "snaptotargetentity" }, + { 0x80FE, "cleartargetentity" }, + { 0x80FF, "getturrettarget" }, + { 0x8100, "setplayerspread" }, + { 0x8101, "setaispread" }, + { 0x8102, "setsuppressiontime" }, + { 0x8103, "setflaggedanimknobrestart" }, + { 0x8104, "setflaggedanimknoblimitedrestart" }, + { 0x8105, "setflaggedanimknoball" }, + { 0x8106, "setflaggedanimknoballrestart" }, + { 0x8107, "setflaggedanim" }, + { 0x8108, "setflaggedanimlimited" }, + { 0x8109, "setflaggedanimrestart" }, + { 0x810A, "setflaggedanimlimitedrestart" }, + { 0x810B, "useanimtree" }, + { 0x810C, "stopuseanimtree" }, + { 0x810D, "setanimtime" }, + { 0x810E, "showviewmodel" }, + { 0x810F, "hideviewmodel" }, + { 0x8110, "allowstand" }, + { 0x8111, "allowcrouch" }, + { 0x8112, "allowprone" }, + { 0x8113, "allowlean" }, + { 0x8114, "allowswim" }, + { 0x8115, "setocclusion" }, + { 0x8116, "setocclusionfromtable" }, + { 0x8117, "deactivateocclusion" }, + { 0x8118, "deactivateallocclusion" }, + { 0x8119, "isocclusionenabled" }, + { 0x811A, "setreverbfromtable" }, + { 0x811B, "setvolmodfromtable" }, + { 0x811C, "settimescalefactorfromtable" }, + { 0x811D, "setwhizbyfromtable" }, + { 0x811E, "seteqfromtable" }, + { 0x811F, "iseqenabled" }, + { 0x8120, "seteq" }, + { 0x8121, "seteqbands" }, + { 0x8122, "deactivateeq" }, + { 0x8123, "seteqlerp" }, + { 0x8124, "islookingat" }, + { 0x8125, "isthrowinggrenade" }, + { 0x8126, "isfiring" }, + { 0x8127, "ismeleeing" }, + { 0x8128, "setautopickup" }, + { 0x8129, "allowmelee" }, + { 0x812A, "allowfire" }, + { 0x812B, "enablehealthshield" }, + { 0x812C, "setconvergencetime" }, + { 0x812D, "setconvergenceheightpercent" }, + { 0x812E, "setturretteam" }, + { 0x812F, "maketurretsolid" }, + { 0x8130, "maketurretoperable" }, + { 0x8131, "maketurretinoperable" }, + { 0x8132, "makeentitysentient" }, + { 0x8133, "freeentitysentient" }, + { 0x8134, "isindoor" }, + { 0x8135, "getdroptofloorposition" }, + { 0x8136, "isbadguy" }, + { 0x8137, "animscripted" }, + { 0x8138, "animscriptedthirdperson" }, + { 0x8139, "animrelative" }, + { 0x813A, "stopanimscripted" }, + { 0x813B, "clearanim" }, + { 0x813C, "setanimknob" }, + { 0x813D, "setanimknoblimited" }, + { 0x813E, "setanimknobrestart" }, + { 0x813F, "setanimknoblimitedrestart" }, + { 0x8140, "setanimknoball" }, + { 0x8141, "setanimknoballlimited" }, + { 0x8142, "setanimknoballrestart" }, + { 0x8143, "setanimknoballlimitedrestart" }, + { 0x8144, "setanim" }, + { 0x8145, "setanimlimited" }, + { 0x8146, "setanimrestart" }, + { 0x8147, "setanimlimitedrestart" }, + { 0x8148, "getanimtime" }, + { 0x8149, "getanimweight" }, + { 0x814A, "getanimassettype" }, + { 0x814B, "setflaggedanimknob" }, + { 0x814C, "setflaggedanimknoblimited" }, + { 0x814D, "setturretaccuracy" }, + { 0x814E, "setrightarc" }, + { 0x814F, "setleftarc" }, + { 0x8150, "settoparc" }, + { 0x8151, "setbottomarc" }, + { 0x8152, "setautorotationdelay" }, + { 0x8153, "setdefaultdroppitch" }, + { 0x8154, "restoredefaultdroppitch" }, + { 0x8155, "turretfiredisable" }, + { 0x8156, "getfixednodesafevolume" }, + { 0x8157, "clearfixednodesafevolume" }, + { 0x8158, "isingoal" }, + { 0x8159, "setruntopos" }, + { 0x815A, "nearnode" }, + { 0x815B, "nearclaimnode" }, + { 0x815C, "nearclaimnodeandangle" }, + { 0x815D, "atdangerousnode" }, + { 0x815E, "getenemyinfo" }, + { 0x815F, "clearenemy" }, + { 0x8160, "setentitytarget" }, + { 0x8161, "clearentitytarget" }, + { 0x8162, "setpotentialthreat" }, + { 0x8163, "clearpotentialthreat" }, + { 0x8164, "setflashbanged" }, + { 0x8165, "setengagementmindist" }, + { 0x8166, "setengagementmaxdist" }, + { 0x8167, "isknownenemyinradius" }, + { 0x8168, "isknownenemyinvolume" }, + { 0x8169, "settalktospecies" }, + { 0x816A, "laseralton" }, + { 0x816B, "laseraltoff" }, + { 0x816C, "invisiblenotsolid" }, + { 0x816D, "visiblesolid" }, + { 0x816E, "setdefaultaimlimits" }, + { 0x816F, "initriotshieldhealth" }, + { 0x8170, "getenemysqdist" }, + { 0x8171, "getclosestenemysqdist" }, + { 0x8172, "setthreatbiasgroup" }, + { 0x8173, "getthreatbiasgroup" }, + { 0x8174, "turretfireenable" }, + { 0x8175, "setturretmodechangewait" }, + { 0x8176, "usetriggerrequirelookat" }, + { 0x8177, "getstance" }, + { 0x8178, "setstance" }, + { 0x8179, "itemweaponsetammo" }, + { 0x817A, "getammocount" }, + { 0x817B, "gettagorigin" }, + { 0x817C, "gettagangles" }, + { 0x817D, "shellshock" }, + { 0x817E, "stunplayer" }, + { 0x817F, "stopshellshock" }, + { 0x8180, "fadeoutshellshock" }, + { 0x8181, "setdepthoffield" }, + { 0x8182, "setviewmodeldepthoffield" }, + { 0x8183, "setmotionblurmovescale" }, + { 0x8184, "pickupgrenade" }, + { 0x8185, "useturret" }, + { 0x8186, "stopuseturret" }, + { 0x8187, "canuseturret" }, + { 0x8188, "traversemode" }, + { 0x8189, "animmode" }, + { 0x818A, "orientmode" }, + { 0x818B, "getmotionangle" }, + { 0x818C, "shouldfacemotion" }, + { 0x818D, "getanglestolikelyenemypath" }, + { 0x818E, "setturretanim" }, + { 0x818F, "getturret" }, + { 0x8190, "getgroundenttype" }, + { 0x8191, "forcestartnegotiation" }, + { 0x8192, "setalienjumpcostscale" }, + { 0x8193, "setalienruncostscale" }, + { 0x8194, "setalientraversecostscale" }, + { 0x8195, "animcustom" }, + { 0x8196, "isinscriptedstate" }, + { 0x8197, "canattackenemynode" }, + { 0x8198, "getnegotiationstartnode" }, + { 0x8199, "getnegotiationendnode" }, + { 0x819A, "getnegotiationnextnode" }, + { 0x819B, "getdoorpathnode" }, + { 0x819C, "comparenodedirtopathdir" }, + { 0x819D, "checkprone" }, + { 0x819E, "pushplayer" }, + { 0x819F, "checkgrenadethrowpos" }, + { 0x81A0, "setgoalnode" }, + { 0x81A1, "setgoalpos" }, + { 0x81A2, "setgoalentity" }, + { 0x81A3, "setgoalvolume" }, + { 0x81A4, "setgoalvolumeauto" }, + { 0x81A5, "getgoalvolume" }, + { 0x81A6, "cleargoalvolume" }, + { 0x81A7, "setfixednodesafevolume" }, + { 0x81A8, "setmotionblurturnscale" }, + { 0x81A9, "setmotionblurzoomscale" }, + { 0x81AA, "viewkick" }, + { 0x81AB, "localtoworldcoords" }, + { 0x81AC, "getentitynumber" }, + { 0x81AD, "getentityvelocity" }, + { 0x81AE, "enablegrenadetouchdamage" }, + { 0x81AF, "disablegrenadetouchdamage" }, + { 0x81B0, "enableaimassist" }, + { 0x81B1, "setlookatyawlimits" }, + { 0x81B2, "stoplookat" }, + { 0x81B3, "getmuzzlepos" }, + { 0x81B4, "getmuzzleangle" }, + { 0x81B5, "getmuzzlesideoffsetpos" }, + { 0x81B6, "getaimangle" }, + { 0x81B7, "canshoot" }, + { 0x81B8, "canshootenemy" }, + { 0x81B9, "cansee" }, + { 0x81BA, "seerecently" }, + { 0x81BB, "lastknowntime" }, + { 0x81BC, "lastknownpos" }, + { 0x81BD, "dropweapon" }, + { 0x81BE, "maymovetopoint" }, + { 0x81BF, "maymovefrompointtopoint" }, + { 0x81C0, "teleport" }, + { 0x81C1, "forceteleport" }, + { 0x81C2, "safeteleport" }, + { 0x81C3, "withinapproxpathdist" }, + { 0x81C4, "ispathdirect" }, + { 0x81C5, "allowedstances" }, + { 0x81C6, "isstanceallowed" }, + { 0x81C7, "issuppressionwaiting" }, + { 0x81C8, "issuppressed" }, + { 0x81C9, "ismovesuppressed" }, + { 0x81CA, "isgrenadepossafe" }, + { 0x81CB, "checkgrenadethrow" }, + { 0x81CC, "checkgrenadelaunch" }, + { 0x81CD, "checkgrenadelaunchpos" }, + { 0x81CE, "throwgrenade" }, + { 0x81CF, "disableaimassist" }, + { 0x81D0, "radiusdamage" }, + { 0x81D1, "detonate" }, + { 0x81D2, "damageconetrace" }, + { 0x81D3, "sightconetrace" }, + { 0x81D4, "missile_settargetent" }, + { 0x81D5, "missile_settargetpos" }, + { 0x81D6, "missile_cleartarget" }, + { 0x81D7, "missile_setflightmodedirect" }, + { 0x81D8, "missile_setflightmodetop" }, + { 0x81D9, "getlightintensity" }, + { 0x81DA, "setlightintensity" }, + { 0x81DB, "isragdoll" }, + { 0x81DC, "setmovespeedscale" }, + { 0x81DD, "cameralinkto" }, + { 0x81DE, "cameraunlink" }, + { 0x81DF, "startcoverarrival" }, + { 0x81E0, "starttraversearrival" }, + { 0x81E1, "checkcoverexitposwithpath" }, + { 0x81E2, "shoot" }, + { 0x81E3, "shootblank" }, + { 0x81E4, "melee" }, + { 0x81E5, "updateplayersightaccuracy" }, + { 0x81E6, "findshufflecovernode" }, + { 0x81E7, "findnearbycovernode" }, + { 0x81E8, "findcovernode" }, + { 0x81E9, "findbestcovernode" }, + { 0x81EA, "getcovernode" }, + { 0x81EB, "usecovernode" }, + { 0x81EC, "iscovervalidagainstenemy" }, + { 0x81ED, "reacquirestep" }, + { 0x81EE, "findreacquiredirectpath" }, + { 0x81EF, "trimpathtoattack" }, + { 0x81F0, "reacquiremove" }, + { 0x81F1, "findreacquireproximatepath" }, + { 0x81F2, "flagenemyunattackable" }, + { 0x81F3, "enterprone" }, + { 0x81F4, "exitprone" }, + { 0x81F5, "setproneanimnodes" }, + { 0x81F6, "updateprone" }, + { 0x81F7, "clearpitchorient" }, + { 0x81F8, "setlookatanimnodes" }, + { 0x81F9, "setlookat" }, + { 0x81FA, "setlookatentity" }, + { 0x81FB, "controlslinkto" }, + { 0x81FC, "controlsunlink" }, + { 0x81FD, "makevehiclesolidcapsule" }, + { 0x81FE, "teleportentityrelative" }, + { 0x81FF, "makevehiclesolidsphere" }, + { 0x8200, "makevehiclesolid" }, + { 0x8201, "remotecontrolvehicle" }, + { 0x8202, "remotecontrolvehicleoff" }, + { 0x8203, "isfiringvehicleturret" }, + { 0x8204, "remotecontrolvehicletarget" }, + { 0x8205, "remotecontrolvehicletargetoff" }, + { 0x8206, "drivevehicleandcontrolturret" }, + { 0x8207, "drivevehicleandcontrolturretoff" }, + { 0x8208, "getplayersetting" }, + { 0x8209, "getlocalplayerprofiledata" }, + { 0x820A, "setlocalplayerprofiledata" }, + { 0x820B, "remotecamerasoundscapeon" }, + { 0x820C, "remotecamerasoundscapeoff" }, + { 0x820D, "setmotiontrackervisible" }, + { 0x820E, "getmotiontrackervisible" }, + { 0x820F, "worldpointinreticle_circle" }, + { 0x8210, "worldpointinreticle_rect" }, + { 0x8211, "getpointinbounds" }, + { 0x8212, "transfermarkstonewscriptmodel" }, + { 0x8213, "setwatersheeting" }, + { 0x8214, "addontoviewmodel" }, + { 0x8215, "clearviewmodeladdons" }, + { 0x8216, "setweaponhudiconoverride" }, + { 0x8217, "getweaponhudiconoverride" }, + { 0x8218, "setempjammed" }, + { 0x8219, "playersetexpfog" }, + { 0x821A, "isitemunlocked" }, + { 0x821B, "getplayerdata" }, + { 0x821C, "getrankedplayerdata" }, + { 0x821D, "getprivateplayerdata" }, + { 0x821E, "getcoopplayerdata" }, + { 0x821F, "getcommonplayerdata" }, + { 0x8220, "vehicleturretcontroloff" }, + { 0x8221, "isturretready" }, + { 0x8222, "vehicledriveto" }, + { 0x8223, "vehicle_dospawn" }, + { 0x8224, "vehicle_isphysveh" }, + { 0x8225, "vehphys_crash" }, + { 0x8226, "vehphys_launch" }, + { 0x8227, "vehphys_disablecrashing" }, + { 0x8228, "vehphys_enablecrashing" }, + { 0x8229, "vehphys_setspeed" }, + { 0x822A, "vehphys_setconveyorbelt" }, + { 0x822B, "freehelicopter" }, + { 0x822C, "playerlinkedturretanglesenable" }, + { 0x822D, "playerlinkedturretanglesdisable" }, + { 0x822E, "playersetstreamorigin" }, + { 0x822F, "playerclearstreamorigin" }, + { 0x8230, "nightvisionviewon" }, + { 0x8231, "nightvisionviewoff" }, + { 0x8232, "painvisionon" }, + { 0x8233, "painvisionoff" }, + { 0x8234, "getplayerintelisfound" }, + { 0x8235, "setplayerintelfound" }, + { 0x8236, "newpip" }, + { 0x8237, "sethuddynlight" }, + { 0x8238, "startscriptedanim" }, + { 0x8239, "startcoverbehavior" }, + { 0x823A, "setplayerdata" }, + { 0x823B, "setrankedplayerdata" }, + { 0x823C, "setprivateplayerdata" }, + { 0x823D, "setcoopplayerdata" }, + { 0x823E, "setcommonplayerdata" }, + { 0x823F, "getcacplayerdata" }, + { 0x8240, "trackerupdate" }, + { 0x8241, "pingplayer" }, + { 0x8242, "buttonpressed" }, + { 0x8243, "sayall" }, + { 0x8244, "sayteam" }, + { 0x8245, "setspawnweapon" }, + { 0x8246, "dropitem" }, + { 0x8247, "dropscavengerbag" }, + { 0x8248, "setjitterparams" }, + { 0x8249, "sethoverparams" }, + { 0x824A, "joltbody" }, + { 0x824B, "freevehicle" }, + { 0x824C, "getwheelsurface" }, + { 0x824D, "getvehicleowner" }, + { 0x824E, "setvehiclelookattext" }, + { 0x824F, "setvehicleteam" }, + { 0x8250, "setneargoalnotifydist" }, + { 0x8251, "setvehgoalpos" }, + { 0x8252, "setgoalyaw" }, + { 0x8253, "cleargoalyaw" }, + { 0x8254, "settargetyaw" }, + { 0x8255, "cleartargetyaw" }, + { 0x8256, "vehicle_helisetai" }, + { 0x8257, "setturrettargetvec" }, + { 0x8258, "setturrettargetent" }, + { 0x8259, "clearturrettarget" }, + { 0x825A, "vehicle_canturrettargetpoint" }, + { 0x825B, "setlookatent" }, + { 0x825C, "clearlookatent" }, + { 0x825D, "setvehweapon" }, + { 0x825E, "fireweapon" }, + { 0x825F, "vehicleturretcontrolon" }, + { 0x8260, "finishplayerdamage" }, + { 0x8261, "suicide" }, + { 0x8262, "closeingamemenu" }, + { 0x8263, "iprintln" }, + { 0x8264, "iprintlnbold" }, + { 0x8265, "spawn" }, + { 0x8266, "setentertime" }, + { 0x8267, "cloneplayer" }, + { 0x8268, "istalking" }, + { 0x8269, "allowspectateteam" }, + { 0x826A, "getguid" }, + { 0x826B, "physicslaunchserver" }, + { 0x826C, "physicslaunchserveritem" }, + { 0x826D, "clonebrushmodeltoscriptmodel" }, + { 0x826E, "scriptmodelplayanim" }, + { 0x826F, "scriptmodelclearanim" }, + { 0x8270, "scriptmodelplayanimdeltamotion" }, + { 0x8271, "vehicle_teleport" }, + { 0x8272, "attachpath" }, + { 0x8273, "getattachpos" }, + { 0x8274, "startpath" }, + { 0x8275, "setswitchnode" }, + { 0x8276, "setwaitspeed" }, + { 0x8277, "vehicle_finishdamage" }, + { 0x8278, "vehicle_setspeed" }, + { 0x8279, "vehicle_setspeedimmediate" }, + { 0x827A, "vehicle_rotateyaw" }, + { 0x827B, "vehicle_getspeed" }, + { 0x827C, "vehicle_getvelocity" }, + { 0x827D, "vehicle_getbodyvelocity" }, + { 0x827E, "vehicle_getsteering" }, + { 0x827F, "vehicle_getthrottle" }, + { 0x8280, "vehicle_turnengineoff" }, + { 0x8281, "vehicle_turnengineon" }, + { 0x8282, "vehicle_orientto" }, + { 0x8283, "getgoalspeedmph" }, + { 0x8284, "setacceleration" }, + { 0x8285, "setdeceleration" }, + { 0x8286, "resumespeed" }, + { 0x8287, "setyawspeed" }, + { 0x8288, "setyawspeedbyname" }, + { 0x8289, "setmaxpitchroll" }, + { 0x828A, "setairresistance" }, + { 0x828B, "setturningability" }, + { 0x828C, "getxuid" }, + { 0x828D, "getucdidhigh" }, + { 0x828E, "getucdidlow" }, + { 0x828F, "getclanidhigh" }, + { 0x8290, "getclanidlow" }, + { 0x8291, "ishost" }, + { 0x8292, "getspectatingplayer" }, + { 0x8293, "predictstreampos" }, + { 0x8294, "updatescores" }, + { 0x8295, "updatedmscores" }, + { 0x8296, "setrank" }, + { 0x8297, "setcardtitle" }, + { 0x8298, "weaponlocknoclearance" }, + { 0x8299, "visionsyncwithplayer" }, + { 0x829A, "showhudsplash" }, + { 0x829B, "setperk" }, + { 0x829C, "hasperk" }, + { 0x829D, "clearperks" }, + { 0x829E, "unsetperk" }, + { 0x829F, "registerparty" }, + { 0x82A0, "getfireteammembers" }, + { 0x82A1, "noclip" }, + { 0x82A2, "ufo" }, + { 0x82A3, "moveto" }, + { 0x82A4, "movex" }, + { 0x82A5, "movey" }, + { 0x82A6, "movez" }, + { 0x82A7, "movegravity" }, + { 0x82A8, "moveslide" }, + { 0x82A9, "stopmoveslide" }, + { 0x82AA, "rotateto" }, + { 0x82AB, "rotatepitch" }, + { 0x82AC, "rotateyaw" }, + { 0x82AD, "rotateroll" }, + { 0x82AE, "addpitch" }, + { 0x82AF, "addyaw" }, + { 0x82B0, "addroll" }, + { 0x82B1, "vibrate" }, + { 0x82B2, "rotatevelocity" }, + { 0x82B3, "solid" }, + { 0x82B4, "notsolid" }, + { 0x82B5, "setcandamage" }, + { 0x82B6, "setcanradiusdamage" }, + { 0x82B7, "physicslaunchclient" }, + { 0x82B8, "setcardicon" }, + { 0x82B9, "setcardnameplate" }, + { 0x82BA, "setcarddisplayslot" }, + { 0x82BB, "kc_regweaponforfxremoval" }, + { 0x82BC, "laststandrevive" }, + { 0x82BD, "setspectatedefaults" }, + { 0x82BE, "getthirdpersoncrosshairoffset" }, + { 0x82BF, "disableweaponpickup" }, + { 0x82C0, "enableweaponpickup" }, + { 0x82C1, "issplitscreenplayer" }, + { 0x82C2, "getweaponslistoffhands" }, + { 0x82C3, "getweaponslistitems" }, + { 0x82C4, "getweaponslistexclusives" }, + { 0x82C5, "getweaponslist" }, + { 0x82C6, "canplayerplacesentry" }, + { 0x82C7, "canplayerplacetank" }, + { 0x82C8, "visionsetnakedforplayer" }, + { 0x82C9, "visionsetnightforplayer" }, + { 0x82CA, "visionsetmissilecamforplayer" }, + { 0x82CB, "visionsetthermalforplayer" }, + { 0x82CC, "visionsetpainforplayer" }, + { 0x82CD, "setblurforplayer" }, + { 0x82CE, "getplayerweaponmodel" }, + { 0x82CF, "getplayerknifemodel" }, + { 0x82D0, "updateentitywithweapons" }, + { 0x82D1, "notifyonplayercommand" }, + { 0x82D2, "canmantle" }, + { 0x82D3, "forcemantle" }, + { 0x82D4, "ismantling" }, + { 0x82D5, "playfx" }, + { 0x82D6, "player_recoilscaleon" }, + { 0x82D7, "player_recoilscaleoff" }, + { 0x82D8, "weaponlockstart" }, + { 0x82D9, "weaponlockfinalize" }, + { 0x82DA, "weaponlockfree" }, + { 0x82DB, "weaponlocktargettooclose" }, + { 0x82DC, "issplitscreenplayerprimary" }, + { 0x82DD, "markforeyeson" }, + { 0x82DE, "issighted" }, + { 0x82DF, "getsightedplayers" }, + { 0x82E0, "getplayerssightingme" }, + { 0x82E1, "getviewmodel" }, + { 0x82E2, "fragbuttonpressed" }, + { 0x82E3, "secondaryoffhandbuttonpressed" }, + { 0x82E4, "getcurrentweaponclipammo" }, + { 0x82E5, "setvelocity" }, + { 0x82E6, "getplayerviewheight" }, + { 0x82E7, "getnormalizedmovement" }, + { 0x82E8, "setchannelvolumes" }, + { 0x82E9, "deactivatechannelvolumes" }, + { 0x82EA, "playlocalsound" }, + { 0x82EB, "stoplocalsound" }, + { 0x82EC, "setweaponammoclip" }, + { 0x82ED, "setweaponammostock" }, + { 0x82EE, "getweaponammoclip" }, + { 0x82EF, "getweaponammostock" }, + { 0x82F0, "anyammoforweaponmodes" }, + { 0x82F1, "setclientomnvar" }, + { 0x82F2, "setclientdvar" }, + { 0x82F3, "setclientdvars" }, + { 0x82F4, "setclientspawnsighttraces" }, + { 0x82F5, "clientspawnsighttracepassed" }, + { 0x82F6, "allowads" }, + { 0x82F7, "allowjump" }, + { 0x82F8, "allowsprint" }, + { 0x82F9, "setspreadoverride" }, + { 0x82FA, "resetspreadoverride" }, + { 0x82FB, "setaimspreadmovementscale" }, + { 0x82FC, "setactionslot" }, + { 0x82FD, "setviewkickscale" }, + { 0x82FE, "getviewkickscale" }, + { 0x82FF, "getweaponslistall" }, + { 0x8300, "getweaponslistprimaries" }, + { 0x8301, "getnormalizedcameramovement" }, + { 0x8302, "giveweapon" }, + { 0x8303, "takeweapon" }, + { 0x8304, "takeallweapons" }, + { 0x8305, "getcurrentweapon" }, + { 0x8306, "getcurrentprimaryweapon" }, + { 0x8307, "getcurrentoffhand" }, + { 0x8308, "hasweapon" }, + { 0x8309, "switchtoweapon" }, + { 0x830A, "switchtoweaponimmediate" }, + { 0x830B, "switchtooffhand" }, + { 0x830C, "setoffhandsecondaryclass" }, + { 0x830D, "getoffhandsecondaryclass" }, + { 0x830E, "beginlocationselection" }, + { 0x830F, "endlocationselection" }, + { 0x8310, "disableweapons" }, + { 0x8311, "enableweapons" }, + { 0x8312, "disableoffhandweapons" }, + { 0x8313, "enableoffhandweapons" }, + { 0x8314, "disableweaponswitch" }, + { 0x8315, "enableweaponswitch" }, + { 0x8316, "openpopupmenu" }, + { 0x8317, "openpopupmenunomouse" }, + { 0x8318, "closepopupmenu" }, + { 0x8319, "openmenu" }, + { 0x831A, "closemenu" }, + { 0x831B, "savematchrulestohistory" }, + { 0x831C, "freezecontrols" }, + { 0x831D, "disableusability" }, + { 0x831E, "enableusability" }, + { 0x831F, "setwhizbyspreads" }, + { 0x8320, "setwhizbyradii" }, + { 0x8321, "setreverb" }, + { 0x8322, "deactivatereverb" }, + { 0x8323, "setvolmod" }, + { 0x8324, "setchannelvolume" }, + { 0x8325, "givestartammo" }, + { 0x8326, "givemaxammo" }, + { 0x8327, "getfractionstartammo" }, + { 0x8328, "getfractionmaxammo" }, + { 0x8329, "isdualwielding" }, + { 0x832A, "isreloading" }, + { 0x832B, "isswitchingweapon" }, + { 0x832C, "setorigin" }, + { 0x832D, "getvelocity" }, + { 0x832E, "setplayerangles" }, + { 0x832F, "getplayerangles" }, + { 0x8330, "usebuttonpressed" }, + { 0x8331, "attackbuttonpressed" }, + { 0x8332, "adsbuttonpressed" }, + { 0x8333, "meleebuttonpressed" }, + { 0x8334, "playerads" }, + { 0x8335, "isonground" }, + { 0x8336, "isusingturret" }, + { 0x8337, "setviewmodel" }, + { 0x8338, "setoffhandprimaryclass" }, + { 0x8339, "getoffhandprimaryclass" }, + { 0x833A, "startac130" }, + { 0x833B, "stopac130" }, + { 0x833C, "enablemousesteer" }, + { 0x833D, "setscriptmoverkillcam" }, + { 0x833E, "usinggamepad" }, + { 0x833F, "forcethirdpersonwhenfollowing" }, + { 0x8340, "disableforcethirdpersonwhenfollowing" }, + { 0x8341, "botsetflag" }, + { 0x8342, "botsetstance" }, + { 0x8343, "botsetscriptmove" }, + { 0x8344, "botsetscriptgoal" }, + { 0x8345, "botsetscriptgoalnode" }, + { 0x8346, "botclearscriptgoal" }, + { 0x8347, "botsetscriptenemy" }, + { 0x8348, "botclearscriptenemy" }, + { 0x8349, "botsetattacker" }, + { 0x834A, "botgetscriptgoal" }, + { 0x834B, "botgetscriptgoalradius" }, + { 0x834C, "botgetscriptgoalyaw" }, + { 0x834D, "botgetscriptgoaltype" }, + { 0x834E, "botgetentrancepoint" }, + { 0x834F, "botgetworldsize" }, + { 0x8350, "botnodeavailable" }, + { 0x8351, "botfindnoderandom" }, + { 0x8352, "botmemoryevent" }, + { 0x8353, "botmemoryselectpos" }, + { 0x8354, "botnodepick" }, + { 0x8355, "bothasscriptgoal" }, + { 0x8356, "botgetpersonality" }, + { 0x8357, "botthrowgrenade" }, + { 0x8358, "botgetmemoryevents" }, + { 0x8359, "botsetpersonality" }, + { 0x835A, "botsetdifficulty" }, + { 0x835B, "botgetdifficulty" }, + { 0x835C, "botgetworldclosestedge" }, + { 0x835D, "botlookatpoint" }, + { 0x835E, "botpredictseepoint" }, + { 0x835F, "botcanseeentity" }, + { 0x8360, "botgetnodesonpath" }, + { 0x8361, "botnodepickmultiple" }, + { 0x8362, "botgetnearestnode" }, + { 0x8363, "botgetfovdot" }, + { 0x8364, "botsetawareness" }, + { 0x8365, "botpursuingscriptgoal" }, + { 0x8366, "botgetscriptgoalnode" }, + { 0x8367, "botgetimperfectenemyinfo" }, + { 0x8368, "botflagmemoryevents" }, + { 0x8369, "botsetpathingstyle" }, + { 0x836A, "botsetdifficultysetting" }, + { 0x836B, "botgetdifficultysetting" }, + { 0x836C, "botgetpathdist" }, + { 0x836D, "botisrandomized" }, + { 0x836E, "botpressbutton" }, + { 0x836F, "botclearbutton" }, + { 0x8370, "botnodescoremultiple" }, + { 0x8371, "getnodenumber" }, + { 0x8372, "setclientowner" }, + { 0x8373, "setotherent" }, + { 0x8374, "playercommandbot" }, + { 0x8375, "setaisightlinevisible" }, + { 0x8376, "setentityowner" }, + { 0x8377, "nodeisdisconnected" }, + { 0x8378, "getnearestnode" }, + { 0x8379, "makeentitynomeleetarget" }, + { 0x837A, "isagent" }, + { 0x837B, "spawnagent" }, + { 0x837C, "finishagentdamage" }, + { 0x837D, "setagentattacker" }, + { 0x837E, "cloneagent" }, + { 0x837F, "agentcanseesentient" }, + { 0x8380, "scragentsetwaypoint" }, + { 0x8381, "scragentsetgoalpos" }, + { 0x8382, "scragentgetgoalpos" }, + { 0x8383, "scragentsetgoalnode" }, + { 0x8384, "scragentsetgoalentity" }, + { 0x8385, "scragentsetgoalradius" }, + { 0x8386, "scragentsetanimscale" }, + { 0x8387, "scragentsetorientmode" }, + { 0x8388, "scragentsetanimmode" }, + { 0x8389, "scragentsetphysicsmode" }, + { 0x838A, "scragentsetclipmode" }, + { 0x838B, "scragentsetmaxturnspeed" }, + { 0x838C, "scragentgetmaxturnspeed" }, + { 0x838D, "scragentbeginmelee" }, + { 0x838E, "scragentsetscripted" }, + { 0x838F, "scragentdotrajectory" }, + { 0x8390, "scragentdoanimlerp" }, + { 0x8391, "scragentsetviewheight" }, + { 0x8392, "scragentclaimnode" }, + { 0x8393, "scragentrelinquishclaimednode" }, + { 0x8394, "setdoghandler" }, + { 0x8395, "setdogcommand" }, + { 0x8396, "setdogattackradius" }, + { 0x8397, "isdogfollowinghandler" }, + { 0x8398, "setdogmaxdrivespeed" }, + { 0x8399, "isdogbeingdriven" }, + { 0x839A, "setdogautoattackwhendriven" }, + { 0x839B, "getdogattackbeginnode" }, + { 0x839C, "setanimclass" }, + { 0x839D, "enableanimstate" }, + { 0x839E, "setanimstate" }, + { 0x839F, "getanimentry" }, + { 0x83A0, "getanimentryname" }, + { 0x83A1, "getanimentryalias" }, + { 0x83A2, "getanimentrycount" }, + { 0x83A3, "pushplayervector" }, + { 0x83A4, "issprinting" }, + { 0x83A5, "playerlinkeduselinkedvelocity" }, + { 0x83A6, "shootstopsound" }, + { 0x83A7, "setclothtype" }, + { 0x83A8, "getclothmovesound" }, + { 0x83A9, "getequipmovesound" }, + { 0x83AA, "jumpbuttonpressed" }, + { 0x83AB, "rotateby" }, + { 0x83AC, "getlookaheaddir" }, + { 0x83AD, "getpathgoalpos" }, + { 0x83AE, "setrocketcorpse" }, + { 0x83AF, "setcorpsefalling" }, + { 0x83B0, "setsurfacetype" }, + { 0x83B1, "aiphysicstrace" }, + { 0x83B2, "aiphysicstracepassed" }, + { 0x83B3, "setdevtext" }, + { 0x83B4, "forcemovingplatformentity" }, + { 0x83B5, "setmovingplatformtrigger" }, + { 0x83B6, "visionsetstage" }, + { 0x83B7, "linkwaypointtotargetwithoffset" }, + { 0x83B8, "getlinkedparent" }, + { 0x83B9, "getmovingplatformparent" }, + { 0x83BA, "setnameplatematerial" }, + { 0x83BB, "retargetscriptmodellighting" }, + { 0x83BC, "setmantlesoundflavor" }, + { 0x83BD, "clearclienttriggeraudiozone" }, + { 0x83BE, "setclienttriggeraudiozone" }, + { 0x83BF, "makevehiclenotcollidewithplayers" }, + { 0x83C0, "getbobrate" }, + { 0x83C1, "setbobrate" }, + { 0x83C2, "setscriptablepartstate" }, + { 0x83C3, "stopsliding" }, + { 0x83C4, "cancelrocketcorpse" }, + { 0x83C5, "setdronegoalpos" }, + { 0x83C6, "hudoutlineenable" }, + { 0x83C7, "hudoutlinedisable" }, + { 0x83C8, "motionblurhqenable" }, + { 0x83C9, "motionblurhqdisable" }, + { 0x83CA, "screenshakeonentity" }, + { 0x83CB, "setpitchorient" }, + { 0x83CC, "worldpointtoscreenpos" }, + { 0x83CD, "linktoplayerviewignoreparentrot" }, + { 0x83CE, "shouldplaymeleedeathanim" }, + { 0x83CF, "botfirstavailablegrenade" }, + { 0x83D0, "visionsetwaterforplayer" }, + { 0x83D1, "setwatersurfacetransitionfx" }, + { 0x83D2, "linktoplayerviewfollowwatersurface" }, + { 0x83D3, "linktoplayerviewattachwatersurfacetransitioneffects" }, + { 0x83D4, "playersetwaterfog" }, + { 0x83D5, "emissiveblend" }, + { 0x83D6, "enableforceviewmodeldof" }, + { 0x83D7, "disableforceviewmodeldof" }, + { 0x83D8, "getcustomizationbody" }, + { 0x83D9, "getcustomizationhead" }, + { 0x83DA, "getcustomizationviewmodel" }, + { 0x83DB, "setviewmodeldepth" }, + { 0x83DC, "isenemyaware" }, + { 0x83DD, "hasenemybeenseen" }, + { 0x83DE, "physicssetmaxlinvel" }, + { 0x83DF, "physicssetmaxangvel" }, + { 0x83E0, "physicsgetlinvel" }, + { 0x83E1, "physicsgetlinspeed" }, + { 0x83E2, "physicsgetangvel" }, + { 0x83E3, "physicsgetangspeed" }, + { 0x83E4, "disablemissileboosting" }, + { 0x83E5, "enablemissileboosting" }, + { 0x83E6, "canspawntestclient" }, + { 0x83E7, "spawntestclient" }, + { 0x83E8, "loadcustomizationplayerview" }, + { 0x83E9, "setgrenadethrowscale" }, + { 0x83EA, "setgrenadecookscale" }, + { 0x83EB, "setplanesplineid" }, + { 0x83EC, "hudoutlineenableforclient" }, + { 0x83ED, "hudoutlinedisableforclient" }, + { 0x83EE, "hudoutlineenableforclients" }, + { 0x83EF, "hudoutlinedisableforclients" }, + { 0x83F0, "turretsetbarrelspinenabled" }, + { 0x83F1, "hasloadedcustomizationplayerview" }, + { 0x83F2, "setclienttriggeraudiozonelerp" }, + { 0x83F3, "setclienttriggeraudiozonepartial" }, + { 0x83F4, "scragentdoanimrelative" }, + { 0x83F5, "rotatetolinked" }, + { 0x83F6, "rotatebylinked" }, + { 0x83F7, "setlinkedangles" }, + { 0x83F8, "getcorpseentity" }, + { 0x83F9, "removefrommovingplatformsystem" }, + { 0x83FA, "logmatchdatalife" }, + { 0x83FB, "logmatchdatadeath" }, + { 0x83FC, "queuedialogforplayer" }, + { 0x83FD, "setmlgcameradefaults" }, + { 0x83FE, "ismlgspectator" }, + { 0x83FF, "disableautoreload" }, + { 0x8400, "enableautoreload" }, + { 0x8401, "issprintsliding" }, + { 0x8402, "getlinkedchildren" }, + { 0x8403, "botpredictenemycampspots" }, + { 0x8404, "playsoundonmovingent" }, + { 0x8405, "cancelmantle" }, + { 0x8406, "hasfemalecustomizationmodel" }, + { 0x8407, "setscriptabledamageowner" }, + { 0x8408, "setfxkilldefondelete" }, + { 0x8409, "getdogavoident" }, + { 0x840A, "enabledogavoidance" }, + { 0x840B, "forcedeathfall" }, + { 0x840C, "gethybridscopestate" }, + { 0x840D, "sethybridscopestate" }, + { 0x840E, "getvieworigin" }, + { 0x840F, "setweaponmodelvariant" }, + { 0x8410, "ridevehicle" }, + { 0x8411, "stopridingvehicle" }, + { 0x8412, "getmantlesound" }, + { 0x8413, "autoboltmissileeffects" }, + { 0x8414, "disablemissilestick" }, + { 0x8415, "enablemissilestick" }, + { 0x8416, "setmissileminimapvisible" }, + { 0x8417, "isoffhandweaponreadytothrow" }, + { 0x8418, "isleaning" }, + { 0x8419, "makecollidewithitemclip" }, + { 0x841A, "ismovementfromgamepad" }, + { 0x841B, "visionsetpostapplyforplayer" }, + { 0x841C, "setcommonplayerdatareservedint" }, + { 0x841D, "getclanwarsbonus" }, + { 0x841E, "getrankedplayerdatareservedint" }, + { 0x841F, "setrankedplayerdatareservedint" }, + { 0x8420, "setignorefoliagesightingme" }, + { 0x8421, "scragentusemodelcollisionbounds" }, + { 0x8422, "setmlgspectator" }, + { 0x8423, "getmlgspectatorteam" }, + { 0x8424, "getcommonplayerdatareservedint" }, + { 0x8425, "getcoopplayerdatareservedint" }, + { 0x8426, "setcoopplayerdatareservedint" }, + { 0x8427, "getjointype" }, + { 0x8428, "scragentsetwallruncost" }, + { 0x8429, "alienscheckisitempurchased" }, +}}; + +const std::array file_list +{{ + { 0x301, "character/character_ajax_flood_a" }, + { 0x302, "character/character_ajax_wood_shotgun_a" }, + { 0x303, "character/character_ajax_wood_shotgun_b" }, + { 0x304, "character/character_ajax_wood_shotgun_injured" }, + { 0x305, "character/character_almagro_assault_a" }, + { 0x306, "character/character_chemwar_russian_assault_b" }, + { 0x307, "character/character_chemwar_russian_assault_bb" }, + { 0x308, "character/character_chemwar_russian_assault_c" }, + { 0x309, "character/character_chemwar_russian_assault_cc" }, + { 0x30A, "character/character_chemwar_russian_assault_d" }, + { 0x30B, "character/character_chemwar_russian_assault_dd" }, + { 0x30C, "character/character_chemwar_russian_assault_e" }, + { 0x30D, "character/character_chemwar_russian_assault_ee" }, + { 0x30E, "character/character_deer_a" }, + { 0x30F, "character/character_deer_b" }, + { 0x310, "character/character_deer_c" }, + { 0x311, "character/character_elias_a" }, + { 0x312, "character/character_elias_assault_a" }, + { 0x313, "character/character_elias_b" }, + { 0x314, "character/character_elias_e" }, + { 0x315, "character/character_elias_hc" }, + { 0x316, "character/character_elias_wood_shotgun_b" }, + { 0x317, "character/character_elite_pmc_assault_a" }, + { 0x318, "character/character_elite_pmc_assault_a_black" }, + { 0x319, "character/character_elite_pmc_assault_a_white" }, + { 0x31A, "character/character_elite_pmc_assault_b" }, + { 0x31B, "character/character_elite_pmc_assault_b_desert" }, + { 0x31C, "character/character_elite_pmc_lmg_b_desert" }, + { 0x31D, "character/character_elite_pmc_shotgun_b_desert" }, + { 0x31E, "character/character_elite_pmc_skyway" }, + { 0x31F, "character/character_elite_pmc_smg_b_desert" }, + { 0x320, "character/character_enemy_shark" }, + { 0x321, "character/character_enemy_wolf" }, + { 0x322, "character/character_fed_army_assault_a" }, + { 0x323, "character/character_fed_army_assault_a_arctic" }, + { 0x324, "character/character_fed_army_assault_a_elite" }, + { 0x325, "character/character_fed_army_assault_a_nohelmet" }, + { 0x326, "character/character_fed_army_assault_a_urban" }, + { 0x327, "character/character_fed_army_assault_b" }, + { 0x328, "character/character_fed_army_assault_b_arctic" }, + { 0x329, "character/character_fed_army_assault_b_elite" }, + { 0x32A, "character/character_fed_army_assault_b_nohelmet" }, + { 0x32B, "character/character_fed_army_assault_b_urban" }, + { 0x32C, "character/character_fed_army_drones" }, + { 0x32D, "character/character_fed_army_lmg_a" }, + { 0x32E, "character/character_fed_army_lmg_a_arctic" }, + { 0x32F, "character/character_fed_army_lmg_a_urban" }, + { 0x330, "character/character_fed_army_shotgun_a" }, + { 0x331, "character/character_fed_army_shotgun_a_arctic" }, + { 0x332, "character/character_fed_army_shotgun_a_urban" }, + { 0x333, "character/character_fed_army_smg_a" }, + { 0x334, "character/character_fed_army_smg_a_arctic" }, + { 0x335, "character/character_fed_army_smg_a_nohelmet" }, + { 0x336, "character/character_fed_army_smg_a_urban" }, + { 0x337, "character/character_fed_basic_assault_a" }, + { 0x338, "character/character_fed_basic_smg_a" }, + { 0x339, "character/character_fed_space_assault_a" }, + { 0x33A, "character/character_fed_space_assault_b" }, + { 0x33B, "character/character_fed_udt_assault_a" }, + { 0x33C, "character/character_hazmat_a" }, + { 0x33D, "character/character_hero_flood_vargas_test" }, + { 0x33E, "character/character_hesh_assault_a" }, + { 0x33F, "character/character_hesh_cornered_b" }, + { 0x340, "character/character_hesh_end_a" }, + { 0x341, "character/character_hesh_end_a_water" }, + { 0x342, "character/character_hesh_end_b" }, + { 0x343, "character/character_hesh_fed_shotgun_a" }, + { 0x344, "character/character_hesh_hostage_ab" }, + { 0x345, "character/character_hesh_ranger_assault_a" }, + { 0x346, "character/character_hesh_ranger_assault_b" }, + { 0x347, "character/character_hesh_stealth_mask_c" }, + { 0x348, "character/character_hesh_stealth_mask_d" }, + { 0x349, "character/character_hesh_udt_assault_a" }, + { 0x34A, "character/character_hesh_young_a" }, + { 0x34B, "character/character_iw6_sp_enemy_dog" }, + { 0x34C, "character/character_iw6_sp_german_shepherd_dog_a" }, + { 0x34D, "character/character_iw6_sp_german_shepherd_dog_b" }, + { 0x34E, "character/character_iw6_sp_german_shepherd_dog_c" }, + { 0x34F, "character/character_keegan_assault_a" }, + { 0x350, "character/character_keegan_end_smg_a" }, + { 0x351, "character/character_keegan_fed_smg_a" }, + { 0x352, "character/character_keegan_udt_assault_a" }, + { 0x353, "character/character_keegan_udt_water_b" }, + { 0x354, "character/character_keegan_wood_sniper_b" }, + { 0x355, "character/character_kick_udt_assault_b" }, + { 0x356, "character/character_kick_udt_water_glowstick" }, + { 0x357, "character/character_kyra_us_space_a" }, + { 0x358, "character/character_merrick_assault_a" }, + { 0x359, "character/character_merrick_assault_b" }, + { 0x35A, "character/character_merrick_assault_c" }, + { 0x35B, "character/character_merrick_end_a" }, + { 0x35C, "character/character_merrick_fed_assault_a" }, + { 0x35D, "character/character_merrick_flood_a" }, + { 0x35E, "character/character_merrick_hostage_a" }, + { 0x35F, "character/character_merrick_udt_assault_b" }, + { 0x360, "character/character_merrick_udt_water_glowstick" }, + { 0x361, "character/character_merrick_wood_smg_c_skull" }, + { 0x362, "character/character_oil_worker" }, + { 0x363, "character/character_oil_worker_bi_foreman" }, + { 0x364, "character/character_oil_worker_mask" }, + { 0x365, "character/character_opforce_henchmen_smg_a" }, + { 0x366, "character/character_opforce_henchmen_smg_b" }, + { 0x367, "character/character_pilot_a" }, + { 0x368, "character/character_pilot_b" }, + { 0x369, "character/character_pilot_b_tan" }, + { 0x36A, "character/character_pilot_c" }, + { 0x36B, "character/character_pilot_c_blue" }, + { 0x36C, "character/character_pilot_c_green" }, + { 0x36D, "character/character_pilot_c_purple" }, + { 0x36E, "character/character_pilot_c_red" }, + { 0x36F, "character/character_ppilot_crew_d" }, + { 0x370, "character/character_ramos_a" }, + { 0x371, "character/character_rorke_assault" }, + { 0x372, "character/character_rorke_basic_a" }, + { 0x373, "character/character_rorke_flood_a" }, + { 0x374, "character/character_scientist_a" }, + { 0x375, "character/character_scientist_b" }, + { 0x376, "character/character_scientist_c" }, + { 0x377, "character/character_scientist_d" }, + { 0x378, "character/character_us_civ_female_yb_a" }, + { 0x379, "character/character_us_civ_female_yb_b" }, + { 0x37A, "character/character_us_civ_male_yb_a" }, + { 0x37B, "character/character_us_civ_male_yb_b" }, + { 0x37C, "character/character_us_rangers_assault_a" }, + { 0x37D, "character/character_us_rangers_assault_a_desert" }, + { 0x37E, "character/character_us_rangers_assault_a_urban" }, + { 0x37F, "character/character_us_rangers_drones" }, + { 0x380, "character/character_us_rangers_lmg_a" }, + { 0x381, "character/character_us_rangers_lmg_a_urban" }, + { 0x382, "character/character_us_rangers_shotgun_a" }, + { 0x383, "character/character_us_rangers_shotgun_a_urban" }, + { 0x384, "character/character_us_rangers_smg_a" }, + { 0x385, "character/character_us_rangers_smg_a_desert" }, + { 0x386, "character/character_us_space_assault_a" }, + { 0x387, "character/character_us_space_assault_b" }, + { 0x388, "character/character_us_space_collins" }, + { 0x389, "character/character_us_space_int_a" }, + { 0x38A, "character/character_us_space_int_b" }, + { 0x38B, "character/character_us_space_int_c" }, + { 0x38C, "character/character_venezuela_army_assault_a" }, + { 0x38D, "character/character_venezuela_army_smg_a" }, + { 0x38E, "character/character_venezuela_army_smg_a_head_d" }, + { 0x38F, "codescripts/character" }, + { 0x390, "codescripts/delete" }, + { 0x391, "codescripts/struct" }, + { 0x392, "common_scripts/_artcommon" }, + { 0x393, "common_scripts/_bcs_location_trigs" }, + { 0x394, "common_scripts/_createfx" }, + { 0x395, "common_scripts/_createfxmenu" }, + { 0x396, "common_scripts/_csplines" }, + { 0x397, "common_scripts/_destructible" }, + { 0x398, "common_scripts/_dynamic_world" }, + { 0x399, "common_scripts/_elevator" }, + { 0x39A, "common_scripts/_exploder" }, + { 0x39B, "common_scripts/_fx" }, + { 0x39C, "common_scripts/_pipes" }, + { 0x39D, "common_scripts/_sentry" }, + { 0x39E, "common_scripts/_wind" }, + { 0x39F, "common_scripts/utility" }, + { 0x3A0, "destructible_scripts/destructible_civilian_sedan_iw6" }, + { 0x3A1, "destructible_scripts/destructible_civilian_sedan_water_iw6" }, + { 0x3A2, "destructible_scripts/destructible_van_water_iw6" }, + { 0x3A3, "destructible_scripts/destructible_vehicle_city_car_water" }, + { 0x3A4, "destructible_scripts/electrical_transformer_large" }, + { 0x3A5, "destructible_scripts/explodable_barrel" }, + { 0x3A6, "destructible_scripts/toy_electricbox2" }, + { 0x3A7, "destructible_scripts/toy_filecabinet" }, + { 0x3A8, "destructible_scripts/toy_generator_on" }, + { 0x3A9, "destructible_scripts/toy_light_ceiling_fluorescent" }, + { 0x3AA, "destructible_scripts/toy_lv_trash_can_vegas" }, + { 0x3AB, "destructible_scripts/toy_sp_panel_box" }, + { 0x3AC, "destructible_scripts/toy_transformer_small01" }, + { 0x3AD, "destructible_scripts/toy_trashcan_metal_closed" }, + { 0x3AE, "destructible_scripts/toy_tv_flatscreen" }, + { 0x3AF, "destructible_scripts/toy_tv_flatscreen_wallmount_02" }, + { 0x3B0, "destructible_scripts/toy_tv_video_monitor" }, + { 0x3B1, "destructible_scripts/toy_usa_gas_station_trash_bin_02" }, + { 0x3B2, "maps/_ambient" }, + { 0x3B3, "maps/_anim" }, + { 0x3B4, "maps/_animatedmodels" }, + { 0x3B5, "maps/_art" }, + { 0x3B6, "maps/_ash_falling" }, + { 0x3B7, "maps/_audio" }, + { 0x3B8, "maps/_audio_ambient" }, + { 0x3B9, "maps/_audio_code" }, + { 0x3BA, "maps/_autosave" }, + { 0x3BB, "maps/_breach" }, + { 0x3BC, "maps/_c4" }, + { 0x3BD, "maps/_chaingun_player" }, + { 0x3BE, "maps/_chopperboss" }, + { 0x3BF, "maps/_chopperboss_utility" }, + { 0x3C0, "maps/_colors" }, + { 0x3C1, "maps/_compass" }, + { 0x3C2, "maps/_coop" }, + { 0x3C3, "maps/_createfx" }, + { 0x3C4, "maps/_credits_iw6" }, + { 0x3C5, "maps/_damagefeedback" }, + { 0x3C6, "maps/_deadbody" }, + { 0x3C7, "maps/_debug" }, + { 0x3C8, "maps/_detonategrenades" }, + { 0x3C9, "maps/_dog_control" }, + { 0x3CA, "maps/_dog_drive" }, + { 0x3CB, "maps/_dog_kinect" }, + { 0x3CC, "maps/_dog_pip" }, + { 0x3CD, "maps/_drone" }, + { 0x3CE, "maps/_drone_ai" }, + { 0x3CF, "maps/_drone_base" }, + { 0x3D0, "maps/_drone_civilian" }, + { 0x3D1, "maps/_drone_deer" }, + { 0x3D2, "maps/_dynamic_run_speed" }, + { 0x3D3, "maps/_endmission" }, + { 0x3D4, "maps/_friendlyfire" }, + { 0x3D5, "maps/_gameskill" }, + { 0x3D6, "maps/_geo_mover" }, + { 0x3D7, "maps/_global_fx" }, + { 0x3D8, "maps/_global_fx_code" }, + { 0x3D9, "maps/_hand_signals" }, + { 0x3DA, "maps/_helicopter_ai" }, + { 0x3DB, "maps/_helicopter_globals" }, + { 0x3DC, "maps/_hud" }, + { 0x3DD, "maps/_hud_util" }, + { 0x3DE, "maps/_idle" }, + { 0x3DF, "maps/_idle_coffee" }, + { 0x3E0, "maps/_idle_lean_smoke" }, + { 0x3E1, "maps/_idle_phone" }, + { 0x3E2, "maps/_idle_sit_load_ak" }, + { 0x3E3, "maps/_idle_sleep" }, + { 0x3E4, "maps/_idle_smoke" }, + { 0x3E5, "maps/_idle_smoke_balcony" }, + { 0x3E6, "maps/_intelligence" }, + { 0x3E7, "maps/_introscreen" }, + { 0x3E8, "maps/_inventory" }, + { 0x3E9, "maps/_lights" }, + { 0x3EA, "maps/_load" }, + { 0x3EB, "maps/_loadout" }, + { 0x3EC, "maps/_loadout_code" }, + { 0x3ED, "maps/_mg_penetration" }, + { 0x3EE, "maps/_mgturret" }, + { 0x3EF, "maps/_minigun" }, + { 0x3F0, "maps/_minigun_viewmodel" }, + { 0x3F1, "maps/_mocap_ar" }, + { 0x3F2, "maps/_mortar" }, + { 0x3F3, "maps/_names" }, + { 0x3F4, "maps/_nightvision" }, + { 0x3F5, "maps/_ocean" }, + { 0x3F6, "maps/_patrol" }, + { 0x3F7, "maps/_patrol_anims" }, + { 0x3F8, "maps/_patrol_anims_creepwalk" }, + { 0x3F9, "maps/_patrol_anims_gundown" }, + { 0x3FA, "maps/_patrol_anims_patroljog" }, + { 0x3FB, "maps/_perlin_noise" }, + { 0x3FC, "maps/_player_death" }, + { 0x3FD, "maps/_player_limp" }, + { 0x3FE, "maps/_player_rig" }, + { 0x3FF, "maps/_player_stats" }, + { 0x400, "maps/_props" }, + { 0x401, "maps/_radiation" }, + { 0x402, "maps/_rambo" }, + { 0x403, "maps/_readystand_anims" }, + { 0x404, "maps/_remoteturret" }, + { 0x405, "maps/_rv_vfx" }, + { 0x406, "maps/_shellshock" }, + { 0x407, "maps/_shg_common" }, + { 0x408, "maps/_slowmo_breach" }, + { 0x409, "maps/_space" }, + { 0x40A, "maps/_space_ai" }, + { 0x40B, "maps/_space_player" }, + { 0x40C, "maps/_spawner" }, + { 0x40D, "maps/_stealth" }, + { 0x40E, "maps/_stealth_accuracy_friendly" }, + { 0x40F, "maps/_stealth_animation_funcs" }, + { 0x410, "maps/_stealth_anims" }, + { 0x411, "maps/_stealth_behavior_enemy" }, + { 0x412, "maps/_stealth_behavior_friendly" }, + { 0x413, "maps/_stealth_behavior_system" }, + { 0x414, "maps/_stealth_color_friendly" }, + { 0x415, "maps/_stealth_corpse_enemy" }, + { 0x416, "maps/_stealth_corpse_system" }, + { 0x417, "maps/_stealth_event_enemy" }, + { 0x418, "maps/_stealth_shared_utilities" }, + { 0x419, "maps/_stealth_smartstance_friendly" }, + { 0x41A, "maps/_stealth_threat_enemy" }, + { 0x41B, "maps/_stealth_utility" }, + { 0x41C, "maps/_stealth_visibility_enemy" }, + { 0x41D, "maps/_stealth_visibility_friendly" }, + { 0x41E, "maps/_stealth_visibility_system" }, + { 0x41F, "maps/_swim_ai" }, + { 0x420, "maps/_swim_ai_common" }, + { 0x421, "maps/_swim_player" }, + { 0x422, "maps/_tank_battlechatter" }, + { 0x423, "maps/_teargas" }, + { 0x424, "maps/_treadfx" }, + { 0x425, "maps/_trigger" }, + { 0x426, "maps/_underwater" }, + { 0x427, "maps/_utility" }, + { 0x428, "maps/_utility_code" }, + { 0x429, "maps/_utility_dogs" }, + { 0x42A, "maps/_vehicle" }, + { 0x42B, "maps/_vehicle_aianim" }, + { 0x42C, "maps/_vehicle_code" }, + { 0x42D, "maps/_vehicle_spline_zodiac" }, + { 0x42E, "maps/_vignette_util" }, + { 0x42F, "maps/_weather" }, + { 0x430, "maps/black_ice_fx" }, + { 0x431, "maps/black_ice_precache" }, + { 0x432, "maps/carrier_fx" }, + { 0x433, "maps/carrier_precache" }, + { 0x434, "maps/clockwork_fx" }, + { 0x435, "maps/clockwork_precache" }, + { 0x436, "maps/cornered_fx" }, + { 0x437, "maps/cornered_precache" }, + { 0x438, "maps/deer_hunt_fx" }, + { 0x439, "maps/deer_hunt_precache" }, + { 0x43A, "maps/enemyhq_fx" }, + { 0x43B, "maps/enemyhq_precache" }, + { 0x43C, "maps/flood_fx" }, + { 0x43D, "maps/flood_precache" }, + { 0x43E, "maps/homecoming_fx" }, + { 0x43F, "maps/homecoming_precache" }, + { 0x440, "maps/iplane_fx" }, + { 0x441, "maps/jungle_ghosts_fx" }, + { 0x442, "maps/jungle_ghosts_precache" }, + { 0x443, "maps/loki_fx" }, + { 0x444, "maps/loki_precache" }, + { 0x445, "maps/nml_fx" }, + { 0x446, "maps/nml_precache" }, + { 0x447, "maps/odin_fx" }, + { 0x448, "maps/odin_precache" }, + { 0x449, "maps/oilrocks_fx" }, + { 0x44A, "maps/oilrocks_precache" }, + { 0x44B, "maps/prologue_fx" }, + { 0x44C, "maps/prologue_precache" }, + { 0x44D, "maps/satfarm_b_fx" }, + { 0x44E, "maps/satfarm_b_precache" }, + { 0x44F, "maps/satfarm_fx" }, + { 0x450, "maps/satfarm_precache" }, + { 0x451, "maps/ship_graveyard_fx" }, + { 0x452, "maps/ship_graveyard_precache" }, + { 0x453, "maps/skyway_fx" }, + { 0x454, "maps/skyway_precache" }, + { 0x455, "maps/youngblood_fx" }, + { 0x456, "maps/youngblood_precache" }, + { 0x457, "vehicle_scripts/_a10_warthog" }, + { 0x458, "vehicle_scripts/_apache" }, + { 0x459, "vehicle_scripts/_apache_player" }, + { 0x45A, "vehicle_scripts/_apache_player_audio" }, + { 0x45B, "vehicle_scripts/_apache_player_difficulty" }, + { 0x45C, "vehicle_scripts/_apache_player_missile_hydra_and_lockon" }, + { 0x45D, "vehicle_scripts/_apache_player_pilot" }, + { 0x45E, "vehicle_scripts/_apache_player_raining_missile" }, + { 0x45F, "vehicle_scripts/_apache_player_targeting" }, + { 0x460, "vehicle_scripts/_attack_heli" }, + { 0x461, "vehicle_scripts/_btr80" }, + { 0x462, "vehicle_scripts/_c17" }, + { 0x463, "vehicle_scripts/_chinese_brave_warrior" }, + { 0x464, "vehicle_scripts/_chopper_ai_missile_defense" }, + { 0x465, "vehicle_scripts/_chopper_missile_defense_utility" }, + { 0x466, "vehicle_scripts/_chopper_player_missile_defense" }, + { 0x467, "vehicle_scripts/_empty" }, + { 0x468, "vehicle_scripts/_f15" }, + { 0x469, "vehicle_scripts/_f18" }, + { 0x46A, "vehicle_scripts/_foliage_tumbleweed_vehicle" }, + { 0x46B, "vehicle_scripts/_gaz" }, + { 0x46C, "vehicle_scripts/_gaz_dshk_oilrocks" }, + { 0x46D, "vehicle_scripts/_gunboat" }, + { 0x46E, "vehicle_scripts/_hind" }, + { 0x46F, "vehicle_scripts/_lcs" }, + { 0x470, "vehicle_scripts/_m1a1_minigun" }, + { 0x471, "vehicle_scripts/_m880_launcher" }, + { 0x472, "vehicle_scripts/_man_7t" }, + { 0x473, "vehicle_scripts/_mig29" }, + { 0x474, "vehicle_scripts/_missile_boat" }, + { 0x475, "vehicle_scripts/_osprey" }, + { 0x476, "vehicle_scripts/_snowmobile" }, + { 0x477, "vehicle_scripts/_snowmobile_friendly" }, + { 0x478, "vehicle_scripts/_soc_r" }, + { 0x479, "vehicle_scripts/_submarine_sdv" }, + { 0x47A, "vehicle_scripts/_tank_crush" }, + { 0x47B, "vehicle_scripts/_zodiac" }, + { 0x47C, "vehicle_scripts/_zpu_antiair" }, + { 0x47D, "vehicle_scripts/_zpu_antiair_oilrocks" }, + { 0x47E, "vehicle_scripts/aas_72x" }, + { 0x47F, "vehicle_scripts/apache" }, + { 0x480, "vehicle_scripts/artemis" }, + { 0x481, "vehicle_scripts/hind" }, + { 0x482, "vehicle_scripts/hind_battle_carrier" }, + { 0x483, "vehicle_scripts/hind_battle_oilrocks" }, + { 0x484, "vehicle_scripts/hovercraft" }, + { 0x485, "vehicle_scripts/iveco_lynx" }, + { 0x486, "vehicle_scripts/iveco_lynx_turret" }, + { 0x487, "vehicle_scripts/m1a2" }, + { 0x488, "vehicle_scripts/m1a2_player" }, + { 0x489, "vehicle_scripts/m800" }, + { 0x48A, "vehicle_scripts/matv" }, + { 0x48B, "vehicle_scripts/mk23" }, + { 0x48C, "vehicle_scripts/nh90" }, + { 0x48D, "vehicle_scripts/pickup_truck_civ" }, + { 0x48E, "vehicle_scripts/sedan_4door" }, + { 0x48F, "vehicle_scripts/silenthawk" }, + { 0x490, "vehicle_scripts/silenthawk_landing" }, + { 0x491, "vehicle_scripts/t90ms" }, + { 0x492, "vehicle_scripts/tatra_t815" }, + { 0x493, "vehicle_scripts/y_8_gunship" }, + { 0x494, "xmodelalias/alias_chemwar_russian_heads" }, + { 0x495, "xmodelalias/alias_elite_pmc_heads" }, + { 0x496, "xmodelalias/alias_fed_army_heads_a" }, + { 0x497, "xmodelalias/alias_fed_army_heads_a_arctic_noshield" }, + { 0x498, "xmodelalias/alias_fed_army_heads_a_nofaceshield" }, + { 0x499, "xmodelalias/alias_fed_army_heads_a_urban" }, + { 0x49A, "xmodelalias/alias_fed_basic_heads" }, + { 0x49B, "xmodelalias/alias_fed_space_assault_heads" }, + { 0x49C, "xmodelalias/alias_fed_udt_heads" }, + { 0x49D, "xmodelalias/alias_henchmen_heads" }, + { 0x49E, "xmodelalias/alias_oil_worker_bodies" }, + { 0x49F, "xmodelalias/alias_oil_worker_heads" }, + { 0x4A0, "xmodelalias/alias_pilot_heads" }, + { 0x4A1, "xmodelalias/alias_pilot_heads_blue" }, + { 0x4A2, "xmodelalias/alias_pilot_heads_green" }, + { 0x4A3, "xmodelalias/alias_pilot_heads_purple" }, + { 0x4A4, "xmodelalias/alias_pilot_heads_red" }, + { 0x4A5, "xmodelalias/alias_pilot_heads_yellow" }, + { 0x4A6, "xmodelalias/alias_russian_military_heads_skyway" }, + { 0x4A7, "xmodelalias/alias_scientist_heads" }, + { 0x4A8, "xmodelalias/alias_us_rangers_drone_bodies" }, + { 0x4A9, "xmodelalias/alias_us_rangers_drone_heads" }, + { 0x4AA, "xmodelalias/alias_us_rangers_heads_a" }, + { 0x4AB, "xmodelalias/alias_us_rangers_heads_a_desert" }, + { 0x4AC, "xmodelalias/alias_us_rangers_heads_a_urban" }, + { 0x4AD, "xmodelalias/alias_us_space_assault_heads" }, + { 0x4AE, "xmodelalias/alias_us_space_int_heads" }, + { 0x4AF, "xmodelalias/alias_venezuela_army_heads" }, + { 0x4B0, "maps/animated_models/accessories_windsock_wind_medium" }, + { 0x4B1, "maps/animated_models/com_roofvent2" }, + { 0x4B2, "maps/animated_models/com_roofvent3" }, + { 0x4B3, "maps/animated_models/flood_palm_tree_tall" }, + { 0x4B4, "maps/animated_models/flood_palm_tree_tall_no_shadow" }, + { 0x4B5, "maps/animated_models/hanging_sheet_wind_medium" }, + { 0x4B6, "maps/animated_models/mp_flooded_water_debris_bob" }, + { 0x4B7, "maps/animated_models/mp_flooded_water_debris_spiral" }, + { 0x4B8, "maps/animated_models/mp_flooded_water_street" }, + { 0x4B9, "maps/animated_models/mp_frag_crane" }, + { 0x4BA, "maps/animated_models/ow_crane_hook" }, + { 0x4BB, "maps/animated_models/tarp_tattered_thin_02" }, + { 0x4BC, "maps/animated_models/tattered_cloth_medium_01" }, + { 0x4BD, "maps/animated_models/tattered_cloth_small_02" }, + { 0x4BE, "maps/createart/black_ice_art" }, + { 0x4BF, "maps/createart/black_ice_fog" }, + { 0x4C0, "maps/createart/carrier_art" }, + { 0x4C1, "maps/createart/carrier_fog" }, + { 0x4C2, "maps/createart/clockwork_art" }, + { 0x4C3, "maps/createart/clockwork_fog" }, + { 0x4C4, "maps/createart/cornered_art" }, + { 0x4C5, "maps/createart/cornered_fog" }, + { 0x4C6, "maps/createart/deer_hunt_art" }, + { 0x4C7, "maps/createart/deer_hunt_fog" }, + { 0x4C8, "maps/createart/enemyhq_art" }, + { 0x4C9, "maps/createart/enemyhq_fog" }, + { 0x4CA, "maps/createart/flood_art" }, + { 0x4CB, "maps/createart/flood_fog" }, + { 0x4CC, "maps/createart/homecoming_art" }, + { 0x4CD, "maps/createart/homecoming_fog" }, + { 0x4CE, "maps/createart/iplane_art" }, + { 0x4CF, "maps/createart/iplane_fog" }, + { 0x4D0, "maps/createart/jungle_ghosts_art" }, + { 0x4D1, "maps/createart/jungle_ghosts_fog" }, + { 0x4D2, "maps/createart/loki_art" }, + { 0x4D3, "maps/createart/loki_fog" }, + { 0x4D4, "maps/createart/mp_alien_town_art" }, + { 0x4D5, "maps/createart/mp_alien_town_fog" }, + { 0x4D6, "maps/createart/mp_chasm_art" }, + { 0x4D7, "maps/createart/mp_chasm_fog" }, + { 0x4D8, "maps/createart/mp_dart_art" }, + { 0x4D9, "maps/createart/mp_dart_fog" }, + { 0x4DA, "maps/createart/mp_fahrenheit_art" }, + { 0x4DB, "maps/createart/mp_fahrenheit_fog" }, + { 0x4DC, "maps/createart/mp_flooded_art" }, + { 0x4DD, "maps/createart/mp_flooded_fog" }, + { 0x4DE, "maps/createart/mp_frag_art" }, + { 0x4DF, "maps/createart/mp_frag_fog" }, + { 0x4E0, "maps/createart/mp_hashima_art" }, + { 0x4E1, "maps/createart/mp_hashima_fog" }, + { 0x4E2, "maps/createart/mp_lonestar_art" }, + { 0x4E3, "maps/createart/mp_lonestar_fog" }, + { 0x4E4, "maps/createart/mp_prisonbreak_art" }, + { 0x4E5, "maps/createart/mp_prisonbreak_fog" }, + { 0x4E6, "maps/createart/mp_siege_buildings_fog" }, + { 0x4E7, "maps/createart/mp_skeleton_art" }, + { 0x4E8, "maps/createart/mp_skeleton_fog" }, + { 0x4E9, "maps/createart/mp_snow_art" }, + { 0x4EA, "maps/createart/mp_snow_fog" }, + { 0x4EB, "maps/createart/mp_sovereign_art" }, + { 0x4EC, "maps/createart/mp_sovereign_fog" }, + { 0x4ED, "maps/createart/mp_strikezone_art" }, + { 0x4EE, "maps/createart/mp_strikezone_fog" }, + { 0x4EF, "maps/createart/mp_warhawk_art" }, + { 0x4F0, "maps/createart/mp_warhawk_fog" }, + { 0x4F1, "maps/createart/mp_zebra_art" }, + { 0x4F2, "maps/createart/mp_zebra_fog" }, + { 0x4F3, "maps/createart/nml_art" }, + { 0x4F4, "maps/createart/nml_fog" }, + { 0x4F5, "maps/createart/odin_art" }, + { 0x4F6, "maps/createart/odin_fog" }, + { 0x4F7, "maps/createart/oilrocks_art" }, + { 0x4F8, "maps/createart/oilrocks_fog" }, + { 0x4F9, "maps/createart/prologue_art" }, + { 0x4FA, "maps/createart/prologue_fog" }, + { 0x4FB, "maps/createart/satfarm_art" }, + { 0x4FC, "maps/createart/satfarm_b_art" }, + { 0x4FD, "maps/createart/satfarm_b_fog" }, + { 0x4FE, "maps/createart/satfarm_fog" }, + { 0x4FF, "maps/createart/ship_graveyard_art" }, + { 0x500, "maps/createart/ship_graveyard_fog" }, + { 0x501, "maps/createart/skyway_art" }, + { 0x502, "maps/createart/skyway_fog" }, + { 0x503, "maps/createart/youngblood_art" }, + { 0x504, "maps/createart/youngblood_fog" }, + { 0x505, "maps/createfx/black_ice_fx" }, + { 0x506, "maps/createfx/black_ice_sound" }, + { 0x507, "maps/createfx/carrier_fx" }, + { 0x508, "maps/createfx/carrier_sound" }, + { 0x509, "maps/createfx/clockwork_fx" }, + { 0x50A, "maps/createfx/clockwork_sound" }, + { 0x50B, "maps/createfx/cornered_fx" }, + { 0x50C, "maps/createfx/cornered_sound" }, + { 0x50D, "maps/createfx/deer_hunt_fx" }, + { 0x50E, "maps/createfx/deer_hunt_sound" }, + { 0x50F, "maps/createfx/enemyhq_fx" }, + { 0x510, "maps/createfx/enemyhq_sound" }, + { 0x511, "maps/createfx/flood_fx" }, + { 0x512, "maps/createfx/flood_sound" }, + { 0x513, "maps/createfx/homecoming_fx" }, + { 0x514, "maps/createfx/homecoming_sound" }, + { 0x515, "maps/createfx/jungle_ghosts_fx" }, + { 0x516, "maps/createfx/jungle_ghosts_sound" }, + { 0x517, "maps/createfx/loki_fx" }, + { 0x518, "maps/createfx/loki_sound" }, + { 0x519, "maps/createfx/mp_alien_town_fx" }, + { 0x51A, "maps/createfx/mp_chasm_fx" }, + { 0x51B, "maps/createfx/mp_dart_fx" }, + { 0x51C, "maps/createfx/mp_fahrenheit_fx" }, + { 0x51D, "maps/createfx/mp_flooded_fx" }, + { 0x51E, "maps/createfx/mp_frag_fx" }, + { 0x51F, "maps/createfx/mp_hashima_fx" }, + { 0x520, "maps/createfx/mp_lonestar_fx" }, + { 0x521, "maps/createfx/mp_prisonbreak_fx" }, + { 0x522, "maps/createfx/mp_skeleton_fx" }, + { 0x523, "maps/createfx/mp_snow_fx" }, + { 0x524, "maps/createfx/mp_sovereign_fx" }, + { 0x525, "maps/createfx/mp_strikezone_fx" }, + { 0x526, "maps/createfx/mp_warhawk_fx" }, + { 0x527, "maps/createfx/mp_zebra_fx" }, + { 0x528, "maps/createfx/nml_fx" }, + { 0x529, "maps/createfx/nml_sound" }, + { 0x52A, "maps/createfx/odin_fx" }, + { 0x52B, "maps/createfx/odin_sound" }, + { 0x52C, "maps/createfx/oilrocks_fx" }, + { 0x52D, "maps/createfx/oilrocks_sound" }, + { 0x52E, "maps/createfx/prologue_fx" }, + { 0x52F, "maps/createfx/prologue_sound" }, + { 0x530, "maps/createfx/satfarm_b_fx" }, + { 0x531, "maps/createfx/satfarm_b_sound" }, + { 0x532, "maps/createfx/satfarm_fx" }, + { 0x533, "maps/createfx/satfarm_sound" }, + { 0x534, "maps/createfx/ship_graveyard_fx" }, + { 0x535, "maps/createfx/ship_graveyard_sound" }, + { 0x536, "maps/createfx/skyway_fx" }, + { 0x537, "maps/createfx/skyway_sound" }, + { 0x538, "maps/createfx/youngblood_fx" }, + { 0x539, "maps/createfx/youngblood_sound" }, + { 0x53A, "maps/interactive_models/_birds" }, + { 0x53B, "maps/interactive_models/_fish" }, + { 0x53C, "maps/interactive_models/_interactive_utility" }, + { 0x53D, "maps/interactive_models/_interactive_utility_sp" }, + { 0x53E, "maps/interactive_models/bldg_01_dest" }, + { 0x53F, "maps/interactive_models/egrets" }, + { 0x540, "maps/interactive_models/fish_bannerfish" }, + { 0x541, "maps/interactive_models/fish_school_sardines" }, + { 0x542, "maps/interactive_models/fish_school_snapper" }, + { 0x543, "maps/interactive_models/oilrig_hanging_jumpsuit" }, + { 0x544, "maps/interactive_models/parakeets" }, + { 0x545, "maps/interactive_models/pigeons" }, + { 0x546, "maps/interactive_models/vulture" }, + { 0x547, "maps/mp/_animatedmodels" }, + { 0x548, "maps/mp/_areas" }, + { 0x549, "maps/mp/_art" }, + { 0x54A, "maps/mp/_audio" }, + { 0x54B, "maps/mp/_awards" }, + { 0x54C, "maps/mp/_breach" }, + { 0x54D, "maps/mp/_compass" }, + { 0x54E, "maps/mp/_createfx" }, + { 0x54F, "maps/mp/_crib" }, + { 0x550, "maps/mp/_defcon" }, + { 0x551, "maps/mp/_destructables" }, + { 0x552, "maps/mp/_elevator" }, + { 0x553, "maps/mp/_empgrenade" }, + { 0x554, "maps/mp/_entityheadicons" }, + { 0x555, "maps/mp/_events" }, + { 0x556, "maps/mp/_flashgrenades" }, + { 0x557, "maps/mp/_fx" }, + { 0x558, "maps/mp/_global_fx" }, + { 0x559, "maps/mp/_global_fx_code" }, + { 0x55A, "maps/mp/_highlights" }, + { 0x55B, "maps/mp/_javelin" }, + { 0x55C, "maps/mp/_laserguidedlauncher" }, + { 0x55D, "maps/mp/_load" }, + { 0x55E, "maps/mp/_matchdata" }, + { 0x55F, "maps/mp/_matchevents" }, + { 0x560, "maps/mp/_menus" }, + { 0x561, "maps/mp/_minefields" }, + { 0x562, "maps/mp/_movable_cover" }, + { 0x563, "maps/mp/_movers" }, + { 0x564, "maps/mp/_radiation" }, + { 0x565, "maps/mp/_scoreboard" }, + { 0x566, "maps/mp/_shutter" }, + { 0x567, "maps/mp/_stinger" }, + { 0x568, "maps/mp/_teleport" }, + { 0x569, "maps/mp/_utility" }, + { 0x56A, "maps/mp/_water" }, + { 0x56B, "maps/mp/_zipline" }, + { 0x56C, "maps/mp/mp_alien_town_fx" }, + { 0x56D, "maps/mp/mp_alien_town_precache" }, + { 0x56E, "maps/mp/mp_chasm_fx" }, + { 0x56F, "maps/mp/mp_chasm_precache" }, + { 0x570, "maps/mp/mp_dart_fx" }, + { 0x571, "maps/mp/mp_dart_precache" }, + { 0x572, "maps/mp/mp_fahrenheit_fx" }, + { 0x573, "maps/mp/mp_fahrenheit_precache" }, + { 0x574, "maps/mp/mp_flooded_fx" }, + { 0x575, "maps/mp/mp_flooded_precache" }, + { 0x576, "maps/mp/mp_frag_fx" }, + { 0x577, "maps/mp/mp_frag_precache" }, + { 0x578, "maps/mp/mp_hashima_fx" }, + { 0x579, "maps/mp/mp_hashima_precache" }, + { 0x57A, "maps/mp/mp_lonestar_fx" }, + { 0x57B, "maps/mp/mp_lonestar_precache" }, + { 0x57C, "maps/mp/mp_prisonbreak_fx" }, + { 0x57D, "maps/mp/mp_prisonbreak_precache" }, + { 0x57E, "maps/mp/mp_skeleton_fx" }, + { 0x57F, "maps/mp/mp_skeleton_precache" }, + { 0x580, "maps/mp/mp_snow_fx" }, + { 0x581, "maps/mp/mp_snow_precache" }, + { 0x582, "maps/mp/mp_sovereign_fx" }, + { 0x583, "maps/mp/mp_sovereign_precache" }, + { 0x584, "maps/mp/mp_strikezone_fx" }, + { 0x585, "maps/mp/mp_strikezone_precache" }, + { 0x586, "maps/mp/mp_warhawk_fx" }, + { 0x587, "maps/mp/mp_warhawk_precache" }, + { 0x588, "maps/mp/mp_zebra_fx" }, + { 0x589, "maps/mp/mp_zebra_precache" }, + { 0x58A, "maps/mp/alien/_achievement" }, + { 0x58B, "maps/mp/alien/_airdrop" }, + { 0x58C, "maps/mp/alien/_alien_fx" }, + { 0x58D, "maps/mp/alien/_autosentry_alien" }, + { 0x58E, "maps/mp/alien/_unk1422" }, + { 0x58F, "maps/mp/alien/_challenge_function" }, + { 0x590, "maps/mp/alien/_collectibles" }, + { 0x591, "maps/mp/alien/_combat_resources" }, + { 0x592, "maps/mp/alien/_damage" }, + { 0x593, "maps/mp/alien/_death" }, + { 0x594, "maps/mp/alien/_debug" }, + { 0x595, "maps/mp/alien/_deployablebox" }, + { 0x596, "maps/mp/alien/_deployablebox_adrenalinebox" }, + { 0x597, "maps/mp/alien/_deployablebox_ammo" }, + { 0x598, "maps/mp/alien/_deployablebox_currency" }, + { 0x599, "maps/mp/alien/_deployablebox_explosives" }, + { 0x59A, "maps/mp/alien/_deployablebox_juicebox" }, + { 0x59B, "maps/mp/alien/_deployablebox_randombox" }, + { 0x59C, "maps/mp/alien/_deployablebox_specialammo" }, + { 0x59D, "maps/mp/alien/_deployablebox_specialammo_ap" }, + { 0x59E, "maps/mp/alien/_deployablebox_specialammo_explo" }, + { 0x59F, "maps/mp/alien/_unk1439" }, + { 0x5A0, "maps/mp/alien/_deployablebox_vest" }, + { 0x5A1, "maps/mp/alien/_director" }, + { 0x5A2, "maps/mp/alien/_drill" }, + { 0x5A3, "maps/mp/alien/_unk1443" }, + { 0x5A4, "maps/mp/alien/_globallogic" }, + { 0x5A5, "maps/mp/alien/_hud" }, + { 0x5A6, "maps/mp/alien/_intro_sequence" }, + { 0x5A7, "maps/mp/alien/_lasedstrike_alien" }, + { 0x5A8, "maps/mp/alien/_laststand" }, + { 0x5A9, "maps/mp/alien/_music_and_dialog" }, + { 0x5AA, "maps/mp/alien/_nuke" }, + { 0x5AB, "maps/mp/alien/_outline_proto" }, + { 0x5AC, "maps/mp/alien/_perk_utility" }, + { 0x5AD, "maps/mp/alien/_perkfunctions" }, + { 0x5AE, "maps/mp/alien/_perks" }, + { 0x5AF, "maps/mp/alien/_persistence" }, + { 0x5B0, "maps/mp/alien/_pillage" }, + { 0x5B1, "maps/mp/alien/_prestige" }, + { 0x5B2, "maps/mp/alien/_progression" }, + { 0x5B3, "maps/mp/alien/_spawn_director" }, + { 0x5B4, "maps/mp/alien/_spawnlogic" }, + { 0x5B5, "maps/mp/alien/_switchblade_alien" }, + { 0x5B6, "maps/mp/alien/_trap" }, + { 0x5B7, "maps/mp/alien/_unlock" }, + { 0x5B8, "maps/mp/alien/_unk1464" }, + { 0x5B9, "maps/mp/gametypes/_battlebuddy" }, + { 0x5BA, "maps/mp/gametypes/_battlechatter_mp" }, + { 0x5BB, "maps/mp/gametypes/_callbacksetup" }, + { 0x5BC, "maps/mp/gametypes/_class" }, + { 0x5BD, "maps/mp/gametypes/_clientids" }, + { 0x5BE, "maps/mp/gametypes/_damage" }, + { 0x5BF, "maps/mp/gametypes/_damagefeedback" }, + { 0x5C0, "maps/mp/gametypes/_deathicons" }, + { 0x5C1, "maps/mp/gametypes/_dev" }, + { 0x5C2, "maps/mp/gametypes/_door" }, + { 0x5C3, "maps/mp/gametypes/_friendicons" }, + { 0x5C4, "maps/mp/gametypes/_gamelogic" }, + { 0x5C5, "maps/mp/gametypes/_gameobjects" }, + { 0x5C6, "maps/mp/gametypes/_gamescore" }, + { 0x5C7, "maps/mp/gametypes/_globalentities" }, + { 0x5C8, "maps/mp/gametypes/_globallogic" }, + { 0x5C9, "maps/mp/gametypes/_hardpoints" }, + { 0x5CA, "maps/mp/gametypes/_healthoverlay" }, + { 0x5CB, "maps/mp/gametypes/_horde_crates" }, + { 0x5CC, "maps/mp/gametypes/_horde_laststand" }, + { 0x5CD, "maps/mp/gametypes/_horde_util" }, + { 0x5CE, "maps/mp/gametypes/_hostmigration" }, + { 0x5CF, "maps/mp/gametypes/_hud" }, + { 0x5D0, "maps/mp/gametypes/_hud_message" }, + { 0x5D1, "maps/mp/gametypes/_hud_util" }, + { 0x5D2, "maps/mp/gametypes/_intel" }, + { 0x5D3, "maps/mp/gametypes/_intelchallenges" }, + { 0x5D4, "maps/mp/gametypes/_killcam" }, + { 0x5D5, "maps/mp/gametypes/_menus" }, + { 0x5D6, "maps/mp/gametypes/_missions" }, + { 0x5D7, "maps/mp/gametypes/_music_and_dialog" }, + { 0x5D8, "maps/mp/gametypes/_objpoints" }, + { 0x5D9, "maps/mp/gametypes/_outline" }, + { 0x5DA, "maps/mp/gametypes/_persistence" }, + { 0x5DB, "maps/mp/gametypes/_playercards" }, + { 0x5DC, "maps/mp/gametypes/_playerlogic" }, + { 0x5DD, "maps/mp/gametypes/_rank" }, + { 0x5DE, "maps/mp/gametypes/_serversettings" }, + { 0x5DF, "maps/mp/gametypes/_shellshock" }, + { 0x5E0, "maps/mp/gametypes/_spawnfactor" }, + { 0x5E1, "maps/mp/gametypes/_spawnlogic" }, + { 0x5E2, "maps/mp/gametypes/_spawnscoring" }, + { 0x5E3, "maps/mp/gametypes/_spectating" }, + { 0x5E4, "maps/mp/gametypes/_teams" }, + { 0x5E5, "maps/mp/gametypes/_trophy_system" }, + { 0x5E6, "maps/mp/gametypes/_tweakables" }, + { 0x5E7, "maps/mp/gametypes/_weapons" }, + { 0x5E8, "maps/mp/killstreaks/_a10" }, + { 0x5E9, "maps/mp/killstreaks/_unk1513" }, + { 0x5EA, "maps/mp/killstreaks/_aamissile" }, + { 0x5EB, "maps/mp/killstreaks/_unk1515" }, + { 0x5EC, "maps/mp/killstreaks/_ac130" }, + { 0x5ED, "maps/mp/killstreaks/_agent_killstreak" }, + { 0x5EE, "maps/mp/killstreaks/_air_superiority" }, + { 0x5EF, "maps/mp/killstreaks/_airdrop" }, + { 0x5F0, "maps/mp/killstreaks/_airstrike" }, + { 0x5F1, "maps/mp/killstreaks/_autosentry" }, + { 0x5F2, "maps/mp/killstreaks/_autoshotgun" }, + { 0x5F3, "maps/mp/killstreaks/_unk1523" }, + { 0x5F4, "maps/mp/killstreaks/_deployablebox" }, + { 0x5F5, "maps/mp/killstreaks/_deployablebox_ammo" }, + { 0x5F6, "maps/mp/killstreaks/_deployablebox_grenades" }, + { 0x5F7, "maps/mp/killstreaks/_deployablebox_gun" }, + { 0x5F8, "maps/mp/killstreaks/_deployablebox_juicebox" }, + { 0x5F9, "maps/mp/killstreaks/_deployablebox_vest" }, + { 0x5FA, "maps/mp/killstreaks/_designator_grenade" }, + { 0x5FB, "maps/mp/killstreaks/_dog_killstreak" }, + { 0x5FC, "maps/mp/killstreaks/_dronehive" }, + { 0x5FD, "maps/mp/killstreaks/_emp" }, + { 0x5FE, "maps/mp/killstreaks/_unk1534" }, + { 0x5FF, "maps/mp/killstreaks/_escortairdrop" }, + { 0x600, "maps/mp/killstreaks/_flares" }, + { 0x601, "maps/mp/killstreaks/_gas_airstrike" }, + { 0x602, "maps/mp/killstreaks/_harrier" }, + { 0x603, "maps/mp/killstreaks/_helicopter" }, + { 0x604, "maps/mp/killstreaks/_helicopter_flock" }, + { 0x605, "maps/mp/killstreaks/_helicopter_guard" }, + { 0x606, "maps/mp/killstreaks/_helicopter_pilot" }, + { 0x607, "maps/mp/killstreaks/_helisniper" }, + { 0x608, "maps/mp/killstreaks/_unk1544" }, + { 0x609, "maps/mp/killstreaks/_ims" }, + { 0x60A, "maps/mp/killstreaks/_jammer" }, + { 0x60B, "maps/mp/killstreaks/_juggernaut" }, + { 0x60C, "maps/mp/killstreaks/_killstreaks" }, + { 0x60D, "maps/mp/killstreaks/_killstreaks_init" }, + { 0x60E, "maps/mp/killstreaks/_lasedstrike" }, + { 0x60F, "maps/mp/killstreaks/_mobilemortar" }, + { 0x610, "maps/mp/killstreaks/_mrsiartillery" }, + { 0x611, "maps/mp/killstreaks/_nuke" }, + { 0x612, "maps/mp/killstreaks/_odin" }, + { 0x613, "maps/mp/killstreaks/_perkstreaks" }, + { 0x614, "maps/mp/killstreaks/_unk1556" }, + { 0x615, "maps/mp/killstreaks/_placeable_barrier" }, + { 0x616, "maps/mp/killstreaks/_plane" }, + { 0x617, "maps/mp/killstreaks/_portableaoegenerator" }, + { 0x618, "maps/mp/killstreaks/_remotemissile" }, + { 0x619, "maps/mp/killstreaks/_unk1561" }, + { 0x61A, "maps/mp/killstreaks/_remotetank" }, + { 0x61B, "maps/mp/killstreaks/_remoteturret" }, + { 0x61C, "maps/mp/killstreaks/_remoteuav" }, + { 0x61D, "maps/mp/killstreaks/_tank" }, + { 0x61E, "maps/mp/killstreaks/_teamammorefill" }, + { 0x61F, "maps/mp/killstreaks/_uav" }, + { 0x620, "maps/mp/killstreaks/_uplink" }, + { 0x621, "maps/mp/killstreaks/_vanguard" }, + { 0x622, "maps/mp/perks/_abilities" }, + { 0x623, "maps/mp/perks/_perkfunctions" }, + { 0x624, "maps/mp/perks/_perks" }, +// onslaugh dlc + { 0x8EFB, "destructible_scripts/toy_wall_fan" }, + { 36604, "destructible_scripts/vehicle_pickup" }, + { 36605, "maps/createart/mp_alien_armory_art" }, + { 36606, "maps/createart/mp_alien_armory_fog" }, + { 36607, "maps/createart/mp_boneyard_ns_art" }, + { 36608, "maps/createart/mp_boneyard_ns_fog" }, + { 36609, "maps/createart/mp_ca_red_river_art" }, + { 36610, "maps/createart/mp_ca_red_river_fog" }, + { 36611, "maps/createart/mp_ca_rumble_art" }, + { 36612, "maps/createart/mp_ca_rumble_fog" }, + { 36613, "maps/createart/mp_swamp_art" }, + { 36614, "maps/createart/mp_swamp_fog" }, + { 36615, "maps/cretaefx/mp_alien_armory_fx" }, + { 36616, "maps/createfx/mp_boneyard_ns_fx" }, + { 36617, "maps/createfx/mp_ca_red_river_fx" }, + { 36618, "maps/createfx/mp_ca_rumble_fx" }, + { 36619, "maps/createfx/mp_swamp_fx" }, + // { 36620, "maps/mp/dlc_unk" }, + { 36621, "maps/mp/mp_alien_armory_fx" }, + { 36622, "maps/mp/mp_alien_armory_precache" }, + { 36623, "maps/mp/mp_boneyard_ns_fx" }, + { 36624, "maps/mp/mp_boneyard_ns_precache" }, + { 36625, "maps/mp/mp_ca_red_river_fx" }, + { 36626, "maps/mp/mp_ca_red_river_precache" }, + { 36627, "maps/mp/mp_ca_rumble_fx" }, + { 36628, "maps/mp/mp_ca_rumble_precache" }, + { 36629, "maps/mp/mp_swamp_fx" }, + { 36630, "maps/mp/mp_swamp_precache" }, + // 36631-44, effects? +}}; + +const std::array token_list +{{ + //OPAQUE_STRING_VOID = 0x0, + //OPAQUE_STRING_PL = 0x1, + //OPAQUE_STRING_MINUS = 0x2, + //OPAQUE_STRING_RADIUS_TYPO = 0x3, + //OPAQUE_STRING_NOTE_COLON = 0x4, + { 0x5, "_" }, + { 0x6, "_custom" }, + { 0x7, "accuracy" }, + { 0x8, "actionslot1" }, + { 0x9, "actionslot2" }, + { 0xA, "actionslot3" }, + { 0xB, "actionslot4" }, + { 0xC, "actionslot5" }, + { 0xD, "actionslot6" }, + { 0xE, "actionslot7" }, + { 0xF, "activator" }, + { 0x10, "active" }, + { 0x11, "activevisionset" }, + { 0x12, "activevisionsetduration" }, + { 0x13, "agent" }, + { 0x14, "agenthealth" }, + { 0x15, "agentname" }, + { 0x16, "agentteam" }, + { 0x17, "ai_event" }, + { 0x18, "ai_sight_line_cycle_group" }, + { 0x19, "ai_sight_line_group" }, + { 0x1A, "aim_highest_bone" }, + { 0x1B, "aim_vis_bone" }, + { 0x1C, "alert" }, + { 0x1D, "alertlevel" }, + { 0x1E, "alertlevelint" }, + { 0x1F, "alien" }, + { 0x20, "alignx" }, + { 0x21, "aligny" }, + { 0x22, "all" }, + { 0x23, "allies" }, + { 0x24, "allowdeath" }, + { 0x25, "allowjump" }, + { 0x26, "allowladders" }, + { 0x27, "allowpain" }, + { 0x28, "alpha" }, + { 0x29, "altmode" }, + { 0x2A, "always" }, + { 0x2B, "ambush" }, + { 0x2C, "ambush_nodes_only" }, + { 0x2D, "angle_deltas" }, + { 0x2E, "anglelerprate" }, + { 0x2F, "angles" }, + { 0x30, "anim_angle_delta" }, + { 0x31, "anim_deltas" }, + { 0x32, "anim_pose" }, + { 0x33, "anim_will_finish" }, + { 0x34, "animscript" }, + { 0x35, "archived" }, + { 0x36, "archivetime" }, + { 0x37, "asleep" }, + { 0x38, "aspectratio" }, + { 0x39, "assists" }, + { 0x3A, "attackeraccuracy" }, + { 0x3B, "attackercount" }, + { 0x3C, "auto_ai" }, + { 0x3D, "auto_change" }, + { 0x3E, "auto_nonai" }, + { 0x3F, "axis" }, + { 0x40, "back" }, + { 0x41, "back_left" }, + { 0x42, "back_low" }, + { 0x43, "back_mid" }, + { 0x44, "back_right" }, + { 0x45, "back_up" }, + { 0x46, "bad_guys" }, + { 0x47, "bad_path" }, + { 0x48, "badplaceawareness" }, + { 0x49, "begin" }, + { 0x4A, "begin_custom_anim" }, + { 0x4B, "begin_firing" }, + { 0x4C, "begin_firing_left" }, + { 0x4D, "bipods" }, + { 0x4E, "birthtime" }, + { 0x4F, "blade_hide" }, + { 0x50, "blade_show" }, + { 0x51, "blockfriendlies" }, + { 0x52, "blurradius" }, + { 0x53, "body_animate_jnt" }, + { 0x54, "bullet_hitshield" }, + { 0x55, "bullethit" }, + { 0x56, "bulletwhizby" }, + { 0x57, "call_vote" }, + { 0x58, "cancel_location" }, + { 0x59, "canclimbladders" }, + { 0x5A, "chainfallback" }, + { 0x5B, "chainnode" }, + { 0x5C, "chest" }, + { 0x5D, "chyron_message1" }, + { 0x5E, "chyron_message2" }, + { 0x5F, "chyron_message3" }, + { 0x60, "civilian" }, + { 0x61, "classname" }, + { 0x62, "clipdistance" }, + { 0x63, "code_classname" }, + { 0x64, "code_damageradius" }, + { 0x65, "code_move" }, + { 0x66, "code_move_slide" }, + { 0x67, "color" }, + { 0x68, "color_blind_toggled" }, + { 0x69, "combat" }, + { 0x6A, "combatmode" }, + { 0x6B, "confirm_location" }, + { 0x6C, "constrained" }, + { 0x6D, "contact" }, + { 0x6E, "contextleanenabled" }, + { 0x6F, "count" }, + { 0x70, "cover" }, + { 0x71, "cover_approach" }, + { 0x72, "coversearchinterval" }, + { 0x73, "criticalbulletdamagedist" }, + { 0x74, "crouch" }, + { 0x75, "current" }, + { 0x76, "custom_attach_00" }, + { 0x77, "custom_attach_01" }, + { 0x78, "custom_attach_02" }, + { 0x79, "custom_attach_03" }, + { 0x7A, "custom_attach_04" }, + { 0x7B, "custom_attach_05" }, + { 0x7C, "custom_attach_06" }, + { 0x7D, "custom_attach_07" }, + { 0x7E, "custom_attach_08" }, + { 0x7F, "custom_attach_09" }, + { 0x80, "custom_attach_10" }, + { 0x81, "custom_attach_11" }, + { 0x82, "custom_attach_12" }, + { 0x83, "custom_attach_13" }, + { 0x84, "custom_attach_14" }, + { 0x85, "custom_attach_15" }, + { 0x86, "damage" }, + { 0x87, "damage_notdone" }, + { 0x88, "damagedir" }, + { 0x89, "damagelocation" }, + { 0x8A, "damagemod" }, + { 0x8B, "damagemultiplier" }, + { 0x8C, "damageshield" }, + { 0x8D, "damagetaken" }, + { 0x8E, "damageweapon" }, + { 0x8F, "damageyaw" }, + { 0x90, "dangerreactduration" }, + { 0x91, "dead" }, + { 0x92, "death" }, + { 0x93, "deathinvulnerabletime" }, + { 0x94, "deathplant" }, + { 0x95, "deaths" }, + { 0x96, "deathshield" }, + { 0x97, "delayeddeath" }, + { 0x98, "desiredangle" }, + { 0x99, "detonate" }, + { 0x9A, "diequietly" }, + { 0x9B, "direct" }, + { 0x9C, "disableplayeradsloscheck" }, + { 0x9D, "dlight" }, + { 0x9E, "dmg" }, + { 0x9F, "dodamagetoall" }, + { 0xA0, "dodangerreact" }, + { 0xA1, "doffar" }, + { 0xA2, "dofnear" }, + { 0xA3, "dog" }, + { 0xA4, "doghandler" }, + { 0xA5, "doingambush" }, + { 0xA6, "done" }, + { 0xA7, "dontavoidplayer" }, + { 0xA8, "down" }, + { 0xA9, "downaimlimit" }, + { 0xAA, "drawoncompass" }, + { 0xAB, "dropweapon" }, + { 0xAC, "empty" }, + { 0xAD, "empty_offhand" }, + { 0xAE, "enable" }, + { 0xAF, "enableshadows" }, + { 0xB0, "end_firing" }, + { 0xB1, "end_firing_left" }, + { 0xB2, "enemy" }, + { 0xB3, "enemy_sighted" }, + { 0xB4, "enemy_sighted_lost" }, + { 0xB5, "enemy_visible" }, + { 0xB6, "engagemaxdist" }, + { 0xB7, "engagemaxfalloffdist" }, + { 0xB8, "engagemindist" }, + { 0xB9, "engageminfalloffdist" }, + { 0xBA, "entity" }, + { 0xBB, "exclusive" }, + { 0xBC, "explode" }, + { 0xBD, "exposedduration" }, + { 0xBE, "extrascore0" }, + { 0xBF, "extrascore1" }, + { 0xC0, "playercardpatch" }, + { 0xC1, "playercardpatchbacking" }, + { 0xC2, "playercardbackground" }, + { 0xC3, "face_angle" }, + { 0xC4, "face_angle_3d" }, + { 0xC5, "face_angle_abs" }, + { 0xC6, "face_angle_rel" }, + { 0xC7, "face_current" }, + { 0xC8, "face_default" }, + { 0xC9, "face_direction" }, + { 0xCA, "face_enemy" }, + { 0xCB, "face_enemy_or_motion" }, + { 0xCC, "face_goal" }, + { 0xCD, "face_motion" }, + { 0xCE, "face_point" }, + { 0xCF, "facemotion" }, + { 0xD0, "failed" }, + { 0xD1, "falling" }, + { 0xD2, "fast_radar" }, + { 0xD3, "favoriteenemy" }, + { 0xD4, "finalaccuracy" }, + { 0xD5, "first_person" }, + { 0xD6, "fixednode" }, + { 0xD7, "fixednodesaferadius" }, + { 0xD8, "flash" }, + { 0xD9, "flashbang" }, + { 0xDA, "follow" }, + { 0xDB, "followmax" }, + { 0xDC, "followmin" }, + { 0xDD, "font" }, + { 0xDE, "fontscale" }, + { 0xDF, "footstepdetectdist" }, + { 0xE0, "footstepdetectdistsprint" }, + { 0xE1, "footstepdetectdistwalk" }, + { 0xE2, "forceragdollimmediate" }, + { 0xE3, "forcespectatorclient" }, + { 0xE4, "foregrip_off" }, + { 0xE5, "foreground" }, + { 0xE6, "forward" }, + { 0xE7, "fov" }, + { 0xE8, "fovcosine" }, + { 0xE9, "fovcosinebusy" }, + { 0xEA, "fraction" }, + { 0xEB, "frag" }, + { 0xEC, "free" }, + { 0xED, "freecamera" }, + { 0xEE, "freelook" }, + { 0xEF, "front_left" }, + { 0xF0, "front_right" }, + { 0xF1, "frontshieldanglecos" }, + { 0xF2, "game_extrainfo" }, + { 0xF3, "glass_destroyed" }, + { 0xF4, "glowalpha" }, + { 0xF5, "glowcolor" }, + { 0xF6, "goal" }, + { 0xF7, "goal_changed" }, + { 0xF8, "goal_reached" }, + { 0xF9, "goal_yaw" }, + { 0xFA, "goalheight" }, + { 0xFB, "goalpos" }, + { 0xFC, "goalradius" }, + { 0xFD, "goingtoruntopos" }, + { 0xFE, "gravity" }, + { 0xFF, "grenade" }, + { 0x100, "grenade_fire" }, + { 0x101, "grenade_pullback" }, + { 0x102, "grenade_return_hand_tag" }, + { 0x103, "grenadeammo" }, + { 0x104, "grenadeawareness" }, + { 0x105, "grenadedanger" }, + { 0x106, "grenadeweapon" }, + { 0x107, "groundEntChanged" }, + { 0x108, "groundtype" }, + { 0x109, "gunblockedbywall" }, + { 0x10A, "gunshot" }, + { 0x10B, "gunshot_teammate" }, + { 0x10C, "hasradar" }, + { 0x10D, "headicon" }, + { 0x10E, "headiconteam" }, + { 0x10F, "health" }, + { 0x110, "height" }, + { 0x111, "showinkillcam" }, + { 0x112, "hidein3rdperson" }, + { 0x113, "hidewhendead" }, + { 0x114, "hidewhenindemo" }, + { 0x115, "enablehudlighting" }, + { 0x116, "hidewheninmenu" }, + { 0x117, "high_priority" }, + { 0x118, "highlyawareradius" }, + { 0x119, "hindlegstraceoffset" }, + { 0x11A, "hit_by_missile" }, + { 0x11B, "horzalign" }, + { 0x11C, "host_sucks_end_game" }, + { 0x11D, "human" }, + { 0x11E, "ignoreall" }, + { 0x11F, "ignoreclosefoliage" }, + { 0x120, "ignoreexplosionevents" }, + { 0x121, "ignoreforfixednodesafecheck" }, + { 0x122, "ignoreme" }, + { 0x123, "ignorerandombulletdamage" }, + { 0x124, "ignoresuppression" }, + { 0x125, "ignoretriggers" }, + { 0x126, "infinite_energy" }, + { 0x127, "info_notnull" }, + { 0x128, "info_player_start" }, + { 0x129, "insolid" }, + { 0x12A, "intermission" }, + { 0x12B, "interval" }, + { 0x12C, "invisible" }, + { 0x12D, "ironsight_off" }, + { 0x12E, "ironsight_on" }, + { 0x12F, "isradarblocked" }, + { 0x130, "item" }, + { 0x131, "j_eyeball_le" }, + { 0x132, "j_eyeball_ri" }, + { 0x133, "j_head" }, + { 0x134, "j_left_elbow" }, + { 0x135, "j_left_hand" }, + { 0x136, "j_left_shoulder" }, + { 0x137, "j_mainroot" }, + { 0x138, "j_neck" }, + { 0x139, "j_spine4" }, + { 0x13A, "j_spinelower" }, + { 0x13B, "j_spineupper" }, + { 0x13C, "jumpcost" }, + { 0x13D, "jumping" }, + { 0x13E, "keepclaimednode" }, + { 0x13F, "keepclaimednodeifvalid" }, + { 0x140, "keepnodeduringscriptedanim" }, + { 0x141, "key1" }, + { 0x142, "key2" }, + { 0x143, "killanimscript" }, + { 0x144, "killcamentity" }, + { 0x145, "killcamentitylookat" }, + { 0x146, "kills" }, + { 0x147, "known_event" }, + { 0x148, "label" }, + { 0x149, "ladder_down" }, + { 0x14A, "ladder_up" }, + { 0x14B, "land" }, + { 0x14C, "lastattacker" }, + { 0x14D, "lastenemysightpos" }, + { 0x14E, "laststand" }, + { 0x14F, "leanamount" }, + { 0x150, "ledge" }, + { 0x151, "left" }, + { 0x152, "leftaimlimit" }, + { 0x153, "light" }, + { 0x154, "lockorientation" }, + { 0x155, "lod" }, + { 0x156, "look" }, + { 0x157, "lookahead" }, + { 0x158, "lookaheaddir" }, + { 0x159, "lookaheaddist" }, + { 0x15A, "lookaheadhitsstairs" }, + { 0x15B, "lookforward" }, + { 0x15C, "lookright" }, + { 0x15D, "looktarget" }, + { 0x15E, "lookup" }, + { 0x15F, "low_priority" }, + { 0x160, "lowresbackground" }, + { 0x161, "luinotifyserver" }, + { 0x162, "mag_eject" }, + { 0x163, "mag_eject_left" }, + { 0x164, "manual" }, + { 0x165, "manual_ai" }, + { 0x166, "manual_change" }, + { 0x167, "max_time" }, + { 0x168, "maxfaceenemydist" }, + { 0x169, "maxhealth" }, + { 0x16A, "maxsightdistsqrd" }, + { 0x16B, "maxvisibledist" }, + { 0x16C, "meleeattackdist" }, + { 0x16D, "menuresponse" }, + { 0x16E, "middle_left" }, + { 0x16F, "middle_right" }, + { 0x170, "min_energy" }, + { 0x171, "min_time" }, + { 0x172, "minpaindamage" }, + { 0x173, "minusedistsq" }, + { 0x174, "missile_fire" }, + { 0x175, "missile_stuck" }, + { 0x176, "mod_crush" }, + { 0x177, "mod_explosive" }, + { 0x178, "mod_explosive_bullet" }, + { 0x179, "mod_falling" }, + { 0x17A, "mod_grenade" }, + { 0x17B, "mod_grenade_splash" }, + { 0x17C, "mod_head_shot" }, + { 0x17D, "mod_impact" }, + { 0x17E, "mod_melee" }, + { 0x17F, "mod_melee_alien" }, + { 0x180, "mod_melee_dog" }, + { 0x181, "mod_pistol_bullet" }, + { 0x182, "mod_projectile" }, + { 0x183, "mod_projectile_splash" }, + { 0x184, "mod_rifle_bullet" }, + { 0x185, "mod_suicide" }, + { 0x186, "mod_trigger_hurt" }, + { 0x187, "mod_unknown" }, + { 0x188, "model" }, + { 0x189, "motiontrackerenabled" }, + { 0x18A, "movedone" }, + { 0x18B, "movemode" }, + { 0x18C, "name" }, + { 0x18D, "near_goal" }, + { 0x18E, "nearz" }, + { 0x18F, "neutral" }, + { 0x190, "never" }, + { 0x191, "newenemyreactiondistsq" }, + { 0x192, "night_vision_off" }, + { 0x193, "night_vision_on" }, + { 0x194, "no_cover" }, + { 0x195, "no_gravity" }, + { 0x196, "noattackeraccuracymod" }, + { 0x197, "noclip" }, + { 0x198, "node" }, + { 0x199, "node_not_safe" }, + { 0x19A, "node_out_of_range" }, + { 0x19B, "node_relinquished" }, + { 0x19C, "node_taken" }, + { 0x19D, "nodeoffsetpos" }, + { 0x19E, "nododgemove" }, + { 0x19F, "nogravity" }, + { 0x1A0, "nogrenadereturnthrow" }, + { 0x1A1, "noncombat" }, + { 0x1A2, "none" }, + { 0x1A3, "nophysics" }, + { 0x1A4, "normal" }, + { 0x1A5, "normal_radar" }, + { 0x1A6, "notinsolid" }, + { 0x1A7, "obstacle" }, + { 0x1A8, "offhand" }, + { 0x1A9, "offhand_end" }, + { 0x1AA, "only_sky" }, + { 0x1AB, "onlygoodnearestnodes" }, + { 0x1AC, "oriented" }, + { 0x1AD, "orientto_complete" }, + { 0x1AE, "origin" }, + { 0x1AF, "other" }, + { 0x1B0, "over" }, + { 0x1B1, "owner" }, + { 0x1B2, "pacifist" }, + { 0x1B3, "pacifistwait" }, + { 0x1B4, "pain" }, + { 0x1B5, "parentindex" }, + { 0x1B6, "parentname" }, + { 0x1B7, "path_blocked" }, + { 0x1B8, "path_changed" }, + { 0x1B9, "path_dir_change" }, + { 0x1BA, "path_enemy" }, + { 0x1BB, "path_need_dodge" }, + { 0x1BC, "path_set" }, + { 0x1BD, "pathenemyfightdist" }, + { 0x1BE, "pathenemylookahead" }, + { 0x1BF, "pathgoalpos" }, + { 0x1C0, "pathrandompercent" }, + { 0x1C1, "pelvis" }, + { 0x1C2, "pers" }, + { 0x1C3, "physics_finished" }, + { 0x1C4, "pickup" }, + { 0x1C5, "pistol" }, + { 0x1C6, "pitchamount" }, + { 0x1C7, "plane_waypoint" }, + { 0x1C8, "player" }, + { 0x1C9, "player_pushed" }, + { 0x1CA, "playername" }, + { 0x1CB, "playing" }, + { 0x1CC, "position" }, + { 0x1CD, "predicted_projectile_impact" }, + { 0x1CE, "prevanimdelta" }, + { 0x1CF, "prevnode" }, + { 0x1D0, "prevscript" }, + { 0x1D1, "primary" }, + { 0x1D2, "primaryoffhand" }, + { 0x1D3, "projectile_impact" }, + { 0x1D4, "prone" }, + { 0x1D5, "proneok" }, + { 0x1D6, "providecoveringfire" }, + { 0x1D7, "psoffsettime" }, + { 0x1D8, "pushable" }, + { 0x1D9, "radarmode" }, + { 0x1DA, "radarshowenemydirection" }, + { 0x1DB, "radarstrength" }, + { 0x1DC, "radius" }, + { 0x1DD, "ragdoll_early_result" }, + { 0x1DE, "reached_end_node" }, + { 0x1DF, "reached_wait_node" }, + { 0x1E0, "reached_wait_speed" }, + { 0x1E1, "reactiontargetpos" }, + { 0x1E2, "receiver" }, + { 0x1E3, "relativedir" }, + { 0x1E4, "reload" }, + { 0x1E5, "reload_start" }, + { 0x1E6, "rendertotexture" }, + { 0x1E7, "requestarrivalnotify" }, + { 0x1E8, "result" }, + { 0x1E9, "return_pitch" }, + { 0x1EA, "reverse" }, + { 0x1EB, "right" }, + { 0x1EC, "rightaimlimit" }, + { 0x1ED, "riotshield_damaged" }, + { 0x1EE, "rocket" }, + { 0x1EF, "rotatedone" }, + { 0x1F0, "run" }, + { 0x1F1, "runcost" }, + { 0x1F2, "runto_arrived" }, + { 0x1F3, "safetochangescript" }, + { 0x1F4, "scavenger" }, + { 0x1F5, "score" }, + { 0x1F6, "script" }, + { 0x1F7, "script_brushmodel" }, + { 0x1F8, "script_linkname" }, + { 0x1F9, "script_model" }, + { 0x1FA, "script_noteworthy" }, + { 0x1FB, "script_origin" }, + { 0x1FC, "script_parent" }, + { 0x1FD, "script_parentname" }, + { 0x1FE, "script_pushable" }, + { 0x1FF, "script_vehicle" }, + { 0x200, "script_vehicle_collision" }, + { 0x201, "script_vehicle_collmap" }, + { 0x202, "script_vehicle_corpse" }, + { 0x203, "scriptable" }, + { 0x204, "scriptedarrivalent" }, + { 0x205, "scope_center" }, + { 0x206, "scope_top" }, + { 0x207, "scope_cap" }, + { 0x208, "search_end" }, + { 0x209, "secondaryoffhand" }, + { 0x20A, "sentry" }, + { 0x20B, "sentry_offline" }, + { 0x20C, "sessionstate" }, + { 0x20D, "sessionteam" }, + { 0x20E, "sharpturnnotifydist" }, + { 0x20F, "sightlatency" }, + { 0x210, "silenced_shot" }, + { 0x211, "slidevelocity" }, + { 0x212, "slowmo_active" }, + { 0x213, "slowmo_passive" }, + { 0x214, "smoke" }, + { 0x215, "snd_channelvolprio_holdbreath" }, + { 0x216, "snd_channelvolprio_pain" }, + { 0x217, "snd_channelvolprio_shellshock" }, + { 0x218, "snd_enveffectsprio_level" }, + { 0x219, "snd_enveffectsprio_shellshock" }, + { 0x21A, "sort" }, + { 0x21B, "sound_blend" }, + { 0x21C, "space" }, + { 0x21D, "spawned" }, + { 0x21E, "spawnflags" }, + { 0x21F, "spectatekillcam" }, + { 0x220, "spectating_cycle" }, + { 0x221, "spectator" }, + { 0x222, "speed" }, + { 0x223, "splatter" }, + { 0x224, "sprint_begin" }, + { 0x225, "sprint_end" }, + { 0x226, "stairsstate" }, + { 0x227, "stand" }, + { 0x228, "start_blend" }, + { 0x229, "start_move" }, + { 0x22A, "start_ragdoll" }, + { 0x22B, "statelocked" }, + { 0x22C, "statusicon" }, + { 0x22D, "stop" }, + { 0x22E, "stop_soon" }, + { 0x22F, "stopanimdistsq" }, + { 0x230, "stopsoonnotifydist" }, + { 0x231, "suppression" }, + { 0x232, "suppression_end" }, + { 0x233, "suppressionduration" }, + { 0x234, "suppressionmeter" }, + { 0x235, "suppressionstarttime" }, + { 0x236, "suppressionwait" }, + { 0x237, "surfacetype" }, + { 0x238, "surprisedbymedistsq" }, + { 0x239, "swimmer" }, + { 0x23A, "syncedmeleetarget" }, + { 0x23B, "tag" }, + { 0x23C, "tag_aim" }, + { 0x23D, "tag_aim_animated" }, + { 0x23E, "tag_aim_pivot" }, + { 0x23F, "tag_barrel" }, + { 0x240, "tag_blade_off" }, + { 0x241, "tag_body" }, + { 0x242, "tag_brass" }, + { 0x243, "tag_butt" }, + { 0x244, "tag_camera" }, + { 0x245, "tag_clip" }, + { 0x246, "tag_detach" }, + { 0x247, "tag_engine_left" }, + { 0x248, "tag_engine_right" }, + { 0x249, "tag_eotech_reticle" }, + { 0x24A, "tag_eye" }, + { 0x24B, "tag_flash" }, + { 0x24C, "tag_flash_11" }, + { 0x24D, "tag_flash_2" }, + { 0x24E, "tag_flash_22" }, + { 0x24F, "tag_flash_3" }, + { 0x250, "tag_flash_silenced" }, + { 0x251, "tag_fx" }, + { 0x252, "tag_gasmask" }, + { 0x253, "tag_gasmask2" }, + { 0x254, "tag_ik_loc_le" }, + { 0x255, "tag_ik_loc_le_foregrip" }, + { 0x256, "tag_ik_loc_le_launcher" }, + { 0x257, "tag_ik_loc_le_shotgun" }, + { 0x258, "tag_ik_target" }, + { 0x259, "tag_inhand" }, + { 0x25A, "tag_knife_fx" }, + { 0x25B, "tag_laser" }, + { 0x25C, "tag_launcher" }, + { 0x25D, "tag_magnifier_eotech_reticle" }, + { 0x25E, "tag_motion_tracker_bl" }, + { 0x25F, "tag_motion_tracker_br" }, + { 0x260, "tag_motion_tracker_fx" }, + { 0x261, "tag_motion_tracker_tl" }, + { 0x262, "tag_origin" }, + { 0x263, "tag_player" }, + { 0x264, "tag_popout" }, + { 0x265, "tag_reticle_acog" }, + { 0x266, "tag_reticle_hamr" }, + { 0x267, "tag_reticle_on" }, + { 0x268, "tag_reticle_red_dot" }, + { 0x269, "tag_reticle_reflex" }, + { 0x26A, "tag_reticle_tavor_scope" }, + { 0x26B, "tag_reticle_thermal_scope" }, + { 0x26C, "tag_shield_back" }, + { 0x26D, "tag_shotgun" }, + { 0x26E, "tag_show_alt" }, + { 0x26F, "tag_stowed_back" }, + { 0x270, "tag_stowed_hip_rear" }, + { 0x271, "tag_sync" }, + { 0x272, "tag_tip" }, + { 0x273, "tag_turret" }, + { 0x274, "tag_turret_base" }, + { 0x275, "tag_weapon" }, + { 0x276, "tag_weapon_chest" }, + { 0x277, "tag_weapon_left" }, + { 0x278, "tag_weapon_right" }, + { 0x279, "tag_wheel_back_left" }, + { 0x27A, "tag_wheel_back_right" }, + { 0x27B, "tag_wheel_front_left" }, + { 0x27C, "tag_wheel_front_right" }, + { 0x27D, "tag_wheel_middle_left" }, + { 0x27E, "tag_wheel_middle_right" }, + { 0x27F, "takedamage" }, + { 0x280, "target" }, + { 0x281, "target_script_trigger" }, + { 0x282, "targetname" }, + { 0x283, "team" }, + { 0x284, "team3" }, + { 0x285, "teammode_axisallies" }, + { 0x286, "teammode_ffa" }, + { 0x287, "teammovewaittime" }, + { 0x288, "thermal" }, + { 0x289, "thermalbodymaterial" }, + { 0x28A, "third_person" }, + { 0x28B, "threatbias" }, + { 0x28C, "threatbiasgroup" }, + { 0x28D, "throwingknife" }, + { 0x28E, "top" }, + { 0x28F, "touch" }, + { 0x290, "touching_platform" }, + { 0x291, "transients_synced" }, + { 0x292, "traverse_complete" }, + { 0x293, "traverse_soon" }, + { 0x294, "traversecost" }, + { 0x295, "traversesoonnotifydist" }, + { 0x296, "trigger" }, + { 0x297, "trigger_damage" }, + { 0x298, "trigger_use" }, + { 0x299, "trigger_use_touch" }, + { 0x29A, "truck_cam" }, + { 0x29B, "turnrate" }, + { 0x29C, "turret_deactivate" }, + { 0x29D, "turret_fire" }, + { 0x29E, "turret_no_vis" }, + { 0x29F, "turret_not_on_target" }, + { 0x2A0, "turret_on_target" }, + { 0x2A1, "turret_on_vistarget" }, + { 0x2A2, "turret_pitch_clamped" }, + { 0x2A3, "turret_rotate_stopped" }, + { 0x2A4, "turret_yaw_clamped" }, + { 0x2A5, "turretinvulnerability" }, + { 0x2A6, "turretownerchange" }, + { 0x2A7, "turretstatechange" }, + { 0x2A8, "type" }, + { 0x2A9, "unresolved_collision" }, + { 0x2AA, "up" }, + { 0x2AB, "upaimlimit" }, + { 0x2AC, "useable" }, + { 0x2AD, "usechokepoints" }, + { 0x2AE, "usecombatscriptatcover" }, + { 0x2AF, "veh_boatbounce" }, + { 0x2B0, "veh_brake" }, + { 0x2B1, "veh_collision" }, + { 0x2B2, "veh_jolt" }, + { 0x2B3, "veh_landed" }, + { 0x2B4, "veh_leftground" }, + { 0x2B5, "veh_pathdir" }, + { 0x2B6, "veh_pathspeed" }, + { 0x2B7, "veh_pathtype" }, + { 0x2B8, "veh_predictedcollision" }, + { 0x2B9, "veh_speed" }, + { 0x2BA, "veh_throttle" }, + { 0x2BB, "veh_topspeed" }, + { 0x2BC, "veh_transmission" }, + { 0x2BD, "vehicle_dismount" }, + { 0x2BE, "vehicle_mount" }, + { 0x2BF, "velocity" }, + { 0x2C0, "vertalign" }, + { 0x2C1, "visionsetmissilecam" }, + { 0x2C2, "visionsetmissilecamduration" }, + { 0x2C3, "visionsetnaked" }, + { 0x2C4, "visionsetnakedduration" }, + { 0x2C5, "visionsetnight" }, + { 0x2C6, "visionsetnightduration" }, + { 0x2C7, "visionsetpain" }, + { 0x2C8, "visionsetpainduration" }, + { 0x2C9, "visionsetthermal" }, + { 0x2CA, "visionsetthermalduration" }, + { 0x2CB, "vote" }, + { 0x2CC, "walk" }, + { 0x2CD, "walkdist" }, + { 0x2CE, "walkdistfacingmotion" }, + { 0x2CF, "waypoint_reached" }, + { 0x2D0, "weapon" }, + { 0x2D1, "weapon_change" }, + { 0x2D2, "weapon_dropped" }, + { 0x2D3, "weapon_fired" }, + { 0x2D4, "weapon_switch_started" }, + { 0x2D5, "weapon_taken" }, + { 0x2D6, "weaponchange" }, + { 0x2D7, "weaponrail_on" }, + { 0x2D8, "width" }, + { 0x2D9, "world" }, + { 0x2DA, "worldspawn" }, + { 0x2DB, "x" }, + { 0x2DC, "y" }, + { 0x2DD, "z" }, + { 0x2DE, "zonly_physics" }, + { 0x2DF, "accumulate" }, + { 0x2E0, "allowprone" }, + { 0x2E1, "aiSpread" }, + { 0x2E2, "ambienttrack" }, + { 0x2E3, "ambienttrack_ac130" }, + { 0x2E4, "bottomarc" }, + { 0x2E5, "convergencetime" }, + { 0x2E6, "cursorhint" }, + { 0x2E7, "destructible_type" }, + { 0x2E8, "diffusefraction" }, + { 0x2E9, "eftarc" }, + { 0x2EA, "leftarc" }, + { 0x2EB, "maxrange" }, + { 0x2EC, "northyaw" }, + { 0x2ED, "pitchconvergencetime" }, + { 0x2EE, "playerSpread" }, + { 0x2EF, "postsharpturnlookaheaddist" }, + { 0x2F0, "reflection_clear_color" }, + { 0x2F1, "rightarc" }, + { 0x2F2, "sharpturntooclosetodestdist" }, + { 0x2F3, "script_delay" }, + { 0x2F4, "script_visionset" }, + { 0x2F5, "script_zone" }, + { 0x2F6, "spawner" }, + { 0x2F7, "sunlight" }, + { 0x2F8, "suncolor" }, + { 0x2F9, "sundirection" }, + { 0x2FA, "suppressionTime" }, + { 0x2FB, "threshold" }, + { 0x2FC, "toparc" }, + { 0x2FD, "vehicletype" }, + { 0x2FE, "wait" }, + { 0x2FF, "weaponinfo" }, + { 0x300, "yawconvergencetime" }, +// symbols + { 0x625, "__smangles" }, + { 0x626, "__smid" }, + { 0x627, "__smname" }, + { 0x628, "__smorigin" }, + { 0x629, "_add_as_apache_target_on_spawn_iternal" }, + { 0x62A, "_ai_delete" }, + { 0x62B, "_ai_group" }, + { 0x62C, "_ai_health" }, + { 0x62D, "_aliveplayers" }, + { 0x62E, "_allies" }, + { 0x630, "_ally" }, + { 0x632, "_ally_dist" }, + { 0x633, "_ally_get_pitch_down_aim_weight" }, + { 0x634, "_ally_get_pitch_up_aim_weight" }, + { 0x635, "_ally_get_yaw_left_aim_weight" }, + { 0x636, "_ally_get_yaw_right_aim_weight" }, + { 0x637, "_ally_is_current_volume" }, + { 0x638, "_ally_set_last_volume" }, + { 0x639, "_ally_transition_to_weight" }, + { 0x63A, "_ally_trigs" }, + { 0x63B, "_anim" }, + { 0x63C, "_anim_node" }, + { 0x63D, "_animactive" }, + { 0x63F, "_animmode" }, + { 0x640, "_animname" }, + { 0x641, "_array_wait" }, + { 0x642, "_aud_zip_wind_1" }, + { 0x643, "_audio" }, + { 0x644, "_audio_trigger" }, + { 0x645, "_autosave_game_now" }, + { 0x646, "_autosave_game_now_nochecks" }, + { 0x647, "_autosave_game_now_notrestart" }, + { 0x648, "_autosave_stealthcheck" }, + { 0x649, "_autosave_stealthcheck_nml" }, + { 0x64A, "_battlechatter_off" }, + { 0x64B, "_battlechatter_on" }, + { 0x64C, "_beginlocationselection" }, + { 0x64D, "_boss" }, + { 0x64E, "_box_setactivehelper" }, + { 0x64F, "_bravo" }, + { 0x650, "_clearalltextafterhudelem" }, + { 0x651, "_clearperks" }, + { 0x652, "_col" }, + { 0x653, "_color" }, + { 0x654, "_color_friendly_spawners" }, + { 0x655, "_color_ng" }, + { 0x656, "_colors_go_line" }, + { 0x657, "_command" }, + { 0x659, "_current_goal_volume" }, + { 0x65A, "_current_index" }, + { 0x65B, "_custom_anim" }, + { 0x65C, "_custom_anim_loop" }, + { 0x65D, "_custom_anim_thread" }, + { 0x65E, "_death_anims" }, + { 0x65F, "_delay" }, + { 0x660, "_destroy" }, + { 0x661, "_destructible_preanims" }, + { 0x662, "_destructible_preanimtree" }, + { 0x663, "_detachall" }, + { 0x664, "_disableoffhandweapons" }, + { 0x665, "_disableusability" }, + { 0x666, "_disableweapon" }, + { 0x667, "_disableweaponswitch" }, + { 0x668, "_dmg" }, + { 0x669, "_dog_guard" }, + { 0x66A, "_dog_too_close_to_owner" }, + { 0x66B, "_domflageffect" }, + { 0x66D, "_effect_keys" }, + { 0x66E, "_effecttype" }, + { 0x670, "_enableusability" }, + { 0x671, "_enableweapon" }, + { 0x672, "_enableweaponswitch" }, + { 0x673, "_end" }, + { 0x674, "_end_swim" }, + { 0x675, "_end_wreck" }, + { 0x676, "_endbeach" }, + { 0x677, "_enemies" }, + { 0x678, "_enemy" }, + { 0x679, "_enemy_num" }, + { 0x67A, "_engine_room" }, + { 0x67B, "_essential_part" }, + { 0x67C, "_exfil" }, + { 0x67D, "_exfil_heli" }, + { 0x67E, "_exit_menu" }, + { 0x67F, "_explosion_fquakepower" }, + { 0x680, "_explosion_iblastradius" }, + { 0x681, "_explosion_idamagemax" }, + { 0x682, "_explosion_idamagemin" }, + { 0x683, "_explosion_imaxrange" }, + { 0x684, "_explosion_iminrange" }, + { 0x685, "_explosion_iquakeradius" }, + { 0x686, "_explosion_iquaketime" }, + { 0x687, "_explosion_last_incoming" }, + { 0x688, "_explosion_last_sound" }, + { 0x689, "_extra_autosave_checks" }, + { 0x68A, "_findunobstructedfiringpointhelper" }, + { 0x68B, "_fire" }, + { 0x68C, "_fire_damage_ent" }, + { 0x68D, "_fire_suppression" }, + { 0x68E, "_fires" }, + { 0x68F, "_firework_large" }, + { 0x690, "_firework_sunlight" }, + { 0x691, "_firework_wait" }, + { 0x692, "_fireworks_cleanup" }, + { 0x693, "_fireworks_internal" }, + { 0x694, "_fireworks_meteor_internal" }, + { 0x695, "_first_frame_anim" }, + { 0x696, "_flag_wait_trigger" }, + { 0x697, "_flags" }, + { 0x698, "_flarestack" }, + { 0x699, "_force_kill" }, + { 0x69A, "_freevehicle" }, + { 0x69B, "_fx" }, + { 0x69C, "_get_dummy" }, + { 0x69D, "_get_guard_node_behind_player" }, + { 0x69E, "_get_location_sunlight" }, + { 0x69F, "_get_player_tank_target" }, + { 0x6A0, "_getplayerdata" }, + { 0x6A1, "_getplayerscore" }, + { 0x6A2, "_getradarstrength" }, + { 0x6A5, "_getvehiclespawnerarray_by_spawngroup" }, + { 0x6A6, "_giveweapon" }, + { 0x6A7, "_global_fx_ents" }, + { 0x6A8, "_globals" }, + { 0x6A9, "_gopath" }, + { 0x6AA, "_hangar" }, + { 0x6AB, "_hasperk" }, + { 0x6AC, "_health_death" }, + { 0x6AD, "_heli_ai_pre_move_func_internal" }, + { 0x6AE, "_hint" }, + { 0x6AF, "_hint_stick_get_config_suffix" }, + { 0x6B0, "_hint_stick_update_breakfunc" }, + { 0x6B1, "_hint_stick_update_string" }, + { 0x6B2, "_ignore_settings_old" }, + { 0x6B3, "_index" }, + { 0x6B4, "_init" }, + { 0x6B5, "_interactive" }, + { 0x6B8, "_ishelicopter" }, + { 0x6B9, "_kill_fx" }, + { 0x6BA, "_lastanimtime" }, + { 0x6BC, "_lc" }, + { 0x6BD, "_lc_persists" }, + { 0x6BE, "_lever_col" }, + { 0x6BF, "_linked_triggers" }, + { 0x6C0, "_loadstarted" }, + { 0x6C1, "_max_ai" }, + { 0x6C3, "_mgoff" }, + { 0x6C5, "_missile_cleanup_fake_target" }, + { 0x6C6, "_missile_earthquake" }, + { 0x6C7, "_missile_start_lockon_notify" }, + { 0x6C9, "_mount_snowmobile" }, + { 0x6CA, "_nextcoverprint" }, + { 0x6CB, "_nextmission" }, + { 0x6CC, "_notetrackfx" }, + { 0x6CE, "_objective_delete" }, + { 0x6CF, "_old_goalradius" }, + { 0x6D0, "_patrol_endon_spotted_flag" }, + { 0x6D1, "_pick_best_node_behind_owner" }, + { 0x6D2, "_pick_best_node_heeled_by_owner" }, + { 0x6D3, "_pipe_deck" }, + { 0x6D4, "_pipe_fx_time" }, + { 0x6D5, "_pipe_methods" }, + { 0x6D6, "_pipes" }, + { 0x6D7, "_playlocalsound" }, + { 0x6D8, "_precache" }, + { 0x6D9, "_radio_queue" }, + { 0x6DA, "_refinery" }, + { 0x6DB, "_remote_turrets" }, + { 0x6DC, "_remoteturret_loc_table" }, + { 0x6DD, "_remove_nodes_too_close" }, + { 0x6DE, "_restorepreviousnameplatematerial" }, + { 0x6DF, "_retreat_current_volumes" }, + { 0x6E0, "_retreat_final" }, + { 0x6E1, "_retreat_standby" }, + { 0x6E4, "_rpl_legs_is_diagonal" }, + { 0x6E5, "_rpl_legs_is_horizontal" }, + { 0x6E6, "_sat" }, + { 0x6E7, "_script_exploders" }, + { 0x6E8, "_scripted_spawn" }, + { 0x6E9, "_set_anim_time" }, + { 0x6EA, "_setactionslot" }, + { 0x6EB, "_setextraperks" }, + { 0x6EC, "_sethighestmissionifnotcheating" }, + { 0x6ED, "_setmissiondiffstringifnotcheating" }, + { 0x6EE, "_setnameplatematerial" }, + { 0x6EF, "_setperk" }, + { 0x6F0, "_setplayerdata" }, + { 0x6F1, "_setplayerscore" }, + { 0x6F2, "_setswitchnode" }, + { 0x6F3, "_setteamscore" }, + { 0x6F4, "_setup_chair" }, + { 0x6F5, "_setvehgoalpos" }, + { 0x6F6, "_setvehgoalpos_wrap" }, + { 0x6F7, "_setvehgoalposadheretomesh" }, + { 0x6F8, "_sleeves_flap_internal" }, + { 0x6F9, "_sleeves_idle" }, + { 0x6FA, "_slomo_breach_blowback_guy" }, + { 0x6FC, "_slomo_breach_chair_guy_animated" }, + { 0x6FD, "_slomo_breach_chair_guy_normal" }, + { 0x6FE, "_slomo_breach_desk_guy" }, + { 0x6FF, "_slomo_breach_executed_guy" }, + { 0x700, "_slomo_breach_executed_guy_pushed_to_floor" }, + { 0x701, "_slomo_breach_executioner_knife" }, + { 0x702, "_slomo_breach_executioner_pistol" }, + { 0x703, "_slomo_breach_fightback_guy" }, + { 0x704, "_slomo_breach_hostage_react" }, + { 0x705, "_slomo_breach_knife_charger" }, + { 0x706, "_slomo_breach_knife_hostage_death" }, + { 0x707, "_slomo_breach_pistol_guy" }, + { 0x708, "_slowmo_breach_funcs" }, + { 0x709, "_slowmo_functions" }, + { 0x70A, "_sound" }, + { 0x70B, "_source" }, + { 0x70C, "_source_base" }, + { 0x70D, "_spawner_mg42_think" }, + { 0x70E, "_spawner_stealth_default" }, + { 0x70F, "_spawner_stealth_dog" }, + { 0x710, "_start" }, + { 0x711, "_stealth" }, + { 0x712, "_stealth_move_detection_cap" }, + { 0x713, "_suicide" }, + { 0x714, "_tag_entity" }, + { 0x715, "_takeweaponsexcept" }, + { 0x717, "_tanks" }, + { 0x718, "_target" }, + { 0x719, "_target_vols" }, + { 0x71A, "_thruster_ents" }, + { 0x71B, "_thruster_rig" }, + { 0x71C, "_timeout" }, + { 0x71D, "_timeout_pause_on_death_and_prematch" }, + { 0x71F, "_traverses" }, + { 0x720, "_trigger_handle_triggering" }, + { 0x721, "_turn_off_spec_sun_lerp" }, + { 0x722, "_turn_on_spec_sun_lerp" }, + { 0x723, "_unsetextraperks" }, + { 0x724, "_unsetperk" }, + { 0x725, "_up" }, + { 0x726, "_updateenemyusable" }, + { 0x727, "_updateteamusable" }, + { 0x728, "_useperkenabled" }, + { 0x729, "_validateattacker" }, + { 0x72A, "_vehicle_badplace" }, + { 0x72B, "_vehicle_effect" }, + { 0x72C, "_vehicle_is_crashing" }, + { 0x72D, "_vehicle_landvehicle" }, + { 0x72E, "_vehicle_paths" }, + { 0x72F, "_vehicle_resume_named" }, + { 0x730, "_vehicle_spawn" }, + { 0x731, "_vehicle_stop_named" }, + { 0x732, "_vehicle_unload" }, + { 0x733, "_vehicles" }, + { 0x734, "_vignette_active" }, + { 0x735, "_vision_sets_active" }, + { 0x736, "_vols" }, + { 0x738, "_walkway_brush" }, + { 0x739, "_walkway_brush_node" }, + { 0x73A, "_wavedelay" }, + { 0x73B, "_waveplayerspawnindex" }, + { 0x73C, "_window_imp" }, + { 0x73D, "a" }, + { 0x73E, "a10_30mm_fire" }, + { 0x73F, "a10_allies_target_logic" }, + { 0x740, "a10_ambient_clouds" }, + { 0x742, "a10_balcony_strafe_physics" }, + { 0x743, "a10_bridge_strike" }, + { 0x744, "a10_cockpit_breathing" }, + { 0x745, "a10_crash_approach" }, + { 0x746, "a10_crash_impact" }, + { 0x747, "a10_create_fake_ai" }, + { 0x748, "a10_create_fake_player" }, + { 0x749, "a10_delayed_hint" }, + { 0x74A, "a10_do_shots" }, + { 0x74B, "a10_enable_target" }, + { 0x74C, "a10_endrun_shooting" }, + { 0x74D, "a10_enemies_target_logic" }, + { 0x74E, "a10_explode" }, + { 0x74F, "a10_fake_ai_death" }, + { 0x750, "a10_fire_hint_func" }, + { 0x751, "a10_fire_missiles" }, + { 0x754, "a10_freezebuffer" }, + { 0x755, "a10_get_player_end_position" }, + { 0x756, "a10_gun_dives" }, + { 0x757, "a10_handledamage" }, + { 0x758, "a10_hint_func" }, + { 0x75A, "a10_hud_connected_pulse" }, + { 0x75B, "a10_hud_grain" }, + { 0x75C, "a10_hud_set_alpha" }, + { 0x75D, "a10_hud_set_altitude" }, + { 0x75E, "a10_hud_set_connection" }, + { 0x75F, "a10_hud_set_coords" }, + { 0x760, "a10_hud_set_id" }, + { 0x761, "a10_hud_set_speed" }, + { 0x762, "a10_inital_fire_check" }, + { 0x763, "a10_kill_notification" }, + { 0x764, "a10_lastweapon" }, + { 0x765, "a10_mechanic_off" }, + { 0x766, "a10_mechanic_skip_end" }, + { 0x767, "a10_missile_cleanup" }, + { 0x768, "a10_missile_dives" }, + { 0x769, "a10_missile_lockon" }, + { 0x76A, "a10_missile_set_target" }, + { 0x76B, "a10_originalaudiozone" }, + { 0x76C, "a10_player_30mm" }, + { 0x76D, "a10_player_30mm_fire" }, + { 0x76E, "a10_player_aftermission_report" }, + { 0x76F, "a10_player_hit_hudelem" }, + { 0x770, "a10_player_hit_strafe_vehicles" }, + { 0x771, "a10_player_hud_cleanup" }, + { 0x772, "a10_player_init" }, + { 0x773, "a10_player_init_hud" }, + { 0x774, "a10_player_kills" }, + { 0x775, "a10_player_lockon_warning" }, + { 0x776, "a10_player_shot_think" }, + { 0x777, "a10_precache" }, + { 0x778, "a10_remove_target" }, + { 0x779, "a10_spawn_funcs" }, + { 0x77A, "a10_squadron_friendlyfire_watcher" }, + { 0x77B, "a10_squadron_logic" }, + { 0x77C, "a10_squadron_shoot" }, + { 0x77D, "a10_squadron_tower_crash" }, + { 0x77E, "a10_squadron_tower_crash_flares_warthog" }, + { 0x77F, "a10_squadron_tower_crash_missile" }, + { 0x780, "a10_strafe_cleanup" }, + { 0x781, "a10_strafe_get_location_spawner" }, + { 0x782, "a10_strafe_groups" }, + { 0x783, "a10_strafe_impact" }, + { 0x784, "a10_strafe_impact_earthquake" }, + { 0x785, "a10_strafe_impacts" }, + { 0x786, "a10_strafe_mechanic" }, + { 0x787, "a10_strafe_respotioning" }, + { 0x788, "a10_strafe_respotioning_dialogue" }, + { 0x789, "a10_strafe_run" }, + { 0x78A, "a10_strafe_run_cheap" }, + { 0x78B, "a10_strafe_use_nag" }, + { 0x78C, "a10_target_logic" }, + { 0x78D, "a10_targeting_think" }, + { 0x78E, "a10_targeting_watcher" }, + { 0x78F, "a10_uses" }, + { 0x791, "a10_vista_strafe_group" }, + { 0x792, "a10_vista_strafe_group_delete" }, + { 0x793, "a10_vista_strafe_mig" }, + { 0x794, "a10_wait_fire_missile" }, + { 0x795, "a10_wait_start_firing" }, + { 0x796, "a10_wait_stop_firing" }, + { 0x797, "a10_warthog_strafe" }, + { 0x798, "a10endposition" }, + { 0x799, "a10fakeplayer" }, + { 0x79B, "a10splinesout" }, + { 0x79C, "a10strafeactive" }, + { 0x79E, "a_bad_guys" }, + { 0x7A1, "a_globals" }, + { 0x7A2, "a_guys" }, + { 0x7A3, "a_rel" }, + { 0x7A4, "aa_add_event" }, + { 0x7A5, "aa_add_event_float" }, + { 0x7A6, "aa_init_stats" }, + { 0x7A7, "aa_missile_fire" }, + { 0x7A8, "aa_player_ads_tracking" }, + { 0x7A9, "aa_player_attacks_enemy_with_ads" }, + { 0x7AA, "aa_player_health_tracking" }, + { 0x7AB, "aa_print_vals" }, + { 0x7AC, "aa_should_start_fresh" }, + { 0x7AD, "aa_time_tracking" }, + { 0x7AE, "aa_update_flags" }, + { 0x7AF, "aalauncherammo" }, + { 0x7B0, "aamissilelaunchhorz" }, + { 0x7B1, "aamissilelaunchtargetdist" }, + { 0x7B2, "aamissilelaunchvert" }, + { 0x7B3, "aammissilelaunchtargetdist" }, + { 0x7B4, "aas_guys_spawn_logic" }, + { 0x7B6, "aasoundmanager" }, + { 0x7B7, "abanglecutoff" }, + { 0x7B8, "abilitychosen" }, + { 0x7B9, "abilitymaxval" }, + { 0x7BA, "abort" }, + { 0x7BB, "abort_attack_requested" }, + { 0x7BC, "abort_count" }, + { 0x7BE, "abortapproachifthreatened" }, + { 0x7BF, "abortlevel" }, + { 0x7C0, "abortreloadwhencanshoot" }, + { 0x7C1, "abouttobebreached" }, + { 0x7C2, "above_water_start_setup" }, + { 0x7C3, "absangleclamp180" }, + { 0x7C4, "absolute" }, + { 0x7C5, "absyawtoangles" }, + { 0x7C6, "absyawtoenemy" }, + { 0x7C7, "absyawtoenemy2d" }, + { 0x7C9, "ac130" }, + { 0x7CA, "ac130_altscene" }, + { 0x7CB, "ac130_attack_random" }, + { 0x7CC, "ac130_attacked_player_count" }, + { 0x7CD, "ac130_constant_target" }, + { 0x7CE, "ac130_direct_attack_path" }, + { 0x7CF, "ac130_final_life" }, + { 0x7D0, "ac130_flood_respawn" }, + { 0x7D1, "ac130_kill_player" }, + { 0x7D2, "ac130_last_105_fire_time" }, + { 0x7D3, "ac130_magic_105" }, + { 0x7D4, "ac130_magic_105_fake" }, + { 0x7D5, "ac130_magic_105_impact" }, + { 0x7D7, "ac130_magic_bullet_fake" }, + { 0x7DA, "ac130_missile_take_hit" }, + { 0x7DC, "ac130_spawn" }, + { 0x7DD, "ac130_speed" }, + { 0x7DE, "ac130_use_duration" }, + { 0x7DF, "ac130gunner" }, + { 0x7E0, "ac130inuse" }, + { 0x7E1, "ac130player" }, + { 0x7E2, "ac130queue" }, + { 0x7E3, "ac130shellshock" }, + { 0x7E4, "ac_130" }, + { 0x7E5, "accaracy_mod" }, + { 0x7E6, "accel" }, + { 0x7E7, "accel_factor" }, + { 0x7E8, "accel_time" }, + { 0x7E9, "acceleration" }, + { 0x7EA, "acceleration_fov" }, + { 0x7EB, "accessory" }, + { 0x7EC, "accn" }, + { 0x7ED, "accumulated_damage" }, + { 0x7EE, "accuracy_ally" }, + { 0x7EF, "accuracy_enemy" }, + { 0x7F0, "accuracygrowthmultiplier" }, + { 0x7F1, "accuracystationarymod" }, + { 0x7F2, "achieve_birdie" }, + { 0x7F4, "achieve_jack_the_ripper" }, + { 0x7F5, "achieve_serrated_edge" }, + { 0x7F6, "achieve_slowmo_breach_kills" }, + { 0x7F7, "achieve_strike" }, + { 0x7F8, "achievement" }, + { 0x7F9, "achievement_attacker" }, + { 0x7FA, "achievement_completed" }, + { 0x7FB, "achievement_list" }, + { 0x7FC, "achievement_registration_func" }, + { 0x7FD, "acquiregroundtarget" }, + { 0x7FE, "acquireminitarget" }, + { 0x7FF, "acquiretarget" }, + { 0x800, "acquirevehicletarget" }, + { 0x801, "action_back" }, + { 0x802, "action_func" }, + { 0x803, "action_gears" }, + { 0x804, "action_killstreak" }, + { 0x806, "action_thread" }, + { 0x807, "action_weapons_primary" }, + { 0x808, "action_weapons_secondary" }, + { 0x809, "actionbinds" }, + { 0x80A, "actionnotify" }, + { 0x80B, "actionnotifymessage" }, + { 0x80C, "actionslotenabled" }, + { 0x80D, "actionslots" }, + { 0x80E, "activate" }, + { 0x80F, "activate_angered_state" }, + { 0x810, "activate_avoid_minion_exp" }, + { 0x811, "activate_clientside_exploder" }, + { 0x812, "activate_color_code_internal" }, + { 0x813, "activate_color_trigger" }, + { 0x815, "activate_destructibles_in_volume" }, + { 0x816, "activate_exploder" }, + { 0x817, "activate_exploders_in_volume" }, + { 0x819, "activate_fireworks_exploder" }, + { 0x81A, "activate_health_regen" }, + { 0x81C, "activate_individual_exploder" }, + { 0x81D, "activate_individual_exploder_proc" }, + { 0x81E, "activate_individual_fireworks_exploder" }, + { 0x81F, "activate_interactives_in_volume" }, + { 0x820, "activate_kill_10_in_30" }, + { 0x822, "activate_kill_10_with_traps" }, + { 0x823, "activate_kill_10_with_turrets" }, + { 0x824, "activate_kill_airborne_aliens" }, + { 0x826, "activate_melee_goons" }, + { 0x827, "activate_melee_only" }, + { 0x829, "activate_mortar" }, + { 0x82A, "activate_nerf" }, + { 0x82B, "activate_new_challenge" }, + { 0x82C, "activate_no_abilities" }, + { 0x82D, "activate_no_reloads" }, + { 0x82E, "activate_percent_accuracy" }, + { 0x82F, "activate_protect_a_player" }, + { 0x830, "activate_riders" }, + { 0x831, "activate_rotunda_fight" }, + { 0x832, "activate_spawn_event" }, + { 0x833, "activate_spend_currency" }, + { 0x834, "activate_spend_money_progress" }, + { 0x835, "activate_spend_no_money" }, + { 0x836, "activate_stay_prone" }, + { 0x837, "activate_stay_within_area" }, + { 0x838, "activate_trig_if_not_flag" }, + { 0x839, "activate_trigger" }, + { 0x83A, "activate_trigger_process" }, + { 0x83B, "activate_trigger_with_noteworthy" }, + { 0x83C, "activate_trigger_with_targetname" }, + { 0x83D, "activate_use_weapon_challenge" }, + { 0x83E, "activateagent" }, + { 0x83F, "activated" }, + { 0x840, "activated_color_trigger" }, + { 0x841, "activated_nerfs" }, + { 0x842, "activatefunc" }, + { 0x843, "activateratio" }, + { 0x844, "activatetime" }, + { 0x845, "activateweapon" }, + { 0x846, "activation_notify" }, + { 0x847, "activation_time" }, + { 0x848, "activation_trig" }, + { 0x84A, "active_deployables" }, + { 0x84B, "active_force_dog_talk" }, + { 0x84C, "active_mode" }, + { 0x84D, "active_objective" }, + { 0x84E, "active_odin" }, + { 0x84F, "active_rope" }, + { 0x850, "active_teargas" }, + { 0x851, "active_turrets" }, + { 0x852, "active_wait_spread" }, + { 0x853, "activebreaks" }, + { 0x854, "activecount" }, + { 0x855, "activecounteruavs" }, + { 0x857, "activegrenadetimer" }, + { 0x858, "activenodes" }, + { 0x85A, "activeplayers" }, + { 0x85B, "activesfx" }, + { 0x85C, "activeuavs" }, + { 0x85D, "actor_teleport" }, + { 0x85E, "actor_use_water_when_moving" }, + { 0x860, "actual_health" }, + { 0x861, "actuator_click_wait" }, + { 0x862, "adam" }, + { 0x863, "add_abort" }, + { 0x864, "add_actor_danger_listeners" }, + { 0x866, "add_and_select_entity" }, + { 0x867, "add_animation" }, + { 0x868, "add_animsound" }, + { 0x869, "add_array_to_destructible" }, + { 0x86A, "add_as_apache_target_on_spawn" }, + { 0x86B, "add_as_apaches_target" }, + { 0x86C, "add_attachment_to_weapon" }, + { 0x86E, "add_bcs_location_mapping" }, + { 0x86F, "add_beacon_effect" }, + { 0x870, "add_breach_func" }, + { 0x871, "add_breach_target" }, + { 0x872, "add_button" }, + { 0x873, "add_c4_glow" }, + { 0x874, "add_c4_to_spot" }, + { 0x875, "add_call" }, + { 0x876, "add_care_package" }, + { 0x877, "add_cellphone_notetracks" }, + { 0x878, "add_cleanup_ent" }, + { 0x87B, "add_collision_to_path_ent" }, + { 0x87C, "add_context_sensative_dialog" }, + { 0x87D, "add_context_sensative_timeout" }, + { 0x87E, "add_contrail" }, + { 0x880, "add_cover_node" }, + { 0x881, "add_cycle_scalar" }, + { 0x883, "add_damage_function" }, + { 0x884, "add_damage_owner_recorder" }, + { 0x885, "add_damagefeedback" }, + { 0x886, "add_dead_enemy_clip" }, + { 0x887, "add_debug_dialogue" }, + { 0x888, "add_destructible_fx" }, + { 0x889, "add_destructible_to_frame_queue" }, + { 0x88A, "add_destructible_type_function" }, + { 0x88C, "add_dialogue_line" }, + { 0x88D, "add_dialogue_line_timed" }, + { 0x88E, "add_earthquake" }, + { 0x88F, "add_endon" }, + { 0x890, "add_ent_objective_to_compass" }, + { 0x891, "add_extra_autosave_check" }, + { 0x892, "add_fire" }, + { 0x893, "add_fire_fx" }, + { 0x894, "add_fractional_data_point" }, + { 0x896, "add_fx" }, + { 0x898, "add_headlamp" }, + { 0x899, "add_hint_background" }, + { 0x89A, "add_hint_string" }, + { 0x89B, "add_hive_dependencies" }, + { 0x89C, "add_hud_line" }, + { 0x89D, "add_hudelm_position_internal" }, + { 0x89E, "add_humanoid_agent" }, + { 0x89F, "add_ice_radius" }, + { 0x8A0, "add_in_more_allies" }, + { 0x8A1, "add_jav_glow" }, + { 0x8A2, "add_kb_button" }, + { 0x8A3, "add_key" }, + { 0x8A4, "add_key_to_destructible" }, + { 0x8A5, "add_keypairs_to_destructible" }, + { 0x8A6, "add_large_firework" }, + { 0x8A7, "add_lcs_target" }, + { 0x8A8, "add_light_to_actor" }, + { 0x8A9, "add_magic_bullet_shield_if_off" }, + { 0x8AA, "add_meteor_firework" }, + { 0x8AB, "add_name" }, + { 0x8AC, "add_no_game_starts" }, + { 0x8AE, "add_noself_call" }, + { 0x8AF, "add_notetrack_and_get_index" }, + { 0x8B0, "add_notetrack_array" }, + { 0x8B1, "add_option_to_selected_entities" }, + { 0x8B3, "add_path_start_and_end_refs" }, + { 0x8B4, "add_pet_bombs_to_pillage_system" }, + { 0x8B5, "add_proccess_trigger" }, + { 0x8B7, "add_random_killspawner_to_spawngroup" }, + { 0x8B8, "add_reactive_fx" }, + { 0x8B9, "add_reverb" }, + { 0x8BA, "add_scene_model" }, + { 0x8BB, "add_sit_load_ak_notetracks" }, + { 0x8BC, "add_slowmo_breach_custom_function" }, + { 0x8BD, "add_slowmo_breacher" }, + { 0x8BE, "add_small_firework" }, + { 0x8BF, "add_smoking_notetracks" }, + { 0x8C0, "add_spawn_function" }, + { 0x8C1, "add_start" }, + { 0x8C2, "add_start_assert" }, + { 0x8C3, "add_start_construct" }, + { 0x8C4, "add_target" }, + { 0x8C5, "add_target_pivot" }, + { 0x8C6, "add_teargas_cloud_radius" }, + { 0x8C9, "add_to_array" }, + { 0x8CA, "add_to_bot_damage_targets" }, + { 0x8CB, "add_to_bot_use_targets" }, + { 0x8CC, "add_to_destroyed_count" }, + { 0x8CD, "add_to_dialogue" }, + { 0x8CE, "add_to_dialogue_generic" }, + { 0x8CF, "add_to_enemygazs_until_dead" }, + { 0x8D0, "add_to_enemytanks_until_dead" }, + { 0x8D1, "add_to_group" }, + { 0x8D2, "add_to_interrupt_vo" }, + { 0x8D4, "add_to_outline_hive_watch_list" }, + { 0x8D5, "add_to_outline_pillage_watch_list" }, + { 0x8D6, "add_to_outline_watch_list" }, + { 0x8D7, "add_to_outline_weapon_watch_list" }, + { 0x8D8, "add_to_queue_at_priority" }, + { 0x8D9, "add_to_radio" }, + { 0x8DA, "add_to_spawngroup" }, + { 0x8DB, "add_to_standby" }, + { 0x8DC, "add_to_thrown_entity_list" }, + { 0x8DD, "add_to_vo_system" }, + { 0x8DE, "add_to_vo_system_internal" }, + { 0x8DF, "add_to_zone" }, + { 0x8E0, "add_tokens_to_trigger_flags" }, + { 0x8E1, "add_trace_fx" }, + { 0x8E2, "add_trace_fx_proc" }, + { 0x8E3, "add_trigger_func_thread" }, + { 0x8E4, "add_trigger_function" }, + { 0x8E5, "add_turret_to_heli" }, + { 0x8E6, "add_valid_evade" }, + { 0x8E7, "add_vol_to_node" }, + { 0x8E8, "add_volume_to_global_arrays" }, + { 0x8E9, "add_wait" }, + { 0x8EA, "add_wait_asserter" }, + { 0x8EB, "add_weapon" }, + { 0x8EC, "add_z" }, + { 0x8ED, "addactioncovermealiasex" }, + { 0x8EE, "addactivecounteruav" }, + { 0x8EF, "addactiveuav" }, + { 0x8F0, "addaieventlistener_func" }, + { 0x8F1, "addairexplosion" }, + { 0x8F2, "addalienagent" }, + { 0x8F3, "addalienweaponammo" }, + { 0x8F4, "addallowedthreatcallout" }, + { 0x8F5, "addallweaponammo" }, + { 0x8F6, "addalternatespawnpoint" }, + { 0x8F7, "addammo" }, + { 0x8F8, "addammoovertime" }, + { 0x8F9, "addasapachehudtarget" }, + { 0x8FA, "addattacker" }, + { 0x8FB, "addawardwinner" }, + { 0x8FC, "addblankiw6" }, + { 0x8FD, "addboxtolevelarray" }, + { 0x8FE, "addcalloutresponseevent" }, + { 0x8FF, "addcastiw" }, + { 0x900, "addcastname" }, + { 0x901, "addcenterdual" }, + { 0x902, "addcenterediw6" }, + { 0x903, "addcenterheading" }, + { 0x904, "addcenterimage" }, + { 0x905, "addcentername" }, + { 0x906, "addcenternamedouble" }, + { 0x908, "addcheckfirealias" }, + { 0x909, "addchild" }, + { 0x90A, "addconcatdirectionalias" }, + { 0x90B, "addconcattargetalias" }, + { 0x90C, "addcratetype" }, + { 0x90F, "addcreditiw6_3f" }, + { 0x910, "addcreditiw6_4" }, + { 0x911, "addcreditliw6" }, + { 0x912, "addcreditlsubheaderriw6" }, + { 0x913, "addcreditriw6" }, + { 0x914, "adddeathicon" }, + { 0x915, "addedtowave" }, + { 0x916, "addenemytominimap" }, + { 0x917, "addentryiw6" }, + { 0x918, "addfullcliptoallweapons" }, + { 0x91A, "addgap" }, + { 0x91B, "addgrenadethrowanimoffset" }, + { 0x91C, "addheaderiw6" }, + { 0x91D, "addhostileburstalias" }, + { 0x91E, "addimageiw" }, + { 0x91F, "addinformalias" }, + { 0x920, "addinformevent" }, + { 0x921, "addinformreloadingaliasex" }, + { 0x922, "additionalassets" }, + { 0x923, "additionalexit_vo" }, + { 0x924, "additionalsighttraceentities" }, + { 0x925, "additive_pain" }, + { 0x927, "additiveturretdriveidle" }, + { 0x928, "additiveturretfire" }, + { 0x929, "additiveturretidle" }, + { 0x92A, "additiveturretrotateleft" }, + { 0x92B, "additiveturretrotateright" }, + { 0x92C, "additiveusegunroot" }, + { 0x92D, "addleftimage" }, + { 0x92E, "addleftname" }, + { 0x92F, "addleftnamename" }, + { 0x930, "addlefttitle" }, + { 0x931, "addlefttitlename" }, + { 0x932, "addlefttitlenamespace" }, + { 0x933, "addlevel" }, + { 0x934, "addlevelstoexperience" }, + { 0x936, "addlinknode" }, + { 0x937, "addlockedontarget" }, + { 0x939, "addlowermessage" }, + { 0x93A, "addmovecombataliasex" }, + { 0x93B, "addmovenoncombataliasex" }, + { 0x93C, "addnamealias" }, + { 0x93D, "addnamealiasex" }, + { 0x93E, "addnameiw" }, + { 0x93F, "addnotetrack_animsound" }, + { 0x940, "addnotetrack_attach" }, + { 0x941, "addnotetrack_clockwork" }, + { 0x942, "addnotetrack_cornered" }, + { 0x943, "addnotetrack_customfunction" }, + { 0x944, "addnotetrack_detach" }, + { 0x945, "addnotetrack_detach_gun" }, + { 0x946, "addnotetrack_dialogue" }, + { 0x947, "addnotetrack_flag" }, + { 0x948, "addnotetrack_flag_clear" }, + { 0x949, "addnotetrack_notify" }, + { 0x94A, "addnotetrack_playersound" }, + { 0x94B, "addnotetrack_sound" }, + { 0x94C, "addnotetrack_startfxontag" }, + { 0x94D, "addnotetrack_stopfxontag" }, + { 0x94E, "addnotetrack_swapparttoefx" }, + { 0x94F, "addnotetrack_tracepartforefx" }, + { 0x950, "addofficertosquad" }, + { 0x953, "addoption" }, + { 0x954, "addorderalias" }, + { 0x955, "addorderevent" }, + { 0x956, "addpaneltimesarray" }, + { 0x957, "addplanetolist" }, + { 0x958, "addplayernamealias" }, + { 0x959, "addplayertosquad" }, + { 0x95A, "addpossiblethreatcallout" }, + { 0x95B, "addprereq" }, + { 0x95C, "addrankalias" }, + { 0x95D, "addratiomaxstocktoallweapons" }, + { 0x95E, "addreactionalias" }, + { 0x95F, "addreactionevent" }, + { 0x961, "addresponsealias" }, + { 0x962, "addresponseevent" }, + { 0x963, "addresponseevent_internal" }, + { 0x964, "addrightname" }, + { 0x965, "addrighttitle" }, + { 0x966, "addsafetyhealth" }, + { 0x967, "addsituationalcombatorder" }, + { 0x968, "addsituationalorder" }, + { 0x969, "addspace" }, + { 0x96A, "addspacesmall" }, + { 0x96C, "addspawnpoints" }, + { 0x96D, "addspeaker" }, + { 0x96E, "addstartspawnpoints" }, + { 0x96F, "addsubheaderiw6" }, + { 0x970, "addsubheaderliw6" }, + { 0x971, "addsubheaderriw6" }, + { 0x972, "addsubleftname" }, + { 0x973, "addsubleftnamename" }, + { 0x974, "addsubleftnamenamename" }, + { 0x976, "addsublefttitlename" }, + { 0x977, "addsublefttitlenamespace" }, + { 0x978, "addsubnameiw" }, + { 0x979, "addsubtitleiw" }, + { 0x97A, "addsubtitleiw6" }, + { 0x97B, "addsubtitlenameiw" }, + { 0x97C, "addtakingfirealias" }, + { 0x97D, "addtauntalias" }, + { 0x97E, "addthreatalias" }, + { 0x97F, "addthreatcalloutalias" }, + { 0x980, "addthreatcalloutecho" }, + { 0x981, "addthreatcalloutlandmarkalias" }, + { 0x982, "addthreatcalloutlocationalias" }, + { 0x983, "addthreatcalloutqa_nextline" }, + { 0x984, "addthreatcalloutresponsealias" }, + { 0x985, "addthreatdistancealias" }, + { 0x986, "addthreatelevationalias" }, + { 0x987, "addthreatevent" }, + { 0x988, "addthreatexposedalias" }, + { 0x989, "addthreatobviousalias" }, + { 0x98A, "addtime" }, + { 0x98B, "addtitleiw" }, + { 0x98C, "addtitleiw6" }, + { 0x98D, "addtitlenameiw" }, + { 0x98F, "addtoballdronelist" }, + { 0x990, "addtobattlebuddywaitlist" }, + { 0x991, "addtocharactersarray" }, + { 0x992, "addtoclosedlist" }, + { 0x993, "addtohelilist" }, + { 0x994, "addtoimslist" }, + { 0x995, "addtolittlebirdlist" }, + { 0x996, "addtolivescount" }, + { 0x997, "addtoopenlist" }, + { 0x998, "addtoparticipantsarray" }, + { 0x999, "addtosquad" }, + { 0x99B, "addtotanklist" }, + { 0x99C, "addtoteam" }, + { 0x99D, "addtoteamcount" }, + { 0x99E, "addtoturretlist" }, + { 0x99F, "addtougvlist" }, + { 0x9A2, "addtrackingtarget_ondeath" }, + { 0x9A3, "addtrackingtarget_update" }, + { 0x9A5, "adduavmodel" }, + { 0x9A6, "adduplinktolevellist" }, + { 0x9A7, "addzone" }, + { 0x9A8, "adjust_ally_movement" }, + { 0x9A9, "adjust_angles_to_player" }, + { 0x9AA, "adjust_forward_push" }, + { 0x9AB, "adjust_helo_sound_high" }, + { 0x9AC, "adjust_helo_sound_low" }, + { 0x9AD, "adjust_helo_sound_roll" }, + { 0x9AE, "adjust_movement_step_up" }, + { 0x9AF, "adjust_moving_grass" }, + { 0x9B0, "adjust_overall_apache_pitches" }, + { 0x9B1, "adjust_player_view" }, + { 0x9B2, "adjust_suppression_on_enemies" }, + { 0x9B3, "adrenaline" }, + { 0x9B4, "adrenalineinfo" }, + { 0x9B5, "adrenalinetime" }, + { 0x9B6, "ads_hint" }, + { 0x9B7, "adstime" }, + { 0x9B8, "adstoggled" }, + { 0x9B9, "adszoomed" }, + { 0x9BA, "advance_regardless_of_numbers" }, + { 0x9BB, "advancedtraverse" }, + { 0x9BC, "advancedtraverse2" }, + { 0x9BE, "advanceonhidingenemy" }, + { 0x9BF, "advancetoenemygroup" }, + { 0x9C0, "advancetoenemygroupmax" }, + { 0x9C1, "advancetoenemyinterval" }, + { 0x9C2, "aenemies" }, + { 0x9C3, "aent_flag_waitopen_either" }, + { 0x9C4, "aerial_vehicle_allowed" }, + { 0x9C5, "affected" }, + { 0x9C6, "afk" }, + { 0x9C7, "after_fall_bounce" }, + { 0x9C8, "after_hunt" }, + { 0x9C9, "after_hunt_dialogue" }, + { 0x9CA, "agent_damage_finished" }, + { 0x9CC, "agent_gameparticipant" }, + { 0x9CD, "agent_teamparticipant" }, + { 0x9CE, "agent_type" }, + { 0x9CF, "agentarray" }, + { 0x9D0, "agentdogthink" }, + { 0x9D1, "agentfunc" }, + { 0x9D2, "aggresivelookat" }, + { 0x9D3, "aggressivemode" }, + { 0x9D4, "ahdmode" }, + { 0x9D5, "ahdmode_ng" }, + { 0x9D7, "ai_3d_sighting_model" }, + { 0x9D8, "ai_advancing_logic" }, + { 0x9D9, "ai_alert" }, + { 0x9DA, "ai_alert_bullet" }, + { 0x9DB, "ai_alert_damage" }, + { 0x9DC, "ai_alert_friend_death" }, + { 0x9DD, "ai_alert_loop" }, + { 0x9DE, "ai_alert_player_break_stealth" }, + { 0x9DF, "ai_alert_range" }, + { 0x9E0, "ai_animate_props_on_death" }, + { 0x9E1, "ai_array" }, + { 0x9E2, "ai_array_killcount_flag_set" }, + { 0x9E3, "ai_attack_missile" }, + { 0x9E4, "ai_classname_in_level" }, + { 0x9E6, "ai_clean_up" }, + { 0x9E7, "ai_cleanup_fake_death" }, + { 0x9E8, "ai_clear_custom_animation_reaction" }, + { 0x9E9, "ai_clear_custom_animation_reaction_and_idle" }, + { 0x9EB, "ai_create_behavior_function" }, + { 0x9EC, "ai_damage_think" }, + { 0x9ED, "ai_deathflag" }, + { 0x9EE, "ai_debug" }, + { 0x9EF, "ai_delete_when_out_of_sight" }, + { 0x9F0, "ai_dont_glow_in_thermal" }, + { 0x9F1, "ai_enemy_target_underwater" }, + { 0x9F2, "ai_enemy_tracking" }, + { 0x9F3, "ai_event_settings" }, + { 0x9F4, "ai_event_settings_reset" }, + { 0x9F5, "ai_flee_from_teargas" }, + { 0x9F6, "ai_flooding_hip_anims" }, + { 0x9F7, "ai_flooding_under_anims" }, + { 0x9F8, "ai_follow_cover" }, + { 0x9FA, "ai_get_behavior_function" }, + { 0x9FB, "ai_go_to_player" }, + { 0x9FC, "ai_group_killcount_flag_set" }, + { 0x9FD, "ai_in_coverwater" }, + { 0x9FE, "ai_init" }, + { 0x9FF, "ai_lasers" }, + { 0xA00, "ai_message_handler_hidden" }, + { 0xA02, "ai_mode" }, + { 0xA03, "ai_number" }, + { 0xA05, "ai_out_time" }, + { 0xA06, "ai_picks_destination" }, + { 0xA08, "ai_react_to_teargas" }, + { 0xA09, "ai_record_spawn_pos" }, + { 0xA0A, "ai_remove_outline_waiter" }, + { 0xA0B, "ai_rider_invulnerable_until_vehicle_death" }, + { 0xA0C, "ai_rider_invulnerable_until_vehicle_death_or_jumping_out" }, + { 0xA0D, "ai_rpg_attack_delay_max" }, + { 0xA0E, "ai_rpg_attack_delay_min" }, + { 0xA0F, "ai_set_custom_animation_reaction" }, + { 0xA10, "ai_set_goback_override_function" }, + { 0xA11, "ai_sets_goal" }, + { 0xA13, "ai_should_be_added" }, + { 0xA14, "ai_sight_brushes" }, + { 0xA15, "ai_space_death" }, + { 0xA16, "ai_space_headshot_death" }, + { 0xA17, "ai_space_pain" }, + { 0xA19, "ai_stealth_init" }, + { 0xA1A, "ai_stealth_pause_handler" }, + { 0xA1B, "ai_swim_death" }, + { 0xA1C, "ai_swim_pain" }, + { 0xA1D, "ai_swim_sound" }, + { 0xA1E, "ai_swim_sound_idle" }, + { 0xA1F, "ai_test_count" }, + { 0xA20, "ai_to_kill" }, + { 0xA21, "ai_total_count" }, + { 0xA22, "ai_track" }, + { 0xA23, "ai_track_death_by_player" }, + { 0xA24, "ai_types" }, + { 0xA25, "ai_wait_go" }, + { 0xA26, "ai_waittill_entered_vehicle" }, + { 0xA27, "ai_water_rising_think" }, + { 0xA28, "aiamount" }, + { 0xA29, "aiareintheroom" }, + { 0xA2A, "aiarray" }, + { 0xA2B, "aibattlechatterloop" }, + { 0xA2C, "aicount" }, + { 0xA2D, "aideathenemy" }, + { 0xA2E, "aideatheventthread" }, + { 0xA2F, "aideathfriendly" }, + { 0xA30, "aidisplacewaiter" }, + { 0xA31, "aifolloworderwaiter" }, + { 0xA32, "aigrenadedangerwaiter" }, + { 0xA33, "aigroup_create" }, + { 0xA34, "aigroup_soldierthink" }, + { 0xA35, "aigroup_spawnerdeath" }, + { 0xA36, "aigroup_spawnerempty" }, + { 0xA37, "aigroup_spawnerthink" }, + { 0xA38, "aihasweapon" }, + { 0xA3A, "aikilleventthread" }, + { 0xA3B, "aim2_target" }, + { 0xA3C, "aim4_target" }, + { 0xA3D, "aim6_target" }, + { 0xA3E, "aim8_target" }, + { 0xA3F, "aim_arrow" }, + { 0xA40, "aim_arrow_on_target" }, + { 0xA42, "aim_idle_thread" }, + { 0xA43, "aim_missiles_2" }, + { 0xA44, "aim_turret_at_ambush_point_or_visible_enemy" }, + { 0xA45, "aim_while_moving_thread" }, + { 0xA46, "aimbutdontshoot" }, + { 0xA47, "aimed_at_shoot_ent_or_pos" }, + { 0xA48, "aimedatshootentorpos" }, + { 0xA49, "aimedsomewhatatenemy" }, + { 0xA4A, "aimidlethread" }, + { 0xA4B, "aiming_at_ally" }, + { 0xA4C, "aimpitchdifftolerance" }, + { 0xA4D, "aimweight" }, + { 0xA4E, "aimweight_end" }, + { 0xA4F, "aimweight_start" }, + { 0xA50, "aimweight_t" }, + { 0xA51, "aimweight_transframes" }, + { 0xA52, "aimyawdiffclosedistsq" }, + { 0xA55, "ainame" }, + { 0xA56, "ainameandrankwaiter" }, + { 0xA57, "aiofficerorders" }, + { 0xA58, "aiowner" }, + { 0xA59, "air_armada" }, + { 0xA5A, "air_dropped" }, + { 0xA5B, "air_node_mesh" }, + { 0xA5C, "air_raid" }, + { 0xA5E, "air_raid_fire" }, + { 0xA5F, "air_raid_siren" }, + { 0xA61, "air_raids" }, + { 0xA62, "air_start_nodes" }, + { 0xA63, "air_strip_ai_quick_cleanup_death_function" }, + { 0xA64, "air_strip_ai_quick_cleanup_spawn_function" }, + { 0xA65, "air_strip_ambient_a10_gun_dive_1" }, + { 0xA66, "air_strip_ambient_a10_gun_dive_2" }, + { 0xA67, "air_strip_ambient_a10_gun_dive_3" }, + { 0xA68, "air_strip_ambient_dogfight_1" }, + { 0xA69, "air_strip_ambient_dogfight_2" }, + { 0xA6B, "air_strip_begin" }, + { 0xA6C, "air_strip_choppers" }, + { 0xA6D, "air_strip_cleanup" }, + { 0xA6E, "air_strip_hints" }, + { 0xA6F, "air_strip_init" }, + { 0xA70, "air_strip_m880_corpses" }, + { 0xA71, "air_strip_m880_death_count" }, + { 0xA72, "air_strip_m880s" }, + { 0xA73, "air_strip_main" }, + { 0xA74, "air_strip_obj_markers" }, + { 0xA75, "air_strip_secured_ambient_enemies_setup" }, + { 0xA77, "air_strip_secured_init" }, + { 0xA78, "air_strip_secured_main" }, + { 0xA79, "air_strip_secured_vo" }, + { 0xA7A, "air_strip_take_off_mig_01" }, + { 0xA7B, "air_strip_take_off_mig_02" }, + { 0xA7C, "air_strip_temp_dialog" }, + { 0xA7D, "air_strip_to_chopper" }, + { 0xA7E, "air_strip_trucks_static_setup" }, + { 0xA7F, "air_strip_victory" }, + { 0xA81, "airank" }, + { 0xA82, "airburstbomb" }, + { 0xA83, "aircraft_wash" }, + { 0xA85, "airdeniedplayer" }, + { 0xA86, "airdrop_heli" }, + { 0xA87, "airdrop_icon" }, + { 0xA88, "airdrop_max_linear_velocity" }, + { 0xA89, "airdrop_override_death_moving_platform" }, + { 0xA8A, "airdrop_override_invalid_moving_platform" }, + { 0xA8B, "airdrop_reward" }, + { 0xA8C, "airdropcratecollision" }, + { 0xA8D, "airdropdetonateonstuck" }, + { 0xA8E, "airdropmarkeractivate" }, + { 0xA8F, "airdroptype" }, + { 0xA91, "airlock_glass_fog" }, + { 0xA92, "airlock_interior_hatch" }, + { 0xA93, "airlockexplode" }, + { 0xA94, "airplane_list" }, + { 0xA95, "airshipflydefense" }, + { 0xA97, "airshipfx" }, + { 0xA98, "airshipfxonclient" }, + { 0xA99, "airshipfxonconnect" }, + { 0xA9A, "airshippitchhatchdown" }, + { 0xA9B, "airshippitchhatchup" }, + { 0xA9C, "airshippitchpropsdown" }, + { 0xA9D, "airshippitchpropsup" }, + { 0xA9E, "airspread" }, + { 0xA9F, "airstrike_earthquake" }, + { 0xAA0, "airstrikedamagedents" }, + { 0xAA1, "airstrikedamagedentscount" }, + { 0xAA2, "airstrikedamagedentsindex" }, + { 0xAA3, "airstrikedamageentsthread" }, + { 0xAA4, "airstrikeexplosion" }, + { 0xAA6, "airstrikeheightscale" }, + { 0xAA7, "airstrikeinprogress" }, + { 0xAA8, "airstrikemadeselectionvo" }, + { 0xAA9, "airstrikessfx" }, + { 0xAAA, "airstriketype" }, + { 0xAAB, "aishootplayer" }, + { 0xAAC, "aispread" }, + { 0xAAD, "aistate" }, + { 0xAAE, "aisuppressai" }, + { 0xAAF, "aithreadthreader" }, + { 0xAB0, "aiturnnotifies" }, + { 0xAB1, "aitype_check" }, + { 0xAB2, "aiupdateanimstate" }, + { 0xAB3, "aiupdatecombat" }, + { 0xAB4, "aiupdatesuppressed" }, + { 0xAB5, "aiweapon" }, + { 0xAB6, "ajax_flare" }, + { 0xAB7, "alarm_annoyance" }, + { 0xAB8, "alarm_ent" }, + { 0xAB9, "alarm_interval" }, + { 0xABA, "alarm_playing" }, + { 0xABB, "alarm_validate_damage" }, + { 0xABC, "alarms" }, + { 0xABD, "alarms2" }, + { 0xABE, "alarms_1" }, + { 0xABF, "alarms_2" }, + { 0xAC0, "alarms_3" }, + { 0xAC1, "alert_all" }, + { 0xAC3, "alert_enemies" }, + { 0xAC4, "alert_enemies_early" }, + { 0xAC5, "alert_enemies_react" }, + { 0xAC6, "alert_level" }, + { 0xAC7, "alert_level_table" }, + { 0xAC8, "alert_on_chopper_damage" }, + { 0xAC9, "alert_team" }, + { 0xACA, "alertface" }, + { 0xACB, "alias" }, + { 0xACC, "alien_ai_debug_print" }, + { 0xACD, "alien_area_init" }, + { 0xACE, "alien_attack" }, + { 0xACF, "alien_attack_enemy" }, + { 0xAD0, "alien_attack_sequence" }, + { 0xAD1, "alien_attribute_table_init" }, + { 0xAD2, "alien_begindeployableviamarker" }, + { 0xAD3, "alien_challenge_table" }, + { 0xAD4, "alien_character_cac_table" }, + { 0xAD5, "alien_cloak" }, + { 0xAD6, "alien_collectibles_table" }, + { 0xAD7, "alien_combat_resource_callbacks" }, + { 0xAD8, "alien_combat_resources" }, + { 0xAD9, "alien_combat_resources_table" }, + { 0xADA, "alien_customprematchperiod" }, + { 0xADB, "alien_cycle_intermission" }, + { 0xADC, "alien_cycle_table" }, + { 0xADD, "alien_cycle_table_hardcore" }, + { 0xADE, "alien_eyes_off" }, + { 0xADF, "alien_eyes_off_on_death" }, + { 0xAE0, "alien_eyes_on" }, + { 0xAE1, "alien_eyes_on_threaded" }, + { 0xAE2, "alien_fire_off" }, + { 0xAE3, "alien_fire_on" }, + { 0xAE4, "alien_funcs" }, + { 0xAE5, "alien_health_per_player_init" }, + { 0xAE6, "alien_health_per_player_scalar" }, + { 0xAE8, "alien_jump_melee_speed" }, + { 0xAE9, "alien_loadout" }, + { 0xAEA, "alien_loot_initialized" }, + { 0xAEB, "alien_lurker_behavior" }, + { 0xAEC, "alien_lurker_init" }, + { 0xAED, "alien_lurkers" }, + { 0xAEE, "alien_main_loop" }, + { 0xAEF, "alien_make_entity_sentient" }, + { 0xAF0, "alien_max_rank" }, + { 0xAF1, "alien_melee" }, + { 0xAF2, "alien_mode" }, + { 0xAF3, "alien_mode_enable" }, + { 0xAF4, "alien_mode_enable_raw" }, + { 0xAF5, "alien_mode_feature" }, + { 0xAF6, "alien_mode_feature_strings" }, + { 0xAF7, "alien_mode_has" }, + { 0xAF8, "alien_noncombat" }, + { 0xAFA, "alien_perks" }, + { 0xAFB, "alien_perks_table" }, + { 0xAFC, "alien_pet" }, + { 0xAFD, "alien_pet_follow" }, + { 0xAFE, "alien_player_spawn_group" }, + { 0xAFF, "alien_pregame_delay" }, + { 0xB00, "alien_ranks" }, + { 0xB02, "alien_retreat" }, + { 0xB03, "alien_scene_behavior" }, + { 0xB04, "alien_scene_init" }, + { 0xB05, "alien_scripted" }, + { 0xB06, "alien_synch_attack_enemy" }, + { 0xB07, "alien_test_jump" }, + { 0xB08, "alien_test_loop" }, + { 0xB09, "alien_town_intro" }, + { 0xB0A, "alien_town_intro_precache_characters" }, + { 0xB0C, "alien_type" }, + { 0xB0E, "alien_unlock_data" }, + { 0xB0F, "alien_unlock_table" }, + { 0xB11, "alien_used_resource_rank" }, + { 0xB12, "alien_vo_priority_level" }, + { 0xB14, "alien_wave" }, + { 0xB15, "alien_wave_behavior" }, + { 0xB16, "alien_wave_init" }, + { 0xB18, "alien_wave_spawn_think" }, + { 0xB19, "alien_wave_status" }, + { 0xB1A, "alien_wave_table" }, + { 0xB1B, "alien_xp" }, + { 0xB1C, "alienagentspawn" }, + { 0xB1D, "alienagentthink" }, + { 0xB1E, "alienanimdata" }, + { 0xB1F, "alienbbdata" }, + { 0xB20, "alienclimbdown" }, + { 0xB21, "alienclimbup" }, + { 0xB22, "alienendgame" }, + { 0xB24, "alienmovebackanimchance" }, + { 0xB25, "alienoutcomenotify" }, + { 0xB26, "alienplayerarmor" }, + { 0xB29, "alienplayerpainbreathingsound" }, + { 0xB2A, "alienregulartraversal" }, + { 0xB2B, "aliens_give_currency_func" }, + { 0xB2C, "aliens_make_entity_sentient_func" }, + { 0xB2D, "aliensnarecount" }, + { 0xB2F, "alienspawnlogic" }, + { 0xB30, "alientraversenotetrackhandler" }, + { 0xB31, "alientypecandofriendlydamage" }, + { 0xB32, "align_chalk_marks" }, + { 0xB33, "aligntoverticaledge" }, + { 0xB35, "alivecount" }, + { 0xB36, "aliveplayers" }, + { 0xB37, "all_challenge_completed" }, + { 0xB38, "all_dom_flags" }, + { 0xB39, "all_players_istouching" }, + { 0xB3A, "all_rappel_pt3_downstairs_enemies" }, + { 0xB3C, "all_scenes" }, + { 0xB3D, "all_team_steak_col" }, + { 0xB3E, "all_team_streak_col" }, + { 0xB3F, "allcrashes" }, + { 0xB40, "alley_bokehdots" }, + { 0xB41, "alley_bokehdots_old" }, + { 0xB42, "alley_end_of_alley_fx" }, + { 0xB44, "alley_fill_shallow" }, + { 0xB45, "alley_flood" }, + { 0xB46, "alley_flood_collision_cheater" }, + { 0xB47, "alley_flood_far_vfx_attachments" }, + { 0xB48, "alley_flood_fx" }, + { 0xB49, "alley_flood_near_vfx_attachments" }, + { 0xB4A, "alley_flood_spawn" }, + { 0xB4C, "alley_flood_water" }, + { 0xB4D, "alley_froth_vfx" }, + { 0xB4E, "alley_giantsplashes_left" }, + { 0xB50, "alley_kill_triggers" }, + { 0xB51, "alley_near" }, + { 0xB52, "alley_stumble" }, + { 0xB53, "allie1_tussbubbs" }, + { 0xB55, "allies_baker_command_end_anim" }, + { 0xB56, "allies_baker_console_anims" }, + { 0xB57, "allies_baker_flarestack_exit" }, + { 0xB58, "allies_baker_hold" }, + { 0xB59, "allies_baker_hold_approach_and_idle" }, + { 0xB5A, "allies_breach_anim_node" }, + { 0xB5B, "allies_building_entry_movement" }, + { 0xB5C, "allies_building_entry_vo" }, + { 0xB5D, "allies_building_exit_hookup" }, + { 0xB60, "allies_convoy_dialogue" }, + { 0xB61, "allies_cqbwalk" }, + { 0xB62, "allies_dam_vign" }, + { 0xB63, "allies_dialog_col" }, + { 0xB64, "allies_dialog_playing" }, + { 0xB65, "allies_engine_room" }, + { 0xB66, "allies_first_advance" }, + { 0xB67, "allies_gunship_run" }, + { 0xB68, "allies_help_when_player_shoots_balcony_enemies" }, + { 0xB6A, "allies_help_when_player_shoots_second_floor_left" }, + { 0xB6B, "allies_help_when_player_shoots_second_floor_middle_or_right" }, + { 0xB6C, "allies_hesh_final_position" }, + { 0xB6D, "allies_inverted_rappel_movement" }, + { 0xB6E, "allies_inverted_rappel_vo" }, + { 0xB6F, "allies_jeep_sync_anim" }, + { 0xB70, "allies_move_down_to_first_floor_combat" }, + { 0xB71, "allies_move_down_to_second_floor_combat" }, + { 0xB72, "allies_move_down_to_third_floor_combat" }, + { 0xB73, "allies_move_to_checkpoint_start" }, + { 0xB76, "allies_movement_post_missile_launch" }, + { 0xB77, "allies_movement_tower" }, + { 0xB78, "allies_movement_warehouse" }, + { 0xB79, "allies_mudpumps" }, + { 0xB7A, "allies_rappel_anims" }, + { 0xB7B, "allies_rappel_stealth_anims" }, + { 0xB7F, "allies_ride_chopper" }, + { 0xB80, "allies_run_for_garage" }, + { 0xB81, "allies_sat1" }, + { 0xB82, "allies_sat2" }, + { 0xB83, "allies_shadow_kill_movement" }, + { 0xB84, "allies_shadow_kill_vo" }, + { 0xB85, "allies_start_cqb" }, + { 0xB86, "allies_stealth_behavior_end_count" }, + { 0xB87, "allies_tanks" }, + { 0xB88, "allies_throw_smoke" }, + { 0xB89, "allies_to_rappel" }, + { 0xB8A, "allies_vo_post_missile_launch" }, + { 0xB8B, "allies_vo_tower" }, + { 0xB8D, "alliescapturing" }, + { 0xB8E, "allieschopper" }, + { 0xB8F, "alliesinsertchopper" }, + { 0xB90, "alliesteletostartspot" }, + { 0xB91, "allow_dry_fire" }, + { 0xB92, "allow_fall" }, + { 0xB93, "allow_fire" }, + { 0xB94, "allow_glass_break_slide" }, + { 0xB96, "allow_level_killstreak" }, + { 0xB97, "allow_movement" }, + { 0xB98, "allow_pipe_damage" }, + { 0xB99, "allow_player_ascend_move" }, + { 0xB9A, "allow_sprint" }, + { 0xB9B, "allow_walk_up" }, + { 0xB9C, "allowable_double_attachments" }, + { 0xB9D, "allowboard" }, + { 0xB9F, "allowclasschoice" }, + { 0xBA0, "allowcrouch" }, + { 0xBA1, "allowed_cycles" }, + { 0xBA3, "allowedcallouts" }, + { 0xBA4, "allowedinsolo" }, + { 0xBA5, "allowedpartialreloadontheruntime" }, + { 0xBA6, "allowedtofire" }, + { 0xBA7, "allowempdamage" }, + { 0xBA8, "allowenemyspectate" }, + { 0xBA9, "allowfauxdeath" }, + { 0xBAA, "allowfreespectate" }, + { 0xBAB, "allowgrenadedamage" }, + { 0xBAC, "allowlaststandai" }, + { 0xBAD, "allowlatecomers" }, + { 0xBAF, "allowneutral" }, + { 0xBB0, "allowridekillstreakplayerexit" }, + { 0xBB1, "allowsafeeject" }, + { 0xBB2, "allowshoot" }, + { 0xBB3, "allowteamchoice" }, + { 0xBB4, "allowtelefrag" }, + { 0xBB5, "allowuse" }, + { 0xBB6, "allowvehicledamage" }, + { 0xBB7, "allowvote" }, + { 0xBB8, "allowweapons" }, + { 0xBB9, "ally" }, + { 0xBBA, "ally0_inhere" }, + { 0xBBB, "ally0_instruction_vo" }, + { 0xBBC, "ally0_instruction_vo_holdup" }, + { 0xBBD, "ally0_instruction_vo_table" }, + { 0xBBE, "ally0_main" }, + { 0xBBF, "ally0_main_int" }, + { 0xBC1, "ally0_move_to_end" }, + { 0xBC2, "ally0_start_path2" }, + { 0xBC3, "ally0_traversal_logic" }, + { 0xBC4, "ally1_ascend_ascender" }, + { 0xBC5, "ally1_ascend_launcher" }, + { 0xBC8, "ally1_main_int" }, + { 0xBC9, "ally1_mall" }, + { 0xBCA, "ally2_ascend_ascender" }, + { 0xBCB, "ally2_ascend_launcher" }, + { 0xBCC, "ally2_main" }, + { 0xBCD, "ally2_main_int" }, + { 0xBCE, "ally2_mall" }, + { 0xBCF, "ally_0_animation" }, + { 0xBD0, "ally_1_animation" }, + { 0xBD2, "ally_advance_watcher" }, + { 0xBD4, "ally_alley_flood_spawn" }, + { 0xBD5, "ally_animate_vault_scene" }, + { 0xBD6, "ally_breach_gas" }, + { 0xBD7, "ally_breach_goal" }, + { 0xBD8, "ally_breach_vo" }, + { 0xBD9, "ally_calm_idle_internal" }, + { 0xBDB, "ally_catchup" }, + { 0xBDC, "ally_catchup_solo" }, + { 0xBDF, "ally_cleanup" }, + { 0xBE0, "ally_clear_flee_behavior" }, + { 0xBE1, "ally_color_node_movement" }, + { 0xBE2, "ally_console_scene" }, + { 0xBE3, "ally_cqb_kill" }, + { 0xBE4, "ally_cqb_kill_solo" }, + { 0xBE5, "ally_crouch_walk_to_goal" }, + { 0xBE6, "ally_current_state" }, + { 0xBE7, "ally_dialogue" }, + { 0xBE8, "ally_do_reload_anim" }, + { 0xBE9, "ally_dog_attack_free" }, + { 0xBEB, "ally_dog_follow_owner" }, + { 0xBED, "ally_dog_guard_owner" }, + { 0xBEE, "ally_dog_guardpoint_radius" }, + { 0xBEF, "ally_dog_scripted" }, + { 0xBF0, "ally_dog_search_radius" }, + { 0xBF1, "ally_dog_sniff_mode" }, + { 0xBF2, "ally_dog_think" }, + { 0xBF3, "ally_dogs" }, + { 0xBF6, "ally_edge_nodes" }, + { 0xBF8, "ally_elevator_clip_back" }, + { 0xBF9, "ally_ent_del" }, + { 0xBFA, "ally_finale_logic" }, + { 0xBFB, "ally_finale_movement_setup" }, + { 0xBFC, "ally_fire_until_out_of_ammo" }, + { 0xBFD, "ally_fire_until_out_of_ammo_internal" }, + { 0xBFE, "ally_fired" }, + { 0xBFF, "ally_first_frame_check" }, + { 0xC00, "ally_flee_setup" }, + { 0xC01, "ally_garage" }, + { 0xC02, "ally_garage_sneak" }, + { 0xC03, "ally_get_fire_animation" }, + { 0xC04, "ally_get_horizontal_start_distance" }, + { 0xC05, "ally_get_horizontal_stop_distance" }, + { 0xC06, "ally_get_vertical_stop_anim_distance" }, + { 0xC0A, "ally_goggle_glow_on" }, + { 0xC0B, "ally_grenade" }, + { 0xC0C, "ally_groups" }, + { 0xC0E, "ally_gun_hide" }, + { 0xC0F, "ally_gun_show" }, + { 0xC11, "ally_impact_org" }, + { 0xC12, "ally_intro_anims_and_logic" }, + { 0xC13, "ally_invasion_scene_approach" }, + { 0xC14, "ally_is_aiming" }, + { 0xC17, "ally_kill" }, + { 0xC18, "ally_left_death" }, + { 0xC19, "ally_listen_dog_commands" }, + { 0xC1A, "ally_littlebird_1" }, + { 0xC1B, "ally_littlebird_2" }, + { 0xC1D, "ally_main" }, + { 0xC1E, "ally_main_walk" }, + { 0xC1F, "ally_make_fall" }, + { 0xC21, "ally_move_to_jeep" }, + { 0xC22, "ally_movement" }, + { 0xC24, "ally_nagging" }, + { 0xC25, "ally_new_state" }, + { 0xC26, "ally_node_logic" }, + { 0xC27, "ally_on_stairs" }, + { 0xC28, "ally_owner" }, + { 0xC29, "ally_physics_pulse" }, + { 0xC2A, "ally_push" }, + { 0xC2B, "ally_push_player_after_unload" }, + { 0xC2C, "ally_rappel_distance2dsquared_to_player" }, + { 0xC2F, "ally_rappel_get_aim_pitch" }, + { 0xC30, "ally_rappel_get_aim_yaw" }, + { 0xC31, "ally_rappel_get_enemy" }, + { 0xC32, "ally_rappel_get_rope_start" }, + { 0xC34, "ally_rappel_moving_change_direction" }, + { 0xC35, "ally_rappel_moving_stop_idle" }, + { 0xC36, "ally_rappel_moving_vertical_stop" }, + { 0xC37, "ally_rappel_pause_movement_horizontal" }, + { 0xC38, "ally_rappel_reload" }, + { 0xC39, "ally_rappel_rope" }, + { 0xC3B, "ally_rappel_set_perfect_accuracy" }, + { 0xC3C, "ally_rappel_setup_rope" }, + { 0xC3D, "ally_rappel_start_aiming" }, + { 0xC3E, "ally_rappel_start_movement_horizontal" }, + { 0xC3F, "ally_rappel_start_movement_horizontal_internal" }, + { 0xC40, "ally_rappel_start_rope" }, + { 0xC41, "ally_rappel_start_shooting" }, + { 0xC42, "ally_rappel_stealth_movement_vertical" }, + { 0xC43, "ally_rappel_stop_aiming" }, + { 0xC44, "ally_rappel_stop_rope" }, + { 0xC45, "ally_rappel_stop_shooting" }, + { 0xC47, "ally_reset_second_floor_right" }, + { 0xC48, "ally_reset_weights" }, + { 0xC4A, "ally_roof_collapsing_vo" }, + { 0xC4B, "ally_rooftop_water_to_debrisbridge" }, + { 0xC4C, "ally_rubber_banding_solo" }, + { 0xC4D, "ally_set_initial_weights" }, + { 0xC4E, "ally_setup" }, + { 0xC4F, "ally_setup_aim" }, + { 0xC51, "ally_shoot_at_enemy" }, + { 0xC52, "ally_shoot_convoy" }, + { 0xC53, "ally_shoot_nodes" }, + { 0xC54, "ally_shoot_think" }, + { 0xC55, "ally_shooting_loop" }, + { 0xC56, "ally_shoots_fire_extinguisher" }, + { 0xC57, "ally_sprint" }, + { 0xC58, "ally_sprint_end" }, + { 0xC59, "ally_sprint_setup" }, + { 0xC5A, "ally_start" }, + { 0xC5B, "ally_start_1" }, + { 0xC5C, "ally_start_2" }, + { 0xC5D, "ally_start_calm_idle" }, + { 0xC5E, "ally_start_cornerwaving" }, + { 0xC5F, "ally_stealth_kill" }, + { 0xC60, "ally_stealth_settings" }, + { 0xC61, "ally_stop_calm_idle" }, + { 0xC67, "ally_through_sat_panel" }, + { 0xC68, "ally_to_magicbullet" }, + { 0xC69, "ally_transition_to_target_weights" }, + { 0xC6A, "ally_turnanim_hack" }, + { 0xC6B, "ally_vault_props" }, + { 0xC6C, "ally_vo" }, + { 0xC6D, "ally_wait_to_get_impatient" }, + { 0xC6E, "ally_zipline_count" }, + { 0xC6F, "ally_zipline_nag" }, + { 0xC70, "allyagentthink" }, + { 0xC71, "allyc17_right_waits" }, + { 0xC72, "allyheli" }, + { 0xC76, "allytank1" }, + { 0xC7A, "allytime" }, + { 0xC7B, "alpha1" }, + { 0xC7C, "alpha2" }, + { 0xC7E, "alpha_ascend_rubberband_cleanup" }, + { 0xC7F, "alpha_curr_rate" }, + { 0xC80, "alphabetize" }, + { 0xC81, "already_checking_udwfx" }, + { 0xC82, "already_dumpped" }, + { 0xC83, "already_issued" }, + { 0xC84, "already_ran_function" }, + { 0xC85, "already_spawned" }, + { 0xC86, "already_stuck" }, + { 0xC87, "already_thrown" }, + { 0xC89, "alreadyaddedtoalivecount" }, + { 0xC8B, "alreadyrotating" }, + { 0xC8C, "alreadystumbling" }, + { 0xC8D, "alreadytarget" }, + { 0xC8E, "alsodamageparent" }, + { 0xC8F, "alt_override" }, + { 0xC90, "alternates" }, + { 0xC91, "altitude" }, + { 0xC92, "altitude_adjusted" }, + { 0xC93, "altitude_min_override" }, + { 0xC94, "altitude_min_override_remove" }, + { 0xC95, "altitude_override_over_time" }, + { 0xC96, "altitudepolls" }, + { 0xC97, "altwarning" }, + { 0xC98, "always_pain" }, + { 0xC99, "always_play_pain_sound" }, + { 0xC9A, "alwaysdrawfriendlynames" }, + { 0xC9B, "alwaysgamemodeclass" }, + { 0xC9C, "alwayslookatfirsttarget" }, + { 0xC9D, "alwaysquake" }, + { 0xC9E, "alwaysrocketdeath" }, + { 0xC9F, "alwaysrunforward" }, + { 0xCA0, "amb_quakes" }, + { 0xCA1, "ambience_inner" }, + { 0xCA3, "ambient" }, + { 0xCA4, "ambient_a10s" }, + { 0xCA5, "ambient_airburst_periph_cleanup" }, + { 0xCA6, "ambient_airbursts" }, + { 0xCA7, "ambient_airbursts_player_effcts" }, + { 0xCA8, "ambient_airbursts_startpoint" }, + { 0xCAA, "ambient_animate" }, + { 0xCAB, "ambient_breach_tank_a10_pass" }, + { 0xCAC, "ambient_building_elevators" }, + { 0xCAD, "ambient_building_explosions" }, + { 0xCAE, "ambient_building_lights" }, + { 0xCAF, "ambient_building_lights_internal" }, + { 0xCB0, "ambient_canyon_airburst_close_shake" }, + { 0xCB1, "ambient_canyon_airburst_fx_teleport_and_delete" }, + { 0xCB3, "ambient_canyon_airbursts_periph" }, + { 0xCB5, "ambient_choppers" }, + { 0xCB6, "ambient_combat_guys" }, + { 0xCB7, "ambient_derrick_animation" }, + { 0xCB8, "ambient_drones" }, + { 0xCB9, "ambient_event_thread" }, + { 0xCBA, "ambient_ext" }, + { 0xCBB, "ambient_fence_shocks" }, + { 0xCBC, "ambient_guys_anims" }, + { 0xCBD, "ambient_hinds" }, + { 0xCBE, "ambient_int" }, + { 0xCBF, "ambient_jet_by_sound" }, + { 0xCC2, "ambient_nh90_landers" }, + { 0xCC4, "ambient_road_runners" }, + { 0xCC5, "ambient_road_vehicles" }, + { 0xCC6, "ambient_rog_strike" }, + { 0xCC7, "ambient_rog_strike_intro" }, + { 0xCC9, "ambient_rog_strike_timer" }, + { 0xCCA, "ambient_runner_think" }, + { 0xCCC, "ambient_track" }, + { 0xCCD, "ambient_vehicle_spawning" }, + { 0xCCF, "ambush_duration" }, + { 0xCD1, "ambush_enemies" }, + { 0xCD5, "ambush_guy_outcome_logic" }, + { 0xCD6, "ambush_hidden_settings" }, + { 0xCD7, "ambush_init" }, + { 0xCD8, "ambush_jeep2_backr" }, + { 0xCD9, "ambush_jeep2_driver" }, + { 0xCDA, "ambush_jeep2_guy_wave" }, + { 0xCDB, "ambush_jeep2_passenger" }, + { 0xCDD, "ambush_jeep_latch_close_lf" }, + { 0xCDF, "ambush_jeep_latch_close_rr" }, + { 0xCE0, "ambush_jeep_latch_open_lf" }, + { 0xCE1, "ambush_jeep_latch_open_rf" }, + { 0xCE2, "ambush_jeep_latch_open_rr" }, + { 0xCE3, "ambush_jeep_passenger" }, + { 0xCE6, "ambush_kill_ally" }, + { 0xCE7, "ambush_kill_driver" }, + { 0xCE8, "ambush_kill_driver_cypher" }, + { 0xCE9, "ambush_kill_driver_player" }, + { 0xCEA, "ambush_main" }, + { 0xCEB, "ambush_notify_on_player_kill" }, + { 0xCEC, "ambush_notify_on_player_shot" }, + { 0xCEE, "ambush_patrol_guys" }, + { 0xCEF, "ambush_patrol_logic" }, + { 0xCF0, "ambush_patrollers" }, + { 0xCF1, "ambush_player_did_ambush" }, + { 0xCF2, "ambush_player_ran_ahead" }, + { 0xCF3, "ambush_recover_anim" }, + { 0xCF4, "ambush_script" }, + { 0xCF5, "ambush_stealth_settings" }, + { 0xCF6, "ambush_trap_ent" }, + { 0xCF8, "ambush_yaw" }, + { 0xCFB, "ammo" }, + { 0xCFC, "ammo_cache_think_global" }, + { 0xCFD, "ammo_crate_failsafe" }, + { 0xCFE, "ammo_hack" }, + { 0xCFF, "ammo_icon" }, + { 0xD00, "ammo_icon_fade_in" }, + { 0xD01, "ammo_icon_fade_out" }, + { 0xD04, "ammo_pickup" }, + { 0xD05, "ammo_thrower_scene" }, + { 0xD06, "ammocheatinterval" }, + { 0xD07, "ammocheattime" }, + { 0xD08, "ammocount" }, + { 0xD09, "ammocounterhide" }, + { 0xD0A, "ammoomnvar" }, + { 0xD0B, "ammopickup" }, + { 0xD0C, "ammopickupfunc" }, + { 0xD0D, "ammopickupmodel" }, + { 0xD0E, "ammorefillprimary" }, + { 0xD0F, "ammorefillsecondary" }, + { 0xD10, "ammorestockcheckfreq" }, + { 0xD13, "amount" }, + { 0xD14, "amplitude" }, + { 0xD16, "anchor_line_impact" }, + { 0xD17, "angel_flare" }, + { 0xD18, "angel_flare_burst" }, + { 0xD19, "angelflareprecache" }, + { 0xD1A, "angered" }, + { 0xD1B, "angle_180" }, + { 0xD1D, "angle_lerp" }, + { 0xD1E, "angle_offset" }, + { 0xD1F, "anglerangethread" }, + { 0xD20, "angles3d" }, + { 0xD23, "angles_within" }, + { 0xD24, "anglescheck" }, + { 0xD25, "anglesclamp180" }, + { 0xD28, "angry_flood_big_wave_water" }, + { 0xD2B, "angry_flood_collision_cheater" }, + { 0xD2C, "angry_flood_collision_cheater_spawn" }, + { 0xD2D, "angry_flood_collision_dodamage" }, + { 0xD2E, "angry_flood_collision_spawn" }, + { 0xD2F, "angry_flood_finishing_move" }, + { 0xD30, "angry_flood_rumble" }, + { 0xD31, "angry_flood_rumble_loop" }, + { 0xD32, "angry_flood_splash_sequencing_lf" }, + { 0xD34, "angry_flood_street_mist" }, + { 0xD35, "angry_flood_water" }, + { 0xD36, "anim_addmodel" }, + { 0xD37, "anim_animationendnotify" }, + { 0xD38, "anim_array" }, + { 0xD39, "anim_at_entity" }, + { 0xD3A, "anim_at_self" }, + { 0xD3B, "anim_base" }, + { 0xD3C, "anim_blend_time_override" }, + { 0xD3D, "anim_boost" }, + { 0xD3E, "anim_break_entrance" }, + { 0xD3F, "anim_changes_pushplayer" }, + { 0xD41, "anim_custom_animmode" }, + { 0xD42, "anim_custom_animmode_loop" }, + { 0xD43, "anim_custom_animmode_loop_solo" }, + { 0xD44, "anim_custom_animmode_on_guy" }, + { 0xD46, "anim_deathnotify" }, + { 0xD47, "anim_dialogueendnotify" }, + { 0xD48, "anim_disablepain" }, + { 0xD49, "anim_dontpushplayer" }, + { 0xD4A, "anim_down_move_strength" }, + { 0xD4B, "anim_drop_bone" }, + { 0xD4C, "anim_end_early" }, + { 0xD4D, "anim_end_early_animationendnotify" }, + { 0xD4E, "anim_end_early_deathnotify" }, + { 0xD4F, "anim_end_early_dialogueendnotify" }, + { 0xD50, "anim_end_early_facialendnotify" }, + { 0xD53, "anim_enemies_non_combat" }, + { 0xD54, "anim_enemies_non_combat_rate" }, + { 0xD57, "anim_ent_a" }, + { 0xD58, "anim_ent_b" }, + { 0xD59, "anim_ent_c" }, + { 0xD5C, "anim_facialanim" }, + { 0xD5F, "anim_fake_loop_endon" }, + { 0xD60, "anim_first_frame" }, + { 0xD61, "anim_first_frame_on_guy" }, + { 0xD62, "anim_first_frame_solo" }, + { 0xD63, "anim_first_roll_everyone" }, + { 0xD66, "anim_generic_custom_animmode_loop" }, + { 0xD69, "anim_generic_gravity_run" }, + { 0xD6A, "anim_generic_loop" }, + { 0xD6B, "anim_generic_queue" }, + { 0xD6C, "anim_generic_reach" }, + { 0xD6D, "anim_generic_reach_and_animate" }, + { 0xD6E, "anim_generic_reach_and_arrive" }, + { 0xD6F, "anim_generic_run" }, + { 0xD70, "anim_generic_teleport" }, + { 0xD71, "anim_gunhand" }, + { 0xD72, "anim_guninhand" }, + { 0xD73, "anim_handle_notetrack" }, + { 0xD74, "anim_head_faceplate" }, + { 0xD75, "anim_index" }, + { 0xD76, "anim_intro_dog" }, + { 0xD77, "anim_intro_sniper" }, + { 0xD79, "anim_last_frame_solo" }, + { 0xD7A, "anim_length" }, + { 0xD7B, "anim_length_frames_left" }, + { 0xD7C, "anim_link_tag_model" }, + { 0xD7D, "anim_loop" }, + { 0xD7E, "anim_loop_packet" }, + { 0xD80, "anim_loop_solo" }, + { 0xD81, "anim_minigun_hands" }, + { 0xD82, "anim_models" }, + { 0xD83, "anim_moveto" }, + { 0xD84, "anim_node" }, + { 0xD85, "anim_org" }, + { 0xD86, "anim_player_and_allies" }, + { 0xD87, "anim_player_target_enemy" }, + { 0xD89, "anim_precache" }, + { 0xD8A, "anim_prop_init_threads" }, + { 0xD8B, "anim_prop_models" }, + { 0xD8C, "anim_prop_models_animtree" }, + { 0xD8E, "anim_props_animated" }, + { 0xD8F, "anim_pushplayer" }, + { 0xD90, "anim_reach" }, + { 0xD91, "anim_reach_and_approach" }, + { 0xD92, "anim_reach_and_approach_node_solo" }, + { 0xD93, "anim_reach_and_approach_solo" }, + { 0xD94, "anim_reach_and_idle" }, + { 0xD95, "anim_reach_and_idle_solo" }, + { 0xD96, "anim_reach_and_plant" }, + { 0xD98, "anim_reach_failsafe" }, + { 0xD99, "anim_reach_idle" }, + { 0xD9A, "anim_reach_play" }, + { 0xD9B, "anim_reach_solo" }, + { 0xD9D, "anim_reach_together" }, + { 0xD9E, "anim_reach_with_funcs" }, + { 0xD9F, "anim_ref" }, + { 0xDA1, "anim_removemodel" }, + { 0xDA2, "anim_right_move_strength" }, + { 0xDA3, "anim_scene" }, + { 0xDA4, "anim_self_set_time" }, + { 0xDA5, "anim_sequence" }, + { 0xDA6, "anim_set_rate" }, + { 0xDA7, "anim_set_rate_internal" }, + { 0xDA8, "anim_set_rate_single" }, + { 0xDA9, "anim_set_time" }, + { 0xDAA, "anim_single" }, + { 0xDAB, "anim_single_end_early" }, + { 0xDAC, "anim_single_failsafe" }, + { 0xDAD, "anim_single_failsafeonguy" }, + { 0xDAE, "anim_single_internal" }, + { 0xDAF, "anim_single_queue" }, + { 0xDB0, "anim_single_run" }, + { 0xDB1, "anim_single_run_solo" }, + { 0xDB2, "anim_single_solo" }, + { 0xDB4, "anim_spawn_generic_model" }, + { 0xDB6, "anim_spawn_replace_with_model" }, + { 0xDB7, "anim_spawn_tag_model" }, + { 0xDB8, "anim_spawner_teleport" }, + { 0xDB9, "anim_start_at_groundpos" }, + { 0xDBA, "anim_start_pos" }, + { 0xDBB, "anim_start_pos_solo" }, + { 0xDBC, "anim_stopanimscripted" }, + { 0xDBD, "anim_teleport" }, + { 0xDBE, "anim_teleport_solo" }, + { 0xDBF, "anim_time" }, + { 0xDC0, "anim_timing" }, + { 0xDC1, "anim_up_down_boost" }, + { 0xDC2, "anim_wait_func" }, + { 0xDC3, "anim_weight" }, + { 0xDC5, "animarray" }, + { 0xDC6, "animarrayanyexist" }, + { 0xDC7, "animarrayfuncs" }, + { 0xDC8, "animarraypickrandom" }, + { 0xDC9, "animate_after_movement" }, + { 0xDCA, "animate_allies_to_train" }, + { 0xDCB, "animate_ally_breach" }, + { 0xDCC, "animate_ambush_scene_enemies" }, + { 0xDCD, "animate_and_get_shot" }, + { 0xDCE, "animate_arms" }, + { 0xDCF, "animate_chairs" }, + { 0xDD0, "animate_combat_two_intro_debris" }, + { 0xDD1, "animate_drive_idle" }, + { 0xDD3, "animate_ent" }, + { 0xDD4, "animate_front_station_01" }, + { 0xDD5, "animate_front_station_02" }, + { 0xDD6, "animate_front_station_03" }, + { 0xDD7, "animate_front_station_04" }, + { 0xDD8, "animate_front_station_05" }, + { 0xDD9, "animate_front_station_and_return_to_idle" }, + { 0xDDA, "animate_guys" }, + { 0xDDB, "animate_opposite_direction" }, + { 0xDDC, "animate_props_on_death" }, + { 0xDDD, "animate_til_volume" }, + { 0xDDE, "animate_turret_with_viewmodel" }, + { 0xDDF, "animate_vault_door" }, + { 0xDE0, "animate_vault_light" }, + { 0xDE1, "animate_vip_enemies" }, + { 0xDE2, "animated_doors" }, + { 0xDE3, "animated_logs" }, + { 0xDE4, "animated_model" }, + { 0xDE5, "animated_models" }, + { 0xDE6, "animated_prop" }, + { 0xDE7, "animated_prop_anims" }, + { 0xDE9, "animated_sat_part" }, + { 0xDEA, "animated_scene" }, + { 0xDEB, "animated_scene_org" }, + { 0xDEC, "animated_script_model" }, + { 0xDED, "animated_warehouse_guys" }, + { 0xDEF, "animatedduffle" }, + { 0xDF0, "animatemodel" }, + { 0xDF1, "animatemoveintoplace" }, + { 0xDF5, "animcbs" }, + { 0xDF9, "animflagnameindex" }, + { 0xDFA, "animgaz" }, + { 0xDFB, "animhasfacialoverride" }, + { 0xDFC, "animlengths" }, + { 0xDFD, "animname" }, + { 0xDFE, "animnode" }, + { 0xDFF, "animoffset" }, + { 0xE00, "animontag" }, + { 0xE03, "animplaybackrate" }, + { 0xE05, "anims_curr" }, + { 0xE06, "animsapplied" }, + { 0xE07, "animscriptdonotetracksthread" }, + { 0xE09, "animset" }, + { 0xE0A, "animsets" }, + { 0xE0B, "animsound_aliases" }, + { 0xE0C, "animsound_exists" }, + { 0xE0D, "animsound_hud_extralines" }, + { 0xE0E, "animsound_hudlimit" }, + { 0xE0F, "animsound_start_tracker" }, + { 0xE10, "animsound_start_tracker_loop" }, + { 0xE12, "animsound_tracker" }, + { 0xE13, "animsounds" }, + { 0xE14, "animsounds_thisframe" }, + { 0xE15, "animspeeds" }, + { 0xE16, "animspot" }, + { 0xE18, "animsubstate" }, + { 0xE19, "animtree" }, + { 0xE1A, "animtype_idle" }, + { 0xE1B, "animtype_idle_shift" }, + { 0xE1C, "animtype_loop" }, + { 0xE1D, "animtype_loop_run" }, + { 0xE1E, "animtype_parent" }, + { 0xE1F, "animtype_run_stop" }, + { 0xE20, "animtype_shift_back" }, + { 0xE22, "animtype_stop" }, + { 0xE23, "anmimname" }, + { 0xE24, "announce_past_those_doors" }, + { 0xE25, "annoyance_tracker" }, + { 0xE26, "ant_races" }, + { 0xE27, "antenna" }, + { 0xE28, "antenna_kill" }, + { 0xE29, "antenna_rumble" }, + { 0xE2A, "anti_air_objectiv_trigger" }, + { 0xE2B, "antithreat" }, + { 0xE2C, "any_player_near_sentry" }, + { 0xE2D, "any_player_nearby" }, + { 0xE2E, "any_players_istouching" }, + { 0xE2F, "anyone_touching_blocker" }, + { 0xE30, "anyplayersinkillcam" }, + { 0xE31, "anythingtouchingtrigger" }, + { 0xE32, "ao" }, + { 0xE33, "aoeradius" }, + { 0xE34, "aoexponent" }, + { 0xE35, "aogain" }, + { 0xE36, "aomaxdist" }, + { 0xE37, "aoscalemin" }, + { 0xE39, "apache" }, + { 0xE3A, "apache1" }, + { 0xE3B, "apache2" }, + { 0xE3C, "apache_ally_path_attack_filter_targets" }, + { 0xE3D, "apache_ally_path_attack_func" }, + { 0xE3E, "apache_ally_path_attack_internal" }, + { 0xE3F, "apache_autosave_check" }, + { 0xE40, "apache_chase_allies_apache" }, + { 0xE41, "apache_chase_ally_apache_think" }, + { 0xE42, "apache_chase_ally_blackhawk_think" }, + { 0xE43, "apache_chase_enemies" }, + { 0xE44, "apache_chase_enemies_turret_think_delay" }, + { 0xE45, "apache_chatter" }, + { 0xE46, "apache_chatter_func" }, + { 0xE47, "apache_chatter_last" }, + { 0xE48, "apache_chatter_queue" }, + { 0xE49, "apache_chopper_enemies" }, + { 0xE4A, "apache_chopper_hind_on_death" }, + { 0xE4B, "apache_chopper_hind_spawn" }, + { 0xE4D, "apache_difficulty" }, + { 0xE4E, "apache_dmg_recent" }, + { 0xE4F, "apache_dmg_time" }, + { 0xE50, "apache_escort_encounter_final_wave_on_spawn" }, + { 0xE51, "apache_factory_ai_roof_on_spawn" }, + { 0xE52, "apache_factory_allies_apache_think" }, + { 0xE53, "apache_factory_ally_blackhawk_think" }, + { 0xE54, "apache_factory_enemies" }, + { 0xE55, "apache_factory_enemy_counts" }, + { 0xE56, "apache_factory_enemy_on_death" }, + { 0xE57, "apache_factory_hind_parked_on_death" }, + { 0xE58, "apache_factory_hind_parked_on_spawn" }, + { 0xE59, "apache_factory_objective" }, + { 0xE5B, "apache_health" }, + { 0xE5D, "apache_health_at_max" }, + { 0xE5E, "apache_health_get" }, + { 0xE5F, "apache_health_init" }, + { 0xE60, "apache_health_max" }, + { 0xE61, "apache_health_max_get" }, + { 0xE62, "apache_health_max_set" }, + { 0xE63, "apache_health_min" }, + { 0xE64, "apache_health_pct_get" }, + { 0xE65, "apache_health_pct_min_clear" }, + { 0xE66, "apache_health_pct_min_set" }, + { 0xE67, "apache_health_pct_set" }, + { 0xE68, "apache_health_set" }, + { 0xE69, "apache_health_state_next" }, + { 0xE6A, "apache_health_state_think" }, + { 0xE6C, "apache_hints_break_flares" }, + { 0xE6D, "apache_hints_break_mg" }, + { 0xE6E, "apache_hints_break_missile_lockon" }, + { 0xE6F, "apache_hints_break_missile_straight" }, + { 0xE70, "apache_hints_chase" }, + { 0xE72, "apache_hints_display_hint_timeout" }, + { 0xE73, "apache_hints_factory" }, + { 0xE74, "apache_hints_island" }, + { 0xE75, "apache_hints_move" }, + { 0xE78, "apache_hints_tutorial" }, + { 0xE79, "apache_missile_water_z" }, + { 0xE7B, "apache_mission_difficulty" }, + { 0xE7C, "apache_mission_heli_ai_collision" }, + { 0xE7D, "apache_mission_impact_water_missile_think" }, + { 0xE7E, "apache_mission_impact_water_missiles" }, + { 0xE7F, "apache_mission_impact_water_think" }, + { 0xE80, "apache_mission_vo_antiair" }, + { 0xE81, "apache_mission_vo_chopper" }, + { 0xE82, "apache_mission_vo_factory" }, + { 0xE84, "apache_mission_vo_finale" }, + { 0xE85, "apache_mission_vo_player_crashing" }, + { 0xE89, "apache_owner_notify_on_input_camera" }, + { 0xE8A, "apache_owner_notify_on_input_move" }, + { 0xE8B, "apache_player_adjust" }, + { 0xE8C, "apache_player_dead" }, + { 0xE8D, "apache_player_difficulty" }, + { 0xE8E, "apache_precache" }, + { 0xE8F, "apache_savecheck" }, + { 0xE90, "apache_sun_settings" }, + { 0xE92, "apache_target_manager" }, + { 0xE93, "apache_tutorial_fly_allies" }, + { 0xE94, "apache_tutorial_fly_allies_govern_speed" }, + { 0xE95, "apache_tutorial_fly_allies_govern_speed_stop" }, + { 0xE97, "apache_tutorial_fly_player_pitch_think" }, + { 0xE98, "apache_tutorial_fly_reactive_foliage" }, + { 0xE99, "apextraversaldeathvector" }, + { 0xE9B, "apply_difficulty_frac_with_func" }, + { 0xE9D, "apply_end_fog" }, + { 0xE9E, "apply_extra_last_stand" }, + { 0xE9F, "apply_fog" }, + { 0xEA0, "apply_friendly_fire_damage_modifier" }, + { 0xEA3, "apply_synch_attack_damage" }, + { 0xEA4, "apply_truckjunk" }, + { 0xEA5, "apply_weapons_status" }, + { 0xEA6, "apply_whizby" }, + { 0xEA7, "applyaliensnare" }, + { 0xEA8, "applyaliensnareinternal" }, + { 0xEA9, "applybombcarrierclass" }, + { 0xEAB, "applyflash" }, + { 0xEAC, "applyformat" }, + { 0xEAD, "applyformattype" }, + { 0xEAE, "applygaseffect" }, + { 0xEAF, "applyglobalempeffects" }, + { 0xEB0, "applyoutline" }, + { 0xEB1, "applyperplayerempeffects" }, + { 0xEB2, "applyperplayerempeffects_ondetonate" }, + { 0xEB3, "applystunresistence" }, + { 0xEB4, "approach_anims" }, + { 0xEB5, "approach_enemy" }, + { 0xEB6, "approach_types" }, + { 0xEB8, "approachnumber" }, + { 0xEBB, "approachwaittillclose" }, + { 0xEBC, "approx_dist_from_edge" }, + { 0xEBD, "arc_cached" }, + { 0xEBF, "arcademode_hud_timer" }, + { 0xEC0, "arcademode_stop_timer" }, + { 0xEC1, "arcademode_stoptime" }, + { 0xEC2, "archetype_exists" }, + { 0xEC3, "archetypechanged" }, + { 0xEC4, "archetypeexists" }, + { 0xEC5, "archetypes" }, + { 0xEC6, "archive" }, + { 0xEC7, "are_all_players_using_nuke" }, + { 0xEC8, "are_opposite_sign" }, + { 0xEC9, "area1_ents" }, + { 0xECA, "area_damage_and_impulse" }, + { 0xECB, "areaparallelpipid" }, + { 0xECD, "areatriange" }, + { 0xECE, "aredifferent" }, + { 0xECF, "arm_mine" }, + { 0xED0, "arm_player" }, + { 0xED1, "armingdelay" }, + { 0xED3, "armormitigation" }, + { 0xED4, "armorpiercingmod" }, + { 0xED5, "armorvestmod" }, + { 0xED6, "arms_and_legs" }, + { 0xED7, "armtime" }, + { 0xED9, "array_2dadd" }, + { 0xEDA, "array_add" }, + { 0xEDB, "array_call" }, + { 0xEDC, "array_combine" }, + { 0xEDD, "array_combine_keys" }, + { 0xEDE, "array_combine_non_integer_indices" }, + { 0xEE0, "array_compare" }, + { 0xEE1, "array_contains" }, + { 0xEE3, "array_contains_script_linkto" }, + { 0xEE4, "array_delete" }, + { 0xEE5, "array_delete_evenly" }, + { 0xEE6, "array_exclude" }, + { 0xEE7, "array_find" }, + { 0xEE8, "array_index_by_classname" }, + { 0xEE9, "array_index_by_parameters" }, + { 0xEEB, "array_insert" }, + { 0xEEC, "array_is_defined" }, + { 0xEED, "array_is_greater_than" }, + { 0xEEE, "array_keep_key_values" }, + { 0xEEF, "array_keep_values" }, + { 0xEF0, "array_kill" }, + { 0xEF1, "array_levelcall" }, + { 0xEF2, "array_levelthread" }, + { 0xEF3, "array_levelthread_safe" }, + { 0xEF5, "array_merge_links" }, + { 0xEF6, "array_notify" }, + { 0xEF7, "array_of_triggers1" }, + { 0xEF8, "array_of_triggers2" }, + { 0xEF9, "array_of_triggers3" }, + { 0xEFA, "array_randomize" }, + { 0xEFB, "array_remove" }, + { 0xEFC, "array_remove_array" }, + { 0xEFD, "array_remove_dupes" }, + { 0xEFE, "array_remove_duplicates" }, + { 0xF00, "array_remove_nokeys" }, + { 0xF01, "array_remove_perk" }, + { 0xF03, "array_remove_when_dead" }, + { 0xF04, "array_removedead" }, + { 0xF05, "array_removedead_keepkeys" }, + { 0xF07, "array_removedead_zodiac" }, + { 0xF08, "array_removeinvalidmissiles" }, + { 0xF09, "array_removeundefined" }, + { 0xF0A, "array_reverse" }, + { 0xF0B, "array_setgoalvolume" }, + { 0xF0C, "array_shift" }, + { 0xF0D, "array_sort_by_handler" }, + { 0xF0E, "array_sort_by_handler_parameter" }, + { 0xF11, "array_sortbysorter" }, + { 0xF12, "array_spawn" }, + { 0xF13, "array_spawn_allow_fail" }, + { 0xF14, "array_spawn_function" }, + { 0xF15, "array_spawn_function_noteworthy" }, + { 0xF16, "array_spawn_function_targetname" }, + { 0xF18, "array_spawn_targetname" }, + { 0xF19, "array_spawn_targetname_allow_fail" }, + { 0xF1A, "array_spawn_targetname_allow_fail_setthreat_insideaware" }, + { 0xF1D, "array_thread5" }, + { 0xF1F, "array_thread_safe" }, + { 0xF20, "array_thread_targetname" }, + { 0xF21, "array_wait" }, + { 0xF23, "array_waitlogic2" }, + { 0xF24, "arrayinsertion" }, + { 0xF25, "arrays_of_colorcoded_ai" }, + { 0xF26, "arrays_of_colorcoded_nodes" }, + { 0xF27, "arrays_of_colorcoded_spawners" }, + { 0xF28, "arrays_of_colorcoded_volumes" }, + { 0xF29, "arrays_of_colorforced_ai" }, + { 0xF2A, "arrivalanim" }, + { 0xF2B, "arrivalendstance" }, + { 0xF2C, "arrivalnodetype" }, + { 0xF2D, "arrivalpathgoalpos" }, + { 0xF2E, "arrivalstance" }, + { 0xF2F, "arrivalstartdist" }, + { 0xF30, "arrivaltype" }, + { 0xF31, "arrive" }, + { 0xF32, "arrived" }, + { 0xF33, "artemis_fire" }, + { 0xF34, "artemis_fire_think" }, + { 0xF35, "artemis_think" }, + { 0xF37, "artifact_pulse" }, + { 0xF38, "artifacts" }, + { 0xF39, "artifacts_fade" }, + { 0xF3A, "artillery_balcony_stumble" }, + { 0xF3B, "artillery_balcony_stumble_skip" }, + { 0xF3C, "artillery_balcony_stumblers_setup" }, + { 0xF3D, "artillery_disable_player_mg" }, + { 0xF3E, "artillery_disableweapons" }, + { 0xF40, "artillery_hesco_tower_drones" }, + { 0xF41, "artillery_hit_drones" }, + { 0xF43, "artillery_player_slide" }, + { 0xF45, "artillery_smoke_grenade" }, + { 0xF47, "artilleryshellshock" }, + { 0xF48, "ascend_aim_lerp_anims" }, + { 0xF49, "ascend_aim_logic" }, + { 0xF4A, "ascend_aim_logic_cleanup" }, + { 0xF4B, "ascend_anim_node" }, + { 0xF4C, "ascend_anims_rate" }, + { 0xF4D, "ascend_ascend_state" }, + { 0xF4E, "ascend_ascend_state_transition" }, + { 0xF4F, "ascend_ascender" }, + { 0xF50, "ascend_current_rate" }, + { 0xF51, "ascend_dialog" }, + { 0xF53, "ascend_hook" }, + { 0xF55, "ascend_hook_ally2" }, + { 0xF56, "ascend_hook_ally3" }, + { 0xF57, "ascend_hook_ally4" }, + { 0xF58, "ascend_idle_state" }, + { 0xF59, "ascend_idle_state_transition" }, + { 0xF5A, "ascend_ignoreme_loop" }, + { 0xF5B, "ascend_launch_pos" }, + { 0xF5C, "ascend_launcher" }, + { 0xF5F, "ascend_mechanics" }, + { 0xF60, "ascend_pendulum" }, + { 0xF61, "ascend_rope1" }, + { 0xF62, "ascend_rope2" }, + { 0xF63, "ascend_rope3" }, + { 0xF64, "ascend_snow_fx" }, + { 0xF65, "ascend_state" }, + { 0xF66, "ascend_state_transition" }, + { 0xF67, "ascend_stop_state" }, + { 0xF68, "ascend_stop_state_transition" }, + { 0xF69, "ascend_target_rate" }, + { 0xF6A, "ascend_vision_sets" }, + { 0xF6B, "ascend_waiting" }, + { 0xF6C, "ascend_wind_01" }, + { 0xF6D, "ascend_wind_02" }, + { 0xF6E, "ascend_wind_03" }, + { 0xF6F, "ascend_wind_04" }, + { 0xF70, "ascender" }, + { 0xF72, "ash_fall_thread" }, + { 0xF73, "ash_init" }, + { 0xF74, "asign_blackhawk_riders" }, + { 0xF76, "assemble_plane_wing" }, + { 0xF77, "assembly_line" }, + { 0xF78, "assembly_line_animate" }, + { 0xF79, "assembly_line_notetrack_sound" }, + { 0xF7B, "assembly_line_piece" }, + { 0xF7C, "assembly_line_precache" }, + { 0xF7D, "assembly_line_tank_damage_watch" }, + { 0xF7E, "assembly_line_tank_notetracks" }, + { 0xF7F, "assembly_line_tank_part_damage_watch" }, + { 0xF80, "assembly_line_tank_part_damage_watch_end" }, + { 0xF81, "assembly_line_tank_part_explode" }, + { 0xF82, "assembly_line_tank_part_extinguish" }, + { 0xF83, "assembly_line_tank_part_visible" }, + { 0xF84, "assert_existance_of_anim" }, + { 0xF85, "assert_if_anim_not_defined" }, + { 0xF86, "assert_if_identical_origins" }, + { 0xF87, "assetname" }, + { 0xF88, "assign_alien_attributes" }, + { 0xF89, "assign_alpha" }, + { 0xF8A, "assign_animals_tree" }, + { 0xF8B, "assign_animtree" }, + { 0xF8C, "assign_archetypes" }, + { 0xF8D, "assign_bravo" }, + { 0xF8E, "assign_chatter" }, + { 0xF90, "assign_friendly_heros" }, + { 0xF91, "assign_fx_to_trigger" }, + { 0xF92, "assign_generic_human_tree" }, + { 0xF93, "assign_model" }, + { 0xF94, "assign_npcid" }, + { 0xF95, "assign_script_breachgroup_to_ents" }, + { 0xF96, "assign_unique_id" }, + { 0xF97, "assignaward" }, + { 0xF98, "assignawards" }, + { 0xF99, "assignteamspawns" }, + { 0xF9A, "assistedsuicide" }, + { 0xF9C, "assumed_match_length" }, + { 0xF9D, "at_edge" }, + { 0xF9E, "at_edge_sign" }, + { 0xF9F, "at_end_anim_freeze_frame" }, + { 0xFA0, "at_goal_node" }, + { 0xFA1, "at_least_goal" }, + { 0xFA2, "atbrinkofdeath" }, + { 0xFA3, "atconcealmentnode" }, + { 0xFA4, "atrium_checkpoint" }, + { 0xFA5, "atrium_done" }, + { 0xFA6, "atrium_final_stand" }, + { 0xFA8, "atrium_player_outside" }, + { 0xFA9, "atrium_wave2" }, + { 0xFAA, "atrium_wave3" }, + { 0xFAB, "atrium_wave4" }, + { 0xFAC, "attach_audio_points_to_player" }, + { 0xFAD, "attach_cig" }, + { 0xFAE, "attach_cig_self" }, + { 0xFB0, "attach_deck_gun" }, + { 0xFB1, "attach_dust_to_mover" }, + { 0xFB2, "attach_flashlight" }, + { 0xFB3, "attach_fx_anim_model" }, + { 0xFB5, "attach_fx_anim_model_mall_debris" }, + { 0xFB6, "attach_fx_anim_model_street_flood" }, + { 0xFB7, "attach_in_volume" }, + { 0xFB8, "attach_model_override" }, + { 0xFBA, "attach_phone" }, + { 0xFBC, "attach_pistol_right" }, + { 0xFBE, "attached_actor" }, + { 0xFBF, "attached_item" }, + { 0xFC0, "attachedguys" }, + { 0xFC1, "attachedmodels" }, + { 0xFC2, "attachedpath" }, + { 0xFC3, "attachedusemodel" }, + { 0xFC4, "attachgrenademodel" }, + { 0xFC5, "attachhat" }, + { 0xFC6, "attachhead" }, + { 0xFC7, "attachlid" }, + { 0xFC9, "attachmentcheck" }, + { 0xFCA, "attachmentgroup" }, + { 0xFCB, "attachmentmap_attachtoperk" }, + { 0xFCC, "attachmentmap_basetounique" }, + { 0xFCD, "attachmentmap_tobase" }, + { 0xFCE, "attachmentmap_tounique" }, + { 0xFCF, "attachmentmap_uniquetobase" }, + { 0xFD1, "attachments" }, + { 0xFD2, "attachmentscompatible" }, + { 0xFD3, "attachmissiles" }, + { 0xFD4, "attachplayer" }, + { 0xFD5, "attachplayertochopper" }, + { 0xFD6, "attachprops" }, + { 0xFD8, "attachturret" }, + { 0xFDA, "attack_chopper_monitoruse" }, + { 0xFDB, "attack_chopper_pot" }, + { 0xFDC, "attack_chopper_reward_pool" }, + { 0xFDD, "attack_damage_trigger" }, + { 0xFDE, "attack_dir" }, + { 0xFE0, "attack_heli_cleanup" }, + { 0xFE1, "attack_heli_fx" }, + { 0xFE2, "attack_heli_safe_volumes" }, + { 0xFE3, "attack_if_provoked" }, + { 0xFE4, "attack_indicator_off" }, + { 0xFE5, "attack_indicator_on" }, + { 0xFE6, "attack_missile_set_up_and_notify" }, + { 0xFE8, "attack_origin_condition_threadd" }, + { 0xFE9, "attack_player_after_death" }, + { 0xFEA, "attack_pos" }, + { 0xFEB, "attack_sequence_num" }, + { 0xFEC, "attack_sound_setup" }, + { 0xFED, "attack_targets" }, + { 0xFEE, "attack_times" }, + { 0xFEF, "attackable" }, + { 0xFF0, "attackable_ent" }, + { 0xFF2, "attackback" }, + { 0xFF3, "attacked" }, + { 0xFF5, "attackenemyaircraft" }, + { 0xFF6, "attacker" }, + { 0xFF7, "attacker_damage" }, + { 0xFF8, "attacker_isonmyteam" }, + { 0xFFA, "attackercandamageitem" }, + { 0xFFB, "attackerdata" }, + { 0xFFC, "attackerent" }, + { 0xFFD, "attackerinlaststand" }, + { 0xFFE, "attackerinremotekillstreak" }, + { 0xFFF, "attackerishittingteam" }, + { 0x1000, "attackernum" }, + { 0x1002, "attackerposition" }, + { 0x1003, "attackerride" }, + { 0x1004, "attackers" }, + { 0x1005, "attackerstance" }, + { 0x1006, "attackertable" }, + { 0x1008, "attackheightpos" }, + { 0x100A, "attackheliexcluders" }, + { 0x100B, "attackhelifov" }, + { 0x100C, "attackheligraceperiod" }, + { 0x100D, "attackhelikillsai" }, + { 0x100E, "attackhelimemory" }, + { 0x100F, "attackhelimovetime" }, + { 0x1010, "attackheliplayerbreak" }, + { 0x1011, "attackhelirange" }, + { 0x1012, "attackhelitargetreaquire" }, + { 0x1013, "attackhelitimeout" }, + { 0x1014, "attacking_player" }, + { 0x1017, "attackmisstracktargetthread" }, + { 0x1018, "attackmovetime" }, + { 0x1019, "attacknothingtodo" }, + { 0x101A, "attackoffset" }, + { 0x101B, "attackradiussq" }, + { 0x101C, "attacks" }, + { 0x101D, "attackstate" }, + { 0x101E, "attacksuppressableenemy" }, + { 0x101F, "attackteleportthread" }, + { 0x1022, "attackzheight" }, + { 0x1023, "attempt_bad_path_melee" }, + { 0x1024, "attempt_bad_path_move_nearby_node" }, + { 0x1025, "attempt_badpath_jump" }, + { 0x1026, "attempt_badpath_move_to_node" }, + { 0x1029, "attract_guys_to_dog" }, + { 0x102A, "attract_range" }, + { 0x102B, "attract_strength" }, + { 0x102C, "attractor" }, + { 0x102D, "attractor2" }, + { 0x102E, "attractor_flare" }, + { 0x102F, "attributes" }, + { 0x1031, "atv_death_launchslide" }, + { 0x1032, "atv_decide_shoot" }, + { 0x1033, "atv_decide_shoot_internal" }, + { 0x1034, "atv_do_event" }, + { 0x1035, "atv_get_death_anim" }, + { 0x1036, "atv_getoff" }, + { 0x1037, "atv_geton" }, + { 0x1038, "atv_handle_events" }, + { 0x1039, "atv_loop_driver" }, + { 0x103A, "atv_loop_driver_shooting" }, + { 0x103B, "atv_normal_death" }, + { 0x103C, "atv_reload" }, + { 0x103D, "atv_reload_internal" }, + { 0x103E, "atv_setanim_common" }, + { 0x1041, "atv_start_shooting" }, + { 0x1042, "atv_stop_shooting" }, + { 0x1044, "atv_waitfor_end" }, + { 0x1045, "atv_waitfor_start_aim" }, + { 0x1046, "atv_waitfor_start_lean" }, + { 0x1048, "aud_30mm_tail" }, + { 0x1049, "aud_add_progress_map" }, + { 0x104A, "aud_ajax_chair" }, + { 0x104B, "aud_ajax_flare" }, + { 0x104C, "aud_alarm" }, + { 0x104D, "aud_ally_gear_rustle" }, + { 0x104E, "aud_ally_gear_rustle_2" }, + { 0x104F, "aud_aux_explosions" }, + { 0x1050, "aud_bar" }, + { 0x1052, "aud_birds" }, + { 0x1053, "aud_blow_vehicle" }, + { 0x1054, "aud_blow_vehicle_low" }, + { 0x1056, "aud_bullet_count" }, + { 0x1057, "aud_bumpy_ride" }, + { 0x1059, "aud_bust_windshield" }, + { 0x105D, "aud_can_play_outside_wind_gusts" }, + { 0x105E, "aud_can_play_rappel_footsteps" }, + { 0x105F, "aud_can_play_rope_creak" }, + { 0x1060, "aud_can_play_tilt_screams" }, + { 0x1061, "aud_car_creak" }, + { 0x1063, "aud_carr_bg_rog_01" }, + { 0x1064, "aud_carr_bg_rog_02" }, + { 0x1065, "aud_carr_bg_rog_03" }, + { 0x1066, "aud_carr_dead_sparrow_ops" }, + { 0x1068, "aud_carr_elevator_exp" }, + { 0x1069, "aud_carr_elevator_front" }, + { 0x106A, "aud_carr_elevator_rear" }, + { 0x106B, "aud_carr_exfil_bg_heli" }, + { 0x106C, "aud_carr_exfil_heli" }, + { 0x106D, "aud_carr_exfil_rog" }, + { 0x106E, "aud_carr_exfil_rog_incoming" }, + { 0x106F, "aud_carr_exp_heli_blade" }, + { 0x1070, "aud_carr_exp_heli_bounce" }, + { 0x1072, "aud_carr_exp_heli_whoosh" }, + { 0x1073, "aud_carr_ghost_mask_on_plr" }, + { 0x1074, "aud_carr_gunship_attack_run" }, + { 0x1075, "aud_carr_gunship_killed" }, + { 0x1076, "aud_carr_hesh_talk_explode" }, + { 0x1079, "aud_carr_osprey_loader" }, + { 0x107A, "aud_carr_osprey_zone_off" }, + { 0x107B, "aud_carr_osprey_zone_on" }, + { 0x107C, "aud_carr_pharmacy_shut" }, + { 0x107D, "aud_carr_pickup_osprey_control" }, + { 0x107E, "aud_carr_player_cuts_rope" }, + { 0x107F, "aud_carr_promotion_dog" }, + { 0x1080, "aud_carr_promotion_hsh" }, + { 0x1081, "aud_carr_promotion_mrk" }, + { 0x1082, "aud_carr_promotion_plr" }, + { 0x1083, "aud_carr_slowmo_bg" }, + { 0x1084, "aud_carr_slowmo_in" }, + { 0x1085, "aud_carr_slowmo_out" }, + { 0x1086, "aud_carr_slowmo_roll" }, + { 0x1087, "aud_carr_slowmo_slide" }, + { 0x1088, "aud_carr_sparrow_105_hit" }, + { 0x1089, "aud_carr_sparrow_105_incoming" }, + { 0x108A, "aud_carr_sparrow_run_hit" }, + { 0x108B, "aud_carr_sparrow_zone_off" }, + { 0x108C, "aud_carr_sparrow_zone_on" }, + { 0x108D, "aud_carr_tilt_plr_death" }, + { 0x108E, "aud_carr_tilt_plr_vault" }, + { 0x108F, "aud_carr_victory_deck_checkpoint" }, + { 0x1090, "aud_carr_zodiac_deck_explode" }, + { 0x1091, "aud_carr_zodiac_deck_explode_vista" }, + { 0x1092, "aud_cart_crash" }, + { 0x1093, "aud_charge_set" }, + { 0x1094, "aud_check" }, + { 0x1096, "aud_chopper_second" }, + { 0x1097, "aud_clear_zone_medbay" }, + { 0x1098, "aud_collapse" }, + { 0x109A, "aud_convoy_done" }, + { 0x109B, "aud_convoy_start" }, + { 0x109C, "aud_coughing" }, + { 0x109D, "aud_deck_jet_catapult_01" }, + { 0x109E, "aud_deck_jet_catapult_02" }, + { 0x109F, "aud_deck_siren" }, + { 0x10A1, "aud_defend_zodiac_osprey_zone" }, + { 0x10A2, "aud_defend_zodiac_zone" }, + { 0x10A3, "aud_disable_deathsdoor_audio" }, + { 0x10A4, "aud_dish_crash" }, + { 0x10A5, "aud_distant_alarm" }, + { 0x10A7, "aud_dog_scratch" }, + { 0x10A8, "aud_dog_thread" }, + { 0x10AB, "aud_doppler_grenade" }, + { 0x10AC, "aud_drillholenumber" }, + { 0x10AD, "aud_dry_fire" }, + { 0x10AE, "aud_enable_deathsdoor_audio" }, + { 0x10AF, "aud_end_random_chatter_and_pa" }, + { 0x10B0, "aud_end_sniper" }, + { 0x10B3, "aud_enemy_muffled_vo" }, + { 0x10B4, "aud_engine_fail" }, + { 0x10B6, "aud_ext_bombs" }, + { 0x10B7, "aud_fast_jets" }, + { 0x10B8, "aud_filter_off" }, + { 0x10B9, "aud_filter_on" }, + { 0x10BA, "aud_finale_ally_locs" }, + { 0x10BB, "aud_finale_chopper1" }, + { 0x10BC, "aud_finale_chopper2" }, + { 0x10BE, "aud_finale_chopper4" }, + { 0x10BF, "aud_finale_pa_guys" }, + { 0x10C0, "aud_finale_sniper" }, + { 0x10C1, "aud_finale_sniper2" }, + { 0x10C2, "aud_flap_loop" }, + { 0x10C3, "aud_flare_grab" }, + { 0x10C4, "aud_flare_kill" }, + { 0x10C5, "aud_flight_deck_bell" }, + { 0x10C6, "aud_focus_zoom" }, + { 0x10C7, "aud_fx_planes" }, + { 0x10C8, "aud_gas_mask_on" }, + { 0x10C9, "aud_gear_sounds" }, + { 0x10CC, "aud_gunship_loc" }, + { 0x10CE, "aud_gunship_trans_4_105_01" }, + { 0x10CF, "aud_gunship_trans_4_105_02" }, + { 0x10D1, "aud_handle_remote_sniper_ai" }, + { 0x10D7, "aud_hvt_rescue_thread" }, + { 0x10D9, "aud_in_sparrow" }, + { 0x10DA, "aud_init_animation_sounds" }, + { 0x10DB, "aud_init_flags" }, + { 0x10DC, "aud_init_globals" }, + { 0x10DF, "aud_intro_alarms" }, + { 0x10E0, "aud_intro_cargo_doors" }, + { 0x10E1, "aud_intro_choppers" }, + { 0x10E2, "aud_intro_convoy_counter" }, + { 0x10E3, "aud_intro_keegan_tinkering" }, + { 0x10E4, "aud_intro_seq_lr" }, + { 0x10E6, "aud_invert" }, + { 0x10E7, "aud_inverted_kill_finish" }, + { 0x10E8, "aud_inverted_kill_firstguy" }, + { 0x10E9, "aud_jeep_flip" }, + { 0x10EA, "aud_jet_attack" }, + { 0x10EB, "aud_junction" }, + { 0x10EC, "aud_keegan_gunfire" }, + { 0x10ED, "aud_last_time" }, + { 0x10EF, "aud_lerp_eq_over_time" }, + { 0x10F1, "aud_listen_mk32_reload" }, + { 0x10F2, "aud_listen_sprint_or_switch" }, + { 0x10F5, "aud_lynx_rider_death_listener" }, + { 0x10F6, "aud_lynx_turrets" }, + { 0x10F8, "aud_map_range" }, + { 0x10F9, "aud_max_bullets" }, + { 0x10FA, "aud_medbay_alarms" }, + { 0x10FB, "aud_medbay_pa" }, + { 0x10FD, "aud_mk32_dud_beep_atrium" }, + { 0x1100, "aud_music" }, + { 0x1103, "aud_ocean02_line_emitter_create" }, + { 0x1104, "aud_old_height" }, + { 0x1105, "aud_old_rotation" }, + { 0x1106, "aud_osprey_controller_off" }, + { 0x1107, "aud_osprey_controller_on" }, + { 0x1108, "aud_osprey_fire" }, + { 0x110A, "aud_osprey_run" }, + { 0x110C, "aud_outside_crowd_rear" }, + { 0x110D, "aud_outside_music" }, + { 0x110E, "aud_outside_music_rear" }, + { 0x110F, "aud_pa_guys" }, + { 0x1110, "aud_party" }, + { 0x1111, "aud_pickup_mk32" }, + { 0x1113, "aud_play_and_move_sound" }, + { 0x1115, "aud_play_deck_music" }, + { 0x1118, "aud_play_intro_music" }, + { 0x1119, "aud_play_jet_flyby" }, + { 0x111A, "aud_play_jets_zoomby" }, + { 0x111B, "aud_play_loop_until_flag" }, + { 0x111C, "aud_play_medbay_music" }, + { 0x111E, "aud_play_random_wind_gust" }, + { 0x111F, "aud_play_tilt_music" }, + { 0x1121, "aud_play_whizby" }, + { 0x1123, "aud_player_gunfire" }, + { 0x1124, "aud_player_jumps_from_sparrow" }, + { 0x1125, "aud_player_reloading" }, + { 0x1127, "aud_player_tank_int_on" }, + { 0x1128, "aud_post_sparrow_music" }, + { 0x112A, "aud_pre_sniper_rpg_explode" }, + { 0x112B, "aud_pre_sniper_rpg_gunner_listener" }, + { 0x112C, "aud_pre_sniper_rpg_listener" }, + { 0x1130, "aud_random_enemy_chatter" }, + { 0x1131, "aud_random_enemy_pa" }, + { 0x1132, "aud_random_metal_crumbles" }, + { 0x1134, "aud_random_rumbles_intro" }, + { 0x1135, "aud_rappel" }, + { 0x1136, "aud_rappel_combat" }, + { 0x1137, "aud_rappel_jump_down" }, + { 0x1139, "aud_rpg_gunner_listener" }, + { 0x113D, "aud_screen_shake_jumps" }, + { 0x113E, "aud_set_spec_ops" }, + { 0x1143, "aud_sniper_fire" }, + { 0x1144, "aud_sniper_start_zoom" }, + { 0x1145, "aud_sniper_stop_zoom" }, + { 0x1146, "aud_sparrow_aiming" }, + { 0x1148, "aud_sparrow_run_spawn_fires" }, + { 0x1149, "aud_sparrow_tone" }, + { 0x114A, "aud_stadium_crumble1" }, + { 0x114C, "aud_start_garden_events" }, + { 0x114D, "aud_start_pseudo_occlusion" }, + { 0x114E, "aud_start_sniper" }, + { 0x114F, "aud_start_sniper_finale" }, + { 0x1151, "aud_stop_wind" }, + { 0x1152, "aud_switch_zone_medbay" }, + { 0x1153, "aud_temp_timer" }, + { 0x1154, "aud_tilt_barrels_01" }, + { 0x1155, "aud_tilt_debris_01" }, + { 0x1156, "aud_tilt_front_deck" }, + { 0x1158, "aud_tilt_sliding_cart_01" }, + { 0x1159, "aud_tilt_sliding_guya" }, + { 0x115B, "aud_tower_collapse" }, + { 0x115C, "aud_tower_to_deck" }, + { 0x115D, "aud_traverse_ally_locs" }, + { 0x115E, "aud_truck_drive" }, + { 0x115F, "aud_truck_enter" }, + { 0x1160, "aud_truck_ext_idle_loop" }, + { 0x1162, "aud_truck_start" }, + { 0x1163, "aud_turret_indices" }, + { 0x1165, "aud_updating_movement" }, + { 0x1166, "aud_vehicle_jolt" }, + { 0x1168, "aud_victory_deck_spawn_fires" }, + { 0x1169, "aud_vip_ally_locs" }, + { 0x116A, "aud_vip_breach" }, + { 0x116B, "aud_vip_combat" }, + { 0x116C, "aud_virus" }, + { 0x116D, "aud_wave2_ambient_jets" }, + { 0x116E, "aud_wave3_ambient_jets" }, + { 0x116F, "aud_weapon_strobe" }, + { 0x1170, "aud_wind_loop" }, + { 0x1171, "aud_wind_state_last" }, + { 0x1172, "aud_zipline" }, + { 0x1173, "aud_zipline_launcher_loop" }, + { 0x1175, "aud_zodiac_gunship_attack_105_fake" }, + { 0x1178, "aud_zodiac_jet_catapult_02" }, + { 0x117D, "audio" }, + { 0x117E, "audio_bink_percentage_beep_array" }, + { 0x117F, "audio_check_to_play_a_beep_or_not" }, + { 0x1180, "audio_derrick_explode_logic" }, + { 0x1181, "audio_entities" }, + { 0x1182, "audio_flag_init" }, + { 0x1185, "audio_jet_counter" }, + { 0x1186, "audio_odin_pressurized_variable" }, + { 0x1187, "audio_plane_engine_sounds_dying" }, + { 0x1189, "audio_player_falling_start" }, + { 0x118B, "audio_set_default_ambience" }, + { 0x118C, "audio_set_fadein_ambience" }, + { 0x118D, "audio_set_infil_ambience" }, + { 0x118E, "audio_set_initial_ambience" }, + { 0x118F, "audio_speed" }, + { 0x1190, "audio_start_destruction_loop" }, + { 0x1191, "audio_start_plane_engine_sounds" }, + { 0x1193, "audio_start_rushing_water_line_emitter_01" }, + { 0x1194, "audio_start_rushing_water_line_emitter_02" }, + { 0x1195, "audio_start_rushing_water_line_emitter_03" }, + { 0x1196, "audio_stereo_line_emitter" }, + { 0x1198, "audio_stringtable_mapname" }, + { 0x1199, "audio_underwater_breath_bubbles" }, + { 0x119A, "audio_underwater_breath_surfacing" }, + { 0x119B, "audio_underwater_choke" }, + { 0x119C, "audio_wait_to_delete_water_node" }, + { 0x119D, "audio_water_level_logic" }, + { 0x119E, "audio_zones" }, + { 0x11A0, "aurora_anims" }, + { 0x11A2, "auto_adjust_difficulty_player_movement_check" }, + { 0x11A3, "auto_adjust_difficulty_player_positioner" }, + { 0x11A4, "auto_adjust_difficulty_track_player_death" }, + { 0x11A7, "auto_adjust_enemy_died" }, + { 0x11A8, "auto_adjust_flags" }, + { 0x11AA, "auto_adjust_results" }, + { 0x11AB, "auto_adust_zone_complete" }, + { 0x11AC, "auto_breach" }, + { 0x11AD, "auto_breach_gametypes" }, + { 0x11AE, "auto_flash_text" }, + { 0x11AF, "auto_kill_enemies" }, + { 0x11B0, "auto_mg42_target" }, + { 0x11B2, "auto_pilot_rot_control_ref_ent" }, + { 0x11B4, "autoassign" }, + { 0x11B7, "automatic_sliding_door_detector" }, + { 0x11B9, "autoresettime" }, + { 0x11BA, "autosave_by_name" }, + { 0x11BB, "autosave_by_name_silent" }, + { 0x11BC, "autosave_by_name_thread" }, + { 0x11BD, "autosave_check_override" }, + { 0x11BE, "autosave_now" }, + { 0x11C0, "autosave_now_trigger" }, + { 0x11C1, "autosave_or_timeout" }, + { 0x11C2, "autosave_past_balcony" }, + { 0x11C4, "autosave_recon" }, + { 0x11C6, "autosave_stealth_silent" }, + { 0x11C7, "autosave_tactical" }, + { 0x11C8, "autosave_tactical_grenade_check" }, + { 0x11C9, "autosave_tactical_grenade_check_dieout" }, + { 0x11CA, "autosave_tactical_player_nades" }, + { 0x11CB, "autosave_tactical_proc" }, + { 0x11CD, "autosave_threat_check_enabled" }, + { 0x11CE, "autosave_timeout" }, + { 0x11CF, "autosaveammocheck" }, + { 0x11D0, "autosavecheck" }, + { 0x11D1, "autosavecheck_not_picky" }, + { 0x11D2, "autosavehealthcheck" }, + { 0x11D5, "autosaveprint" }, + { 0x11D6, "autosaves_think" }, + { 0x11D7, "autosavethreatcheck" }, + { 0x11D8, "autoshootanimrate" }, + { 0x11DA, "autospotadswatcher" }, + { 0x11DB, "autospotdeathwatcher" }, + { 0x11DC, "autotarget" }, + { 0x11DE, "available" }, + { 0x11DF, "availabledrones" }, + { 0x11E1, "avengeddog" }, + { 0x11E2, "avengedplayer" }, + { 0x11E3, "avoidairstrikelocations" }, + { 0x11E4, "avoidcarepackages" }, + { 0x11E5, "avoidcornervisibleenemies" }, + { 0x11E7, "avoidenemyspawn" }, + { 0x11E9, "avoidgrenades" }, + { 0x11EA, "avoidkillstreakonspawntimer" }, + { 0x11EB, "avoidlastattackerlocation" }, + { 0x11EC, "avoidlastdeathlocation" }, + { 0x11ED, "avoidmines" }, + { 0x11EE, "avoidrecentlyused" }, + { 0x11EF, "avoidsamespawn" }, + { 0x11F1, "awaittill_either" }, + { 0x11F2, "award1_ref" }, + { 0x11F3, "award2_ref" }, + { 0x11F4, "award_intel" }, + { 0x11F6, "awards" }, + { 0x11F7, "awardxp" }, + { 0x11F8, "aware_aievents" }, + { 0x11F9, "awareness" }, + { 0x11FA, "awareness_param" }, + { 0x11FB, "axes" }, + { 0x11FD, "axischopper" }, + { 0x11FF, "axismode" }, + { 0x1200, "b" }, + { 0x1201, "b_bad_guys" }, + { 0x1202, "b_falling" }, + { 0x1204, "back_alley_humvee" }, + { 0x1205, "back_jerk" }, + { 0x1206, "back_light_on" }, + { 0x1207, "back_velocity" }, + { 0x1208, "back_weight" }, + { 0x1209, "back_wheel_sfx" }, + { 0x120A, "backdoor_guy" }, + { 0x120B, "backend_friendly_stealth_logic" }, + { 0x120D, "background_block" }, + { 0x1210, "background_vo" }, + { 0x1211, "backplate_sound_on" }, + { 0x1212, "backstab" }, + { 0x1213, "backtank" }, + { 0x1214, "backtodefendlocation" }, + { 0x1215, "backtorunondamage" }, + { 0x1216, "backupbuddyplayfx" }, + { 0x1218, "baclonyguys" }, + { 0x121A, "bad_path_handled" }, + { 0x121C, "badger" }, + { 0x121E, "badpath_jump" }, + { 0x121F, "badpathcount" }, + { 0x1220, "badpathtime" }, + { 0x1221, "badplace" }, + { 0x1223, "badplace_brush_moving" }, + { 0x1224, "badplace_cylinder_func" }, + { 0x1226, "badplace_name" }, + { 0x1228, "badplace_think" }, + { 0x1229, "badplaceint" }, + { 0x122C, "badplacer" }, + { 0x122D, "badplaces" }, + { 0x122E, "badshot" }, + { 0x122F, "badshotcount" }, + { 0x1230, "badtarget" }, + { 0x1231, "badtargetreset" }, + { 0x1232, "bag_name" }, + { 0x1233, "bag_trigger_off_if_player_has_weapon" }, + { 0x1234, "bag_trigger_wait" }, + { 0x1235, "bag_vis_callback" }, + { 0x1236, "bags" }, + { 0x1237, "baker" }, + { 0x1238, "baker_anim" }, + { 0x1239, "baker_approach" }, + { 0x123A, "baker_building_entry_movement" }, + { 0x123B, "baker_crawl_dialogue" }, + { 0x123E, "baker_drop_bag" }, + { 0x123F, "baker_end" }, + { 0x1240, "baker_enemy" }, + { 0x1241, "baker_enter" }, + { 0x1242, "baker_enter_struct" }, + { 0x1243, "baker_enter_wreck" }, + { 0x1245, "baker_glint_off" }, + { 0x1246, "baker_glint_on" }, + { 0x1247, "baker_in_to_jeep_anim" }, + { 0x1248, "baker_junction_door_open" }, + { 0x1249, "baker_killfirms" }, + { 0x124A, "baker_move_to_stealth_2" }, + { 0x124B, "baker_noncombat" }, + { 0x124C, "baker_path_to_wreck" }, + { 0x124E, "baker_post_up_at_sharks" }, + { 0x1250, "baker_rappel_hookup" }, + { 0x1251, "baker_sonar_path" }, + { 0x1252, "baker_sonar_path_dialogue" }, + { 0x1254, "baker_struct" }, + { 0x1255, "baker_torpedo_position" }, + { 0x1256, "baker_wait_at_container" }, + { 0x1258, "baker_weld_door" }, + { 0x1259, "baker_wreck_cleanup" }, + { 0x125A, "baker_wreck_dialogue" }, + { 0x125B, "balanceteams" }, + { 0x125C, "balcony" }, + { 0x125D, "balcony_allies_playerhind_logic" }, + { 0x125E, "balcony_anims" }, + { 0x125F, "balcony_check" }, + { 0x1261, "balcony_death" }, + { 0x1262, "balcony_death_damage_watcher" }, + { 0x1264, "balcony_enemies_clip" }, + { 0x1265, "balcony_fall_deaths" }, + { 0x1267, "balcony_kill_trigger" }, + { 0x1268, "balcony_read" }, + { 0x1269, "balcony_turret" }, + { 0x126A, "balconyent" }, + { 0x126B, "balconystumblers" }, + { 0x126D, "ball_angle" }, + { 0x126E, "ball_i" }, + { 0x1270, "ball_offset" }, + { 0x1271, "ball_ring" }, + { 0x1272, "balldrone" }, + { 0x1277, "balldrone_burstfirestop" }, + { 0x1278, "balldrone_enemy_lightfx" }, + { 0x1279, "balldrone_followplayer" }, + { 0x127A, "balldrone_friendly_lightfx" }, + { 0x127B, "balldrone_handledamage" }, + { 0x127C, "balldrone_leave" }, + { 0x127E, "balldrone_moving_platform_death" }, + { 0x127F, "balldrone_stunned" }, + { 0x1280, "balldrone_watchdeath" }, + { 0x1281, "balldrone_watchforgoal" }, + { 0x1282, "balldrone_watchownerdeath" }, + { 0x1283, "balldrone_watchownerloss" }, + { 0x1284, "balldrone_watchroundend" }, + { 0x1285, "balldrone_watchtimeout" }, + { 0x1286, "balldronedestroyed" }, + { 0x1287, "balldroneexplode" }, + { 0x1288, "balldrones" }, + { 0x1289, "balldronesettings" }, + { 0x128A, "balldronetype" }, + { 0x128B, "balloon_count" }, + { 0x128C, "balloons" }, + { 0x128D, "ballytankmove" }, + { 0x128E, "bang_stick_rotate" }, + { 0x128F, "bar" }, + { 0x1290, "bar_animnode" }, + { 0x1291, "bar_death" }, + { 0x1292, "bar_drift_rate" }, + { 0x1293, "bar_enemies" }, + { 0x1296, "bar_enemy_lights_out_accuracy" }, + { 0x1297, "bar_enemy_panic_vo" }, + { 0x1298, "bar_enemy_reach" }, + { 0x1299, "bar_enemy_react" }, + { 0x129A, "bar_enemy_seek_player" }, + { 0x129B, "bar_enemy_setup" }, + { 0x129C, "bar_enemy_strobe_react" }, + { 0x129D, "bar_enemy_strobe_vo" }, + { 0x129E, "bar_enemy_vo" }, + { 0x129F, "bar_enemy_wave2_3_react" }, + { 0x12A0, "bar_enemy_wave2_behavior" }, + { 0x12A2, "bar_guy11" }, + { 0x12A3, "bar_guy9" }, + { 0x12A4, "bar_guy_watch_death" }, + { 0x12A5, "bar_light" }, + { 0x12A6, "bar_prep" }, + { 0x12A7, "bar_props" }, + { 0x12A8, "bar_react_variable_wait" }, + { 0x12A9, "bar_rorke" }, + { 0x12AA, "bar_rorke_move_on" }, + { 0x12AB, "bar_rorke_shoot_tv" }, + { 0x12AC, "bar_rorke_strobe_attack" }, + { 0x12AD, "bar_rorke_warning_vo" }, + { 0x12AE, "bar_spotted_func" }, + { 0x12AF, "bar_stool_anim" }, + { 0x12B1, "bar_strobe_player_force_off" }, + { 0x12B2, "bar_strobe_player_on" }, + { 0x12B3, "barbed_wire_waver" }, + { 0x12B4, "barbedwirerunners" }, + { 0x12B5, "bared_wire_scene" }, + { 0x12B6, "bark_trigger" }, + { 0x12B7, "barking_sound" }, + { 0x12B8, "barkingdog_handle_stealth_break" }, + { 0x12B9, "barrel" }, + { 0x12BA, "barrel_earthquake" }, + { 0x12BB, "barrel_model_1" }, + { 0x12BC, "barrel_model_2" }, + { 0x12BD, "barrel_model_3" }, + { 0x12BF, "barrel_model_5" }, + { 0x12C0, "barrel_roll" }, + { 0x12C4, "base" }, + { 0x12C5, "base_accuracy" }, + { 0x12C6, "base_alarm" }, + { 0x12C7, "base_alarm_loop" }, + { 0x12C9, "base_array_ai_cleanup_spawn_function" }, + { 0x12CC, "base_array_ambient_a10_gun_dive_1b" }, + { 0x12CD, "base_array_ambient_a10_gun_dive_2" }, + { 0x12CE, "base_array_ambient_a10_gun_dive_2b" }, + { 0x12D0, "base_array_ambient_a10_gun_dive_3b" }, + { 0x12D1, "base_array_ambient_dogfight_1" }, + { 0x12D2, "base_array_ambient_dogfight_1b" }, + { 0x12D3, "base_array_ambient_dogfight_2" }, + { 0x12D4, "base_array_ambient_dogfight_2b" }, + { 0x12D5, "base_array_ambient_dogfight_3" }, + { 0x12D6, "base_array_ambient_dogfight_3b" }, + { 0x12D7, "base_array_ambient_dogfight_4b" }, + { 0x12D8, "base_array_ambient_dogfight_5b" }, + { 0x12D9, "base_array_ambient_dogfight_6b" }, + { 0x12DA, "base_array_ambient_dogfight_6c" }, + { 0x12DB, "base_array_begin" }, + { 0x12DC, "base_array_choppers" }, + { 0x12DD, "base_array_cleanup" }, + { 0x12DE, "base_array_end_vo" }, + { 0x12DF, "base_array_enemies_setup" }, + { 0x12E0, "base_array_exit_rpg" }, + { 0x12E2, "base_array_init" }, + { 0x12E3, "base_array_main" }, + { 0x12E4, "base_array_mortar_strikes" }, + { 0x12E5, "base_array_pinned_down_allies" }, + { 0x12E7, "base_array_trucks_01_setup" }, + { 0x12E9, "base_array_vo" }, + { 0x12EA, "base_falling_hands_anim" }, + { 0x12EB, "base_falling_legs_anim" }, + { 0x12EC, "base_origin" }, + { 0x12ED, "baseaccuracy" }, + { 0x12EE, "basealpha" }, + { 0x12EF, "baseangles" }, + { 0x12F1, "baseeffectforward" }, + { 0x12F2, "baseeffectpos" }, + { 0x12F3, "baseeffectright" }, + { 0x12F4, "baseeffectswaitforjoined" }, + { 0x12F5, "basefontscale" }, + { 0x12F6, "baseheight" }, + { 0x12F7, "baseignorerandombulletdamage" }, + { 0x12F8, "baseline_speed" }, + { 0x12F9, "basement_ally_movement" }, + { 0x12FB, "basename" }, + { 0x12FD, "basetile" }, + { 0x12FE, "basetime" }, + { 0x12FF, "basewidth" }, + { 0x1300, "baseyaw" }, + { 0x1302, "batman_begins" }, + { 0x1303, "batman_rotate_plane" }, + { 0x1305, "battingcage_door_peek" }, + { 0x1306, "battle_chatter_controller_friendlies" }, + { 0x1307, "battlebuddy" }, + { 0x1308, "battlebuddyrespawntimestamp" }, + { 0x1309, "battlebuddywaitlist" }, + { 0x130A, "battlechatter" }, + { 0x130B, "battlechatter_canprint" }, + { 0x130D, "battlechatter_debugprint" }, + { 0x130F, "battlechatter_off" }, + { 0x1310, "battlechatter_on" }, + { 0x1311, "battlechatter_on_thread" }, + { 0x1312, "battlechatter_print" }, + { 0x1314, "battlechatter_printdumpline" }, + { 0x1315, "battlechatter_setup" }, + { 0x1317, "bay_door_lower_model" }, + { 0x1319, "bay_door_upper_model" }, + { 0x131A, "bbdata_init" }, + { 0x131C, "bc_ascend" }, + { 0x1320, "bc_enabled" }, + { 0x1322, "bc_end_fic" }, + { 0x1324, "bc_eventtypelastusedtimeplr" }, + { 0x1326, "bc_front_fic" }, + { 0x1327, "bc_helo_fic" }, + { 0x1328, "bc_helo_reinforce" }, + { 0x1329, "bc_helo_reinforce_kill" }, + { 0x132B, "bc_isspeaking" }, + { 0x132C, "bc_mid" }, + { 0x132E, "bc_rolling_door_open" }, + { 0x132F, "bc_snow_tweaks" }, + { 0x1330, "bc_street" }, + { 0x1332, "bc_street_fic" }, + { 0x1333, "bccountryid" }, + { 0x1335, "bcgetclaimednode" }, + { 0x1336, "bcinfo" }, + { 0x1338, "bclearstrafeturnrate" }, + { 0x1339, "bcname" }, + { 0x133B, "bcprintfailprefix" }, + { 0x133D, "bcqb_pa_playing" }, + { 0x133E, "bcrank" }, + { 0x133F, "bcrashmix" }, + { 0x1340, "bcs_location_mappings" }, + { 0x1341, "bcs_location_trigger_mapping" }, + { 0x1342, "bcs_location_trigs_init" }, + { 0x1343, "bcs_locations" }, + { 0x1344, "bcs_maxtalkingdistsqrdfromplayer" }, + { 0x1346, "bcs_minpriority" }, + { 0x1347, "bcs_on" }, + { 0x1348, "bcs_scripted_dialogue_start" }, + { 0x1349, "bcs_setup_chatter_toggle_array" }, + { 0x134B, "bcs_setup_flavorburst_toggle_array" }, + { 0x134C, "bcs_setup_teams_array" }, + { 0x134D, "bcs_setup_voice" }, + { 0x134E, "bcs_threatresettime" }, + { 0x1350, "bcsdebugwaiter" }, + { 0x1352, "bcsounds" }, + { 0x1353, "bdamagesoundplaying" }, + { 0x1354, "bdcheck" }, + { 0x1356, "bdefenddoorexplosionplaying" }, + { 0x1357, "bdisabledefaultfacialanims" }, + { 0x1358, "bdisablegearsounds" }, + { 0x1359, "bdisablemovetwitch" }, + { 0x135A, "bdoorbreakfoleyplayed" }, + { 0x135B, "bdoturnandmove" }, + { 0x135C, "bdrillon" }, + { 0x135D, "bdriverkilled" }, + { 0x135E, "beach_a10_return_flybys" }, + { 0x135F, "beach_ai" }, + { 0x1360, "beach_ally_default" }, + { 0x1362, "beach_artillery_balcony_logic" }, + { 0x1363, "beach_balcony_collapse_watcher" }, + { 0x1364, "beach_battlehind_default" }, + { 0x1365, "beach_battlehind_rpgers" }, + { 0x1367, "beach_battlehinds_start" }, + { 0x1368, "beach_bunker_backtrack_blocker" }, + { 0x1369, "beach_bunker_drones" }, + { 0x136A, "beach_bunker_stumble_event" }, + { 0x136B, "beach_bunker_stumbler_sound" }, + { 0x136C, "beach_dof_changes" }, + { 0x136D, "beach_enemy_attack_player_manager" }, + { 0x136E, "beach_enemy_default" }, + { 0x1370, "beach_flyover_helis" }, + { 0x1371, "beach_front_nodes_think" }, + { 0x1372, "beach_frontline_abrams" }, + { 0x1373, "beach_frontline_abrams_mg" }, + { 0x1374, "beach_hind_balcony_logic" }, + { 0x1375, "beach_hind_balcony_missile_logic" }, + { 0x1376, "beach_hovercraft_looper" }, + { 0x1377, "beach_hovercraft_tanks_default" }, + { 0x1379, "beach_m880_death_hack" }, + { 0x137B, "beach_nh90_damagestate" }, + { 0x137D, "beach_path_drones" }, + { 0x137E, "beach_playerhind_attack_logic" }, + { 0x137F, "beach_playerhind_attack_target" }, + { 0x1380, "beach_playerhind_attack_target_player" }, + { 0x1381, "beach_reveal_turn_off_mix_snapshot" }, + { 0x1382, "beach_runners" }, + { 0x1383, "beach_sequence_bunker_new" }, + { 0x1384, "beach_sequence_trenches" }, + { 0x1385, "beach_ship_ambient_artillery" }, + { 0x1386, "beach_ship_phalanx_start" }, + { 0x1387, "beach_ship_phalanx_system" }, + { 0x1389, "beach_ship_phalanx_think" }, + { 0x138B, "beach_tank_balcony_logic" }, + { 0x138C, "beach_tank_balcony_stumble" }, + { 0x138D, "beach_tank_balcony_stumbler_notetrack" }, + { 0x138E, "beach_tower_runners_off" }, + { 0x138F, "beach_tower_runners_on" }, + { 0x1390, "beach_trenches_combat" }, + { 0x1391, "beach_trenches_combat_part2" }, + { 0x1392, "beach_trenches_dialogue" }, + { 0x1393, "beach_trenches_part2_dialogue" }, + { 0x1394, "beach_vehicle_default" }, + { 0x1395, "beach_wave1_ai" }, + { 0x1397, "beach_wave1_artillery_drones" }, + { 0x1398, "beach_wave1_artillery_retreat" }, + { 0x1399, "beach_wave1_dialog" }, + { 0x139B, "beach_wave1_enemy_drones" }, + { 0x139C, "beach_wave1_hind_flybys" }, + { 0x139D, "beach_wave1_logic" }, + { 0x139E, "beach_wave2_dialogue" }, + { 0x139F, "beach_wave2_inithinds" }, + { 0x13A0, "beach_wave2_logic" }, + { 0x13A1, "beach_wave2_playerhind_deathfunc" }, + { 0x13A2, "beach_wave2_playerhind_evade" }, + { 0x13A5, "beach_wave2_playerhind_path_logic" }, + { 0x13A6, "beach_wave2_playerhind_pathing" }, + { 0x13A8, "beach_wave2_vehicle_watcher" }, + { 0x13A9, "beach_wave3_dialogue" }, + { 0x13AA, "beach_wave3_logic" }, + { 0x13AB, "beach_wave3_tank_dropoff" }, + { 0x13AC, "beach_wave3_tank_setup" }, + { 0x13AD, "beachfronelinedrones" }, + { 0x13AF, "beachhinds" }, + { 0x13B0, "beachlander" }, + { 0x13B1, "beachtanks" }, + { 0x13B4, "beforestairanim" }, + { 0x13B6, "begin_anim_reach" }, + { 0x13B7, "begin_atrium" }, + { 0x13BB, "begin_building_entry" }, + { 0x13BE, "begin_checkpoint" }, + { 0x13C0, "begin_combat" }, + { 0x13C2, "begin_courtyard" }, + { 0x13C3, "begin_deck_combat" }, + { 0x13C5, "begin_deck_transition" }, + { 0x13C6, "begin_deck_victory" }, + { 0x13C8, "begin_defend_blowdoors1" }, + { 0x13C9, "begin_defend_blowdoors2" }, + { 0x13CB, "begin_defend_plat" }, + { 0x13CD, "begin_defend_zodiac" }, + { 0x13CE, "begin_drive_in" }, + { 0x13D2, "begin_exfil_tank" }, + { 0x13D3, "begin_finale" }, + { 0x13D4, "begin_garden" }, + { 0x13D6, "begin_hvt_test" }, + { 0x13D9, "begin_interior_cqb" }, + { 0x13DA, "begin_interior_vault_scene" }, + { 0x13DB, "begin_intro" }, + { 0x13DC, "begin_inverted_rappel" }, + { 0x13E1, "begin_rail_vo" }, + { 0x13E2, "begin_rappel" }, + { 0x13E3, "begin_rappel_stealth" }, + { 0x13E4, "begin_rooftop_intro" }, + { 0x13E5, "begin_rooftop_shoot" }, + { 0x13E6, "begin_run_to_sparrow" }, + { 0x13E7, "begin_semtex_grenade_tracking" }, + { 0x13E8, "begin_shadow_kill" }, + { 0x13E9, "begin_slow_intro" }, + { 0x13EA, "begin_stairwell" }, + { 0x13ED, "begin_traverse" }, + { 0x13EF, "begin_zipline" }, + { 0x13F0, "beginairdropmarkertracking" }, + { 0x13F1, "beginairdropviamarker" }, + { 0x13F3, "beginclasschoice" }, + { 0x13F4, "begincustomevent" }, + { 0x13F6, "begingrenadetracking" }, + { 0x13F7, "beginharrier" }, + { 0x13F8, "beginningoflevelsave" }, + { 0x13FA, "beginsmokegrenadetracking" }, + { 0x13FB, "beginteamchoice" }, + { 0x13FC, "behavior" }, + { 0x13FD, "being_charged" }, + { 0x13FF, "beingartilleryshellshocked" }, + { 0x1400, "beingdestroyed" }, + { 0x1401, "beingrevived" }, + { 0x1402, "belowcumulativepainthreshold" }, + { 0x1404, "bestminitarget" }, + { 0x1405, "bestspawnflag" }, + { 0x1407, "better" }, + { 0x1408, "betty_tutorial_given" }, + { 0x140A, "bfirstmoveanim" }, + { 0x140B, "bg" }, + { 0x140C, "bg_loop_sound" }, + { 0x140D, "bg_rog_hit" }, + { 0x140E, "bg_rog_impact" }, + { 0x140F, "bg_viewbobmax" }, + { 0x1410, "bg_weaponbobamplitudebase" }, + { 0x1411, "bg_zodiac_respawn" }, + { 0x1414, "bhasgunwhileriding" }, + { 0x1415, "bhasnopath" }, + { 0x1416, "bidlehitreaction" }, + { 0x1417, "bidlelooking" }, + { 0x1418, "big_dish_fall" }, + { 0x1419, "big_message" }, + { 0x141A, "big_wave_2" }, + { 0x141B, "big_wave_addl_effects" }, + { 0x141C, "big_wreck_2_dialogue" }, + { 0x141D, "big_wreck_2_setup" }, + { 0x141E, "big_wreck_baker_stealth" }, + { 0x1420, "big_wreck_dialogue" }, + { 0x1421, "big_wreck_encounter" }, + { 0x1423, "big_wreck_kill_when_outside" }, + { 0x1424, "big_wreck_setup" }, + { 0x1425, "big_wreck_shark" }, + { 0x1426, "big_wreck_shark_baker_teleport" }, + { 0x1427, "big_wreck_tilt" }, + { 0x1428, "big_wreck_track_player_gunfire" }, + { 0x142A, "bigjump" }, + { 0x142B, "bigjump_player_blend_to_anim" }, + { 0x142C, "bigjump_timedelta" }, + { 0x142D, "bigmissile1" }, + { 0x142E, "bike" }, + { 0x1430, "bike_avoids_obstacles" }, + { 0x1431, "bike_death_score" }, + { 0x1432, "bike_drives_path" }, + { 0x1433, "bike_ent_wipe_out_check" }, + { 0x1434, "bike_randomly_changes_lanes" }, + { 0x1436, "bike_turns" }, + { 0x1437, "bin_failsafe" }, + { 0x1438, "binding" }, + { 0x143A, "bink_is_paused" }, + { 0x143B, "bink_percentage" }, + { 0x143C, "bink_start_time" }, + { 0x143D, "binoc_target" }, + { 0x143E, "binocular_body_features_left" }, + { 0x1440, "binocular_face_scanning" }, + { 0x1441, "binocular_face_scanning_data" }, + { 0x1443, "binocular_face_scanning_lines_complete" }, + { 0x1446, "binocular_profile_materials" }, + { 0x1448, "binocular_reticle_target_reaction" }, + { 0x1449, "binocular_status_update" }, + { 0x144A, "binocular_target" }, + { 0x144B, "binocular_zoom_levels" }, + { 0x144E, "binoculars_angles_display" }, + { 0x144F, "binoculars_calculate_range" }, + { 0x1450, "binoculars_clear_hud" }, + { 0x1452, "binoculars_default_zoom_level" }, + { 0x1454, "binoculars_hide_deactive_hint" }, + { 0x1455, "binoculars_hide_hint" }, + { 0x1456, "binoculars_hud" }, + { 0x1457, "binoculars_hud_item" }, + { 0x1458, "binoculars_init" }, + { 0x145A, "binoculars_linked_to_target" }, + { 0x145B, "binoculars_lock_to_target" }, + { 0x145C, "binoculars_monitor_scanning" }, + { 0x145D, "binoculars_monitor_scanning_button" }, + { 0x1461, "binoculars_pip_update_position" }, + { 0x1462, "binoculars_remove_target_on_death" }, + { 0x1463, "binoculars_reticle_lerp_to_tag" }, + { 0x1464, "binoculars_scan_for_targets" }, + { 0x1465, "binoculars_scan_target" }, + { 0x1466, "binoculars_scan_target_points" }, + { 0x1468, "binoculars_set_default_zoom_level" }, + { 0x1469, "binoculars_set_vision_set" }, + { 0x146B, "binoculars_trace" }, + { 0x146D, "binoculars_vision_set" }, + { 0x146E, "binoculars_zoom_display" }, + { 0x146F, "binoculars_zooming" }, + { 0x1471, "bird_fly" }, + { 0x1473, "bird_fx" }, + { 0x1475, "bird_model" }, + { 0x1476, "bird_sit" }, + { 0x1477, "bird_startle" }, + { 0x1478, "bird_waitfordamage" }, + { 0x1479, "birdexists" }, + { 0x147A, "birdmodel_anims" }, + { 0x147B, "birds" }, + { 0x147C, "birds_createents" }, + { 0x147F, "birds_finishbirdtypesetup" }, + { 0x1480, "birds_fly" }, + { 0x1482, "birds_get_last_takeoff" }, + { 0x1483, "birds_isperchsafe" }, + { 0x1484, "birds_loadfromstruct" }, + { 0x1485, "birds_on_baddy" }, + { 0x1486, "birds_path_move_first_point" }, + { 0x1487, "birds_perchdangertrigger" }, + { 0x1489, "birds_perchsetuppath" }, + { 0x148B, "birds_savetostruct" }, + { 0x148C, "birds_savetostructandwaitfortriggerstart" }, + { 0x148E, "birds_setup" }, + { 0x148F, "birds_setupconnectedperches" }, + { 0x1492, "birth_time" }, + { 0x1493, "bisgunner" }, + { 0x1494, "bishop" }, + { 0x1497, "bishop_in_crosshairs" }, + { 0x1498, "bishop_loop_carry_pose" }, + { 0x149A, "bishop_speaks" }, + { 0x149B, "bishop_stool" }, + { 0x149D, "bkillplayer" }, + { 0x149F, "black_fade" }, + { 0x14A0, "black_ice_geyser2_pulse" }, + { 0x14A1, "black_ice_geyser_pulse" }, + { 0x14A2, "black_ice_hide_hud" }, + { 0x14A3, "black_ice_hud" }, + { 0x14A4, "black_ice_hud_actionslotshide" }, + { 0x14A6, "black_ice_hud_compass" }, + { 0x14A7, "black_ice_hud_showstance" }, + { 0x14A8, "black_ice_show_previous_hud" }, + { 0x14AA, "black_screen_vo" }, + { 0x14AB, "blackbox_alienkilled" }, + { 0x14AC, "blackbox_endgame" }, + { 0x14AD, "blackbox_endgame_score" }, + { 0x14AE, "blackbox_laststand" }, + { 0x14AF, "blackhawk_ally" }, + { 0x14B0, "blackhawk_countermeasure" }, + { 0x14B2, "blackhawk_idle_next_to_factory" }, + { 0x14B3, "blackhawk_into_position" }, + { 0x14B4, "blackhawk_landing" }, + { 0x14B5, "blackhawk_path_to_end" }, + { 0x14B6, "blackhawk_unloads_and_takes_off" }, + { 0x14B7, "blackice_exfil_music" }, + { 0x14B8, "blackice_exfil_stinger_music" }, + { 0x14B9, "blackice_ice_chunks_truck" }, + { 0x14BA, "blackice_locations" }, + { 0x14BB, "blackice_pre_ascend_music" }, + { 0x14BC, "blackout" }, + { 0x14BD, "blackout_50" }, + { 0x14BE, "blackout_enemy1and2_react_anims" }, + { 0x14BF, "blackout_enemy3" }, + { 0x14C0, "blackout_enemy45" }, + { 0x14C1, "blackout_loop_anims" }, + { 0x14C2, "blackout_moment_anims" }, + { 0x14C4, "blackout_no_blur" }, + { 0x14C6, "blackscreen" }, + { 0x14C7, "blackscreen_intro" }, + { 0x14C8, "blank" }, + { 0x14C9, "blast_shield" }, + { 0x14CB, "blastshieldclamp" }, + { 0x14CC, "blastshieldmod" }, + { 0x14CD, "blastshieldusetracker" }, + { 0x14CE, "blend_droppitch" }, + { 0x14CF, "blend_link_over_time" }, + { 0x14D0, "blend_movespeedscale" }, + { 0x14D1, "blend_movespeedscale_custom" }, + { 0x14D2, "blend_movespeedscale_default" }, + { 0x14D3, "blend_movespeedscale_percent" }, + { 0x14D4, "blend_player_position" }, + { 0x14D5, "blend_player_to_arms" }, + { 0x14D6, "blend_struct" }, + { 0x14D9, "blend_to_exploder" }, + { 0x14DA, "blend_wind_setting_internal" }, + { 0x14DB, "blend_zones" }, + { 0x14DE, "blended_link" }, + { 0x14DF, "blendintocrouchrun" }, + { 0x14E0, "blendintocrouchwalk" }, + { 0x14E1, "blendintostandrun" }, + { 0x14E2, "blendintostandwalk" }, + { 0x14E3, "blendtreeanims" }, + { 0x14E4, "blindfire" }, + { 0x14E5, "blinkinglightfx" }, + { 0x14E8, "blitz_allies_trigger_origin" }, + { 0x14E9, "blitz_axis_trigger_origin" }, + { 0x14EA, "blitzgetteam" }, + { 0x14EB, "block_ally_cornerwaving" }, + { 0x14EC, "block_ally_sneak_to_node" }, + { 0x14EE, "block_garage_exit" }, + { 0x14EF, "block_off_road_during_convoy" }, + { 0x14F0, "block_until_at_struct" }, + { 0x14F1, "block_until_fully_stopped_and_idle" }, + { 0x14F3, "blockarea" }, + { 0x14F4, "blockentsinarea" }, + { 0x14F5, "blocker_hive_active" }, + { 0x14F6, "blocker_hive_burn" }, + { 0x14F7, "blocker_hive_chopper_hp_bar" }, + { 0x14F8, "blocker_hive_cycle" }, + { 0x14F9, "blocker_hive_hp_bar" }, + { 0x14FA, "blocker_hive_pain_monitor" }, + { 0x14FD, "blockgoalpos" }, + { 0x14FE, "blocking" }, + { 0x14FF, "blockingpain" }, + { 0x1500, "blockplayeruav" }, + { 0x1501, "blockweapondrops" }, + { 0x1502, "blood_splat_on_screen" }, + { 0x1505, "bloodrushregenhealthmod" }, + { 0x1506, "bloodrushregenspeedmod" }, + { 0x1507, "bloodsplateffect" }, + { 0x1508, "bloody_death" }, + { 0x150C, "blowdoors" }, + { 0x150D, "blowit_beep" }, + { 0x150E, "blowout_goalradius_on_pathend" }, + { 0x150F, "blue" }, + { 0x1510, "blue_flare" }, + { 0x1511, "blur" }, + { 0x1512, "blur_death" }, + { 0x1513, "blur_pulse" }, + { 0x1514, "blur_sine" }, + { 0x1515, "blurview" }, + { 0x1516, "bmantisexplosionplaying" }, + { 0x1517, "bmcd_debug_loop" }, + { 0x1518, "bmovingstraight" }, + { 0x1519, "bnoanimunload" }, + { 0x151A, "bnpcpostsoundplaying" }, + { 0x151B, "bo_enemy3" }, + { 0x151D, "bo_enemy5" }, + { 0x1520, "boat2_in_sounds" }, + { 0x1521, "boat_crashing_waves" }, + { 0x1522, "boat_fall_trigs" }, + { 0x1523, "boat_mginit" }, + { 0x1524, "boat_populate" }, + { 0x1527, "boat_teleport" }, + { 0x1529, "boat_vo" }, + { 0x152A, "boats" }, + { 0x152B, "boats_struct" }, + { 0x152C, "bob_axis" }, + { 0x152D, "bob_mask" }, + { 0x152F, "bob_value" }, + { 0x1530, "bobbing_actor" }, + { 0x1532, "bobbing_jitter_cleanup" }, + { 0x1533, "bobbing_object" }, + { 0x1535, "bobbing_ripple" }, + { 0x1536, "bobbing_updown" }, + { 0x1537, "bobcat" }, + { 0x1538, "bodies" }, + { 0x153A, "body_ext" }, + { 0x153C, "body_is_falling" }, + { 0x153D, "bodyarmorhp" }, + { 0x153E, "bodyindex" }, + { 0x1540, "bog_style_mortar" }, + { 0x1542, "bog_style_mortar_cleanup" }, + { 0x1543, "bog_style_mortar_cooldown" }, + { 0x1544, "bog_style_mortar_explode" }, + { 0x1545, "bog_style_mortar_off" }, + { 0x1546, "bog_style_mortar_on" }, + { 0x1547, "bog_style_mortar_think" }, + { 0x154A, "bokeh_ent" }, + { 0x154B, "bokehdots_audition_test" }, + { 0x154C, "bold_dog_jeep" }, + { 0x154D, "bolthit" }, + { 0x154E, "bomb" }, + { 0x154F, "bomb_squad" }, + { 0x1552, "bombdefusetrig" }, + { 0x1554, "bombexploded" }, + { 0x1556, "bombowner" }, + { 0x1557, "bombplanted" }, + { 0x1558, "bombplantedtime" }, + { 0x155A, "bombsquadicon" }, + { 0x155B, "bombsquadicons" }, + { 0x155D, "bombsquadmodel" }, + { 0x155E, "bombsquadvisibilityupdater" }, + { 0x155F, "bombsquadwaiter_missilefire" }, + { 0x1560, "bombstrike" }, + { 0x1561, "bombtimer" }, + { 0x1563, "bombwatcher" }, + { 0x1564, "bombzones" }, + { 0x1565, "bone" }, + { 0x1567, "boneyard_style_heli_missile_attack" }, + { 0x156A, "bool" }, + { 0x156B, "border" }, + { 0x156C, "border_thickness" }, + { 0x156E, "borescope" }, + { 0x1571, "bot" }, + { 0x1572, "bot_3d_sighting_model" }, + { 0x1573, "bot_3d_sighting_model_thread" }, + { 0x1574, "bot_abort_tactical_goal" }, + { 0x1575, "bot_add_ambush_time_delayed" }, + { 0x1577, "bot_add_to_bot_damage_targets" }, + { 0x1578, "bot_add_to_bot_level_targets" }, + { 0x1579, "bot_add_to_bot_use_targets" }, + { 0x157A, "bot_allowed_to_use_killstreaks" }, + { 0x157B, "bot_ambush_end" }, + { 0x157D, "bot_attachment_reticle" }, + { 0x157E, "bot_attachmenttable" }, + { 0x157F, "bot_balance_personality" }, + { 0x1580, "bot_body_is_dead" }, + { 0x1581, "bot_bots_enabled_or_added" }, + { 0x1582, "bot_cache_entrances" }, + { 0x1583, "bot_cache_entrances_to_bombzones" }, + { 0x1584, "bot_cache_entrances_to_flags_or_radios" }, + { 0x1585, "bot_can_revive" }, + { 0x1586, "bot_can_use_aa_launcher" }, + { 0x1587, "bot_can_use_air_superiority" }, + { 0x1588, "bot_can_use_ball_drone" }, + { 0x1589, "bot_can_use_box_by_type" }, + { 0x158B, "bot_can_use_point_in_defend" }, + { 0x158D, "bot_capture_zone" }, + { 0x158E, "bot_capture_zone_get_furthest_distance" }, + { 0x158F, "bot_check_team_is_using_position" }, + { 0x1590, "bot_choose_difficulty_for_default" }, + { 0x1591, "bot_chosen_difficulty" }, + { 0x1592, "bot_class" }, + { 0x1593, "bot_client_counts" }, + { 0x1594, "bot_connect_monitor" }, + { 0x1595, "bot_control_heli" }, + { 0x1596, "bot_control_heli_main_move_loop" }, + { 0x1597, "bot_control_heli_pilot" }, + { 0x1598, "bot_control_heli_sniper" }, + { 0x1599, "bot_control_odin" }, + { 0x159D, "bot_control_vanguard" }, + { 0x159E, "bot_crate_is_command_goal" }, + { 0x159F, "bot_crate_valid" }, + { 0x15A0, "bot_damage_callback" }, + { 0x15A3, "bot_defend_get_random_entrance_point_for_current_area" }, + { 0x15A5, "bot_defend_stop" }, + { 0x15A6, "bot_defend_think" }, + { 0x15A7, "bot_defending" }, + { 0x15A8, "bot_defending_center" }, + { 0x15AB, "bot_defending_radius" }, + { 0x15AC, "bot_defending_trigger" }, + { 0x15AD, "bot_defending_type" }, + { 0x15B0, "bot_disable_tactical_goals" }, + { 0x15B1, "bot_draw_circle" }, + { 0x15B2, "bot_draw_cylinder" }, + { 0x15B3, "bot_draw_cylinder_think" }, + { 0x15B4, "bot_enable_tactical_goals" }, + { 0x15B5, "bot_end_control_on_respawn" }, + { 0x15B6, "bot_end_control_on_vehicle_death" }, + { 0x15B7, "bot_end_control_watcher" }, + { 0x15B8, "bot_end_odin_watcher" }, + { 0x15B9, "bot_ent_is_anonymous_mine" }, + { 0x15BA, "bot_filter_ambush_inuse" }, + { 0x15BB, "bot_filter_ambush_vicinity" }, + { 0x15BC, "bot_find_ambush_entrances" }, + { 0x15BD, "bot_find_defend_node_func" }, + { 0x15BE, "bot_find_node_that_protects_point" }, + { 0x15BF, "bot_find_node_to_capture_point" }, + { 0x15C1, "bot_find_node_to_guard_player" }, + { 0x15C2, "bot_find_random_midpoint" }, + { 0x15C3, "bot_fireteam_buddy_search" }, + { 0x15C4, "bot_fireteam_buddy_think" }, + { 0x15C5, "bot_fireteam_buddy_up" }, + { 0x15C6, "bot_fireteam_cac_getperk" }, + { 0x15C7, "bot_fireteam_cac_getprimarygrenade" }, + { 0x15C8, "bot_fireteam_cac_getsecondarygrenade" }, + { 0x15C9, "bot_fireteam_cac_getstreak" }, + { 0x15CA, "bot_fireteam_cac_getweapon" }, + { 0x15CC, "bot_fireteam_cac_getweaponattachmenttwo" }, + { 0x15CD, "bot_fireteam_cac_getweaponbuff" }, + { 0x15CE, "bot_fireteam_cac_getweaponcamo" }, + { 0x15CF, "bot_fireteam_cac_getweaponreticle" }, + { 0x15D1, "bot_fireteam_follower" }, + { 0x15D4, "bot_fireteam_loadout_class_callback" }, + { 0x15D5, "bot_fireteam_monitor_killstreak_earned" }, + { 0x15D6, "bot_fireteam_setup_callback_class" }, + { 0x15D7, "bot_fireteam_setup_callbacks" }, + { 0x15D9, "bot_free_to_move" }, + { 0x15DA, "bot_funcs" }, + { 0x15DB, "bot_gametype_chooses_class" }, + { 0x15DC, "bot_gametype_chooses_team" }, + { 0x15DF, "bot_get_client_limit" }, + { 0x15E0, "bot_get_entrances_for_stance_and_index" }, + { 0x15E1, "bot_get_grenade_ammo" }, + { 0x15E2, "bot_get_grenade_for_purpose" }, + { 0x15E3, "bot_get_heli_goal_dist_sq" }, + { 0x15E4, "bot_get_heli_slowdown_dist_sq" }, + { 0x15E5, "bot_get_known_attacker" }, + { 0x15E7, "bot_get_nodes_in_cone" }, + { 0x15E8, "bot_get_player_team" }, + { 0x15E9, "bot_get_rank_xp" }, + { 0x15EA, "bot_get_string_index_for_integer" }, + { 0x15EB, "bot_get_team_limit" }, + { 0x15EC, "bot_get_teammates_currently_defending_point" }, + { 0x15EE, "bot_get_total_gun_ammo" }, + { 0x15EF, "bot_get_zones_within_dist" }, + { 0x15F0, "bot_get_zones_within_dist_recurs" }, + { 0x15F1, "bot_goal_can_override" }, + { 0x15F2, "bot_grenade_matches_purpose" }, + { 0x15F3, "bot_guard_player" }, + { 0x15F5, "bot_has_tactical_goal" }, + { 0x15F6, "bot_heli_find_unvisited_nodes" }, + { 0x15F7, "bot_heli_nodes" }, + { 0x15F8, "bot_heli_pilot_traceoffset" }, + { 0x15F9, "bot_in_combat" }, + { 0x15FA, "bot_initialized_remote_vehicles" }, + { 0x15FB, "bot_interaction_type" }, + { 0x15FC, "bot_invalid_attachment_combos" }, + { 0x15FD, "bot_is_bodyguarding" }, + { 0x15FE, "bot_is_capturing" }, + { 0x15FF, "bot_is_defending" }, + { 0x1600, "bot_is_defending_point" }, + { 0x1601, "bot_is_fireteam_mode" }, + { 0x1602, "bot_is_guarding_player" }, + { 0x1605, "bot_is_remote_or_linked" }, + { 0x1606, "bot_killstreak_choose_loc_enemies" }, + { 0x1607, "bot_killstreak_drop" }, + { 0x1609, "bot_killstreak_drop_hidden" }, + { 0x160A, "bot_killstreak_drop_outside" }, + { 0x160B, "bot_killstreak_get_all_outside_allies" }, + { 0x160C, "bot_killstreak_get_all_outside_enemies" }, + { 0x160E, "bot_killstreak_get_zone_allies_outside" }, + { 0x160F, "bot_killstreak_get_zone_enemies_outside" }, + { 0x1610, "bot_killstreak_is_valid_internal" }, + { 0x1612, "bot_killstreak_never_use" }, + { 0x1613, "bot_killstreak_remote_control" }, + { 0x1614, "bot_killstreak_sentry" }, + { 0x1615, "bot_killstreak_setup" }, + { 0x1616, "bot_killstreak_simple_use" }, + { 0x1617, "bot_killstreak_valid_for_specific_streaktype" }, + { 0x161B, "bot_ks_funcs" }, + { 0x161F, "bot_loadout_choose_from_attachmenttable" }, + { 0x1621, "bot_loadout_choose_from_perktable" }, + { 0x1622, "bot_loadout_choose_from_set" }, + { 0x1626, "bot_loadout_copy_from_client" }, + { 0x1627, "bot_loadout_fields" }, + { 0x1629, "bot_loadout_pick" }, + { 0x162A, "bot_loadout_set" }, + { 0x162B, "bot_loadout_setup_perks" }, + { 0x162C, "bot_loadout_setup_squad_match" }, + { 0x162D, "bot_loadout_valid_choice" }, + { 0x162F, "bot_lui_convert_team_to_int" }, + { 0x1631, "bot_map_center" }, + { 0x1632, "bot_map_max_x" }, + { 0x1633, "bot_map_max_y" }, + { 0x1635, "bot_map_min_x" }, + { 0x1636, "bot_map_min_y" }, + { 0x1637, "bot_map_min_z" }, + { 0x1638, "bot_melee_tactical_insertion_check" }, + { 0x1639, "bot_memory_goal" }, + { 0x163A, "bot_memory_goal_time" }, + { 0x163D, "bot_monitor_watch_entrances_bodyguard" }, + { 0x163F, "bot_new_tactical_goal" }, + { 0x1640, "bot_notify_streak_used" }, + { 0x1641, "bot_odin_find_target_for_airdrop" }, + { 0x1642, "bot_odin_find_target_for_rods" }, + { 0x1643, "bot_odin_get_closest_visible_outside_player" }, + { 0x1646, "bot_odin_get_player_target_point" }, + { 0x1647, "bot_odin_get_visible_outside_players" }, + { 0x1648, "bot_odin_should_airdrop_at_marker" }, + { 0x164A, "bot_odin_should_fire_flash_at_marker" }, + { 0x164B, "bot_odin_should_fire_rod_at_marker" }, + { 0x164C, "bot_odin_time_to_move" }, + { 0x164D, "bot_odin_try_airdrop" }, + { 0x164E, "bot_odin_try_flash" }, + { 0x164F, "bot_odin_try_rods" }, + { 0x1650, "bot_odin_try_smoke" }, + { 0x1651, "bot_odin_try_spawn_juggernaut" }, + { 0x1652, "bot_out_of_ammo" }, + { 0x1654, "bot_outside_gate_watch" }, + { 0x1656, "bot_perk_cost" }, + { 0x1657, "bot_perktable" }, + { 0x1659, "bot_pers_init" }, + { 0x165A, "bot_pers_update" }, + { 0x165E, "bot_pick_random_point_from_set" }, + { 0x1660, "bot_pickup_weapon" }, + { 0x1662, "bot_point_is_on_pathgrid" }, + { 0x1663, "bot_post_teleport" }, + { 0x1664, "bot_post_use_ammo_crate" }, + { 0x1665, "bot_post_use_box_of_type" }, + { 0x1667, "bot_pre_use_box_of_type" }, + { 0x1669, "bot_protect_point" }, + { 0x166A, "bot_queued_process" }, + { 0x166B, "bot_queued_process_level_thread" }, + { 0x166C, "bot_queued_process_level_thread_active" }, + { 0x166E, "bot_random_path" }, + { 0x166F, "bot_random_path_default" }, + { 0x1670, "bot_random_path_function" }, + { 0x1671, "bot_random_ranks_for_difficulty" }, + { 0x1673, "bot_register_killstreak_func" }, + { 0x1674, "bot_remove_from_bot_level_targets" }, + { 0x1675, "bot_respawn_launcher_name" }, + { 0x1676, "bot_restart_think_threads" }, + { 0x1677, "bot_rnd_prestige" }, + { 0x1678, "bot_rnd_rank" }, + { 0x167A, "bot_seek_dropped_weapon" }, + { 0x167B, "bot_send_cancel_notify" }, + { 0x167D, "bot_sentry_activate" }, + { 0x167E, "bot_sentry_add_goal" }, + { 0x1680, "bot_sentry_carried_obj" }, + { 0x1681, "bot_sentry_choose_placement" }, + { 0x1682, "bot_sentry_choose_target" }, + { 0x1683, "bot_sentry_ensure_exit" }, + { 0x1684, "bot_sentry_force_cancel" }, + { 0x1685, "bot_sentry_path_start" }, + { 0x1686, "bot_sentry_path_thread" }, + { 0x1688, "bot_set_ambush_trap" }, + { 0x1689, "bot_set_ambush_trap_wait_fire" }, + { 0x168A, "bot_set_bombzone_bottargets" }, + { 0x168B, "bot_set_difficulty" }, + { 0x168D, "bot_set_personality" }, + { 0x168F, "bot_setup_bot_targets" }, + { 0x1690, "bot_setup_callback_class" }, + { 0x1692, "bot_setup_radio_bottargets" }, + { 0x1693, "bot_shootable_target_watch" }, + { 0x1694, "bot_should_do_killcam" }, + { 0x1696, "bot_should_pickup_weapons" }, + { 0x1697, "bot_should_use_ammo_crate" }, + { 0x1699, "bot_should_use_grenade_crate" }, + { 0x169B, "bot_should_use_scavenger_bag" }, + { 0x169C, "bot_spawned_before" }, + { 0x169D, "bot_squad_lookup" }, + { 0x169E, "bot_squad_lookup_enemy" }, + { 0x16A0, "bot_squad_lookup_ranked" }, + { 0x16A1, "bot_start_aa_launcher_tracking" }, + { 0x16A4, "bot_supported_killstreaks" }, + { 0x16A5, "bot_switch_to_killstreak_weapon" }, + { 0x16A6, "bot_target" }, + { 0x16A7, "bot_targets" }, + { 0x16A8, "bot_tdm_apply_commander_tactics" }, + { 0x16AC, "bot_think_crate" }, + { 0x16AD, "bot_think_crate_blocking_path" }, + { 0x16AE, "bot_think_gametype" }, + { 0x16AF, "bot_think_killstreak" }, + { 0x16B1, "bot_think_revive" }, + { 0x16B2, "bot_think_seek_dropped_weapons" }, + { 0x16B3, "bot_think_tactical_goals" }, + { 0x16B5, "bot_think_watch_enemy" }, + { 0x16B6, "bot_underground_trapped_watch" }, + { 0x16B8, "bot_usebutton_wait" }, + { 0x16B9, "bot_valid_camp_assassin" }, + { 0x16BA, "bot_validate_perk" }, + { 0x16BB, "bot_validate_reticle" }, + { 0x16BC, "bot_validate_weapon" }, + { 0x16BD, "bot_vanguard_find_unvisited_nodes" }, + { 0x16BE, "bot_vanguard_height_trace_size" }, + { 0x16C5, "bot_waittill_goal_or_fail" }, + { 0x16C6, "bot_waittill_out_of_combat_or_time" }, + { 0x16C7, "bot_waittill_using_vehicle" }, + { 0x16C8, "bot_war_think" }, + { 0x16CB, "bot_watch_manual_detonate" }, + { 0x16CC, "bot_watch_nodes" }, + { 0x16CD, "bot_weap_personality" }, + { 0x16CE, "bot_weap_statstable" }, + { 0x16D0, "botlastloadout" }, + { 0x16D1, "botlastloadoutdifficulty" }, + { 0x16D2, "botlastloadoutpersonality" }, + { 0x16D3, "botloadoutfavoritecamo" }, + { 0x16D7, "bots_disable_team_switching" }, + { 0x16D8, "bots_exist" }, + { 0x16DA, "bots_fireteam_num_classes_loaded" }, + { 0x16DB, "bots_gametype_handles_class_choice" }, + { 0x16DC, "bots_gametype_handles_team_choice" }, + { 0x16DD, "bots_ignore_team_balance" }, + { 0x16DE, "bots_notify_on_disconnect" }, + { 0x16E1, "bots_update_difficulty" }, + { 0x16E2, "bottarget" }, + { 0x16E3, "bottargets" }, + { 0x16E4, "bottom" }, + { 0x16E5, "bottom_arc" }, + { 0x16E6, "bottom_missile_target" }, + { 0x16E7, "bottom_target" }, + { 0x16E8, "bottom_tower_enemies" }, + { 0x16E9, "bouncelight" }, + { 0x16EB, "boundry_radius_cache" }, + { 0x16EC, "boundryradius" }, + { 0x16EE, "box_agentconnected" }, + { 0x16EF, "box_disableplayeruse" }, + { 0x16F0, "box_enableplayeruse" }, + { 0x16F1, "box_handledamage" }, + { 0x16F2, "box_handledeath" }, + { 0x16F3, "box_handledeathdamage" }, + { 0x16F4, "box_handleownerdisconnect" }, + { 0x16F6, "box_modelteamupdater" }, + { 0x16F9, "box_playerjoinedteam" }, + { 0x16FA, "box_setactive" }, + { 0x16FB, "box_seticon" }, + { 0x16FC, "box_setinactive" }, + { 0x16FD, "box_should_leave_immediately" }, + { 0x1702, "boxes" }, + { 0x1704, "boxmodifydamage" }, + { 0x1706, "boxsettings" }, + { 0x1707, "boxthink" }, + { 0x1708, "boxtouchonly" }, + { 0x1709, "boxtype" }, + { 0x170A, "bp" }, + { 0x170C, "bplrpostsoundplaying" }, + { 0x170D, "branchnodes" }, + { 0x170F, "bravo1_ascend_ascender" }, + { 0x1710, "bravo1_ascend_launcher" }, + { 0x1712, "bravo2_ascend_launcher" }, + { 0x1713, "bravo_ascend" }, + { 0x1714, "bravo_ascend_anim_node" }, + { 0x1716, "bravo_ascend_rope2" }, + { 0x1717, "bravo_ascend_rubberband" }, + { 0x1719, "bravo_ascend_rubberband_cleanup" }, + { 0x171B, "bravo_friendly_logic" }, + { 0x171C, "bravo_post_snake_cam" }, + { 0x171E, "breach_abort" }, + { 0x1720, "breach_ai_space_death" }, + { 0x1721, "breach_allies" }, + { 0x1722, "breach_ally_drones_drone_think" }, + { 0x1725, "breach_anim_struct" }, + { 0x1726, "breach_animated_door_init" }, + { 0x1728, "breach_bad_weapon_hint" }, + { 0x172B, "breach_charge_fx_activate" }, + { 0x172E, "breach_cleanup" }, + { 0x1731, "breach_damage_radius" }, + { 0x1732, "breach_damage_watch" }, + { 0x1736, "breach_dont_fire" }, + { 0x1737, "breach_door" }, + { 0x1738, "breach_door_clips" }, + { 0x1739, "breach_door_close" }, + { 0x173A, "breach_door_init" }, + { 0x173B, "breach_door_open" }, + { 0x173D, "breach_door_rig" }, + { 0x173E, "breach_doors" }, + { 0x1740, "breach_enemies_stunned" }, + { 0x1741, "breach_enemy_array" }, + { 0x1743, "breach_enemy_catch_exceptions" }, + { 0x1745, "breach_enemy_death_dmg" }, + { 0x1747, "breach_enemy_player_stab" }, + { 0x1748, "breach_enemy_ragdoll_on_death" }, + { 0x1749, "breach_enemy_setup" }, + { 0x174A, "breach_enemy_spawner_think" }, + { 0x174E, "breach_enemy_waitfor_breach_ending" }, + { 0x1751, "breach_explosion" }, + { 0x1752, "breach_explosion_notify" }, + { 0x1754, "breach_fire_straight" }, + { 0x1756, "breach_friendlies_restore_grenades" }, + { 0x1759, "breach_functions" }, + { 0x175A, "breach_fx_setup" }, + { 0x175B, "breach_grenade" }, + { 0x175C, "breach_grenade_smoke" }, + { 0x175D, "breach_group_trigger_think" }, + { 0x175E, "breach_groups" }, + { 0x175F, "breach_gun_up" }, + { 0x1760, "breach_heli_door" }, + { 0x1761, "breach_hide" }, + { 0x1765, "breach_icon" }, + { 0x1766, "breach_icon_count" }, + { 0x1767, "breach_icon_create" }, + { 0x1768, "breach_icon_fade_in" }, + { 0x1769, "breach_icon_fade_out" }, + { 0x176A, "breach_icon_think" }, + { 0x176B, "breach_icon_update" }, + { 0x176C, "breach_icon_update_is_player_in_range" }, + { 0x176D, "breach_icons" }, + { 0x176E, "breach_index" }, + { 0x176F, "breach_init" }, + { 0x1771, "breach_mines" }, + { 0x1772, "breach_missionfailed" }, + { 0x1774, "breach_nag" }, + { 0x1776, "breach_no_auto_reload" }, + { 0x1777, "breach_not_ready_hint" }, + { 0x1778, "breach_on_activate" }, + { 0x1779, "breach_on_event" }, + { 0x177A, "breach_onenduse" }, + { 0x177B, "breach_onuse" }, + { 0x177C, "breach_open_door" }, + { 0x177D, "breach_open_watch" }, + { 0x177E, "breach_origin" }, + { 0x177F, "breach_other_watch" }, + { 0x1780, "breach_outside_ambience" }, + { 0x1781, "breach_participants_ready_to_proceed" }, + { 0x1783, "breach_passive_time" }, + { 0x1788, "breach_precache" }, + { 0x178A, "breach_pt" }, + { 0x178E, "breach_reset_goaladius" }, + { 0x1790, "breach_rumble" }, + { 0x1791, "breach_set_2dicon" }, + { 0x1793, "breach_set_can_use" }, + { 0x1794, "breach_set_goaladius" }, + { 0x1795, "breach_setup" }, + { 0x1796, "breach_sfx" }, + { 0x1797, "breach_shot_blood_fx" }, + { 0x1799, "breach_show" }, + { 0x179A, "breach_spawner_setup" }, + { 0x179B, "breach_spawners" }, + { 0x179C, "breach_targets" }, + { 0x179D, "breach_think" }, + { 0x179E, "breach_too_many_enemies_hint" }, + { 0x179F, "breach_trigger_cleanup" }, + { 0x17A1, "breach_use_triggers" }, + { 0x17A3, "breach_vehicles" }, + { 0x17A4, "breach_wait_move" }, + { 0x17A5, "breach_wait_nag_proc" }, + { 0x17A8, "breach_weapon" }, + { 0x17A9, "breachdonotfire" }, + { 0x17AA, "breached" }, + { 0x17AE, "breacher_think" }, + { 0x17AF, "breachers" }, + { 0x17B2, "breachfriendlies" }, + { 0x17B3, "breachfriendlies_can_teleport" }, + { 0x17B4, "breachfriendlies_grenades_empty" }, + { 0x17B6, "breaching" }, + { 0x17B7, "breaching_shots_fired" }, + { 0x17B8, "breachless_door_opens" }, + { 0x17BB, "break_cockpit_glass" }, + { 0x17BE, "break_light" }, + { 0x17BF, "break_nearest_light" }, + { 0x17C0, "break_stealth_mg" }, + { 0x17C1, "break_window" }, + { 0x17C2, "breakable_light" }, + { 0x17C5, "breaktarget" }, + { 0x17C7, "breathing_overlay" }, + { 0x17C8, "breathingmanager" }, + { 0x17CA, "bren_switchout_logic" }, + { 0x17CB, "brian" }, + { 0x17D0, "bridge_anim" }, + { 0x17D1, "bridge_begin" }, + { 0x17D2, "bridge_deploy_begin" }, + { 0x17D3, "bridge_deploy_enemy_a10_gun_dives" }, + { 0x17D4, "bridge_deploy_enemy_tanks_setup" }, + { 0x17D5, "bridge_deploy_init" }, + { 0x17D7, "bridge_destroyed" }, + { 0x17D8, "bridge_enemies" }, + { 0x17D9, "bridge_event" }, + { 0x17DD, "bridge_init" }, + { 0x17DE, "bridge_jeep_by" }, + { 0x17E0, "bridge_main" }, + { 0x17E1, "bridge_push" }, + { 0x17E3, "bridge_push_4" }, + { 0x17E4, "bridge_scene_anims" }, + { 0x17E5, "bridge_scene_tank_anims" }, + { 0x17E8, "bridges" }, + { 0x17E9, "briefcase" }, + { 0x17EA, "bright_light_flash_into_console" }, + { 0x17EC, "bring_up_osprey" }, + { 0x17ED, "brinkofdeathkillstreak" }, + { 0x17EE, "broadcast_player_input" }, + { 0x17F1, "broken_wall_delete" }, + { 0x17F2, "broken_wall_init" }, + { 0x17F3, "broken_wall_show" }, + { 0x17F4, "broken_walls" }, + { 0x17FA, "brushmodels" }, + { 0x17FB, "bsharpturnduringsharpturn" }, + { 0x17FC, "bshootwhilemoving" }, + { 0x17FD, "bsnowmobilesstarted" }, + { 0x17FE, "bsoundlooping" }, + { 0x17FF, "bsplashplaying" }, + { 0x1800, "bsprinton" }, + { 0x1801, "bstopbarrage" }, + { 0x1802, "btankmoving" }, + { 0x1803, "bthermalon" }, + { 0x1804, "btr_ambush" }, + { 0x1805, "btr_attack_player_on_flag" }, + { 0x1806, "btr_burst" }, + { 0x1807, "btr_by_mountainside" }, + { 0x1808, "btr_check_player_fire" }, + { 0x1809, "btr_fire_logic" }, + { 0x180A, "btr_look_logic" }, + { 0x180B, "btr_mg_off" }, + { 0x180C, "btr_sees_body" }, + { 0x180D, "btr_stop_when_not_normal" }, + { 0x180E, "btr_target_player" }, + { 0x180F, "btr_turret_follow" }, + { 0x1810, "buddyspawn" }, + { 0x1813, "bufferedstats" }, + { 0x1814, "bufferedstatsmax" }, + { 0x1817, "build_aianims" }, + { 0x1818, "build_all_treadfx" }, + { 0x181A, "build_bulletshield" }, + { 0x181C, "build_car" }, + { 0x181D, "build_chopperboss_defaults" }, + { 0x181E, "build_data_override" }, + { 0x181F, "build_death_badplace" }, + { 0x1820, "build_death_jolt_delay" }, + { 0x1821, "build_deathanim" }, + { 0x1822, "build_deathfx" }, + { 0x1823, "build_deathfx_override" }, + { 0x1824, "build_deathmodel" }, + { 0x1829, "build_elevators" }, + { 0x182A, "build_exhaust" }, + { 0x182B, "build_frontarmor" }, + { 0x182C, "build_fx" }, + { 0x182D, "build_gaz_death" }, + { 0x182E, "build_grenadeshield" }, + { 0x182F, "build_hideparts" }, + { 0x1830, "build_human_model" }, + { 0x1831, "build_humvee_anims" }, + { 0x1833, "build_is_airplane" }, + { 0x1834, "build_is_helicopter" }, + { 0x1835, "build_life" }, + { 0x1837, "build_light_override" }, + { 0x1839, "build_lynx_death" }, + { 0x183C, "build_pillageitem_array" }, + { 0x183D, "build_pillageitem_arrays" }, + { 0x183E, "build_quake" }, + { 0x183F, "build_radiusdamage" }, + { 0x1840, "build_rider_death_func" }, + { 0x1841, "build_rocket_deathfx" }, + { 0x1844, "build_rumble_unique" }, + { 0x1845, "build_shoot_shock" }, + { 0x1846, "build_single_tread" }, + { 0x1847, "build_spawn_zones" }, + { 0x1849, "build_template" }, + { 0x184A, "build_treadfx" }, + { 0x184C, "build_turret" }, + { 0x184D, "build_turrets" }, + { 0x1850, "buildalienweaponname" }, + { 0x1851, "buildalienweaponnamecamo" }, + { 0x1856, "buildbaseweaponlist" }, + { 0x1858, "buildchallengetableinfo" }, + { 0x1859, "builddot_damage" }, + { 0x185A, "builddot_ontick" }, + { 0x185C, "builddot_wait" }, + { 0x1861, "building_entry_exit_anim_struct" }, + { 0x1864, "building_entry_tv" }, + { 0x1865, "building_fall_anim_rig" }, + { 0x1867, "building_hit_fx" }, + { 0x1869, "building_slide_control_hint" }, + { 0x186A, "buildscoreboardtype" }, + { 0x186B, "buildshadowgeomopt" }, + { 0x186D, "buildweaponname" }, + { 0x186F, "buildweaponnamereticle" }, + { 0x1870, "bullet_armor" }, + { 0x1871, "bullet_attack" }, + { 0x1872, "bullet_blender" }, + { 0x1874, "bullet_caused_fuel_leaks" }, + { 0x1875, "bullet_damage_scalar" }, + { 0x1878, "bullet_holes2" }, + { 0x1879, "bullet_holes3" }, + { 0x187A, "bullet_pinhole_tag_fx_orgs" }, + { 0x187B, "bullet_resistance" }, + { 0x187C, "bullet_start" }, + { 0x187D, "bullet_strafe_start" }, + { 0x1880, "bullet_watcher_ambush" }, + { 0x1881, "bulletcount" }, + { 0x1884, "bulletsinclip" }, + { 0x1885, "bulletwhizbycheck_whilemoving" }, + { 0x1886, "bulletwhizbycheckloop" }, + { 0x1887, "bulletwhizbyreaction" }, + { 0x1888, "bully" }, + { 0x1889, "bully_shoots" }, + { 0x188A, "bump_player" }, + { 0x188C, "bunker_balcony_bullet_impacts" }, + { 0x188E, "bunker_balcony_bullet_impacts_think" }, + { 0x188F, "bunker_balcony_cleanup" }, + { 0x1890, "bunker_balcony_damage_state" }, + { 0x1893, "bunker_beach_ai" }, + { 0x1894, "bunker_beach_attackers" }, + { 0x1895, "bunker_beach_attackers_death" }, + { 0x1896, "bunker_beach_attackers_think" }, + { 0x1897, "bunker_beach_vehicles" }, + { 0x1898, "bunker_enemy_cover_drones" }, + { 0x1899, "bunker_final_strafe" }, + { 0x189A, "bunker_final_strafe_hind_missiles" }, + { 0x189C, "bunker_final_strafe_think" }, + { 0x189E, "bunker_mg_guy" }, + { 0x189F, "bunker_reinforcement_helis" }, + { 0x18A1, "bunker_style_mortar_activate" }, + { 0x18A5, "bunker_style_mortar_on" }, + { 0x18A6, "bunker_style_mortar_think" }, + { 0x18A7, "bunker_style_mortar_trigger" }, + { 0x18A8, "bunker_trench_drone_runners" }, + { 0x18AA, "bunker_vehicle_javelin_watcher" }, + { 0x18AB, "burn_trig" }, + { 0x18AC, "burning" }, + { 0x18AF, "burnville_paratrooper_hack_loop" }, + { 0x18B2, "burst_fire_settings" }, + { 0x18B5, "burst_pause_max" }, + { 0x18B6, "burst_pause_min" }, + { 0x18B7, "burst_shots_max" }, + { 0x18B9, "burstdelay" }, + { 0x18BA, "burstfirenumshots" }, + { 0x18BC, "burstmin" }, + { 0x18BD, "burstshootanimrate" }, + { 0x18BF, "bus_movement_internal" }, + { 0x18C0, "bus_movement_model_logic" }, + { 0x18C1, "bus_movement_sounds_rumble_etc" }, + { 0x18C2, "busdust" }, + { 0x18C3, "busereadyidle" }, + { 0x18C6, "bust_thru_prep" }, + { 0x18C7, "bust_thru_prep_dog" }, + { 0x18C8, "butchdance" }, + { 0x18C9, "butchdance_combat" }, + { 0x18CA, "button_is_clicked" }, + { 0x18CB, "button_is_held" }, + { 0x18CD, "button_parse_parameters" }, + { 0x18CE, "button_pressed_from_string" }, + { 0x18D0, "button_sound" }, + { 0x18D1, "button_switch" }, + { 0x18D2, "button_toggles" }, + { 0x18D3, "buttonclick" }, + { 0x18D5, "buttonisheld" }, + { 0x18D6, "buttonpressed_internal" }, + { 0x18D8, "buttonthink" }, + { 0x18DA, "buzzkill" }, + { 0x18DB, "bwalldestroyed" }, + { 0x18DC, "bwalldestroyedsoundplayed" }, + { 0x18DD, "bypass_max_attacker_counter" }, + { 0x18DE, "bypassclasschoice" }, + { 0x18DF, "bypassclasschoicefunc" }, + { 0x18E0, "c" }, + { 0x18E1, "c130" }, + { 0x18E2, "c130setup" }, + { 0x18E3, "c17_drops" }, + { 0x18E4, "c4_cancel_flag" }, + { 0x18E6, "c4_earthquake" }, + { 0x18E7, "c4_hint" }, + { 0x18E8, "c4_hintstring" }, + { 0x18E9, "c4_location" }, + { 0x18EA, "c4_sound_override" }, + { 0x18EB, "c4_spot_glow" }, + { 0x18EC, "c4_weaponname" }, + { 0x18ED, "c4activate" }, + { 0x18EF, "c4damage" }, + { 0x18F0, "c4death" }, + { 0x18F1, "c4deathdetonate" }, + { 0x18F2, "c4detectiontrigger" }, + { 0x18F4, "c4empdamage" }, + { 0x18F5, "c4empkillstreakwait" }, + { 0x18F7, "c4used" }, + { 0x18F9, "cac_getkillstreak" }, + { 0x18FA, "cac_getkillstreakwithtype" }, + { 0x18FB, "cac_getperk" }, + { 0x18FD, "cac_getsecondarygrenade" }, + { 0x18FE, "cac_getweapon" }, + { 0x18FF, "cac_getweaponattachment" }, + { 0x1901, "cac_getweaponattachmenttwo" }, + { 0x1902, "cac_getweaponbuff" }, + { 0x1903, "cac_getweaponcamo" }, + { 0x1904, "cac_getweaponreticle" }, + { 0x1906, "cac_selector" }, + { 0x1907, "cache_ambient" }, + { 0x1908, "cache_ambient_element" }, + { 0x1909, "cache_ambient_event" }, + { 0x190D, "cache_mix_default" }, + { 0x190E, "cache_occlusion" }, + { 0x190F, "cache_reverb" }, + { 0x1910, "cache_timescale" }, + { 0x1911, "cache_whizby" }, + { 0x1912, "cache_zone" }, + { 0x1913, "cached" }, + { 0x1914, "cached_ambients" }, + { 0x1915, "cached_arcs" }, + { 0x1916, "cached_elems" }, + { 0x1919, "cage_guys3" }, + { 0x191A, "cairo_church_whines" }, + { 0x191B, "cairo_scared_dialogue" }, + { 0x191C, "calc_max_last_stands" }, + { 0x191D, "calcanimstartpos" }, + { 0x191E, "calctrackingyaw" }, + { 0x191F, "calculate_and_show_hive_scores" }, + { 0x1920, "calculate_arc" }, + { 0x1921, "calculate_bezier_curve" }, + { 0x1922, "calculate_bravo_rubberband_base" }, + { 0x1923, "calculate_challenge_score" }, + { 0x1924, "calculate_current_intensity_level" }, + { 0x1925, "calculate_defend_stance" }, + { 0x1926, "calculate_discount" }, + { 0x1927, "calculate_drill_protection_score" }, + { 0x1929, "calculate_maxmovedeltainanimstate" }, + { 0x192A, "calculate_partial_hive_scores" }, + { 0x192B, "calculate_personal_skill_score" }, + { 0x192D, "calculate_players_total_end_game_score" }, + { 0x192E, "calculate_stopsoonnotifydist" }, + { 0x1930, "calculate_total_end_game_score" }, + { 0x1931, "calculateanimdata" }, + { 0x1932, "calculated_closest_point" }, + { 0x1933, "calculated_nearest_node" }, + { 0x1934, "calculatekillcamtime" }, + { 0x1936, "calculatenodeoffsetfromanimationdelta" }, + { 0x1938, "call_elevator" }, + { 0x1939, "call_fire_exploder_on_spawn" }, + { 0x193A, "call_flag_when_clacked" }, + { 0x193B, "call_in_airdrop_heli" }, + { 0x193C, "call_in_attack_heli" }, + { 0x193D, "call_in_hive_heli" }, + { 0x193E, "call_in_rescue_heli" }, + { 0x193F, "call_jolt_by_flag" }, + { 0x1942, "callairsupport" }, + { 0x1943, "callback_alienplayerdamage" }, + { 0x1947, "callback_playerconnect" }, + { 0x1948, "callback_playerdamage" }, + { 0x1949, "callback_playerdamage_internal" }, + { 0x194C, "callback_playerlaststand" }, + { 0x194D, "callback_playerlaststandalien" }, + { 0x194F, "callback_playermigrated" }, + { 0x1950, "callback_startgametype" }, + { 0x1951, "callback_vehicledamage" }, + { 0x1953, "callbackhostmigration" }, + { 0x1955, "callbackplayerdamage" }, + { 0x1956, "callbackplayerdisconnect" }, + { 0x1957, "callbackplayerkilled" }, + { 0x1958, "callbackplayerlaststand" }, + { 0x1959, "callbackplayermigrated" }, + { 0x195B, "callbackstartgametype" }, + { 0x195E, "caller" }, + { 0x195F, "calloptionalbehaviorcallback" }, + { 0x1960, "callout" }, + { 0x1961, "calloutdestroyed" }, + { 0x1962, "callouttypewillrepeat" }, + { 0x1963, "callstrike" }, + { 0x1965, "callstrike_bombeffect" }, + { 0x1966, "calm_idle_get_random" }, + { 0x1967, "cam" }, + { 0x1968, "cam_sound_sources" }, + { 0x1969, "camera" }, + { 0x196C, "camera_zoom" }, + { 0x196D, "camera_zoomout" }, + { 0x196E, "cameramodel" }, + { 0x1970, "camlanding_from_apache" }, + { 0x1971, "camp_mblur_changes" }, + { 0x1974, "camper_guy" }, + { 0x1975, "camper_time_started_hunting" }, + { 0x1976, "camper_trigger_think" }, + { 0x1978, "campfire_temp_dialog" }, + { 0x1979, "camping_needs_fallback_camp_location" }, + { 0x197A, "camtime" }, + { 0x197B, "can_activate_trap" }, + { 0x197D, "can_attempt_badpath_move" }, + { 0x1980, "can_cut_rope" }, + { 0x1981, "can_do_charge_attack" }, + { 0x1982, "can_early_melee" }, + { 0x1984, "can_leap_melee" }, + { 0x1986, "can_place_sentry" }, + { 0x1987, "can_purchase_chopper" }, + { 0x1989, "can_say_event_type" }, + { 0x198B, "can_say_soundalias" }, + { 0x198C, "can_see_attacker_for_a_bit" }, + { 0x198D, "can_see_enemy" }, + { 0x198E, "can_see_origin" }, + { 0x1990, "can_spawn_at_any_node" }, + { 0x1991, "can_spawn_meteoroid_alien" }, + { 0x1992, "can_spit_gas_cloud" }, + { 0x1994, "can_use_health" }, + { 0x1995, "canactivatefunc" }, + { 0x1996, "canal_event" }, + { 0x1997, "canbepickedup" }, + { 0x1998, "canbeplaced" }, + { 0x1999, "canbetargeted" }, + { 0x199C, "cancalloutlocation" }, + { 0x199E, "cancel_repair_on_hive_death" }, + { 0x19A1, "cancelmode" }, + { 0x19A2, "cancelnukeondeath" }, + { 0x19A4, "canceluse_default_deployable_box" }, + { 0x19A5, "canceluse_dpad_airstrike" }, + { 0x19A6, "canceluse_dpad_backup_buddy" }, + { 0x19A7, "canceluse_dpad_death_machine" }, + { 0x19A8, "canceluse_dpad_glsentry" }, + { 0x19A9, "canceluse_dpad_ims" }, + { 0x19AA, "canceluse_dpad_minigun_turret" }, + { 0x19AB, "canceluse_dpad_predator" }, + { 0x19AC, "canceluse_dpad_riotshield" }, + { 0x19AD, "canceluse_dpad_sentry" }, + { 0x19AE, "canceluse_dpad_war_machine" }, + { 0x19B2, "candodge" }, + { 0x19B3, "candoflavorburst" }, + { 0x19B4, "candojumpforend" }, + { 0x19B5, "candopain" }, + { 0x19B6, "candostartmove" }, + { 0x19B7, "candoturnanim" }, + { 0x19B8, "canenttriggerplatform" }, + { 0x19B9, "canfire" }, + { 0x19BC, "cangive_booster" }, + { 0x19BE, "cangive_health" }, + { 0x19BF, "cangive_loot_blood" }, + { 0x19C1, "cangive_maxammo" }, + { 0x19C2, "cangive_offhand" }, + { 0x19C3, "cangive_self_revive" }, + { 0x19C4, "cangive_shock_ammo" }, + { 0x19C5, "cangive_slotted_explosive" }, + { 0x19C7, "cangive_throwable_weapon" }, + { 0x19CB, "canlean" }, + { 0x19CC, "canlogclient" }, + { 0x19CD, "canlogevent" }, + { 0x19CE, "canlogkillstreak" }, + { 0x19CF, "canloglife" }, + { 0x19D0, "canmovepointtopoint" }, + { 0x19D1, "cannedtraverseanims" }, + { 0x19D3, "cannonfirevfx" }, + { 0x19D4, "cannonrumble" }, + { 0x19D5, "cannotplacestring" }, + { 0x19D6, "canperformclienttraces" }, + { 0x19D7, "canpickcrate" }, + { 0x19D8, "canpickupobject" }, + { 0x19DC, "canpurchase_dpad_backup_buddy" }, + { 0x19DD, "canpurchase_dpad_death_machine" }, + { 0x19E0, "canpurchase_dpad_minigun_turret" }, + { 0x19E1, "canpurchase_dpad_predator" }, + { 0x19E2, "canpurchase_dpad_riotshield" }, + { 0x19E6, "canpurchase_dpad_team_armor" }, + { 0x19E7, "canpurchase_dpad_team_boost" }, + { 0x19E8, "canpurchase_dpad_team_currency" }, + { 0x19EB, "canpurchase_dpad_team_specialammo" }, + { 0x19ED, "canreactagain" }, + { 0x19EE, "canreadtext" }, + { 0x19EF, "canregenhealth" }, + { 0x19F0, "canreturntocover" }, + { 0x19F1, "cansave" }, + { 0x19F5, "canseeandshootpoint" }, + { 0x19F7, "canseeenemyfromexposed" }, + { 0x19F9, "canseepointfromexposedatnode" }, + { 0x19FA, "canshootwhilerunning" }, + { 0x19FB, "canshootwhilerunningbackward" }, + { 0x19FC, "canshootwhilerunningforward" }, + { 0x19FE, "canstoppeeking" }, + { 0x19FF, "cansuppressenemy" }, + { 0x1A02, "cantfindanythingtodo" }, + { 0x1A03, "canthittarget" }, + { 0x1A04, "canthrowgrenade" }, + { 0x1A05, "cantraceto" }, + { 0x1A06, "cantseeenemybehavior" }, + { 0x1A07, "cantseeenemywait" }, + { 0x1A09, "canuse" }, + { 0x1A0B, "canuse_dpad_backup_buddy" }, + { 0x1A0C, "canuse_dpad_death_machine" }, + { 0x1A0D, "canuse_dpad_glsentry" }, + { 0x1A0E, "canuse_dpad_ims" }, + { 0x1A0F, "canuse_dpad_minigun_turret" }, + { 0x1A10, "canuse_dpad_predator" }, + { 0x1A14, "canuse_dpad_team_ammo" }, + { 0x1A15, "canuse_dpad_team_armor" }, + { 0x1A16, "canuse_dpad_team_boost" }, + { 0x1A17, "canuse_dpad_team_currency" }, + { 0x1A18, "canuse_dpad_team_explosives" }, + { 0x1A1C, "canusecallback" }, + { 0x1A1D, "canusedeployable" }, + { 0x1A1F, "canuseotherboxes" }, + { 0x1A21, "canyon_init" }, + { 0x1A22, "canyon_jumper_setup" }, + { 0x1A23, "canyon_main" }, + { 0x1A24, "cap_range" }, + { 0x1A25, "capacity" }, + { 0x1A26, "capsule_ninja" }, + { 0x1A27, "capturednuke" }, + { 0x1A2A, "capturingstring" }, + { 0x1A2C, "car_1" }, + { 0x1A2D, "car_alarm_org" }, + { 0x1A2E, "car_alarm_timeout" }, + { 0x1A2F, "car_damage_owner_recorder" }, + { 0x1A32, "care_package_watch" }, + { 0x1A34, "career_stat_increment" }, + { 0x1A35, "career_stats_init" }, + { 0x1A38, "cargo" }, + { 0x1A39, "cargo_amb" }, + { 0x1A3A, "cargo_choppers" }, + { 0x1A3B, "cargo_container" }, + { 0x1A3C, "cargo_item_spawners" }, + { 0x1A3E, "cargo_winds_front" }, + { 0x1A3F, "cargo_winds_rear" }, + { 0x1A40, "carried_grape" }, + { 0x1A41, "carriedby" }, + { 0x1A43, "carrieditem" }, + { 0x1A45, "carrier" }, + { 0x1A46, "carrier_grape" }, + { 0x1A48, "carrier_life_jet_takeoff_guys" }, + { 0x1A49, "carrier_life_jet_takeoff_jet" }, + { 0x1A4A, "carrier_liferaft" }, + { 0x1A4C, "carrier_light_post_sparrow" }, + { 0x1A4D, "carrier_locations" }, + { 0x1A4E, "carrier_planes_precache" }, + { 0x1A4F, "carrier_post_load" }, + { 0x1A50, "carrier_set_vision_rog_tilt" }, + { 0x1A51, "carrier_starts" }, + { 0x1A52, "carriervisible" }, + { 0x1A53, "carry_bishop" }, + { 0x1A54, "carry_in" }, + { 0x1A55, "carry_vanguard" }, + { 0x1A56, "carryflag" }, + { 0x1A57, "carryicon" }, + { 0x1A58, "carrying_pickedup_sentry" }, + { 0x1A59, "carryobject" }, + { 0x1A5A, "carryobject_overridemovingplatformdeath" }, + { 0x1A5B, "carryobjectproxthink" }, + { 0x1A5C, "carryobjectproxthinkdelayed" }, + { 0x1A5E, "carryobjectusethink" }, + { 0x1A5F, "carryremoteuav_delete" }, + { 0x1A61, "carryremoteuav_setcarried" }, + { 0x1A62, "cars" }, + { 0x1A63, "cart_player_kill_volume" }, + { 0x1A64, "cart_runner" }, + { 0x1A66, "casualtytracking" }, + { 0x1A67, "cat_array_add" }, + { 0x1A68, "cat_array_get" }, + { 0x1A69, "catch_alien_on_fire" }, + { 0x1A6B, "catch_death_notify" }, + { 0x1A6C, "catch_interrupt_notify" }, + { 0x1A6F, "catchup_deck_combat" }, + { 0x1A70, "catchup_deck_tilt" }, + { 0x1A73, "catchup_defend_sparrow" }, + { 0x1A75, "catchup_function" }, + { 0x1A78, "catchup_slow_intro" }, + { 0x1A7C, "catwalk_melee_glass_break" }, + { 0x1A7D, "catwalks_end" }, + { 0x1A82, "cave_cairo_whine" }, + { 0x1A83, "cave_dialogue" }, + { 0x1A84, "cave_dialogue_2" }, + { 0x1A85, "cave_dust" }, + { 0x1A86, "cave_earthquake" }, + { 0x1A8D, "ceiling_rubble" }, + { 0x1A8E, "ceiling_rubble_missile_explode_watch" }, + { 0x1A8F, "ceiling_rubble_onplayerconnect" }, + { 0x1A90, "ceiling_rubble_watchusage" }, + { 0x1A94, "centeraimpoint" }, + { 0x1A95, "centered" }, + { 0x1A97, "centerref" }, + { 0x1A98, "cfxprintln" }, + { 0x1A99, "cfxprintlnend" }, + { 0x1A9A, "cfxprintlnstart" }, + { 0x1A9B, "cg_drawbreathhint" }, + { 0x1A9C, "ch_assists" }, + { 0x1A9D, "ch_bulletdamagecommon" }, + { 0x1AA0, "ch_getstate" }, + { 0x1AA1, "ch_gettarget" }, + { 0x1AA3, "ch_isactivechallenge" }, + { 0x1AA5, "ch_roundplayed" }, + { 0x1AA6, "ch_roundwin" }, + { 0x1AA7, "ch_setprogress" }, + { 0x1AA9, "ch_vehicle_killed" }, + { 0x1AAA, "ch_vehicle_kills" }, + { 0x1AAB, "ch_vo" }, + { 0x1AAC, "chain_gate" }, + { 0x1AAF, "chaingun_shelleject_fx" }, + { 0x1AB4, "chair_anim_ent" }, + { 0x1AB5, "chair_animate" }, + { 0x1AB8, "chair_nags" }, + { 0x1AB9, "chair_vargas" }, + { 0x1ABC, "chalk_swipe1" }, + { 0x1ABD, "chalk_swipe2" }, + { 0x1ABE, "challenge_countdown" }, + { 0x1AC0, "challenge_registration_func" }, + { 0x1AC1, "challenge_rewardval" }, + { 0x1AC4, "challengedata" }, + { 0x1AC5, "challengeinfo" }, + { 0x1AC7, "challengereward" }, + { 0x1AC8, "challengescompleted" }, + { 0x1AC9, "challengeslot" }, + { 0x1ACB, "challengetarget" }, + { 0x1ACD, "chance" }, + { 0x1ACE, "chancefordoground" }, + { 0x1ACF, "chancetospawndog" }, + { 0x1AD0, "chancetospawnpickup" }, + { 0x1AD1, "change_character_model" }, + { 0x1AD3, "change_enemy_priority" }, + { 0x1AD4, "change_guard_to_hazmat" }, + { 0x1AD5, "change_light" }, + { 0x1AD6, "change_mix" }, + { 0x1AD8, "change_zone_stairwell" }, + { 0x1ADA, "changecrateweight" }, + { 0x1ADB, "changed_team" }, + { 0x1ADE, "changelightcolortoworkerthread" }, + { 0x1AE0, "changestanceforfuntime" }, + { 0x1AE1, "changestepoutpos" }, + { 0x1AE3, "changingcoverpos" }, + { 0x1AE5, "changingtoregularinfected" }, + { 0x1AE6, "changingtoregularinfectedbykill" }, + { 0x1AE7, "changingweapon" }, + { 0x1AE8, "chaos_a" }, + { 0x1AEA, "chaos_a_hesh_landing" }, + { 0x1AEB, "chaos_a_hesh_run" }, + { 0x1AEE, "chaos_airdrop_locs" }, + { 0x1AEF, "chaos_b" }, + { 0x1AF0, "chaos_b_hide_debris" }, + { 0x1AF1, "chaos_b_slow_zone" }, + { 0x1AF2, "chaos_checkpoint" }, + { 0x1AF3, "chaos_checkpoint_trigger" }, + { 0x1AF7, "chaos_hide_on_start" }, + { 0x1AF8, "chaos_kill_after_time" }, + { 0x1AFA, "chaos_kill_player" }, + { 0x1AFB, "chaos_moving_clip" }, + { 0x1AFC, "chaos_moving_head" }, + { 0x1AFD, "chaos_music" }, + { 0x1AFE, "chaos_player_kill" }, + { 0x1AFF, "chaos_quake_trigger_think" }, + { 0x1B00, "chaos_rog_think" }, + { 0x1B02, "chaos_walker_wait" }, + { 0x1B09, "character_type" }, + { 0x1B0A, "characters" }, + { 0x1B0B, "charactertypebonusxp" }, + { 0x1B0C, "charge" }, + { 0x1B0D, "charge1" }, + { 0x1B0E, "charge2" }, + { 0x1B0F, "charge_attack" }, + { 0x1B10, "charge_tracking_enemy" }, + { 0x1B12, "chase_amb_enter_chasm" }, + { 0x1B13, "chase_amb_enter_ravine" }, + { 0x1B16, "chase_amb_garage_exit" }, + { 0x1B19, "chase_amb_garage_punch_it" }, + { 0x1B1A, "chase_amb_garage_start" }, + { 0x1B1B, "chase_amb_sharp_turn" }, + { 0x1B1C, "chase_amb_sub_comes_up" }, + { 0x1B1D, "chase_amb_tight_spot" }, + { 0x1B1F, "chase_amb_under_bridge_2" }, + { 0x1B20, "chase_amb_under_bridge_3" }, + { 0x1B21, "chase_amb_under_bridge_4" }, + { 0x1B22, "chase_cam_ent" }, + { 0x1B23, "chase_cam_last_num" }, + { 0x1B26, "chase_concussion" }, + { 0x1B27, "chase_crack_icehole" }, + { 0x1B28, "chase_crashmix" }, + { 0x1B29, "chase_dog" }, + { 0x1B2A, "chase_dog_blocker_think" }, + { 0x1B2B, "chase_dog_dialogue" }, + { 0x1B2C, "chase_land_roof" }, + { 0x1B2D, "chase_land_tires_big" }, + { 0x1B2E, "chase_land_tires_small" }, + { 0x1B30, "chase_music" }, + { 0x1B31, "chase_pileup_counter" }, + { 0x1B32, "chase_player" }, + { 0x1B33, "chase_player_collision" }, + { 0x1B34, "chase_player_jolt" }, + { 0x1B35, "chase_roadblock_smash" }, + { 0x1B36, "chase_script" }, + { 0x1B37, "chase_sink" }, + { 0x1B3C, "chase_tunnel_jeep" }, + { 0x1B3D, "chasecam" }, + { 0x1B3E, "chasecam_onent" }, + { 0x1B41, "chatqueue" }, + { 0x1B42, "cheap_effect_id" }, + { 0x1B43, "cheap_vehicles_have_shields" }, + { 0x1B44, "cheatammoifnecessary" }, + { 0x1B46, "check_ai_array_for_death" }, + { 0x1B47, "check_already_touching" }, + { 0x1B4B, "check_atrium_done" }, + { 0x1B4C, "check_break_stealth" }, + { 0x1B4D, "check_break_stealth_end" }, + { 0x1B51, "check_debug_hud_dvar" }, + { 0x1B53, "check_dog_ready_to_attack" }, + { 0x1B54, "check_dog_sprinting" }, + { 0x1B55, "check_enemy_clump" }, + { 0x1B56, "check_enemy_index" }, + { 0x1B57, "check_failed_spawn_groups" }, + { 0x1B58, "check_feature_dependencies" }, + { 0x1B5A, "check_flag_for_stat_tracking" }, + { 0x1B5C, "check_for_block" }, + { 0x1B5D, "check_for_combat_two_done" }, + { 0x1B5E, "check_for_death_during_traversal" }, + { 0x1B5F, "check_for_enemies" }, + { 0x1B60, "check_for_existing_pet_bombs" }, + { 0x1B61, "check_for_melee_stab" }, + { 0x1B63, "check_for_player_impact" }, + { 0x1B64, "check_for_player_meleeing" }, + { 0x1B65, "check_for_player_near_hive_with_drill" }, + { 0x1B66, "check_for_rog_death" }, + { 0x1B67, "check_for_special_damage" }, + { 0x1B68, "check_for_weapon_pickup" }, + { 0x1B69, "check_force_color" }, + { 0x1B6B, "check_grenade" }, + { 0x1B6C, "check_guard_death_to_stop_pistol_fire" }, + { 0x1B6E, "check_hold_bar_in_green" }, + { 0x1B6F, "check_hold_bar_in_green_or_die" }, + { 0x1B70, "check_hostage_flag_a" }, + { 0x1B71, "check_hostage_flag_b" }, + { 0x1B72, "check_if_player_close_to_checkpoint" }, + { 0x1B73, "check_if_went_hot_late" }, + { 0x1B75, "check_kill_traversal" }, + { 0x1B77, "check_melee_interaction_active" }, + { 0x1B78, "check_missing_animation" }, + { 0x1B79, "check_other_haslevelveteranachievement" }, + { 0x1B7A, "check_overrides" }, + { 0x1B7C, "check_pain_lockout" }, + { 0x1B7F, "check_player_warehouse_mantle" }, + { 0x1B80, "check_player_zoom" }, + { 0x1B81, "check_script_char_group_ratio" }, + { 0x1B82, "check_sound_tag_dupe" }, + { 0x1B83, "check_sound_tag_dupe_reset" }, + { 0x1B86, "check_submix_hud_dvar" }, + { 0x1B89, "check_triggers_flagset" }, + { 0x1B8A, "check_unloadgroup" }, + { 0x1B8C, "check_weapon" }, + { 0x1B8F, "checkadvanceonenemyconditions" }, + { 0x1B90, "checkallgeneratorsofthistype" }, + { 0x1B93, "checkapproachpreconditions" }, + { 0x1B94, "checkarrivalenterpositions" }, + { 0x1B97, "checkchanged" }, + { 0x1B98, "checkcombatstate" }, + { 0x1B99, "checkcoverenterpos" }, + { 0x1B9B, "checkdynamicspawns" }, + { 0x1B9C, "checked" }, + { 0x1B9E, "checkexpiretime" }, + { 0x1B9F, "checkforbestweapon" }, + { 0x1BA0, "checkforcebleedout" }, + { 0x1BA1, "checkforceragdoll" }, + { 0x1BA3, "checkforperkupgrade" }, + { 0x1BA4, "checkforpersonalbests" }, + { 0x1BA5, "checkforthrowback" }, + { 0x1BA6, "checkgeneratorplacement" }, + { 0x1BA7, "checkgrenadethrowdist" }, + { 0x1BA8, "checkhit" }, + { 0x1BAA, "checkhitsthismag_regularmp" }, + { 0x1BAB, "checking_for_hits" }, + { 0x1BAC, "checkisfacing" }, + { 0x1BAD, "checkkillsteal" }, + { 0x1BAE, "checkmatchdataequipmentkills" }, + { 0x1BB2, "checkowner" }, + { 0x1BB3, "checkpitchvisibility" }, + { 0x1BB4, "checkplayer" }, + { 0x1BB5, "checkplayerscorelimitsoon" }, + { 0x1BB8, "checkpoint_base_array" }, + { 0x1BB9, "checkpoint_bridge" }, + { 0x1BBA, "checkpoint_canyon" }, + { 0x1BBB, "checkpoint_cave" }, + { 0x1BBC, "checkpoint_chaos" }, + { 0x1BBF, "checkpoint_crash_site" }, + { 0x1BC0, "checkpoint_defend" }, + { 0x1BC3, "checkpoint_exfil" }, + { 0x1BC5, "checkpoint_foley" }, + { 0x1BC6, "checkpoint_interior" }, + { 0x1BC7, "checkpoint_interior_combat" }, + { 0x1BC8, "checkpoint_interior_cqb" }, + { 0x1BCA, "checkpoint_osprey" }, + { 0x1BCC, "checkpoint_patrol_anim" }, + { 0x1BCE, "checkpoint_ride" }, + { 0x1BD2, "checkpoint_tank" }, + { 0x1BD3, "checkpoint_tower" }, + { 0x1BD4, "checkpredictedspawnpointcorrectness" }, + { 0x1BD8, "checkstreakreward" }, + { 0x1BD9, "checkteam" }, + { 0x1BDE, "checktransitionpreconditions" }, + { 0x1BE5, "choke_loc" }, + { 0x1BE6, "choke_trigs" }, + { 0x1BE9, "choose_fire" }, + { 0x1BEA, "choose_from_weighted_array" }, + { 0x1BEB, "choose_goal_vol" }, + { 0x1BEC, "choose_goal_vol_chain" }, + { 0x1BEE, "choose_random_explosive_type" }, + { 0x1BEF, "choose_spit_type" }, + { 0x1BF1, "chooseattackidle" }, + { 0x1BF2, "choosedirection" }, + { 0x1BF4, "choosepose" }, + { 0x1BF5, "chooseposefunc" }, + { 0x1BF6, "choper_fly_in_think" }, + { 0x1BF7, "chopper" }, + { 0x1BFA, "chopper_achievement_check" }, + { 0x1BFB, "chopper_active" }, + { 0x1BFC, "chopper_ai_init" }, + { 0x1BFD, "chopper_air_support_activate" }, + { 0x1BFE, "chopper_arrive_wind_gust" }, + { 0x1C00, "chopper_attacker_check" }, + { 0x1C01, "chopper_boss_agro" }, + { 0x1C03, "chopper_boss_attempt_firing" }, + { 0x1C05, "chopper_boss_can_hit_from_tag_turret" }, + { 0x1C0C, "chopper_boss_forced_target_set" }, + { 0x1C0D, "chopper_boss_gather_targets" }, + { 0x1C0E, "chopper_boss_get_best_location_and_target" }, + { 0x1C10, "chopper_boss_get_best_target_proc" }, + { 0x1C12, "chopper_boss_get_closest_neighbor_2d" }, + { 0x1C13, "chopper_boss_get_closest_target_2d" }, + { 0x1C14, "chopper_boss_get_target" }, + { 0x1C15, "chopper_boss_goto_hangout" }, + { 0x1C17, "chopper_boss_in_range" }, + { 0x1C1C, "chopper_boss_locs_disabled" }, + { 0x1C1D, "chopper_boss_locs_monitor_disable" }, + { 0x1C1E, "chopper_boss_locs_monitor_disable_clean_up" }, + { 0x1C1F, "chopper_boss_locs_monitor_disable_reset" }, + { 0x1C21, "chopper_boss_locs_populate" }, + { 0x1C22, "chopper_boss_locs_populate_thread" }, + { 0x1C23, "chopper_boss_locs_populate_thread_optimized" }, + { 0x1C24, "chopper_boss_locs_populated" }, + { 0x1C27, "chopper_boss_move" }, + { 0x1C28, "chopper_boss_path_override" }, + { 0x1C29, "chopper_boss_path_paused" }, + { 0x1C2B, "chopper_boss_post_move_func" }, + { 0x1C2C, "chopper_boss_pre_move_func" }, + { 0x1C2D, "chopper_boss_resume_path_finding" }, + { 0x1C31, "chopper_boss_think" }, + { 0x1C33, "chopper_boss_wait_populate" }, + { 0x1C35, "chopper_crash" }, + { 0x1C36, "chopper_crash_enemies" }, + { 0x1C38, "chopper_crash_guy_logic" }, + { 0x1C39, "chopper_custom_death_spin" }, + { 0x1C3D, "chopper_decoys_and_evade" }, + { 0x1C3E, "chopper_destroys_cover" }, + { 0x1C3F, "chopper_does_first_flyby" }, + { 0x1C42, "chopper_hear_vo" }, + { 0x1C43, "chopper_infantry_tweak" }, + { 0x1C44, "chopper_insta_kill" }, + { 0x1C46, "chopper_leaves_after_time" }, + { 0x1C49, "chopper_missile_burst" }, + { 0x1C4B, "chopper_outline_monitor" }, + { 0x1C4E, "chopper_reacts_to_lockon" }, + { 0x1C4F, "chopper_resume_path" }, + { 0x1C50, "chopper_reward" }, + { 0x1C51, "chopper_rumble_earthquake" }, + { 0x1C52, "chopper_scripted_death" }, + { 0x1C53, "chopper_side_dodge" }, + { 0x1C54, "chopper_sound" }, + { 0x1C58, "chopper_start_at_path" }, + { 0x1C5B, "chopper_turret_on" }, + { 0x1C5D, "chopperboss_const" }, + { 0x1C5F, "choppers_do_strafe_attacks" }, + { 0x1C64, "chopperturretofffunc" }, + { 0x1C65, "chopperturretonfunc" }, + { 0x1C66, "chosen" }, + { 0x1C67, "chosentemplates" }, + { 0x1C68, "chunk_spark_fx_tag" }, + { 0x1C6A, "church_destruction_init" }, + { 0x1C6B, "church_fall" }, + { 0x1C6C, "church_weapon_pullout" }, + { 0x1C6E, "chyron" }, + { 0x1C6F, "chyron_sound" }, + { 0x1C70, "cig_throwing" }, + { 0x1C72, "cinematic_off" }, + { 0x1C73, "cinematic_on" }, + { 0x1C74, "cinematic_over" }, + { 0x1C75, "cinematicmode_off" }, + { 0x1C77, "cipher_ambush_approach" }, + { 0x1C79, "cipher_keegan_tower_kill" }, + { 0x1C7A, "cipher_podium" }, + { 0x1C7B, "cipher_vo" }, + { 0x1C7E, "circle_radius" }, + { 0x1C7F, "circle_time" }, + { 0x1C80, "circling" }, + { 0x1C82, "city_collapse" }, + { 0x1C84, "civilian_combatmoveturn" }, + { 0x1C86, "civilian_jet_flyby" }, + { 0x1C87, "civilian_noncombatmoveturn" }, + { 0x1C88, "civilian_walk_animation" }, + { 0x1C8A, "civilianjetflyby" }, + { 0x1C8B, "civilianjetflyby_timer" }, + { 0x1C8C, "civilianprops" }, + { 0x1C8D, "civs" }, + { 0x1C8E, "civs_set_flag_on_damage" }, + { 0x1C8F, "clacker_vo_failsafe" }, + { 0x1C93, "claimed_node" }, + { 0x1C96, "claimtrigger" }, + { 0x1C97, "clampandnormalize" }, + { 0x1C98, "clampedhealth" }, + { 0x1C9A, "class" }, + { 0x1C9B, "class_num" }, + { 0x1C9D, "classcallback" }, + { 0x1C9F, "classhasperk" }, + { 0x1CA0, "classmap" }, + { 0x1CA1, "classname_ng" }, + { 0x1CA2, "classtablename" }, + { 0x1CA3, "classtablenum" }, + { 0x1CA4, "classtweaks" }, + { 0x1CA6, "claymore_tutorial_given" }, + { 0x1CAA, "claymoredetectiontrigger" }, + { 0x1CAB, "claymoredetonateradius" }, + { 0x1CAC, "claymoredetonation" }, + { 0x1CAE, "claymores" }, + { 0x1CAF, "claymoresentientfunc" }, + { 0x1CB0, "claymoretracking" }, + { 0x1CB1, "claymoreused" }, + { 0x1CB3, "clean_tow_hud" }, + { 0x1CB9, "clean_up_intro_exterior_props" }, + { 0x1CBA, "clean_up_lagged_aliens" }, + { 0x1CBB, "clean_up_on_death" }, + { 0x1CBC, "clean_up_on_owner_death" }, + { 0x1CBD, "clean_window_player" }, + { 0x1CC0, "cleanup" }, + { 0x1CC2, "cleanup_boats" }, + { 0x1CC4, "cleanup_complex" }, + { 0x1CC5, "cleanup_deck_transition" }, + { 0x1CC6, "cleanup_delayed" }, + { 0x1CC7, "cleanup_enemies" }, + { 0x1CC8, "cleanup_enemy_destroyer" }, + { 0x1CC9, "cleanup_ent_on_dismount" }, + { 0x1CCA, "cleanup_ents" }, + { 0x1CCB, "cleanup_ents_removing_bullet_shield" }, + { 0x1CCC, "cleanup_fixtures" }, + { 0x1CCE, "cleanup_intermission_enemies" }, + { 0x1CD0, "cleanup_land_vert_missile_fx" }, + { 0x1CD1, "cleanup_launcher" }, + { 0x1CD3, "cleanup_missile_fx" }, + { 0x1CD6, "cleanup_phys_obj" }, + { 0x1CD9, "cleanup_rope" }, + { 0x1CDA, "cleanup_rope_on_zodiac_death" }, + { 0x1CDE, "cleanup_sentry_hud_outline" }, + { 0x1CE0, "cleanup_teargas_on_exit" }, + { 0x1CE1, "cleanup_topdrive" }, + { 0x1CE2, "cleanup_triggers" }, + { 0x1CE3, "cleanup_vehicles" }, + { 0x1CE4, "cleanup_vert_missile_fx" }, + { 0x1CE6, "cleanup_zodiac_bodies" }, + { 0x1CE7, "cleanup_zodiacs" }, + { 0x1CE8, "cleanup_zone_arrays" }, + { 0x1CEC, "cleanupents" }, + { 0x1CED, "cleanupequipment" }, + { 0x1CEE, "cleanupflyby" }, + { 0x1CEF, "cleanuplasertargetingdevice" }, + { 0x1CF3, "clear_all_corpses" }, + { 0x1CF4, "clear_ally_drones" }, + { 0x1CF5, "clear_animation" }, + { 0x1CF9, "clear_attached_items" }, + { 0x1CFA, "clear_attacking" }, + { 0x1CFB, "clear_audio_filter" }, + { 0x1CFC, "clear_audio_mix" }, + { 0x1CFD, "clear_audio_occlusion" }, + { 0x1CFE, "clear_bark_cairo" }, + { 0x1D03, "clear_colors" }, + { 0x1D05, "clear_custom_gameskill_func" }, + { 0x1D06, "clear_deathanim" }, + { 0x1D07, "clear_deck_props" }, + { 0x1D08, "clear_dog_master" }, + { 0x1D0C, "clear_entity_selection" }, + { 0x1D0D, "clear_exception" }, + { 0x1D0E, "clear_filter" }, + { 0x1D12, "clear_generic_run_anim" }, + { 0x1D13, "clear_groundref" }, + { 0x1D16, "clear_ignore_everything" }, + { 0x1D17, "clear_ignore_states" }, + { 0x1D1B, "clear_mix" }, + { 0x1D1E, "clear_promotion_order" }, + { 0x1D1F, "clear_rappel_move_flag" }, + { 0x1D20, "clear_reverb" }, + { 0x1D21, "clear_run_anim" }, + { 0x1D22, "clear_sam_missiles" }, + { 0x1D23, "clear_script_goal_on" }, + { 0x1D24, "clear_settable_fx" }, + { 0x1D25, "clear_target_array" }, + { 0x1D26, "clear_target_on_vehicle_death" }, + { 0x1D29, "clear_this_node" }, + { 0x1D2A, "clear_to_go_flag_set_once" }, + { 0x1D2B, "clear_tool_hud" }, + { 0x1D2E, "clear_turret_ammo_counter_on_dismount" }, + { 0x1D30, "clear_vista_vehicles" }, + { 0x1D31, "clear_volume_flag" }, + { 0x1D32, "clearafterfade" }, + { 0x1D33, "clearall" }, + { 0x1D34, "clearawardwinners" }, + { 0x1D36, "clearbuddymessage" }, + { 0x1D38, "cleardamagehistory" }, + { 0x1D39, "cleardodgeanims" }, + { 0x1D3B, "clearempondeath" }, + { 0x1D3C, "clearfaceanimonanimdone" }, + { 0x1D3D, "clearfxondeath" }, + { 0x1D40, "clearidshortly" }, + { 0x1D41, "clearing_bob_anim" }, + { 0x1D42, "clearing_sways" }, + { 0x1D44, "clearkillcamstate" }, + { 0x1D45, "clearkillstreaks" }, + { 0x1D49, "clearondeath" }, + { 0x1D4A, "clearonvictimdisconnect" }, + { 0x1D4B, "clearplayerlockfromremoteuavlaunch" }, + { 0x1D4D, "clearportalfx" }, + { 0x1D4E, "clearprevioustispawnpoint" }, + { 0x1D4F, "clearprogress" }, + { 0x1D50, "clearrideintro" }, + { 0x1D52, "clearsightposnear" }, + { 0x1D53, "clearspawnpointdistancedata" }, + { 0x1D56, "clearteamspawnpointsightdata" }, + { 0x1D58, "clearthreatbias" }, + { 0x1D5A, "clearwatervarsonspawn" }, + { 0x1D5B, "clientid" }, + { 0x1D5C, "clientmatchdataid" }, + { 0x1D5D, "clienttracespawnclass" }, + { 0x1D5E, "clienttweakables" }, + { 0x1D61, "cliff_choppers_move_on" }, + { 0x1D62, "cliff_guy_logic" }, + { 0x1D63, "climb_over" }, + { 0x1D64, "climbover_enemy" }, + { 0x1D66, "clip_brush" }, + { 0x1D67, "clip_delete" }, + { 0x1D68, "clip_down" }, + { 0x1D69, "clip_move" }, + { 0x1D6B, "clip_up" }, + { 0x1D6D, "clipammo" }, + { 0x1D71, "clipmovementtolerance" }, + { 0x1D73, "clockwork_exfil_pre_load" }, + { 0x1D75, "clockwork_interior_nvg_pre_load" }, + { 0x1D77, "clockwork_intro_pre_load" }, + { 0x1D78, "clockwork_locations" }, + { 0x1D79, "clockwork_starts" }, + { 0x1D7A, "clockwork_thermobaric_mines" }, + { 0x1D7C, "clockwork_treadfx_override" }, + { 0x1D7D, "close_distance_sq" }, + { 0x1D7E, "close_door" }, + { 0x1D7F, "close_elevator_doors" }, + { 0x1D80, "close_enemy_volume" }, + { 0x1D82, "close_gate" }, + { 0x1D84, "close_inner_doors" }, + { 0x1D86, "close_outer_doors" }, + { 0x1D87, "close_range_retreat" }, + { 0x1D88, "close_stream_enemies" }, + { 0x1D89, "close_to_waterfall_enemy_logic" }, + { 0x1D8B, "close_warehouse_doors" }, + { 0x1D8C, "closed_angles" }, + { 0x1D8D, "closed_defend_fx_ent" }, + { 0x1D8F, "closed_height" }, + { 0x1D90, "closed_pos" }, + { 0x1D92, "closed_x" }, + { 0x1D94, "closedlist" }, + { 0x1D96, "closeelevatordoors" }, + { 0x1D97, "closeenoughaimdegrees" }, + { 0x1D98, "closeomamenuondeath" }, + { 0x1D99, "closepos" }, + { 0x1D9A, "closerfunc" }, + { 0x1D9C, "closest_enemy_snowmobile_to_player" }, + { 0x1D9E, "closest_start_struct" }, + { 0x1DA1, "clouds" }, + { 0x1DA6, "cnd_delay_rope_link" }, + { 0x1DA7, "cnd_ent_flag_clear" }, + { 0x1DAC, "cnd_generic_flicker" }, + { 0x1DAD, "cnd_generic_flicker_msg_watcher" }, + { 0x1DAE, "cnd_generic_flicker_pause" }, + { 0x1DB0, "cnd_get_rope_anim_origin" }, + { 0x1DB4, "cnd_plyr_rpl_death" }, + { 0x1DB6, "cnd_plyr_rpl_handle_view_lerp" }, + { 0x1DBA, "cnd_plyr_rpl_setup_dvars" }, + { 0x1DBB, "cnd_plyr_rpl_setup_globals" }, + { 0x1DBD, "cnd_rappel_player_rope" }, + { 0x1DBE, "cnd_rappel_railing_obj" }, + { 0x1DC3, "cnd_rpl_cleanup" }, + { 0x1DC6, "cnd_rpl_do_move_bob" }, + { 0x1DC7, "cnd_rpl_do_rope" }, + { 0x1DC8, "cnd_rpl_do_stop_sway" }, + { 0x1DCB, "cnd_rpl_do_wind" }, + { 0x1DCD, "cnd_rpl_legs_notetracks" }, + { 0x1DCE, "cnd_rpl_plyr_link_to_rope" }, + { 0x1DD2, "cnd_shaft_flickering" }, + { 0x1DD6, "cobra_missile_models" }, + { 0x1DD7, "cobra_weapon_tags" }, + { 0x1DD9, "cockpit_tubes" }, + { 0x1DDA, "codecallback_agentadded" }, + { 0x1DDB, "codecallback_agentdamaged" }, + { 0x1DDC, "codecallback_agentkilled" }, + { 0x1DDD, "codecallback_codeendgame" }, + { 0x1DDE, "codecallback_hostmigration" }, + { 0x1DDF, "codecallback_leaderdialog" }, + { 0x1DE0, "codecallback_playerconnect" }, + { 0x1DE1, "codecallback_playerdamage" }, + { 0x1DE3, "codecallback_playerkilled" }, + { 0x1DE4, "codecallback_playerlaststand" }, + { 0x1DE5, "codecallback_playermigrated" }, + { 0x1DE7, "codecallback_vehicledamage" }, + { 0x1DEB, "col_lines" }, + { 0x1DEC, "col_radiuses" }, + { 0x1DED, "col_volumes" }, + { 0x1DEE, "coldbreath_player" }, + { 0x1DEF, "coldbreathfx" }, + { 0x1DF0, "colheight" }, + { 0x1DF2, "collapsed_derrick_wire_anims" }, + { 0x1DF3, "collect_func" }, + { 0x1DF5, "collectibles_hint_precache" }, + { 0x1DF7, "collectibles_model_precache" }, + { 0x1DFA, "collectibles_worldcount" }, + { 0x1DFB, "collision" }, + { 0x1DFC, "collision_brush_post_explosion" }, + { 0x1DFD, "collision_brush_pre_explosion" }, + { 0x1DFE, "collision_origin" }, + { 0x1E01, "color_debug_println" }, + { 0x1E02, "color_doesnt_care_about_classname" }, + { 0x1E03, "color_doesnt_care_about_heroes" }, + { 0x1E04, "color_helper_trigger" }, + { 0x1E05, "color_node" }, + { 0x1E08, "color_node_finds_user_from_colorcodes" }, + { 0x1E09, "color_node_type_function" }, + { 0x1E0A, "color_ordered_node_assignment" }, + { 0x1E0B, "color_status" }, + { 0x1E0D, "color_teams" }, + { 0x1E0E, "color_trig_moves_enemies" }, + { 0x1E10, "color_user" }, + { 0x1E11, "color_volume_enemies" }, + { 0x1E12, "colorblind" }, + { 0x1E15, "colordebug" }, + { 0x1E16, "colorindex" }, + { 0x1E17, "colorislegit" }, + { 0x1E18, "colorlist" }, + { 0x1E19, "colornode_func" }, + { 0x1E1B, "colornode_setgoal_func" }, + { 0x1E1D, "colornodes_debug_array" }, + { 0x1E1E, "colors" }, + { 0x1E20, "combat_allies_mainhall" }, + { 0x1E22, "combat_ambient_guys2" }, + { 0x1E24, "combat_handle_allies" }, + { 0x1E25, "combat_one" }, + { 0x1E28, "combat_one_door_col" }, + { 0x1E2A, "combat_one_enemy" }, + { 0x1E2B, "combat_one_start" }, + { 0x1E2C, "combat_one_wave_node" }, + { 0x1E2D, "combat_playfacialanim" }, + { 0x1E30, "combat_rappel_garden_entry" }, + { 0x1E34, "combat_rappel_garden_entry_enemies" }, + { 0x1E36, "combat_rappel_garden_entry_finish_player_rope" }, + { 0x1E37, "combat_rappel_garden_entry_first_frame" }, + { 0x1E3C, "combat_rappel_garden_entry_rotate_legs" }, + { 0x1E3D, "combat_rappel_garden_entry_set_small_legs_jump" }, + { 0x1E3E, "combat_rappel_garden_entry_set_small_rotate_jump" }, + { 0x1E3F, "combat_rappel_garden_entry_setup_glass" }, + { 0x1E40, "combat_rappel_garden_entry_setup_jumpoints" }, + { 0x1E41, "combat_rappel_garden_entry_setup_weapon" }, + { 0x1E42, "combat_rappel_garden_entry_should_shift_allies" }, + { 0x1E44, "combat_rappel_garden_entry_tree" }, + { 0x1E45, "combat_rappel_rope_coil_baker" }, + { 0x1E46, "combat_rappel_rope_coil_player" }, + { 0x1E47, "combat_rappel_rope_coil_rorke" }, + { 0x1E48, "combat_rappel_rope_rorke" }, + { 0x1E49, "combat_rappel_spawn_garden_entry_enemies" }, + { 0x1E4B, "combat_resource" }, + { 0x1E4C, "combat_two" }, + { 0x1E4E, "combat_two_dialogue" }, + { 0x1E54, "combatbehavior" }, + { 0x1E57, "combathigh" }, + { 0x1E58, "combathighicon" }, + { 0x1E59, "combathighoverlay" }, + { 0x1E5B, "combatidle" }, + { 0x1E5C, "combatidlepreventoverlappingplayer" }, + { 0x1E5D, "combatmemorytimeconst" }, + { 0x1E60, "combatspeedscalar" }, + { 0x1E62, "combatstate" }, + { 0x1E63, "combattime" }, + { 0x1E64, "comeback" }, + { 0x1E65, "comexpfuncs" }, + { 0x1E67, "comm_center_2_pieces" }, + { 0x1E68, "command_fail_late_death" }, + { 0x1E69, "command_geyser_light" }, + { 0x1E6A, "command_goal" }, + { 0x1E6D, "command_platform_bag_baker" }, + { 0x1E6E, "command_platform_bag_cypher" }, + { 0x1E6F, "command_platform_bag_keegan" }, + { 0x1E70, "command_platform_bag_player" }, + { 0x1E75, "commander_can_takeover_bot" }, + { 0x1E77, "commander_create_dom_obj" }, + { 0x1E79, "commander_gametype_initialized" }, + { 0x1E7A, "commander_gave_hint" }, + { 0x1E7B, "commander_handle_notify_quick" }, + { 0x1E7D, "commander_hint_delete_on_commander_menu" }, + { 0x1E7F, "commander_initialize_gametype" }, + { 0x1E80, "commander_last_tactic_applied" }, + { 0x1E81, "commander_last_tactic_selected" }, + { 0x1E82, "commander_loadout_class_callback" }, + { 0x1E83, "commander_moment" }, + { 0x1E84, "commander_monitor_tactics" }, + { 0x1E85, "commander_or_bot_change_class" }, + { 0x1E86, "commander_order_ack" }, + { 0x1E87, "commander_speaking" }, + { 0x1E89, "commander_spectate_first_available_bot" }, + { 0x1E8A, "commander_spectate_next_bot" }, + { 0x1E8B, "commander_takeover_first_available_bot" }, + { 0x1E8C, "commander_vo" }, + { 0x1E8D, "commander_wait_connect" }, + { 0x1E8F, "commanding_bot" }, + { 0x1E90, "common_flash_check" }, + { 0x1E92, "common_tryuse_actions" }, + { 0x1E93, "commonstarttime" }, + { 0x1E94, "compare" }, + { 0x1E96, "comparesizesfx" }, + { 0x1E98, "compass_flash" }, + { 0x1E99, "compass_objectives" }, + { 0x1E9C, "compassiconenemy" }, + { 0x1E9D, "compassiconfriendly" }, + { 0x1E9F, "complete_me" }, + { 0x1EA2, "completednodes" }, + { 0x1EA3, "complex_expl" }, + { 0x1EA6, "complex_script" }, + { 0x1EA7, "complexobjectives" }, + { 0x1EA8, "compute_round_based_percentages" }, + { 0x1EA9, "computer_guys_runin" }, + { 0x1EAA, "computer_guys_runin_vo" }, + { 0x1EAB, "computer_idf" }, + { 0x1EAD, "conf_fx" }, + { 0x1EAE, "config" }, + { 0x1EAF, "confirmed" }, + { 0x1EB0, "connect_and_start_tarps" }, + { 0x1EB1, "connect_door_path" }, + { 0x1EB3, "connect_nodes_after_crash" }, + { 0x1EB4, "connect_time" }, + { 0x1EB5, "connect_traverse" }, + { 0x1EB6, "connect_watch" }, + { 0x1EB9, "connected_nodes" }, + { 0x1EBC, "connectedpostgame" }, + { 0x1EBD, "connection_sound" }, + { 0x1EC1, "connecttime" }, + { 0x1EC2, "connecttraverses" }, + { 0x1EC5, "considerthrowgrenade" }, + { 0x1EC6, "consolation" }, + { 0x1EC7, "console" }, + { 0x1EC8, "console_scene_dialogue" }, + { 0x1EC9, "console_scene_player_blocker" }, + { 0x1ECA, "const_baker" }, + { 0x1ED0, "constraingametype" }, + { 0x1ED2, "constrict_view" }, + { 0x1ED3, "constrict_view_count" }, + { 0x1ED4, "contact_points" }, + { 0x1ED8, "context_sensative_dialog_filler" }, + { 0x1EDA, "context_sensative_dialog_guy_in_sight" }, + { 0x1EDB, "context_sensative_dialog_guy_in_sight_check" }, + { 0x1EDD, "context_sensative_dialog_kill" }, + { 0x1EDE, "context_sensative_dialog_kill_thread" }, + { 0x1EDF, "context_sensative_dialog_locations" }, + { 0x1EE0, "context_sensative_dialog_locations_add_notify_event" }, + { 0x1EE1, "context_sensative_dialog_locations_thread" }, + { 0x1EE2, "context_sensative_dialog_play_random_group_sound" }, + { 0x1EE3, "context_sensative_dialog_secondary_explosion_vehicle" }, + { 0x1EE4, "context_sensative_dialog_timedout" }, + { 0x1EE6, "context_sensative_dialog_vehicledeath" }, + { 0x1EE7, "context_sensative_dialog_vehiclespawn" }, + { 0x1EE8, "continous_fire" }, + { 0x1EE9, "continuedrivenmovement" }, + { 0x1EEA, "continuemovement" }, + { 0x1EEC, "control_nvg_lightmodels" }, + { 0x1EED, "control_nvg_staticscreens_off" }, + { 0x1EEE, "control_nvg_staticscreens_on" }, + { 0x1EEF, "control_panel_setup_lights" }, + { 0x1EF0, "control_room_combat" }, + { 0x1EF1, "control_room_enemies" }, + { 0x1EF2, "control_room_enemies_upper_setup" }, + { 0x1EF3, "control_room_enemy_setup" }, + { 0x1EF6, "control_screen_bink_init" }, + { 0x1EF7, "controlled_dog" }, + { 0x1EF8, "controlling_dog" }, + { 0x1EFA, "controlroom_top_2" }, + { 0x1EFB, "controlsfrozen" }, + { 0x1EFD, "contuing_to_move_check" }, + { 0x1EFE, "converge_on_target" }, + { 0x1EFF, "conversation_start" }, + { 0x1F00, "conversation_stop" }, + { 0x1F01, "convert_color_to_short_string" }, + { 0x1F02, "convert_fov_string" }, + { 0x1F03, "convert_guy_to_drone" }, + { 0x1F04, "convert_moving_cover_enemies_to_wave_3" }, + { 0x1F06, "convert_to_fake_riders" }, + { 0x1F07, "convert_to_fireworks_effect" }, + { 0x1F08, "convert_to_time_string" }, + { 0x1F09, "convo_generator" }, + { 0x1F0A, "convoy" }, + { 0x1F0C, "convoy_checkpoint" }, + { 0x1F0D, "convoy_checkpoint_spawn" }, + { 0x1F0E, "convoy_death_func" }, + { 0x1F0F, "convoy_kill_player" }, + { 0x1F10, "convoy_riders_death_func" }, + { 0x1F11, "convoy_riders_react_func" }, + { 0x1F13, "convoy_spawn_func" }, + { 0x1F14, "convoy_spawn_logic" }, + { 0x1F16, "convoy_tall_barricade_01" }, + { 0x1F17, "convoy_tall_barricade_02" }, + { 0x1F18, "convoy_think" }, + { 0x1F19, "convoy_veh_01" }, + { 0x1F1A, "convoy_veh_01a" }, + { 0x1F1C, "convoy_veh_03" }, + { 0x1F1F, "convoy_veh_05" }, + { 0x1F22, "cool_spawn" }, + { 0x1F23, "cool_walk" }, + { 0x1F26, "cooldowntime" }, + { 0x1F27, "cooldownwaittime" }, + { 0x1F28, "coop_breached_from_same_door_in_a_muliti_door_room" }, + { 0x1F29, "coop_icon_blinkcrement" }, + { 0x1F2B, "coop_icon_color_blink" }, + { 0x1F2C, "coop_icon_color_damage" }, + { 0x1F2D, "coop_icon_color_downed" }, + { 0x1F2E, "coop_icon_color_dying" }, + { 0x1F2F, "coop_icon_color_normal" }, + { 0x1F30, "coop_icon_color_shoot" }, + { 0x1F31, "coop_icon_state" }, + { 0x1F32, "coop_player_in_special_ops_survival" }, + { 0x1F33, "coop_player_touching_valid_door_volume" }, + { 0x1F35, "coop_with_one_player_downed" }, + { 0x1F37, "copier" }, + { 0x1F38, "copy_adrenaline" }, + { 0x1F3B, "copy_bar" }, + { 0x1F3C, "copy_cat" }, + { 0x1F3D, "copy_ents" }, + { 0x1F3E, "copy_fullweaponlist" }, + { 0x1F3F, "copy_killstreak_status" }, + { 0x1F41, "copy_node" }, + { 0x1F42, "copy_weapon_ammo_clip" }, + { 0x1F43, "copy_weapon_ammo_stock" }, + { 0x1F44, "copy_weapon_current" }, + { 0x1F46, "copymachine_ai" }, + { 0x1F48, "copymachine_cleanup" }, + { 0x1F49, "copymachine_falling_vo" }, + { 0x1F4C, "copymachine_window_event" }, + { 0x1F4D, "core_lights_red" }, + { 0x1F4E, "corner_clearfacialanim" }, + { 0x1F4F, "corner_playaimfacialanim" }, + { 0x1F50, "corner_playcornerfacialanim" }, + { 0x1F55, "cornerdirection" }, + { 0x1F56, "cornered_building_entry_pre_load" }, + { 0x1F57, "cornered_destruct_pre_load" }, + { 0x1F58, "cornered_falling_death" }, + { 0x1F59, "cornered_garden_pre_load" }, + { 0x1F5B, "cornered_interior_pre_load" }, + { 0x1F5E, "cornered_player_arms" }, + { 0x1F5F, "cornered_player_legs" }, + { 0x1F60, "cornered_rappel_pre_load" }, + { 0x1F61, "cornered_start_random_wind" }, + { 0x1F63, "cornered_starts" }, + { 0x1F64, "cornered_stop_random_wind" }, + { 0x1F65, "cornered_stop_rappel" }, + { 0x1F66, "cornerline_height" }, + { 0x1F67, "cornermode" }, + { 0x1F68, "cornerreload" }, + { 0x1F69, "cornerrightgrenadedeath" }, + { 0x1F6A, "cornersights" }, + { 0x1F6B, "corpse" }, + { 0x1F6C, "corpse_behavior_doesnt_require_player_sight" }, + { 0x1F6D, "corpse_clear" }, + { 0x1F6E, "corpse_entity" }, + { 0x1F6F, "corpse_entnums" }, + { 0x1F70, "corpse_height" }, + { 0x1F71, "corpse_ragdoll_when_vertical" }, + { 0x1F73, "corpseflag" }, + { 0x1F76, "cos45" }, + { 0x1F77, "cosine" }, + { 0x1F78, "cosine11_25" }, + { 0x1F79, "cosine15" }, + { 0x1F7B, "cosine45" }, + { 0x1F7D, "cost" }, + { 0x1F7E, "cost_display" }, + { 0x1F7F, "coughing_active" }, + { 0x1F81, "countdown_sound" }, + { 0x1F83, "counted" }, + { 0x1F86, "countryids" }, + { 0x1F87, "courtyard_cleanup_enemies" }, + { 0x1F88, "courtyard_directory" }, + { 0x1F8A, "courtyard_guys_notify_on_death" }, + { 0x1F8B, "courtyard_guys_walla" }, + { 0x1F8C, "courtyard_hazmat_guy_think" }, + { 0x1F8D, "courtyard_intro_ally_vo" }, + { 0x1F8F, "courtyard_intro_elevator" }, + { 0x1F90, "courtyard_intro_elevator_guy" }, + { 0x1F91, "courtyard_intro_elevator_guy_fail" }, + { 0x1F92, "courtyard_intro_elevator_guys" }, + { 0x1F95, "courtyard_office_a_doors" }, + { 0x1F97, "courtyard_office_chair" }, + { 0x1F99, "courtyard_office_death" }, + { 0x1F9A, "courtyard_office_enemies" }, + { 0x1F9B, "courtyard_office_enemy_anim" }, + { 0x1F9C, "courtyard_office_glass" }, + { 0x1F9D, "courtyard_office_props" }, + { 0x1F9E, "courtyard_office_stealth_end" }, + { 0x1F9F, "courtyard_rig_kill" }, + { 0x1FA2, "courtyard_transient_unload" }, + { 0x1FAA, "cover_warnings_disabled" }, + { 0x1FAD, "covercrouchfail" }, + { 0x1FAE, "covercrouchgrenade" }, + { 0x1FAF, "covercrouchlean_aimmode" }, + { 0x1FB0, "covercrouchleanpitch" }, + { 0x1FB1, "coverenterpos" }, + { 0x1FB2, "coverexit" }, + { 0x1FB3, "coverexitangles" }, + { 0x1FB6, "coverexitpostdist" }, + { 0x1FBB, "covermode" }, + { 0x1FBC, "covermulti_choosehidestate" }, + { 0x1FBD, "covermulti_dotransition" }, + { 0x1FBE, "covermulti_enterstate" }, + { 0x1FBF, "covermulti_exitstate" }, + { 0x1FC0, "covermulti_getanimtransition" }, + { 0x1FC2, "covermulti_getnonrandomvaliddir" }, + { 0x1FC3, "covermulti_getrandomvaliddir" }, + { 0x1FC4, "covermulti_getstatefromdir" }, + { 0x1FC5, "covermulti_isvaliddir" }, + { 0x1FC7, "covermulti_setstate" }, + { 0x1FC9, "covermulti_think" }, + { 0x1FCC, "coverposestablishedtime" }, + { 0x1FCE, "coverreload" }, + { 0x1FD1, "coverrightgrenade" }, + { 0x1FD2, "coversetupanim" }, + { 0x1FD3, "coverstand" }, + { 0x1FD4, "coverstandfail" }, + { 0x1FD5, "coverstandgrenade" }, + { 0x1FD8, "covertransangles" }, + { 0x1FDB, "covertranspredist" }, + { 0x1FDC, "covertype" }, + { 0x1FDF, "cq_combat_movement" }, + { 0x1FE0, "cq_enemies" }, + { 0x1FE1, "cq_room_destruction" }, + { 0x1FE2, "cqb_aim" }, + { 0x1FE4, "cqb_anims" }, + { 0x1FE5, "cqb_clearfacialanim" }, + { 0x1FE6, "cqb_dog" }, + { 0x1FE8, "cqb_door_open_slow" }, + { 0x1FE9, "cqb_door_shove" }, + { 0x1FEA, "cqb_encounter" }, + { 0x1FEB, "cqb_encounter_allies_move_up" }, + { 0x1FEC, "cqb_fans" }, + { 0x1FED, "cqb_off_sprint_on" }, + { 0x1FEF, "cqb_playfacialanim" }, + { 0x1FF0, "cqb_point_of_interest" }, + { 0x1FF1, "cqb_reloadinternal" }, + { 0x1FF3, "cqb_time" }, + { 0x1FF5, "cqb_wide_poi_track" }, + { 0x1FF6, "cqb_wide_target_track" }, + { 0x1FF7, "cqbenabled" }, + { 0x1FF8, "cqbpointsofinterest" }, + { 0x1FF9, "cqbtracking" }, + { 0x1FFE, "crack_exploder_test" }, + { 0x2000, "cranked" }, + { 0x2001, "cranked_end_time" }, + { 0x2002, "crankedbombtimer" }, + { 0x2003, "crash_blackhawk_fire_think" }, + { 0x2005, "crash_blackhawk_think" }, + { 0x2006, "crash_derailed_check" }, + { 0x2009, "crash_event" }, + { 0x200A, "crash_hidden_settings" }, + { 0x200B, "crash_model_damage" }, + { 0x200E, "crash_path_check" }, + { 0x200F, "crash_pilot_logic" }, + { 0x2011, "crash_site_a10_missile_dive_1" }, + { 0x2012, "crash_site_a10_overhead" }, + { 0x2014, "crash_site_begin" }, + { 0x2016, "crash_site_init" }, + { 0x2017, "crash_site_main" }, + { 0x2019, "crash_site_vo" }, + { 0x201A, "crash_test_start" }, + { 0x201C, "crash_vehicle_on_death" }, + { 0x201E, "crashed_truck1" }, + { 0x201F, "crashed_truck2" }, + { 0x2020, "crashed_trucks" }, + { 0x2022, "crashedc17_waits" }, + { 0x2023, "crashedtank_waits" }, + { 0x2024, "crashing" }, + { 0x2025, "crashplane" }, + { 0x2026, "crashtimer" }, + { 0x2027, "crate_calculate_on_path_grid" }, + { 0x2028, "crate_can_use_always" }, + { 0x202A, "crate_clip" }, + { 0x202B, "crate_clip_of_doom" }, + { 0x202C, "crate_death_fling" }, + { 0x202D, "crate_get_bot_target" }, + { 0x2033, "crate_low_ammo_check" }, + { 0x2035, "crate_picked_up" }, + { 0x2038, "crateallcapturethink" }, + { 0x203B, "cratekill" }, + { 0x203D, "cratemodelenemyteamsupdater" }, + { 0x203E, "cratemodelplayerupdater" }, + { 0x2040, "cratenonownerusetime" }, + { 0x2041, "crateothercapturethink" }, + { 0x2042, "crateownercapturethink" }, + { 0x2043, "crateownerusetime" }, + { 0x2046, "crater_ledge_walk" }, + { 0x2047, "crater_reveal_dialogue" }, + { 0x2048, "cratesetupforuse" }, + { 0x2049, "crateteammodelupdater" }, + { 0x204A, "cratetype" }, + { 0x204B, "cratetypes" }, + { 0x204D, "crateusepostjuggernautupdater" }, + { 0x204E, "crateuseteamupdater" }, + { 0x2051, "crawl_breath_start" }, + { 0x2052, "crawl_fx" }, + { 0x2053, "crawl_fx_rate" }, + { 0x2054, "crawl_hurt_pulse" }, + { 0x2055, "crawl_out" }, + { 0x2056, "crawl_target_and_init_flags" }, + { 0x2057, "crawl_through_targets_to_init_flags" }, + { 0x2059, "crawling_guys_spawnfunc" }, + { 0x205B, "crawlingpainanimoverridefunc" }, + { 0x205C, "crawlingpaintransanim" }, + { 0x205F, "creaky_board" }, + { 0x2061, "create_anim_event" }, + { 0x2062, "create_anim_node" }, + { 0x2063, "create_anim_scene" }, + { 0x2065, "create_array_of_intel_items" }, + { 0x2067, "create_artillery_shell" }, + { 0x206A, "create_chyron_text" }, + { 0x206B, "create_client_overlay" }, + { 0x206C, "create_client_overlay_custom_size" }, + { 0x2074, "create_dog_start_point_ent" }, + { 0x2075, "create_door_sound_ents" }, + { 0x2077, "create_dvar" }, + { 0x2078, "create_escape_doors" }, + { 0x207A, "create_flare" }, + { 0x207C, "create_fresh_friendly_icon" }, + { 0x207D, "create_fx_ent_setup" }, + { 0x207E, "create_fx_menu" }, + { 0x207F, "create_fxlighting_object" }, + { 0x2080, "create_gain_credit_hud" }, + { 0x2081, "create_gamemessage_text" }, + { 0x2083, "create_hatchet" }, + { 0x2084, "create_hud" }, + { 0x208B, "create_hud_lower_right" }, + { 0x208D, "create_hud_section" }, + { 0x208E, "create_hud_static_overlay" }, + { 0x208F, "create_hud_upper_left" }, + { 0x2090, "create_hud_upper_right" }, + { 0x2091, "create_hud_vertical_meter" }, + { 0x2093, "create_hud_xm25_screen" }, + { 0x2095, "create_jump_point" }, + { 0x2096, "create_line" }, + { 0x2097, "create_lock" }, + { 0x2098, "create_looper" }, + { 0x2099, "create_loopsound" }, + { 0x209A, "create_mantle" }, + { 0x209E, "create_new_spawner_pool" }, + { 0x20A0, "create_outofrange_hud" }, + { 0x20A1, "create_overlay_element" }, + { 0x20A2, "create_passengers" }, + { 0x20A3, "create_path" }, + { 0x20A4, "create_persistent_ice_breach_props" }, + { 0x20A7, "create_player_rig" }, + { 0x20A8, "create_player_surfacing_effects" }, + { 0x20A9, "create_pushed_dropped_weapon" }, + { 0x20AA, "create_qte_prompt" }, + { 0x20AB, "create_random_animation" }, + { 0x20AE, "create_reflection_objects" }, + { 0x20AF, "create_rog_controls" }, + { 0x20B0, "create_rumble_ent" }, + { 0x20B1, "create_single_missile_truck" }, + { 0x20B2, "create_sliding_space_door" }, + { 0x20B4, "create_smoke_and_ambience" }, + { 0x20B5, "create_start" }, + { 0x20B8, "create_sunflare_setting" }, + { 0x20B9, "create_trace_cache" }, + { 0x20BA, "create_track_struct" }, + { 0x20BF, "create_view_particle_source_locked" }, + { 0x20C0, "create_vision_set_fog" }, + { 0x20C1, "create_vo_data" }, + { 0x20C2, "create_warning_elem" }, + { 0x20C3, "create_world_model_from_ent_weapon" }, + { 0x20C5, "createairdropcrate" }, + { 0x20C7, "createart_transient_thread" }, + { 0x20C8, "createballdrone" }, + { 0x20C9, "createbar" }, + { 0x20CA, "createbombsquadmodel" }, + { 0x20CD, "createcarryremoteuav" }, + { 0x20D2, "createclientfontstring_func" }, + { 0x20D3, "createclienticon" }, + { 0x20D4, "createclientprogressbar" }, + { 0x20D5, "createclienttimer" }, + { 0x20D7, "createdogenemy" }, + { 0x20D8, "createdot" }, + { 0x20D9, "createdot_radius" }, + { 0x20DA, "createdropzones" }, + { 0x20DB, "createechoalias" }, + { 0x20DC, "createeffect" }, + { 0x20DF, "createexploder" }, + { 0x20E0, "createexploderex" }, + { 0x20E1, "createfontstring" }, + { 0x20E5, "createfx_centerprint" }, + { 0x20E6, "createfx_centerprint_thread" }, + { 0x20E8, "createfx_draw_enabled" }, + { 0x20EB, "createfx_inputlocked" }, + { 0x20EC, "createfx_loopcounter" }, + { 0x20ED, "createfx_offset" }, + { 0x20EE, "createfx_only_triggers" }, + { 0x20EF, "createfx_print3d" }, + { 0x20F0, "createfx_selecting" }, + { 0x20F1, "createfxbyfxid" }, + { 0x20F2, "createfxcursor" }, + { 0x20F4, "createfxexploders" }, + { 0x20F5, "createfxlogic" }, + { 0x20F6, "createfxmasks" }, + { 0x20F7, "createheli" }, + { 0x20F9, "createhordecrates" }, + { 0x20FB, "createhumanoidenemy" }, + { 0x20FD, "createicon_hudelem" }, + { 0x20FE, "createims" }, + { 0x20FF, "createimsforplayer" }, + { 0x2100, "createintervalsound" }, + { 0x2101, "createlbguard" }, + { 0x2102, "createline" }, + { 0x2104, "createloopeffect" }, + { 0x2105, "createloopsound" }, + { 0x2108, "createmuggercrates" }, + { 0x2109, "createmultipliertext" }, + { 0x210A, "createnewexploder" }, + { 0x210B, "createobject" }, + { 0x210C, "createobjective" }, + { 0x210E, "createoneshoteffect" }, + { 0x2110, "createplaneasheli" }, + { 0x2112, "createportal" }, + { 0x2113, "createportals" }, + { 0x2114, "createprimaryprogressbar" }, + { 0x2115, "createprimaryprogressbartext" }, + { 0x2116, "createprisoner" }, + { 0x2118, "createremoteuav" }, + { 0x2119, "createrpgrepulsors" }, + { 0x211D, "createserverfontstring" }, + { 0x211F, "createservertimer" }, + { 0x2120, "createspendhinthud" }, + { 0x2121, "createsquad" }, + { 0x2122, "createstruct" }, + { 0x2123, "createtags" }, + { 0x2124, "createtank" }, + { 0x2126, "createteamobjpoint" }, + { 0x2128, "createteamprogressbartext" }, + { 0x2129, "createtimer" }, + { 0x212A, "createturret" }, + { 0x212F, "createzones" }, + { 0x2130, "credits" }, + { 0x2133, "credits_spacing" }, + { 0x2136, "creepwalk_traverse_over_small" }, + { 0x2138, "creepwalk_traverse_under" }, + { 0x213A, "crew_quarters_combat" }, + { 0x213C, "crew_quarters_crew_killed" }, + { 0x213E, "critchance" }, + { 0x213F, "critialhit" }, + { 0x2141, "critical_factor" }, + { 0x2142, "criticalfactors_awayfromenemies" }, + { 0x2143, "criticalfactors_domination" }, + { 0x2145, "criticalfactors_nearteam" }, + { 0x2146, "criticalfactors_safeguard" }, + { 0x2148, "crnd_bar_amb" }, + { 0x214E, "crossproduct" }, + { 0x2153, "crouchrun_combatanim" }, + { 0x2154, "crouchrun_runnormal" }, + { 0x2155, "crouchrun_runoverride" }, + { 0x2156, "crouchruntocrouch" }, + { 0x2158, "crouchruntopronerun" }, + { 0x2159, "crouchruntopronewalk" }, + { 0x215B, "crouchstop_begin" }, + { 0x215C, "crouchtocrouchrun" }, + { 0x215E, "crouchtoprone" }, + { 0x2160, "crouchtopronewalk" }, + { 0x2161, "crouchtostand" }, + { 0x2167, "crt_plane" }, + { 0x2168, "crush_front_gaz" }, + { 0x2169, "crush_mobile_gaz" }, + { 0x216A, "crush_player_with_floating_lynx" }, + { 0x216B, "crush_rear_gaz" }, + { 0x216C, "crush_stop_sign_when_near_tank" }, + { 0x216F, "cspline_adjusttime" }, + { 0x2170, "cspline_calctangent" }, + { 0x2173, "cspline_findpathnodes" }, + { 0x2174, "cspline_getnodes" }, + { 0x2177, "cspline_initnoise" }, + { 0x217A, "cspline_makenoisepathnodes" }, + { 0x217B, "cspline_makepath" }, + { 0x217C, "cspline_makepath1seg" }, + { 0x217D, "cspline_makepathtopoint" }, + { 0x217F, "cspline_noise" }, + { 0x2180, "cspline_speedfromdistance" }, + { 0x2181, "cspline_test" }, + { 0x2182, "cspline_testnodes" }, + { 0x2183, "cspline_time" }, + { 0x2184, "csplineseg_calccoeffs" }, + { 0x2185, "csplineseg_calccoeffscapspeed" }, + { 0x2186, "csplineseg_calclengthbystepping" }, + { 0x2187, "csplineseg_calctopspeed" }, + { 0x2189, "csplineseg_calctopspeedbystepping" }, + { 0x218B, "csplineseg_getpoint" }, + { 0x218C, "csv_include" }, + { 0x218D, "csv_lines" }, + { 0x218F, "cull_spawners_from_killspawner" }, + { 0x2191, "cull_trigger_logic" }, + { 0x2192, "cur_defend_angle_override" }, + { 0x2194, "cur_defend_point_override" }, + { 0x2195, "cur_defend_stance" }, + { 0x2197, "cur_node" }, + { 0x2198, "cur_node_check_delete" }, + { 0x2199, "curautosave" }, + { 0x219A, "curclass" }, + { 0x219B, "curdefvalue" }, + { 0x219E, "curmeleetarget" }, + { 0x219F, "curorigin" }, + { 0x21A0, "curprogress" }, + { 0x21A1, "curr_betty" }, + { 0x21A2, "curr_interruption" }, + { 0x21A3, "curr_movetime" }, + { 0x21A5, "currectlocindex" }, + { 0x21A7, "currency_scale_per_hive" }, + { 0x21A8, "current_accuracy" }, + { 0x21A9, "current_alien_count" }, + { 0x21AA, "current_anim" }, + { 0x21AB, "current_anim_data_scene" }, + { 0x21AD, "current_attackers" }, + { 0x21AE, "current_audio_zone" }, + { 0x21AF, "current_binocular_zoom_level" }, + { 0x21B0, "current_challenge" }, + { 0x21B1, "current_challenge_exist" }, + { 0x21B2, "current_challenge_index" }, + { 0x21B3, "current_challenge_is" }, + { 0x21B4, "current_challenge_percent" }, + { 0x21B5, "current_challenge_progress_current" }, + { 0x21B6, "current_challenge_progress_max" }, + { 0x21B7, "current_challenge_target_player" }, + { 0x21BA, "current_color_order" }, + { 0x21BC, "current_cycle_num" }, + { 0x21BD, "current_dist_to_top" }, + { 0x21BE, "current_drill_health" }, + { 0x21BF, "current_drill_time" }, + { 0x21C0, "current_end" }, + { 0x21C1, "current_enemy" }, + { 0x21C2, "current_enemy_vol" }, + { 0x21C3, "current_event" }, + { 0x21C4, "current_fallbackers" }, + { 0x21C5, "current_follow_path" }, + { 0x21C6, "current_foot" }, + { 0x21C7, "current_global_hint" }, + { 0x21C8, "current_high_volume" }, + { 0x21C9, "current_hint" }, + { 0x21CB, "current_hive_name" }, + { 0x21CC, "current_intensity" }, + { 0x21CE, "current_interrupt_status" }, + { 0x21D0, "current_lane_monitor" }, + { 0x21D1, "current_mode_hud" }, + { 0x21D3, "current_position" }, + { 0x21D7, "current_sniff_zone" }, + { 0x21D8, "current_speed_percent" }, + { 0x21D9, "current_spit_node" }, + { 0x21DD, "current_sun" }, + { 0x21DE, "current_sunflare_setting" }, + { 0x21DF, "current_swing_pos" }, + { 0x21E0, "current_target" }, + { 0x21E1, "current_target_hud_count" }, + { 0x21E2, "current_vol_acceptable" }, + { 0x21E3, "current_volume" }, + { 0x21E4, "current_volumes" }, + { 0x21E5, "current_yellow_enemy_replenisher" }, + { 0x21EB, "currentanimstate" }, + { 0x21EF, "currentcolorcode" }, + { 0x21F0, "currentcolorforced" }, + { 0x21F1, "currentdialogimportance" }, + { 0x21F4, "currentdodgeanim" }, + { 0x21F5, "currentenemycount" }, + { 0x21F6, "currentfireworkslocation" }, + { 0x21FA, "currentlylocking" }, + { 0x21FC, "currentowner" }, + { 0x21FF, "currentroundnumber" }, + { 0x2200, "currentstate" }, + { 0x2207, "currenttrig" }, + { 0x2208, "currentvehicletarget" }, + { 0x2209, "currentvels" }, + { 0x220A, "currentweapon" }, + { 0x220C, "cursor" }, + { 0x220D, "curtain_dust" }, + { 0x2211, "custom_aim_internal" }, + { 0x2212, "custom_anim_wait" }, + { 0x2215, "custom_balcony_death_animscript" }, + { 0x2216, "custom_bar_enemy_state_spotted" }, + { 0x2219, "custom_battlechatter_init_valid_phrases" }, + { 0x221C, "custom_cornered_stealth_settings" }, + { 0x221F, "custom_death_script" }, + { 0x2220, "custom_dismount_hint_return_when_dismounted" }, + { 0x2222, "custom_fade_out" }, + { 0x2223, "custom_flavor_burst_ent_delete" }, + { 0x2225, "custom_flavor_bursts" }, + { 0x2227, "custom_followpath_parameter_func" }, + { 0x2228, "custom_friendly_fire_message" }, + { 0x2229, "custom_friendly_fire_shader" }, + { 0x222B, "custom_giveloadout" }, + { 0x222C, "custom_hind_death" }, + { 0x2230, "custom_laser_function" }, + { 0x2232, "custom_mount_hint_return_when_mounted" }, + { 0x2233, "custom_no_game_setupfunc" }, + { 0x2234, "custom_player_attacker" }, + { 0x2235, "custom_radius_damage_for_exploders" }, + { 0x2238, "custom_waterfx" }, + { 0x2239, "customanim" }, + { 0x223A, "customarrivalfunc" }, + { 0x223B, "customautosavecheck" }, + { 0x223C, "custombadplacethread" }, + { 0x223D, "custombcs_validphrases" }, + { 0x223E, "custombreathingtime" }, + { 0x223F, "customchatevent" }, + { 0x2244, "customidleanimset" }, + { 0x2245, "customidleanimweights" }, + { 0x2247, "customjuiced" }, + { 0x2248, "custommoveanimset" }, + { 0x224A, "custommovetransitionfunc" }, + { 0x224C, "customprematchperiod" }, + { 0x224D, "customrunningreacttobullets" }, + { 0x224E, "cut_exploders" }, + { 0x224F, "cut_hint" }, + { 0x2257, "cut_window_rorke" }, + { 0x2259, "cw_barracks" }, + { 0x225E, "cw_barracks_setup" }, + { 0x225F, "cw_barracks_slow" }, + { 0x2260, "cw_bloom_above" }, + { 0x2261, "cw_bravo_breach" }, + { 0x2266, "cw_common" }, + { 0x2268, "cw_common_breach_allies" }, + { 0x226A, "cw_common_breach_nag" }, + { 0x226B, "cw_common_breach_player" }, + { 0x226C, "cw_common_breach_trig_proc" }, + { 0x226D, "cw_common_fic" }, + { 0x226F, "cw_fizzle_flashbangs_thinking" }, + { 0x2270, "cw_fog_above" }, + { 0x2271, "cw_fog_under" }, + { 0x2272, "cw_in_rising_water" }, + { 0x2273, "cw_lights_out_ng" }, + { 0x2274, "cw_lights_out_script_1" }, + { 0x2276, "cw_lights_out_script_3" }, + { 0x2278, "cw_lights_out_script_5" }, + { 0x227B, "cw_mid" }, + { 0x227F, "cw_player_damage_underwater_time_exceeded" }, + { 0x2280, "cw_player_drowning_animate" }, + { 0x2281, "cw_player_drowning_damage_count" }, + { 0x2282, "cw_player_in_rising_water" }, + { 0x2283, "cw_player_is_drowning" }, + { 0x2284, "cw_player_make_stand" }, + { 0x2285, "cw_player_underwater_max_blur" }, + { 0x2287, "cw_player_view_fx_source" }, + { 0x2288, "cw_player_view_water_level_fx_source" }, + { 0x2289, "cw_playing_wet_fx" }, + { 0x228B, "cw_previous_longdeath" }, + { 0x228C, "cw_snowmobile_headlight" }, + { 0x228D, "cw_snowmobile_headlight_cg" }, + { 0x228E, "cw_snowmobile_light" }, + { 0x228F, "cw_stairs_fic" }, + { 0x2291, "cw_tape_breach" }, + { 0x2294, "cw_thermite_charge_light" }, + { 0x2295, "cw_trigger_volumes" }, + { 0x2296, "cw_vision_above" }, + { 0x2297, "cw_waterwipe_above" }, + { 0x2299, "cw_waterwipe_under" }, + { 0x229A, "cw_waterwipe_under_playing" }, + { 0x229C, "cycle_begin_intensity_monitor" }, + { 0x229D, "cycle_count" }, + { 0x229F, "cycle_data" }, + { 0x22A4, "cycle_reward_scalar" }, + { 0x22A7, "cycletargets" }, + { 0x22A8, "cypher_defend_self" }, + { 0x22AC, "d_dialogue_queue" }, + { 0x22AD, "dam" }, + { 0x22AE, "dam_break" }, + { 0x22B1, "dam_break_church_spire" }, + { 0x22B5, "dam_break_m880_launch_prep" }, + { 0x22B6, "dam_break_m880_launch_prep_spawn" }, + { 0x22BA, "dam_break_missile_02" }, + { 0x22BB, "dam_break_missile_03" }, + { 0x22BF, "dam_break_street_water" }, + { 0x22C0, "dam_break_street_water_01" }, + { 0x22C1, "dam_break_street_water_02" }, + { 0x22C5, "dam_break_weapon" }, + { 0x22C7, "dam_heli_flyover_hover" }, + { 0x22C8, "dam_start" }, + { 0x22C9, "dam_street_flood_big_splashes_fx" }, + { 0x22CA, "dam_street_flood_church_hits" }, + { 0x22CD, "damage_alien_over_time" }, + { 0x22CF, "damage_done" }, + { 0x22D1, "damage_feedback_setup" }, + { 0x22D2, "damage_functions" }, + { 0x22D4, "damage_hint_bullet_only" }, + { 0x22D6, "damage_hints_cleanup" }, + { 0x22D7, "damage_is_valid_for_friendlyfire_warning" }, + { 0x22D8, "damage_level" }, + { 0x22DA, "damage_not" }, + { 0x22DB, "damage_player" }, + { 0x22DF, "damage_slide_time" }, + { 0x22E1, "damage_smoke_time" }, + { 0x22E2, "damage_state_apply" }, + { 0x22E3, "damage_state_build" }, + { 0x22E4, "damage_state_choose" }, + { 0x22E6, "damage_state_fx_add" }, + { 0x22EB, "damage_state_play_fx_on_tag" }, + { 0x22EF, "damage_state_stop_fx_on_tag" }, + { 0x22F0, "damage_state_tag_ent_clear_all" }, + { 0x22F4, "damage_time" }, + { 0x22F5, "damage_time_player" }, + { 0x22F7, "damage_type" }, + { 0x22F8, "damage_vehicle_think" }, + { 0x22F9, "damage_vehicles_path1" }, + { 0x22FA, "damage_vehicles_path2" }, + { 0x22FB, "damage_watcher_ambush" }, + { 0x22FE, "damageattacker" }, + { 0x2300, "damagecallback" }, + { 0x2303, "damaged_crate" }, + { 0x2304, "damagedplayer" }, + { 0x2308, "damagefeedback" }, + { 0x2309, "damagefeedback_took_damage" }, + { 0x230B, "damageinfocolorindex" }, + { 0x230F, "damagelistsize" }, + { 0x2312, "damageorigin" }, + { 0x2314, "damagepoint" }, + { 0x2316, "damageshieldcounter" }, + { 0x2318, "damageshieldpain" }, + { 0x231B, "damping_factor" }, + { 0x231D, "dangermaxradius" }, + { 0x231E, "dangerminradius" }, + { 0x231F, "dangerovalscale" }, + { 0x2320, "dangersprinttime" }, + { 0x2321, "dart" }, + { 0x2323, "dart_breach_precache" }, + { 0x2324, "dash_wipe" }, + { 0x2325, "data" }, + { 0x2327, "data_value_suffix" }, + { 0x2329, "dc_old_moveplaybackrate" }, + { 0x232A, "dc_shotgun_seek" }, + { 0x232C, "ddtimetoadd" }, + { 0x232D, "deactivate" }, + { 0x232E, "deactivate_avoid_minion_exp" }, + { 0x232F, "deactivate_current_challenge" }, + { 0x2333, "deactivate_kill_10_with_turrets" }, + { 0x2334, "deactivate_kill_airborne_aliens" }, + { 0x2336, "deactivate_melee_goons" }, + { 0x2337, "deactivate_melee_only" }, + { 0x2339, "deactivate_occlusion" }, + { 0x233A, "deactivate_percent_accuracy" }, + { 0x233B, "deactivate_protect_a_player" }, + { 0x2347, "dead_guy" }, + { 0x234B, "dead_hive_model" }, + { 0x234C, "dead_pilot_hang" }, + { 0x234E, "deadly_sharks" }, + { 0x2350, "death_a" }, + { 0x2351, "death_achievements" }, + { 0x2352, "death_achievements_rappel" }, + { 0x2353, "death_anim" }, + { 0x2354, "death_anim_anytime" }, + { 0x2355, "death_anim_played" }, + { 0x2358, "death_d" }, + { 0x2359, "death_delayed_ragdoll" }, + { 0x235A, "death_effect" }, + { 0x235B, "death_firesound" }, + { 0x235C, "death_func" }, + { 0x235F, "death_getincomingdirection" }, + { 0x2360, "death_model_col" }, + { 0x2364, "death_only_ragdoll" }, + { 0x2365, "death_override" }, + { 0x2366, "death_waiter" }, + { 0x2367, "death_warning_vo" }, + { 0x2368, "death_watcher" }, + { 0x2369, "deathanim" }, + { 0x236B, "deathanimscript" }, + { 0x236C, "deathchain_goalvolume" }, + { 0x236D, "deathchainainotify" }, + { 0x236E, "deathchainspawnerlogic" }, + { 0x2372, "deathdamagemax" }, + { 0x2374, "deathdamageradius" }, + { 0x2375, "deathflags" }, + { 0x2376, "deathfunc" }, + { 0x2379, "deathfunc_vol_num_decrement" }, + { 0x237A, "deathfuncs" }, + { 0x237D, "deathfx_ent" }, + { 0x237E, "deathoverridecallback" }, + { 0x2380, "deathquote_on_death" }, + { 0x2381, "deathrolloff" }, + { 0x2383, "deathscript" }, + { 0x2385, "deathsdoor_enabled" }, + { 0x2388, "deathspawnerents" }, + { 0x2389, "deathspawnerpreview" }, + { 0x238A, "deathstring" }, + { 0x238E, "deathvfx" }, + { 0x238F, "deathwatcher" }, + { 0x2391, "debgugprintdestructiblelist" }, + { 0x2392, "debris" }, + { 0x2393, "debris_bridge_actor_vign_and_transition_to_combat" }, + { 0x2394, "debris_bridge_allies_loop" }, + { 0x2396, "debris_bridge_bus_sparks" }, + { 0x2397, "debris_bridge_cleanup" }, + { 0x2399, "debris_bridge_fx" }, + { 0x239A, "debris_bridge_loop1" }, + { 0x239C, "debris_bridge_sfx" }, + { 0x23A0, "debris_bridge_vign2_and_loop3" }, + { 0x23A1, "debris_bridge_vign2_and_loop3_ally" }, + { 0x23A2, "debris_chunk" }, + { 0x23A4, "debris_remove_after_time" }, + { 0x23A5, "debris_spawner" }, + { 0x23A8, "debrisbridge_cleanup" }, + { 0x23A9, "debrisbridge_clear_enemies_bottom" }, + { 0x23AA, "debrisbridge_clear_enemies_top" }, + { 0x23AC, "debrisbridge_crossing" }, + { 0x23AE, "debrisbridge_enemy_aggrisive_logic" }, + { 0x23AF, "debrisbridge_enemy_logic" }, + { 0x23B1, "debrisbridge_enemy_spawn_logic" }, + { 0x23B2, "debrisbridge_fodder" }, + { 0x23B3, "debrisbridge_fodder_extra" }, + { 0x23B4, "debrisbridge_hide_glass_parts" }, + { 0x23B5, "debrisbridge_kill_enemies_top" }, + { 0x23B6, "debrisbridge_loc" }, + { 0x23B7, "debrisbridge_move_trigger" }, + { 0x23B9, "debrisbridge_origins" }, + { 0x23BA, "debrisbridge_path_logic" }, + { 0x23BB, "debrisbridge_prevent_frogger" }, + { 0x23BC, "debrisbridge_setup_ally_for_kill_shot" }, + { 0x23BD, "debrisbridge_setup_enemies_for_clearance" }, + { 0x23BE, "debrisbridge_shot_count" }, + { 0x23C0, "debrisbridge_start" }, + { 0x23C1, "debrisbridge_wall_break_logic" }, + { 0x23C2, "debrisbridge_water_enter_combat_space" }, + { 0x23C6, "debug" }, + { 0x23C7, "debug_ai_drone_amounts" }, + { 0x23C8, "debug_ai_drone_amounts_logic" }, + { 0x23C9, "debug_anim" }, + { 0x23CB, "debug_animsoundtagselected" }, + { 0x23CD, "debug_arrivals_on_actor" }, + { 0x23CE, "debug_audio_hud" }, + { 0x23CF, "debug_bike_line" }, + { 0x23D2, "debug_circle" }, + { 0x23D5, "debug_color_huds" }, + { 0x23D6, "debug_color_system_hud" }, + { 0x23D8, "debug_corner" }, + { 0x23DA, "debug_cross" }, + { 0x23DB, "debug_death" }, + { 0x23DE, "debug_draw_arrow" }, + { 0x23E6, "debug_enemyposproc" }, + { 0x23E7, "debug_enemyposreplay" }, + { 0x23E8, "debug_error" }, + { 0x23E9, "debug_friendlyfire" }, + { 0x23EA, "debug_function" }, + { 0x23EC, "debug_fxlighting_buttons" }, + { 0x23ED, "debug_heli_gun" }, + { 0x23EF, "debug_hud_disabled" }, + { 0x23F1, "debug_j_prop" }, + { 0x23F3, "debug_jolt_vehs" }, + { 0x23F4, "debug_kill_enemies_in_order" }, + { 0x23F5, "debug_line" }, + { 0x23F6, "debug_lookflag" }, + { 0x23F7, "debug_message" }, + { 0x23FA, "debug_no_move" }, + { 0x23FC, "debug_org" }, + { 0x23FE, "debug_player_in_post_clip" }, + { 0x2400, "debug_print3d" }, + { 0x2401, "debug_print3d_simple" }, + { 0x2403, "debug_radiusdamage_circle" }, + { 0x2404, "debug_reflection" }, + { 0x2405, "debug_reflection_buttons" }, + { 0x2408, "debug_show_ai_counts" }, + { 0x240A, "debug_spawn_director_active" }, + { 0x240C, "debug_stopenemypos" }, + { 0x240E, "debug_test_thruster_audio" }, + { 0x2410, "debug_thruster_text" }, + { 0x2411, "debug_timer" }, + { 0x2415, "debug_wait" }, + { 0x2416, "debug_warning" }, + { 0x2417, "debug_wibble" }, + { 0x2419, "debugchains" }, + { 0x241A, "debugcircle" }, + { 0x241B, "debugcolorfriendlies" }, + { 0x241E, "debuggoalpos" }, + { 0x2421, "debugleft" }, + { 0x2423, "debugmisstime" }, + { 0x2426, "debugpos" }, + { 0x2427, "debugposinternal" }, + { 0x2428, "debugpossize" }, + { 0x242A, "debugprint3d" }, + { 0x242B, "debugprintln2" }, + { 0x242C, "debugsightline" }, + { 0x242D, "debugspawners" }, + { 0x242E, "debugthreat" }, + { 0x242F, "debugthreatcalc" }, + { 0x2430, "debugtimeout" }, + { 0x2431, "debugvar" }, + { 0x2433, "decal" }, + { 0x2435, "deceleration" }, + { 0x2436, "decidenumcrawls" }, + { 0x243B, "deck_ac130_dmg_badplace_size" }, + { 0x243C, "deck_ac130_dmg_clip" }, + { 0x2441, "deck_combat_vo" }, + { 0x2443, "deck_combat_wave1_flank" }, + { 0x2444, "deck_combat_wave1_helis" }, + { 0x2446, "deck_combat_wave2_helis" }, + { 0x2448, "deck_combat_wave3_ambient_jets" }, + { 0x2449, "deck_combat_wave3_helis" }, + { 0x244A, "deck_damage" }, + { 0x244B, "deck_destroyed_odin" }, + { 0x244C, "deck_explode" }, + { 0x244D, "deck_explode_guys" }, + { 0x244E, "deck_explode_vista" }, + { 0x244F, "deck_tilt_pre_load" }, + { 0x2450, "deck_tilt_water_kill_trigger" }, + { 0x2452, "deck_transition_cleanup_vol" }, + { 0x2453, "deck_transition_pre_load" }, + { 0x2454, "deck_victory_pre_load" }, + { 0x2456, "decomp_anim_line_1" }, + { 0x2457, "decomp_anim_line_2" }, + { 0x2458, "decomp_anim_notify_done" }, + { 0x2459, "decomp_anim_notify_end_slomo" }, + { 0x245A, "decomp_anim_notify_player_link" }, + { 0x245B, "decomp_anim_notify_slomo" }, + { 0x245D, "decomp_explosion_anim_ally" }, + { 0x245E, "decomp_explosion_anim_enemies" }, + { 0x245F, "decomp_explosion_anim_player" }, + { 0x2460, "decomp_explosion_anim_player_legs" }, + { 0x2462, "decomp_heavy_rumble" }, + { 0x2464, "decreasexpboost" }, + { 0x2465, "decrement_list_offset" }, + { 0x2466, "decrementalivecount" }, + { 0x2468, "decrementcolorusers" }, + { 0x246A, "decrementfauxvehiclecount" }, + { 0x246B, "decrementing_slide" }, + { 0x246C, "decrementlevelbreaks" }, + { 0x246D, "deep_array_call" }, + { 0x246E, "deep_array_thread" }, + { 0x246F, "deer" }, + { 0x2471, "deer_anims" }, + { 0x2474, "deer_detects_when_to_run" }, + { 0x2475, "deer_drone_custom_idle" }, + { 0x2477, "deer_drone_spawn_func" }, + { 0x2478, "deer_dronespawn" }, + { 0x2479, "deer_dronespawn_internal" }, + { 0x247B, "deer_fade_in" }, + { 0x247C, "deer_init" }, + { 0x247D, "deer_player_aim_detection" }, + { 0x247E, "deer_player_leaning_detect" }, + { 0x247F, "deer_reveal_chairs" }, + { 0x2481, "deer_ruckus_trig_logic" }, + { 0x2482, "deer_rumble_movewait" }, + { 0x2483, "deer_stampede_logic" }, + { 0x2484, "deerhunttransitionanim" }, + { 0x2485, "def" }, + { 0x2486, "def_fire" }, + { 0x248B, "default_canactivatefunc" }, + { 0x248D, "default_dof" }, + { 0x248E, "default_dog_limits" }, + { 0x248F, "default_door_node_flashbang_frequency" }, + { 0x2490, "default_drop_pitch" }, + { 0x2491, "default_failactivatefunc" }, + { 0x2492, "default_failfunc" }, + { 0x2494, "default_fov" }, + { 0x2496, "default_goalheight" }, + { 0x2498, "default_heartbeat_rate" }, + { 0x2499, "default_init" }, + { 0x249B, "default_loadout_if_notset" }, + { 0x249D, "default_mg_drone" }, + { 0x249F, "default_node" }, + { 0x24A0, "default_ondeadevent" }, + { 0x24A2, "default_ononeleftevent" }, + { 0x24A4, "default_resetsuccess" }, + { 0x24A6, "default_run_speed" }, + { 0x24A7, "default_should_update" }, + { 0x24A8, "default_sprint" }, + { 0x24A9, "default_start" }, + { 0x24AC, "default_stealth_override" }, + { 0x24AD, "default_stealth_settings" }, + { 0x24B0, "default_unresolved_collision_handler" }, + { 0x24B1, "default_visionset" }, + { 0x24B2, "default_wander_radius" }, + { 0x24B4, "defaultbodymodels" }, + { 0x24B5, "defaultclass" }, + { 0x24B6, "defaultdroneragdoll" }, + { 0x24B7, "defaultdroppitch" }, + { 0x24B8, "defaultdropyaw" }, + { 0x24B9, "defaultemissive" }, + { 0x24BA, "defaultexception" }, + { 0x24BB, "defaultheadmodels" }, + { 0x24BE, "defaultmoveplaybackrate" }, + { 0x24BF, "defaultonmode" }, + { 0x24C0, "defaults" }, + { 0x24C1, "defaulttarget" }, + { 0x24C2, "defaultturnthreshold" }, + { 0x24C6, "defaultweapon" }, + { 0x24C7, "defconkillstreakthread" }, + { 0x24C8, "defconkillstreakwait" }, + { 0x24C9, "defconmode" }, + { 0x24CA, "defconpointmod" }, + { 0x24CB, "defconsplashnotify" }, + { 0x24CE, "defend_combat" }, + { 0x24D2, "defend_door_explosion" }, + { 0x24D3, "defend_door_open" }, + { 0x24D7, "defend_fire" }, + { 0x24DA, "defend_intro" }, + { 0x24DB, "defend_platform" }, + { 0x24DC, "defend_quick" }, + { 0x24DD, "defend_save_safe" }, + { 0x24DF, "defend_sparrow_control" }, + { 0x24E0, "defend_sparrow_fx" }, + { 0x24E1, "defend_sparrow_pre_load" }, + { 0x24E2, "defend_sparrow_ships" }, + { 0x24E3, "defend_start" }, + { 0x24E4, "defend_start_player_shield" }, + { 0x24E5, "defend_valid_center" }, + { 0x24E9, "defend_zodiac_arrived_catwalk" }, + { 0x24EA, "defend_zodiac_arrived_right" }, + { 0x24EB, "defend_zodiac_autosave" }, + { 0x24ED, "defend_zodiac_osprey" }, + { 0x24F0, "defend_zodiac_spawn_hidden_reinforcement" }, + { 0x24F1, "defend_zodiac_spawn_reinforcement" }, + { 0x24F2, "defend_zodiac_waittill_enemies_remaining" }, + { 0x24F3, "defendedplayer" }, + { 0x24F4, "defendloc" }, + { 0x24F5, "defendlocation" }, + { 0x24F6, "defends" }, + { 0x24F7, "defense_cautious_approach" }, + { 0x24F8, "defense_death_monitor" }, + { 0x24F9, "defense_force_next_node_goal" }, + { 0x24FA, "defense_get_initial_entrances" }, + { 0x24FC, "defense_override_entrances" }, + { 0x24FF, "define_loadout" }, + { 0x2500, "definechestweapons" }, + { 0x2502, "defuseendtime" }, + { 0x2503, "defuses" }, + { 0x2504, "defusetime" }, + { 0x2505, "delay" }, + { 0x2506, "delay_drop_boat" }, + { 0x2508, "delay_keegan_color" }, + { 0x2509, "delay_multi_fx" }, + { 0x250A, "delay_multi_fx_proc" }, + { 0x250C, "delay_remove_invul" }, + { 0x250D, "delay_reset_swim_shock" }, + { 0x2511, "delay_show_legs_entry" }, + { 0x2512, "delay_with_bubbles" }, + { 0x2513, "delaybetweenlockon" }, + { 0x2514, "delaybetweenrockets" }, + { 0x2515, "delaycall" }, + { 0x2516, "delaycall_proc" }, + { 0x2517, "delaychildthread" }, + { 0x2518, "delaychildthread_proc" }, + { 0x2519, "delaydestroy" }, + { 0x251A, "delayed_delete" }, + { 0x251C, "delayed_intro" }, + { 0x251D, "delayed_kill" }, + { 0x251E, "delayed_player_seek_think" }, + { 0x251F, "delayed_setgoalvolumeauto" }, + { 0x2520, "delayed_setup" }, + { 0x2522, "delayedbadplace" }, + { 0x2524, "delayedexception" }, + { 0x2525, "delayedfofoverlay" }, + { 0x2528, "delayer" }, + { 0x2529, "delayhudoutline" }, + { 0x252E, "delaytankunload" }, + { 0x2530, "delaythread_nuke" }, + { 0x2531, "delaythread_proc" }, + { 0x2532, "deletable_magic_bullet_shield" }, + { 0x2534, "delete_accessories_on_death" }, + { 0x2538, "delete_ai_at_path_end" }, + { 0x2539, "delete_all_by_type" }, + { 0x253A, "delete_all_ents" }, + { 0x253B, "delete_all_grenades" }, + { 0x253C, "delete_all_triggers" }, + { 0x253E, "delete_at_anim_end" }, + { 0x2540, "delete_beginning_ents" }, + { 0x2543, "delete_building_glow" }, + { 0x2544, "delete_corpse_in_volume" }, + { 0x2546, "delete_corpses_around_vehicle" }, + { 0x2547, "delete_cracked_glass" }, + { 0x2548, "delete_destructibles_in_volumes" }, + { 0x2549, "delete_ent" }, + { 0x254A, "delete_ent_by_script_noteworthy" }, + { 0x254C, "delete_ents" }, + { 0x2552, "delete_fish_in_volume" }, + { 0x2553, "delete_glass_cutter" }, + { 0x2554, "delete_hazmat_guns" }, + { 0x2556, "delete_if_player_cant_see_me" }, + { 0x2557, "delete_intel" }, + { 0x2558, "delete_interactives_in_volumes" }, + { 0x2559, "delete_light_on_clearup" }, + { 0x255A, "delete_links_then_self" }, + { 0x255B, "delete_me" }, + { 0x255C, "delete_me_after_time" }, + { 0x255E, "delete_me_on_parent_ai_death" }, + { 0x2560, "delete_moving_cover_objects" }, + { 0x2564, "delete_on_crack1_done" }, + { 0x2565, "delete_on_crack2_done" }, + { 0x2566, "delete_on_death" }, + { 0x2567, "delete_on_death_wait_sound" }, + { 0x2568, "delete_on_end" }, + { 0x2569, "delete_on_flag" }, + { 0x256B, "delete_on_house_done" }, + { 0x256D, "delete_on_notify" }, + { 0x256E, "delete_on_path_end" }, + { 0x256F, "delete_on_removed" }, + { 0x2570, "delete_on_sounddone" }, + { 0x2571, "delete_path_clip" }, + { 0x2574, "delete_removables" }, + { 0x2577, "delete_sentry_turret" }, + { 0x2578, "delete_stage_one_fx" }, + { 0x2579, "delete_start" }, + { 0x257A, "delete_temp_sat_view_targets" }, + { 0x257D, "delete_trolley_ally" }, + { 0x257E, "delete_volmod_hud" }, + { 0x257F, "delete_wand_at_lights_out" }, + { 0x2580, "delete_when_behind_player" }, + { 0x2584, "deletecrate" }, + { 0x2585, "deletedebugtexthud" }, + { 0x2587, "deletedestructiblekillcament" }, + { 0x2589, "deleteexplosive" }, + { 0x258B, "deleteifnotused" }, + { 0x258C, "deletelethalequipmentondisconnect" }, + { 0x258D, "deleteobjpoint" }, + { 0x258E, "deleteonac130playerremoved" }, + { 0x258F, "deleteondeath" }, + { 0x2590, "deleteonentnotify" }, + { 0x2592, "deleteonreviveordeathordisconnect" }, + { 0x2594, "deletepickupafterawhile" }, + { 0x2595, "deleteplacedentity" }, + { 0x2596, "deletereviveicon" }, + { 0x2599, "deletestruct_ref" }, + { 0x259A, "deletestructarray" }, + { 0x259B, "deletestructarray_ref" }, + { 0x259C, "deleteti" }, + { 0x259D, "deleteuseent" }, + { 0x259E, "deleteuseobject" }, + { 0x25A1, "demo_setup_allies" }, + { 0x25A2, "demo_setup_sound" }, + { 0x25A3, "demo_switch_checkpoints" }, + { 0x25A5, "denied" }, + { 0x25A6, "dependent_hives_removed" }, + { 0x25A7, "deploy_currency" }, + { 0x25A8, "deploy_health_regen_shield" }, + { 0x25A9, "deployable" }, + { 0x25AB, "deployable_ammo_placed_listener" }, + { 0x25AC, "deployable_armor_placed_listener" }, + { 0x25AF, "deployable_box_onuse_message" }, + { 0x25B0, "deployable_currency_placed_listener" }, + { 0x25B3, "deployable_randombox_placed_listener" }, + { 0x25B4, "deployable_specialammo_placed_listener" }, + { 0x25B5, "deployable_tutorial_given" }, + { 0x25B6, "deployablebox_adrenalinebox_max" }, + { 0x25B7, "deployablebox_adrenalinebox_rank" }, + { 0x25B9, "deployablebox_juicebox_rank" }, + { 0x25BD, "deployablegunbox_bonusinxuses" }, + { 0x25C3, "depth" }, + { 0x25C6, "depth_allow_stand" }, + { 0x25C8, "depth_charge_check_failure" }, + { 0x25C9, "depth_charge_clear_hud" }, + { 0x25CA, "depth_charge_control_down" }, + { 0x25CB, "depth_charge_control_up" }, + { 0x25CD, "depth_charge_current_slow_pitch" }, + { 0x25D0, "depth_charge_death_trig" }, + { 0x25D2, "depth_charge_default_pitch" }, + { 0x25D3, "depth_charge_dialogue" }, + { 0x25D4, "depth_charge_drop" }, + { 0x25D7, "depth_charge_exit" }, + { 0x25D9, "depth_charge_firing_slow_aim_modifier" }, + { 0x25DB, "depth_charge_friendly_fire_kills_to_fail" }, + { 0x25DC, "depth_charge_give_control" }, + { 0x25DF, "depth_charge_hint" }, + { 0x25E2, "depth_charge_init" }, + { 0x25E8, "depth_charge_max_slow_aim_pitch" }, + { 0x25EA, "depth_charge_min_fov" }, + { 0x25EC, "depth_charge_min_slow_aim_yaw" }, + { 0x25EE, "depth_charge_monitor_drop" }, + { 0x25F0, "depth_charge_org" }, + { 0x25F1, "depth_charge_pitch_down_allowance" }, + { 0x25F3, "depth_charge_remove_control" }, + { 0x25F4, "depth_charge_replay" }, + { 0x25F6, "depth_charge_set_slow_aim" }, + { 0x25F7, "depth_charge_start_time" }, + { 0x25F8, "depth_charge_target" }, + { 0x25F9, "depth_charge_turn" }, + { 0x25FB, "depth_charge_use" }, + { 0x25FD, "depth_charges" }, + { 0x25FF, "depth_charges_setup" }, + { 0x2600, "depth_marker" }, + { 0x2601, "depthenable" }, + { 0x2603, "derrick_metal_debris_sfx" }, + { 0x2604, "derrick_model" }, + { 0x2605, "derrick_pop_and_explode" }, + { 0x2606, "derrick_scene_struct" }, + { 0x2607, "derrick_struct" }, + { 0x2608, "desc" }, + { 0x260C, "deselect_entity" }, + { 0x260D, "designator_disableusabilityduringgrenadepullback" }, + { 0x260E, "designator_enableusabilitywhendesignatorfinishes" }, + { 0x260F, "designator_ontargetacquired" }, + { 0x2611, "designator_start" }, + { 0x2612, "designator_waitforgrenadefire" }, + { 0x2615, "desired_anim_pose" }, + { 0x2616, "desired_bob_pitch" }, + { 0x2617, "desired_bob_roll" }, + { 0x2618, "desired_speed" }, + { 0x2619, "desiredtimeofdeath" }, + { 0x261A, "desk_animate" }, + { 0x261D, "dest_tree_test" }, + { 0x261E, "destination" }, + { 0x261F, "destinations" }, + { 0x2621, "destroy_all_hangar_walls_wait" }, + { 0x2622, "destroy_breach_mines_and_fx" }, + { 0x2624, "destroy_corner" }, + { 0x2627, "destroy_hint" }, + { 0x2628, "destroy_hint_on_friendlyfire" }, + { 0x2629, "destroy_hive_icon" }, + { 0x262A, "destroy_lip_debris_fx" }, + { 0x262B, "destroy_persistent_ice_breach_props" }, + { 0x262F, "destroy_player_ambush_vo" }, + { 0x2633, "destroy_warning_elem" }, + { 0x263A, "destroyactiveimss" }, + { 0x263B, "destroyactivelittlebirds" }, + { 0x263C, "destroyactiverockets" }, + { 0x263D, "destroyactiveturrets" }, + { 0x263E, "destroyactiveuavs" }, + { 0x263F, "destroyactiveugvs" }, + { 0x2641, "destroyed" }, + { 0x2642, "destroyed_derrick_models" }, + { 0x2643, "destroyed_fire_fx" }, + { 0x2644, "destroyed_hesco_count" }, + { 0x2645, "destroyed_tank" }, + { 0x2647, "destroyedcounttimeout" }, + { 0x2648, "destroyedmodel" }, + { 0x264A, "destroyefx" }, + { 0x264B, "destroyelem" }, + { 0x264D, "destroyer_ac130_exchange" }, + { 0x2650, "destroyer_mg_monitor" }, + { 0x2651, "destroyer_target" }, + { 0x2652, "destroyer_targets_big" }, + { 0x2655, "destroyheadiconsondeath" }, + { 0x2659, "destroyslowly" }, + { 0x265E, "destructable_think" }, + { 0x265F, "destructible" }, + { 0x2663, "destructible_attachmodel" }, + { 0x2667, "destructible_builddot_startloop" }, + { 0x2668, "destructible_builddot_wait" }, + { 0x2669, "destructible_car_alarm" }, + { 0x266A, "destructible_civilian_sedan_iw6" }, + { 0x266B, "destructible_cleans_up_more" }, + { 0x266C, "destructible_create" }, + { 0x266E, "destructible_createdot_radius" }, + { 0x266F, "destructible_damage_threshold" }, + { 0x2670, "destructible_death" }, + { 0x2672, "destructible_dots" }, + { 0x2673, "destructible_dragons_teeth" }, + { 0x2679, "destructible_function" }, + { 0x267C, "destructible_fx_think" }, + { 0x2680, "destructible_handles_collision_brushes" }, + { 0x2681, "destructible_health_drain_amount_multiplier" }, + { 0x2683, "destructible_info" }, + { 0x2684, "destructible_lights_out" }, + { 0x2685, "destructible_loopfx" }, + { 0x268C, "destructible_parts" }, + { 0x268D, "destructible_physics" }, + { 0x268E, "destructible_protection_func" }, + { 0x268F, "destructible_quakes_off" }, + { 0x2690, "destructible_quakes_on" }, + { 0x2693, "destructible_setdot_ontickfunc" }, + { 0x2694, "destructible_setup" }, + { 0x2696, "destructible_sound_think" }, + { 0x269A, "destructible_spotlight" }, + { 0x269B, "destructible_spotlight_think" }, + { 0x269C, "destructible_state" }, + { 0x269E, "destructible_transient" }, + { 0x269F, "destructible_update_part" }, + { 0x26A0, "destructible_van_iw6" }, + { 0x26A4, "destructibles" }, + { 0x26A5, "destructiblespawnedents" }, + { 0x26A9, "destructions" }, + { 0x26AA, "destructisolarpanelsinit" }, + { 0x26AC, "detach_cig" }, + { 0x26AD, "detach_getoutrigs" }, + { 0x26AE, "detach_hatchet" }, + { 0x26AF, "detach_idle_clip" }, + { 0x26B0, "detach_models_with_substr" }, + { 0x26B1, "detach_phone" }, + { 0x26B2, "detach_pistol_left" }, + { 0x26B3, "detach_pistol_right" }, + { 0x26B4, "detach_rope_ally" }, + { 0x26B7, "detach_rope_rorke" }, + { 0x26B8, "detachallweaponmodels" }, + { 0x26BA, "detachifattached" }, + { 0x26BB, "detachprops" }, + { 0x26BC, "detachusemodels" }, + { 0x26BF, "detect_distsqrd" }, + { 0x26C1, "detect_people" }, + { 0x26C2, "detect_people_trigger" }, + { 0x26C3, "detect_player_death" }, + { 0x26C4, "detect_player_event" }, + { 0x26C6, "detect_range" }, + { 0x26CA, "detectexplosives" }, + { 0x26CB, "detectfriendlyfireonentity" }, + { 0x26CD, "detectid" }, + { 0x26CE, "detection_level" }, + { 0x26CF, "detection_timeout" }, + { 0x26D0, "detectiongraceperiod" }, + { 0x26D2, "detectionradius" }, + { 0x26D3, "detectkill" }, + { 0x26D4, "determine_closest_cars" }, + { 0x26D6, "determinecqbanim" }, + { 0x26D7, "determineexposedapproachtype" }, + { 0x26D8, "determineheatcoverexittype" }, + { 0x26D9, "determinenodeapproachtype" }, + { 0x26DA, "determinenodeexittype" }, + { 0x26DB, "determinenonnodeexittype" }, + { 0x26DD, "detonate_dominator" }, + { 0x26E1, "detonateonuse" }, + { 0x26E4, "detoured" }, + { 0x26E5, "detouringpath" }, + { 0x26E6, "detpackstunradius" }, + { 0x26E7, "devaliengiveplayersmoney" }, + { 0x26E8, "device" }, + { 0x26EA, "dialog" }, + { 0x26EB, "dialog_baker_init_control" }, + { 0x26EC, "dialog_baker_player_control" }, + { 0x26ED, "dialog_baker_start" }, + { 0x26EF, "dialog_explode" }, + { 0x26F0, "dialog_found_a_body" }, + { 0x26F1, "dialog_jump" }, + { 0x26F2, "dialog_line_with_flag" }, + { 0x26F5, "dialog_nags_heli" }, + { 0x26F8, "dialog_radiobravo" }, + { 0x26F9, "dialog_seehelo" }, + { 0x26FB, "dialogue" }, + { 0x26FD, "dialogue_baker_waitforit" }, + { 0x2700, "dialogue_end" }, + { 0x2704, "dialogue_intro" }, + { 0x2705, "dialogue_mantle" }, + { 0x2706, "dialogue_mgs_1" }, + { 0x2708, "dialogue_mudpumps" }, + { 0x270A, "dialogue_outro" }, + { 0x270C, "dialogue_queue_single" }, + { 0x270D, "dialogue_random_last_line" }, + { 0x2710, "dialogue_sat1" }, + { 0x2711, "dialogue_sat2" }, + { 0x2712, "dialogue_streets_to_dam" }, + { 0x2713, "dialogue_streets_to_dam_2" }, + { 0x2714, "dialogue_tanks" }, + { 0x2715, "dialoguenotetrack" }, + { 0x2716, "diaz_door_kick_sfx" }, + { 0x2717, "did_flares" }, + { 0x2718, "did_handsignal" }, + { 0x2719, "did_inactive_vo" }, + { 0x271B, "diddamagestate" }, + { 0x271C, "didpastmeleefail" }, + { 0x271D, "didpastpursuitfail" }, + { 0x271F, "didsomethingotherthanshooting" }, + { 0x2722, "die_and_ragdoll" }, + { 0x2723, "die_from_explosion" }, + { 0x2724, "die_hard_explosion_fx" }, + { 0x2725, "die_quietly" }, + { 0x2727, "died_of_headshot" }, + { 0x2728, "diehardmode" }, + { 0x272A, "dieingrevival_vo" }, + { 0x272F, "difficultystring" }, + { 0x2730, "difficultytype" }, + { 0x2731, "diffusefraction_ng" }, + { 0x2734, "digitalflash" }, + { 0x2737, "diraimlimit" }, + { 0x2738, "direct_chopper_crate_anim" }, + { 0x2739, "direction" }, + { 0x273A, "direction_change_smoothing" }, + { 0x273E, "dirt_on_screen_from_position" }, + { 0x2742, "disable_achievement_harder_they_fall_guy" }, + { 0x2746, "disable_all_triggers" }, + { 0x2749, "disable_arrivals" }, + { 0x274A, "disable_arrivals_and_exits" }, + { 0x274D, "disable_blindfire" }, + { 0x274F, "disable_breathing_sound" }, + { 0x2750, "disable_bulletwhizbyreaction" }, + { 0x2751, "disable_careful" }, + { 0x2752, "disable_checkpoint_patrol" }, + { 0x2754, "disable_control" }, + { 0x2755, "disable_cqb_points_of_interest" }, + { 0x2756, "disable_cqbwalk" }, + { 0x2757, "disable_damagefeedback" }, + { 0x2758, "disable_danger_react" }, + { 0x275A, "disable_demigod" }, + { 0x275D, "disable_dog_control" }, + { 0x275F, "disable_dog_sneak" }, + { 0x2760, "disable_dog_sniff" }, + { 0x2761, "disable_dog_walk" }, + { 0x2763, "disable_dontevershoot" }, + { 0x2764, "disable_dynamic_run_speed" }, + { 0x2765, "disable_exits" }, + { 0x2767, "disable_flinch" }, + { 0x2768, "disable_fx_on_death" }, + { 0x2769, "disable_gun_recall" }, + { 0x276A, "disable_health_regen_shield" }, + { 0x276B, "disable_heat_behavior" }, + { 0x276C, "disable_hudoutline_on_death" }, + { 0x276D, "disable_ignorerandombulletdamage_drone" }, + { 0x276F, "disable_killcam" }, + { 0x2772, "disable_militia_behavior" }, + { 0x2773, "disable_nodes_before_allies_move" }, + { 0x2775, "disable_oneshotfx_with_noteworthy" }, + { 0x2777, "disable_pain" }, + { 0x2779, "disable_player_swim" }, + { 0x277A, "disable_readystand" }, + { 0x277D, "disable_sniper_outline" }, + { 0x2782, "disable_sprint" }, + { 0x2783, "disable_stealth" }, + { 0x2787, "disable_strikezone_rog" }, + { 0x2789, "disable_swim" }, + { 0x278A, "disable_target_on_death" }, + { 0x278C, "disable_teamflashbangimmunity" }, + { 0x278E, "disable_tired" }, + { 0x278F, "disable_torpedo_ui" }, + { 0x2790, "disable_trigger" }, + { 0x2791, "disable_trigger_helper" }, + { 0x2792, "disable_trigger_with_noteworthy" }, + { 0x2794, "disable_turnanims" }, + { 0x2795, "disable_turns_arrivals_exits" }, + { 0x2799, "disableallstreaks" }, + { 0x279C, "disablebattlechatter" }, + { 0x279E, "disablebutton" }, + { 0x279F, "disableclientspawntraces" }, + { 0x27A0, "disablecollision" }, + { 0x27A1, "disablecoverarrivalsonly" }, + { 0x27A4, "disabled_use_for" }, + { 0x27A5, "disabledamageshieldpain" }, + { 0x27A6, "disabledefaultfacialanims" }, + { 0x27A7, "disabledoffhandweapons" }, + { 0x27AA, "disabledweapon" }, + { 0x27AF, "disablegeardrop" }, + { 0x27B0, "disablegrenadetracking" }, + { 0x27B3, "disablelongdeath" }, + { 0x27B6, "disablemovementtracker" }, + { 0x27B8, "disablepain" }, + { 0x27C0, "disablevehiclescripts" }, + { 0x27C2, "disablewhenjuggernaut" }, + { 0x27C3, "discardtime" }, + { 0x27C4, "disconnect_and_bad_place" }, + { 0x27C5, "disconnect_path_periodic" }, + { 0x27C6, "disconnect_paths" }, + { 0x27C8, "disconnect_paths_whenstopped" }, + { 0x27CD, "disconnecttraverses" }, + { 0x27D0, "discrete_waittill" }, + { 0x27D1, "disguise_head" }, + { 0x27D3, "disomount_hint" }, + { 0x27D5, "dispatch_activated_zone" }, + { 0x27D6, "dispatch_activated_zone_thread" }, + { 0x27D7, "dispatch_dog_think" }, + { 0x27D8, "dispatchnotify" }, + { 0x27D9, "displacement_uvscale" }, + { 0x27DC, "display_fx_add_options" }, + { 0x27DE, "display_hint" }, + { 0x27DF, "display_hint_stick" }, + { 0x27E0, "display_hint_stick_timeout" }, + { 0x27E1, "display_hint_stick_timeout_mintime" }, + { 0x27E2, "display_hint_timeout" }, + { 0x27E3, "display_hint_timeout_mintime" }, + { 0x27E4, "display_no_target" }, + { 0x27E8, "display_starts_pressed" }, + { 0x27ED, "displaybuddystatusmessage" }, + { 0x27EE, "displayed_hints" }, + { 0x27EF, "displaygameend" }, + { 0x27F0, "displayincomingairdropmessage" }, + { 0x27F2, "displayroundend" }, + { 0x27F4, "displaythreat" }, + { 0x27F5, "displaythrowmessage" }, + { 0x27FA, "dist_to_next_targ" }, + { 0x2800, "distance_from_next_volume_sq" }, + { 0x2804, "distances" }, + { 0x2805, "distfromplayer" }, + { 0x2808, "distorg" }, + { 0x2809, "distort_pct" }, + { 0x280C, "disttoline" }, + { 0x280D, "dlight_on_me" }, + { 0x2810, "dmg_bullet_chance_player_static" }, + { 0x2813, "dmg_player_health_adjust_chance" }, + { 0x2814, "dmg_player_speed_evade_max_pct" }, + { 0x2815, "dmg_player_speed_evade_min_pct" }, + { 0x2817, "dmg_rear_elevator" }, + { 0x2819, "do_bird_single" }, + { 0x281A, "do_bird_single_enemy" }, + { 0x281C, "do_bokeh" }, + { 0x281D, "do_bokehdot_volume" }, + { 0x281F, "do_charge_attack" }, + { 0x2820, "do_creak" }, + { 0x2821, "do_damage_over_time" }, + { 0x2823, "do_decal_square" }, + { 0x2824, "do_dud_damage" }, + { 0x2825, "do_earthquake" }, + { 0x2826, "do_elias_head_look" }, + { 0x2829, "do_exit_wait_on_movement" }, + { 0x282C, "do_funcs" }, + { 0x282D, "do_fx_plane_break" }, + { 0x282E, "do_goto_trace" }, + { 0x282F, "do_ground_slam" }, + { 0x2831, "do_hand_wheeling_anim" }, + { 0x2832, "do_heavy_delete_wait" }, + { 0x2835, "do_knife_throw_blood" }, + { 0x2837, "do_multiple_treads" }, + { 0x2838, "do_nag_dialog" }, + { 0x283B, "do_no_game_start_teleport" }, + { 0x283E, "do_nothing" }, + { 0x283F, "do_physics_pulse" }, + { 0x2841, "do_rag_death" }, + { 0x2842, "do_ramp_light" }, + { 0x2844, "do_random_pilot_chatter" }, + { 0x2845, "do_rope_animation" }, + { 0x2846, "do_rubble" }, + { 0x2849, "do_single_tread" }, + { 0x284A, "do_spacejump_debris" }, + { 0x284B, "do_specular_sun_lerp" }, + { 0x284E, "do_tarps" }, + { 0x2850, "do_unique_debris" }, + { 0x2853, "do_wait_endons_array" }, + { 0x2856, "doaim" }, + { 0x2859, "doairstrikeflyby" }, + { 0x285B, "dobj_manager" }, + { 0x285C, "doblinkinglight" }, + { 0x285D, "dobomberstrike" }, + { 0x285F, "dobuilddot_wait" }, + { 0x2862, "docustomidle" }, + { 0x2863, "dodeathfromarray" }, + { 0x2864, "dodge_dir" }, + { 0x2865, "dodge_distance" }, + { 0x2869, "dodgemoveloopoverride" }, + { 0x286B, "dodgerightanimoffset" }, + { 0x286E, "dodot_delayfunc" }, + { 0x286F, "dodot_fadeinblackout" }, + { 0x2874, "dodrivenidle" }, + { 0x2875, "dodropff" }, + { 0x2876, "doempartifactloop" }, + { 0x2878, "doexposedcalloutresponse" }, + { 0x287C, "dof_blend_interior_ads" }, + { 0x287D, "dof_blend_interior_ads_element" }, + { 0x287E, "dof_blend_interior_ads_scalar" }, + { 0x287F, "dof_blend_interior_generic" }, + { 0x2882, "dof_disable_ads" }, + { 0x2884, "dof_enable_ads" }, + { 0x2885, "dof_enable_script" }, + { 0x2887, "dof_outro_pt2" }, + { 0x2888, "dof_process_ads" }, + { 0x288B, "dof_ref_ent" }, + { 0x288D, "dof_set_generic" }, + { 0x2890, "dof_underwater_general" }, + { 0x2892, "dofacialdialogue" }, + { 0x2894, "dofinalkillcamfx" }, + { 0x2895, "dofiring" }, + { 0x2897, "dofriendlyfirereaction" }, + { 0x2899, "dog_active_touch_zones" }, + { 0x289B, "dog_additional_drivein_anims" }, + { 0x28A1, "dog_animation_generic" }, + { 0x28A3, "dog_animation_sawcorpse" }, + { 0x28A5, "dog_animation_wakeup_slow" }, + { 0x28A9, "dog_attack_alt_func" }, + { 0x28AA, "dog_attack_back_enemies_logic" }, + { 0x28AB, "dog_attack_command_internal" }, + { 0x28AC, "dog_attack_damage_tracking" }, + { 0x28B2, "dog_attack_guy" }, + { 0x28B4, "dog_attack_range" }, + { 0x28B5, "dog_attack_slowmo" }, + { 0x28B7, "dog_attack_tunnel_sniper" }, + { 0x28B8, "dog_attack_victim_logic" }, + { 0x28B9, "dog_attacking_me" }, + { 0x28BB, "dog_bark" }, + { 0x28BD, "dog_bark_think" }, + { 0x28BF, "dog_cam_fov_default" }, + { 0x28C1, "dog_command_attack" }, + { 0x28C7, "dog_death_quote" }, + { 0x28CB, "dog_delayed_allow_damage" }, + { 0x28CC, "dog_delayed_unlink" }, + { 0x28CD, "dog_disable_ai_color" }, + { 0x28CE, "dog_downed_player" }, + { 0x28CF, "dog_drag_to_cover" }, + { 0x28D0, "dog_drive_animscript" }, + { 0x28D4, "dog_enemy_laststand_check" }, + { 0x28D5, "dog_exits_jeep" }, + { 0x28D9, "dog_force_talk" }, + { 0x28DB, "dog_friendly_spotted" }, + { 0x28DC, "dog_gasstation_logic" }, + { 0x28DF, "dog_goto_veh_and_enter" }, + { 0x28E3, "dog_health" }, + { 0x28E4, "dog_hint" }, + { 0x28E5, "dog_hint_check" }, + { 0x28E7, "dog_hits_before_kill" }, + { 0x28E8, "dog_hud_active" }, + { 0x28EA, "dog_hunt2_delete" }, + { 0x28EB, "dog_hunt_spotted" }, + { 0x28EC, "dog_in_exfil_jeep" }, + { 0x28EE, "dog_intro" }, + { 0x28EF, "dog_is_in_combat" }, + { 0x28F0, "dog_jump_down" }, + { 0x28F1, "dog_jump_guy" }, + { 0x28F5, "dog_jumpup_wait" }, + { 0x28F6, "dog_kills_roof_guy" }, + { 0x28F8, "dog_link" }, + { 0x28F9, "dog_lock_check" }, + { 0x28FA, "dog_lock_flag" }, + { 0x28FB, "dog_logic" }, + { 0x28FC, "dog_long_jump" }, + { 0x28FE, "dog_manage_damage" }, + { 0x28FF, "dog_marker" }, + { 0x2901, "dog_melee_index" }, + { 0x2902, "dog_melee_timing_array" }, + { 0x2904, "dog_navigation_logic" }, + { 0x2905, "dog_neck_snapped" }, + { 0x2906, "dog_node_wait" }, + { 0x2909, "dog_pant" }, + { 0x290A, "dog_pant_think" }, + { 0x2911, "dog_return_to_sender" }, + { 0x2912, "dog_reunite" }, + { 0x2916, "dog_run_earthquakes" }, + { 0x2917, "dog_scratch_and_path" }, + { 0x291B, "dog_setup" }, + { 0x291C, "dog_sniff_spots" }, + { 0x291F, "dog_sprint_disable" }, + { 0x2921, "dog_stealth" }, + { 0x2922, "dog_stealth_visibility" }, + { 0x2923, "dog_swap_enemy" }, + { 0x2924, "dog_tag_origin" }, + { 0x2927, "dog_traverse_kill" }, + { 0x292A, "dog_victim_death_internal" }, + { 0x292B, "dog_victim_enemy_early_damage_detection" }, + { 0x292E, "dog_wait_anim_finished" }, + { 0x2930, "dog_walk" }, + { 0x2931, "dog_walk_for_time" }, + { 0x2936, "dogattackaidist" }, + { 0x2939, "dogattackradius" }, + { 0x293B, "dogdamagedradiussq" }, + { 0x293C, "doghintelem" }, + { 0x293D, "doginited" }, + { 0x293E, "doglookpose" }, + { 0x2942, "dognextidletwitchtime" }, + { 0x2945, "dogs" }, + { 0x2948, "dogsinitialized" }, + { 0x2949, "dogstartmovedist" }, + { 0x294B, "dogstoppingdistsq" }, + { 0x294C, "dogtag" }, + { 0x294D, "dogtags" }, + { 0x2951, "dogturnadjust" }, + { 0x2955, "doimmediateragdolldeath" }, + { 0x2957, "doing_hand_signal" }, + { 0x2958, "doing_in_space_rotation" }, + { 0x295A, "doing_start_anim" }, + { 0x295B, "doingadditivepain" }, + { 0x295C, "doingdamagestate" }, + { 0x295E, "doinglongdeath" }, + { 0x295F, "doingreacquirestep" }, + { 0x2960, "doingsplash" }, + { 0x2961, "dointrovignetteanim" }, + { 0x2963, "dolastminuteexposedapproach" }, + { 0x2964, "dolastminuteexposedapproachwrapper" }, + { 0x2965, "dolbstrike" }, + { 0x2967, "dolerp" }, + { 0x296B, "dom" }, + { 0x296D, "domarkingflash" }, + { 0x296E, "domegac130flyby" }, + { 0x2971, "domeleevsai" }, + { 0x2972, "domeleevsai_simple" }, + { 0x2974, "domeleevsai_simple_animcustom_cleanup" }, + { 0x2975, "domeleevsdog" }, + { 0x2979, "dominator_earthquake" }, + { 0x297B, "domissioncallback" }, + { 0x297C, "domortar" }, + { 0x297D, "dompointa" }, + { 0x297F, "dompointc" }, + { 0x2980, "dompointnumber" }, + { 0x2984, "donodeexitanimation" }, + { 0x2985, "dononattackcoverbehavior" }, + { 0x2987, "donotetracksforever" }, + { 0x298A, "donotetracksforpopup" }, + { 0x298B, "donotetracksfortime" }, + { 0x2991, "donotetrackspostcallback" }, + { 0x2993, "donotetrackswithendon" }, + { 0x2994, "donotetrackswithtimeout" }, + { 0x2995, "donothingfunc" }, + { 0x2996, "dont_allow_ammo_cache" }, + { 0x2998, "dont_auto_ride" }, + { 0x2999, "dont_crush_player" }, + { 0x299B, "dont_delete_mines_on_next_spawn" }, + { 0x299E, "dont_unlink_after_breach" }, + { 0x29A0, "dontallowexplode" }, + { 0x29A2, "dontchangemoveplaybackrate" }, + { 0x29A3, "dontchangepushplayer" }, + { 0x29A4, "dontcolormove" }, + { 0x29A5, "dontcrouchtime" }, + { 0x29A7, "dontdonotetracks" }, + { 0x29A8, "dontdrawoncompass" }, + { 0x29A9, "dontdropweapon" }, + { 0x29AD, "dontgetonpath" }, + { 0x29B0, "dontshoot" }, + { 0x29B2, "dontshootwhilemoving" }, + { 0x29B3, "dontunloadondeath" }, + { 0x29B4, "dontunloadonend" }, + { 0x29B7, "donuke_fx" }, + { 0x29B8, "donuke_fx_strikezone" }, + { 0x29B9, "donukesimple" }, + { 0x29BA, "dooneflyby" }, + { 0x29BB, "door" }, + { 0x29BC, "door_break_foley" }, + { 0x29BD, "door_burst_splashes" }, + { 0x29BF, "door_close" }, + { 0x29C0, "door_close_behind" }, + { 0x29C3, "door_current_x" }, + { 0x29C4, "door_debris_l" }, + { 0x29C7, "door_fall_over" }, + { 0x29C8, "door_in" }, + { 0x29CB, "door_knockback" }, + { 0x29CC, "door_knockdown" }, + { 0x29CD, "door_l_modelswap" }, + { 0x29CE, "door_name" }, + { 0x29D2, "door_out" }, + { 0x29D3, "door_parse_parameters" }, + { 0x29D4, "door_play_sounds" }, + { 0x29D9, "door_state_exit" }, + { 0x29DD, "door_state_update_sound" }, + { 0x29DE, "door_switch_icon" }, + { 0x29E2, "door_switch_icon_fade_out" }, + { 0x29E7, "door_traversal" }, + { 0x29E8, "door_traversal_move" }, + { 0x29E9, "door_volume" }, + { 0x29EA, "doorangle" }, + { 0x29EB, "doorclose" }, + { 0x29EE, "doorenter_enable_cqbwalk" }, + { 0x29F1, "doorexit" }, + { 0x29F4, "doorfragchance" }, + { 0x29F6, "doormovetime" }, + { 0x29FB, "doors_open_flicker" }, + { 0x29FC, "doors_swingopen" }, + { 0x29FD, "doorspeed" }, + { 0x29FF, "doortype" }, + { 0x2A00, "doospreyinsertion" }, + { 0x2A01, "dopain" }, + { 0x2A02, "dopainfromarray" }, + { 0x2A03, "dopavelow" }, + { 0x2A08, "doreload" }, + { 0x2A0C, "doshoot" }, + { 0x2A10, "dosounddistant" }, + { 0x2A11, "dospacetraverse" }, + { 0x2A15, "dostrike" }, + { 0x2A16, "dostumble" }, + { 0x2A1A, "dot_player" }, + { 0x2A1C, "dot_to_apache_player_facing_2d_inverse" }, + { 0x2A20, "dotraverse_custom" }, + { 0x2A23, "doturnnotetracks" }, + { 0x2A24, "doturretearthquake" }, + { 0x2A25, "dotypelimit" }, + { 0x2A2A, "doubletapcount" }, + { 0x2A2B, "doubletapthink" }, + { 0x2A2D, "dowalkanimoverride" }, + { 0x2A2F, "down_leg_move_percent" }, + { 0x2A31, "down_part2_proc_ran" }, + { 0x2A32, "down_velocity" }, + { 0x2A35, "downed_enemy_monitor" }, + { 0x2A37, "download_time" }, + { 0x2A38, "download_timer" }, + { 0x2A39, "dpad_icon" }, + { 0x2A3A, "dpad_icon_col" }, + { 0x2A3E, "drag_hints" }, + { 0x2A3F, "drag_interrogate_scene" }, + { 0x2A41, "drag_metal_detector" }, + { 0x2A44, "drag_player_arms" }, + { 0x2A45, "drag_sounds" }, + { 0x2A48, "draw_arrow" }, + { 0x2A49, "draw_arrow_time" }, + { 0x2A4B, "draw_bike_debug" }, + { 0x2A4C, "draw_boundry_sphere" }, + { 0x2A50, "draw_col_vol_offset" }, + { 0x2A51, "draw_color_friendlies" }, + { 0x2A52, "draw_colored_nodes" }, + { 0x2A53, "draw_colornodes" }, + { 0x2A55, "draw_cut_hint" }, + { 0x2A59, "draw_effects_list" }, + { 0x2A5A, "draw_entity_bounds" }, + { 0x2A5D, "draw_line_from_ent_for_time" }, + { 0x2A5E, "draw_line_from_ent_to_ent_for_time" }, + { 0x2A5F, "draw_line_from_ent_to_ent_until_notify" }, + { 0x2A61, "draw_line_to_ent_for_time" }, + { 0x2A62, "draw_line_until_notify" }, + { 0x2A63, "draw_model_path" }, + { 0x2A64, "draw_move_path" }, + { 0x2A66, "draw_path" }, + { 0x2A69, "draw_radial_buttons" }, + { 0x2A6B, "draw_trigger" }, + { 0x2A6D, "draw_turret_target_line" }, + { 0x2A6E, "draw_volume" }, + { 0x2A71, "drawarrow" }, + { 0x2A72, "drawarrowforever" }, + { 0x2A75, "drawchopperattackarrow" }, + { 0x2A77, "drawcircleuntilnotify" }, + { 0x2A7A, "drawenttag" }, + { 0x2A7B, "drawforwardforever" }, + { 0x2A7C, "drawfriend" }, + { 0x2A7D, "drawgraph" }, + { 0x2A80, "drawminimapbounds" }, + { 0x2A81, "drawmyoff" }, + { 0x2A83, "drawoffset" }, + { 0x2A84, "draworgforever" }, + { 0x2A85, "draworiginforever" }, + { 0x2A86, "drawpath" }, + { 0x2A87, "drawplayerviewforever" }, + { 0x2A88, "drawsphere" }, + { 0x2A89, "drawstring" }, + { 0x2A8B, "drawtag" }, + { 0x2A8C, "drawtagforever" }, + { 0x2A91, "drift_hit" }, + { 0x2A93, "driftspeed" }, + { 0x2A94, "drill" }, + { 0x2A95, "drill_bink" }, + { 0x2A96, "drill_carrier" }, + { 0x2A98, "drill_detonate_bbprint" }, + { 0x2A99, "drill_fail_animation" }, + { 0x2A9A, "drill_generic_bbprint" }, + { 0x2A9B, "drill_health_hardcore" }, + { 0x2A9C, "drill_health_scalar" }, + { 0x2A9D, "drill_icon" }, + { 0x2AA0, "drill_locs" }, + { 0x2AA2, "drill_monitor" }, + { 0x2AA3, "drill_nag" }, + { 0x2AAA, "drill_plant" }, + { 0x2AAC, "drill_progress_fx" }, + { 0x2AAF, "drill_reset_bbprint" }, + { 0x2AB0, "drill_reset_pos" }, + { 0x2AB1, "drill_sfx_dist_lp" }, + { 0x2AB2, "drill_sfx_lp" }, + { 0x2AB4, "drill_sfx_offline_lp" }, + { 0x2AB5, "drill_sfx_overheat_lp" }, + { 0x2AB7, "drill_synch_attack_play_anim" }, + { 0x2AB9, "drill_think" }, + { 0x2ABA, "drill_threat_think" }, + { 0x2ABB, "drill_time_scalar" }, + { 0x2ABC, "drill_tutorial_given" }, + { 0x2AC2, "drillthrough_plate_sound" }, + { 0x2AC3, "drip_already_played" }, + { 0x2AC7, "drip_on_player_choose_location" }, + { 0x2AC8, "drive_in_vo" }, + { 0x2ACA, "drivenanimupdate" }, + { 0x2ACD, "driver_dies" }, + { 0x2ACF, "driver_shooting" }, + { 0x2AD0, "driverdead" }, + { 0x2AD1, "drivingvehicle" }, + { 0x2AD2, "drone_animate_on_path" }, + { 0x2AD3, "drone_anims" }, + { 0x2AD4, "drone_array_handling" }, + { 0x2AD7, "drone_civs_init" }, + { 0x2ADA, "drone_death_handler" }, + { 0x2ADD, "drone_die" }, + { 0x2AE0, "drone_fight" }, + { 0x2AE2, "drone_fire_fake_javelin_loop" }, + { 0x2AE5, "drone_frontline_respawner" }, + { 0x2AE7, "drone_give_soul" }, + { 0x2AE8, "drone_gun_remove" }, + { 0x2AE9, "drone_idle" }, + { 0x2AEA, "drone_idle_custom" }, + { 0x2AEE, "drone_init_path" }, + { 0x2AF1, "drone_look_ahead_point" }, + { 0x2AF2, "drone_lookahead_value" }, + { 0x2AF3, "drone_loop_custom" }, + { 0x2AF6, "drone_move_callback" }, + { 0x2AF9, "drone_move_z" }, + { 0x2AFB, "drone_play_anim" }, + { 0x2AFC, "drone_play_looping_anim" }, + { 0x2AFD, "drone_play_scripted_anim" }, + { 0x2AFE, "drone_play_weapon_sound" }, + { 0x2B00, "drone_respawner" }, + { 0x2B02, "drone_runanim" }, + { 0x2B04, "drone_set_runanim" }, + { 0x2B05, "drone_setname" }, + { 0x2B06, "drone_shoot" }, + { 0x2B08, "drone_shoot_rpg" }, + { 0x2B0A, "drone_spawn" }, + { 0x2B0E, "drone_targets" }, + { 0x2B0F, "drone_thermal_draw_disable" }, + { 0x2B10, "drone_traverse_check" }, + { 0x2B1A, "dronemissilespawnarray" }, + { 0x2B1B, "dronepathstarts" }, + { 0x2B1D, "dronerowend" }, + { 0x2B1E, "dronerows" }, + { 0x2B1F, "dronerowsamount" }, + { 0x2B21, "dronerunoffset" }, + { 0x2B23, "drones_crew" }, + { 0x2B24, "drones_death_watcher" }, + { 0x2B27, "drones_request_queue" }, + { 0x2B28, "drones_request_think" }, + { 0x2B29, "drones_targets_sets_to_default" }, + { 0x2B2D, "dronespawner_init" }, + { 0x2B2E, "dronesthermalteamselect" }, + { 0x2B2F, "dronestruct" }, + { 0x2B31, "drop_and_angle_to_ground" }, + { 0x2B32, "drop_ascender" }, + { 0x2B35, "drop_drill" }, + { 0x2B37, "drop_drill_on_disconnect" }, + { 0x2B3B, "drop_geiger_counter" }, + { 0x2B3C, "drop_grenade_bag" }, + { 0x2B3E, "drop_health_timeout_thread" }, + { 0x2B41, "drop_loc" }, + { 0x2B43, "drop_path_to_ground" }, + { 0x2B44, "drop_pillage_item_on_ground" }, + { 0x2B45, "drop_selection_to_ground" }, + { 0x2B46, "drop_to_ground" }, + { 0x2B47, "drop_turret" }, + { 0x2B4A, "dropanim" }, + { 0x2B4B, "dropbombs" }, + { 0x2B4D, "dropcrateexistence" }, + { 0x2B4F, "dropimpulse" }, + { 0x2B51, "dropnuke" }, + { 0x2B52, "dropoff_height" }, + { 0x2B53, "droponebomb" }, + { 0x2B54, "dropparachutebomb" }, + { 0x2B55, "droppeddeathweapon" }, + { 0x2B57, "droppedlinez" }, + { 0x2B58, "droppedoff" }, + { 0x2B5A, "droppingoff" }, + { 0x2B5B, "droppingtoground" }, + { 0x2B5C, "droppostoground" }, + { 0x2B5D, "dropscavengerfordeath" }, + { 0x2B60, "droptimeout" }, + { 0x2B61, "dropturret" }, + { 0x2B63, "droptype" }, + { 0x2B64, "dropweaponfordeath" }, + { 0x2B65, "dropweaponfordeathhorde" }, + { 0x2B68, "drown_choke" }, + { 0x2B6A, "drown_die" }, + { 0x2B6B, "drown_heartbeat" }, + { 0x2B6C, "drown_max_alpha" }, + { 0x2B6D, "drowning_dialogue" }, + { 0x2B6F, "drowning_hudfx" }, + { 0x2B71, "drs_ahead_test" }, + { 0x2B72, "ds_vo_timer" }, + { 0x2B73, "ds_vo_timer_left" }, + { 0x2B74, "ds_vo_timer_right" }, + { 0x2B75, "dshk_death_anim" }, + { 0x2B78, "dsq_2d_ents_lt" }, + { 0x2B7C, "dual_firing" }, + { 0x2B7D, "dual_waittill" }, + { 0x2B7E, "duck_once" }, + { 0x2B7F, "duckidle" }, + { 0x2B80, "duckidleoccurrence" }, + { 0x2B81, "duckin" }, + { 0x2B83, "duckout" }, + { 0x2B84, "dude_kicks_in_the_door" }, + { 0x2B85, "dude_kicks_in_the_door_setup" }, + { 0x2B86, "dudes_in_place_breach" }, + { 0x2B87, "dudes_in_place_cover" }, + { 0x2B88, "duffle_bag_anims" }, + { 0x2B89, "dumb_tank_shoot" }, + { 0x2B8A, "dummy_ent" }, + { 0x2B8D, "dummy_to_vehicle" }, + { 0x2B8F, "dummyspeed" }, + { 0x2B91, "dump_missing_anims" }, + { 0x2B92, "dumpit" }, + { 0x2B93, "dupe_hud" }, + { 0x2B96, "dusteffect" }, + { 0x2B97, "dvar" }, + { 0x2B9B, "dyingcrawlaiming" }, + { 0x2B9C, "dyingcrawlbackaim" }, + { 0x2B9D, "dyingcrawlbloodsmear" }, + { 0x2B9E, "dyn_balloon_bob" }, + { 0x2B9F, "dyn_balloon_delete" }, + { 0x2BA4, "dyn_sniff_disable" }, + { 0x2BA6, "dyn_speed" }, + { 0x2BA8, "dyn_swimspeed_enable" }, + { 0x2BAC, "dynamic_player_crash" }, + { 0x2BAD, "dynamic_repulsor" }, + { 0x2BB3, "dynamic_sun_sample_size" }, + { 0x2BB4, "dynamicspawns" }, + { 0x2BB9, "dz_osprey_missiles" }, + { 0x2BBA, "e" }, + { 0x2BBB, "e3_demo" }, + { 0x2BBC, "e3_fadein" }, + { 0x2BBD, "e3_fadeout" }, + { 0x2BBE, "e3_section" }, + { 0x2BBF, "e3_section_start" }, + { 0x2BC0, "e3_start" }, + { 0x2BC6, "early_level" }, + { 0x2BC7, "early_prompt" }, + { 0x2BC8, "early_weapon_enabled" }, + { 0x2BC9, "earlyabortwatcher" }, + { 0x2BCB, "earned_dialog_col" }, + { 0x2BCC, "earned_hint_col" }, + { 0x2BCD, "earnedstreaklevel" }, + { 0x2BCE, "earnkillstreak" }, + { 0x2BD0, "earth_model" }, + { 0x2BD1, "earth_origin_start" }, + { 0x2BD3, "earthqauke_wait" }, + { 0x2BD4, "earthquake" }, + { 0x2BD5, "earthquake_destructibles_monitor" }, + { 0x2BD7, "earthquake_max" }, + { 0x2BD9, "earthquake_on_death" }, + { 0x2BDA, "earthquake_on_death_missile" }, + { 0x2BDB, "earthquake_player" }, + { 0x2BDD, "earthquake_strength" }, + { 0x2BDE, "earthquake_trigger" }, + { 0x2BE3, "ebreachmodel" }, + { 0x2BE4, "edge_lean_natural" }, + { 0x2BE7, "edgetiles" }, + { 0x2BEB, "effect_id" }, + { 0x2BEF, "effect_monitors" }, + { 0x2BF0, "effect_soundalias" }, + { 0x2BF1, "effectcheckfrequency" }, + { 0x2BF3, "effectheight" }, + { 0x2BF4, "effectlifespan" }, + { 0x2BF5, "effectmaxdelay" }, + { 0x2BF7, "effectradius" }, + { 0x2BFB, "ehq_intro_flag_wait_all" }, + { 0x2BFC, "ehq_znear_default" }, + { 0x2BFD, "einflictor" }, + { 0x2BFE, "either_player_looking_at" }, + { 0x2BFF, "ejected" }, + { 0x2C00, "ele_enemy1" }, + { 0x2C03, "electric_fences" }, + { 0x2C06, "elem" }, + { 0x2C0A, "elevated_circling_retreat" }, + { 0x2C0B, "elevated_delay_retreat" }, + { 0x2C0D, "elevator_105" }, + { 0x2C0F, "elevator_ac130_dmg" }, + { 0x2C11, "elevator_accel" }, + { 0x2C13, "elevator_anims" }, + { 0x2C14, "elevator_call" }, + { 0x2C15, "elevator_callbutton_link_h" }, + { 0x2C18, "elevator_debug" }, + { 0x2C1C, "elevator_door_open" }, + { 0x2C1E, "elevator_floor_update" }, + { 0x2C25, "elevator_interrupt" }, + { 0x2C27, "elevator_lean_over" }, + { 0x2C29, "elevator_move" }, + { 0x2C2A, "elevator_movement" }, + { 0x2C2C, "elevator_outterdoorspeed" }, + { 0x2C2D, "elevator_return" }, + { 0x2C2E, "elevator_room_combat" }, + { 0x2C31, "elevator_room_left_flank" }, + { 0x2C33, "elevator_sound_think" }, + { 0x2C35, "elevator_think" }, + { 0x2C36, "elevator_update_global_dvars" }, + { 0x2C39, "elevator_zoom" }, + { 0x2C3A, "elevatorblockpath" }, + { 0x2C3B, "elevatorclearpath" }, + { 0x2C3C, "elevatordoorsautoclose" }, + { 0x2C3D, "elevatormovetofloor" }, + { 0x2C3E, "elevators" }, + { 0x2C40, "elias" }, + { 0x2C41, "elias_house_attack" }, + { 0x2C42, "elias_house_attack_dialogue" }, + { 0x2C45, "elias_house_attack_grab_sound" }, + { 0x2C46, "elias_house_attack_hesh_shot" }, + { 0x2C47, "elias_house_attack_hit_ground" }, + { 0x2C48, "elias_house_attack_knife_anim_logic" }, + { 0x2C4A, "elias_house_attack_knife_fail_killplayer" }, + { 0x2C4C, "elias_house_attack_knife_hint" }, + { 0x2C4D, "elias_house_attack_knife_hint_logic" }, + { 0x2C4F, "elias_house_attack_knife_think" }, + { 0x2C50, "elias_house_attack_knife_vision" }, + { 0x2C53, "elias_house_attack_wall" }, + { 0x2C55, "elias_house_attacker_breath_knife" }, + { 0x2C56, "elias_house_attacker_breath_sequence" }, + { 0x2C5C, "elias_house_lift_rubble_scene" }, + { 0x2C5D, "elias_house_sequence" }, + { 0x2C5E, "elias_house_window_explosion" }, + { 0x2C5F, "elias_line" }, + { 0x2C60, "elias_logic" }, + { 0x2C62, "elias_start" }, + { 0x2C63, "elias_street_advancing_drones" }, + { 0x2C65, "elias_street_artemis" }, + { 0x2C69, "elias_street_flee_guys" }, + { 0x2C6A, "elias_street_flee_guys_enemies" }, + { 0x2C6C, "elias_street_helicopter_flyover" }, + { 0x2C6D, "elias_street_helicopter_spawn" }, + { 0x2C71, "elite_angered" }, + { 0x2C72, "elite_approach" }, + { 0x2C75, "elite_monitor" }, + { 0x2C78, "emerge_node" }, + { 0x2C79, "emitfalldamage" }, + { 0x2C7A, "emp_jamplayers" }, + { 0x2C7E, "emp_teamtracker" }, + { 0x2C7F, "emp_use" }, + { 0x2C80, "empcandamage" }, + { 0x2C82, "empeffects" }, + { 0x2C84, "empgrenaded" }, + { 0x2C89, "emprumbleloop" }, + { 0x2C8A, "emptimeout" }, + { 0x2C8B, "emptimeremaining" }, + { 0x2C8C, "empty_func" }, + { 0x2C8D, "empty_init_func" }, + { 0x2C8E, "empty_kill_func" }, + { 0x2C8F, "empty_spawner" }, + { 0x2C91, "empty_suit_animation" }, + { 0x2C94, "enable_achievement_harder_they_fall" }, + { 0x2CA0, "enable_blood_pool" }, + { 0x2CA1, "enable_bulletwhizbyreaction" }, + { 0x2CA2, "enable_careful" }, + { 0x2CA3, "enable_cqbwalk" }, + { 0x2CA6, "enable_danger_react" }, + { 0x2CAB, "enable_dog_sniff" }, + { 0x2CAC, "enable_dog_walk" }, + { 0x2CAF, "enable_elias_walk" }, + { 0x2CB4, "enable_global_vehicle_spawn_functions" }, + { 0x2CB7, "enable_hesh_walk" }, + { 0x2CB8, "enable_ignorerandombulletdamage_drone" }, + { 0x2CBB, "enable_limp" }, + { 0x2CC2, "enable_player_space" }, + { 0x2CC3, "enable_player_swim" }, + { 0x2CC6, "enable_space" }, + { 0x2CC8, "enable_spline_path_think" }, + { 0x2CC9, "enable_sprint" }, + { 0x2CCB, "enable_stealth_smart_stance" }, + { 0x2CCC, "enable_stealth_system" }, + { 0x2CCE, "enable_surprise" }, + { 0x2CD0, "enable_team_color" }, + { 0x2CD1, "enable_teamflashbangimmunity" }, + { 0x2CD2, "enable_teamflashbangimmunity_proc" }, + { 0x2CD3, "enable_tired" }, + { 0x2CD7, "enable_trigger_with_noteworthy" }, + { 0x2CD8, "enable_trigger_with_targetname" }, + { 0x2CD9, "enable_turnanims" }, + { 0x2CDA, "enable_turns_arrivals_exits" }, + { 0x2CDE, "enable_weapons" }, + { 0x2CDF, "enableairdropoutlineai" }, + { 0x2CE4, "enableextendedkill" }, + { 0x2CE6, "enablejammedeffect" }, + { 0x2CE7, "enablejuggernaut" }, + { 0x2CE9, "enablelaststandweapons" }, + { 0x2CEB, "enableplayerweapons" }, + { 0x2CED, "enablesomecontrol" }, + { 0x2CEF, "enablestop" }, + { 0x2CF0, "enableteamintel" }, + { 0x2CF1, "enableweaponlaser" }, + { 0x2CF2, "encoderatio" }, + { 0x2CF6, "end" }, + { 0x2CF7, "end_aim_idle_thread" }, + { 0x2CF9, "end_anim_then_loop" }, + { 0x2CFB, "end_birds" }, + { 0x2CFD, "end_breach_enemies_killed" }, + { 0x2CFE, "end_breach_enemy_spawn_single" }, + { 0x2CFF, "end_breach_engines_sieze" }, + { 0x2D02, "end_breach_impulse_player_logic" }, + { 0x2D03, "end_breach_impulse_player_single" }, + { 0x2D05, "end_breach_player_death_rpg" }, + { 0x2D06, "end_breach_player_unlink" }, + { 0x2D07, "end_breach_rpg_explosion" }, + { 0x2D0A, "end_breach_rpg_guy_fire" }, + { 0x2D0E, "end_color" }, + { 0x2D14, "end_dialogue" }, + { 0x2D15, "end_enemies" }, + { 0x2D16, "end_fade" }, + { 0x2D17, "end_fardist" }, + { 0x2D18, "end_fire_and_anim_idle_thread" }, + { 0x2D19, "end_game_score" }, + { 0x2D1A, "end_game_string_index" }, + { 0x2D1B, "end_game_string_override" }, + { 0x2D1D, "end_hdrsuncolorintensity" }, + { 0x2D1E, "end_heli_2_think" }, + { 0x2D1F, "end_heli_treadfx" }, + { 0x2D23, "end_legs_jump_anim" }, + { 0x2D24, "end_level" }, + { 0x2D27, "end_mantle_angle" }, + { 0x2D2A, "end_neardist" }, + { 0x2D2B, "end_nodes" }, + { 0x2D2E, "end_notifies" }, + { 0x2D30, "end_of_scripting" }, + { 0x2D31, "end_opacity" }, + { 0x2D32, "end_org" }, + { 0x2D34, "end_script" }, + { 0x2D35, "end_script_corner" }, + { 0x2D36, "end_skyfogintensity" }, + { 0x2D3A, "end_slide_effects" }, + { 0x2D3B, "end_sunbeginfadeangle" }, + { 0x2D3C, "end_suncolor" }, + { 0x2D3D, "end_sundir" }, + { 0x2D3E, "end_sunendfadeangle" }, + { 0x2D3F, "end_sunfogscale" }, + { 0x2D40, "end_surface" }, + { 0x2D41, "end_swim_anim_node" }, + { 0x2D43, "end_swim_logic" }, + { 0x2D44, "end_thread" }, + { 0x2D46, "end_to_start_length" }, + { 0x2D47, "end_tunnel_swim" }, + { 0x2D48, "end_turret_reservation" }, + { 0x2D4E, "endcustomevent" }, + { 0x2D4F, "endedkillcamcleanup" }, + { 0x2D54, "endgame" }, + { 0x2D5A, "endgameontimelimit" }, + { 0x2D5B, "endgameovertime" }, + { 0x2D5E, "endgameupdate" }, + { 0x2D61, "ending2_debri_fall" }, + { 0x2D65, "ending2_window_break" }, + { 0x2D67, "ending_animatic_setup" }, + { 0x2D68, "ending_arms" }, + { 0x2D69, "ending_autosave" }, + { 0x2D6A, "ending_bink_display" }, + { 0x2D6B, "ending_blink_qte_prompt" }, + { 0x2D6C, "ending_blood_wall" }, + { 0x2D6D, "ending_blur_logic" }, + { 0x2D6E, "ending_breach_ally" }, + { 0x2D77, "ending_dof_05" }, + { 0x2D7A, "ending_dof_08" }, + { 0x2D7C, "ending_door_r" }, + { 0x2D83, "ending_fx_opfor03_fire_pilot" }, + { 0x2D84, "ending_gate_l" }, + { 0x2D85, "ending_gate_node_left" }, + { 0x2D86, "ending_gate_node_right" }, + { 0x2D87, "ending_gate_r" }, + { 0x2D8A, "ending_harmless_shots_logic" }, + { 0x2D8B, "ending_heli" }, + { 0x2D8C, "ending_heli_callout_vo" }, + { 0x2D8D, "ending_heli_path" }, + { 0x2D8F, "ending_hvt_handle_damage" }, + { 0x2D90, "ending_hvt_shot_blood_fx" }, + { 0x2D91, "ending_init" }, + { 0x2D94, "ending_lower_raise_weapon_logic" }, + { 0x2D95, "ending_open_doors" }, + { 0x2D97, "ending_opfor_1" }, + { 0x2D9A, "ending_opfor_kill_pilot" }, + { 0x2D9B, "ending_player_anims" }, + { 0x2D9C, "ending_player_broken_nose" }, + { 0x2D9E, "ending_player_enemy_broken_nose" }, + { 0x2DA0, "ending_player_failed_qte_0" }, + { 0x2DA3, "ending_player_hvt_aim" }, + { 0x2DA8, "ending_player_qte_0_logic" }, + { 0x2DAB, "ending_player_qte_reach_logic" }, + { 0x2DAC, "ending_player_qte_shoot_logic" }, + { 0x2DB6, "ending_price_gets_capped" }, + { 0x2DB7, "ending_pt1_allies_sequence_start" }, + { 0x2DB8, "ending_pt1_ally_0_sequence" }, + { 0x2DB9, "ending_pt1_ally_1_sequence" }, + { 0x2DC0, "ending_pt2_player_sequence_save" }, + { 0x2DC1, "ending_qte_0_prompt_logic" }, + { 0x2DC3, "ending_qte_catch" }, + { 0x2DC8, "ending_qte_reach" }, + { 0x2DCA, "ending_scene" }, + { 0x2DCD, "ending_sequence" }, + { 0x2DCF, "ending_setup" }, + { 0x2DD4, "ending_transition" }, + { 0x2DD5, "ending_vo_main" }, + { 0x2DD6, "ending_white_fade" }, + { 0x2DD8, "endkillcamifnothingtoshow" }, + { 0x2DDA, "endmgstreakwhenleavemg" }, + { 0x2DDD, "endnotetrack" }, + { 0x2DDF, "endofspeedwatcher" }, + { 0x2DE2, "endonstring" }, + { 0x2DE5, "endpoint" }, + { 0x2DE6, "endpos" }, + { 0x2DE8, "endrespawnnotify" }, + { 0x2DF0, "endselectiononemp" }, + { 0x2DF1, "endselectiononendgame" }, + { 0x2DF2, "endsliding" }, + { 0x2DF4, "endtime" }, + { 0x2DF5, "enduavonlatejoiner" }, + { 0x2DF6, "endupvector" }, + { 0x2DF7, "endvel" }, + { 0x2DFA, "enemies_above_killed" }, + { 0x2DFC, "enemies_around_nitro" }, + { 0x2DFE, "enemies_engine_room" }, + { 0x2DFF, "enemies_engine_room_reinforcements" }, + { 0x2E00, "enemies_engineroom_entry" }, + { 0x2E02, "enemies_engineroom_extinguisher" }, + { 0x2E05, "enemies_final_move" }, + { 0x2E08, "enemies_magic_bullet_until_player_at_corner" }, + { 0x2E0A, "enemies_mg_watcher_shield_damage" }, + { 0x2E0F, "enemies_right_door" }, + { 0x2E10, "enemies_sat1" }, + { 0x2E11, "enemies_sat2" }, + { 0x2E12, "enemies_scene" }, + { 0x2E13, "enemies_setup_explosion_scene_guys" }, + { 0x2E17, "enemieskilledintimewindow" }, + { 0x2E1A, "enemy2" }, + { 0x2E1B, "enemy_13" }, + { 0x2E1E, "enemy_1_sitting" }, + { 0x2E1F, "enemy_1_standing" }, + { 0x2E21, "enemy_alert_level_attack" }, + { 0x2E22, "enemy_alert_level_attack_wrapper" }, + { 0x2E25, "enemy_alert_level_default_pre_spotted_func" }, + { 0x2E26, "enemy_alert_level_forget" }, + { 0x2E27, "enemy_alert_level_logic" }, + { 0x2E29, "enemy_alert_level_normal" }, + { 0x2E2A, "enemy_alert_level_normal_wrapper" }, + { 0x2E2B, "enemy_alert_level_reset_wrapper" }, + { 0x2E2E, "enemy_alert_level_warning1" }, + { 0x2E32, "enemy_animation_custom" }, + { 0x2E33, "enemy_animation_do_anim" }, + { 0x2E35, "enemy_animation_generic" }, + { 0x2E36, "enemy_animation_loop" }, + { 0x2E38, "enemy_animation_post_anim" }, + { 0x2E39, "enemy_animation_pre_anim" }, + { 0x2E3A, "enemy_animation_pre_anim_dog_special_first_condition" }, + { 0x2E40, "enemy_announce_corpse" }, + { 0x2E41, "enemy_announce_hmph" }, + { 0x2E46, "enemy_announce_spotted_acknowledge" }, + { 0x2E48, "enemy_announce_wtf" }, + { 0x2E4A, "enemy_attempt_melee" }, + { 0x2E4B, "enemy_breach_anims" }, + { 0x2E53, "enemy_checkpoint_dialogue" }, + { 0x2E57, "enemy_corpse_alert_level" }, + { 0x2E59, "enemy_corpse_found" }, + { 0x2E5B, "enemy_corpse_found_loop" }, + { 0x2E5D, "enemy_corpse_logic" }, + { 0x2E61, "enemy_corpse_saw_behavior" }, + { 0x2E64, "enemy_custom_corpse_behavior" }, + { 0x2E65, "enemy_custom_state_behavior" }, + { 0x2E69, "enemy_death_tracking" }, + { 0x2E6A, "enemy_debris_vo" }, + { 0x2E6D, "enemy_default_corpse_behavior" }, + { 0x2E6F, "enemy_default_threat_anim_behavior" }, + { 0x2E71, "enemy_destroyer_guy_logic" }, + { 0x2E72, "enemy_dialog_col" }, + { 0x2E74, "enemy_dog_init" }, + { 0x2E76, "enemy_drone_anim" }, + { 0x2E78, "enemy_drones_pt1_lower" }, + { 0x2E79, "enemy_drones_pt1_lower_runners" }, + { 0x2E7D, "enemy_event_awareness_notify" }, + { 0x2E7E, "enemy_event_category_awareness" }, + { 0x2E7F, "enemy_event_debug_print" }, + { 0x2E80, "enemy_event_declare_to_team" }, + { 0x2E83, "enemy_event_listeners_logic" }, + { 0x2E84, "enemy_event_listeners_proc" }, + { 0x2E85, "enemy_event_loop" }, + { 0x2E86, "enemy_event_reaction_dog_attack" }, + { 0x2E87, "enemy_event_reaction_dog_bark" }, + { 0x2E89, "enemy_event_reaction_flashbang" }, + { 0x2E8A, "enemy_event_reaction_heard_scream" }, + { 0x2E8D, "enemy_final_wave_run" }, + { 0x2E94, "enemy_gaz_health" }, + { 0x2E95, "enemy_get_nearby_pathnodes" }, + { 0x2E97, "enemy_go_back_clear_lastspot" }, + { 0x2E9E, "enemy_heli_attacking" }, + { 0x2E9F, "enemy_heli_killed" }, + { 0x2EA1, "enemy_heli_respawner" }, + { 0x2EA4, "enemy_infantry_set_up_on_spawn" }, + { 0x2EA7, "enemy_investigate_position" }, + { 0x2EAA, "enemy_jeep_b" }, + { 0x2EAF, "enemy_jeep_turret" }, + { 0x2EB4, "enemy_lookaround_for_time" }, + { 0x2EB5, "enemy_lower_level" }, + { 0x2EB9, "enemy_melee_readjust" }, + { 0x2EBA, "enemy_mg_adjust_if_target_dies" }, + { 0x2EBB, "enemy_mg_burst_fire" }, + { 0x2EBC, "enemy_mg_get_untargeted_random_target" }, + { 0x2EBD, "enemy_mg_pin_down_player" }, + { 0x2EBF, "enemy_near_position" }, + { 0x2EC0, "enemy_odin_assault_exists" }, + { 0x2EC1, "enemy_patrol_phone" }, + { 0x2EC3, "enemy_plane_behind_skipto" }, + { 0x2EC4, "enemy_plane_engine_loop_01" }, + { 0x2EC7, "enemy_plane_engine_loop_04" }, + { 0x2EC9, "enemy_plane_looping_sounds_start" }, + { 0x2ECA, "enemy_poker_cards" }, + { 0x2ECC, "enemy_prespotted_func_default" }, + { 0x2ECD, "enemy_process_synch_attack" }, + { 0x2ED1, "enemy_reaction_state_alert" }, + { 0x2ED3, "enemy_rnd_runner" }, + { 0x2ED5, "enemy_runto_and_lookaround" }, + { 0x2ED6, "enemy_saw_corpse_logic" }, + { 0x2ED7, "enemy_sentry_difficulty_settings" }, + { 0x2EDB, "enemy_set_threat_behavior" }, + { 0x2EDC, "enemy_setup" }, + { 0x2EDD, "enemy_setup_vign" }, + { 0x2EDE, "enemy_setup_vign_floor" }, + { 0x2EDF, "enemy_shoot_at_player" }, + { 0x2EE1, "enemy_snowmobiles" }, + { 0x2EE3, "enemy_spanish_vo" }, + { 0x2EE5, "enemy_spawn_func" }, + { 0x2EE7, "enemy_squad_spawn" }, + { 0x2EEC, "enemy_stop_current_behavior" }, + { 0x2EF0, "enemy_struggle_anim" }, + { 0x2EF1, "enemy_struggle_anim_additives" }, + { 0x2EF4, "enemy_switchblade_exists" }, + { 0x2EF8, "enemy_tank_soldiers_2_init" }, + { 0x2EFB, "enemy_team_name" }, + { 0x2EFC, "enemy_threat_anim_defaults" }, + { 0x2EFD, "enemy_threat_logic" }, + { 0x2EFE, "enemy_threat_logic_dog" }, + { 0x2EFF, "enemy_threat_logic_dog_wait" }, + { 0x2F01, "enemy_threat_loop" }, + { 0x2F04, "enemy_twitch" }, + { 0x2F05, "enemy_twitch_runstumble" }, + { 0x2F09, "enemy_wait_for_synch_attack_end" }, + { 0x2F0A, "enemy_wait_for_synch_end_notify" }, + { 0x2F0B, "enemy_wait_for_synch_invalid_enemy" }, + { 0x2F0C, "enemy_waittill_count" }, + { 0x2F0E, "enemy_weapons_force_use_silencer" }, + { 0x2F0F, "enemy_zodiacs_spawn_and_attack" }, + { 0x2F10, "enemy_zpu_health" }, + { 0x2F14, "enemygazs" }, + { 0x2F16, "enemyguys2" }, + { 0x2F19, "enemyhq_basement_pre_load" }, + { 0x2F1B, "enemyhq_footstep_override" }, + { 0x2F1E, "enemyhq_pre_load" }, + { 0x2F1F, "enemyhq_rooftop_intro_pre_load" }, + { 0x2F20, "enemyhq_starts" }, + { 0x2F26, "enemyisingeneraldirection" }, + { 0x2F2B, "enemytank_cleanup" }, + { 0x2F2D, "enemytanksbri1" }, + { 0x2F2E, "enemyteam" }, + { 0x2F2F, "enemyteamid" }, + { 0x2F30, "enemytrigger" }, + { 0x2F31, "enemyvelocity" }, + { 0x2F32, "engageground" }, + { 0x2F33, "engagementcomplimentdialognext" }, + { 0x2F34, "engagevehicle" }, + { 0x2F35, "engine_fxs" }, + { 0x2F37, "engineroom_headsmoke_fx_end" }, + { 0x2F38, "engineroom_headsmoke_fx_start" }, + { 0x2F39, "engineroom_heat_fx_shake" }, + { 0x2F3C, "enginevfxtag" }, + { 0x2F3D, "enhanced_vision" }, + { 0x2F42, "ent_flag" }, + { 0x2F43, "ent_flag_assert" }, + { 0x2F46, "ent_flag_exist" }, + { 0x2F4A, "ent_flag_wait" }, + { 0x2F4B, "ent_flag_wait_either" }, + { 0x2F4C, "ent_flag_wait_or_timeout" }, + { 0x2F4D, "ent_flag_wait_vehicle_node" }, + { 0x2F4E, "ent_flag_waitopen" }, + { 0x2F50, "ent_flags_lock" }, + { 0x2F51, "ent_is_highlighted" }, + { 0x2F54, "ent_parachute_from_plane_two" }, + { 0x2F55, "ent_wait_for_flag_or_time_elapses" }, + { 0x2F56, "ent_waits_for_trigger" }, + { 0x2F57, "enter" }, + { 0x2F58, "enter_blackbird_vo" }, + { 0x2F59, "enter_camera_zoomout" }, + { 0x2F5D, "enter_jeep" }, + { 0x2F60, "enter_revive_use_hold_think" }, + { 0x2F61, "enter_spectate" }, + { 0x2F64, "entermove" }, + { 0x2F65, "enterpronewrapper" }, + { 0x2F6A, "entities_are_selected" }, + { 0x2F6C, "entity_counter" }, + { 0x2F6D, "entity_fx_and_anims_think" }, + { 0x2F6E, "entity_highlight_disable" }, + { 0x2F6F, "entity_highlight_enable" }, + { 0x2F70, "entity_number" }, + { 0x2F71, "entity_path_disconnect_thread" }, + { 0x2F73, "entityheadiconoffset" }, + { 0x2F76, "entityheadiconteam" }, + { 0x2F77, "entitynumber" }, + { 0x2F78, "entnum" }, + { 0x2F7C, "entrance_points" }, + { 0x2F7F, "entrance_visible_from" }, + { 0x2F81, "entrance_watched_by_player" }, + { 0x2F82, "entry" }, + { 0x2F83, "entry_door_beeper" }, + { 0x2F85, "entry_door_close_layer2" }, + { 0x2F87, "ents" }, + { 0x2F89, "entsound" }, + { 0x2F8A, "eog_altimeter_conv_ratio" }, + { 0x2F8B, "eog_player_tracking_init" }, + { 0x2F8C, "eog_player_update_stat" }, + { 0x2F8E, "eq_table" }, + { 0x2F90, "eq_track" }, + { 0x2F91, "eq_trigger_num" }, + { 0x2F92, "equal_to_goal" }, + { 0x2F93, "equipment_enabled" }, + { 0x2F94, "equipmentdeathvfx" }, + { 0x2F95, "equipmentdeletevfx" }, + { 0x2F96, "equipmentempstunvfx" }, + { 0x2F98, "equipped_hide_weapon" }, + { 0x2F99, "equipped_weapon" }, + { 0x2F9A, "erasefinalkillcam" }, + { 0x2F9B, "error" }, + { 0x2FA3, "escape_choke_init" }, + { 0x2FA6, "escape_combat_door" }, + { 0x2FA7, "escape_cycle" }, + { 0x2FAB, "escape_dialogue" }, + { 0x2FAD, "escape_door_anim_player" }, + { 0x2FB0, "escape_enemies_and_vehicles" }, + { 0x2FB2, "escape_enemy_01_think" }, + { 0x2FB3, "escape_enemy_02_think" }, + { 0x2FB4, "escape_enemy_03_think" }, + { 0x2FB5, "escape_enemy_setup" }, + { 0x2FB7, "escape_fake_underwater_bullets" }, + { 0x2FB9, "escape_friendly_follow_spline" }, + { 0x2FBB, "escape_friendly_movement" }, + { 0x2FBD, "escape_jungle_start" }, + { 0x2FBE, "escape_loc" }, + { 0x2FBF, "escape_main" }, + { 0x2FC2, "escape_objective" }, + { 0x2FC3, "escape_play_slide_fx_on_npc" }, + { 0x2FC6, "escape_player_jump" }, + { 0x2FC7, "escape_player_speed" }, + { 0x2FC9, "escape_river_start" }, + { 0x2FCB, "escape_scripted_destruction" }, + { 0x2FCC, "escape_setup" }, + { 0x2FCE, "escape_setup_trees" }, + { 0x2FD1, "escape_socr_turret_own_target" }, + { 0x2FD2, "escape_spawn_special_minion_wave" }, + { 0x2FD8, "escape_vo" }, + { 0x2FD9, "escape_waterfall_enemies_logic" }, + { 0x2FDD, "estate" }, + { 0x2FDE, "estimatedtimetillscorelimit" }, + { 0x2FE0, "evad_anims" }, + { 0x2FE2, "eval" }, + { 0x2FE4, "evaluatefiringevent" }, + { 0x2FE5, "evaluatemeleeevent" }, + { 0x2FE8, "evaluatesuppressionevent" }, + { 0x2FE9, "evasive_addpoint" }, + { 0x2FED, "evasive_endmaneuvers" }, + { 0x2FF5, "event_awareness_dialogue_wrapper" }, + { 0x2FF6, "event_awareness_enders" }, + { 0x2FFE, "event_derrick_explode_catwalk_break" }, + { 0x3001, "event_derrick_explode_debris_bomb_throw_enemy" }, + { 0x3003, "event_derrick_explode_debris_main" }, + { 0x3005, "event_derrick_explode_debris_oiltank" }, + { 0x3007, "event_derrick_explode_debris_setup_collision" }, + { 0x300A, "event_derrick_explode_large" }, + { 0x300B, "event_derrick_explode_setup" }, + { 0x300D, "event_derrick_explode_stack_setup" }, + { 0x300F, "event_flarestack_enter" }, + { 0x3011, "event_flarestack_enter_fail_watcher" }, + { 0x3014, "event_intro_player_anims" }, + { 0x3015, "event_intro_tv_pip" }, + { 0x3016, "event_jet_flyby" }, + { 0x3017, "event_noticket" }, + { 0x3018, "event_pipe_explosions" }, + { 0x3019, "event_player_arm_break" }, + { 0x301B, "event_player_gets_kicked" }, + { 0x301D, "event_player_grabs_knife" }, + { 0x301F, "event_pressure_buildup" }, + { 0x3021, "event_qte_bullet_catch" }, + { 0x3024, "event_quaker_indoor" }, + { 0x3025, "event_quaker_outdoor" }, + { 0x3027, "event_rogs_finale" }, + { 0x302B, "event_scan_manager" }, + { 0x302C, "event_sinking_boats" }, + { 0x302E, "event_tanks_bridge_fall_scene" }, + { 0x302F, "event_thread" }, + { 0x3035, "eventactionminwait" }, + { 0x3036, "eventchance" }, + { 0x3037, "eventduration" }, + { 0x3038, "eventpriority" }, + { 0x303A, "eventstring" }, + { 0x303B, "eventtype" }, + { 0x303C, "eventtypeminwait" }, + { 0x303D, "everusessecondaryweapon" }, + { 0x303E, "exceededmaxballdrones" }, + { 0x3044, "exception" }, + { 0x3046, "excludedir" }, + { 0x304C, "execute_save" }, + { 0x304D, "execution" }, + { 0x304E, "execution_guy_dead" }, + { 0x304F, "execution_slowmo" }, + { 0x3051, "executor_kill_hostage_notetrack" }, + { 0x3054, "exfil_animnode" }, + { 0x3055, "exfil_anims_cornering" }, + { 0x3057, "exfil_blackice_exfil_heli_lights_fx" }, + { 0x3059, "exfil_chopper" }, + { 0x305A, "exfil_cypher_enter_jeep" }, + { 0x305D, "exfil_engine_fires" }, + { 0x3060, "exfil_enter_jeep" }, + { 0x3061, "exfil_get_on_turret" }, + { 0x3062, "exfil_gun_cock" }, + { 0x3063, "exfil_hall_explosions" }, + { 0x3065, "exfil_heli" }, + { 0x3066, "exfil_heli_smoke_fx_01" }, + { 0x3067, "exfil_heli_spotlight" }, + { 0x3068, "exfil_heli_tag" }, + { 0x3069, "exfil_hoodsmack" }, + { 0x306A, "exfil_jeep_latch_close_lf" }, + { 0x306C, "exfil_jeep_latch_close_rf" }, + { 0x306D, "exfil_jeep_latch_open_lf" }, + { 0x3070, "exfil_jet" }, + { 0x3072, "exfil_keegan_and_cypher_enter_jeep" }, + { 0x3075, "exfil_mblur_changes" }, + { 0x307A, "exfil_player_view_smoke_particles" }, + { 0x307B, "exfil_random_quaker" }, + { 0x307D, "exfil_slomo" }, + { 0x307E, "exfil_sniper" }, + { 0x3080, "exfil_teleport" }, + { 0x3081, "exfil_vision_bump" }, + { 0x3082, "exfil_yellow_alarms" }, + { 0x3086, "exit" }, + { 0x3088, "exit_gamemodespecificaction" }, + { 0x308B, "exit_laststand" }, + { 0x308C, "exit_nags" }, + { 0x3094, "exit_tunnel_jeep_by" }, + { 0x3095, "exit_water_tired" }, + { 0x3097, "exit_wreck_check" }, + { 0x3098, "exitaistate" }, + { 0x3099, "exiting_combat_player_fail" }, + { 0x309A, "exiting_combat_zone" }, + { 0x309C, "exitpronewrapper" }, + { 0x30A0, "expand_goalradius" }, + { 0x30A4, "expire_time" }, + { 0x30A6, "explicitabandonminitarget" }, + { 0x30A7, "explicitabandontarget" }, + { 0x30AA, "explode_gunboats" }, + { 0x30AE, "explode_zodiacs" }, + { 0x30AF, "exploded" }, + { 0x30B0, "explodeondamage" }, + { 0x30B1, "exploder" }, + { 0x30B2, "exploder_after_load" }, + { 0x30B4, "exploder_cache" }, + { 0x30B6, "exploder_damage" }, + { 0x30B7, "exploder_damage_loop" }, + { 0x30B9, "exploder_earthquake" }, + { 0x30BA, "exploder_flag_wait" }, + { 0x30BB, "exploder_fx_stuffs" }, + { 0x30BD, "exploder_model_is_chunk" }, + { 0x30C1, "exploder_radius_custom" }, + { 0x30C6, "exploder_with_connect_watch" }, + { 0x30C7, "exploderfunction" }, + { 0x30C8, "exploderfx" }, + { 0x30CB, "exploders_cached" }, + { 0x30CC, "exploders_explode_for_late_player" }, + { 0x30CE, "explodevfx" }, + { 0x30D1, "exploding_heli" }, + { 0x30D5, "explosion_anim" }, + { 0x30D7, "explosion_boom" }, + { 0x30D8, "explosion_death" }, + { 0x30D9, "explosion_death_offset" }, + { 0x30DB, "explosion_delay" }, + { 0x30DD, "explosion_incoming" }, + { 0x30E2, "explosion_throw_sandbags" }, + { 0x30E4, "explosion_vehicle_killer2" }, + { 0x30E5, "explosion_vehicle_killer3" }, + { 0x30E6, "explosion_vehicle_killer4" }, + { 0x30EB, "explosive_damage_watch" }, + { 0x30EC, "explosive_dist" }, + { 0x30ED, "explosive_type" }, + { 0x30EF, "explosivehandlemovers" }, + { 0x30F0, "explosiveinfo" }, + { 0x30F3, "explosiveplanttime" }, + { 0x30F4, "explosivetrigger" }, + { 0x30F5, "expltagroot" }, + { 0x30F8, "exposed_guy" }, + { 0x30FC, "exposedcombatcheckputawaypistol" }, + { 0x30FD, "exposedcombatcheckreloadorusepistol" }, + { 0x30FF, "exposedcombatmainloop" }, + { 0x3101, "exposedcombatpositionadjust" }, + { 0x3102, "exposedcombatstopusingrpgcheck" }, + { 0x310A, "extra_vehicle_cleanup" }, + { 0x310B, "extrafiretime_max" }, + { 0x310C, "extrafiretime_min" }, + { 0x310D, "extraspintime_max" }, + { 0x3112, "f_max" }, + { 0x3115, "face_players" }, + { 0x3116, "faceenemyaimtracking" }, + { 0x3117, "faceenemyarrival" }, + { 0x3118, "faceenemyatendofapproach" }, + { 0x311C, "faceresult" }, + { 0x311E, "facewaitforresult" }, + { 0x3120, "faceyaw" }, + { 0x3121, "facial" }, + { 0x3125, "facialidx" }, + { 0x3129, "facing_dot" }, + { 0x312C, "fade" }, + { 0x312D, "fade_ambient_elem_internal" }, + { 0x312F, "fade_ambient_elems" }, + { 0x3130, "fade_from_black" }, + { 0x3135, "fade_in_hint" }, + { 0x3136, "fade_in_logo" }, + { 0x3138, "fade_in_to_alpha" }, + { 0x313B, "fade_logo_run_credits" }, + { 0x313C, "fade_out" }, + { 0x313D, "fade_out_cut_hint" }, + { 0x3140, "fade_out_hint" }, + { 0x3141, "fade_out_in" }, + { 0x3145, "fade_out_time" }, + { 0x3148, "fade_qte_prompt" }, + { 0x3149, "fade_sun_in_out" }, + { 0x314B, "fade_tired" }, + { 0x314D, "fade_up_black" }, + { 0x314E, "fadeaway" }, + { 0x3150, "fadeinblackout" }, + { 0x3154, "fadeoverlay_no_blur" }, + { 0x3155, "fadetoalpha" }, + { 0x3156, "fadetoalphatime" }, + { 0x3157, "fading" }, + { 0x315A, "fail_mission_ambush" }, + { 0x315B, "fail_mission_leave_area" }, + { 0x315E, "fail_on_player_kill" }, + { 0x315F, "failactivatefunc" }, + { 0x3160, "failcase_blackout_early" }, + { 0x3162, "failed_spawnvehicles" }, + { 0x3165, "failonfriendlyfire" }, + { 0x3166, "fails" }, + { 0x3167, "failsafe_c_k_bags" }, + { 0x3168, "fake" }, + { 0x3169, "fake_ally_kill_me" }, + { 0x316B, "fake_dead" }, + { 0x316C, "fake_death_bullet" }, + { 0x316F, "fake_function" }, + { 0x3171, "fake_mantle_text" }, + { 0x3172, "fake_missile_launch" }, + { 0x3175, "fake_shellshock_sound" }, + { 0x3176, "fake_shooter_death" }, + { 0x317A, "fake_spot" }, + { 0x317C, "fake_tank_rumble" }, + { 0x317D, "fake_targets" }, + { 0x317F, "fake_teleport_notify" }, + { 0x3181, "fake_vehicle_moveto" }, + { 0x3185, "fakea10ai" }, + { 0x3186, "fakedrones" }, + { 0x3190, "fall_break_glass" }, + { 0x3194, "fall_enemies_rail_hit" }, + { 0x3196, "fall_enemies_start" }, + { 0x3197, "fall_enemy_anim" }, + { 0x319A, "fall_environment" }, + { 0x319B, "fall_fx_billboard_fx" }, + { 0x319C, "fall_fx_billboard_setup" }, + { 0x319E, "fall_fx_crowd_fx" }, + { 0x31A0, "fall_fx_end_bldg" }, + { 0x31A5, "fall_object_init" }, + { 0x31A6, "fall_object_run" }, + { 0x31AA, "fall_physics_debris_furniture" }, + { 0x31AB, "fall_physics_debris_lobby" }, + { 0x31AC, "fall_physics_debris_slide" }, + { 0x31B0, "fall_prop_merrick_window" }, + { 0x31B1, "fall_prop_picture" }, + { 0x31B5, "fall_props_debris_b" }, + { 0x31BB, "fall_props_player_parachute" }, + { 0x31BC, "fall_to" }, + { 0x31BF, "fallback_ai" }, + { 0x31C0, "fallback_ai_think" }, + { 0x31C2, "fallback_coverprint" }, + { 0x31C5, "fallback_initiated" }, + { 0x31C8, "fallback_text" }, + { 0x31CB, "falling_debris" }, + { 0x31D0, "falling_rock_init" }, + { 0x31D1, "falling_rock_kill_trigger" }, + { 0x31D2, "falling_rock_run" }, + { 0x31D3, "falling_rocks" }, + { 0x31D4, "falling_sat_dish" }, + { 0x31D5, "falling_tree_player_detection" }, + { 0x31D6, "fallingtileeffect" }, + { 0x31D7, "falloff" }, + { 0x31D9, "fandb_dodamage" }, + { 0x31DD, "fandb_handles_collision_brushes" }, + { 0x31DE, "fandb_hideshowtag" }, + { 0x31DF, "fandb_playsound" }, + { 0x31E5, "farthest_distance_down" }, + { 0x31E6, "fast_convoy" }, + { 0x31E7, "fast_destructible_explode" }, + { 0x31E8, "fast_jog" }, + { 0x31E9, "fast_walk" }, + { 0x31EB, "fastburstfirenumshots" }, + { 0x31EC, "fastcrouch" }, + { 0x31F0, "fastropeoffset" }, + { 0x31F4, "faux_spawn_stance" }, + { 0x31F5, "fauxdead" }, + { 0x31FB, "faze_out_finish" }, + { 0x31FD, "fbt_firstburst" }, + { 0x3203, "featherents" }, + { 0x3205, "fed_destroyer_fx_guns" }, + { 0x3207, "fed_destroyer_guys" }, + { 0x3208, "fed_destroyer_osprey" }, + { 0x320B, "fence_bottom_left" }, + { 0x320F, "fence_smash_setup" }, + { 0x3210, "fence_smash_wait" }, + { 0x321A, "ffpoints" }, + { 0x321C, "field_birds" }, + { 0x321D, "fifteen_minutes_earlier_feed_lines" }, + { 0x3220, "fight_objective" }, + { 0x3221, "fightdist" }, + { 0x3225, "fileprint_launcher_start_file" }, + { 0x3226, "fileprint_map_entity_end" }, + { 0x3227, "fileprint_map_entity_start" }, + { 0x322D, "fileprintlauncher_linecount" }, + { 0x3230, "filter" }, + { 0x3232, "filter_spawn_point_by_distance_from_player" }, + { 0x3236, "final_jungle_ai_cleanup" }, + { 0x3237, "final_main" }, + { 0x3239, "final_sequence_fail_condition" }, + { 0x3240, "finale_fx_handling" }, + { 0x3241, "finale_nags" }, + { 0x3242, "finale_sniping" }, + { 0x3243, "finale_timer" }, + { 0x3246, "finalhinds" }, + { 0x324D, "finalkillcam_inflictor" }, + { 0x324E, "finalkillcam_killcamentityindex" }, + { 0x3250, "finalkillcam_psoffsettime" }, + { 0x3252, "finalkillcam_sweapon" }, + { 0x3255, "finalkillcam_victim" }, + { 0x3256, "finalkillcam_winner" }, + { 0x3257, "finalkillcammusic" }, + { 0x325D, "find_available_collision_model" }, + { 0x3260, "find_camp_node_worker" }, + { 0x3264, "find_connected_turrets" }, + { 0x3266, "find_defend_node_capture" }, + { 0x3269, "find_defend_node_protect" }, + { 0x326A, "find_destructibles" }, + { 0x326B, "find_different_way_to_attack_last_seen_position" }, + { 0x326E, "find_lane_spawn_node" }, + { 0x3270, "find_new_chase_target" }, + { 0x3272, "find_random_spawn_node" }, + { 0x3274, "find_safe_spawn_spot_with_volumes" }, + { 0x3278, "find_spitter_attack_node" }, + { 0x327E, "findaveragepointvec" }, + { 0x327F, "findbattlebuddy" }, + { 0x3280, "findboxcenter" }, + { 0x3281, "findbuddypathnode" }, + { 0x3288, "findlocation" }, + { 0x3289, "findnewowner" }, + { 0x328A, "findpointnearowner" }, + { 0x328B, "findrandomtarget" }, + { 0x328D, "findspawnlocationnearplayer" }, + { 0x328E, "findtarget" }, + { 0x3290, "findunobstructedfiringpoint" }, + { 0x3294, "finish_zoom" }, + { 0x3297, "finishcoverexitnotetracks" }, + { 0x329A, "finished_spawning" }, + { 0x32A1, "finishsupportescortusage" }, + { 0x32A4, "fire_anim_start" }, + { 0x32A6, "fire_artillery" }, + { 0x32A8, "fire_at_chopper" }, + { 0x32B1, "fire_cloud_burn_alien" }, + { 0x32B2, "fire_cloud_burn_player" }, + { 0x32B3, "fire_damage" }, + { 0x32B4, "fire_death_watcher" }, + { 0x32B7, "fire_ext_grab" }, + { 0x32BA, "fire_extinguisher" }, + { 0x32BD, "fire_extinguisher_death" }, + { 0x32C6, "fire_fx" }, + { 0x32C8, "fire_grenade" }, + { 0x32C9, "fire_guns" }, + { 0x32CA, "fire_heli_missile" }, + { 0x32CD, "fire_link_structs" }, + { 0x32CF, "fire_magic_missile" }, + { 0x32D0, "fire_magic_missile_mig" }, + { 0x32D2, "fire_missile_at_vehicle" }, + { 0x32D3, "fire_missiles" }, + { 0x32D7, "fire_on" }, + { 0x32D8, "fire_on_non_vehicle" }, + { 0x32DA, "fire_radius" }, + { 0x32DD, "fire_rocket" }, + { 0x32E0, "fire_sat_rcs_thrusters" }, + { 0x32E1, "fire_seeking_missile" }, + { 0x32E2, "fire_sensor" }, + { 0x32E3, "fire_sound_spindown" }, + { 0x32E6, "fire_space_microtar" }, + { 0x32E7, "fire_spit_projectile" }, + { 0x32E9, "fire_supression_status" }, + { 0x32EB, "fire_tracers" }, + { 0x32ED, "fire_tracking_missile_at_vehicle" }, + { 0x32EE, "fire_tracking_missile_mig" }, + { 0x32EF, "fire_trap_burn" }, + { 0x32F6, "fire_turret" }, + { 0x32FA, "firecloudheight" }, + { 0x32FC, "firecloudlingertime" }, + { 0x3300, "firecloudsfx" }, + { 0x3301, "firecloudtickdamage" }, + { 0x3306, "fired_weapon" }, + { 0x3308, "firedirector" }, + { 0x3309, "firedonme" }, + { 0x330B, "fireinterval" }, + { 0x3310, "fireontarget" }, + { 0x3311, "fireonvehicletarget" }, + { 0x3312, "fires" }, + { 0x3313, "fireshield" }, + { 0x331C, "fireteam_hunt_next_zone_search_time" }, + { 0x331D, "fireteam_hunt_target_zone" }, + { 0x331E, "fireteam_menu" }, + { 0x331F, "fireteam_personality_original" }, + { 0x3323, "fireteam_tdm_set_hunt_leader" }, + { 0x3324, "fireteammembers" }, + { 0x3325, "firetime" }, + { 0x3328, "fireuntiloutofammointernal" }, + { 0x332C, "fireworklights" }, + { 0x332D, "fireworks" }, + { 0x332E, "fireworks_courtyard" }, + { 0x332F, "fireworks_courtyard_post" }, + { 0x3330, "fireworks_courtyard_stairs" }, + { 0x3331, "fireworks_finale" }, + { 0x3335, "fireworks_init" }, + { 0x3337, "fireworks_intro_post" }, + { 0x3338, "fireworks_junction" }, + { 0x3339, "fireworks_junction_post" }, + { 0x333B, "fireworks_start" }, + { 0x3341, "firing_into_bunks" }, + { 0x3342, "firing_position" }, + { 0x3343, "firing_sound_ent" }, + { 0x3347, "firingreaper" }, + { 0x3348, "first_distant_sat_launch" }, + { 0x3349, "first_explosion_fx" }, + { 0x334C, "first_floor_patroller_1_setup" }, + { 0x334D, "first_floor_patroller_2_setup" }, + { 0x334E, "first_floor_shift_right_trigger" }, + { 0x334F, "first_floor_sitting_laptop_guy_react" }, + { 0x3350, "first_floor_sitting_laptop_guy_react_laptop" }, + { 0x3352, "first_frame" }, + { 0x3356, "first_guy_leap_frog_logic" }, + { 0x335E, "first_time_depth_charge_minigun_hint" }, + { 0x3361, "first_zoom_level_fov" }, + { 0x3362, "firstblood" }, + { 0x3364, "firstcapture" }, + { 0x3365, "firstcontact" }, + { 0x3366, "firstcratedrop" }, + { 0x3367, "firstframe_combat_one_door" }, + { 0x336A, "firstinit" }, + { 0x336C, "firstload" }, + { 0x3370, "fish" }, + { 0x3377, "fizzle_flashbangs_think" }, + { 0x3378, "fizzle_tracked" }, + { 0x337E, "flag_count" }, + { 0x3383, "flag_exist" }, + { 0x3384, "flag_if_player_aims_knife_at_enemy" }, + { 0x3386, "flag_inits" }, + { 0x3387, "flag_on_death" }, + { 0x3388, "flag_set" }, + { 0x3389, "flag_set_delayed" }, + { 0x338A, "flag_set_near_ent" }, + { 0x338C, "flag_state" }, + { 0x3390, "flag_trigger_init" }, + { 0x3394, "flag_wait" }, + { 0x3395, "flag_wait_all" }, + { 0x3396, "flag_wait_any" }, + { 0x3399, "flag_wait_badplace_brush" }, + { 0x339C, "flag_wait_either_return" }, + { 0x339F, "flag_wait_or_timeout" }, + { 0x33A1, "flag_waitopen_any" }, + { 0x33A3, "flag_watcher" }, + { 0x33A4, "flagbasefxid" }, + { 0x33A9, "flagtowait" }, + { 0x33AA, "flagwaitthread" }, + { 0x33AB, "flagwaitthread_proc" }, + { 0x33AD, "flamestack_godrays" }, + { 0x33AF, "flare_doburnout" }, + { 0x33B2, "flare_fx" }, + { 0x33B5, "flare_knife" }, + { 0x33B9, "flare_trackvelocity" }, + { 0x33BB, "flareactiveradius" }, + { 0x33BD, "flareauto" }, + { 0x33C1, "flarefx" }, + { 0x33C2, "flarefxexplode" }, + { 0x33C3, "flareindex" }, + { 0x33C5, "flareprotection" }, + { 0x33C7, "flarerig_animrate" }, + { 0x33CA, "flarerig_tagangles" }, + { 0x33CC, "flares" }, + { 0x33D2, "flares_fire" }, + { 0x33DB, "flares_playfx" }, + { 0x33DC, "flares_redirect_missiles" }, + { 0x33DE, "flares_watchsamproximity" }, + { 0x33E1, "flaresound" }, + { 0x33EA, "flarestack_door" }, + { 0x33EC, "flarestack_pressurelp_01" }, + { 0x33ED, "flarestack_pressurelp_02" }, + { 0x33F4, "flash_credit_gain" }, + { 0x33F5, "flash_fxs" }, + { 0x33F7, "flashanimindex" }, + { 0x33FA, "flashbangedloop" }, + { 0x33FC, "flashbangimmunity" }, + { 0x33FD, "flashbangisactive" }, + { 0x33FF, "flashbangstart" }, + { 0x3400, "flashbangstop" }, + { 0x3403, "flashendtime" }, + { 0x3408, "flashlight_off" }, + { 0x340A, "flashlight_prop" }, + { 0x340C, "flashlight_toggle" }, + { 0x340D, "flashmonitor" }, + { 0x340E, "flashmonitorenablehealthshield" }, + { 0x3412, "flashrumbleloop" }, + { 0x3418, "flat_trigger" }, + { 0x3428, "flinching" }, + { 0x342B, "fling_debug" }, + { 0x3434, "flock_handledamage" }, + { 0x3436, "flood_amb_fx" }, + { 0x3438, "flood_and_secure_spawn" }, + { 0x3439, "flood_and_secure_spawn_goal" }, + { 0x343A, "flood_and_secure_spawner" }, + { 0x343B, "flood_and_secure_spawner_think" }, + { 0x343C, "flood_battlechatter_on" }, + { 0x343E, "flood_convoy_attackheli01_sfx" }, + { 0x3441, "flood_convoy_chopper2_sfx" }, + { 0x3443, "flood_convoy_exp_sfx" }, + { 0x3444, "flood_convoy_sfx" }, + { 0x3445, "flood_createfx_cleanup" }, + { 0x3446, "flood_current_goalnode" }, + { 0x3447, "flood_default_water_transion_fx" }, + { 0x3449, "flood_ending_fadeout" }, + { 0x344D, "flood_interactives_cleanup" }, + { 0x344E, "flood_intro_screen" }, + { 0x3450, "flood_launcher_crash_sfx" }, + { 0x3451, "flood_locations" }, + { 0x3452, "flood_mall_roof_door" }, + { 0x3453, "flood_mall_roof_door_model" }, + { 0x3459, "flood_og_movetransitionrate" }, + { 0x345B, "flood_player_default_jump_height" }, + { 0x345C, "flood_shake_tree" }, + { 0x345D, "flood_shake_tree_internal" }, + { 0x345F, "flood_spawn" }, + { 0x3462, "flood_spawner_scripted" }, + { 0x3463, "flood_spawner_stop" }, + { 0x3464, "flood_spawner_think" }, + { 0x3465, "flood_sweptaway" }, + { 0x346A, "flooding_ext_start" }, + { 0x346C, "flooding_int_start" }, + { 0x346D, "flooding_last_water_state" }, + { 0x346E, "flooding_stairs_vo" }, + { 0x3470, "flush_church_proc" }, + { 0x3471, "flush_sat_camp_1" }, + { 0x3473, "fly_around_start" }, + { 0x3476, "fly_distance" }, + { 0x347B, "flyout_lights" }, + { 0x347C, "fndogmeleevictim" }, + { 0x347E, "fnoverlord" }, + { 0x3487, "folded_sentry_use_wait" }, + { 0x3488, "foley" }, + { 0x348B, "follow_icon_manager" }, + { 0x348C, "follow_on_went_hot" }, + { 0x348D, "follow_on_went_hot_logic" }, + { 0x348E, "follow_origin" }, + { 0x348F, "follow_path" }, + { 0x3491, "follow_path_animate_set_ent" }, + { 0x3492, "follow_path_animate_set_node" }, + { 0x3493, "follow_path_animate_set_struct" }, + { 0x349A, "font_color" }, + { 0x349B, "font_size" }, + { 0x349D, "fontpulse" }, + { 0x349F, "fontscaler" }, + { 0x34A0, "foo" }, + { 0x34A3, "force_actor_space_rotation_update" }, + { 0x34A5, "force_all_complete" }, + { 0x34A7, "force_civilian_hunched_run" }, + { 0x34AB, "force_crawling_death_proc" }, + { 0x34AC, "force_crouch" }, + { 0x34AD, "force_deathquote" }, + { 0x34B2, "force_hint" }, + { 0x34B6, "force_mantle_trigs" }, + { 0x34B7, "force_next_earthquake" }, + { 0x34B8, "force_num_crawls" }, + { 0x34BB, "force_player_to_end_upload" }, + { 0x34BF, "force_stop_sound" }, + { 0x34C7, "forced_hint" }, + { 0x34C8, "forced_slowmo_breach_lerpout" }, + { 0x34CA, "forced_start_catchup" }, + { 0x34CB, "forced_startingposition" }, + { 0x34CC, "forcedend" }, + { 0x34CD, "forcedgameskill" }, + { 0x34D0, "forcedtarget" }, + { 0x34D6, "forcegoal" }, + { 0x34D7, "forcegoal_radius" }, + { 0x34DE, "forcespawnangles" }, + { 0x34E2, "forcetrigger" }, + { 0x34E5, "foreman" }, + { 0x34E7, "forfeitinprogress" }, + { 0x34E8, "forfeitwaitforabort" }, + { 0x34E9, "forget_time" }, + { 0x34EA, "format1" }, + { 0x34EB, "format2" }, + { 0x34ED, "forty_five_sec_vo" }, + { 0x34EE, "forward_direction_worldspace" }, + { 0x34EF, "forward_for_vision_change" }, + { 0x34F0, "forwardgraphid" }, + { 0x34F1, "forwardpush" }, + { 0x34F3, "forwardyaw" }, + { 0x34FB, "fov_get_default" }, + { 0x34FD, "fov_orig" }, + { 0x34FE, "fov_outer" }, + { 0x34FF, "fov_range" }, + { 0x3501, "frac" }, + { 0x3504, "frames_visible" }, + { 0x3505, "free_node" }, + { 0x3506, "free_on_death" }, + { 0x350A, "freeplayer" }, + { 0x350D, "freezeallplayers" }, + { 0x3510, "freon_leak_fx_turn_off_damage" }, + { 0x3512, "fridge_anims" }, + { 0x3516, "friendlies_breach" }, + { 0x3517, "friendlies_execute_enemies" }, + { 0x3518, "friendlies_shoot_while_breaching" }, + { 0x351F, "friendly_breach_thread" }, + { 0x3520, "friendly_bubbles" }, + { 0x3525, "friendly_color_hidden" }, + { 0x3526, "friendly_color_spotted" }, + { 0x352A, "friendly_custom_acc_behavior" }, + { 0x352D, "friendly_default_acc_behavior" }, + { 0x352E, "friendly_default_color_behavior" }, + { 0x3533, "friendly_fire_enable" }, + { 0x3534, "friendly_fire_fail_check" }, + { 0x3536, "friendly_getangles_ai" }, + { 0x3537, "friendly_getangles_player" }, + { 0x353A, "friendly_getvelocity" }, + { 0x353C, "friendly_hud_icon_blink_on_damage" }, + { 0x3540, "friendly_init" }, + { 0x3545, "friendly_mg42_doneusingturret" }, + { 0x3546, "friendly_mg42_endtrigger" }, + { 0x354B, "friendly_mgturret" }, + { 0x354C, "friendly_navigation" }, + { 0x354D, "friendly_nearby" }, + { 0x354E, "friendly_promotion_thread" }, + { 0x3550, "friendly_respawn_vision_checker_thread" }, + { 0x3553, "friendly_setup" }, + { 0x3554, "friendly_setup_apache_section" }, + { 0x3556, "friendly_spawner" }, + { 0x3558, "friendly_spotted_getup_from_prone" }, + { 0x3559, "friendly_stance_handler" }, + { 0x355C, "friendly_stance_handler_check_mightbeseen" }, + { 0x355E, "friendly_stance_handler_return_ai_sight" }, + { 0x3568, "friendly_visibility_logic" }, + { 0x356B, "friendly_wave_masterthread" }, + { 0x356C, "friendly_wave_trigger" }, + { 0x3570, "friendlychains" }, + { 0x3574, "friendlyfire_damage_modifier" }, + { 0x3575, "friendlyfire_destructible_attacker" }, + { 0x3577, "friendlyfire_max_participation" }, + { 0x3578, "friendlyfire_shield" }, + { 0x3579, "friendlyfire_warning" }, + { 0x357B, "friendlyfire_warnings_disable" }, + { 0x357C, "friendlyfire_warnings_off" }, + { 0x357E, "friendlyfire_whizby_distances_valid" }, + { 0x3581, "friendlyfiredisabledfordestructible" }, + { 0x3587, "friendlyhudicon_normal" }, + { 0x3588, "friendlyhudicon_rotating" }, + { 0x3589, "friendlyhudicon_showall" }, + { 0x358A, "friendlyhudicon_update" }, + { 0x358B, "friendlyicon" }, + { 0x358C, "friendlymodel" }, + { 0x358D, "friendlyspawnorg" }, + { 0x358F, "friendlyspawnwave" }, + { 0x3590, "friendlyspawnwave_triggerthink" }, + { 0x3591, "friendlytrigger" }, + { 0x3592, "friendlywave_thread" }, + { 0x3593, "friendlywaypoint" }, + { 0x359D, "front_wheel_sfx" }, + { 0x35A0, "fudge_ally_accuracy" }, + { 0x35A3, "fullmodel" }, + { 0x35A5, "func" }, + { 0x35AA, "func_get_level_fx" }, + { 0x35AB, "func_get_nodes_on_path" }, + { 0x35AD, "func_give" }, + { 0x35B2, "func_position_player" }, + { 0x35B3, "func_position_player_get" }, + { 0x35B6, "func_waittill_msg" }, + { 0x35B7, "function_stack" }, + { 0x35B8, "function_stack_caller_waits_for_turn" }, + { 0x35B9, "function_stack_clear" }, + { 0x35BE, "function_stack_wait" }, + { 0x35BF, "function_stack_wait_finish" }, + { 0x35C2, "funnel_player_internal" }, + { 0x35C3, "furniturepushsound" }, + { 0x35C7, "fx_airlock_ambient" }, + { 0x35C8, "fx_airstrike_afterburner" }, + { 0x35C9, "fx_airstrike_contrail" }, + { 0x35CB, "fx_airstrike_wingtip_light_red" }, + { 0x35CE, "fx_ambient_setup" }, + { 0x35CF, "fx_angry_flood_nearmiss" }, + { 0x35D0, "fx_array" }, + { 0x35D1, "fx_aurora_anim" }, + { 0x35D2, "fx_blood_splatter" }, + { 0x35D3, "fx_bokehdots_and_waterdrops_heavy" }, + { 0x35D5, "fx_bokehdots_far" }, + { 0x35D8, "fx_bridgefall_med_splash" }, + { 0x35D9, "fx_bridgefall_small_splash" }, + { 0x35DB, "fx_burnup_kyra" }, + { 0x35DC, "fx_burnup_player" }, + { 0x35DD, "fx_burnup_sat" }, + { 0x35DE, "fx_c2_rog_satelittes_close_01" }, + { 0x35E1, "fx_camp_truck_submerge_body" }, + { 0x35E5, "fx_charge2_pos" }, + { 0x35E9, "fx_command_snow" }, + { 0x35EB, "fx_command_window_light_on" }, + { 0x35EF, "fx_crater_plume" }, + { 0x35F0, "fx_create_bokehdots_source" }, + { 0x35F3, "fx_dam_explosion" }, + { 0x35F5, "fx_dam_missile_dust" }, + { 0x35F6, "fx_dam_missile_launch_01" }, + { 0x35FC, "fx_debri_combat_one" }, + { 0x35FD, "fx_door_open" }, + { 0x3605, "fx_ents_playfx" }, + { 0x3606, "fx_escape_ambient" }, + { 0x3608, "fx_escape_play_rog_impact" }, + { 0x360B, "fx_flarestack_motion" }, + { 0x3610, "fx_glass_front" }, + { 0x3612, "fx_glass_mid_1" }, + { 0x3620, "fx_init" }, + { 0x3621, "fx_intro_amb" }, + { 0x3622, "fx_intro_ambient" }, + { 0x3623, "fx_intro_friendly_glowsticks" }, + { 0x3624, "fx_jump_ambient" }, + { 0x3627, "fx_lens_drops_01" }, + { 0x362A, "fx_lens_drops_04" }, + { 0x362D, "fx_like_dust_in_the_wind_02" }, + { 0x362E, "fx_like_dust_in_the_wind_03" }, + { 0x3632, "fx_mall_roof_water_hide" }, + { 0x3633, "fx_mall_roof_water_show" }, + { 0x3634, "fx_mall_rooftop_debris" }, + { 0x3635, "fx_mall_rooftop_hide_shadow_geo" }, + { 0x3636, "fx_missile_launch" }, + { 0x3639, "fx_opfor3_pushdown_bubbles" }, + { 0x363B, "fx_org" }, + { 0x363D, "fx_org_belly2" }, + { 0x363E, "fx_org_body" }, + { 0x3645, "fx_origin_with_train_angles" }, + { 0x3646, "fx_parking_garage_ambient" }, + { 0x3650, "fx_retarget_warehouse_waters_lighting" }, + { 0x3651, "fx_rog_amb_exp" }, + { 0x3653, "fx_rog_satelittes_close_02" }, + { 0x3654, "fx_rog_satelittes_close_03" }, + { 0x3655, "fx_rog_satelittes_fire_fx_close" }, + { 0x3657, "fx_rog_satelittes_firing_c2" }, + { 0x3659, "fx_rooftop2_ambient" }, + { 0x365E, "fx_rotate_lights" }, + { 0x3660, "fx_rotating" }, + { 0x3662, "fx_sat_doors_close" }, + { 0x3663, "fx_sat_doors_open" }, + { 0x3665, "fx_sat_rcs_damage" }, + { 0x3666, "fx_sat_rcs_damage_kill" }, + { 0x3667, "fx_sat_thrusters_damage" }, + { 0x3669, "fx_screen_bokehdots_rain" }, + { 0x366D, "fx_screen_raindrops_fast_kill" }, + { 0x366E, "fx_screen_water_sheeting" }, + { 0x366F, "fx_sea_spray" }, + { 0x3675, "fx_skybridge_event" }, + { 0x3676, "fx_skybridge_room_bokeh_01" }, + { 0x3677, "fx_skybridge_room_bokeh_02" }, + { 0x3678, "fx_snakecam_lens_shmutz" }, + { 0x367B, "fx_snowmobile_light" }, + { 0x367D, "fx_solar_panel_collision_player" }, + { 0x367F, "fx_space_glass" }, + { 0x3682, "fx_spin_play_rog_impact" }, + { 0x3683, "fx_spin_player_debris" }, + { 0x3686, "fx_stealth_ambient" }, + { 0x3688, "fx_stealthkill_02_blood_02" }, + { 0x3689, "fx_stealthkill_02_opfor2_blood_01" }, + { 0x368C, "fx_swept_amb_fx" }, + { 0x368E, "fx_swept_water_hide" }, + { 0x3691, "fx_tag" }, + { 0x3694, "fx_tag_prop_wash" }, + { 0x3695, "fx_tag_prop_wash1" }, + { 0x3697, "fx_tank_window_break" }, + { 0x369A, "fx_turn_on_bokehdots_16_player" }, + { 0x369C, "fx_turn_on_bokehdots_32_player" }, + { 0x369E, "fx_turn_on_introfx" }, + { 0x369F, "fx_turn_on_tunnel_lights" }, + { 0x36A0, "fx_turnon_loco_exterior_lights" }, + { 0x36A2, "fx_turnon_rooftop_lights" }, + { 0x36B0, "fx_warehouse_door_burst" }, + { 0x36B2, "fx_warehouse_double_doors" }, + { 0x36B3, "fx_warehouse_floating_debris" }, + { 0x36B5, "fx_warehouse_splashes" }, + { 0x36B8, "fx_warehouse_underwater_fx_on" }, + { 0x36BD, "fx_waterwipe_above" }, + { 0x36BE, "fx_waterwipe_under" }, + { 0x36BF, "fx_wh_splashes" }, + { 0x36C0, "fxcost" }, + { 0x36C4, "fxfireloopmod" }, + { 0x36C5, "fxhudelements" }, + { 0x36C8, "fxid_explode" }, + { 0x36CB, "fxid_light2" }, + { 0x36D3, "fxstop" }, + { 0x36D5, "fxtags" }, + { 0x36D6, "fxtime" }, + { 0x36D8, "g_bob_scale_get_func" }, + { 0x36D9, "g_bob_scale_set_func" }, + { 0x36DB, "g_friendlynamedist_old" }, + { 0x36DC, "g_speed" }, + { 0x36DD, "g_speed_get_func" }, + { 0x36DE, "g_speed_set_func" }, + { 0x36DF, "gain" }, + { 0x36E0, "gain_credit_message" }, + { 0x36E1, "gamblerability" }, + { 0x36E2, "gambleranimwatcher" }, + { 0x36E3, "game_is_current_gen" }, + { 0x36E4, "game_is_ng" }, + { 0x36EE, "gameended" }, + { 0x36EF, "gameendlistener" }, + { 0x36F5, "gameflagwait" }, + { 0x36FA, "gamemodemaydropweapon" }, + { 0x36FB, "gamemodemodifyplayerdamage" }, + { 0x36FE, "gameskill" }, + { 0x3700, "gameskill_is_difficult" }, + { 0x3709, "gapfixlevel" }, + { 0x370A, "garage" }, + { 0x370D, "garage_ally_move476_jumpers" }, + { 0x3711, "garage_ally_move480" }, + { 0x3713, "garage_door_logic" }, + { 0x3714, "garage_door_nag" }, + { 0x3715, "garage_jeep_start_skid" }, + { 0x3716, "garage_jump_01" }, + { 0x3719, "garage_jump_02_spawn" }, + { 0x371A, "garage_malllight_off" }, + { 0x371B, "garage_misc" }, + { 0x371C, "garage_opening_collapse" }, + { 0x371F, "garage_start" }, + { 0x3722, "garage_velocity_loops" }, + { 0x3725, "garage_wave3_trig" }, + { 0x3726, "garage_wave4_trig" }, + { 0x3727, "garage_wave_get_furthest" }, + { 0x3729, "garden_enemies_cyan_needed" }, + { 0x372A, "garden_enemies_delete" }, + { 0x372F, "garden_entity_cleanup" }, + { 0x3731, "garden_gameplay" }, + { 0x3732, "garden_glass_room_guy_spawnfunc" }, + { 0x3733, "garden_idf_guys_orange" }, + { 0x3737, "garden_last_stand" }, + { 0x3738, "garden_move_allies_to_end" }, + { 0x3739, "garden_transient_sync" }, + { 0x373A, "garden_vo" }, + { 0x373B, "garden_wave1" }, + { 0x373F, "gas_cloud_available" }, + { 0x3742, "gas_flee_guys" }, + { 0x3743, "gas_mask_off_player_anim" }, + { 0x3746, "gas_station" }, + { 0x3748, "gas_station_connect_node" }, + { 0x3749, "gas_station_disconnect_node" }, + { 0x374A, "gas_station_earthquake" }, + { 0x374B, "gas_station_events" }, + { 0x374E, "gas_station_play_fx" }, + { 0x3750, "gas_station_precache" }, + { 0x3752, "gas_station_run_func_on_notify" }, + { 0x3753, "gas_station_update_clip" }, + { 0x3755, "gasmask" }, + { 0x3756, "gasmask_breathing" }, + { 0x3757, "gasmask_hud_elem" }, + { 0x375C, "gasstation_ambient_aa72" }, + { 0x375F, "gasstation_civs_logic" }, + { 0x3760, "gasstation_did_player_rush" }, + { 0x3763, "gasstation_execution_timing" }, + { 0x3766, "gasstation_takedown_knife_notetrack_func" }, + { 0x3768, "gate_being_used" }, + { 0x3769, "gateopen" }, + { 0x376A, "gates" }, + { 0x376C, "gather_delay_proc" }, + { 0x376F, "gaz_additive_anims_release" }, + { 0x3770, "gaz_crush" }, + { 0x3777, "gaz_relative_speed_stop" }, + { 0x3778, "gaz_spawn_setup" }, + { 0x3779, "gaz_turret_guy_gettin_func" }, + { 0x377A, "gazvehicles" }, + { 0x377E, "generatemaxweightedcratevalue" }, + { 0x3780, "generatesquadname" }, + { 0x3784, "generatortype" }, + { 0x3788, "generic_double_strobe" }, + { 0x3789, "generic_flicker" }, + { 0x378E, "generic_gaz_spawner_setup" }, + { 0x3792, "generic_human_beach" }, + { 0x3793, "generic_human_intro" }, + { 0x3794, "generic_human_recruits" }, + { 0x3797, "generic_index" }, + { 0x379C, "generic_shootable_double_doors" }, + { 0x379D, "generic_spawn_node_based_enemy_gaz" }, + { 0x37A5, "generic_swing_ents" }, + { 0x37AA, "geo_off" }, + { 0x37AB, "geo_on" }, + { 0x37AC, "get_a10_player_start" }, + { 0x37AD, "get_activation_result" }, + { 0x37AE, "get_active_turret" }, + { 0x37AF, "get_adjusted_armor" }, + { 0x37B0, "get_ai_array" }, + { 0x37B2, "get_ai_group_count" }, + { 0x37B4, "get_ai_number" }, + { 0x37B5, "get_ai_touching_volume" }, + { 0x37B6, "get_alias_from_stored" }, + { 0x37BB, "get_all_allies" }, + { 0x37C2, "get_all_wave_guys" }, + { 0x37C3, "get_altitude_min" }, + { 0x37C4, "get_angered_damage_scalar" }, + { 0x37C6, "get_anim_class" }, + { 0x37C9, "get_anim_start_time" }, + { 0x37CD, "get_apache_ally" }, + { 0x37CF, "get_apache_player" }, + { 0x37D1, "get_apache_spawn_struct" }, + { 0x37D3, "get_approach_node" }, + { 0x37D4, "get_area_for_cycle" }, + { 0x37D6, "get_array_of_farthest" }, + { 0x37DA, "get_attack_num" }, + { 0x37E0, "get_average_distance_to_players" }, + { 0x37E2, "get_badcountryidstr" }, + { 0x37EA, "get_best_weapons" }, + { 0x37F0, "get_blended_difficulty" }, + { 0x37F1, "get_blendtime_from_notetrack" }, + { 0x37F6, "get_breach_groups" }, + { 0x37F9, "get_breach_target" }, + { 0x3800, "get_challenge_scalar" }, + { 0x3801, "get_channel_array" }, + { 0x3802, "get_chaos_airdrop_loc" }, + { 0x3804, "get_choke_trig_id" }, + { 0x3805, "get_chopperboss_data" }, + { 0x3806, "get_clone_agent" }, + { 0x3809, "get_closest_ally" }, + { 0x380A, "get_closest_colored_friendly" }, + { 0x380B, "get_closest_colored_friendly_with_classname" }, + { 0x3812, "get_closest_player_healthy" }, + { 0x3815, "get_closest_to_player_view" }, + { 0x3816, "get_closest_vec_index" }, + { 0x3817, "get_closest_with_targetname" }, + { 0x3819, "get_color_index_item" }, + { 0x381F, "get_color_volume_from_trigger" }, + { 0x3820, "get_colorcoded_volume" }, + { 0x3822, "get_colorcodes_and_activate_trigger" }, + { 0x382D, "get_cumulative_weights" }, + { 0x382E, "get_curfloor" }, + { 0x382F, "get_current_agent_count" }, + { 0x3834, "get_current_hive" }, + { 0x3835, "get_current_hive_lane_index" }, + { 0x3838, "get_current_sam" }, + { 0x383B, "get_current_vo_alias" }, + { 0x3845, "get_damageable_mine" }, + { 0x3846, "get_damageable_player" }, + { 0x3849, "get_datascene" }, + { 0x384B, "get_death_anim_physics_mode" }, + { 0x384D, "get_delay" }, + { 0x384E, "get_desc_by_ref" }, + { 0x3852, "get_direction_away_from_players" }, + { 0x3855, "get_dot" }, + { 0x3856, "get_downed_posture_node" }, + { 0x3857, "get_download_state_hud" }, + { 0x3858, "get_dpad_down_level" }, + { 0x385B, "get_dpad_right_level" }, + { 0x385E, "get_drill_widget_color" }, + { 0x385F, "get_drones_touching_volume" }, + { 0x3860, "get_drones_with_targetname" }, + { 0x3861, "get_drop_loop_center" }, + { 0x3866, "get_edge_tiles" }, + { 0x3867, "get_elem_position" }, + { 0x3868, "get_elevated_jump_node" }, + { 0x386B, "get_enemy_count_touching_volume" }, + { 0x3871, "get_ent" }, + { 0x3873, "get_entry" }, + { 0x3877, "get_explosion_radius" }, + { 0x387A, "get_eye_position" }, + { 0x387C, "get_flare_node" }, + { 0x387D, "get_flashed_anim" }, + { 0x3884, "get_force_color" }, + { 0x3885, "get_force_color_guys" }, + { 0x3886, "get_fov" }, + { 0x3888, "get_free_edge_node" }, + { 0x3889, "get_free_shoot_node" }, + { 0x388A, "get_friendly_crate_model" }, + { 0x388B, "get_friendly_juggernaut_crate_model" }, + { 0x388D, "get_from_entity_target" }, + { 0x388E, "get_from_spawnstruct" }, + { 0x388F, "get_from_spawnstruct_target" }, + { 0x3893, "get_func_give" }, + { 0x3894, "get_furthest_zodiac" }, + { 0x3895, "get_generic_anime" }, + { 0x389A, "get_gun_tag" }, + { 0x389D, "get_helicopter_crash_location" }, + { 0x389E, "get_heroes" }, + { 0x38A2, "get_hintstring_for_item_pickup" }, + { 0x38A3, "get_hintstring_for_pillaged_item" }, + { 0x38A5, "get_hives_destroyed_stat" }, + { 0x38A9, "get_housing_door_trigger" }, + { 0x38AF, "get_housing_musak_model" }, + { 0x38B0, "get_housing_primarylight" }, + { 0x38B3, "get_human_player" }, + { 0x38B6, "get_idle_anim" }, + { 0x38B9, "get_in_moving_vehicle" }, + { 0x38BA, "get_in_truck_nag_vo" }, + { 0x38BC, "get_in_world_area" }, + { 0x38C1, "get_is_upgrade_by_ref" }, + { 0x38C3, "get_item_desc" }, + { 0x38C4, "get_item_name" }, + { 0x38C5, "get_item_outline_color" }, + { 0x38C6, "get_jump_info" }, + { 0x38C7, "get_key" }, + { 0x38C9, "get_knife_reticle" }, + { 0x38CD, "get_last_selected_ent" }, + { 0x38CF, "get_latest_struct" }, + { 0x38D3, "get_leper_retreat_node" }, + { 0x38D6, "get_leveltime" }, + { 0x38D8, "get_linked_ents" }, + { 0x38DA, "get_linked_nodes_and_delete" }, + { 0x38DB, "get_linked_points" }, + { 0x38DC, "get_linked_struct" }, + { 0x38DD, "get_linked_structs" }, + { 0x38DE, "get_linked_vehicle_node" }, + { 0x38DF, "get_linked_vehicle_nodes" }, + { 0x38E0, "get_links" }, + { 0x38E1, "get_living_ai" }, + { 0x38E2, "get_living_ai_array" }, + { 0x38E5, "get_load_trigger_classes" }, + { 0x38E6, "get_load_trigger_funcs" }, + { 0x38E7, "get_loadout" }, + { 0x38EB, "get_locked_difficulty_val_global" }, + { 0x38EC, "get_locked_difficulty_val_player" }, + { 0x38EE, "get_lookahead_target_location" }, + { 0x38F1, "get_manhandled" }, + { 0x38F2, "get_map_soundtable" }, + { 0x38F3, "get_max_alien_count" }, + { 0x38F6, "get_max_sentry_count" }, + { 0x38FA, "get_maxxp_by_id" }, + { 0x38FB, "get_melee_painstate_info" }, + { 0x38FE, "get_meteoroid_impact_node_escape" }, + { 0x3901, "get_minutes_and_seconds" }, + { 0x3904, "get_modified_alien_amount" }, + { 0x3909, "get_name" }, + { 0x390A, "get_name_by_ref" }, + { 0x390C, "get_nerf_scalar" }, + { 0x390D, "get_next_allow_melee_time" }, + { 0x3910, "get_node_funcs_based_on_target" }, + { 0x3912, "get_noteworthy_ent" }, + { 0x3916, "get_obj_ent_hvt" }, + { 0x3917, "get_obj_event" }, + { 0x3918, "get_obj_origin" }, + { 0x3919, "get_obstacle_dodge_amount" }, + { 0x391B, "get_offset_percent" }, + { 0x391D, "get_optimal_next_path_los_check" }, + { 0x3923, "get_out_override" }, + { 0x3927, "get_outer_leftdoor" }, + { 0x392B, "get_outside_range" }, + { 0x392E, "get_pacifist" }, + { 0x3930, "get_part_fx_cost_for_action_state" }, + { 0x3931, "get_parts" }, + { 0x3932, "get_path_end_node" }, + { 0x3933, "get_path_getfunc" }, + { 0x3936, "get_perk_1_level" }, + { 0x3937, "get_perk_ref_at_upgrade_level" }, + { 0x3939, "get_pet_follow_node" }, + { 0x393A, "get_photo_copier" }, + { 0x393B, "get_phraseinvalidstr" }, + { 0x393E, "get_pistol_plane_attack" }, + { 0x393F, "get_player_currency" }, + { 0x3940, "get_player_escaped" }, + { 0x3941, "get_player_feet_from_view" }, + { 0x3943, "get_player_gameskill" }, + { 0x3944, "get_player_hesco" }, + { 0x3946, "get_player_loop_center" }, + { 0x3947, "get_player_max_currency" }, + { 0x394D, "get_player_rig" }, + { 0x394E, "get_player_score" }, + { 0x394F, "get_player_session_rankup" }, + { 0x3951, "get_player_targ" }, + { 0x3955, "get_player_xp" }, + { 0x3956, "get_players" }, + { 0x395C, "get_portable_mg_spot" }, + { 0x395D, "get_position_from_progress" }, + { 0x3961, "get_possible_attachments_by_weaponclass" }, + { 0x3967, "get_primary_death_anim_state" }, + { 0x396B, "get_prioritized_colorcoded_nodes" }, + { 0x3971, "get_random_death_sound" }, + { 0x3974, "get_random_firework_num" }, + { 0x3977, "get_random_streamer_num" }, + { 0x397D, "get_ref_by_id" }, + { 0x397E, "get_reflected_point" }, + { 0x3980, "get_resource_ref_by_index" }, + { 0x3982, "get_respawn_delay_by_index" }, + { 0x3983, "get_respawn_threshold_by_index" }, + { 0x3984, "get_retreat_node_rated" }, + { 0x3987, "get_rider_by_position" }, + { 0x398A, "get_rl_toward" }, + { 0x398D, "get_rumble_ent" }, + { 0x398E, "get_rumble_ent_linked" }, + { 0x398F, "get_scaled_alien_amount" }, + { 0x3991, "get_script_linkto_targets" }, + { 0x3993, "get_selected_dpad_down" }, + { 0x3997, "get_selected_move_vector" }, + { 0x3998, "get_selected_nerf" }, + { 0x399F, "get_shuffle_to_corner_start_anim" }, + { 0x39A0, "get_side_next_missile" }, + { 0x39A1, "get_sign" }, + { 0x39A2, "get_skill_from_index" }, + { 0x39A3, "get_sound_ent" }, + { 0x39A4, "get_spawn_event_types_array" }, + { 0x39A5, "get_spawn_event_wave_blocking_by_index" }, + { 0x39A6, "get_spawn_position" }, + { 0x39AD, "get_start_dvars" }, + { 0x39B1, "get_strip_color" }, + { 0x39B2, "get_strip_settings" }, + { 0x39B4, "get_suppress_point" }, + { 0x39B5, "get_surface_types" }, + { 0x39BE, "get_target_ent_origin" }, + { 0x39C0, "get_target_ent_target_ent" }, + { 0x39C2, "get_target_ents" }, + { 0x39C6, "get_team_prefix" }, + { 0x39C7, "get_team_substr" }, + { 0x39C9, "get_teleport_optimized_breachfriendly" }, + { 0x39CD, "get_to_train_wait_node" }, + { 0x39CE, "get_tool_hudelem" }, + { 0x39CF, "get_touching_tiles" }, + { 0x39D0, "get_trace_loc_for_target" }, + { 0x39D1, "get_trace_types" }, + { 0x39D7, "get_trigger_targs" }, + { 0x39D8, "get_turret_setup_anim" }, + { 0x39DA, "get_type_data" }, + { 0x39DB, "get_types_array" }, + { 0x39E2, "get_use_trigger" }, + { 0x39E3, "get_valid_challenge" }, + { 0x39E9, "get_vehicle_ai_spawners" }, + { 0x39EA, "get_vehicle_array" }, + { 0x39F4, "get_wash_effect" }, + { 0x39F6, "get_wave_data" }, + { 0x39F7, "get_waves" }, + { 0x39F9, "get_weapon_outline_color" }, + { 0x39FE, "get_white_overlay" }, + { 0x39FF, "get_within_range" }, + { 0x3A00, "get_world_item_spawn_pos" }, + { 0x3A05, "get_zone_to" }, + { 0x3A0A, "getactionbind" }, + { 0x3A0B, "getactiveagentsoftype" }, + { 0x3A0C, "getactiveplayerlist" }, + { 0x3A0D, "getagentdamagescalar" }, + { 0x3A0F, "getaicurrentweaponslot" }, + { 0x3A10, "getaimpitchtoshootentorpos" }, + { 0x3A14, "getairstrikedanger" }, + { 0x3A16, "getaisidearmweapon" }, + { 0x3A17, "getaliastypefromsoundalias" }, + { 0x3A18, "getallactiveparts" }, + { 0x3A19, "getallweapons" }, + { 0x3A1B, "getangleindex" }, + { 0x3A1E, "getangles_func" }, + { 0x3A24, "getanimscalefactors" }, + { 0x3A27, "getarrivalnode" }, + { 0x3A28, "getarrivalprestartpos" }, + { 0x3A2B, "getattachmentlistbasenames" }, + { 0x3A2C, "getattachmentlistuniqenames" }, + { 0x3A2D, "getattachmenttype" }, + { 0x3A2E, "getattackpoint" }, + { 0x3A31, "getaverageplayerorigin" }, + { 0x3A32, "getawardrecord" }, + { 0x3A34, "getawardtype" }, + { 0x3A35, "getawardwinners" }, + { 0x3A3B, "getbestminitarget" }, + { 0x3A3F, "getbestspawnpoint" }, + { 0x3A40, "getbeststepoutpos" }, + { 0x3A41, "getbesttarget" }, + { 0x3A42, "getbetterplayer" }, + { 0x3A45, "getbuddyspawnangles" }, + { 0x3A4A, "getcapxpscale" }, + { 0x3A4C, "getchain" }, + { 0x3A4F, "getchallengestatus" }, + { 0x3A57, "getclosest2d" }, + { 0x3A59, "getclosestfriendlyspeaker" }, + { 0x3A5A, "getclosestfx" }, + { 0x3A5C, "getclosestnode" }, + { 0x3A5D, "getclosests_flickering_model" }, + { 0x3A5E, "getcloseststartnode" }, + { 0x3A60, "getcombatspeedscalar" }, + { 0x3A62, "getcorrectcoverangles" }, + { 0x3A64, "getcovermultipretendtype" }, + { 0x3A65, "getcratetypefordroptype" }, + { 0x3A67, "getcrouchdeathanim" }, + { 0x3A6B, "getcurrentdifficultysetting" }, + { 0x3A6C, "getcurrentfraction" }, + { 0x3A6E, "getcurrentweaponxp" }, + { 0x3A73, "getdamagetype" }, + { 0x3A74, "getdeathanim" }, + { 0x3A75, "getdeathanimindex" }, + { 0x3A7A, "getdegreeselevation" }, + { 0x3A7B, "getdescription" }, + { 0x3A7C, "getdesireddrivenmovemode" }, + { 0x3A7E, "getdesiredidlepose" }, + { 0x3A80, "getdirectioncompass" }, + { 0x3A82, "getdirectionfacingclock" }, + { 0x3A87, "getdogdeathanim" }, + { 0x3A89, "getdogmoveanim" }, + { 0x3A8A, "getdognexttwitchtime" }, + { 0x3A8E, "getdogstopanimlook" }, + { 0x3A91, "getdoorside" }, + { 0x3A93, "getdvarvec" }, + { 0x3A94, "getearliestclaimplayer" }, + { 0x3A95, "getempdamageents" }, + { 0x3A96, "getenemyeyepos" }, + { 0x3A9B, "getent_or_struct" }, + { 0x3A9E, "getentarraywithflag" }, + { 0x3A9F, "getentwithflag" }, + { 0x3AA0, "geteventstate" }, + { 0x3AA1, "getexitnode" }, + { 0x3AA2, "getexitsplittime" }, + { 0x3AA3, "getexplodedistance" }, + { 0x3AAC, "getflavorburstaliases" }, + { 0x3AAD, "getflavorburstid" }, + { 0x3AB1, "getfollowmovemode" }, + { 0x3AB4, "getfraggrenadecount" }, + { 0x3AB5, "getfreeagent" }, + { 0x3AB6, "getfriendlyspawnstart" }, + { 0x3ABC, "getgenericanim" }, + { 0x3AC2, "getgunpitchtoshootentorpos" }, + { 0x3AC4, "getgvalue" }, + { 0x3AC5, "gethalftime" }, + { 0x3AC7, "gethealthcap" }, + { 0x3AC8, "gethelipilotmeshoffset" }, + { 0x3ACB, "gethighestscoringplayer" }, + { 0x3ACE, "gethostplayer" }, + { 0x3ACF, "gethvalue" }, + { 0x3AD0, "geticonshader" }, + { 0x3AD2, "getimpactpainanimindex" }, + { 0x3AD3, "getimpactpainanimstate" }, + { 0x3ADB, "getintervalsounddelaymaxdefault" }, + { 0x3ADF, "getitemweaponname" }, + { 0x3AE5, "getjumpendangles" }, + { 0x3AE6, "getjumpgravity" }, + { 0x3AE7, "getjumpinfo" }, + { 0x3AE9, "getjumpplaybackrate" }, + { 0x3AEA, "getjumpspeedmultiplier" }, + { 0x3AEC, "getjumpvelocity" }, + { 0x3AF0, "getkillstreakallteamstreak" }, + { 0x3AF1, "getkillstreakawardref" }, + { 0x3AF2, "getkillstreakcount" }, + { 0x3AF6, "getkillstreakearnedhint" }, + { 0x3AF9, "getkillstreakfromchallenge" }, + { 0x3AFA, "getkillstreakicon" }, + { 0x3AFE, "getkillstreakoverheadicon" }, + { 0x3AFF, "getkillstreakreference" }, + { 0x3B00, "getkillstreakrownum" }, + { 0x3B01, "getkillstreakscore" }, + { 0x3B04, "getkillstreakweapon" }, + { 0x3B0B, "getlaunchanimentry" }, + { 0x3B0D, "getlerptime" }, + { 0x3B0E, "getlevelcompleted" }, + { 0x3B13, "getlinkedvehiclenodes" }, + { 0x3B14, "getlinknamenodes" }, + { 0x3B18, "getlocation" }, + { 0x3B19, "getloccalloutalias" }, + { 0x3B1A, "getlookattarget" }, + { 0x3B1C, "getlosingplayers" }, + { 0x3B1D, "getlowermessage" }, + { 0x3B21, "getmapcenter" }, + { 0x3B25, "getmaxaliveenemycount" }, + { 0x3B29, "getmaxrounds" }, + { 0x3B2A, "getmaxstreakcost" }, + { 0x3B2C, "getmeleepainanimindex" }, + { 0x3B33, "getmoveanim" }, + { 0x3B34, "getmovebackentry" }, + { 0x3B35, "getmovebackstate" }, + { 0x3B3C, "getnewenemyreactionanim" }, + { 0x3B3F, "getnextflashanim" }, + { 0x3B40, "getnextlevelindex" }, + { 0x3B41, "getnextmissilespawnindex" }, + { 0x3B44, "getnextobjid" }, + { 0x3B4C, "getnodeforwardangles" }, + { 0x3B4D, "getnodeforwardyaw" }, + { 0x3B4E, "getnodefunction" }, + { 0x3B51, "getnodeorigin" }, + { 0x3B52, "getnodetype" }, + { 0x3B54, "getnodeyawtoorigin" }, + { 0x3B56, "getnormalanimtime" }, + { 0x3B57, "getnumabilitycategories" }, + { 0x3B58, "getnumactiveagents" }, + { 0x3B59, "getnumownedactiveagents" }, + { 0x3B5D, "getnumsubability" }, + { 0x3B60, "getobjectivetext" }, + { 0x3B62, "getobjpointbyname" }, + { 0x3B67, "getotherteam" }, + { 0x3B73, "getoutrig_model" }, + { 0x3B79, "getpainanim" }, + { 0x3B7D, "getparent" }, + { 0x3B7E, "getpartandstateindex" }, + { 0x3B82, "getpathnodenearplayer" }, + { 0x3B83, "getpathstart" }, + { 0x3B84, "getpercentchancetodrop" }, + { 0x3B86, "getperkforclass" }, + { 0x3B89, "getperkupgrade" }, + { 0x3B8C, "getpermutation" }, + { 0x3B8E, "getpitchtoenemy" }, + { 0x3B90, "getpitchtoshootentorpos" }, + { 0x3B94, "getplayerclaymores" }, + { 0x3B95, "getplayerfoleytype" }, + { 0x3B98, "getplayerhelispeed" }, + { 0x3B99, "getplayermodelindex" }, + { 0x3B9A, "getplayermodelname" }, + { 0x3B9B, "getplayerstat" }, + { 0x3B9D, "getplayertraceheight" }, + { 0x3B9E, "getplayerweaponhorde" }, + { 0x3BA1, "getpredictedaimyawtoshootentorpos" }, + { 0x3BA2, "getpredictedpathmidpoint" }, + { 0x3BA4, "getpreferredweapon" }, + { 0x3BA7, "getprojectiondata" }, + { 0x3BAC, "getquadrant" }, + { 0x3BAE, "getradarstrengthforcomexp" }, + { 0x3BAF, "getradarstrengthforplayer" }, + { 0x3BB1, "getradialanglefroment" }, + { 0x3BB2, "getrandomability" }, + { 0x3BB3, "getrandomanimentry" }, + { 0x3BB4, "getrandomattachments" }, + { 0x3BB7, "getrandomcratetype" }, + { 0x3BB8, "getrandomcratetypeforgamemode" }, + { 0x3BBA, "getrandomindex" }, + { 0x3BC0, "getrank" }, + { 0x3BC1, "getrankforxp" }, + { 0x3BC2, "getrankfromname" }, + { 0x3BCB, "getratiohival" }, + { 0x3BCC, "getratioloval" }, + { 0x3BCD, "getrawbaseweaponname" }, + { 0x3BCE, "getregendata" }, + { 0x3BCF, "getregenspeed" }, + { 0x3BD2, "getremainingburstdelaytime" }, + { 0x3BD7, "getreversegraphnode" }, + { 0x3BD8, "getroundintermissiontimer" }, + { 0x3BD9, "getroundswon" }, + { 0x3BE1, "getscorelimit" }, + { 0x3BE2, "getscoreperminute" }, + { 0x3BED, "getspawnpoint" }, + { 0x3BEF, "getspawnpoint_domination" }, + { 0x3BF7, "getspawnteam" }, + { 0x3BF8, "getspeakers" }, + { 0x3BFA, "getspecialroundtimer" }, + { 0x3BFB, "getsplittimes" }, + { 0x3BFE, "getsprintanim" }, + { 0x3C01, "getstance_func" }, + { 0x3C07, "getstartmoveangleindex" }, + { 0x3C09, "getstartnode" }, + { 0x3C0C, "getstat_easy" }, + { 0x3C11, "getstat_veteran" }, + { 0x3C12, "getstopanimindex" }, + { 0x3C14, "getstopdata" }, + { 0x3C23, "gettargetentpos" }, + { 0x3C25, "gettargetpredictedposition" }, + { 0x3C2A, "getteamarray" }, + { 0x3C2B, "getteamassignment" }, + { 0x3C2C, "getteambalance" }, + { 0x3C2D, "getteamcolor" }, + { 0x3C2E, "getteamcratemodel" }, + { 0x3C2F, "getteamdeploymodel" }, + { 0x3C36, "getteamflagmodel" }, + { 0x3C37, "getteamforfeitedstring" }, + { 0x3C39, "getteamhudicon" }, + { 0x3C40, "getteamspawnmusic" }, + { 0x3C42, "getteamvoiceprefix" }, + { 0x3C43, "getteamwinmusic" }, + { 0x3C47, "getthreatsovertime" }, + { 0x3C48, "gettierfromtable" }, + { 0x3C49, "gettimeinterval" }, + { 0x3C4C, "gettimepassedpercentage" }, + { 0x3C4D, "gettimeremaining" }, + { 0x3C4F, "gettimesincedompointcapture" }, + { 0x3C53, "gettranssplittime" }, + { 0x3C54, "gettruenodeangles" }, + { 0x3C55, "getturnanim" }, + { 0x3C56, "getturnanimstate" }, + { 0x3C57, "getturninplaceindex" }, + { 0x3C58, "gettweakabledvar" }, + { 0x3C59, "gettweakabledvarvalue" }, + { 0x3C5C, "getuniqueflagnameindex" }, + { 0x3C64, "getvalueinrange" }, + { 0x3C65, "getvectorarrayaverage" }, + { 0x3C6A, "getvelocity_func" }, + { 0x3C6D, "getwalkanim" }, + { 0x3C6E, "getwatcheddvar" }, + { 0x3C70, "getweaponattachmentfromchallenge" }, + { 0x3C71, "getweaponattachmentfromstats" }, + { 0x3C73, "getweaponbarsize" }, + { 0x3C76, "getweaponchoice" }, + { 0x3C77, "getweaponclass" }, + { 0x3C78, "getweaponforpos" }, + { 0x3C79, "getweaponfromchallenge" }, + { 0x3C7C, "getweaponmaxrankxp" }, + { 0x3C7E, "getweaponrankforxp" }, + { 0x3C7F, "getweaponrankinfomaxxp" }, + { 0x3C80, "getweaponrankinfominxp" }, + { 0x3C81, "getweaponrankinfoxpamt" }, + { 0x3C82, "getweaponrankxp" }, + { 0x3C84, "getweeklyref" }, + { 0x3C88, "getyaw2d" }, + { 0x3C89, "getyawangles" }, + { 0x3C8C, "getyawtoorigin" }, + { 0x3C8D, "getyawtospot" }, + { 0x3C8E, "getyawtotag" }, + { 0x3C90, "ghetto_tag_create" }, + { 0x3C92, "ghille_top" }, + { 0x3C97, "ghost_town_end" }, + { 0x3C9C, "ghost_town_sneak_end" }, + { 0x3CA1, "give_ammo_clip" }, + { 0x3CA5, "give_back_aim_over_time" }, + { 0x3CA7, "give_binoculars" }, + { 0x3CA8, "give_boost_item" }, + { 0x3CA9, "give_default" }, + { 0x3CAF, "give_hatchet" }, + { 0x3CB0, "give_health" }, + { 0x3CB3, "give_initial_perks" }, + { 0x3CB4, "give_laser" }, + { 0x3CB7, "give_loadout" }, + { 0x3CBC, "give_maxammo" }, + { 0x3CC1, "give_player_new_ref_ent_look" }, + { 0x3CC3, "give_player_points" }, + { 0x3CC5, "give_player_skill_point" }, + { 0x3CC8, "give_player_xp" }, + { 0x3CC9, "give_players_rewards" }, + { 0x3CCA, "give_point" }, + { 0x3CCB, "give_power_back" }, + { 0x3CCF, "give_soflam" }, + { 0x3CD4, "give_trophy_item" }, + { 0x3CD5, "give_underwater_weapon" }, + { 0x3CDC, "giveassistbonus" }, + { 0x3CE0, "givebonusperks" }, + { 0x3CE1, "givecarryremoteuav" }, + { 0x3CE4, "givecombathigh" }, + { 0x3CEA, "giveflagcapturexp" }, + { 0x3CEE, "givehighlight" }, + { 0x3CEF, "giveims" }, + { 0x3CF0, "givejuggernaut" }, + { 0x3CF1, "givekillreward" }, + { 0x3CF3, "givekillstreakweapon" }, + { 0x3CF5, "giveloadout" }, + { 0x3CF6, "givemarker" }, + { 0x3CF7, "givematchbonus" }, + { 0x3CF8, "giveobject" }, + { 0x3CFC, "giveperkequipment" }, + { 0x3D03, "givepointsforevent" }, + { 0x3D04, "giverandomdeployable" }, + { 0x3D05, "giverandomgun" }, + { 0x3D06, "giverankxp" }, + { 0x3D07, "giverankxp_regularmp" }, + { 0x3D09, "giverecentshieldxp" }, + { 0x3D0A, "giveresistanceperks" }, + { 0x3D0C, "giveselectedkillstreakitem" }, + { 0x3D10, "givetank" }, + { 0x3D14, "giveteamscoreforobjective" }, + { 0x3D15, "giveultimatekillstreak" }, + { 0x3D17, "giveuponsuppressiontime" }, + { 0x3D18, "giveuptime" }, + { 0x3D1E, "glass_cutter_on" }, + { 0x3D1F, "glass_cutting_fx_notetrack_handler" }, + { 0x3D28, "global_breakables_think" }, + { 0x3D29, "global_callbacks" }, + { 0x3D2A, "global_damage_func" }, + { 0x3D2E, "global_fx_array_to_string" }, + { 0x3D2F, "global_kill_func" }, + { 0x3D30, "global_spawn_functions" }, + { 0x3D31, "global_tables" }, + { 0x3D32, "globalthink" }, + { 0x3D34, "glow" }, + { 0x3D35, "glow_console" }, + { 0x3D37, "glow_model" }, + { 0x3D3E, "glowstick2_prop" }, + { 0x3D3F, "glowstick_hacking" }, + { 0x3D45, "glowstickenemyuselistener" }, + { 0x3D46, "glowstickhandledeathdamage" }, + { 0x3D48, "glowsticks" }, + { 0x3D4B, "glowstickuselistener" }, + { 0x3D4C, "glsentry_placed_listener" }, + { 0x3D4E, "gndlt" }, + { 0x3D51, "go_hit_geo" }, + { 0x3D52, "go_path_by_targetname" }, + { 0x3D54, "go_street" }, + { 0x3D57, "go_to_leaping_melee_node" }, + { 0x3D59, "go_to_node" }, + { 0x3D5C, "go_to_node_set_goal_node" }, + { 0x3D61, "go_to_struct" }, + { 0x3D62, "go_to_waiting" }, + { 0x3D63, "goal_dir" }, + { 0x3D64, "goal_fx_ent" }, + { 0x3D65, "goal_node" }, + { 0x3D6C, "goalraidus" }, + { 0x3D6F, "goback_startfunc" }, + { 0x3D71, "god_rays_from_moving_source" }, + { 0x3D72, "god_rays_from_rog" }, + { 0x3D74, "godmode" }, + { 0x3D75, "godoff" }, + { 0x3D76, "godon" }, + { 0x3D77, "godrays" }, + { 0x3D7A, "goingtoproneaim" }, + { 0x3D7D, "gold_jeep_player_door_exfil" }, + { 0x3D7E, "gold_player_door" }, + { 0x3D80, "goodaccuracy" }, + { 0x3D82, "goodfriendlydistancefromplayersquared" }, + { 0x3D83, "goodshootpos" }, + { 0x3D84, "gopath" }, + { 0x3D89, "gotocover" }, + { 0x3D8F, "grabvignetteinfo" }, + { 0x3D91, "graceperiodgrenademod" }, + { 0x3D92, "graph_position" }, + { 0x3D95, "grass_aas_approach" }, + { 0x3D96, "gravity_shift" }, + { 0x3D98, "greatestuniqueplayerkills" }, + { 0x3DA3, "grenade_cache_index" }, + { 0x3DAA, "grenade_roll_grenade" }, + { 0x3DAB, "grenade_tossed" }, + { 0x3DAD, "grenadecooldownelapsed" }, + { 0x3DB4, "grenadeorigin" }, + { 0x3DB6, "grenades" }, + { 0x3DB7, "grenades_by_difficulty" }, + { 0x3DB8, "grenades_merrick" }, + { 0x3DB9, "grenadeshielded" }, + { 0x3DBA, "grenadesplashing" }, + { 0x3DBC, "grenadethrowoffsets" }, + { 0x3DBD, "grenadethrowpose" }, + { 0x3DBE, "grenadetimers" }, + { 0x3DBF, "grenadetracking" }, + { 0x3DC6, "ground_movement" }, + { 0x3DC8, "ground_ref" }, + { 0x3DC9, "ground_ref_ent" }, + { 0x3DCB, "ground_support_locs" }, + { 0x3DD0, "group_anim" }, + { 0x3DD3, "group_flag_init" }, + { 0x3DD6, "group_get_flagname" }, + { 0x3DD7, "group_get_flagname_from_group" }, + { 0x3DDA, "group_return_groups_with_flag_set" }, + { 0x3DDB, "group_wait_group_spawned" }, + { 0x3DDC, "group_walla" }, + { 0x3DDD, "groupedanim_pos" }, + { 0x3DE0, "growl_on_path_end" }, + { 0x3DE3, "gt_get_to_cover_after_landing" }, + { 0x3DE8, "guard_b_1" }, + { 0x3DE9, "guard_b_2" }, + { 0x3DEF, "gun_down_trigger" }, + { 0x3DF7, "gun_on_ground" }, + { 0x3DF8, "gun_pickup_left" }, + { 0x3DFA, "gun_r_off" }, + { 0x3DFC, "gun_recall" }, + { 0x3DFE, "gun_removed" }, + { 0x3E00, "gun_up_for_reload" }, + { 0x3E09, "gundown_twitch" }, + { 0x3E0A, "gundown_walk" }, + { 0x3E0F, "gunfireloopfxvecthread" }, + { 0x3E12, "gunner_pain_init" }, + { 0x3E13, "gunner_pain_reset" }, + { 0x3E16, "gunnerweapon" }, + { 0x3E18, "gunship_attack_autosave" }, + { 0x3E1A, "gunship_damage" }, + { 0x3E1D, "gunship_line_attack" }, + { 0x3E1F, "gunship_line_attack_fake" }, + { 0x3E20, "gunship_sparrow_platform_loop" }, + { 0x3E21, "gunship_trans_1" }, + { 0x3E22, "gunship_trans_2" }, + { 0x3E23, "gunship_trans_3" }, + { 0x3E24, "gunship_trans_4" }, + { 0x3E28, "guy1" }, + { 0x3E2A, "guy3" }, + { 0x3E2E, "guy_cleanup_vehiclevars" }, + { 0x3E2F, "guy_death" }, + { 0x3E30, "guy_deathhandle" }, + { 0x3E31, "guy_deathimate_me" }, + { 0x3E32, "guy_do_animation" }, + { 0x3E35, "guy_duck_once" }, + { 0x3E37, "guy_duck_out" }, + { 0x3E38, "guy_enter" }, + { 0x3E3A, "guy_fridge_beers" }, + { 0x3E3C, "guy_goes_directly_to_turret" }, + { 0x3E3D, "guy_goes_to_struct_animates" }, + { 0x3E43, "guy_idle_alert_to_casual" }, + { 0x3E4E, "guy_runtovehicle_load" }, + { 0x3E4F, "guy_runtovehicle_loaded" }, + { 0x3E52, "guy_should_man_turret" }, + { 0x3E57, "guy_turn_hardleft" }, + { 0x3E59, "guy_turn_left" }, + { 0x3E5B, "guy_turn_right" }, + { 0x3E5D, "guy_turret_fire" }, + { 0x3E5E, "guy_turret_turnleft" }, + { 0x3E63, "guy_unset_allowdeath" }, + { 0x3E66, "guy_weave" }, + { 0x3E67, "guy_weave_check" }, + { 0x3E6C, "hacking_eyes_and_ears" }, + { 0x3E6D, "hacking_music" }, + { 0x3E71, "halftimeroundenddelay" }, + { 0x3E72, "halftimesubcaption" }, + { 0x3E75, "hall_clear_vo" }, + { 0x3E77, "hall_redshirt_talk" }, + { 0x3E7A, "hallway_crossing_middle" }, + { 0x3E7C, "hallway_encounter" }, + { 0x3E85, "halon_system_fog_on" }, + { 0x3E86, "halon_system_killstreak" }, + { 0x3E8A, "hand_icon" }, + { 0x3E8B, "hand_icon_count" }, + { 0x3E90, "hand_icons" }, + { 0x3E95, "handle_ally_bag_vis" }, + { 0x3E98, "handle_ambush_return_spot" }, + { 0x3E9B, "handle_approach_anims_end" }, + { 0x3E9E, "handle_autoturret_chatter" }, + { 0x3EA0, "handle_backpack_objective" }, + { 0x3EA4, "handle_baker_intro_anim" }, + { 0x3EA6, "handle_basement_guys2" }, + { 0x3EAA, "handle_binocular_zoom_magnet" }, + { 0x3EAE, "handle_breach_door" }, + { 0x3EB4, "handle_cipher_intro_anim" }, + { 0x3EB9, "handle_combat_guys2" }, + { 0x3EBD, "handle_cqb_pip_cams" }, + { 0x3EC2, "handle_death" }, + { 0x3EC6, "handle_delete" }, + { 0x3ECB, "handle_dismount" }, + { 0x3ECC, "handle_dog_ambush" }, + { 0x3ECD, "handle_dog_chaos" }, + { 0x3ECF, "handle_dog_combat_defend" }, + { 0x3ED1, "handle_dog_defend" }, + { 0x3ED3, "handle_dog_hud" }, + { 0x3ED5, "handle_dog_interior_attack" }, + { 0x3ED8, "handle_dog_modes" }, + { 0x3ED9, "handle_dog_targeting_chaos" }, + { 0x3EDB, "handle_dogbite_notetrack" }, + { 0x3EDC, "handle_drill_spot" }, + { 0x3EDD, "handle_drilling" }, + { 0x3EDE, "handle_drone" }, + { 0x3EDF, "handle_drone_nags" }, + { 0x3EE1, "handle_enemies_behind_player" }, + { 0x3EE6, "handle_exploders" }, + { 0x3EEB, "handle_finale_drones" }, + { 0x3EEE, "handle_first_doorway_allies" }, + { 0x3EEF, "handle_flare_slow" }, + { 0x3EF1, "handle_fog_changes" }, + { 0x3EF2, "handle_friendly_fail" }, + { 0x3EF3, "handle_front_elevator" }, + { 0x3EF9, "handle_ghost_chopper_removal" }, + { 0x3EFA, "handle_glowstick" }, + { 0x3EFD, "handle_grenade_thrown_failcase" }, + { 0x3EFF, "handle_gunner_pain" }, + { 0x3F00, "handle_hesh_teleport" }, + { 0x3F04, "handle_intro_fx" }, + { 0x3F05, "handle_intro_sniper_outline" }, + { 0x3F0C, "handle_jet3_fx" }, + { 0x3F0F, "handle_jet_taxi" }, + { 0x3F10, "handle_keegan_intro_anim" }, + { 0x3F12, "handle_landing" }, + { 0x3F15, "handle_lights" }, + { 0x3F18, "handle_looper" }, + { 0x3F1B, "handle_m32_launcher" }, + { 0x3F1C, "handle_mg_firing" }, + { 0x3F23, "handle_moving_platform_invalid" }, + { 0x3F2B, "handle_phys_debris" }, + { 0x3F2E, "handle_platform_blockers" }, + { 0x3F34, "handle_radiotower_guy" }, + { 0x3F38, "handle_rappel_inverted" }, + { 0x3F3E, "handle_rider_death" }, + { 0x3F45, "handle_sentry_placement_failed" }, + { 0x3F46, "handle_shadow_kill" }, + { 0x3F47, "handle_skip_rpg_sniping" }, + { 0x3F48, "handle_sliding_osprey_fx" }, + { 0x3F49, "handle_slow_movement" }, + { 0x3F4C, "handle_spotlight_enemy_b" }, + { 0x3F4D, "handle_stage_two_fx" }, + { 0x3F4E, "handle_stairs" }, + { 0x3F4F, "handle_starts" }, + { 0x3F53, "handle_strobe_on_hint" }, + { 0x3F54, "handle_tank_death" }, + { 0x3F57, "handle_teargas_grenades" }, + { 0x3F5D, "handle_truck_shooting" }, + { 0x3F60, "handle_unresolved_collision" }, + { 0x3F62, "handle_vehicles_near_iceholes" }, + { 0x3F67, "handle_weapon_melee_toggle" }, + { 0x3F6D, "handleapdamage" }, + { 0x3F71, "handlebranchnode" }, + { 0x3F73, "handlecleanupputaway" }, + { 0x3F76, "handledeathdamage" }, + { 0x3F7B, "handleemp" }, + { 0x3F7C, "handleempdamage" }, + { 0x3F7D, "handlefirstelitearrival" }, + { 0x3F7F, "handlefriendlyfiredeath" }, + { 0x3F80, "handlegrenadedamage" }, + { 0x3F81, "handlehostmigration" }, + { 0x3F84, "handleinsolid" }, + { 0x3F88, "handlemeleedamage" }, + { 0x3F8C, "handlenotetrack" }, + { 0x3F8F, "handleownerleft" }, + { 0x3F96, "handlescavengerbagpickup" }, + { 0x3F97, "handlesidetosidenotetracks" }, + { 0x3FA0, "handletraversedeathnotetrack" }, + { 0x3FA4, "handleunreslovedcollision" }, + { 0x3FA5, "handleuse" }, + { 0x3FA7, "handleworlddeath" }, + { 0x3FB0, "hangar_wall_debris" }, + { 0x3FB2, "hangar_wall_shot" }, + { 0x3FB9, "hanging_cargo_motion" }, + { 0x3FBA, "harassers_ignore_player" }, + { 0x3FBB, "hardcoremode" }, + { 0x3FBD, "hardpointtweaks" }, + { 0x3FBE, "hardpointtype" }, + { 0x3FC7, "harrierexplode" }, + { 0x3FCA, "harriers" }, + { 0x3FCF, "has_attack_abort_been_requested" }, + { 0x3FD4, "has_char_group" }, + { 0x3FD5, "has_cold_breath" }, + { 0x3FDB, "has_health_pack" }, + { 0x3FDD, "has_homing_missiles" }, + { 0x3FDE, "has_ims" }, + { 0x3FE1, "has_loadout" }, + { 0x3FE3, "has_model" }, + { 0x3FE5, "has_passive_breacher" }, + { 0x3FEB, "has_script_parameters" }, + { 0x3FF0, "has_special_weapon" }, + { 0x3FF1, "has_straight_missiles" }, + { 0x3FF2, "has_stun_ammo" }, + { 0x3FF3, "has_target_shader" }, + { 0x3FF4, "has_terrain" }, + { 0x3FF7, "has_weapon_variation" }, + { 0x3FFE, "hasattachedweapons" }, + { 0x4004, "hasdied" }, + { 0x4005, "hasdisplayvalue" }, + { 0x4008, "hasdonecombat" }, + { 0x400A, "hasenemysightpos" }, + { 0x400B, "hasexplosivefired" }, + { 0x400E, "hashelicopterdustkickup" }, + { 0x400F, "hashelicopterturret" }, + { 0x4010, "hashima" }, + { 0x4012, "hashimacustomcratefunc" }, + { 0x4019, "haslightarmor" }, + { 0x401A, "hasmissionhardenedaward" }, + { 0x401E, "hasprogressbar" }, + { 0x401F, "hasregenfaster" }, + { 0x4020, "hasriotshield" }, + { 0x4023, "hasspawned" }, + { 0x4025, "hasstarted" }, + { 0x4026, "hassuppressableenemy" }, + { 0x402F, "have_flashlight" }, + { 0x4032, "havenothingtoshoot" }, + { 0x4035, "hazmat_find_gun" }, + { 0x4039, "hazmat_if_hazmat" }, + { 0x403B, "hazmat_react" }, + { 0x403C, "hazmat_run_away" }, + { 0x4042, "hdrsuncolorintensity" }, + { 0x4043, "head_shield_activated" }, + { 0x4047, "heading" }, + { 0x4049, "headlamp_death_blink" }, + { 0x4050, "health_drain" }, + { 0x4058, "healthregen" }, + { 0x405A, "healthregendisabled" }, + { 0x405C, "healthregenerated_regularmp" }, + { 0x405F, "healthregeninit" }, + { 0x4063, "heartbeat_rumble" }, + { 0x4064, "heartbeatrate" }, + { 0x4065, "heat" }, + { 0x4066, "heat_column_fx" }, + { 0x4069, "heat_warn_toggle" }, + { 0x406A, "heatlevel" }, + { 0x406B, "heavy_quake" }, + { 0x406C, "heavyarmorhp" }, + { 0x406D, "heightforhighcallout" }, + { 0x406E, "heightrange" }, + { 0x406F, "heli" }, + { 0x4070, "heli_ai_can_hit_target" }, + { 0x4073, "heli_ai_collision_cylinder_setup" }, + { 0x4074, "heli_ai_gather_targets" }, + { 0x4078, "heli_ai_shoot_target" }, + { 0x407A, "heli_angle_offset" }, + { 0x407C, "heli_anims_length" }, + { 0x407E, "heli_array_setup" }, + { 0x407F, "heli_attack1" }, + { 0x4083, "heli_attract_range" }, + { 0x4089, "heli_beach_lander_leave" }, + { 0x408C, "heli_can_see_target" }, + { 0x408D, "heli_chopper_impact" }, + { 0x4093, "heli_combat_path" }, + { 0x4094, "heli_combat_respawn" }, + { 0x4098, "heli_crash_blade_hit_2" }, + { 0x409B, "heli_crash_box_hit_1" }, + { 0x409C, "heli_crash_box_hit_2" }, + { 0x409D, "heli_crash_engine_fail" }, + { 0x40A0, "heli_crash_kill" }, + { 0x40A6, "heli_damage_update" }, + { 0x40A9, "heli_decides_to_shoot_missile_at_ai" }, + { 0x40B1, "heli_engine_lp_02" }, + { 0x40B6, "heli_explode" }, + { 0x40BA, "heli_fire_turret" }, + { 0x40BF, "heli_firelink" }, + { 0x40C0, "heli_fireminigun_cheap" }, + { 0x40C1, "heli_firemissile_noexplode" }, + { 0x40C2, "heli_flock" }, + { 0x40C3, "heli_flock_victims" }, + { 0x40CB, "heli_flyin_mudpumps" }, + { 0x40D0, "heli_get_node_origin" }, + { 0x40D3, "heli_get_target_player_only" }, + { 0x40D5, "heli_goal_think" }, + { 0x40DE, "heli_jump_fire_fail" }, + { 0x40E4, "heli_leave_on_changeteams" }, + { 0x40E5, "heli_leave_on_disconnect" }, + { 0x40E7, "heli_leave_on_nuke" }, + { 0x40EC, "heli_loop_nodes" }, + { 0x40EF, "heli_loop_speed_control" }, + { 0x40F0, "heli_lp" }, + { 0x40F1, "heli_maxhealth" }, + { 0x40FB, "heli_pilot" }, + { 0x4100, "heli_pilot_monitor_flares" }, + { 0x4101, "heli_pilot_pick_node" }, + { 0x4102, "heli_pilot_waittill_initial_goal" }, + { 0x4108, "heli_setup" }, + { 0x4109, "heli_shells" }, + { 0x410A, "heli_shoot_think" }, + { 0x410F, "heli_sniper_waittill_initial_goal" }, + { 0x4111, "heli_spawn" }, + { 0x4119, "heli_spotlight_cleanup" }, + { 0x4121, "heli_spotlight_think" }, + { 0x4125, "heli_strafing_run" }, + { 0x4126, "heli_strafing_think" }, + { 0x4130, "heli_targeting_delay" }, + { 0x4132, "heli_think" }, + { 0x4136, "heli_turret_think" }, + { 0x4139, "heli_type" }, + { 0x413E, "heli_vs_heli_mg_range_2d_squared" }, + { 0x4140, "heli_wait_node" }, + { 0x4145, "heliconfigs" }, + { 0x4146, "helicopter_crash" }, + { 0x4148, "helicopter_crash_flavor" }, + { 0x414B, "helicopter_crash_path" }, + { 0x414E, "helicopter_fail" }, + { 0x4151, "helicopter_jump" }, + { 0x4153, "helicopter_predator_target_shader" }, + { 0x4157, "helidialog" }, + { 0x415B, "heliguardsettings" }, + { 0x415F, "helileave" }, + { 0x4161, "helipickup" }, + { 0x4166, "helipilot_leave" }, + { 0x4168, "helipilot_setairstartnodes" }, + { 0x416A, "helipilot_watchdeath" }, + { 0x416C, "helipilot_watchownerloss" }, + { 0x416E, "helipilot_watchtimeout" }, + { 0x416F, "helipilotsettings" }, + { 0x4170, "helipilottype" }, + { 0x4172, "heliridelifeid" }, + { 0x4174, "helis_can_respawn" }, + { 0x4176, "helisniper" }, + { 0x4177, "helispawning" }, + { 0x417A, "helmet_damage_test" }, + { 0x417F, "helmet_swap_keegan" }, + { 0x4181, "helmetpop" }, + { 0x4182, "helmetsidemodel" }, + { 0x418B, "help_baker_control_panel_vo" }, + { 0x418C, "help_near_comps" }, + { 0x4194, "hero_train_impact" }, + { 0x4199, "heroonly" }, + { 0x419C, "hesco_logic" }, + { 0x419F, "hesh" }, + { 0x41A5, "hesh_close_to_knockdown" }, + { 0x41A9, "hesh_dialogue_pacing" }, + { 0x41AE, "hesh_gate_logic" }, + { 0x41B0, "hesh_getin_truck" }, + { 0x41B1, "hesh_gunship_run" }, + { 0x41B3, "hesh_hide_dsm" }, + { 0x41B9, "hesh_logic" }, + { 0x41BA, "hesh_looks_at_cam" }, + { 0x41BE, "hesh_nag_til_flag" }, + { 0x41C1, "hesh_regroup_nag_vo" }, + { 0x41C2, "hesh_ride_chopper" }, + { 0x41CA, "hesh_waits_for_player" }, + { 0x41CD, "hidden_parts" }, + { 0x41D0, "hidden_terrain" }, + { 0x41D1, "hide_ai_sight_brushes" }, + { 0x41D2, "hide_and_drop_entity" }, + { 0x41D3, "hide_and_show" }, + { 0x41D5, "hide_bink_brush" }, + { 0x41D6, "hide_combat_two_intro_debris" }, + { 0x41DA, "hide_dufflebags" }, + { 0x41DB, "hide_end_bridge_geo" }, + { 0x41DD, "hide_exploder_models" }, + { 0x41E6, "hide_hint" }, + { 0x41E8, "hide_if_defined" }, + { 0x41EA, "hide_loco_exterior" }, + { 0x41EC, "hide_mask" }, + { 0x41EE, "hide_missile_launcher_collision" }, + { 0x41EF, "hide_models_by_targetname" }, + { 0x41F0, "hide_normal_hud_elements" }, + { 0x41F1, "hide_notsolid" }, + { 0x41F3, "hide_player_arms_sleeve_flaps" }, + { 0x41FA, "hide_turret" }, + { 0x41FB, "hide_turret_icon" }, + { 0x4201, "hidecarryiconongameend" }, + { 0x4207, "hidehudelementongameend" }, + { 0x420C, "hidespendhinticon" }, + { 0x420E, "hideworldiconongameend" }, + { 0x4210, "hiding" }, + { 0x4213, "high_priority_for" }, + { 0x4214, "high_priority_hint" }, + { 0x4216, "highestwins" }, + { 0x4217, "highlightairdrop" }, + { 0x4218, "highlightallenemies" }, + { 0x421E, "highy" }, + { 0x4220, "hill_chopper" }, + { 0x4221, "hill_enemy_on_spotted" }, + { 0x4224, "hill_holders" }, + { 0x4227, "hill_squad" }, + { 0x422C, "hind_projectile_damagestate" }, + { 0x4230, "hint_active" }, + { 0x4231, "hint_ascend_func" }, + { 0x4235, "hint_breakfunc" }, + { 0x4237, "hint_bridge_2" }, + { 0x423B, "hint_create" }, + { 0x423D, "hint_delete" }, + { 0x4240, "hint_fontscale" }, + { 0x4241, "hint_for_first_attack" }, + { 0x4243, "hint_guided_round_guiding_off" }, + { 0x4244, "hint_jump_off" }, + { 0x4246, "hint_machine_gun_off" }, + { 0x4247, "hint_missile_lock" }, + { 0x4248, "hint_neverbreak" }, + { 0x424C, "hint_smoke_off" }, + { 0x4252, "hint_timeout" }, + { 0x4253, "hint_toggle_thermal_off" }, + { 0x4256, "hint_zoom_off" }, + { 0x4257, "hintbackground" }, + { 0x4258, "hintbackground1" }, + { 0x4259, "hintbackground2" }, + { 0x425E, "hintexit" }, + { 0x4260, "hintmessage" }, + { 0x426A, "hit_bullet_armor" }, + { 0x426B, "hit_chain_dialogue" }, + { 0x426F, "hit_panel_rumble" }, + { 0x4270, "hit_player" }, + { 0x4272, "hit_surface" }, + { 0x4273, "hit_vo" }, + { 0x4277, "hitloc" }, + { 0x427B, "hitroundlimit" }, + { 0x4284, "hive_dependencies" }, + { 0x4285, "hive_drill_listener" }, + { 0x4289, "hive_outline_monitor" }, + { 0x428D, "hive_play_death_animations" }, + { 0x428F, "hive_play_first_pain_animations" }, + { 0x4290, "hive_play_second_pain_animations" }, + { 0x4291, "hive_score_bbprint" }, + { 0x4298, "hold_count_check" }, + { 0x4299, "hold_fire_unless_ads" }, + { 0x429D, "holdstancechange" }, + { 0x42A0, "homecoming_locations" }, + { 0x42A5, "hopper_wheel_think" }, + { 0x42AB, "hordecrateperkthink" }, + { 0x42AC, "hordecrateweaponthink" }, + { 0x42AE, "hordedroplocations" }, + { 0x42B0, "hordeendgame" }, + { 0x42B4, "hordemaydropweapon" }, + { 0x42B5, "hordesetupdogstate" }, + { 0x42B9, "horn" }, + { 0x42BB, "hose_fx" }, + { 0x42BD, "hostage_b" }, + { 0x42BF, "hostage_fire_single_right" }, + { 0x42C0, "hostage_fire_spray" }, + { 0x42C1, "hostage_health_regen" }, + { 0x42C7, "hostilesspawned" }, + { 0x42CA, "hostmigrationtimer" }, + { 0x42CC, "hostmigrationtimerthink_internal" }, + { 0x42D0, "hotel_parking_car_hide" }, + { 0x42D2, "house_attack_slowmo" }, + { 0x42D3, "house_deer" }, + { 0x42D4, "house_enter" }, + { 0x42D9, "house_secondfloor_exploder" }, + { 0x42DA, "house_secondfloor_exploder_off" }, + { 0x42DD, "hovercraft_ai_pathstarts" }, + { 0x42E0, "hovercraft_artillery_incoming_missile" }, + { 0x42E1, "hovercraft_artillery_player_weapon" }, + { 0x42E8, "hovercraft_drone_fightspots" }, + { 0x42EE, "hovercraft_missile_barrage" }, + { 0x42EF, "hovercraft_missile_barrage_player" }, + { 0x42F2, "hovercraft_tanks_setup" }, + { 0x42FA, "hovercraftdroneunloader" }, + { 0x42FB, "hovercraftlanders" }, + { 0x42FF, "hovercraftsmokeents" }, + { 0x4300, "hovercrafttanks" }, + { 0x4302, "hp" }, + { 0x4303, "hud" }, + { 0x4306, "hud2" }, + { 0x430C, "hud_color_ally" }, + { 0x430D, "hud_compass_elem" }, + { 0x430E, "hud_countfree_flares" }, + { 0x4311, "hud_debug_add" }, + { 0x4313, "hud_debug_add_frac" }, + { 0x4316, "hud_debug_add_second_string" }, + { 0x4317, "hud_debug_add_string" }, + { 0x431C, "hud_enemy_missile_lockon" }, + { 0x431D, "hud_enemy_tracker" }, + { 0x4325, "hud_highlight_homing_missile" }, + { 0x432D, "hud_makenotavailable_availablemissileicon" }, + { 0x432F, "hud_mantle" }, + { 0x4330, "hud_markavailable_firstusedmissileicon" }, + { 0x4332, "hud_marklocked_firstavailablemissileicon" }, + { 0x4333, "hud_markunlocked_firstlockedmissileicon" }, + { 0x4335, "hud_markused_freemissileicon" }, + { 0x4336, "hud_mask_model" }, + { 0x4338, "hud_mg_inactive" }, + { 0x4339, "hud_missile_active" }, + { 0x433B, "hud_missile_warning" }, + { 0x433C, "hud_monitorplayerownership" }, + { 0x433E, "hud_offset" }, + { 0x4342, "hud_outlineenable_static" }, + { 0x4344, "hud_player_target_hide_at_min" }, + { 0x4345, "hud_scubamask" }, + { 0x434D, "hud_space_helmet_rim" }, + { 0x434E, "hud_start" }, + { 0x434F, "hud_static_overlay" }, + { 0x4357, "hud_update_speed" }, + { 0x435B, "huddelete" }, + { 0x435D, "hudelem_count" }, + { 0x4360, "hudelems" }, + { 0x4362, "huditemshide" }, + { 0x4363, "huditemsshow" }, + { 0x436A, "hudoutline_wait_death" }, + { 0x436B, "huds" }, + { 0x436C, "hudsetpoint_func" }, + { 0x4373, "hummer_spawn_func" }, + { 0x4377, "humvee_turret_guy_gettin_func" }, + { 0x4379, "hunted_style_door_open" }, + { 0x437F, "hurtgen_style" }, + { 0x4380, "hvt_dog_bark" }, + { 0x4382, "hvt_guys_in_position" }, + { 0x4385, "hvt_office_chair" }, + { 0x4386, "hvt_office_doors" }, + { 0x4389, "hvt_office_hesh" }, + { 0x438B, "hvt_office_hvt_death" }, + { 0x438D, "hvt_office_light" }, + { 0x438E, "hvt_office_merrick" }, + { 0x438F, "hvt_office_player" }, + { 0x4390, "hvt_office_props" }, + { 0x4394, "hvt_reach_and_animate" }, + { 0x43A5, "icehole_achievement" }, + { 0x43A7, "icehole_shards" }, + { 0x43AA, "icon_always_show" }, + { 0x43AC, "icon_fade_in" }, + { 0x43AD, "icon_fade_out" }, + { 0x43AE, "icon_name" }, + { 0x43B0, "iconelem" }, + { 0x43B5, "iconvisall" }, + { 0x43B9, "idflags" }, + { 0x43BB, "idflags_no_knockback" }, + { 0x43BF, "idflags_penetration" }, + { 0x43C2, "idflags_shield_explosive_impact_huge" }, + { 0x43D0, "idle_break_anim_active" }, + { 0x43D3, "idle_hardleft" }, + { 0x43DA, "idle_reach_node" }, + { 0x43DB, "idle_right" }, + { 0x43DD, "idle_struct_animating_node" }, + { 0x43DF, "idleanim" }, + { 0x43E0, "idleanimtype" }, + { 0x43E2, "idlelookattargets" }, + { 0x43E3, "idleoccurrence" }, + { 0x43E6, "idlesound_waitfordoneordeath" }, + { 0x43EC, "idlewait" }, + { 0x43EE, "idlingatcover" }, + { 0x43F2, "iflashfuse" }, + { 0x43F7, "ignore_me_ignore_all" }, + { 0x43FB, "ignore_move_suppression" }, + { 0x4400, "ignore_run" }, + { 0x4408, "ignoreall_false_end_anim" }, + { 0x4409, "ignoreall_on_end" }, + { 0x440B, "ignored_by_attack_heli" }, + { 0x440D, "ignoreeachother" }, + { 0x440F, "ignoreorigin" }, + { 0x4412, "ignoresightpos" }, + { 0x4417, "impact_loc" }, + { 0x4421, "impulse_push" }, + { 0x4428, "ims_handleownerdisconnect" }, + { 0x442A, "ims_hideallparts" }, + { 0x442B, "ims_modifydamage" }, + { 0x442D, "ims_oncarrierdeath" }, + { 0x442E, "ims_oncarrierdisconnect" }, + { 0x4433, "ims_setactive" }, + { 0x4434, "ims_setcancelled" }, + { 0x4435, "ims_setcarried" }, + { 0x443B, "imscreateexplosive" }, + { 0x4441, "imsopendoor" }, + { 0x4445, "in_alien_mode" }, + { 0x4446, "in_attack" }, + { 0x4448, "in_deathsdoor" }, + { 0x4450, "in_spawnspectator" }, + { 0x4451, "in_to_jeep" }, + { 0x4454, "in_world_area" }, + { 0x4458, "inairanimentry" }, + { 0x445A, "inboundsfx" }, + { 0x445C, "inc" }, + { 0x445D, "inc4death" }, + { 0x4465, "inc_escaped_stat" }, + { 0x4466, "inc_hives_destroyed_stat" }, + { 0x4468, "inc_prestige_nerfs_stat" }, + { 0x446A, "inc_score_stat" }, + { 0x446B, "inc_session_stat" }, + { 0x446C, "inc_stat" }, + { 0x446D, "inc_xp_stat" }, + { 0x4474, "incoming_sound" }, + { 0x447C, "incranimaimweight" }, + { 0x447F, "increase_difficulty" }, + { 0x4481, "increase_threatbias" }, + { 0x4485, "incrementalivecount" }, + { 0x4489, "index" }, + { 0x448A, "index_col" }, + { 0x448B, "index_is_selected" }, + { 0x448C, "index_map" }, + { 0x448D, "indexarray" }, + { 0x448E, "indexnumber" }, + { 0x4490, "indoor_think" }, + { 0x4491, "indoorcqbtogglecheck" }, + { 0x4492, "infantry_guys" }, + { 0x4493, "infantry_teleport_start" }, + { 0x4497, "infect_chosefirstinfected" }, + { 0x44A1, "infil_allow_movement" }, + { 0x44A2, "infil_allowed_slide" }, + { 0x44A3, "infil_ally" }, + { 0x44A5, "infil_cleanup" }, + { 0x44A7, "infil_entry_lock" }, + { 0x44A8, "infil_explosions" }, + { 0x44A9, "infil_flyin_allies" }, + { 0x44AB, "infil_flyin_battle_init" }, + { 0x44AC, "infil_flyin_old" }, + { 0x44B0, "infil_grenade" }, + { 0x44B1, "infil_grenade_delete" }, + { 0x44B3, "infil_heli_anim_skip" }, + { 0x44B7, "infil_lights_and_vision" }, + { 0x44B8, "infil_movement_step" }, + { 0x44B9, "infil_object_hide" }, + { 0x44BC, "infil_path_offset" }, + { 0x44C4, "infil_rpg_guy" }, + { 0x44C5, "infil_sidestreet" }, + { 0x44C8, "infil_vignette" }, + { 0x44CD, "infinite_event_index" }, + { 0x44D3, "informattacking" }, + { 0x44D6, "informreloading" }, + { 0x44DA, "infront" }, + { 0x44E0, "init_a10" }, + { 0x44E2, "init_ai_space_animsets" }, + { 0x44E7, "init_alien_idle" }, + { 0x44E9, "init_ambient" }, + { 0x44ED, "init_animated_dufflebags_baker" }, + { 0x44EE, "init_animated_dufflebags_candk" }, + { 0x44EF, "init_animatedmodels" }, + { 0x44F1, "init_anims_human" }, + { 0x44F2, "init_anims_player" }, + { 0x44F3, "init_animset_ambush" }, + { 0x44F4, "init_animset_combat" }, + { 0x44F8, "init_animset_cover_multi" }, + { 0x44FA, "init_animset_cover_right" }, + { 0x44FB, "init_animset_cover_wall" }, + { 0x44FC, "init_animset_cqb_move" }, + { 0x44FD, "init_animset_cqb_stand" }, + { 0x44FF, "init_animset_custom_stand" }, + { 0x4500, "init_animset_death" }, + { 0x4501, "init_animset_default_crouch" }, + { 0x4504, "init_animset_flashed" }, + { 0x4507, "init_animset_heat_stand" }, + { 0x4508, "init_animset_idle" }, + { 0x450B, "init_animset_pain" }, + { 0x450D, "init_animset_reactions" }, + { 0x450E, "init_animset_rpg_crouch" }, + { 0x4513, "init_animset_shotgun_stand" }, + { 0x4516, "init_animsounds_for_animname" }, + { 0x4518, "init_audio" }, + { 0x451B, "init_biasgroups" }, + { 0x451C, "init_blocker_hive_animation_state" }, + { 0x451D, "init_bot_attachmenttable" }, + { 0x4522, "init_challenge_type" }, + { 0x4524, "init_chaos_animset" }, + { 0x4527, "init_color_grouping" }, + { 0x4528, "init_color_helper_triggers" }, + { 0x452A, "init_colors" }, + { 0x452C, "init_combat_resource_from_table" }, + { 0x452E, "init_combat_resource_overrides" }, + { 0x452F, "init_combat_resources" }, + { 0x4531, "init_creepwalk_archetype" }, + { 0x4533, "init_dam_destruction_anim" }, + { 0x4534, "init_damage_feedback" }, + { 0x453B, "init_dog_anims" }, + { 0x453E, "init_drill_drop_loc" }, + { 0x4547, "init_filter" }, + { 0x454B, "init_fog_transition" }, + { 0x454D, "init_fx" }, + { 0x454F, "init_gamescore" }, + { 0x4552, "init_helicopters" }, + { 0x4553, "init_helo" }, + { 0x4558, "init_hive_locs" }, + { 0x4559, "init_hover" }, + { 0x4563, "init_levelvariables" }, + { 0x4564, "init_light_def" }, + { 0x4565, "init_lights" }, + { 0x4567, "init_lit_model" }, + { 0x456A, "init_localoilrocks" }, + { 0x456E, "init_mgturretsettings" }, + { 0x4570, "init_mix" }, + { 0x4571, "init_move_transition_arrays" }, + { 0x4577, "init_occlusion" }, + { 0x4579, "init_patrol_paths" }, + { 0x457A, "init_perk_bullet_damage" }, + { 0x4580, "init_perks" }, + { 0x4581, "init_perks_callback" }, + { 0x4584, "init_personality_camper" }, + { 0x458A, "init_player_hud_onconnect" }, + { 0x458B, "init_player_limp" }, + { 0x458E, "init_player_rig" }, + { 0x458F, "init_player_score" }, + { 0x4590, "init_player_space" }, + { 0x4594, "init_player_unlock" }, + { 0x4595, "init_post_main" }, + { 0x4597, "init_radio_dialogue" }, + { 0x4599, "init_reverb" }, + { 0x459D, "init_screeneffect_vars" }, + { 0x45A0, "init_scripted_light" }, + { 0x45A4, "init_shooter" }, + { 0x45A5, "init_shooter_anims" }, + { 0x45AC, "init_spawn_node_info" }, + { 0x45AE, "init_squadbattlechatter" }, + { 0x45B7, "init_take_cover_warnings" }, + { 0x45BC, "init_threatbiasgroups" }, + { 0x45C1, "init_tracks" }, + { 0x45C3, "init_tunnel" }, + { 0x45C6, "init_uphill_jog_animset" }, + { 0x45C9, "init_vehicles" }, + { 0x45CC, "init_vo_system" }, + { 0x45CF, "init_whizby" }, + { 0x45D0, "init_wind_if_uninitialized" }, + { 0x45D3, "initactivisioncredits" }, + { 0x45D8, "initalienanims" }, + { 0x45D9, "initaliencannedtraverses" }, + { 0x45DA, "initaliendeath" }, + { 0x45DD, "initalienvosystem" }, + { 0x45E0, "initanimtree" }, + { 0x45E2, "initatvicredits_blade" }, + { 0x45E4, "initatvicredits_central_tech" }, + { 0x45E8, "initatvicredits_global" }, + { 0x45EA, "initatvicredits_qa1" }, + { 0x45EB, "initatvicredits_qa2" }, + { 0x45F1, "initbaseaward" }, + { 0x45F2, "initbattlechatter" }, + { 0x45F3, "initbombsquaddata" }, + { 0x45F7, "initcharacterface" }, + { 0x45FB, "initcontact" }, + { 0x4601, "initdoganimations" }, + { 0x4605, "initdogarchetype_reaction" }, + { 0x4608, "initdogvestanimations" }, + { 0x4609, "initdot" }, + { 0x4610, "initgameflags" }, + { 0x4612, "initglobals" }, + { 0x4615, "inithandsignals" }, + { 0x4616, "inithordesettings" }, + { 0x4619, "initial_dist_z_from_top" }, + { 0x461B, "initial_edge_ally_left" }, + { 0x461E, "initial_spawn" }, + { 0x4620, "initialdelay" }, + { 0x4621, "initialdmscoreupdate" }, + { 0x4628, "initializematchrules" }, + { 0x462A, "initiated" }, + { 0x462B, "initinsertionvehicles" }, + { 0x462D, "initiw6atvicredits" }, + { 0x462E, "initiw6credits" }, + { 0x4634, "initlevelflags" }, + { 0x4637, "initmovestartstoptransitions" }, + { 0x463C, "initpainfx" }, + { 0x4643, "initplayerstat" }, + { 0x4644, "initplayerstats" }, + { 0x4646, "initprisonerloadout" }, + { 0x464A, "initridekillstreak_internal" }, + { 0x464C, "initscoreboard" }, + { 0x4650, "initspawns" }, + { 0x4651, "initstat" }, + { 0x4653, "initstate" }, + { 0x4659, "initweapon" }, + { 0x465A, "initwindowtraverse" }, + { 0x465C, "inovertime" }, + { 0x465D, "inplayerportableradar" }, + { 0x465E, "inplayerscrambler" }, + { 0x4674, "insyncmeleewithtarget" }, + { 0x4677, "intel_items" }, + { 0x4678, "intel_think" }, + { 0x467E, "intelcrouchkillschallenge" }, + { 0x4684, "intelfoundshotkillschallenge" }, + { 0x4685, "intelheadshotchallenge" }, + { 0x4689, "intelknifekillchallenge" }, + { 0x468A, "intelminigun" }, + { 0x4693, "intelteammelee" }, + { 0x4694, "intelteamreward" }, + { 0x4696, "intensity" }, + { 0x4697, "intensity_monitor_update_loop" }, + { 0x4699, "intensity_spawning_paused_count" }, + { 0x469A, "intensitylevels" }, + { 0x469E, "interactive_number" }, + { 0x46A0, "interactive_tv" }, + { 0x46AD, "intermission_vo" }, + { 0x46AE, "internalmain" }, + { 0x46B5, "interrupt_level" }, + { 0x46C0, "intro_agent" }, + { 0x46C1, "intro_allies_killed_by_mig" }, + { 0x46C3, "intro_ally_idle" }, + { 0x46C4, "intro_ambush_vo" }, + { 0x46C5, "intro_and_crash_site_ally_setup" }, + { 0x46C8, "intro_anim_from_keegan" }, + { 0x46D7, "intro_binocs_not_target_vo" }, + { 0x46D8, "intro_binocs_oracle_scanning_vo" }, + { 0x46D9, "intro_binocular_monitor" }, + { 0x46DD, "intro_binoculars_use_hint" }, + { 0x46DF, "intro_birds" }, + { 0x46E4, "intro_bunker_house_runners" }, + { 0x46E5, "intro_bunker_turrets" }, + { 0x46EB, "intro_check_binocular_activate" }, + { 0x46EC, "intro_check_binocular_deactivate" }, + { 0x46ED, "intro_check_binocular_range" }, + { 0x46EF, "intro_check_binocular_zoom" }, + { 0x46F1, "intro_chopper_fx" }, + { 0x46F3, "intro_cleanup" }, + { 0x46F4, "intro_cliff_tanks" }, + { 0x46FC, "intro_dialogue_2" }, + { 0x46FF, "intro_dof" }, + { 0x4703, "intro_drive" }, + { 0x4707, "intro_enemy11" }, + { 0x4709, "intro_enemy2" }, + { 0x470B, "intro_enemy5" }, + { 0x470F, "intro_enemy_scene" }, + { 0x4711, "intro_ent_del" }, + { 0x4713, "intro_explosion2" }, + { 0x4714, "intro_fake_mortars" }, + { 0x4715, "intro_flavorburst" }, + { 0x4716, "intro_flyby_a10" }, + { 0x4721, "intro_helis_overhead" }, + { 0x4726, "intro_house_blocker_truck" }, + { 0x472B, "intro_logic" }, + { 0x472C, "intro_main" }, + { 0x472D, "intro_mask" }, + { 0x472E, "intro_masks" }, + { 0x472F, "intro_medic_osprey" }, + { 0x4733, "intro_offse" }, + { 0x4736, "intro_overlook_static" }, + { 0x4739, "intro_player_blur" }, + { 0x473A, "intro_player_goggles_watersheeting_fx" }, + { 0x473D, "intro_prep_vip_heli" }, + { 0x4748, "intro_rorke_gun" }, + { 0x474A, "intro_runners" }, + { 0x474B, "intro_save_check" }, + { 0x4750, "intro_screen_custom_timing" }, + { 0x4752, "intro_scripted_audio_fade_in_mixing" }, + { 0x4753, "intro_scripted_sequence" }, + { 0x4757, "intro_sequence_precache" }, + { 0x4758, "intro_sequence_street" }, + { 0x4759, "intro_setup" }, + { 0x4762, "intro_street_abrams" }, + { 0x4764, "intro_street_drones" }, + { 0x4767, "intro_tank_foley" }, + { 0x4768, "intro_target_monitor" }, + { 0x476A, "intro_transport_mover" }, + { 0x476B, "intro_turn_off_prop_bm21_1_lights_fx" }, + { 0x4779, "intro_watch" }, + { 0x477A, "introcp_guy_radio" }, + { 0x477B, "introcp_guys_remaining" }, + { 0x477C, "introcp_guys_tower" }, + { 0x477D, "introscreen" }, + { 0x4786, "introscreen_generic_fade_in_on_flag" }, + { 0x4788, "introscreen_line_1" }, + { 0x478B, "introscreen_line_4" }, + { 0x4792, "invasion_door_anim" }, + { 0x4794, "inventory" }, + { 0x47A0, "inverted_rappel" }, + { 0x47A1, "inverted_rappel_ally_idles" }, + { 0x47A2, "inverted_rappel_ally_movement" }, + { 0x47A5, "inverted_rappel_movement_rorke" }, + { 0x47A8, "invincible" }, + { 0x47B2, "iplane_start" }, + { 0x47B3, "iplane_start_dialogue" }, + { 0x47B5, "is3d" }, + { 0x47BA, "is_alien_agent" }, + { 0x47BC, "is_ambience_blend_valid" }, + { 0x47BF, "is_apache_player" }, + { 0x47C0, "is_array_close" }, + { 0x47C4, "is_blocker_hive" }, + { 0x47C7, "is_burning" }, + { 0x47D4, "is_currently_mg_target" }, + { 0x47D9, "is_dead_sentient" }, + { 0x47E0, "is_dog_really_attacking" }, + { 0x47E2, "is_drop_button_pressed" }, + { 0x47E6, "is_dynamic_path" }, + { 0x47E9, "is_empty_string" }, + { 0x47EB, "is_escape_sequence_active" }, + { 0x47EC, "is_exploding" }, + { 0x47EF, "is_fake_zodiac" }, + { 0x47F0, "is_firing" }, + { 0x47F1, "is_first" }, + { 0x47F3, "is_frag_grenade" }, + { 0x47F9, "is_godmode" }, + { 0x47FC, "is_hero_ai" }, + { 0x4807, "is_in_upload" }, + { 0x4808, "is_indoor_map" }, + { 0x480B, "is_lastblast" }, + { 0x480C, "is_later_in_alphabet" }, + { 0x480F, "is_locked" }, + { 0x4811, "is_moving" }, + { 0x4814, "is_no_nerf" }, + { 0x4817, "is_normal_upright" }, + { 0x481A, "is_on_heli" }, + { 0x481D, "is_overrode" }, + { 0x4822, "is_path_start_node" }, + { 0x4823, "is_perk_set" }, + { 0x482B, "is_player_right" }, + { 0x482D, "is_playing_initial_blocker_anim" }, + { 0x4830, "is_precalculated_entrance" }, + { 0x4833, "is_resource_set" }, + { 0x4834, "is_rider" }, + { 0x483E, "is_spawn_debug_info_requested" }, + { 0x4842, "is_spitter_spit" }, + { 0x4844, "is_survival" }, + { 0x4846, "is_targeting" }, + { 0x484B, "is_turret_enabled" }, + { 0x4858, "is_valid_spit_target" }, + { 0x485D, "is_visable" }, + { 0x4860, "isactive" }, + { 0x4865, "isagent" }, + { 0x4866, "isaifunc" }, + { 0x4867, "isaigameparticipant" }, + { 0x4868, "isairdenied" }, + { 0x486A, "isairdropmarker" }, + { 0x486B, "isairplane" }, + { 0x4876, "isanymissilefiredonme" }, + { 0x4878, "isassaultkillstreak" }, + { 0x487B, "isatmost" }, + { 0x487D, "isattachment" }, + { 0x487F, "isattachmentsniperscopedefaulttokenized" }, + { 0x4880, "isattachmentunlocked" }, + { 0x4885, "isawardexclusive" }, + { 0x4886, "isawardflag" }, + { 0x4887, "isbombcarrier" }, + { 0x488A, "isbreaching" }, + { 0x488E, "isbulletweapon" }, + { 0x488F, "iscacprimaryweapon" }, + { 0x4893, "iscallouttypereport" }, + { 0x4895, "iscapturingcrate" }, + { 0x4898, "ischallengeunlocked" }, + { 0x489A, "ischeap" }, + { 0x48A1, "iscqbwalkingorfacingenemy" }, + { 0x48A4, "iscurrentlyholdingkillstreakweapon" }, + { 0x48A8, "isdefusing" }, + { 0x48AD, "isdestructibleweapon" }, + { 0x48B0, "isdrone" }, + { 0x48BB, "isexposed" }, + { 0x48BC, "isfacing" }, + { 0x48BD, "isferal" }, + { 0x48C4, "isflashed" }, + { 0x48C5, "isflashing" }, + { 0x48C8, "isfmjdamage" }, + { 0x48CA, "isfriendlyteam" }, + { 0x48CC, "isfriendlytoims" }, + { 0x48D1, "ishackweapon" }, + { 0x48D5, "ishelicopter" }, + { 0x48DF, "isincontact" }, + { 0x48E5, "isinset" }, + { 0x48E8, "isinzone" }, + { 0x48E9, "isitem" }, + { 0x48F4, "iskillstreakaffectedbyjammer" }, + { 0x48F5, "iskillstreakchallenge" }, + { 0x48F8, "isknifeonly" }, + { 0x48FE, "islaserguidedmissile" }, + { 0x4901, "islastround" }, + { 0x4906, "islockedontarget" }, + { 0x4907, "islongrangeai" }, + { 0x490A, "isloot" }, + { 0x490D, "ismembersaying" }, + { 0x490E, "ismidstarted" }, + { 0x490F, "isminitarget" }, + { 0x4913, "ismoving" }, + { 0x491E, "isoffhandweapon" }, + { 0x491F, "isoffhandweaponenabled" }, + { 0x4921, "isonemanarmymenu" }, + { 0x4922, "isonhumanteam" }, + { 0x4925, "ispainted" }, + { 0x4926, "ispartiallysuppressedwrapper" }, + { 0x4927, "ispathclear" }, + { 0x492A, "ispeekoutposclear" }, + { 0x492C, "isperk" }, + { 0x492D, "isperkstreakon" }, + { 0x4930, "isplanting" }, + { 0x4936, "isplayeroutsideofanybombsite" }, + { 0x4937, "isplayertimer" }, + { 0x493E, "isprimaryweapon" }, + { 0x4941, "israppelshooting" }, + { 0x4942, "isreactivated" }, + { 0x4943, "isreactivating" }, + { 0x4947, "isrelativeteam" }, + { 0x4948, "isreloading" }, + { 0x4949, "isrepairing" }, + { 0x4954, "isscoring" }, + { 0x4955, "isscriptmodel" }, + { 0x4957, "issentient" }, + { 0x4959, "issentrygun" }, + { 0x495A, "issetup" }, + { 0x495B, "isshooting" }, + { 0x495C, "isshotgun" }, + { 0x495D, "isshotgunai" }, + { 0x495F, "issidearm" }, + { 0x4960, "issliding" }, + { 0x4962, "issniperrifle" }, + { 0x4964, "issp_towerdefense" }, + { 0x4967, "isspeakerinrange" }, + { 0x4969, "isspeakingfailsafe" }, + { 0x496A, "isspecialist" }, + { 0x4975, "issue_color_orders" }, + { 0x4976, "issue_leave_node_order_to_ai_and_get_ai" }, + { 0x4977, "issuffix" }, + { 0x4978, "issupportkillstreak" }, + { 0x4981, "isteam" }, + { 0x4982, "isteaminlaststand" }, + { 0x4986, "isteamspeaking" }, + { 0x4989, "isthresholdaward" }, + { 0x498A, "isthrowableitem" }, + { 0x498B, "istopbarrage" }, + { 0x498D, "istouchingrangetrigger" }, + { 0x498E, "istouchingtrigger" }, + { 0x4999, "isvalidattachment" }, + { 0x499F, "isvalidevent" }, + { 0x49A0, "isvalidffatarget" }, + { 0x49A3, "isvalidperk1" }, + { 0x49A4, "isvalidperk2" }, + { 0x49A5, "isvalidperk3" }, + { 0x49A8, "isvalidsecondary" }, + { 0x49A9, "isvalidsoundcause" }, + { 0x49AF, "isvehicle" }, + { 0x49B2, "isweapon" }, + { 0x49B4, "isweaponbuffunlocked" }, + { 0x49B5, "isweaponchallenge" }, + { 0x49B9, "isweaponswitchenabled" }, + { 0x49BA, "item_bob" }, + { 0x49BB, "item_ent" }, + { 0x49BD, "item_exist" }, + { 0x49BF, "item_min_distance_from_players" }, + { 0x49C0, "item_outline" }, + { 0x49C4, "item_pickup_listener" }, + { 0x49C5, "item_ref" }, + { 0x49C7, "itemexplodethisframe" }, + { 0x49CC, "jackpot_tag" }, + { 0x49CD, "jackpot_targetfx" }, + { 0x49CE, "jackpot_zone" }, + { 0x49CF, "jackpotpileicon" }, + { 0x49D1, "javelin" }, + { 0x49D2, "javelin_check_decent" }, + { 0x49D3, "javelin_dof" }, + { 0x49D6, "javelin_target_set" }, + { 0x49DB, "javelinlostsightlinetime" }, + { 0x49DE, "javelinstage" }, + { 0x49E2, "javelintargets" }, + { 0x49E4, "javelinuseentered" }, + { 0x49E5, "javtargets" }, + { 0x49E8, "jeep2" }, + { 0x49F1, "jeep_player_arms_sub" }, + { 0x49F4, "jeep_start_music" }, + { 0x49F5, "jeeps_by" }, + { 0x49FD, "jet_blast_shields" }, + { 0x4A03, "jet_flight_time" }, + { 0x4A0B, "jet_phalanx_tracking" }, + { 0x4A0C, "jet_planesound" }, + { 0x4A0D, "jet_reset" }, + { 0x4A0E, "jet_takeoff1" }, + { 0x4A0F, "jet_takeoff2" }, + { 0x4A13, "jets_check_deleted" }, + { 0x4A21, "joint1" }, + { 0x4A2B, "juggmovespeedscaler" }, + { 0x4A2E, "juggsettings" }, + { 0x4A2F, "juggtype" }, + { 0x4A32, "juicetime" }, + { 0x4A35, "jump_distance_allowed" }, + { 0x4A3A, "jumparms" }, + { 0x4A47, "jumporient" }, + { 0x4A50, "junction_baker_open_elevator_control_room" }, + { 0x4A51, "junction_banners" }, + { 0x4A53, "junction_elevator_control_doors_open" }, + { 0x4A56, "junction_enemies" }, + { 0x4A57, "junction_enemy_setup" }, + { 0x4A58, "junction_fireworks" }, + { 0x4A5E, "junction_pip_waver_drone" }, + { 0x4A5F, "junction_rorke_window" }, + { 0x4A6A, "jungle_start" }, + { 0x4A73, "keegan_additional_drivein_anims" }, + { 0x4A76, "keegan_breach_anim" }, + { 0x4A78, "keegan_breach_guys" }, + { 0x4A79, "keegan_drag_body" }, + { 0x4A7A, "keegan_drag_body2" }, + { 0x4A7B, "keegan_enter" }, + { 0x4A81, "keegan_gun_l" }, + { 0x4A83, "keegan_idle_with_bishop" }, + { 0x4A84, "keegan_kill_dialog" }, + { 0x4A8B, "keegan_snipes" }, + { 0x4A8C, "keegan_stands_behind_desk" }, + { 0x4A8D, "keegan_start_at_button" }, + { 0x4A8E, "keegan_swap_head_to_mask" }, + { 0x4A93, "keegan_turn_right_anims" }, + { 0x4A94, "keegan_turn_right_anims_rush" }, + { 0x4A99, "keep_player_below_surface" }, + { 0x4A9C, "keep_up_with_player_reset" }, + { 0x4AA0, "keepnukeemptimeremaining" }, + { 0x4AA3, "keeptryingtomelee" }, + { 0x4AA4, "keepweapons" }, + { 0x4AA9, "keyhint" }, + { 0x4AAD, "kick_bully_logic" }, + { 0x4AB9, "kill_allies" }, + { 0x4ABA, "kill_allies_on_next_shot" }, + { 0x4ABB, "kill_ally1_submerge_bubbles" }, + { 0x4ABC, "kill_ally_in_volume" }, + { 0x4AC0, "kill_barriers_when_close" }, + { 0x4AC6, "kill_death_anim_thread" }, + { 0x4AC8, "kill_deathflag" }, + { 0x4ACC, "kill_drone_respawner" }, + { 0x4ACD, "kill_dude" }, + { 0x4ACE, "kill_during_vignette" }, + { 0x4ACF, "kill_ending_heli_fx" }, + { 0x4AD1, "kill_enemies_touching_trigger" }, + { 0x4AD2, "kill_enemy_at_arm_node" }, + { 0x4AD3, "kill_estimates_vo" }, + { 0x4AD4, "kill_fire" }, + { 0x4AD6, "kill_fx" }, + { 0x4ADB, "kill_guys_right" }, + { 0x4ADE, "kill_heli_logic" }, + { 0x4AE1, "kill_hive_burning_on_death" }, + { 0x4AE2, "kill_infil_enemies" }, + { 0x4AE3, "kill_intro_chopper" }, + { 0x4AED, "kill_on_river_crossing_back_track" }, + { 0x4AEF, "kill_player" }, + { 0x4AF0, "kill_player_if_go_back_or_not_moving" }, + { 0x4AF3, "kill_players_touching_ent" }, + { 0x4AF5, "kill_remaining_gunboats" }, + { 0x4AFD, "kill_spawnernum" }, + { 0x4AFE, "kill_spawners_per_checkpoint" }, + { 0x4AFF, "kill_streak" }, + { 0x4B01, "kill_timer" }, + { 0x4B03, "kill_trigger" }, + { 0x4B04, "kill_trigger_linked" }, + { 0x4B0D, "killcamcleanup" }, + { 0x4B12, "killchains" }, + { 0x4B16, "killedaxis" }, + { 0x4B17, "killedbestenemyplayer" }, + { 0x4B19, "killedinuse" }, + { 0x4B1B, "killedplayernotifysys" }, + { 0x4B1D, "killedplayerscurrent" }, + { 0x4B22, "killing_will_down" }, + { 0x4B23, "killplayer" }, + { 0x4B24, "killplayerfromcrate_dodamage" }, + { 0x4B25, "killplayerfromcrate_fastvelocitypush" }, + { 0x4B28, "killsassurvivor" }, + { 0x4B31, "killstreak_botparm" }, + { 0x4B33, "killstreak_info" }, + { 0x4B35, "killstreakcratethink" }, + { 0x4B40, "killstreaks" }, + { 0x4B41, "killstreaks_array" }, + { 0x4B45, "killstreakspawnshield" }, + { 0x4B47, "killstreakthink" }, + { 0x4B49, "killstreakusepressed" }, + { 0x4B4B, "killstreakweapons" }, + { 0x4B4D, "killteaminlaststand" }, + { 0x4B51, "killwrapper" }, + { 0x4B57, "knife" }, + { 0x4B58, "knife_guy_cleanup" }, + { 0x4B5A, "knife_out_rorke_anims" }, + { 0x4B5B, "knife_reticle" }, + { 0x4B62, "knockback_player" }, + { 0x4B68, "ks_manualflares_watchuse" }, + { 0x4B69, "ks_setup_manual_flares" }, + { 0x4B6D, "la_river_defend_weapons_spawn" }, + { 0x4B6F, "ladder" }, + { 0x4B72, "ladder_spot_glow" }, + { 0x4B73, "ladder_vo" }, + { 0x4B78, "land_shoot_vert_missile" }, + { 0x4B79, "land_shoot_vert_missile_loop" }, + { 0x4B7B, "land_vert_missile_wait_max" }, + { 0x4B81, "landed" }, + { 0x4B83, "landing_gear_up" }, + { 0x4B87, "lanterns" }, + { 0x4B89, "laptop_close" }, + { 0x4B8C, "laptop_hdr" }, + { 0x4B8D, "laptop_off" }, + { 0x4B92, "largescale" }, + { 0x4B96, "lariver_balcony_friendly_logic" }, + { 0x4B97, "lariver_bridge_drones" }, + { 0x4B99, "lariver_bridge_rappel_enemies" }, + { 0x4B9B, "lariver_chopper_passanger_logic" }, + { 0x4BA0, "lariver_defend_enemy_population" }, + { 0x4BA2, "lariver_defend_guided_missile_setup" }, + { 0x4BA6, "lariver_defend_populate_close_area" }, + { 0x4BA7, "lariver_defend_slide_down_river_wall" }, + { 0x4BA9, "lariver_defend_start" }, + { 0x4BAA, "lariver_doors_siren" }, + { 0x4BAF, "lariver_enemy_chopper_logic" }, + { 0x4BB0, "lariver_exit" }, + { 0x4BB6, "lariver_matv_load_and_go" }, + { 0x4BBE, "lariver_spawn_wall_battle_guys_early" }, + { 0x4BC1, "lariver_team2_logic" }, + { 0x4BC7, "lasedstrikecratethink" }, + { 0x4BC8, "lasedstrikedrone" }, + { 0x4BCD, "laser_artillery" }, + { 0x4BD1, "laser_designator_disable_list" }, + { 0x4BD2, "laser_ent" }, + { 0x4BD6, "laser_targets" }, + { 0x4BDA, "laserforceon" }, + { 0x4BDC, "laserguidedmissileents_inuse" }, + { 0x4BE0, "laseron_func" }, + { 0x4BE6, "last_audio_bink_beep_array_num" }, + { 0x4BE7, "last_audio_bink_percentage" }, + { 0x4BE8, "last_balcony_death" }, + { 0x4BEA, "last_balcony_death_time" }, + { 0x4BEB, "last_bob_anim" }, + { 0x4BEE, "last_charge_time" }, + { 0x4BEF, "last_command" }, + { 0x4BF0, "last_commanded_bot" }, + { 0x4BF2, "last_death_pos" }, + { 0x4BF8, "last_dodge_time" }, + { 0x4BF9, "last_dog_attack" }, + { 0x4BFB, "last_drill_pickup_angles" }, + { 0x4BFD, "last_enemy_sight_time" }, + { 0x4C01, "last_goal_struct" }, + { 0x4C02, "last_heli_decides_to_shoot_missile_at_ai_time" }, + { 0x4C05, "last_hive_xp" }, + { 0x4C07, "last_investigation_time" }, + { 0x4C08, "last_killfirm_time" }, + { 0x4C09, "last_killfirm_timeout" }, + { 0x4C0B, "last_large_rod_time" }, + { 0x4C0C, "last_legs_offset" }, + { 0x4C13, "last_motion_time" }, + { 0x4C14, "last_move_state" }, + { 0x4C19, "last_player_damage" }, + { 0x4C1E, "last_runanim" }, + { 0x4C21, "last_set_goalent" }, + { 0x4C23, "last_set_goalpos" }, + { 0x4C25, "last_spawned_time" }, + { 0x4C27, "last_spawned_vehicle" }, + { 0x4C2D, "last_strips" }, + { 0x4C2E, "last_teleport_time" }, + { 0x4C30, "last_time" }, + { 0x4C36, "lastadvancetoenemyattacker" }, + { 0x4C37, "lastadvancetoenemydest" }, + { 0x4C38, "lastadvancetoenemysrc" }, + { 0x4C3A, "lastaieventtrigger" }, + { 0x4C3D, "lastattackedshieldplayer" }, + { 0x4C3F, "lastautosavetime" }, + { 0x4C46, "lastcampkilltime" }, + { 0x4C47, "lastcaralarmtime" }, + { 0x4C4A, "lastcarexplosionrange" }, + { 0x4C4E, "lastclass" }, + { 0x4C54, "lastdeathicon" }, + { 0x4C5C, "lastenemypos" }, + { 0x4C5D, "lastenemysightposold" }, + { 0x4C5E, "lastenemysightposselforigin" }, + { 0x4C61, "lastexplodingbarrel" }, + { 0x4C62, "lastflashedtime" }, + { 0x4C63, "lastfraggrenadetoplayerstart" }, + { 0x4C66, "lastgrenadelandednearplayertime" }, + { 0x4C6F, "lastkilldogtime" }, + { 0x4C70, "lastkilledby" }, + { 0x4C73, "lastkilllocation" }, + { 0x4C7B, "lastmansd" }, + { 0x4C7C, "lastmeleefailedmypos" }, + { 0x4C7D, "lastmeleefailedpos" }, + { 0x4C7F, "lastmortar" }, + { 0x4C85, "lastpaintime" }, + { 0x4C88, "lastplayercallouttime" }, + { 0x4C8B, "lastprimaryweaponswaptime" }, + { 0x4C97, "lastshoottime" }, + { 0x4C9A, "lastslowprocessframe" }, + { 0x4C9E, "lastspawnteam" }, + { 0x4C9F, "lastspawntime" }, + { 0x4CA4, "laststand_enabled" }, + { 0x4CAD, "laststandkeepoverlay" }, + { 0x4CB0, "laststandrespawnplayer" }, + { 0x4CB6, "laststandupdatereviveiconcoloralien" }, + { 0x4CB8, "laststandusetime" }, + { 0x4CB9, "laststandwaittilldeath" }, + { 0x4CBA, "laststandwaittilldeathhorde" }, + { 0x4CC0, "laststatustime" }, + { 0x4CC1, "laststoppedtime" }, + { 0x4CC4, "lastsurfacetype" }, + { 0x4CC5, "lasttarget" }, + { 0x4CC9, "lastteamthreatcallouttime" }, + { 0x4CCC, "lastturretindex" }, + { 0x4CCD, "lastupdatetime" }, + { 0x4CD3, "lastvectotarget" }, + { 0x4CD4, "lastvisionsetthermal" }, + { 0x4CD9, "lateral_change_this_update" }, + { 0x4CDE, "launch_button" }, + { 0x4CE1, "launch_ends" }, + { 0x4CE4, "launch_prep_static" }, + { 0x4CE6, "launch_ragdolls_zodiac" }, + { 0x4CE9, "launch_rope_ally" }, + { 0x4CEB, "launch_smoke" }, + { 0x4CEC, "launch_smoke_from_tag" }, + { 0x4CED, "launch_speed" }, + { 0x4CEE, "launchanimentry" }, + { 0x4CEF, "launchanimstate" }, + { 0x4CF0, "launcher" }, + { 0x4CF7, "launcher_destroy_slomo_sfx" }, + { 0x4CF8, "launcher_destroy_stop_slomo_sfx" }, + { 0x4CF9, "launcher_lynx" }, + { 0x4CFA, "launcher_lynx_spawn_func" }, + { 0x4CFD, "launchers_attached" }, + { 0x4D01, "launchtime" }, + { 0x4D02, "launchuav" }, + { 0x4D03, "launchvelocity" }, + { 0x4D04, "launchvelocity2d" }, + { 0x4D06, "layer_completed" }, + { 0x4D09, "lbexplode" }, + { 0x4D0E, "lbsupport_attacktargets" }, + { 0x4D10, "lbsupport_burstfirestop" }, + { 0x4D14, "lbsupport_getclosestnode" }, + { 0x4D1E, "lbsupport_watchownerdamage" }, + { 0x4D29, "lcs_lights_back" }, + { 0x4D2A, "lcs_lights_front" }, + { 0x4D2B, "lcs_setup" }, + { 0x4D2E, "lead_jeep" }, + { 0x4D32, "leaderdialoggroup" }, + { 0x4D33, "leaderdialoggroups" }, + { 0x4D39, "leadersound" }, + { 0x4D44, "leave_node_on_attacked" }, + { 0x4D45, "leave_node_on_distance_breach" }, + { 0x4D46, "leave_path_for_spline_path" }, + { 0x4D47, "leavebattlebuddysystem" }, + { 0x4D48, "leavebattlebuddysystemdisconnect" }, + { 0x4D49, "leavecoverandshoot" }, + { 0x4D4B, "leaveonownerdisconnect" }, + { 0x4D4E, "ledge_fx" }, + { 0x4D4F, "ledge_old_player_pos" }, + { 0x4D51, "ledge_sway" }, + { 0x4D52, "ledge_track_player_pos" }, + { 0x4D54, "left_arc" }, + { 0x4D56, "left_defend" }, + { 0x4D57, "left_ent" }, + { 0x4D58, "left_flank_spawn_proc" }, + { 0x4D5D, "left_post" }, + { 0x4D5F, "left_stick" }, + { 0x4D60, "left_velocity" }, + { 0x4D63, "leg_anim_blend_time" }, + { 0x4D64, "leg_anim_blend_time_fast" }, + { 0x4D65, "leg_clear_anim_blend_time" }, + { 0x4D6B, "legs_idle_anim" }, + { 0x4D6C, "legs_move_parent_node" }, + { 0x4D6D, "length" }, + { 0x4D6E, "leper" }, + { 0x4D72, "leper_combat" }, + { 0x4D73, "leper_despawn" }, + { 0x4D74, "leper_init" }, + { 0x4D75, "leper_retreat" }, + { 0x4D78, "leperdespawntime" }, + { 0x4D79, "lerp" }, + { 0x4D7E, "lerp_fovscale_overtime" }, + { 0x4D80, "lerp_intensity" }, + { 0x4D81, "lerp_maxalpha_overtime" }, + { 0x4D83, "lerp_out_drop_pitch" }, + { 0x4D88, "lerp_player_view_to_tag" }, + { 0x4D8C, "lerp_player_view_to_tag_oldstyle_internal" }, + { 0x4D8D, "lerp_rate" }, + { 0x4D90, "lerp_saveddvar_cg_ng" }, + { 0x4D98, "lerpfov_saved_thread" }, + { 0x4D99, "lerpfraction" }, + { 0x4D9B, "let_player_through" }, + { 0x4D9E, "level_2_weight" }, + { 0x4DA5, "level_fadein" }, + { 0x4DAD, "level_specific_dof" }, + { 0x4DAE, "level_specific_score_parameter" }, + { 0x4DB3, "levelflag" }, + { 0x4DB7, "levelflagset" }, + { 0x4DB9, "levelflagwaitopen" }, + { 0x4DBB, "levelhasvehicles" }, + { 0x4DBE, "lg_missileslocked" }, + { 0x4DC3, "lgm_firing_monitormissilefire" }, + { 0x4DC7, "lgm_locked_missileondeath" }, + { 0x4DC8, "lgm_locked_spawnmissiles" }, + { 0x4DCA, "lgm_locking_loopsound" }, + { 0x4DCC, "lgm_locking_think" }, + { 0x4DCD, "lgm_missilesnotifyandrelease" }, + { 0x4DD0, "lgm_onmissilenotifies" }, + { 0x4DD5, "lgm_update_launcherusage" }, + { 0x4DD6, "lgt_ally_sequence" }, + { 0x4DE0, "life_span" }, + { 0x4DE3, "liferaft_splash_on_hit_water" }, + { 0x4DE8, "light_brighten" }, + { 0x4DED, "light_fade" }, + { 0x4DF0, "light_flicker" }, + { 0x4DF2, "light_hall_light" }, + { 0x4DF3, "light_model" }, + { 0x4DF4, "light_pulse" }, + { 0x4DF5, "light_rog_threads" }, + { 0x4DF6, "light_tag" }, + { 0x4DFB, "lightgridsupersamplecount" }, + { 0x4DFC, "lighthouse" }, + { 0x4DFE, "lightmapcount_cg" }, + { 0x4E00, "lightning_flash" }, + { 0x4E02, "lightningexploder" }, + { 0x4E03, "lightningexploderindex" }, + { 0x4E05, "lightningthink" }, + { 0x4E07, "lights" }, + { 0x4E09, "lights_off" }, + { 0x4E16, "limping_guys_spawnfunc" }, + { 0x4E19, "line_debug" }, + { 0x4E1D, "linelist" }, + { 0x4E1E, "lines" }, + { 0x4E23, "link1" }, + { 0x4E25, "link_bag_to_jeep_after_anim" }, + { 0x4E26, "link_bags_to_spin_crates" }, + { 0x4E27, "link_dlight_to_dummy" }, + { 0x4E28, "link_dog_to_jeep" }, + { 0x4E2A, "link_final_exposed_nodes" }, + { 0x4E2C, "link_player_for_catch" }, + { 0x4E2F, "link_to_moving_target" }, + { 0x4E30, "link_to_sittag" }, + { 0x4E32, "linked" }, + { 0x4E35, "linked_ents" }, + { 0x4E39, "linked_prefab_ents" }, + { 0x4E3B, "linked_to_ent" }, + { 0x4E3D, "linked_world_space_forward" }, + { 0x4E3E, "linkedplayers" }, + { 0x4E42, "linkparent" }, + { 0x4E43, "linkpet" }, + { 0x4E44, "links" }, + { 0x4E45, "linkstartnodes" }, + { 0x4E46, "linktoblend" }, + { 0x4E48, "linktotrain" }, + { 0x4E4B, "listen_dog_attack" }, + { 0x4E4E, "listen_for_dog_commands" }, + { 0x4E50, "listen_for_landing_gear_messages" }, + { 0x4E51, "listen_for_mine_layed" }, + { 0x4E52, "listen_for_mine_trigger" }, + { 0x4E53, "listen_for_use_multi_turret" }, + { 0x4E62, "listen_player_leftground" }, + { 0x4E67, "lit_models" }, + { 0x4E6E, "littlebird_spotlight_death" }, + { 0x4E72, "littlebird_turrets_think" }, + { 0x4E75, "littlebirdmadeselectionvo" }, + { 0x4E79, "living_ai" }, + { 0x4E7A, "living_ai_prethink" }, + { 0x4E7E, "lnchr_slomo_sfx" }, + { 0x4E7F, "load" }, + { 0x4E8A, "load_player_anims" }, + { 0x4E90, "load_spawn_events_from_table" }, + { 0x4E92, "load_transient" }, + { 0x4E95, "load_variables_from_table" }, + { 0x4E9C, "loadingdocks_no_jump" }, + { 0x4EA3, "loadoutperkoffhand" }, + { 0x4EA7, "loadoutprimarycamo" }, + { 0x4EA8, "loadoutprimaryreticle" }, + { 0x4EAD, "loadoutsecondarycamo" }, + { 0x4EAF, "loadoutvalues" }, + { 0x4EB2, "lobby_ruckus" }, + { 0x4EB4, "loc1" }, + { 0x4EBA, "location" }, + { 0x4EBB, "location_add_last_callout_time" }, + { 0x4ECA, "lock_dummy_add" }, + { 0x4ECB, "lock_dummy_add_ondeath" }, + { 0x4ECC, "lock_dummy_remove" }, + { 0x4ED2, "lock_player_controls" }, + { 0x4ED3, "lock_spawner_for_awhile" }, + { 0x4EDA, "lockedtarget" }, + { 0x4EDE, "lockmissespassedthreshold" }, + { 0x4EE5, "lockontargets_stop" }, + { 0x4EEE, "loco_breach_opfor_start" }, + { 0x4EF7, "loco_falling_glass" }, + { 0x4EF8, "loco_gunhold_end_slowmo" }, + { 0x4F00, "loco_slide_player_view_lerp_up" }, + { 0x4F06, "log_anim_lengths" }, + { 0x4F0D, "log_pile_support_damage_watch" }, + { 0x4F12, "log_visual_link_joints" }, + { 0x4F14, "logaward" }, + { 0x4F17, "loggameevent" }, + { 0x4F1B, "logkillsconfirmed" }, + { 0x4F25, "logplayerdata" }, + { 0x4F2A, "logweaponstat" }, + { 0x4F2B, "logxpgains" }, + { 0x4F2C, "loki_breach_lighting" }, + { 0x4F30, "loki_drop_weapon" }, + { 0x4F3A, "loki_space_particulates_while_moving" }, + { 0x4F42, "look_at_roof_nag" }, + { 0x4F47, "look_at_tower_vo_timeout" }, + { 0x4F4D, "lookat_triggers" }, + { 0x4F4E, "lookatent" }, + { 0x4F53, "lookdown_zodiacs" }, + { 0x4F56, "lookforenemy" }, + { 0x4F5B, "lookout_guys_logic" }, + { 0x4F5C, "lookupanim" }, + { 0x4F61, "loop" }, + { 0x4F63, "loop_armada" }, + { 0x4F74, "loopers" }, + { 0x4F7E, "loopidlesound" }, + { 0x4F82, "loopmovesound" }, + { 0x4F83, "loopreflectoreffect" }, + { 0x4F8A, "loot_collection_timeout" }, + { 0x4F8D, "loot_pickup_listener" }, + { 0x4F8F, "lootbag" }, + { 0x4F92, "lootbox_world_init" }, + { 0x4F93, "lootboxes" }, + { 0x4F97, "losthope_vo" }, + { 0x4F98, "low_speed_mult" }, + { 0x4F9B, "lower_bottom_bay_door" }, + { 0x4F9D, "lower_shield1" }, + { 0x4F9E, "lower_shield2" }, + { 0x4FA5, "lowertextfontsize" }, + { 0x4FAC, "lowspeed_start_crossfade" }, + { 0x4FAE, "lowy" }, + { 0x4FAF, "lrtest" }, + { 0x4FB2, "lurker_listen_trigger" }, + { 0x4FBC, "m880_crash" }, + { 0x4FC5, "m880_crash_spawn" }, + { 0x4FC8, "m880_kill_collision_change" }, + { 0x4FCC, "m880_open_path" }, + { 0x4FCF, "m880_waits" }, + { 0x4FD6, "magic_bullet_shield" }, + { 0x4FD7, "magic_distance" }, + { 0x4FD8, "magic_missile_fire_at_ent" }, + { 0x4FDA, "magicbullet_spray" }, + { 0x4FE4, "main_chopper_test" }, + { 0x4FE6, "main_common" }, + { 0x4FE8, "main_end_beach" }, + { 0x4FF6, "main_roof_combat" }, + { 0x4FFA, "main_sp" }, + { 0x4FFB, "main_spot" }, + { 0x5001, "maingun_fx_override" }, + { 0x5002, "mainloopstart" }, + { 0x5004, "make_array" }, + { 0x5008, "make_enemy_squad_burst" }, + { 0x5019, "makereviveentity" }, + { 0x501F, "makesureturnworks" }, + { 0x5023, "mall" }, + { 0x5029, "mall_breach_enemy_2" }, + { 0x502A, "mall_breach_enemy_ragdoll_on_death" }, + { 0x502E, "mall_delete_rooftop_ents" }, + { 0x5032, "mall_dialogue_grp1" }, + { 0x503A, "mall_heli" }, + { 0x503E, "mall_lone_patrol_think" }, + { 0x503F, "mall_lookout" }, + { 0x5041, "mall_radioburst_volume" }, + { 0x5043, "mall_rooftop_floor_splash" }, + { 0x504B, "mall_rootop_event" }, + { 0x5051, "mall_teleport_dog" }, + { 0x5053, "mall_walla_volume" }, + { 0x5054, "mallroof_acboxes" }, + { 0x5055, "mallroof_array" }, + { 0x5063, "manage_all_rpg_ai_get_target" }, + { 0x506C, "manage_player_linked_view" }, + { 0x506F, "manage_sentry_count" }, + { 0x5072, "manage_use_region" }, + { 0x5076, "manhandler_hold" }, + { 0x5081, "mansion_hesh" }, + { 0x5086, "mantis_explosion" }, + { 0x5087, "mantis_explosion_fragment" }, + { 0x508B, "manual_clear_hint_on_trigger" }, + { 0x5091, "manualdropthink" }, + { 0x5097, "map_is_early_in_the_game" }, + { 0x5099, "map_without_loadout" }, + { 0x509D, "mapcustomkillstreakfunc" }, + { 0x509F, "mark_completed" }, + { 0x50A1, "mark_friendly_vehicles" }, + { 0x50A3, "mark_suits_for_delete" }, + { 0x50A4, "markedduration" }, + { 0x50AA, "markplayer" }, + { 0x50B0, "mask_interactives_in_volumes" }, + { 0x50B1, "mask_prop" }, + { 0x50B3, "massnodeinitfunctions" }, + { 0x50BB, "matchestargetteam" }, + { 0x50C2, "matchoutcomenotify" }, + { 0x50C5, "matchrules_numinitialinfected" }, + { 0x50CE, "matv" }, + { 0x50D4, "max_capacity" }, + { 0x50D5, "max_count" }, + { 0x50D7, "max_distance" }, + { 0x50D8, "max_drones" }, + { 0x50DC, "max_lurker_population" }, + { 0x50DF, "max_rotation_speed" }, + { 0x50E6, "max_velocity" }, + { 0x50E8, "max_zodiacs" }, + { 0x50E9, "max_zoom_dof" }, + { 0x50EA, "maxalienattackerdifficultyvalue" }, + { 0x50EB, "maxaliveenemycount" }, + { 0x50EE, "maxammopickupsperround" }, + { 0x50F6, "maxdestructions" }, + { 0x50F7, "maxdetpackdamage" }, + { 0x50F8, "maxdirections" }, + { 0x50FA, "maxdistance" }, + { 0x50FD, "maxemissive" }, + { 0x5101, "maxflashedseconds" }, + { 0x5107, "maxlaststands" }, + { 0x510C, "maxnamelength" }, + { 0x5111, "maxpickupsperround" }, + { 0x5114, "maxradius" }, + { 0x511A, "maxtracecount" }, + { 0x511D, "maxvehiclesallowed" }, + { 0x511E, "maxvisibledist_old" }, + { 0x5120, "maydolaststand" }, + { 0x5125, "mayonlydie" }, + { 0x512C, "medbay_cleanup" }, + { 0x512D, "medbay_player_anim" }, + { 0x5133, "meeting_guys" }, + { 0x5136, "meetup_vo" }, + { 0x5140, "melee_aivsai_exposed_chooseanimationandposition_behind" }, + { 0x5142, "melee_aivsai_exposed_chooseanimationandposition_flip" }, + { 0x514C, "melee_aivsai_targetlink" }, + { 0x514F, "melee_clean_up" }, + { 0x5156, "melee_deathhandler_regular" }, + { 0x515B, "melee_dogcleanup" }, + { 0x515D, "melee_droppedweaponrestore" }, + { 0x515E, "melee_endscript" }, + { 0x5160, "melee_endscript_checkpositionandmovement" }, + { 0x516A, "melee_in_posture" }, + { 0x516E, "melee_jumping_to_wall" }, + { 0x516F, "melee_kill_stab" }, + { 0x517B, "melee_player_lerp_back" }, + { 0x517C, "melee_playfacialanim" }, + { 0x517E, "melee_resetaction" }, + { 0x517F, "melee_scalar" }, + { 0x5180, "melee_setjumpanimstates" }, + { 0x5181, "melee_standard_checktimeconstraints" }, + { 0x5187, "melee_standard_resetgiveuptime" }, + { 0x518A, "melee_stealthcheck" }, + { 0x518C, "melee_success" }, + { 0x518F, "melee_synch" }, + { 0x5190, "melee_synch_attack" }, + { 0x5191, "melee_trigger" }, + { 0x519B, "meleebiteattackplayer" }, + { 0x51A0, "meleefailed" }, + { 0x51A1, "meleeforcedexposedflip" }, + { 0x51A2, "meleeforcedexposedwrestle" }, + { 0x51A6, "meleekilltarget" }, + { 0x51A7, "meleeplayerwhilemoving" }, + { 0x51AB, "meleestrength" }, + { 0x51AC, "meleestruggle_istraverse" }, + { 0x51AE, "meleestrugglevsai_first_attack" }, + { 0x51AF, "meleestrugglevsai_interrupted_animcustom" }, + { 0x51B0, "meleestrugglevsai_interrupted_animcustom_cleanup" }, + { 0x51B3, "meleestrugglevsai_supershort" }, + { 0x51B5, "meleestrugglevsdog" }, + { 0x51B9, "meleestrugglevsdog_justdie" }, + { 0x51BB, "meleestrugglevsdog_traverse" }, + { 0x51BC, "meleestun" }, + { 0x51C4, "memberremovestrings" }, + { 0x51C9, "menu_create" }, + { 0x51CB, "menu_fx_creation" }, + { 0x51CC, "menu_fx_option_set" }, + { 0x51CD, "menu_none" }, + { 0x51D2, "menuspectator" }, + { 0x51D4, "merrick_goes_green" }, + { 0x51D5, "merrick_handle_name_when_scanning" }, + { 0x51D7, "merrick_medbay" }, + { 0x51D8, "merrick_move_to_edge" }, + { 0x51DA, "merrick_scene_dialogue" }, + { 0x51DF, "merrick_shoots_first_guy" }, + { 0x51E1, "metal_detector" }, + { 0x51E2, "metal_detector_dmg_monitor" }, + { 0x51E3, "metal_detector_touch_monitor" }, + { 0x51E4, "metal_detector_weapons" }, + { 0x51E7, "meteorfireworkstructs" }, + { 0x51E8, "meteoroid" }, + { 0x51EF, "meteoroid_start_angles" }, + { 0x51F0, "meteoroid_start_pos" }, + { 0x51F1, "methodsinit" }, + { 0x51F2, "mg" }, + { 0x51F6, "mg42_gunner_manual_think" }, + { 0x51F7, "mg42_gunner_think" }, + { 0x51F9, "mg42_setdifficulty" }, + { 0x51FA, "mg42_suppressionfire" }, + { 0x51FC, "mg42_think" }, + { 0x51FF, "mg42badplace_mintime" }, + { 0x5200, "mg42pain" }, + { 0x5203, "mg_gunner_team" }, + { 0x5204, "mg_target" }, + { 0x5205, "mg_turret_do_something_while_waiting_for_player" }, + { 0x5206, "mginit" }, + { 0x5209, "mgon" }, + { 0x520D, "mgturret_auto" }, + { 0x5220, "mig29_missile_dives" }, + { 0x5234, "mindetpackdamage" }, + { 0x5235, "mindistancecallout" }, + { 0x5237, "mine_beacon" }, + { 0x523A, "mine_explode" }, + { 0x523D, "mine_notify_on_level" }, + { 0x5240, "mine_spin" }, + { 0x5246, "minedamagemin" }, + { 0x5247, "minedamagemonitor" }, + { 0x5248, "minedamageradius" }, + { 0x524B, "minedetectionheight" }, + { 0x524C, "minedetectionradius" }, + { 0x5252, "mineproximitytrigger" }, + { 0x5257, "mineselfdestructtime" }, + { 0x525A, "minethrown" }, + { 0x5262, "mini_sub_prop_wash_stop" }, + { 0x5266, "minigun_fire" }, + { 0x5269, "minigun_hints_off" }, + { 0x526A, "minigun_hints_on" }, + { 0x526B, "minigun_ignoreme" }, + { 0x526C, "minigun_rumble" }, + { 0x5274, "minigun_turret_placed_listener" }, + { 0x5275, "minigun_turret_watch_ammo" }, + { 0x5276, "minigun_used" }, + { 0x5277, "minigunchance" }, + { 0x527A, "minigunsspinning" }, + { 0x527F, "minimapheight" }, + { 0x5280, "minimaporigin" }, + { 0x5283, "minion_approach" }, + { 0x5288, "minradius" }, + { 0x528B, "missed_enemy" }, + { 0x5294, "missile_dist_internal" }, + { 0x5299, "missile_find_ground_target" }, + { 0x52A9, "missile_launcher_destruction_vignette" }, + { 0x52AF, "missile_move_firemissile" }, + { 0x52B5, "missile_starts" }, + { 0x52BA, "missile_towerbuzz" }, + { 0x52BB, "missile_trackrealtarget" }, + { 0x52BD, "missile_truck_fire_missile" }, + { 0x52C0, "missileattractor" }, + { 0x52C9, "missileisgoodtarget" }, + { 0x52CB, "missilelosetarget" }, + { 0x52D0, "missiles_chasing" }, + { 0x52D4, "missiletags" }, + { 0x52D5, "missiletargetangle" }, + { 0x52D6, "missiletargetflareradius" }, + { 0x52D8, "missing_animation_parameters" }, + { 0x52DA, "mission_fail_func" }, + { 0x52DC, "mission_failed_garage" }, + { 0x52E0, "mission_finished" }, + { 0x52E1, "mission_flag_inits" }, + { 0x52EA, "mission_post_inits" }, + { 0x52EC, "mission_recon" }, + { 0x52EF, "missionfail" }, + { 0x52F0, "missionfail_rorke" }, + { 0x52FA, "mix" }, + { 0x52FE, "mk32_badassery" }, + { 0x5308, "mlrs_start_qte" }, + { 0x530A, "mobilemortar" }, + { 0x530B, "mod" }, + { 0x530E, "model_dummy_death" }, + { 0x530F, "model_init" }, + { 0x5310, "model_name_dummy" }, + { 0x5311, "model_name_enemy" }, + { 0x5314, "modelbase" }, + { 0x5316, "modelbombsquad" }, + { 0x5319, "modeldummyon" }, + { 0x531A, "modelmgturret" }, + { 0x5322, "modify_player_speed" }, + { 0x5324, "modify_sentry_setting" }, + { 0x5325, "modifydamage" }, + { 0x5328, "mods_override" }, + { 0x5329, "modulate_speed_based_on_progress" }, + { 0x532B, "module_int" }, + { 0x5332, "monitor_attackable_ent_damage" }, + { 0x5334, "monitor_bar_drift" }, + { 0x5338, "monitor_can_cut_rope" }, + { 0x5339, "monitor_cautious_approach_dangerous_locations" }, + { 0x533E, "monitor_controls_and_fx" }, + { 0x533F, "monitor_deaths_on_dynamic_array" }, + { 0x5342, "monitor_drill_complete" }, + { 0x5343, "monitor_enemies_in_pods" }, + { 0x5345, "monitor_enemy_for_downed" }, + { 0x534A, "monitor_fx" }, + { 0x534C, "monitor_guy_moveup" }, + { 0x5350, "monitor_missile_distance" }, + { 0x5353, "monitor_pain" }, + { 0x535F, "monitor_spawners" }, + { 0x5362, "monitor_touching" }, + { 0x5363, "monitor_trig_activation" }, + { 0x5366, "monitorads_blend_dof" }, + { 0x5367, "monitorads_zoom_elem_offset" }, + { 0x5368, "monitorads_zoom_elem_reset" }, + { 0x5369, "monitorads_zoom_hud_delay" }, + { 0x536B, "monitorads_zoom_out" }, + { 0x5379, "monitorconcussion" }, + { 0x5384, "monitorenemymissilefire" }, + { 0x538B, "monitorflares" }, + { 0x5397, "monitorhealth_ondeath" }, + { 0x5398, "monitorhealth_ondeath_apache_crash" }, + { 0x539E, "monitorkills" }, + { 0x53A2, "monitorlivetime" }, + { 0x53A6, "monitormagcycle" }, + { 0x53A8, "monitormarkervisibility" }, + { 0x53AA, "monitormisc" }, + { 0x53AD, "monitormovedown" }, + { 0x53AE, "monitormovementdistance" }, + { 0x53B3, "monitorpositioncamping" }, + { 0x53B4, "monitorprocesschallenge" }, + { 0x53B5, "monitorreload" }, + { 0x53B9, "monitorrocketfire2" }, + { 0x53BD, "monitorscopechange" }, + { 0x53C1, "monitorsinglesprintdistance" }, + { 0x53C2, "monitorspecialroundend" }, + { 0x53C8, "monitorstateshud" }, + { 0x53CD, "monitorsupportdropprogress" }, + { 0x53D2, "monitorthermalvision" }, + { 0x53D5, "monitorturretfire" }, + { 0x53DE, "mortar_ends" }, + { 0x53DF, "mortar_fire_on_struct" }, + { 0x53EE, "mortardamageradius" }, + { 0x53EF, "mortardamagetriggerdist" }, + { 0x53F0, "mortarearthquakeradius" }, + { 0x53F3, "mortarfx" }, + { 0x53F4, "mortargroup" }, + { 0x53F7, "mortarnoincomingsound" }, + { 0x53F9, "mortarrecoil" }, + { 0x53FA, "mortars" }, + { 0x53FD, "mortartrigger" }, + { 0x5400, "mosley_airlock_ln_1" }, + { 0x5401, "mosley_airlock_ln_2" }, + { 0x5402, "motion_light" }, + { 0x5407, "motion_trigger" }, + { 0x5409, "motionsensormarkedby" }, + { 0x540D, "mount_tank" }, + { 0x5417, "movable_cover_init" }, + { 0x541C, "movable_cover_move_delay" }, + { 0x541E, "movable_cover_parse_parameters" }, + { 0x5421, "movable_cover_trigger" }, + { 0x5422, "movable_cover_update_use_icon" }, + { 0x5423, "movable_cover_use_icon" }, + { 0x5425, "movable_cover_wait_for_user_or_timeout" }, + { 0x5426, "movable_type" }, + { 0x5427, "movables" }, + { 0x5429, "move_all_fx" }, + { 0x542A, "move_allies_from_fire_blocker" }, + { 0x542C, "move_ally_to_mesh" }, + { 0x542E, "move_angles" }, + { 0x542F, "move_apache_to_main_island" }, + { 0x5430, "move_arc" }, + { 0x5431, "move_arc_dist" }, + { 0x5432, "move_arc_zodiac" }, + { 0x5437, "move_check" }, + { 0x5439, "move_controlroom_to_new_location" }, + { 0x5440, "move_explosion_buildup_rumble" }, + { 0x5448, "move_player_to_start_point" }, + { 0x544A, "move_previous" }, + { 0x544B, "move_primary_light" }, + { 0x5451, "move_side" }, + { 0x5452, "move_speed_scalar" }, + { 0x5458, "move_state_loop" }, + { 0x5459, "move_state_loop_run" }, + { 0x545A, "move_state_shift_back" }, + { 0x545B, "move_state_start" }, + { 0x545F, "move_to_breach" }, + { 0x5468, "move_transition_arrays" }, + { 0x5471, "move_with_plane" }, + { 0x5472, "move_with_rate" }, + { 0x5477, "movecovertocover_checkstartpose" }, + { 0x547A, "movedlow" }, + { 0x547C, "movedrecently" }, + { 0x547E, "moveloop" }, + { 0x5487, "movement_back" }, + { 0x548C, "movemsg" }, + { 0x548F, "moveplaybackrate" }, + { 0x5492, "mover_candidates" }, + { 0x5493, "mover_delete" }, + { 0x5496, "movercreate" }, + { 0x549A, "moverun" }, + { 0x549B, "moverwaitforuse" }, + { 0x549F, "movespeed_multiplier" }, + { 0x54A2, "movespeedscale" }, + { 0x54A5, "movestartbattlechatter" }, + { 0x54A8, "moveswim" }, + { 0x54AC, "moveswim_combat_forward_enter" }, + { 0x54AD, "moveswim_combat_forward_exit" }, + { 0x54B0, "moveswim_combat_strafe_exit" }, + { 0x54B5, "moveswim_set" }, + { 0x54BB, "moveto_speed" }, + { 0x54C6, "moving" }, + { 0x54C9, "moving_cover_death" }, + { 0x54CA, "moving_cover_guys" }, + { 0x54CB, "moving_cover_jumped" }, + { 0x54CC, "moving_cover_lightsoff" }, + { 0x54CE, "moving_cover_obj1" }, + { 0x54D4, "moving_crates_plane" }, + { 0x54D7, "moving_jeeps_and_crates" }, + { 0x54DC, "moving_platform_empty_func" }, + { 0x54DE, "moving_water" }, + { 0x54E2, "mp_alien_town_intro_drill_setup" }, + { 0x54EC, "mp_dart_is_light_entity" }, + { 0x54EE, "mp_dart_restarteffect" }, + { 0x54EF, "mp_dart_tv_flicker" }, + { 0x54F3, "mssl_launch_destory_sfx" }, + { 0x54F9, "mugger_add_extra_tag" }, + { 0x54FA, "mugger_bank_limit" }, + { 0x54FD, "mugger_delayed_banking" }, + { 0x5500, "mugger_first_unused_or_oldest_extra_tag" }, + { 0x5502, "mugger_fx_playing" }, + { 0x550E, "mugger_jackpot_tags_spawned" }, + { 0x5511, "mugger_jackpot_timer" }, + { 0x5514, "mugger_last_mega_drop" }, + { 0x5515, "mugger_max_extra_tags" }, + { 0x551B, "mugger_pile_icon_remove" }, + { 0x551C, "mugger_scorelimit" }, + { 0x551D, "mugger_tag_pickup_wait" }, + { 0x5526, "multikill" }, + { 0x5529, "multiple_c4" }, + { 0x552E, "multiteambased" }, + { 0x5532, "music_escape_hot" }, + { 0x5537, "music_loop_stealth" }, + { 0x5539, "music_on_flag" }, + { 0x553A, "music_play" }, + { 0x553C, "music_play_jg" }, + { 0x5540, "music_stealth_tension_loop" }, + { 0x5544, "musiclength" }, + { 0x5546, "muzzleflashoverride" }, + { 0x5547, "my_animnode" }, + { 0x554B, "my_speed" }, + { 0x5554, "n_door_knock" }, + { 0x5555, "n_hesh_stumble_and_path" }, + { 0x5556, "n_vehicle_1" }, + { 0x555A, "n_vehicle_3" }, + { 0x555F, "nag_if_shot" }, + { 0x5565, "nag_player_to_jump" }, + { 0x556C, "name1" }, + { 0x5573, "names" }, + { 0x5580, "near_dist_sq" }, + { 0x5584, "neardistance" }, + { 0x5586, "nearest_nodes" }, + { 0x5587, "nearest_point_on_pathgrid" }, + { 0x558A, "necksnapped" }, + { 0x558D, "needflexibleheightsupport" }, + { 0x558E, "needrecalculategoodshootpos" }, + { 0x55A3, "neutralflagfx" }, + { 0x55A6, "neverenablecqb" }, + { 0x55B6, "new_glowstick_scene" }, + { 0x55B9, "new_l_pip_corner" }, + { 0x55BD, "new_rope_roll" }, + { 0x55C0, "new_submix_hud" }, + { 0x55C5, "new_volmod_hud" }, + { 0x55C8, "newenemyreactiondistsq_old" }, + { 0x55C9, "newenemysurprisedreaction" }, + { 0x55CA, "newfallback_overmind" }, + { 0x55CC, "newradialbutton" }, + { 0x55CE, "newrandomcrate" }, + { 0x55D0, "next" }, + { 0x55D1, "next_bomb_damage_vo_time" }, + { 0x55D4, "next_earthquake" }, + { 0x55D8, "next_minion_vo_time" }, + { 0x55DF, "next_reactive_time" }, + { 0x55E3, "nextallowedlooktime" }, + { 0x55E8, "nextdoorgrenadetime" }, + { 0x55EB, "nextgrenadedrop" }, + { 0x55F1, "nextmeleechecktarget" }, + { 0x55F2, "nextmeleechecktime" }, + { 0x55F5, "nextmissiletag" }, + { 0x55F8, "nextorigin" }, + { 0x55F9, "nextpeekoutattempttime" }, + { 0x55FB, "nextsaytimes" }, + { 0x55FD, "nextstandinghitdying" }, + { 0x5600, "nh90_doors_open" }, + { 0x5603, "nightvision_dlight" }, + { 0x5605, "nightvision_effectsoff" }, + { 0x560A, "nightvision_started" }, + { 0x560D, "ninebangexplodewaiter" }, + { 0x5611, "nml_locations" }, + { 0x5612, "no_abilities_timer" }, + { 0x5614, "no_attack_hint" }, + { 0x5618, "no_crouch_or_prone_think_for_player" }, + { 0x5619, "no_delete" }, + { 0x561C, "no_edge_death" }, + { 0x5621, "no_go_back_into_field" }, + { 0x5627, "no_moving_unresolved_collisions" }, + { 0x562B, "no_prone" }, + { 0x5632, "no_swept_hint" }, + { 0x5634, "no_tremor" }, + { 0x5635, "no_vehicle_getoutanim" }, + { 0x5636, "no_vehicle_ragdoll" }, + { 0x563E, "node_array" }, + { 0x563F, "node_change_logic" }, + { 0x5640, "node_closest" }, + { 0x5646, "node_is_valid_outside_for_vanguard" }, + { 0x5649, "node_search" }, + { 0x564A, "node_test" }, + { 0x564E, "node_within_use_radius_of_crate" }, + { 0x5654, "nodes" }, + { 0x5655, "nodes_array" }, + { 0x5658, "nodes_start" }, + { 0x5659, "nodescore" }, + { 0x565B, "nodisconnect" }, + { 0x565C, "nodroneweaponsound" }, + { 0x565F, "nofirstframemelee" }, + { 0x5660, "nofour" }, + { 0x5662, "nogun" }, + { 0x5666, "noise_amplitude" }, + { 0x5669, "nomeleechargedelay" }, + { 0x5675, "noragdollents" }, + { 0x5678, "normal_speed" }, + { 0x5681, "norunreload" }, + { 0x5688, "not_closing" }, + { 0x568D, "notargethudelem" }, + { 0x5690, "note_track_start_fx_on_tag" }, + { 0x5695, "noteleport" }, + { 0x569B, "notetrack_blast_shake_early" }, + { 0x569D, "notetrack_command_dialog_end" }, + { 0x56A0, "notetrack_control_room_allow_free_look" }, + { 0x56A3, "notetrack_derrick_chunk_hit_barrels" }, + { 0x56A6, "notetrack_derrick_debris_hitground" }, + { 0x56A8, "notetrack_derrick_large_explosion" }, + { 0x56A9, "notetrack_derrick_small_explosion" }, + { 0x56AB, "notetrack_end_slomo" }, + { 0x56B8, "notetrack_oiltank_catwalk_swap" }, + { 0x56BC, "notetrack_player_breach_water" }, + { 0x56C3, "notetrack_release_allies" }, + { 0x56C5, "notetrack_shake_start" }, + { 0x56CD, "notetrack_start_slomo" }, + { 0x56CE, "notetrack_swim_begin_player_control" }, + { 0x56D8, "notetrackalertnesscasual" }, + { 0x56D9, "notetrackbodyfall" }, + { 0x56DD, "notetrackfire" }, + { 0x56E5, "notetrackguntochest" }, + { 0x56EA, "notetrackmovementstop" }, + { 0x56EC, "notetrackpistolpickup" }, + { 0x56ED, "notetrackpistolputaway" }, + { 0x56EE, "notetrackpistolrechamber" }, + { 0x56F0, "notetrackposecrawl" }, + { 0x56FC, "noteworthy_check" }, + { 0x56FD, "notfirsttime" }, + { 0x56FE, "notfirsttimedogs" }, + { 0x56FF, "notfirsttimedogvests" }, + { 0x5703, "notify_baddies_to_retreat" }, + { 0x5706, "notify_enable" }, + { 0x570B, "notify_moving_platform_invalid" }, + { 0x570F, "notify_on_damage" }, + { 0x571A, "notify_spotted_on_damage" }, + { 0x571C, "notify_trigger" }, + { 0x571E, "notifyaftertime" }, + { 0x5721, "notifydamage" }, + { 0x5722, "notifydamageafterframe" }, + { 0x5723, "notifydamagenotdone" }, + { 0x572A, "notifyonanimend" }, + { 0x572E, "notifyoverlay" }, + { 0x572F, "notifyroundover" }, + { 0x5733, "notifytext" }, + { 0x5737, "notsolid_ents" }, + { 0x573C, "npc_physics_pulse" }, + { 0x573E, "npc_tank_combat_init" }, + { 0x573F, "npcid" }, + { 0x5743, "nuke_blur" }, + { 0x5747, "nuke_empjam" }, + { 0x574E, "nuke_soundobject" }, + { 0x5753, "nukecankill" }, + { 0x5756, "nukecratethink" }, + { 0x5759, "nukedeathsimple" }, + { 0x575A, "nukedetonated" }, + { 0x5765, "nukeslowmo" }, + { 0x576A, "nukevisioninprogress" }, + { 0x5771, "num_players_left" }, + { 0x5773, "numagents" }, + { 0x5774, "numareas" }, + { 0x5776, "numberoffishinexistence" }, + { 0x577B, "numbombs" }, + { 0x5781, "numdropcrates" }, + { 0x5782, "numenemiesclose" }, + { 0x5785, "numexplosivesexceedmodelcapacity" }, + { 0x5787, "numfriendlyvoices" }, + { 0x5789, "numgasstrikeactive" }, + { 0x578A, "numgrenadesinprogresstowardsplayer" }, + { 0x5794, "numspeakers" }, + { 0x579D, "nvg_animted_scene" }, + { 0x57A0, "nvg_goggles_off" }, + { 0x57A5, "nvg_on_check" }, + { 0x57A9, "nvgs_on_blackout" }, + { 0x57AB, "obj" }, + { 0x57AF, "obj_capture_hvt" }, + { 0x57B0, "obj_clear_deck" }, + { 0x57B5, "obj_enterbase" }, + { 0x57B8, "obj_exists" }, + { 0x57BA, "obj_flags" }, + { 0x57BB, "obj_flight_deck" }, + { 0x57BC, "obj_getingetajaxgetout" }, + { 0x57BD, "obj_getinjeep" }, + { 0x57C0, "obj_origin" }, + { 0x57C3, "obj_sparrow" }, + { 0x57C9, "objective" }, + { 0x57CA, "objective_breach" }, + { 0x57CF, "objective_is_inactive" }, + { 0x57D0, "objective_outline_add" }, + { 0x57D1, "objective_outline_remove" }, + { 0x57DB, "objectivepointsmod" }, + { 0x57DC, "objectives" }, + { 0x57DD, "objectivescaler" }, + { 0x57E1, "objid_axis" }, + { 0x57E9, "objpoints" }, + { 0x57EF, "occlusion" }, + { 0x57F1, "occupied" }, + { 0x57FD, "odin_assault_perform_action" }, + { 0x57FE, "odin_clear_using" }, + { 0x57FF, "odin_control_player_speed" }, + { 0x5801, "odin_drop_weapon" }, + { 0x5806, "odin_fac_cart" }, + { 0x580A, "odin_fireweapon" }, + { 0x580C, "odin_flag_inits" }, + { 0x580E, "odin_fov" }, + { 0x5815, "odin_hall_escape_turn02_ally_spawn" }, + { 0x5817, "odin_hall_escape_turn02_player_spawn" }, + { 0x5818, "odin_hint_string_init" }, + { 0x5820, "odin_leave" }, + { 0x5829, "odin_overlay_ent" }, + { 0x5830, "odin_satellite" }, + { 0x5831, "odin_script_setup" }, + { 0x583B, "odin_waitfordonefiring" }, + { 0x583E, "odin_watchoutlines" }, + { 0x5844, "odin_zoom_up" }, + { 0x5845, "odinsettings" }, + { 0x5847, "off_flashlight" }, + { 0x5853, "office_enemy_vo" }, + { 0x585E, "officercount" }, + { 0x585F, "officerid" }, + { 0x5860, "officers" }, + { 0x5865, "offscreen_shader_blink" }, + { 0x5866, "offset" }, + { 0x5869, "offset_percent" }, + { 0x586D, "offsetdist" }, + { 0x586E, "offsetone" }, + { 0x5871, "offsetzero" }, + { 0x5873, "og_animname" }, + { 0x5876, "og_health" }, + { 0x5879, "og_script_stealthgroup" }, + { 0x587D, "oilrig_jumpsuit_ondamage" }, + { 0x587F, "oilrig_jumpsuit_precache" }, + { 0x5880, "oilrig_jumpsuits" }, + { 0x5881, "oilrocks_apache_hint_timers" }, + { 0x5882, "oilrocks_locations" }, + { 0x5883, "old" }, + { 0x5889, "old_ai_target" }, + { 0x588A, "old_alpha" }, + { 0x588B, "old_ang" }, + { 0x588E, "old_baseaccuracy" }, + { 0x588F, "old_color" }, + { 0x5892, "old_disablearrivals" }, + { 0x5893, "old_dist" }, + { 0x5895, "old_fixednode" }, + { 0x589A, "old_ignoreme" }, + { 0x58A1, "old_movementtype" }, + { 0x58AF, "old_weap" }, + { 0x58B0, "old_weapon" }, + { 0x58B4, "oldbaseaccuracy" }, + { 0x58B6, "oldcombatmode" }, + { 0x58BB, "oldfightdist" }, + { 0x58BD, "oldgoalradius" }, + { 0x58BF, "oldgrenadeawareness" }, + { 0x58C5, "oldmaxdist" }, + { 0x58CC, "oldorigin" }, + { 0x58CF, "oldprimarygun" }, + { 0x58D0, "oldradius" }, + { 0x58D9, "on_agent_squadmate_killed" }, + { 0x58DA, "on_alien_type_killed" }, + { 0x58DC, "on_bridge" }, + { 0x58DF, "on_damaged_finished" }, + { 0x58E3, "on_fire_sabot" }, + { 0x58E4, "on_hintstring" }, + { 0x58EA, "on_path_grid" }, + { 0x58EB, "on_pop_smoke" }, + { 0x58F0, "onagentkilled" }, + { 0x58F1, "onaiconnect" }, + { 0x58F3, "onalienagentkilled" }, + { 0x58F7, "onatv" }, + { 0x58F8, "onback" }, + { 0x5907, "ondamaged" }, + { 0x5908, "ondamageddelegate" }, + { 0x5909, "ondamagefinish" }, + { 0x590D, "ondeath" }, + { 0x5911, "ondeathfunc" }, + { 0x5914, "ondestroycallback" }, + { 0x5917, "ondetonateexplosive" }, + { 0x591D, "one_missile_kill" }, + { 0x591F, "onemanarmyweaponchangetracker" }, + { 0x5921, "onenter" }, + { 0x5923, "onentercallback" }, + { 0x5925, "onenterdot_player" }, + { 0x5927, "onenterdot_poisondamageoverlay" }, + { 0x592A, "onenterstate" }, + { 0x5937, "onfinalsurvivor" }, + { 0x5939, "onfirerocket" }, + { 0x593A, "onfirstspawnedplayer" }, + { 0x5940, "ongroundpos" }, + { 0x5941, "onhalftime" }, + { 0x5943, "onhitpitchclamp" }, + { 0x5944, "onjoinedspectators" }, + { 0x5947, "onkill" }, + { 0x5948, "onkillstreakdisowned" }, + { 0x5949, "onkillstreakkilled" }, + { 0x594F, "only_allowable_tactical_goals" }, + { 0x5954, "onmovingplatformcollision" }, + { 0x5957, "onpickup" }, + { 0x5961, "onplayerconnecting" }, + { 0x5969, "onplayerspawned" }, + { 0x596E, "onrespawndelay" }, + { 0x596F, "onrotatingvehicleturret" }, + { 0x5973, "onscorelimit" }, + { 0x5983, "ontriggeredsfx" }, + { 0x5986, "onusedefuseobject" }, + { 0x5988, "onuseplantobject" }, + { 0x598B, "onweapondamage" }, + { 0x598D, "op_barracks" }, + { 0x598E, "op_helo" }, + { 0x5990, "open_and_connect" }, + { 0x5991, "open_angles" }, + { 0x5992, "open_church_doors" }, + { 0x599E, "open_loading_dock_doors" }, + { 0x59A4, "open_up_player_view_during_weld" }, + { 0x59AC, "opened_y" }, + { 0x59B6, "opfor_bc_lmg" }, + { 0x59B7, "opfor_catwalk_falling_death" }, + { 0x59B9, "opfor_common_ambush" }, + { 0x59BA, "opfor_crawl" }, + { 0x59BB, "opfor_death_runners" }, + { 0x59BD, "opfor_infil" }, + { 0x59C1, "opfor_m880_escape" }, + { 0x59C6, "opfor_retreat" }, + { 0x59CA, "opfor_starting_runners" }, + { 0x59CB, "opsrey_control_nag_vo" }, + { 0x59CC, "optimal_height" }, + { 0x59D4, "options" }, + { 0x59D8, "orderonqueueddialog" }, + { 0x59E1, "orient_to_face" }, + { 0x59E2, "orientmeleevictim" }, + { 0x59E6, "orig_org" }, + { 0x59EC, "orig_wakeupradius" }, + { 0x59F1, "origin_offset" }, + { 0x59F3, "original_angles" }, + { 0x59F4, "original_height" }, + { 0x59F6, "original_pos" }, + { 0x59F9, "original_yaw" }, + { 0x5A03, "osprey2_gunship_attack" }, + { 0x5A07, "osprey_debug_ai" }, + { 0x5A09, "osprey_hit_fake_targets" }, + { 0x5A0B, "osprey_hit_zodiacs" }, + { 0x5A0E, "osprey_missile_side_left" }, + { 0x5A0F, "osprey_props" }, + { 0x5A17, "other_col_point" }, + { 0x5A1C, "otherdir" }, + { 0x5A31, "outline_init" }, + { 0x5A37, "outline_set_global_width" }, + { 0x5A38, "outline_switch" }, + { 0x5A49, "outlinegethighestinfoforplayer" }, + { 0x5A4A, "outlinegethighestpriorityid" }, + { 0x5A4C, "outlineonplayerdisconnect" }, + { 0x5A51, "outlineremoveplayerfromvisibletoarrays" }, + { 0x5A55, "outro_gate" }, + { 0x5A56, "outro_heli_front" }, + { 0x5A57, "outro_heli_mid" }, + { 0x5A58, "outro_heli_rear" }, + { 0x5A62, "outside_reads" }, + { 0x5A63, "outside_start" }, + { 0x5A6C, "overheat" }, + { 0x5A6E, "overheattime" }, + { 0x5A7C, "override_array_delete" }, + { 0x5A7F, "override_check" }, + { 0x5A80, "override_class_function" }, + { 0x5A81, "override_crawl_death_anims" }, + { 0x5A85, "override_ride_anims" }, + { 0x5A8E, "ownerboarded" }, + { 0x5A90, "ownerfx" }, + { 0x5A94, "ownerradiussq" }, + { 0x5A95, "ownersattacker" }, + { 0x5A97, "ownershipstring" }, + { 0x5A99, "ownerteamid" }, + { 0x5A9D, "pa_announcements_chaos_thread" }, + { 0x5AA7, "pain_interval_monitor" }, + { 0x5AAB, "pain_resistance" }, + { 0x5AAE, "pain_setflaggedanimknobrestart" }, + { 0x5AAF, "pain_test" }, + { 0x5AB0, "painai" }, + { 0x5AB4, "painonstairs" }, + { 0x5ABB, "pairbattlebuddy" }, + { 0x5AC8, "panel_array" }, + { 0x5ACC, "panicdistance" }, + { 0x5AD5, "parachute_function" }, + { 0x5ADA, "parachute_intro_sound" }, + { 0x5ADE, "parachute_player_land_sounds" }, + { 0x5AE1, "parachute_unload" }, + { 0x5AEA, "parm2" }, + { 0x5AFA, "part_2_draw_player" }, + { 0x5AFF, "part_2_gun_reload" }, + { 0x5B00, "part_2_help_ally" }, + { 0x5B05, "part_2_speedloader" }, + { 0x5B06, "parthealths" }, + { 0x5B09, "participation_point_cap" }, + { 0x5B12, "passenger2turret_anime" }, + { 0x5B16, "passes_spawn_node_filter" }, + { 0x5B17, "passive_missile_settargetandflightmode" }, + { 0x5B1A, "pastswitch" }, + { 0x5B1D, "path_clip" }, + { 0x5B24, "path_gate_open" }, + { 0x5B28, "path_solids" }, + { 0x5B31, "pathdataavailable" }, + { 0x5B33, "pathgoal" }, + { 0x5B35, "pathrandompercent_set" }, + { 0x5B37, "pathstart" }, + { 0x5B48, "patrol_react_anim_count" }, + { 0x5B4C, "patrol_scriptedanims" }, + { 0x5B5F, "pavelowmadeselectionvo" }, + { 0x5B67, "pc_dog_drive_end" }, + { 0x5B69, "pc_dog_drive_killed_by_sniper" }, + { 0x5B6B, "pc_house_baker_get_ready" }, + { 0x5B84, "perk_getdrillhealthscalar" }, + { 0x5B85, "perk_getdrilltimescalar" }, + { 0x5B8B, "perk_getpistoloverkill" }, + { 0x5B8F, "perk_getrevivetimescalar" }, + { 0x5B9E, "perksperkname" }, + { 0x5BAB, "persistence_weaponstats" }, + { 0x5BAF, "perslog_weaponstats" }, + { 0x5BB2, "personalcoldbreathstop" }, + { 0x5BB6, "personalitymanuallyset" }, + { 0x5BB9, "pet" }, + { 0x5BBC, "pet_patrol" }, + { 0x5BBE, "pet_patrol_get_available_origin" }, + { 0x5BC8, "phalanx_gun_fire_at_missiles" }, + { 0x5BCA, "phalanx_gun_fire_target" }, + { 0x5BCB, "phalanx_gun_offline" }, + { 0x5BD0, "pharm_roller_shut" }, + { 0x5BD1, "phone" }, + { 0x5BD2, "photo_copier" }, + { 0x5BD4, "photo_copier_init" }, + { 0x5BD8, "photo_light_flicker" }, + { 0x5BD9, "phys_blockers_brush" }, + { 0x5BDA, "phys_blockers_model" }, + { 0x5BE2, "physicsdefaultdamagepush" }, + { 0x5BE3, "physicsjolt_proximity" }, + { 0x5BE4, "physicsmodel" }, + { 0x5BEC, "pianodamagethink" }, + { 0x5BED, "pianothink" }, + { 0x5BF0, "pick_drone_gundown_dummy" }, + { 0x5BF4, "pickai" }, + { 0x5BF8, "pickup_guns" }, + { 0x5BFC, "pickupfunc" }, + { 0x5BFE, "pickupmodelobj" }, + { 0x5BFF, "pickupobjectdelay" }, + { 0x5C03, "pickuptimer" }, + { 0x5C0B, "pillage_area_has_petbomb" }, + { 0x5C0D, "pillage_init" }, + { 0x5C0E, "pillage_spot" }, + { 0x5C10, "pillage_trigger" }, + { 0x5C12, "pillageable_attachments" }, + { 0x5C15, "pillageable_attachments_dmr" }, + { 0x5C16, "pillageable_attachments_lmg" }, + { 0x5C1B, "pillageable_explosives" }, + { 0x5C1C, "pillageinfo" }, + { 0x5C1E, "pilot" }, + { 0x5C22, "pilot_ai_spawner" }, + { 0x5C29, "pip_ai_cam" }, + { 0x5C2A, "pip_border" }, + { 0x5C2B, "pip_camera" }, + { 0x5C30, "pip_enable" }, + { 0x5C33, "pip_open" }, + { 0x5C39, "pip_static_lines" }, + { 0x5C3B, "pip_toggle_ai_cam" }, + { 0x5C3F, "pipe_calc_ballistic" }, + { 0x5C41, "pipe_calc_splash" }, + { 0x5C43, "pipe_deck_fx" }, + { 0x5C45, "pipe_fx_array" }, + { 0x5C46, "pipe_logic" }, + { 0x5C52, "pistol_ammo_remaining" }, + { 0x5C54, "pistol_overkill" }, + { 0x5C57, "pistolcombatspeedscalar" }, + { 0x5C58, "pistolshoot" }, + { 0x5C5F, "pitch_offset_ground" }, + { 0x5C66, "place_defenses" }, + { 0x5C67, "place_sentry" }, + { 0x5C69, "place_weapon_on" }, + { 0x5C6B, "placed_sentry" }, + { 0x5C6C, "placedims" }, + { 0x5C6D, "placedmodel" }, + { 0x5C6E, "placedsfx" }, + { 0x5C78, "placeweaponon" }, + { 0x5C7C, "plan_crash_run" }, + { 0x5C8F, "plane_tail" }, + { 0x5C94, "planemodel" }, + { 0x5C95, "planemove" }, + { 0x5C96, "planes" }, + { 0x5CA1, "play2dspawnsound" }, + { 0x5CA3, "play_ally_anim" }, + { 0x5CA4, "play_ally_launcher_vignette" }, + { 0x5CA9, "play_ambient_sfx_int" }, + { 0x5CAA, "play_anim_and_end_slowmo_logic" }, + { 0x5CAF, "play_baker_anim" }, + { 0x5CB0, "play_basic_pain_overlay" }, + { 0x5CB4, "play_chatter" }, + { 0x5CBA, "play_console_scene" }, + { 0x5CC6, "play_distant_cloud_design" }, + { 0x5CCE, "play_fire" }, + { 0x5CD0, "play_foilage_sound_custom" }, + { 0x5CD4, "play_fullscreen_shader" }, + { 0x5CD8, "play_fx_for_sub_back" }, + { 0x5CD9, "play_fx_for_sub_blow" }, + { 0x5CDA, "play_fx_for_sub_front" }, + { 0x5CDC, "play_fx_on_tag" }, + { 0x5CE0, "play_health_regen_anim" }, + { 0x5CE3, "play_hive_anim" }, + { 0x5CED, "play_linked_sound" }, + { 0x5CF8, "play_mlrs_m880_end" }, + { 0x5CFA, "play_nag" }, + { 0x5CFD, "play_new_idle" }, + { 0x5D00, "play_nuke_rumble" }, + { 0x5D02, "play_pain_sound" }, + { 0x5D03, "play_pilot_vo" }, + { 0x5D04, "play_player_break_light" }, + { 0x5D11, "play_rumble_heavy" }, + { 0x5D12, "play_rumble_light" }, + { 0x5D15, "play_rumble_seconds" }, + { 0x5D16, "play_rumbles" }, + { 0x5D18, "play_satellite_static_on_connect" }, + { 0x5D27, "play_spark_fx_when_falling" }, + { 0x5D30, "play_sub_fx_icerise" }, + { 0x5D31, "play_sub_fx_settle" }, + { 0x5D32, "play_synch_attack" }, + { 0x5D36, "play_vo_for_grab_drill" }, + { 0x5D37, "play_vo_for_next_hive" }, + { 0x5D45, "playanimnatratefortime" }, + { 0x5D46, "playanimnatrateuntilnotetrack" }, + { 0x5D48, "playanimnuntilnotetrack" }, + { 0x5D4A, "playanimonscriptable" }, + { 0x5D4C, "playbackrate" }, + { 0x5D64, "player_acceleration_low" }, + { 0x5D67, "player_action_slot_internal" }, + { 0x5D6A, "player_aim_debug" }, + { 0x5D74, "player_animated_sequence_restrictions" }, + { 0x5D77, "player_animtree" }, + { 0x5D84, "player_beach" }, + { 0x5D86, "player_blend_swim_speed" }, + { 0x5D8A, "player_boundaries_off" }, + { 0x5D8C, "player_boundary_ai_focus" }, + { 0x5D90, "player_boundary_vo_player" }, + { 0x5D91, "player_breach" }, + { 0x5D98, "player_can_see_corpse" }, + { 0x5D9A, "player_cancel_internal" }, + { 0x5DA3, "player_chopper_anim_struct" }, + { 0x5DA4, "player_chopper_flyin_setup" }, + { 0x5DA9, "player_combat_rappel" }, + { 0x5DAE, "player_console_anims" }, + { 0x5DAF, "player_const_quake" }, + { 0x5DB1, "player_control" }, + { 0x5DB5, "player_controller" }, + { 0x5DC2, "player_died_recently" }, + { 0x5DC6, "player_dismount" }, + { 0x5DC8, "player_distsqrd" }, + { 0x5DD0, "player_downed_death_buffer_time" }, + { 0x5DD1, "player_drag_body" }, + { 0x5DD8, "player_embers" }, + { 0x5DDB, "player_enter_building" }, + { 0x5DE7, "player_fade_out" }, + { 0x5DE8, "player_fail_finale" }, + { 0x5DEE, "player_failcase_road_overrun" }, + { 0x5DF1, "player_failcase_tunnel_overrun" }, + { 0x5DF5, "player_fall_off_balcony" }, + { 0x5DF7, "player_falling_2" }, + { 0x5DFA, "player_flap_sleeves" }, + { 0x5DFC, "player_flashlight_toggle" }, + { 0x5DFF, "player_force_prone_recover" }, + { 0x5E07, "player_get_mk32" }, + { 0x5E12, "player_getvelocity_pc" }, + { 0x5E18, "player_gravity_slide" }, + { 0x5E1A, "player_grenade_check" }, + { 0x5E1B, "player_grenade_check_dieout" }, + { 0x5E1C, "player_ground_collapse" }, + { 0x5E1D, "player_ground_ref_mover" }, + { 0x5E22, "player_has_enough_currency" }, + { 0x5E24, "player_has_silenced_weapon" }, + { 0x5E2B, "player_heartbeat_rate" }, + { 0x5E2E, "player_heat_fx_end" }, + { 0x5E31, "player_helmet" }, + { 0x5E35, "player_hideviewmodelsleeveflaps" }, + { 0x5E38, "player_hit_ratio_override" }, + { 0x5E51, "player_initiates_inverted_kill" }, + { 0x5E52, "player_input_console_animate" }, + { 0x5E53, "player_inside_nvg_area" }, + { 0x5E56, "player_intro_anim" }, + { 0x5E5B, "player_inverted_kill" }, + { 0x5E5C, "player_inverted_kill_enemy" }, + { 0x5E5F, "player_inverted_kill_fail" }, + { 0x5E63, "player_is_good_missile_target" }, + { 0x5E74, "player_killzone" }, + { 0x5E75, "player_knife_throw_enemy" }, + { 0x5E7B, "player_lerp_speed" }, + { 0x5E7C, "player_lerp_swim_vars" }, + { 0x5E84, "player_littlebird" }, + { 0x5E86, "player_location_check" }, + { 0x5E8D, "player_looking_at_stabguy" }, + { 0x5E8E, "player_looking_at_vargas" }, + { 0x5E93, "player_mantle_wait" }, + { 0x5E95, "player_max" }, + { 0x5E98, "player_min_speed" }, + { 0x5E99, "player_missile_control" }, + { 0x5E9B, "player_missile_roll_control" }, + { 0x5EA9, "player_name_called_recently" }, + { 0x5EB1, "player_on_hill" }, + { 0x5EB3, "player_one_already_breached" }, + { 0x5EB4, "player_outline" }, + { 0x5EB6, "player_pain_vo" }, + { 0x5EBA, "player_persistence_init" }, + { 0x5EBC, "player_pipe_explosion_reaction" }, + { 0x5EBE, "player_plane_engine_right" }, + { 0x5EC4, "player_pounce_anim" }, + { 0x5EC5, "player_pulls_mask_down" }, + { 0x5ECD, "player_pushes_too_far" }, + { 0x5ECF, "player_quake_distance" }, + { 0x5ED3, "player_rambo_rpg" }, + { 0x5ED4, "player_ramp_up_wind" }, + { 0x5ED6, "player_random_blur_cleanup" }, + { 0x5ED7, "player_random_sway" }, + { 0x5ED9, "player_recoil" }, + { 0x5EDC, "player_ref_ent" }, + { 0x5EE3, "player_rides_shotgun_in_humvee" }, + { 0x5EE6, "player_rope_unwind_anim" }, + { 0x5EE8, "player_rotate_plane01" }, + { 0x5EEC, "player_rumble" }, + { 0x5EED, "player_rumble_amb_ent" }, + { 0x5EF3, "player_safe_from_sonar" }, + { 0x5EF4, "player_saw_kill" }, + { 0x5EF5, "player_scuba" }, + { 0x5EFC, "player_seek_disable" }, + { 0x5F00, "player_set_spotted" }, + { 0x5F07, "player_should_see_drill_hint" }, + { 0x5F09, "player_showviewmodelsleeveflaps" }, + { 0x5F15, "player_space_breathe_sound" }, + { 0x5F22, "player_spotted_logic" }, + { 0x5F23, "player_sprint" }, + { 0x5F24, "player_sprintcamerabob" }, + { 0x5F2B, "player_stealth" }, + { 0x5F2F, "player_struct" }, + { 0x5F30, "player_struggle_anim" }, + { 0x5F33, "player_stun_return_weapons_sprint" }, + { 0x5F35, "player_surface_blur_think" }, + { 0x5F37, "player_sway" }, + { 0x5F39, "player_sway_bump" }, + { 0x5F3C, "player_swim_rubberband" }, + { 0x5F3E, "player_swim_think" }, + { 0x5F3F, "player_swim_water_current_logic" }, + { 0x5F41, "player_tank_impeded_sound" }, + { 0x5F43, "player_tank_turret_sounds" }, + { 0x5F49, "player_tired" }, + { 0x5F4B, "player_took_too_long_to_open" }, + { 0x5F4D, "player_touched_arr" }, + { 0x5F4E, "player_touching_post_clip" }, + { 0x5F55, "player_underwater_set" }, + { 0x5F58, "player_unlink_slide_on_death" }, + { 0x5F5D, "player_using_missile" }, + { 0x5F65, "player_view_pitch_down" }, + { 0x5F68, "player_view_shake_blender" }, + { 0x5F6C, "player_viewhands_minigun_hand" }, + { 0x5F70, "player_viewkick_distance" }, + { 0x5F7D, "player_watch_upgrade_internal" }, + { 0x5F7E, "player_watch_use" }, + { 0x5F81, "player_watcher" }, + { 0x5F82, "player_water_breach_moment" }, + { 0x5F84, "player_water_height_think" }, + { 0x5F88, "player_water_wade_speed" }, + { 0x5F92, "playeractivatedairsupport" }, + { 0x5F93, "playeraffectedarray" }, + { 0x5F9F, "playerdamagerumble" }, + { 0x5FA8, "playerdrone_create" }, + { 0x5FAF, "playergrenaderangetime" }, + { 0x5FB4, "playerhealthregeninit" }, + { 0x5FB5, "playerhind_attackspots" }, + { 0x5FB8, "playerhurtcheck" }, + { 0x5FBA, "playerinvul" }, + { 0x5FC2, "playerkilled_internal" }, + { 0x5FC3, "playerkilled_regularmp" }, + { 0x5FC8, "playerlinktodeltablend" }, + { 0x5FCE, "playerpainbreathingsound" }, + { 0x5FD0, "players" }, + { 0x5FD5, "playerseesme" }, + { 0x5FE0, "playertank" }, + { 0x5FE3, "playertank_waits" }, + { 0x5FEF, "playerview_endsequence" }, + { 0x5FF4, "playerview_playmissanim" }, + { 0x6001, "playface_waitfornotify" }, + { 0x600D, "playfx_for_sub_slide" }, + { 0x600F, "playfx_targetname_endon" }, + { 0x6012, "playgrowl" }, + { 0x6014, "playheatfx" }, + { 0x6018, "playidleface" }, + { 0x601A, "playinairjumppainanims" }, + { 0x601C, "playing_effect" }, + { 0x6025, "playlocksound" }, + { 0x6026, "playlookanimation" }, + { 0x602E, "playmusicbeforereachlayer" }, + { 0x6031, "playpainoverlay" }, + { 0x6032, "playpanting" }, + { 0x6035, "playplayerandnpcsounds" }, + { 0x6039, "playreactionevent" }, + { 0x603E, "playsound_and_light" }, + { 0x6042, "playsound_wrapper" }, + { 0x604A, "playtankexhaust" }, + { 0x604C, "playtickingsound" }, + { 0x604F, "playtransitionanimationthread_withoutwaitsetstates" }, + { 0x6051, "playuplinkanimations" }, + { 0x605A, "playvoforbombplant" }, + { 0x605D, "playvofordeathmachine" }, + { 0x605E, "playvofordowned" }, + { 0x6067, "playvoformeteor" }, + { 0x606B, "playvofornukecountdown" }, + { 0x6070, "playvoforrandombox" }, + { 0x607C, "playvoforwavestart" }, + { 0x607E, "plot_points" }, + { 0x6087, "point_cost" }, + { 0x608D, "pointoncircle" }, + { 0x608F, "poison" }, + { 0x6095, "poolindex" }, + { 0x6096, "pop_first_vo_out_of_queue" }, + { 0x609C, "populate_combat_resource_from_table" }, + { 0x609E, "populateintelchallenges" }, + { 0x60A0, "port_to_escape_spitter_location" }, + { 0x60AB, "pos_info" }, + { 0x60B0, "posclosed" }, + { 0x60B4, "positions" }, + { 0x60B8, "post" }, + { 0x60BA, "post_breach_doors" }, + { 0x60BB, "post_breach_positional_ambience" }, + { 0x60BD, "post_crater_breach_dialogue_2" }, + { 0x60CD, "post_quake_vo" }, + { 0x60DE, "power_down" }, + { 0x60E2, "pre_ambush_scene_org" }, + { 0x60E3, "pre_breach_guys" }, + { 0x60EC, "pre_org" }, + { 0x60F4, "pre_tall_grass_patroller_logic" }, + { 0x60F6, "pre_tall_grass_stealth_settings" }, + { 0x60F8, "pre_tall_grass_went_hot_vo" }, + { 0x60FB, "pre_teleport" }, + { 0x60FC, "pre_teleport_to_start" }, + { 0x6103, "precache_create_fx" }, + { 0x6106, "precache_for_startpoints" }, + { 0x6107, "precache_items" }, + { 0x6108, "precache_please" }, + { 0x610C, "precache_scripts" }, + { 0x610D, "precache_stuff" }, + { 0x610E, "precache_teargas" }, + { 0x6114, "precachesetup" }, + { 0x6117, "precisepositioning" }, + { 0x6119, "precommon" }, + { 0x611A, "precommon_bc" }, + { 0x6120, "predictedspawnpoint" }, + { 0x612A, "prefers_drones" }, + { 0x612B, "pregame_delay" }, + { 0x612D, "prekillcamnotify" }, + { 0x612E, "preload" }, + { 0x612F, "preloop_push_anims" }, + { 0x6131, "prematchperiodend" }, + { 0x6134, "prepare_crates_for_anim" }, + { 0x613C, "prepare_to_regenerate" }, + { 0x613D, "prepareattackplayer" }, + { 0x613F, "prereqs" }, + { 0x6147, "prespawn_decomp_enemies" }, + { 0x614A, "pressurized" }, + { 0x614F, "prestige_getweapondamagescalar" }, + { 0x6151, "prestigedoubleweaponxp" }, + { 0x615D, "prevattack" }, + { 0x616F, "prevleanfracpitch" }, + { 0x6179, "prevstairsstate" }, + { 0x6180, "price_breach_ent_movesto_player" }, + { 0x6182, "price_desired_speed" }, + { 0x6183, "price_match_player_speed" }, + { 0x6184, "priceliner" }, + { 0x6185, "primary_attacker" }, + { 0x6187, "primary_weapon_array" }, + { 0x6189, "primaryprogressbarfontsize" }, + { 0x618C, "primaryprogressbartexty" }, + { 0x61A4, "printboldonteam" }, + { 0x61A9, "printer" }, + { 0x61B1, "printturnrate" }, + { 0x61B5, "prioritize_watch_nodes_toward_enemies" }, + { 0x61BB, "process" }, + { 0x61BD, "process_blend" }, + { 0x61C3, "process_deathflags" }, + { 0x61C7, "process_moving_platform_death" }, + { 0x61CC, "processassist" }, + { 0x61DD, "progress_trigger_callbacks" }, + { 0x61DF, "project" }, + { 0x61E1, "projectileexplode" }, + { 0x61EA, "promo_dof" }, + { 0x61EC, "promote_nearest_friendly_with_classname" }, + { 0x61EE, "promotion_dog" }, + { 0x61F6, "prone_kill_trigger" }, + { 0x61F7, "prone_only" }, + { 0x61FF, "pronelegsstraighttree" }, + { 0x6207, "pronetocrouchwalk" }, + { 0x6208, "pronetopronemove" }, + { 0x6216, "prop_launch" }, + { 0x621B, "props_cleanup" }, + { 0x6221, "proxbartext" }, + { 0x6223, "proximity_spawn" }, + { 0x6228, "proximitykill" }, + { 0x622B, "proxmity_check_stop_loop" }, + { 0x622C, "proxmity_check_stop_relative" }, + { 0x6235, "pt2_force_look_down" }, + { 0x6243, "push_anim" }, + { 0x6246, "push_out_of_doorway" }, + { 0x6264, "quadrantanimweights" }, + { 0x6269, "quake_anims_ref" }, + { 0x626F, "quake_event_disconnect_node" }, + { 0x6273, "quake_event_gas_leak" }, + { 0x6274, "quake_event_hurt" }, + { 0x6275, "quake_event_init" }, + { 0x6279, "quake_event_pole_fall_on_car" }, + { 0x6282, "quake_event_wait" }, + { 0x6285, "quake_hurt_trigger" }, + { 0x6298, "queued_anim_threads" }, + { 0x62AA, "radarviewtime" }, + { 0x62AF, "radial_button_group" }, + { 0x62B1, "radial_button_previous_group" }, + { 0x62B7, "radiationdeath" }, + { 0x62B8, "radiationeffect" }, + { 0x62BA, "radiationsound" }, + { 0x62C5, "radio_dialogue_queue_single" }, + { 0x62C9, "radio_in_use" }, + { 0x62CA, "radio_queue_thread" }, + { 0x62CB, "radio_tower_guy_shot" }, + { 0x62CC, "radioforcedtransmissionqueue" }, + { 0x62D1, "radiousityscale" }, + { 0x62D5, "radius_min_sq" }, + { 0x62D7, "radiusartilleryshellshock" }, + { 0x62D8, "ragdoll_and_delete" }, + { 0x62DD, "ragdoll_immediate" }, + { 0x62E3, "railyard_style" }, + { 0x62E4, "rain" }, + { 0x62E7, "rain_overlay_alpha" }, + { 0x62E9, "raineffectchange" }, + { 0x62F6, "raise_rear_elevator_intro" }, + { 0x62F9, "ramboaccuracymult" }, + { 0x62FF, "ramp_down_push" }, + { 0x6301, "ramp_up_accurracy" }, + { 0x6302, "rampfx" }, + { 0x6303, "ramping_explosions" }, + { 0x631B, "random_mortars_get_target" }, + { 0x631C, "random_mortars_incoming_sound" }, + { 0x6320, "random_pick_r_or_l" }, + { 0x6321, "random_player_wall_push" }, + { 0x6322, "random_player_wall_pushdownup" }, + { 0x632A, "random_weight" }, + { 0x632B, "random_weight_sorted" }, + { 0x632C, "randomaditionaltime" }, + { 0x6330, "randomdeath" }, + { 0x6336, "randominttable" }, + { 0x6338, "randomitem" }, + { 0x633B, "randomizer_create" }, + { 0x633E, "randomly_rotate_and_fire" }, + { 0x6341, "randompathstoptime" }, + { 0x6343, "randomvector" }, + { 0x6344, "randomvectorrange" }, + { 0x6354, "rappel_clear_vertical_limits" }, + { 0x6356, "rappel_combat_two_volume_upstairs" }, + { 0x6357, "rappel_death" }, + { 0x6359, "rappel_disable_fidgit" }, + { 0x635B, "rappel_enemy" }, + { 0x635D, "rappel_enter_death" }, + { 0x635E, "rappel_entry_anim_struct" }, + { 0x6364, "rappel_guy" }, + { 0x6366, "rappel_idle" }, + { 0x6374, "rappel_max_lateral_speed" }, + { 0x6378, "rappel_params" }, + { 0x6380, "rappel_rope_rig" }, + { 0x6381, "rappel_rotate_jump_anim" }, + { 0x6385, "rappel_stealth_checkpoint" }, + { 0x638A, "rappel_stealth_second_floor_combat_vo" }, + { 0x638C, "rappel_type" }, + { 0x638D, "rappel_type_aim" }, + { 0x638E, "rappel_upper_limit" }, + { 0x6397, "raven_player_can_see_ai" }, + { 0x6398, "ravine_jeeps_to_the_right" }, + { 0x639C, "reach_death_notify" }, + { 0x63B2, "react_to_attractor_flare" }, + { 0x63BB, "reaction_sleep_wait_wakeup_dist" }, + { 0x63C2, "reactive_fx_ents" }, + { 0x63C4, "reactive_grass_settings" }, + { 0x63C5, "reactive_grass_settings_pc" }, + { 0x63C6, "reactive_sound_ents" }, + { 0x63CA, "reacttobulletsinterruptcheck" }, + { 0x63CF, "readtriple" }, + { 0x63DC, "real_reload" }, + { 0x63DE, "realorigin" }, + { 0x63E3, "rear_left_anchor_impact" }, + { 0x63E4, "rear_right_anchor_impact" }, + { 0x63E9, "reassign_dir_group" }, + { 0x63EC, "reassign_interrogate" }, + { 0x63EF, "reassign_typer" }, + { 0x63F0, "reassign_vault_guys" }, + { 0x63F7, "rec_blink" }, + { 0x63FA, "recentdamageamount" }, + { 0x63FB, "recentdamages" }, + { 0x63FC, "recentkillcount" }, + { 0x6402, "recipe_getkillstreak" }, + { 0x6403, "recipeclassapplyjuggernaut" }, + { 0x640C, "record_last_player_damage" }, + { 0x640E, "recordfinalkillcam" }, + { 0x6410, "recover_from_careful_disable" }, + { 0x6411, "recover_interval" }, + { 0x6412, "recruit_player_visual" }, + { 0x6416, "red_crosshair" }, + { 0x6418, "redshirt_cq_enc_handles" }, + { 0x641A, "redshirts" }, + { 0x6425, "ref_node" }, + { 0x642A, "refillclip" }, + { 0x642B, "refillexplosiveweapons" }, + { 0x643B, "refresh_reactive_fx_ents" }, + { 0x643C, "refreshspectatorportalfx" }, + { 0x6442, "regenamount" }, + { 0x6444, "regenfastermod" }, + { 0x6448, "regenspeedwatcher" }, + { 0x6449, "register_achievement" }, + { 0x644A, "register_airdrop_sub_items" }, + { 0x644E, "register_default_achievements" }, + { 0x6451, "register_end_game_string_index" }, + { 0x6455, "register_laststand_ammo" }, + { 0x6465, "registeradrenalineinfo" }, + { 0x6467, "registerdamage" }, + { 0x6474, "registerscoreinfo" }, + { 0x647D, "reincrement_count_if_deleted" }, + { 0x6486, "release_use_trigger" }, + { 0x6488, "release_view_count" }, + { 0x648A, "reload_aim_active" }, + { 0x6490, "relocatespeed" }, + { 0x6491, "remaining_kill" }, + { 0x6492, "remote_canreload" }, + { 0x649D, "remote_turret_clear_hud" }, + { 0x64A9, "remote_turret_handle_zoom" }, + { 0x64B7, "remote_turret_monitor_dryfire" }, + { 0x64B8, "remote_turret_next" }, + { 0x64C6, "remote_turret_type" }, + { 0x64D7, "remotefiring" }, + { 0x64DF, "remoteride" }, + { 0x64EE, "remoteuav_explode_on_disconnect" }, + { 0x64F7, "remoteuav_leave" }, + { 0x64FA, "remoteuav_markplayer" }, + { 0x6501, "remoteuav_rumble" }, + { 0x6502, "remoteuav_staticfade" }, + { 0x650C, "remove_all_challenge_cases" }, + { 0x6510, "remove_allies" }, + { 0x6519, "remove_damagefeedback" }, + { 0x6529, "remove_from_bot_damage_targets" }, + { 0x6531, "remove_global_spawn_function" }, + { 0x6543, "remove_nocolor_from_array" }, + { 0x654E, "remove_remote_turret_targets" }, + { 0x6559, "remove_specialized_ammo" }, + { 0x6567, "remove_without_classname" }, + { 0x6572, "removeac130playerongameend" }, + { 0x6578, "removealtituedmesh" }, + { 0x657B, "removebodyarmorondeath" }, + { 0x6581, "removechild" }, + { 0x658B, "removefrombattlebuddywaitlist" }, + { 0x658D, "removefromhelilist" }, + { 0x658F, "removefromimslist" }, + { 0x6595, "removefromtanklist" }, + { 0x659F, "removelockedontarget" }, + { 0x65A8, "removepickup" }, + { 0x65A9, "removeplanefromlist" }, + { 0x65AD, "removesafetyhealth" }, + { 0x65B6, "removetypefromqueue" }, + { 0x65B8, "removeuavmodelondeath" }, + { 0x65C1, "replace_attacker_request" }, + { 0x65C5, "replenishloadout" }, + { 0x65D6, "rescue_think" }, + { 0x65DB, "reserve_turret" }, + { 0x65DC, "reserved" }, + { 0x65E9, "reset_kill_10_with_propane_progress" }, + { 0x65EA, "reset_kill_10_with_traps_progress" }, + { 0x65ED, "reset_laststand" }, + { 0x65EE, "reset_melee_goons_progress" }, + { 0x65F2, "reset_nuke_usage" }, + { 0x65F4, "reset_player_speed" }, + { 0x65FB, "reset_team_hive_performance" }, + { 0x6603, "resetaccuracyandpause" }, + { 0x6607, "resetbrinkofdeathkillstreakshortly" }, + { 0x6612, "resetnow" }, + { 0x6613, "resetoncancel" }, + { 0x6615, "resetplayervariables" }, + { 0x6618, "resetskill" }, + { 0x6619, "resetsniperaim" }, + { 0x661A, "resetstate" }, + { 0x6620, "resetuidvarsondeath" }, + { 0x6628, "respawn_asspectator" }, + { 0x662A, "respawn_friendlies_force_vision_check" }, + { 0x662C, "respawn_max" }, + { 0x662E, "respawn_spawner_org" }, + { 0x6634, "respawn_with_launcher" }, + { 0x6635, "respawneliminatedplayers" }, + { 0x6636, "respawntimerstarttime" }, + { 0x6639, "respondto" }, + { 0x6640, "responsethreatexposed" }, + { 0x6646, "restockammoaura" }, + { 0x6651, "restore_last_weapon" }, + { 0x6663, "restorevision_no_blur" }, + { 0x666D, "retarget_rig" }, + { 0x6677, "retreat_watcher" }, + { 0x667C, "return_collision_model" }, + { 0x667E, "return_false" }, + { 0x6680, "return_on_movement" }, + { 0x6694, "revive_player" }, + { 0x669A, "revivetriggerthink" }, + { 0x669F, "ride_dog_bark" }, + { 0x66A7, "rider_func" }, + { 0x66B0, "rifleshootobjectivenormal" }, + { 0x66B1, "rifleshootobjectivesuppress" }, + { 0x66B4, "rig_fx" }, + { 0x66B5, "rig_model" }, + { 0x66B8, "right_direction_worldspace" }, + { 0x66C3, "rigmodel_anims" }, + { 0x66C4, "rigmodel_pauseend" }, + { 0x66C6, "riing_fx" }, + { 0x66CB, "ring_fx" }, + { 0x66D0, "riotshield_attach" }, + { 0x66D2, "riotshield_detach" }, + { 0x66D3, "riotshield_getmodel" }, + { 0x6702, "rog_add_hud_element_on_target" }, + { 0x6703, "rog_adjust_aoe_target_height" }, + { 0x6705, "rog_airstrike" }, + { 0x670B, "rog_altimeter_game_world_delta" }, + { 0x6711, "rog_ammo_animate_depleted_round" }, + { 0x6716, "rog_aoe_reticle_visibility_logic" }, + { 0x6723, "rog_cleanup_altimeter_hud" }, + { 0x6725, "rog_cleanup_static_hud" }, + { 0x672A, "rog_display_hint_strings" }, + { 0x6736, "rog_firing_fx_at_player" }, + { 0x6744, "rog_hud_logic_reset" }, + { 0x674B, "rog_kill_jet" }, + { 0x6755, "rog_play_countdown_beeps" }, + { 0x6762, "rog_setup_temp_hud" }, + { 0x6764, "rog_shockwave" }, + { 0x6765, "rog_show_target_marker" }, + { 0x6767, "rog_single_velocity_max" }, + { 0x676D, "rog_stop_countdown_beebs" }, + { 0x6773, "rog_target_add_hud_element" }, + { 0x6774, "rog_target_cleaned_up_by_allies" }, + { 0x6776, "rog_target_create_model_logic" }, + { 0x677C, "rog_target_handle_rod_impact" }, + { 0x6784, "rog_target_overkill_death" }, + { 0x678A, "rog_targeting_pip" }, + { 0x678D, "rog_temp_ui" }, + { 0x678F, "rog_uav_camera_logic" }, + { 0x67A1, "rog_zoom_ui_pip_0" }, + { 0x67AB, "roll_speed_max" }, + { 0x67AE, "ronnie_knife_watcher" }, + { 0x67AF, "ronnie_talks" }, + { 0x67B9, "roofcollapse_retreat" }, + { 0x67BF, "rooftop_collapse_end_build_sfx" }, + { 0x67C4, "rooftop_heli" }, + { 0x67E7, "rooftops_encounter_b_ally_vo" }, + { 0x67EA, "rooftops_encounter_b_flank_vo" }, + { 0x67EC, "rooftops_encounter_b_handle_defensive" }, + { 0x67F0, "rooftops_encounter_b_water_vo" }, + { 0x67F1, "rooftops_encounters_ally_logic" }, + { 0x67FE, "rooftops_heli_flyaway" }, + { 0x6802, "rooftops_interior_start_combat_soft_sight_line" }, + { 0x6804, "rooftops_long_jump" }, + { 0x680B, "rooftops_player_start_combat_attack" }, + { 0x681B, "rooftops_water_enter_combat_space_play_effects" }, + { 0x6820, "rooftops_water_heli_movement_logic" }, + { 0x6821, "rooftops_water_intro" }, + { 0x6824, "rooftops_water_intro_flare_setup" }, + { 0x682A, "rooftops_water_player_logic" }, + { 0x6832, "room_has_multiple_doors" }, + { 0x6833, "room_volume" }, + { 0x6834, "root_anim" }, + { 0x6836, "rootsofquadratic" }, + { 0x6839, "rope_cut_death" }, + { 0x683E, "rope_origin" }, + { 0x6840, "rope_prop_anim" }, + { 0x6844, "rope_unwind_anim" }, + { 0x684D, "rorke_glass_cutter" }, + { 0x6852, "rorke_inverted_kill_enemy" }, + { 0x6853, "rorke_inverted_kill_knife" }, + { 0x6854, "rorke_inverted_kill_knife_putaway" }, + { 0x685B, "rorke_react_to_stealth_break" }, + { 0x685E, "rorke_start_shadowkill" }, + { 0x686A, "rotate_helicopter_rotor" }, + { 0x686F, "rotate_rollers_to" }, + { 0x6872, "rotate_turbine" }, + { 0x6873, "rotate_vector" }, + { 0x687E, "rotating_turbines" }, + { 0x6882, "rotation_is_occuring" }, + { 0x6888, "rotunda_kill_gun_sync" }, + { 0x6889, "rotunda_knife" }, + { 0x688E, "round_num" }, + { 0x6892, "roundbegin" }, + { 0x6895, "roundenddelay" }, + { 0x6897, "roundendwait" }, + { 0x689D, "roundup" }, + { 0x689E, "roundwinnerdialog" }, + { 0x68A0, "rpg_ai_attack" }, + { 0x68AC, "rpg_guy_wait_and_fire_at_target" }, + { 0x68AD, "rpg_kibble" }, + { 0x68BB, "rpl_calc_max_yaw_right" }, + { 0x68C2, "rpl_get_max_downward_speed" }, + { 0x68C3, "rpl_get_max_lateral_speed" }, + { 0x68C9, "rpl_get_walk_loop_anim" }, + { 0x68CB, "rpl_get_walk_stop_anim" }, + { 0x68D4, "rpl_legs_get_blend_time" }, + { 0x68D7, "rpl_legs_get_idle_anim" }, + { 0x68D8, "rpl_legs_get_move_directions" }, + { 0x68DC, "rpl_legs_get_stop_move_direction" }, + { 0x68E7, "rpl_legs_should_use_run_loop" }, + { 0x68F3, "rt_fade_in" }, + { 0x68F7, "rt_helo_break_glass" }, + { 0x68F9, "rt_helo_cleanup" }, + { 0x68FC, "rt_helo_crash_train" }, + { 0x68FE, "rt_helo_dam" }, + { 0x6901, "rt_helo_flyout" }, + { 0x6902, "rt_helo_fx_setup" }, + { 0x690F, "rt_helos_kill_ally" }, + { 0x6910, "rt_hero_train_impact" }, + { 0x6914, "rt_run_fic" }, + { 0x6915, "rt_spawn_and_link_helo_glass" }, + { 0x691F, "rubble_flare" }, + { 0x6925, "rumble_ent" }, + { 0x692A, "rumble_ramp_on" }, + { 0x6930, "rumbletrigger" }, + { 0x6936, "run_anim_events" }, + { 0x693B, "run_c17_jet_flyers" }, + { 0x693C, "run_call_after_wait_array" }, + { 0x6946, "run_defend_zodiac" }, + { 0x694D, "run_enemy_destroyer_gun" }, + { 0x695E, "run_nag_vo" }, + { 0x695F, "run_near_enemy" }, + { 0x6960, "run_noself_call_after_wait_array" }, + { 0x696A, "run_overrideanim" }, + { 0x696B, "run_overridebulletreact" }, + { 0x696D, "run_player_out_of_bounds" }, + { 0x6976, "run_spawn_functions" }, + { 0x6977, "run_speed" }, + { 0x6978, "run_speed_state" }, + { 0x697E, "run_to_new_spot_and_setup_gun" }, + { 0x6994, "runnerguys" }, + { 0x6996, "runngun_backward" }, + { 0x69A4, "runportalstatus" }, + { 0x69AB, "runteamintel" }, + { 0x69AC, "runtovehicleoverride" }, + { 0x69AD, "runway_apache_logic" }, + { 0x69C1, "rushtime" }, + { 0x69C7, "saf_large_sign_01_dynamic_func" }, + { 0x69C9, "saf_streetlight_dynamic_func" }, + { 0x69D8, "safe_makerealai" }, + { 0x69E6, "safezone_sound_on" }, + { 0x69F2, "sam_exit" }, + { 0x69F4, "sam_fire_missiles" }, + { 0x6A00, "sam_missile_lockon" }, + { 0x6A04, "sam_reload_missile" }, + { 0x6A06, "sam_start_missile_lockon" }, + { 0x6A08, "sam_update_compass" }, + { 0x6A0D, "sam_use_auto_lock_on" }, + { 0x6A10, "sam_watchleaving" }, + { 0x6A12, "samdamagescale" }, + { 0x6A18, "samproximitydetonate" }, + { 0x6A19, "samtargetent" }, + { 0x6A1A, "samturret" }, + { 0x6A20, "sardines" }, + { 0x6A23, "sardines_balllinkpiece" }, + { 0x6A24, "sardines_ballpanic" }, + { 0x6A28, "sardines_line" }, + { 0x6A36, "sardines_spreadring" }, + { 0x6A39, "sat_base_s" }, + { 0x6A3A, "sat_combat" }, + { 0x6A3C, "sat_crane_arm" }, + { 0x6A4A, "satellite_cleanup" }, + { 0x6A55, "satellite_group_hide" }, + { 0x6A5E, "satellite_script_mover" }, + { 0x6A67, "satellite_view_blink_corners" }, + { 0x6A79, "satellite_view_pip_close_l_corner" }, + { 0x6A7B, "satellite_view_pip_display_name" }, + { 0x6A7F, "satellite_view_pip_set_entity" }, + { 0x6A81, "satellite_view_remove_l_corners" }, + { 0x6A84, "satellite_view_type_anchored_text" }, + { 0x6A86, "satellite_view_type_multiline_text_at_point" }, + { 0x6A8C, "satellite_view_zoom_in_sound" }, + { 0x6A92, "satfarm_global_flags" }, + { 0x6AA0, "save_turret_sharing_info" }, + { 0x6AAB, "saveplayerweaponstatepersistent" }, + { 0x6AAE, "saw_mgturretlink" }, + { 0x6AB0, "say_nag_after_delay" }, + { 0x6AB4, "saylocalsounddelayed" }, + { 0x6AB9, "scale" }, + { 0x6ABB, "scan_blur" }, + { 0x6AC1, "scared_behavior" }, + { 0x6AC2, "scared_danger_dialogue" }, + { 0x6AC8, "scene1emitter" }, + { 0x6ACA, "scene_loop" }, + { 0x6AEB, "scr_anim" }, + { 0x6AF4, "scr_notetrack" }, + { 0x6AF8, "scr_text" }, + { 0x6AFD, "scramble_watchlineofsight" }, + { 0x6B01, "scrambletarget" }, + { 0x6B09, "screen_effect_on_open_bottom" }, + { 0x6B0D, "screen_glitch_org" }, + { 0x6B11, "screen_shake_vehicles" }, + { 0x6B25, "script_airstrike_exp02" }, + { 0x6B28, "script_airstrike_exp05" }, + { 0x6B2B, "script_allowdeath" }, + { 0x6B2D, "script_ammo_alt_extra" }, + { 0x6B44, "script_audio_update_rate" }, + { 0x6B45, "script_audio_zones" }, + { 0x6B68, "script_color_axis" }, + { 0x6B6D, "script_count" }, + { 0x6B6E, "script_count_max" }, + { 0x6B71, "script_crashtypeoverride" }, + { 0x6B77, "script_deathchain" }, + { 0x6B79, "script_deathflag_longdeath" }, + { 0x6B7A, "script_deathroll" }, + { 0x6B7D, "script_decel_fraction" }, + { 0x6B82, "script_delayed_playerseek" }, + { 0x6B84, "script_delete_vehicles" }, + { 0x6B86, "script_destruct_collision" }, + { 0x6B8E, "script_dof_far_start" }, + { 0x6BA2, "script_engage" }, + { 0x6BB3, "script_favoriteenemy" }, + { 0x6BB5, "script_firefx" }, + { 0x6BB9, "script_firelink" }, + { 0x6BBC, "script_fixednode" }, + { 0x6BBD, "script_flag" }, + { 0x6BBE, "script_flag_clear" }, + { 0x6BC2, "script_flag_set" }, + { 0x6BCB, "script_followmax" }, + { 0x6BD3, "script_forcegrenade" }, + { 0x6BE2, "script_gametype_koth" }, + { 0x6BE6, "script_ghettotag" }, + { 0x6BE7, "script_goal_radius" }, + { 0x6BEC, "script_goalvolume" }, + { 0x6BF2, "script_grenadespeed" }, + { 0x6BF5, "script_health" }, + { 0x6BF7, "script_hidden" }, + { 0x6BFA, "script_idleanim" }, + { 0x6BFC, "script_ignore_suppression" }, + { 0x6C0E, "script_light" }, + { 0x6C11, "script_linkto" }, + { 0x6C13, "script_longdeath" }, + { 0x6C17, "script_mapsize_16" }, + { 0x6C18, "script_mapsize_32" }, + { 0x6C24, "script_minspec_level" }, + { 0x6C30, "script_mortargroup_domortar" }, + { 0x6C32, "script_mortargroup_mortarzone" }, + { 0x6C35, "script_move_vehicles" }, + { 0x6C38, "script_mover" }, + { 0x6C39, "script_mover_add_hintstring" }, + { 0x6C3A, "script_mover_add_parameters" }, + { 0x6C40, "script_mover_connect_watch" }, + { 0x6C42, "script_mover_func_on_notify" }, + { 0x6C46, "script_mover_is_script_mover" }, + { 0x6C47, "script_mover_move_to_named_goal" }, + { 0x6C48, "script_mover_move_to_target" }, + { 0x6C4A, "script_mover_parameters" }, + { 0x6C4C, "script_mover_parse_range" }, + { 0x6C4F, "script_mover_save_default_move_parameters" }, + { 0x6C56, "script_multiplier" }, + { 0x6C57, "script_namenumber" }, + { 0x6C5A, "script_node_pausetime" }, + { 0x6C5E, "script_nofriendlywave" }, + { 0x6C62, "script_nosurprise" }, + { 0x6C6B, "script_objective_inactive" }, + { 0x6C6F, "script_oneway" }, + { 0x6C74, "script_painter_treeorient" }, + { 0x6C7C, "script_pet" }, + { 0x6C7D, "script_physics" }, + { 0x6C8E, "script_retreating_allies04_firing" }, + { 0x6C92, "script_rumble" }, + { 0x6C93, "script_savedata" }, + { 0x6C98, "script_shooting_tanks_01" }, + { 0x6C9F, "script_shooting_tanks_08" }, + { 0x6CB1, "script_spawnsubgroup" }, + { 0x6CB2, "script_specialops" }, + { 0x6CC1, "script_stay_drone" }, + { 0x6CD9, "script_transient" }, + { 0x6CDD, "script_triggered_playerseek" }, + { 0x6CE5, "script_turretmg" }, + { 0x6CEF, "script_vehicle_selfremove" }, + { 0x6CFD, "script_vehicletriggergroup" }, + { 0x6D0A, "scriptable_vo_handler" }, + { 0x6D0C, "scriptables" }, + { 0x6D11, "scripted_dialogue" }, + { 0x6D1E, "scubamask_distortion" }, + { 0x6D24, "sd_loadout" }, + { 0x6D25, "sd_loadouts" }, + { 0x6D27, "sd_prisonerobjective" }, + { 0x6D28, "sd_triggers" }, + { 0x6D29, "sdbomb" }, + { 0x6D2C, "sdv_follow_spotted_react" }, + { 0x6D35, "second_bumper_hint" }, + { 0x6D3D, "second_floor_elevator_guy_setup" }, + { 0x6D40, "second_floor_fridge_guy_setup" }, + { 0x6D43, "second_floor_kitchenette_guy_setup" }, + { 0x6D46, "second_floor_poker_table_guys_setup" }, + { 0x6D4B, "second_patroller" }, + { 0x6D4F, "secondarytarget" }, + { 0x6D52, "secondload" }, + { 0x6D57, "section_flag_inits" }, + { 0x6D5E, "security_beeps" }, + { 0x6D63, "seekoutenemytime" }, + { 0x6D64, "seen_attacker" }, + { 0x6D65, "segments" }, + { 0x6D6B, "select_by_substring" }, + { 0x6D6E, "select_last_entity" }, + { 0x6D75, "selected_fx_ents" }, + { 0x6D7E, "selectentrancelocation" }, + { 0x6D7F, "selectidleanimstate" }, + { 0x6D85, "self_cleanup" }, + { 0x6D87, "self_func" }, + { 0x6D95, "send_friends_in" }, + { 0x6D9A, "send_to_node_and_set_flag_if_specified_when_reached" }, + { 0x6D9B, "send_to_volume_and_delete" }, + { 0x6DA0, "sensitive_chopper_in_players_view" }, + { 0x6DA1, "sensor" }, + { 0x6DA2, "sensorscreeneffects" }, + { 0x6DA3, "sentient" }, + { 0x6DAC, "sentry_badplace_delete" }, + { 0x6DAE, "sentry_beep_sounds" }, + { 0x6DB0, "sentry_burst_fire_start" }, + { 0x6DB3, "sentry_burstfirestop" }, + { 0x6DBE, "sentry_enemy_wait" }, + { 0x6DC2, "sentry_gun_weak_settings" }, + { 0x6DCB, "sentry_initsentry" }, + { 0x6DDC, "sentry_place_delay" }, + { 0x6DE9, "sentry_setactive" }, + { 0x6DF3, "sentry_smg_default_settings" }, + { 0x6DF7, "sentry_synch_attack_begin" }, + { 0x6DFD, "sentry_team_show_icon" }, + { 0x6E06, "sentrymode" }, + { 0x6E09, "sentrymodifydamage" }, + { 0x6E16, "set3duseicon" }, + { 0x6E20, "set_ai_bcvoice" }, + { 0x6E29, "set_all_ai_targetnames" }, + { 0x6E2A, "set_all_exceptions" }, + { 0x6E2C, "set_allowdeath" }, + { 0x6E37, "set_animarray_burst_and_semi_fire_crouch" }, + { 0x6E39, "set_animarray_crouching" }, + { 0x6E3A, "set_animarray_crouching_left" }, + { 0x6E4B, "set_audio_mix" }, + { 0x6E4F, "set_bag_visibility" }, + { 0x6E5E, "set_breaching_variable" }, + { 0x6E64, "set_console_status" }, + { 0x6E70, "set_custom_gameskill_func" }, + { 0x6E73, "set_cycle_scalars" }, + { 0x6E7F, "set_default_hud_stuff" }, + { 0x6E87, "set_diff_accuracy" }, + { 0x6E8F, "set_dog_hud_disabled" }, + { 0x6E91, "set_dog_hud_for_guard" }, + { 0x6E9E, "set_dpad_right_level" }, + { 0x6E9F, "set_dpad_up_level" }, + { 0x6EA4, "set_drill_state_run" }, + { 0x6EAB, "set_enter_garage_mall_vf" }, + { 0x6EB7, "set_firing" }, + { 0x6EC0, "set_flag_on_dead" }, + { 0x6EC1, "set_flag_on_dead_or_dying" }, + { 0x6EC5, "set_flag_on_spawned" }, + { 0x6EDA, "set_flavorbursts_team_state" }, + { 0x6EF2, "set_glass_zero_gravity" }, + { 0x6EF7, "set_goal_from_settings" }, + { 0x6EFE, "set_goal_volume" }, + { 0x6F01, "set_grenadeammo" }, + { 0x6F04, "set_high_priority_target_for_bot" }, + { 0x6F07, "set_hud_name_percent_value" }, + { 0x6F09, "set_hud_value" }, + { 0x6F0A, "set_hud_value_internal" }, + { 0x6F0B, "set_hudoutline" }, + { 0x6F12, "set_ignoreall" }, + { 0x6F13, "set_ignoreme" }, + { 0x6F14, "set_ignoresuppression" }, + { 0x6F15, "set_initial_emissive" }, + { 0x6F18, "set_key" }, + { 0x6F22, "set_missile_reaction" }, + { 0x6F24, "set_mission_failed_override" }, + { 0x6F27, "set_mk23_model" }, + { 0x6F28, "set_mortar_on" }, + { 0x6F29, "set_motion_blur" }, + { 0x6F2A, "set_motionblur" }, + { 0x6F30, "set_nerf_scalar" }, + { 0x6F31, "set_new_enemy_volume" }, + { 0x6F39, "set_off_exploders" }, + { 0x6F46, "set_perk_bullet_damage_1" }, + { 0x6F49, "set_perk_bullet_damage_4" }, + { 0x6F4B, "set_perk_health_level_1" }, + { 0x6F56, "set_perk_pistol_m9a1_2" }, + { 0x6F59, "set_perk_pistol_magnum_0" }, + { 0x6F60, "set_perk_pistol_mp443_2" }, + { 0x6F63, "set_perk_pistol_p226_0" }, + { 0x6F69, "set_perk_rigger_1" }, + { 0x6F6B, "set_perk_rigger_3" }, + { 0x6F6C, "set_perk_rigger_4" }, + { 0x6F6F, "set_player_character_model" }, + { 0x6F72, "set_player_hearbeat_rate" }, + { 0x6F79, "set_player_session_rankup" }, + { 0x6F87, "set_room_to_breached" }, + { 0x6F91, "set_silenthawk_override_anims" }, + { 0x6F98, "set_spawners_for_location" }, + { 0x6F99, "set_stage" }, + { 0x6F9C, "set_standing_turns" }, + { 0x6F9D, "set_start_pos" }, + { 0x6F9E, "set_start_positions" }, + { 0x6FA0, "set_stop_ignore_flag" }, + { 0x6FA5, "set_talker_until_msg" }, + { 0x6FA6, "set_team_bcvoice" }, + { 0x6FB5, "set_up_vignette_enemies" }, + { 0x6FB6, "set_up_when_patroller_goes" }, + { 0x6FBF, "set_vision_set" }, + { 0x6FC2, "set_visionset_for_watching_players" }, + { 0x6FC3, "set_vo_currently_playing" }, + { 0x6FC4, "set_vo_system_playing" }, + { 0x6FC7, "set_warelights_off" }, + { 0x6FCF, "set_z" }, + { 0x6FD3, "setac130" }, + { 0x6FD5, "setactivegrenadetimer" }, + { 0x6FD8, "setairdropcratecollision" }, + { 0x6FDA, "setalienloadout" }, + { 0x6FDD, "setanimaimweight" }, + { 0x6FEE, "setbloodrushinternal" }, + { 0x6FF8, "setcarriervisible" }, + { 0x6FF9, "setcarryicon" }, + { 0x6FFD, "setcarryingtank" }, + { 0x6FFE, "setcarryingturret" }, + { 0x7009, "setcomexp" }, + { 0x7018, "setdefaultmodel" }, + { 0x701A, "setdelaymine" }, + { 0x701C, "setdirection" }, + { 0x7033, "setfirstinfected" }, + { 0x7036, "setflashbangimmunity" }, + { 0x703F, "setgamblerinternal" }, + { 0x7041, "setglobalaimsettings" }, + { 0x7046, "setgunsmithinternal" }, + { 0x7048, "sethardshell" }, + { 0x704A, "setheadicon" }, + { 0x7050, "seticonshader" }, + { 0x7059, "setjugg" }, + { 0x7064, "setlightweight" }, + { 0x7067, "setlowermessage" }, + { 0x7068, "setmapcenterfordev" }, + { 0x706B, "setmatchrecordiflower" }, + { 0x706D, "setmeleeattackdist" }, + { 0x7076, "setmovenonforwardanims" }, + { 0x707E, "setnotetrackeffect" }, + { 0x7081, "setobjectivehinttext" }, + { 0x709C, "setplayermodels" }, + { 0x70A6, "setpose" }, + { 0x70A8, "setposemovementfnarray" }, + { 0x70BE, "setscrambled" }, + { 0x70C4, "setshootstyleforsuppression" }, + { 0x70C8, "setsize" }, + { 0x70CC, "setspawnpoint" }, + { 0x70D2, "setstandardspeed" }, + { 0x70D6, "setstreakcounttonext" }, + { 0x70D7, "setstrikermodel" }, + { 0x70F3, "setup_ai" }, + { 0x70F5, "setup_ai_for_end" }, + { 0x7101, "setup_atrium_check" }, + { 0x7105, "setup_blocker_hives" }, + { 0x7107, "setup_bodydrag_startpoint" }, + { 0x710B, "setup_bullet_pinholes" }, + { 0x710D, "setup_camera_roll" }, + { 0x710E, "setup_capture" }, + { 0x711A, "setup_combat" }, + { 0x711B, "setup_common" }, + { 0x7126, "setup_damageable_exploder_rooftanks" }, + { 0x7130, "setup_defend_blowdoors2" }, + { 0x7135, "setup_defense_bunkers" }, + { 0x713A, "setup_dog" }, + { 0x7143, "setup_edge_lean" }, + { 0x7144, "setup_electric_fence" }, + { 0x7146, "setup_enemies_open_gate" }, + { 0x7148, "setup_exfil" }, + { 0x7153, "setup_flags" }, + { 0x7154, "setup_flood_water_anims" }, + { 0x7158, "setup_front_elevator" }, + { 0x7159, "setup_fuel_leak_lighting" }, + { 0x715E, "setup_garden_entry" }, + { 0x7160, "setup_gate_ai" }, + { 0x7163, "setup_hangar_truck_pre_loaded" }, + { 0x7164, "setup_hangar_truck_to_load" }, + { 0x7165, "setup_hill_enemies" }, + { 0x7167, "setup_house" }, + { 0x716C, "setup_individual_exploder" }, + { 0x7176, "setup_inverted_rappel" }, + { 0x7179, "setup_item_data" }, + { 0x7186, "setup_mall" }, + { 0x7194, "setup_neighborhood" }, + { 0x7196, "setup_object_friction_mass" }, + { 0x7197, "setup_objectives" }, + { 0x719C, "setup_office_enemy_vo" }, + { 0x71AF, "setup_retreat_vols" }, + { 0x71B1, "setup_rooftop_dof" }, + { 0x71BC, "setup_scientist" }, + { 0x71C5, "setup_shadow_kill" }, + { 0x71D4, "setup_traverse" }, + { 0x71D9, "setup_tunnel" }, + { 0x71E8, "setup_woods" }, + { 0x71EB, "setupapproachnode" }, + { 0x71F1, "setupcqbpointsofinterest" }, + { 0x71F2, "setupdamageflags" }, + { 0x71F6, "setupdoor" }, + { 0x71FA, "setupforrandomspawn" }, + { 0x7201, "setupmovement" }, + { 0x7202, "setuppaths" }, + { 0x721D, "sfx_airlock_door" }, + { 0x721F, "sfx_ally_ally_grapple" }, + { 0x7220, "sfx_ally_grab_script" }, + { 0x7223, "sfx_ally_plr_grapple_loop" }, + { 0x722F, "sfx_ascend_wind_last" }, + { 0x723F, "sfx_blackice_catwalk_collapse" }, + { 0x7244, "sfx_blackice_derrick_exp6_ss" }, + { 0x7245, "sfx_blackice_door_rollup" }, + { 0x7247, "sfx_blackice_engine_beam_fall" }, + { 0x7248, "sfx_blackice_engine_dist_explo" }, + { 0x7266, "sfx_cmd_console_acknowledge" }, + { 0x7269, "sfx_cmd_seq_end" }, + { 0x7270, "sfx_controlroom_explosions" }, + { 0x7278, "sfx_delete_refinery_alarm_node" }, + { 0x727C, "sfx_derrick_mix_change" }, + { 0x7282, "sfx_distant_oil_rig" }, + { 0x7283, "sfx_drill_destroyed" }, + { 0x7285, "sfx_drill_offline" }, + { 0x7286, "sfx_drill_offline_beep" }, + { 0x7289, "sfx_drill_plant" }, + { 0x728F, "sfx_escape_destruction_fire_puffs" }, + { 0x729F, "sfx_fire_tower_triggers" }, + { 0x72A2, "sfx_flare_stack_arm_expl" }, + { 0x72A5, "sfx_flarestack_door_open" }, + { 0x72B5, "sfx_gas_line_scene_plr_hit" }, + { 0x72B9, "sfx_gen4_fire_puff" }, + { 0x72BB, "sfx_gun_grab_script" }, + { 0x72C4, "sfx_heli_flyaway_cmd_center" }, + { 0x72CC, "sfx_heli_rooftops_engine" }, + { 0x72D3, "sfx_heli_turret_fire_start" }, + { 0x72D6, "sfx_heli_turret_shells_stop" }, + { 0x72E3, "sfx_intro_heli_engine" }, + { 0x72E9, "sfx_jet_passby_01" }, + { 0x72EA, "sfx_jet_passby_02" }, + { 0x72EC, "sfx_jet_passby_04" }, + { 0x72ED, "sfx_jet_passby_05" }, + { 0x72F5, "sfx_kyra_hatch" }, + { 0x7301, "sfx_last_pass" }, + { 0x7305, "sfx_lever_logic" }, + { 0x7307, "sfx_lever_rumbles" }, + { 0x730A, "sfx_loco_breach_02" }, + { 0x730B, "sfx_loco_breach_out" }, + { 0x730E, "sfx_loki_control_room_start" }, + { 0x7310, "sfx_long_pipe_bursts" }, + { 0x731E, "sfx_noticket" }, + { 0x7320, "sfx_odin_decompress" }, + { 0x7321, "sfx_odin_decompress_explode" }, + { 0x7325, "sfx_odin_spin_explosion" }, + { 0x7326, "sfx_odin_spinup" }, + { 0x732B, "sfx_plane_crash_script" }, + { 0x732F, "sfx_play_pipe_sounds" }, + { 0x733D, "sfx_plr_vault" }, + { 0x733E, "sfx_post_infil_door" }, + { 0x734A, "sfx_rescue_heli_flyin" }, + { 0x7353, "sfx_rooftop_collapse" }, + { 0x735B, "sfx_sat_approach_kyra" }, + { 0x735D, "sfx_sat_big_fire_lp" }, + { 0x7362, "sfx_satellite_lat_thruster_loop" }, + { 0x736C, "sfx_set_rog_amb" }, + { 0x736F, "sfx_shaky_camera_moment" }, + { 0x7383, "sfx_stereo_quake" }, + { 0x7385, "sfx_stop_alley_water" }, + { 0x7386, "sfx_stop_ascend_sound_wait" }, + { 0x7397, "sfx_train_derail_sound" }, + { 0x739A, "sfx_truck_sinking" }, + { 0x73B0, "sfxcannonfireloop_1p" }, + { 0x73B8, "sfxmissilefire_3p" }, + { 0x73BB, "shader_fade_out" }, + { 0x73D0, "shadowkill_phone_on" }, + { 0x73D1, "shadowkill_phone_show" }, + { 0x73D5, "shakemag" }, + { 0x73D6, "shaky_moment" }, + { 0x73D8, "shared_turrets" }, + { 0x73DA, "shark_attack_2_fx" }, + { 0x73DF, "shark_collision_model" }, + { 0x73E2, "shark_eat_wandering_player" }, + { 0x73E5, "shark_heartbeat" }, + { 0x73E7, "shark_kill_front" }, + { 0x73EF, "shark_room_faster_hint" }, + { 0x73F0, "shark_think" }, + { 0x740C, "shipartilleryspots" }, + { 0x7423, "shoot_from_ai_to_ai" }, + { 0x742F, "shootanimtime" }, + { 0x7433, "shootenemytarget_bullets" }, + { 0x743A, "shootentvelocity" }, + { 0x743E, "shooter_tracking" }, + { 0x7441, "shootflares" }, + { 0x744C, "shootuntilneedtoturn" }, + { 0x7456, "shot" }, + { 0x7461, "shotgunswitchfinish" }, + { 0x7472, "should_do_immediate_ragdoll" }, + { 0x7477, "should_explode_on_damage" }, + { 0x7480, "should_make_entity_sentient" }, + { 0x7488, "should_put_drill_outline_on" }, + { 0x7489, "should_put_player_outline_on" }, + { 0x748F, "should_stabilize" }, + { 0x7495, "should_toggle_silencer" }, + { 0x74A3, "shouldconserveammotime" }, + { 0x74A6, "shoulddoarrivals" }, + { 0x74AC, "shoulddostopanim" }, + { 0x74B1, "shouldfirewhilechangingpose" }, + { 0x74B4, "shouldhelpadvancingteammate" }, + { 0x74BB, "shouldpreventearlyuse" }, + { 0x74BE, "shouldreturntocover" }, + { 0x74C3, "shouldsniff" }, + { 0x74D6, "show_binoc_scan_hint" }, + { 0x74D7, "show_challenge_outcome" }, + { 0x74DD, "show_ent" }, + { 0x74DE, "show_entity" }, + { 0x74E2, "show_fire_hide_aim_idle" }, + { 0x74E3, "show_garage_debris" }, + { 0x74EB, "show_icon" }, + { 0x74F0, "show_legs" }, + { 0x74F3, "show_missile_launcher_collision" }, + { 0x74FC, "show_train_geo" }, + { 0x74FE, "show_trap_icon_to_team" }, + { 0x7503, "show_weapon_switch_hints" }, + { 0x7505, "showcapturedbaseeffecttoplayer" }, + { 0x7507, "showclosedportalfx" }, + { 0x7508, "showcratesplash" }, + { 0x750C, "showdefendprompt" }, + { 0x7511, "showfx" }, + { 0x7518, "showlastenemysightpos" }, + { 0x7519, "showline" }, + { 0x751B, "showmainmenuforteam" }, + { 0x7521, "showspawnnotifies" }, + { 0x7522, "showspawnpoint" }, + { 0x752C, "shufflekillstreaksdown" }, + { 0x7531, "shut_post_infil_door_flag" }, + { 0x7538, "shuttle_docking" }, + { 0x753C, "shuttle_thrust_fl" }, + { 0x7541, "side_arm_array" }, + { 0x7545, "sideisleftright" }, + { 0x7547, "sidesteprate" }, + { 0x7550, "sign" }, + { 0x7551, "silent_magic_bullet_windshield" }, + { 0x7557, "simulation_speed" }, + { 0x7558, "single_ally_run" }, + { 0x755B, "single_fish_detectdamage" }, + { 0x7562, "single_fish_start" }, + { 0x7563, "single_fish_start_after_frameend" }, + { 0x7568, "sinkingplatform_start" }, + { 0x7574, "sittag_offset" }, + { 0x7576, "sitting_wounded_scene_sound" }, + { 0x757A, "skip_start_transition" }, + { 0x757B, "skip_to_end" }, + { 0x7583, "skiplivesxpscalar" }, + { 0x7584, "skipmodelswapdeath" }, + { 0x758A, "sky_change" }, + { 0x758D, "skybridge_ally_cross" }, + { 0x75A0, "skybridge_player_flinch" }, + { 0x75A1, "skybridge_precursor_emitter" }, + { 0x75A3, "skybridge_rumble_logic" }, + { 0x75AA, "skybridge_to_rooftops_transition" }, + { 0x75B8, "skydomeradiosity_ng" }, + { 0x75C0, "skyway_beach_fade_to_dev_logo_credits" }, + { 0x75C5, "skyway_beach_rorke_again" }, + { 0x75C6, "skyway_checkmate_music" }, + { 0x75C9, "skyway_endshot_sfx" }, + { 0x75CD, "skyway_hud_ammocounterhide" }, + { 0x75D2, "skyway_introscreen" }, + { 0x75DD, "sleeping_enemy_below_alerted_or_killed" }, + { 0x75DF, "sleeping_enemy_below_vo" }, + { 0x75F1, "sliding_jet2" }, + { 0x75F3, "sliding_jet21" }, + { 0x75F7, "slomo_breach_vision_change" }, + { 0x75FA, "slomobasevision" }, + { 0x7606, "slow_intro_pre_load" }, + { 0x7608, "slowconvergence" }, + { 0x760C, "slowmo_breach_damage_trigger_think" }, + { 0x760D, "slowmo_breach_disable_stancemod" }, + { 0x7610, "slowmo_breach_start_delay" }, + { 0x7614, "slowmo_lerp_in" }, + { 0x7623, "small_shakes_on" }, + { 0x762A, "smart_get_nag_line" }, + { 0x762B, "smart_radio_dialogue" }, + { 0x763B, "smoke_thrown" }, + { 0x7647, "snake_cam_enemy_anims" }, + { 0x7649, "snake_cam_hud" }, + { 0x7652, "snake_cam_vision_flicker" }, + { 0x7659, "sniff_mode" }, + { 0x765B, "sniff_system_init" }, + { 0x7660, "sniper_cancel_flag" }, + { 0x7667, "sniper_paces" }, + { 0x766A, "sniper_vision_override" }, + { 0x766B, "sniper_wait_extra_black" }, + { 0x766C, "sniper_zoom_hint_hud" }, + { 0x767C, "snowmobile_decide_shoot" }, + { 0x767D, "snowmobile_decide_shoot_internal" }, + { 0x7684, "snowmobile_loop_driver" }, + { 0x7685, "snowmobile_loop_driver_shooting" }, + { 0x768B, "snowmobile_reload" }, + { 0x768C, "snowmobile_reload_internal" }, + { 0x76A4, "soccer_scene_enemies" }, + { 0x76B1, "softlandingwaiter" }, + { 0x76B3, "solar_array0" }, + { 0x76B5, "solar_panel_handling" }, + { 0x76B9, "solarpanels_damage_think_instant" }, + { 0x76C3, "sonar_boat_audio" }, + { 0x76C8, "sonar_boat_e3" }, + { 0x76D7, "sonar_mines" }, + { 0x76E0, "sonar_ping_light_think" }, + { 0x76E4, "sonar_times_hit" }, + { 0x76E5, "sonar_wreck" }, + { 0x76E6, "sonar_wreck_crash_after" }, + { 0x76F9, "sorter" }, + { 0x76FA, "sortlowermessages" }, + { 0x7704, "sound_effect" }, + { 0x7707, "sound_ents" }, + { 0x770A, "sound_fade_in" }, + { 0x770F, "sound_org_four" }, + { 0x7711, "sound_ping_plr" }, + { 0x7719, "sound_torpedo_ent" }, + { 0x7721, "sounds" }, + { 0x772C, "space_accel" }, + { 0x7732, "space_breach_dialogue" }, + { 0x7733, "space_breach_enemies" }, + { 0x7735, "space_breathing_enabled" }, + { 0x773D, "space_hud_enable" }, + { 0x7750, "sparrow_control" }, + { 0x7752, "sparrow_fire_hint" }, + { 0x775B, "sparrow_run_enemy_logic" }, + { 0x7775, "spawn_ally" }, + { 0x777B, "spawn_and_reinforce" }, + { 0x7799, "spawn_convoy" }, + { 0x779B, "spawn_dam_harrassers" }, + { 0x779D, "spawn_dead_bodies_mudpumps" }, + { 0x77B3, "spawn_event_delayed_wave_spawn" }, + { 0x77B8, "spawn_event_per_alien_activation_increase" }, + { 0x77BD, "spawn_events" }, + { 0x77CC, "spawn_grenade" }, + { 0x77D0, "spawn_group" }, + { 0x77D3, "spawn_gunboat" }, + { 0x77D4, "spawn_guys_until_death_or_no_count" }, + { 0x77D6, "spawn_heroes_checkpoint" }, + { 0x77DF, "spawn_infantry_friends" }, + { 0x77E0, "spawn_infantry_in_blackhawk" }, + { 0x77E1, "spawn_initial_combat_helis" }, + { 0x77EB, "spawn_left" }, + { 0x77FB, "spawn_model_on_me" }, + { 0x77FF, "spawn_node_info" }, + { 0x7807, "spawn_odin_actor_single" }, + { 0x7811, "spawn_random_airdrop_sub_items" }, + { 0x7818, "spawn_rorke_inverted_kill_knife" }, + { 0x781C, "spawn_scaffold_guys" }, + { 0x781D, "spawn_scene_alien" }, + { 0x7820, "spawn_setcharacter" }, + { 0x7825, "spawn_single_stage3_ground_vehicle" }, + { 0x7829, "spawn_space_ais_from_targetname" }, + { 0x782C, "spawn_stage1_bombing_runs" }, + { 0x782E, "spawn_stage2_attack_ground_vehicles" }, + { 0x7832, "spawn_stair_runner" }, + { 0x7849, "spawn_type_vo_monitor" }, + { 0x7850, "spawn_vehicles_from_targetname" }, + { 0x785C, "spawn_zone_exists" }, + { 0x7860, "spawnallypet" }, + { 0x7861, "spawnarmor" }, + { 0x786D, "spawnendofgame" }, + { 0x786E, "spawner_cleanup" }, + { 0x7876, "spawner_random_team" }, + { 0x7888, "spawnfunc_enemies_noticket" }, + { 0x788A, "spawnfunc_enemies_rog" }, + { 0x7891, "spawnfunc_enemy_plan_b" }, + { 0x7892, "spawnfunc_enemy_right" }, + { 0x78AB, "spawnlogicteam" }, + { 0x78B2, "spawnorigin" }, + { 0x78B5, "spawnplayer" }, + { 0x78B6, "spawnpointarray" }, + { 0x78B9, "spawnpoints" }, + { 0x78BB, "spawnpointupdate" }, + { 0x78BC, "spawnpos" }, + { 0x78C0, "spawnsolarpanelsinit" }, + { 0x78C1, "spawnspectator" }, + { 0x78C5, "spawntracelocation" }, + { 0x78C7, "spawnwaypointfriendlies" }, + { 0x78CC, "spec_cg_fireworks_low" }, + { 0x78D3, "special_ammocount" }, + { 0x78DA, "special_ammocount_rank" }, + { 0x78E6, "specialcheck" }, + { 0x78F1, "specialpain" }, + { 0x78F3, "specialreloadanimfunc" }, + { 0x78F7, "species" }, + { 0x78FE, "speechcommands" }, + { 0x790B, "spin_allowance_y" }, + { 0x790D, "spin_ally_logic" }, + { 0x7910, "spin_colliders_go" }, + { 0x7913, "spin_dialogue" }, + { 0x7914, "spin_do_moving_debris" }, + { 0x7915, "spin_do_moving_debris_fx" }, + { 0x791B, "spin_piece_sparks" }, + { 0x7930, "spit_target_location" }, + { 0x7931, "spit_type" }, + { 0x793D, "spitters_against_players_ratio" }, + { 0x794A, "splash_z" }, + { 0x794F, "splashqueue" }, + { 0x7951, "spline" }, + { 0x7955, "spline_min_progress" }, + { 0x7959, "splitarrivalsright" }, + { 0x795C, "splitscreen" }, + { 0x795E, "splshtag11" }, + { 0x796E, "spotlight_loop" }, + { 0x7970, "spotlight_tag_origin_cleanup" }, + { 0x7973, "spotted_an_enemy" }, + { 0x7974, "spotted_enemy" }, + { 0x797A, "sprinkler_fx" }, + { 0x797C, "sprinkler_watch" }, + { 0x7986, "squad" }, + { 0x7987, "squad_kill" }, + { 0x7991, "squadflavorbursttransmissions" }, + { 0x799A, "squadofficerwaiter" }, + { 0x79A0, "squadupdatefuncs" }, + { 0x79B3, "stairwell_crack_flat" }, + { 0x79BB, "stance" }, + { 0x79C1, "stance_handler" }, + { 0x79C5, "stances" }, + { 0x79CA, "standardspeed" }, + { 0x79D1, "standing" }, + { 0x79D5, "standrun_begin" }, + { 0x79D7, "standrun_checkreload" }, + { 0x79DC, "standruntostand" }, + { 0x79DD, "standruntranstime" }, + { 0x79E3, "standwalk_begin" }, + { 0x79F9, "start_ascend_time" }, + { 0x79FA, "start_ascent" }, + { 0x79FB, "start_atrium_combat" }, + { 0x79FD, "start_baker" }, + { 0x79FE, "start_balcony_fall" }, + { 0x7A08, "start_canyon" }, + { 0x7A09, "start_canyon_combat" }, + { 0x7A0A, "start_catwalk_snow" }, + { 0x7A0C, "start_catwalks_end" }, + { 0x7A0E, "start_chaos_a" }, + { 0x7A0F, "start_chaos_b" }, + { 0x7A11, "start_chase_dog" }, + { 0x7A12, "start_chopper_test" }, + { 0x7A14, "start_church_destruction" }, + { 0x7A18, "start_combat_after_seeing_launcher" }, + { 0x7A1A, "start_command_outside" }, + { 0x7A1D, "start_coverheight_water_swap" }, + { 0x7A2D, "start_end_beach" }, + { 0x7A30, "start_end_swim" }, + { 0x7A3B, "start_fuel_explosion_fx" }, + { 0x7A43, "start_hangar" }, + { 0x7A46, "start_hdrsuncolorintensity" }, + { 0x7A47, "start_hesh" }, + { 0x7A58, "start_loco_standoff_nomove" }, + { 0x7A59, "start_mall" }, + { 0x7A5A, "start_mansion" }, + { 0x7A6C, "start_odin_satellite" }, + { 0x7A6D, "start_odin_spin" }, + { 0x7A6E, "start_off_running" }, + { 0x7A76, "start_pickup" }, + { 0x7A77, "start_pipe_deck" }, + { 0x7A79, "start_point" }, + { 0x7A7E, "start_post_crater_dog" }, + { 0x7A7F, "start_post_crater_house" }, + { 0x7A8A, "start_sat" }, + { 0x7A8F, "start_sfx_dam_siren_ext" }, + { 0x7A94, "start_small_wreck" }, + { 0x7A9A, "start_strafe_1" }, + { 0x7A9C, "start_street_sequence" }, + { 0x7A9E, "start_struggle_spin" }, + { 0x7AA0, "start_suncolor" }, + { 0x7AAA, "start_test_1" }, + { 0x7AAE, "start_test_area_a" }, + { 0x7AB2, "start_timed_monitor_fx" }, + { 0x7AB3, "start_to_end_length" }, + { 0x7ABB, "start_vo_system" }, + { 0x7AD2, "startfireandaimidlethread" }, + { 0x7AD8, "starthelipilot" }, + { 0x7ADA, "startingbunkerheli" }, + { 0x7ADD, "startjeep" }, + { 0x7AE0, "startlbsupport" }, + { 0x7AE7, "startnode" }, + { 0x7AE9, "startnpcbombusesound" }, + { 0x7B00, "startwatervisuals" }, + { 0x7B0D, "state" }, + { 0x7B17, "statgetbuffered" }, + { 0x7B1A, "static" }, + { 0x7B1B, "static_damping_factor" }, + { 0x7B32, "stealth_1_encounter" }, + { 0x7B35, "stealth_1_zodiac_sounds" }, + { 0x7B4A, "stealth_ai_reach_idle_and_react_proc" }, + { 0x7B4C, "stealth_alert_level_duration" }, + { 0x7B58, "stealth_behavior_system_init" }, + { 0x7B5A, "stealth_blockers" }, + { 0x7B5C, "stealth_broken_flag" }, + { 0x7B63, "stealth_corpse_default_collect_func" }, + { 0x7B69, "stealth_corpse_forget_time_default" }, + { 0x7B84, "stealth_event_anim_defaults" }, + { 0x7B8A, "stealth_event_mod_all" }, + { 0x7B9A, "stealth_group_corpse_flag_waitopen" }, + { 0x7B9E, "stealth_group_return_groups_with_corpse_flag" }, + { 0x7BA0, "stealth_group_return_groups_with_spotted_flag" }, + { 0x7BA8, "stealth_init" }, + { 0x7BAE, "stealth_kill_01_enemy1" }, + { 0x7BB0, "stealth_kill_02_ally" }, + { 0x7BB5, "stealth_photocopier" }, + { 0x7BB7, "stealth_plugin_accuracy" }, + { 0x7BBD, "stealth_plugin_event_explosion" }, + { 0x7BC4, "stealth_pre_spotted_function_default" }, + { 0x7BC5, "stealth_range_trigger" }, + { 0x7BC6, "stealth_satellite_guys" }, + { 0x7BDC, "stealth_threat_behavior_replace" }, + { 0x7BE3, "stealthbombfx" }, + { 0x7BE4, "stealthed_stream_vo" }, + { 0x7BE5, "stealthnewenemyreactanim" }, + { 0x7BE8, "steering_maxdelta" }, + { 0x7BEF, "stern_corner_dmg" }, + { 0x7BF3, "sticky_grenade_04" }, + { 0x7BF6, "sticky_grenade_07" }, + { 0x7BFB, "stingerfxid" }, + { 0x7C0D, "stop_anim_direction" }, + { 0x7C17, "stop_chopper_bosses" }, + { 0x7C18, "stop_chopper_lean" }, + { 0x7C1C, "stop_drilling_sounds" }, + { 0x7C36, "stop_loopsound" }, + { 0x7C3D, "stop_music_jg" }, + { 0x7C3F, "stop_path_on_damage" }, + { 0x7C40, "stop_patrol_vo" }, + { 0x7C43, "stop_player_scuba" }, + { 0x7C44, "stop_player_space" }, + { 0x7C4B, "stop_sfx_dam_siren_int" }, + { 0x7C4F, "stop_spotlight_killed" }, + { 0x7C50, "stop_spotlight_provoked" }, + { 0x7C57, "stop_vo_on_spotted" }, + { 0x7C63, "stopguy3" }, + { 0x7C65, "stopidlesound" }, + { 0x7C66, "stoplocationselection" }, + { 0x7C6C, "stoponback" }, + { 0x7C7A, "stopusingturretwhennodelost" }, + { 0x7C7E, "store_weapons_status" }, + { 0x7C7F, "storecompletedchallenge" }, + { 0x7C86, "str" }, + { 0x7C8B, "strafecooldown" }, + { 0x7C9F, "stream_enemy_logic" }, + { 0x7CBA, "streets_script_vehicle_cleanup" }, + { 0x7CDF, "string_is_single_digit_integer" }, + { 0x7CE1, "string_starts_with" }, + { 0x7CE2, "string_to_bool" }, + { 0x7CE5, "stringcannotplace" }, + { 0x7CE6, "stringfix" }, + { 0x7CED, "strobe_off_hide_hint" }, + { 0x7CEE, "strobe_on_hide_hint" }, + { 0x7CF0, "strobelight" }, + { 0x7CF4, "struct" }, + { 0x7CF6, "struct_arrayspawn" }, + { 0x7CFC, "structarray_remove" }, + { 0x7CFE, "structarray_remove_undefined" }, + { 0x7D01, "structarray_swaptolast" }, + { 0x7D0F, "stuckenemyentity" }, + { 0x7D12, "stumble_and_quake" }, + { 0x7D21, "stylized_line" }, + { 0x7D36, "sun_angles_intro" }, + { 0x7D3C, "sun_manage" }, + { 0x7D44, "sundir_start" }, + { 0x7D48, "sunflare" }, + { 0x7D55, "sunred_start" }, + { 0x7D57, "sunsamplesizenear_ng" }, + { 0x7D68, "suppressingfiretracking" }, + { 0x7D79, "survive" }, + { 0x7D83, "sus_fd" }, + { 0x7D86, "sus_fr" }, + { 0x7D92, "swap_goal_volumes" }, + { 0x7D93, "swap_head" }, + { 0x7D98, "swap_to_overcast_sky" }, + { 0x7D9E, "sweep_tells_vehicles_to_get_off_path" }, + { 0x7D9F, "swept" }, + { 0x7DAA, "swept_end" }, + { 0x7DB2, "swept_path_anim" }, + { 0x7DB5, "swept_plunge_01" }, + { 0x7DDB, "swim_getanimstartpos" }, + { 0x7DE6, "swim_moveend" }, + { 0x7DEA, "swim_player_surface_anim" }, + { 0x7DFA, "swim_track_set" }, + { 0x7DFD, "swim_truck_surface_anim" }, + { 0x7DFF, "swim_updateleananim" }, + { 0x7E00, "swim_updatestrafeaimanim" }, + { 0x7E01, "swim_updatestrafeanim" }, + { 0x7E04, "swim_waitforapproachpos" }, + { 0x7E13, "switch_node_on_flag" }, + { 0x7E1F, "switchmsg" }, + { 0x7E24, "sync_carry_walk_anims" }, + { 0x7E2D, "synch_directions" }, + { 0x7E30, "syncnotetrackent" }, + { 0x7E34, "system_default_event_distances" }, + { 0x7E38, "system_init_shadows" }, + { 0x7E41, "systems_down_end" }, + { 0x7E51, "table_getweaponbuff" }, + { 0x7E53, "table_getweaponreticle" }, + { 0x7E55, "tablet" }, + { 0x7E58, "tablet_prop" }, + { 0x7E7A, "take_cover_warning" }, + { 0x7E7B, "take_cover_warning_loop" }, + { 0x7E7D, "take_fire_tracking" }, + { 0x7E8C, "takeover_flash" }, + { 0x7E91, "talk_for_time" }, + { 0x7E95, "tall_grass_friendly_exit_logic" }, + { 0x7E9D, "tall_grass_guys_went_hot" }, + { 0x7EAD, "tank_ambient_waits" }, + { 0x7EBE, "tank_damage_allies" }, + { 0x7EC0, "tank_death_allies" }, + { 0x7ECB, "tank_drop_slide_allies" }, + { 0x7ECC, "tank_dropmines" }, + { 0x7ED0, "tank_event" }, + { 0x7ED1, "tank_fire_at_enemies" }, + { 0x7EDA, "tank_handledeath" }, + { 0x7EE0, "tank_hud" }, + { 0x7EE5, "tank_hud_crack_left" }, + { 0x7EF1, "tank_hud_vignette" }, + { 0x7F03, "tank_rumble" }, + { 0x7F04, "tank_save" }, + { 0x7F08, "tank_setinactive" }, + { 0x7F1E, "tank_watchlowhealth" }, + { 0x7F27, "tankfire_spline_jeep" }, + { 0x7F29, "tankflash" }, + { 0x7F39, "tankupdate" }, + { 0x7F3F, "targertname" }, + { 0x7F46, "target_ent_cleanup" }, + { 0x7F47, "target_entity" }, + { 0x7F4C, "target_min_range" }, + { 0x7F55, "target_trace_to_owners_eyes" }, + { 0x7F57, "target_unset_islockedon" }, + { 0x7F63, "targetingoffset" }, + { 0x7F6A, "targetpointtooclose" }, + { 0x7F78, "team1" }, + { 0x7F84, "team_hive_performance" }, + { 0x7F93, "teamflashbangimmunity" }, + { 0x7F94, "teamheadicon" }, + { 0x7F97, "teamkilldelay" }, + { 0x7FA3, "teamprogressbartexty" }, + { 0x7FA4, "teamprogressbarwidth" }, + { 0x7FA6, "teams" }, + { 0x7FB0, "teargas_cough_vo" }, + { 0x7FB1, "teargas_coughing" }, + { 0x7FB9, "teargas_loaded" }, + { 0x7FBF, "teargas_vo" }, + { 0x7FC5, "teleport_add_delta" }, + { 0x7FD8, "teleport_failsafe" }, + { 0x7FDD, "teleport_get_care_packages" }, + { 0x7FE0, "teleport_get_safe_node_near" }, + { 0x7FE4, "teleport_include_killstreaks" }, + { 0x7FE8, "teleport_is_valid_zone" }, + { 0x7FEC, "teleport_notify_death" }, + { 0x7FF6, "teleport_onteleportgrind" }, + { 0x8004, "teleport_pre_onstartgamesd_and_sr" }, + { 0x8007, "teleport_self_add_delta" }, + { 0x8016, "teleport_to_zone_agents" }, + { 0x8017, "teleport_to_zone_character" }, + { 0x801C, "teleport_zone_current" }, + { 0x8027, "tell_player_to_stay" }, + { 0x8043, "test_attack_heli" }, + { 0x8045, "test_connect_paths" }, + { 0x8048, "test_guy_do_goalor_die" }, + { 0x8049, "test_individual_spawner" }, + { 0x8057, "testingapache_animations" }, + { 0x805B, "text1" }, + { 0x8065, "text_titlefadeout" }, + { 0x807E, "thermite2" }, + { 0x808E, "thorough_delete" }, + { 0x8097, "threatcallouttracking" }, + { 0x80AA, "throw_stones_idle" }, + { 0x80B1, "throwingknifeused" }, + { 0x80B2, "thrown_entities" }, + { 0x80B3, "thrown_semtex_grenades" }, + { 0x80C7, "thruster_timer_logic" }, + { 0x80CB, "thunder_big_sound_moving" }, + { 0x80E0, "tilt_exfil_props" }, + { 0x80E1, "tilt_exp_heli_clip" }, + { 0x80E3, "tilt_front_deck_impact" }, + { 0x80E8, "tilt_handler" }, + { 0x80EF, "tilt_osprey_1" }, + { 0x80F4, "tilt_player_stumble" }, + { 0x80F5, "tilt_player_vault" }, + { 0x8109, "tilt_run_forward_monitor" }, + { 0x8117, "timebetweenshots" }, + { 0x8118, "timecheck" }, + { 0x8121, "timelimitthread" }, + { 0x8123, "timeofnextsound" }, + { 0x8124, "timeout" }, + { 0x8126, "timeout_watch" }, + { 0x8128, "timeoutregenfaster" }, + { 0x8129, "timepaused" }, + { 0x812F, "timer_ten_change" }, + { 0x8131, "timername" }, + { 0x8132, "timerpausetime" }, + { 0x8136, "timescale" }, + { 0x8153, "toggle_zoom" }, + { 0x8158, "too_close_to_boat" }, + { 0x815A, "took_damage" }, + { 0x8161, "topattackpasses" }, + { 0x817C, "total_runner_drone_spawn_count" }, + { 0x8186, "totalscore" }, + { 0x8188, "touched" }, + { 0x8193, "tower_a10_flyby" }, + { 0x81A7, "tower_door_pitchfx" }, + { 0x81B0, "tower_entrance_stumblers" }, + { 0x81B5, "tower_hesh_help_wounded" }, + { 0x81BD, "tower_nh90_guys" }, + { 0x81BE, "tower_pickup_b" }, + { 0x81BF, "tower_radio" }, + { 0x81C8, "tower_retreat_mortars_hit" }, + { 0x81CF, "tower_vista_retreat_tank" }, + { 0x81D8, "toy_tvs_flatscreen_sturdy" }, + { 0x81DC, "trace_part_for_efx" }, + { 0x81DE, "trace_to_forward" }, + { 0x81ED, "track_dud" }, + { 0x81F9, "track_odin_down" }, + { 0x8219, "trackingweaponheadshots" }, + { 0x8224, "trackloop_cqbshootpos" }, + { 0x822A, "trackshootentorpos" }, + { 0x8239, "train_nag" }, + { 0x8240, "train_pathing" }, + { 0x824A, "train_tele_trig_proc" }, + { 0x824B, "train_teleport" }, + { 0x8250, "trains_move" }, + { 0x8252, "trajectoryactive" }, + { 0x826E, "transitiontime" }, + { 0x8277, "translate_off_edge" }, + { 0x827E, "trap_cage_init" }, + { 0x827F, "trap_can_player_trigger" }, + { 0x8282, "trap_damage_scalar" }, + { 0x8287, "trap_explosive_init" }, + { 0x8289, "trap_get_launch_dir" }, + { 0x828E, "trap_get_targets" }, + { 0x8290, "trap_get_unset_use_text" }, + { 0x829A, "trap_launcher_init" }, + { 0x829C, "trap_launcher_reset" }, + { 0x82AD, "trap_set_can_use" }, + { 0x82B1, "trap_state_funcs" }, + { 0x82BA, "trap_use_trigger_init" }, + { 0x82C5, "travel_view_fx" }, + { 0x82D5, "traversedeath" }, + { 0x82DA, "traverseinfo" }, + { 0x82E6, "treadfx_override_nh90" }, + { 0x82F5, "trench_beach_allies_ambient" }, + { 0x82F6, "trench_beach_allies_ambient_off" }, + { 0x82FA, "trench_boat_think" }, + { 0x82FC, "trench_chargers_think" }, + { 0x8302, "trench_friendly_orange_guy" }, + { 0x830F, "trench_spawn_functions" }, + { 0x8325, "trig_stairs_setup" }, + { 0x8330, "trigger_battlechatter" }, + { 0x8333, "trigger_createart_transient" }, + { 0x833B, "trigger_disable_on_jump" }, + { 0x833C, "trigger_door" }, + { 0x833F, "trigger_enemy_spawn" }, + { 0x8347, "trigger_flag_set_specialops" }, + { 0x8348, "trigger_flag_set_specialops_clear" }, + { 0x834F, "trigger_functions" }, + { 0x8351, "trigger_glass_break" }, + { 0x8352, "trigger_group" }, + { 0x835D, "trigger_int_building_hits" }, + { 0x836D, "trigger_multiple_depthoffield" }, + { 0x836F, "trigger_multiple_fx_trigger_on_think" }, + { 0x8371, "trigger_multiple_fx_volume_off_target" }, + { 0x8373, "trigger_multiple_sunflare" }, + { 0x8380, "trigger_parse_parameters" }, + { 0x839D, "trigger_spawngroup" }, + { 0x83A5, "trigger_turns_off" }, + { 0x83AD, "trigger_wait" }, + { 0x83BB, "triggers" }, + { 0x83DC, "truck_rumble" }, + { 0x83EC, "try_take_player_currency" }, + { 0x8404, "tryorderto" }, + { 0x8409, "tryuse" }, + { 0x8417, "tryuse_dpad_team_ammo" }, + { 0x841B, "tryuse_dpad_team_explosives" }, + { 0x842E, "tryusedeployableammo" }, + { 0x8445, "tryuseperkstreak" }, + { 0x8449, "tryuserefillammo" }, + { 0x8451, "tryusesam" }, + { 0x845B, "tryuseuplink" }, + { 0x845C, "tryusevanguard" }, + { 0x8464, "tunnel_behavior" }, + { 0x8468, "tunnel_door_clip" }, + { 0x8469, "tunnel_door_scene" }, + { 0x847F, "tunnel_tank_crush" }, + { 0x8480, "tunnel_vehicle_think" }, + { 0x8482, "tunnel_vehix_stop_sounds" }, + { 0x848A, "turn_exit_trigger_on" }, + { 0x8491, "turn_off_gas_fx" }, + { 0x8495, "turn_off_nodes" }, + { 0x84A6, "turn_on_gaztiger_underwater_bubble_fx" }, + { 0x84B5, "turnbackon" }, + { 0x84B9, "turnoff" }, + { 0x84C6, "turret_activate" }, + { 0x84D1, "turret_cleanup_on_unload" }, + { 0x84D4, "turret_coolmonitor" }, + { 0x84DA, "turret_deleteme" }, + { 0x84DF, "turret_function" }, + { 0x84EB, "turret_impact" }, + { 0x84F5, "turret_oncarrierchangedteam" }, + { 0x84F7, "turret_oncarrierdisconnect" }, + { 0x8503, "turret_setcarried" }, + { 0x8512, "turret_target_updater" }, + { 0x8521, "turretattachpoint" }, + { 0x8523, "turretdeathanimroot" }, + { 0x852B, "turretinfo" }, + { 0x853F, "tv_changes_intensity" }, + { 0x8544, "tv_play" }, + { 0x8549, "tweak_player_view_do_rotate" }, + { 0x856C, "uav_rig_controller" }, + { 0x856F, "uav_sort" }, + { 0x857C, "ui_action_slot_force_active_off" }, + { 0x857F, "ui_bomb_planting_defusing" }, + { 0x8581, "ui_dom_securing" }, + { 0x858B, "unblock_curtain" }, + { 0x858F, "underwater" }, + { 0x8592, "underwater_combat_amb" }, + { 0x8595, "underwater_melee_kill_achievement_count" }, + { 0x85BC, "unloadque" }, + { 0x85BF, "unlock_flag" }, + { 0x85C6, "unmatched_death_rig_light_waits_for_lights_off" }, + { 0x85C7, "unresolved_collision_count" }, + { 0x85CA, "unresolved_collision_kill" }, + { 0x85D3, "unset_forcegoal" }, + { 0x85D6, "unset_perk" }, + { 0x85DF, "unset_perk_health_level_3" }, + { 0x85E1, "unset_perk_medic_0" }, + { 0x85ED, "unset_perk_pistol_magnum_2" }, + { 0x85F0, "unset_perk_pistol_mp443_0" }, + { 0x85F3, "unset_perk_pistol_mp443_3" }, + { 0x85FC, "unset_perk_rigger_2" }, + { 0x862B, "unsetlightarmor" }, + { 0x8632, "unsetpainted" }, + { 0x8639, "unsetrefillgrenades" }, + { 0x864E, "unstoppable_friendly_fire_shield" }, + { 0x8658, "update_achievement" }, + { 0x8659, "update_achievement_all_players" }, + { 0x8663, "update_bike_player_avoidance" }, + { 0x867A, "update_goal_vol_from_trigger" }, + { 0x867B, "update_heli_crash_location" }, + { 0x8689, "update_melee_spitter" }, + { 0x868A, "update_motion_tracker_speed" }, + { 0x8690, "update_no_reloads" }, + { 0x86AA, "update_shotguns_only" }, + { 0x86AD, "update_soflam_ammocount" }, + { 0x86B2, "update_steering" }, + { 0x86C1, "update_weaponstats_hits" }, + { 0x86CB, "updateareanodes" }, + { 0x86D7, "updatecheckforceragdoll" }, + { 0x86E6, "updateenemyuse" }, + { 0x86E9, "updatefreeplayedtime" }, + { 0x8709, "updateobjectivetext" }, + { 0x8729, "updatesavedlastweapon" }, + { 0x872E, "updatesentrypositionthread" }, + { 0x8734, "updatesppercent" }, + { 0x8739, "updatestreakcount" }, + { 0x873A, "updatestreakslots" }, + { 0x873F, "updateteamplacement" }, + { 0x8741, "updateteamscores" }, + { 0x8748, "updatetimerpausedness" }, + { 0x8757, "updatewinlossstats" }, + { 0x875A, "updateworldicons" }, + { 0x8760, "uplink_override_moving_platform_death" }, + { 0x8767, "upload_virus_anims" }, + { 0x8779, "use_big_splash" }, + { 0x8780, "use_dpad_glsentry" }, + { 0x878C, "use_dpad_team_randombox" }, + { 0x878E, "use_dpad_war_machine" }, + { 0x8799, "use_switch_toggle_multiple" }, + { 0x87A0, "use_trigger" }, + { 0x87A5, "useballdrone" }, + { 0x87BB, "usehardpoint_regularmp" }, + { 0x87BE, "usehintstring" }, + { 0x87C0, "useholdthinkloop" }, + { 0x87E5, "using_hdr_fog" }, + { 0x87EA, "using_remote_turret_when_died" }, + { 0x87EC, "using_string_tables" }, + { 0x87F1, "usingmg" }, + { 0x87F6, "usingprimary" }, + { 0x87F7, "usingremote" }, + { 0x87F9, "usingriflelikeweapon" }, + { 0x8803, "util_derrick_destroy_quick" }, + { 0x882B, "vanguard_missile_radius" }, + { 0x8833, "vanguard_origin" }, + { 0x8834, "vanguard_pick_node" }, + { 0x883C, "vanguard_showreticletoplayer" }, + { 0x8842, "vanguardfiremisslefunc" }, + { 0x8847, "vantage_nag" }, + { 0x886B, "vault_vol_1" }, + { 0x886F, "vault_water" }, + { 0x8884, "vehicle_ai_turret_gunner_ignore_all_until_unload" }, + { 0x8893, "vehicle_attack_missile" }, + { 0x889A, "vehicle_controlling" }, + { 0x88A0, "vehicle_death_anim" }, + { 0x88A6, "vehicle_death_jolt" }, + { 0x88AB, "vehicle_deathmodel_delay" }, + { 0x88AE, "vehicle_deletegroup" }, + { 0x88B0, "vehicle_detourpaths" }, + { 0x88B9, "vehicle_dynamicpath" }, + { 0x88BE, "vehicle_fire_loop" }, + { 0x88C0, "vehicle_frontarmor" }, + { 0x88C9, "vehicle_getinanim_clear" }, + { 0x88CC, "vehicle_getinstart" }, + { 0x88D1, "vehicle_grenadeshield" }, + { 0x88DA, "vehicle_idle_override" }, + { 0x88DF, "vehicle_isstationary" }, + { 0x88ED, "vehicle_liftoff" }, + { 0x88EF, "vehicle_lights" }, + { 0x88F2, "vehicle_lights_off" }, + { 0x88FC, "vehicle_mainturrets" }, + { 0x8905, "vehicle_play_guy_anim" }, + { 0x8910, "vehicle_resume_named" }, + { 0x8916, "vehicle_ridespawners" }, + { 0x8919, "vehicle_rumble_override" }, + { 0x892C, "vehicle_spawner_adjust_health_and_damage" }, + { 0x8931, "vehicle_startmovegroup" }, + { 0x893B, "vehicle_turn_left" }, + { 0x8945, "vehicle_unloadgroups" }, + { 0x8946, "vehicle_unloadwhenattacked" }, + { 0x894C, "vehicle_zpu_can_target" }, + { 0x8955, "vehiclekilled" }, + { 0x8966, "verifydedicatedconfiguration" }, + { 0x898A, "vfx_hostage1_waterboard_stop" }, + { 0x8999, "vfx_torpedo_wings_out" }, + { 0x899A, "vfxarry" }, + { 0x89A0, "victimteam" }, + { 0x89AB, "view_particle_source_alt" }, + { 0x89B5, "viewfx" }, + { 0x89C3, "vignette_drone_spawn" }, + { 0x89D0, "vignette_register_wait" }, + { 0x89D8, "vignette_unignore_everything" }, + { 0x89D9, "vignette_vehicle_delete" }, + { 0x89E2, "vip_enemy_interrupt" }, + { 0x89F6, "visibleto" }, + { 0x89FD, "vision_mudpumps_end" }, + { 0x8A03, "vision_set_fog_progress" }, + { 0x8A04, "vision_set_refinery_visionsets" }, + { 0x8A0B, "visionset_diff" }, + { 0x8A0C, "visiontest" }, + { 0x8A1B, "vista_tilt_model" }, + { 0x8A1C, "vista_tilt_setup" }, + { 0x8A1D, "vista_vehicles" }, + { 0x8A1F, "visual_origin" }, + { 0x8A33, "vo_flag_timer" }, + { 0x8A37, "vo_system" }, + { 0x8A3F, "voice_is_british_based" }, + { 0x8A40, "voicecanburst" }, + { 0x8A46, "vol" }, + { 0x8A57, "vttype" }, + { 0x8A5F, "vulture_savetostruct" }, + { 0x8A62, "vulture_waitfortriggerstop" }, + { 0x8A64, "w_alpha" }, + { 0x8A6C, "wait_endon" }, + { 0x8A6D, "wait_for_ability_use" }, + { 0x8A91, "wait_for_proximity_check_activation" }, + { 0x8AB7, "wait_till_distance_from_enemy" }, + { 0x8AB9, "wait_till_offscreen_then_delete" }, + { 0x8ABC, "wait_till_shot" }, + { 0x8AC3, "wait_until_anim_finishes" }, + { 0x8AC5, "wait_until_enemies_in_volume" }, + { 0x8ADC, "waitforchangeteams" }, + { 0x8ADD, "waitforclassselect" }, + { 0x8AE8, "waitformovemodechange" }, + { 0x8AF6, "waitforstancechange" }, + { 0x8AFA, "waitforstuck" }, + { 0x8AFC, "waitfortimeornotify" }, + { 0x8B04, "waitingforgate" }, + { 0x8B05, "waitingtodeactivate" }, + { 0x8B0B, "waitloadoutdone" }, + { 0x8B17, "waitskipkillcambutton" }, + { 0x8B18, "waitskipkillcambuttonduringdeathtimer" }, + { 0x8B1E, "waittakekillstreakweapon" }, + { 0x8B2D, "waittill_any_in_array_or_timeout_no_endon_death" }, + { 0x8B2F, "waittill_any_in_array_return_no_endon_death" }, + { 0x8B34, "waittill_any_return_no_endon_death" }, + { 0x8B38, "waittill_any_triggered_return_triggerer" }, + { 0x8B39, "waittill_array_dead" }, + { 0x8B3B, "waittill_breach_enemy_dead" }, + { 0x8B3C, "waittill_clockambush_driver_dead" }, + { 0x8B4D, "waittill_death_respawn" }, + { 0x8B5A, "waittill_entity_in_range" }, + { 0x8B61, "waittill_forever" }, + { 0x8B6B, "waittill_knockdown_moment" }, + { 0x8B75, "waittill_my_death" }, + { 0x8B7C, "waittill_notify_or_timeout" }, + { 0x8B92, "waittill_player_not_looking" }, + { 0x8BA1, "waittill_time_out" }, + { 0x8BA6, "waittill_trigger_ent_targetname" }, + { 0x8BA8, "waittill_triggered_current" }, + { 0x8BAD, "waittill_volume_dead_then_set_flag" }, + { 0x8BAE, "waittill_weapon_placed" }, + { 0x8BCB, "waituntilwaverelease" }, + { 0x8BD1, "wakeup_enemies" }, + { 0x8BD5, "wakeup_to_player_distance" }, + { 0x8BE0, "walkout_do_stop_transition_anim" }, + { 0x8BE6, "walkway_collapse_clip_show" }, + { 0x8BF2, "wall_friction_enabled" }, + { 0x8BF4, "wall_friction_trace_dist" }, + { 0x8BF9, "wall_lights" }, + { 0x8C00, "wants_to_fire" }, + { 0x8C2B, "warhawkcustombotkillstreakfunc" }, + { 0x8C35, "warthog" }, + { 0x8C38, "warthog_player_fadeout_crash" }, + { 0x8C62, "watch_damage" }, + { 0x8C6E, "watch_for_ally_see_convoy" }, + { 0x8C80, "watch_for_round_room_combat" }, + { 0x8C82, "watch_for_shockwave_hit" }, + { 0x8C8E, "watch_if_used" }, + { 0x8C99, "watch_nodes_stop" }, + { 0x8C9D, "watch_placed_sentry" }, + { 0x8CA2, "watch_player_escape" }, + { 0x8CAC, "watch_player_wake_scientists" }, + { 0x8CB4, "watch_smoke" }, + { 0x8CB8, "watch_throwing_knife_land" }, + { 0x8CBB, "watch_tv_for_damage" }, + { 0x8CC5, "watchattackstate" }, + { 0x8CD7, "watchdeployablemarkercancel" }, + { 0x8CDD, "watchdvars" }, + { 0x8D07, "watchoffhandcancel" }, + { 0x8D22, "watchsmokeuse" }, + { 0x8D24, "watchstartweaponchange" }, + { 0x8D28, "watchstoprevenge" }, + { 0x8D29, "watchsuppression" }, + { 0x8D34, "watchweaponpickuphorde" }, + { 0x8D52, "water_surface_think" }, + { 0x8D5F, "waterball_main_side_setup" }, + { 0x8D79, "wave_3_charge_spawn_func" }, + { 0x8D7E, "wave_has_delayed_spawn_type" }, + { 0x8D8D, "weap_has_thermal" }, + { 0x8D91, "weapon_change_timer" }, + { 0x8D9A, "weapon_notify_loop" }, + { 0x8DA1, "weaponattachments" }, + { 0x8DC2, "weaponspeed" }, + { 0x8DC9, "weapontagright" }, + { 0x8DD3, "weld_sound_loop_npc" }, + { 0x8DDA, "weldtool" }, + { 0x8DE4, "whisper" }, + { 0x8DE6, "white_overlay" }, + { 0x8DFA, "window_crash" }, + { 0x8E0C, "wing_tag" }, + { 0x8E11, "winner" }, + { 0x8E12, "winners" }, + { 0x8E15, "wipeout" }, + { 0x8E33, "wolfpack_circle_dialogue" }, + { 0x8E44, "world_vault_clip" }, + { 0x8E51, "wreck_hint_up" }, + { 0x8E52, "wreck_jumper_watcher" }, + { 0x8E5B, "write_log" }, + { 0x8E96, "yoff" }, + { 0x8E9C, "yscale" }, + { 0x8E9E, "z_max" }, + { 0x8EA8, "zipline" }, + { 0x8EA9, "zipline_allies_anims" }, + { 0x8EAA, "zipline_allies_vo" }, + { 0x8EB8, "zipline_launcher_setup_anims" }, + { 0x8EBC, "zipline_rope_baker" }, + { 0x8EC1, "zipline_startpoint" }, + { 0x8EC5, "zipline_trolley_rorke" }, + { 0x8ECA, "zodiac_ally_shoot_targets" }, + { 0x8ECC, "zodiac_b" }, + { 0x8ED7, "zodiac_osprey_2_wave" }, + { 0x8EE0, "zodiac_teleport_logic" }, + { 0x8EE7, "zodiacs_defend_vo" }, + { 0x8EE8, "zoffset" }, + { 0x8EE9, "zone" }, + { 0x8EF2, "zoom_lerp_dof" }, +}}; + +struct __init__ +{ + __init__() + { + static bool init = false; + if(init) return; + init = true; + + opcode_map.reserve(opcode_list.size()); + opcode_map_rev.reserve(opcode_list.size()); + function_map.reserve(function_list.size()); + function_map_rev.reserve(function_list.size()); + method_map.reserve(method_list.size()); + method_map_rev.reserve(method_list.size()); + file_map.reserve(file_list.size()); + file_map_rev.reserve(file_list.size()); + token_map.reserve(token_list.size()); + token_map_rev.reserve(token_list.size()); + + for(const auto& entry : opcode_list) + { + opcode_map.insert({ entry.key, entry.value }); + opcode_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : function_list) + { + function_map.insert({ entry.key, entry.value }); + function_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : method_list) + { + method_map.insert({ entry.key, entry.value }); + method_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : file_list) + { + file_map.insert({ entry.key, entry.value }); + file_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : token_list) + { + token_map.insert({ entry.key, entry.value }); + token_map_rev.insert({ utils::string::to_lower(entry.value), entry.key }); + } + } +}; + +__init__ _; + +} // namespace xsk::gsc::iw6 diff --git a/src/iw6/xsk/resolver.hpp b/src/iw6/xsk/resolver.hpp new file mode 100644 index 00000000..d8f733c0 --- /dev/null +++ b/src/iw6/xsk/resolver.hpp @@ -0,0 +1,33 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::iw6 +{ + +class resolver +{ +public: + static auto opcode_id(const std::string& name) -> std::uint8_t; + static auto opcode_name(std::uint8_t id) -> std::string; + + static auto function_id(const std::string& name) -> std::uint16_t; + static auto function_name(std::uint16_t id) -> std::string; + + static auto method_id(const std::string& name) -> std::uint16_t; + static auto method_name(std::uint16_t id) -> std::string; + + static auto file_id(const std::string& name) -> std::uint16_t; + static auto file_name(std::uint16_t id) -> std::string; + + static auto token_id(const std::string& name) -> std::uint16_t; + static auto token_name(std::uint16_t id) -> std::string; + + static auto find_function(const std::string& name) -> bool; + static auto find_method(const std::string& name) -> bool; +}; + +} // namespace xsk::gsc::iw6 diff --git a/src/iw7/stdafx.cpp b/src/iw7/stdafx.cpp new file mode 100644 index 00000000..0f0f08c2 --- /dev/null +++ b/src/iw7/stdafx.cpp @@ -0,0 +1,6 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" diff --git a/src/iw7/stdafx.hpp b/src/iw7/stdafx.hpp new file mode 100644 index 00000000..6cf2fff4 --- /dev/null +++ b/src/iw7/stdafx.hpp @@ -0,0 +1,38 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +// Warnings +#ifdef _WIN32 +#pragma warning(disable:4244) +#pragma warning(disable:4267) +#pragma warning(disable:4005) +#pragma warning(disable:4065) +#define _CRT_SECURE_NO_WARNINGS +#endif + +// C/C++ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Ext +using namespace std::literals; + +#include "xsk/iw7.hpp" diff --git a/src/iw7/xsk/assembler.cpp b/src/iw7/xsk/assembler.cpp new file mode 100644 index 00000000..aeb29d2b --- /dev/null +++ b/src/iw7/xsk/assembler.cpp @@ -0,0 +1,608 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw7.hpp" + +namespace xsk::gsc::iw7 +{ + +auto assembler::output_script() -> std::vector +{ + std::vector script; + + if(script_ == nullptr) return script; + + script.resize(script_->pos()); + memcpy(script.data(), script_->buffer().data(), script.size()); + + return script; +} + +auto assembler::output_stack() -> std::vector +{ + std::vector stack; + + if(stack_ == nullptr) return stack; + + stack.resize(stack_->pos()); + memcpy(stack.data(), stack_->buffer().data(), stack.size()); + + return stack; +} + +void assembler::assemble(const std::string& file, std::vector& data) +{ + std::vector assembly = utils::string::clean_buffer_lines(data); + std::vector functions; + gsc::function_ptr func = nullptr; + std::uint32_t index = 1; + std::uint16_t switchnum = 0; + + for (auto& line : assembly) + { + if (line == "" || line.substr(0, 2) == "//") + { + continue; + } + else if (line.substr(0, 4) == "sub_") + { + func = std::make_unique(); + func->index = index; + func->name = line.substr(4); + } + else if (line.substr(0, 4) == "end_") + { + if (func != nullptr) + { + func->size = index - func->index; + functions.push_back(std::move(func)); + } + } + else if (line.substr(0, 4) == "loc_") + { + func->labels[index] = line; + } + else + { + auto data = utils::string::parse_code(line); + + if (switchnum) + { + if (data[0] == "case" || data[0] == "default") + { + for (auto& entry : data) + { + func->instructions.back()->data.push_back(entry); + } + switchnum--; + continue; + } + + throw gsc::asm_error("invalid instruction inside endswitch \""s + line + "\"!"); + } + else + { + auto inst = std::make_unique(); + inst->index = index; + inst->opcode = static_cast(resolver::opcode_id(data[0])); + inst->size = opcode_size(inst->opcode); + data.erase(data.begin()); + inst->data = std::move(data); + + if (opcode(inst->opcode) == opcode::OP_endswitch) + { + switchnum = static_cast(std::stoul(inst->data[0])); + inst->size += 7 * switchnum; + } + + index += inst->size; + func->instructions.push_back(std::move(inst)); + } + } + } + + this->assemble(file, functions); +} + +void assembler::assemble(const std::string& file, std::vector& functions) +{ + script_ = std::make_unique(0x100000); + stack_ = std::make_unique(0x100000); + filename_ = file; + functions_ = std::move(functions); + + script_->write(static_cast(opcode::OP_End)); + stack_->write(0x69773630); + + for (const auto& func : functions_) + { + this->assemble_function(func); + } +} + +void assembler::assemble_function(const gsc::function_ptr& func) +{ + labels_ = func->labels; + + stack_->write(func->size); + + func->id = func->name.substr(0, 3) == "_ID" ? std::stoul(func->name.substr(3)) : resolver::token_id(func->name); + stack_->write(func->id); + + if (func->id == 0) + { + stack_->write_c_string(func->name); + } + + for (const auto& inst : func->instructions) + { + this->assemble_instruction(inst); + } +} + +void assembler::assemble_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_Return: + case opcode::OP_BoolNot: + case opcode::OP_CastBool: + case opcode::OP_inequality: + case opcode::OP_GetThisthread: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_checkclearparams: + case opcode::OP_CastFieldObject: + case opcode::OP_End: + case opcode::OP_size: + case opcode::OP_EmptyArray: + case opcode::OP_bit_and: + case opcode::OP_less_equal: + case opcode::OP_voidCodepos: + case opcode::OP_ClearVariableField: + case opcode::OP_divide: + case opcode::OP_GetSelf: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_plus: + case opcode::OP_BoolComplement: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_inc: + case opcode::OP_clearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_endon: + case opcode::OP_greater_equal: + case opcode::OP_GetSelfObject: + case opcode::OP_SetVariableField: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_less: + case opcode::OP_GetGameRef: + case opcode::OP_waittillFrameEnd: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_notify: + case opcode::OP_DecTop: + case opcode::OP_shift_left: + case opcode::OP_greater: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_minus: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_multiply: + case opcode::OP_mod: + case opcode::OP_GetGame: + case opcode::OP_waittill: + case opcode::OP_dec: + case opcode::OP_PreScriptCall: + case opcode::OP_GetAnim: + case opcode::OP_GetUndefined: + case opcode::OP_GetAnimObject: + case opcode::OP_GetLevelObject: + case opcode::OP_bit_ex_or: + case opcode::OP_equality: + case opcode::OP_ClearArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalArray: + case opcode::OP_vector: + case opcode::OP_bit_or: + case opcode::OP_AddArray: + case opcode::OP_waittillmatch2: + case opcode::OP_shift_right: + script_->write(static_cast(inst->opcode)); + break; + case opcode::OP_GetByte: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetNegByte: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetUnsignedShort: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetNegUnsignedShort: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + case opcode::OP_GetInteger: + script_->write(static_cast(inst->opcode)); + script_->write(std::stoi(inst->data[0])); + break; + case opcode::OP_GetFloat: + script_->write(static_cast(inst->opcode)); + script_->write(std::stof(inst->data[0])); + break; + case opcode::OP_GetVector: + script_->write(static_cast(inst->opcode)); + script_->write(std::stof(inst->data[0])); + script_->write(std::stof(inst->data[1])); + script_->write(std::stof(inst->data[2])); + break; + case opcode::OP_GetString: + case opcode::OP_GetIString: + script_->write(static_cast(inst->opcode)); + script_->write(0); + stack_->write_c_string(utils::string::to_code(inst->data[0])); + break; + case opcode::OP_GetAnimation: + script_->write(static_cast(inst->opcode)); + script_->write(0); + script_->write(0); + stack_->write_c_string(utils::string::unquote(inst->data[0])); + stack_->write_c_string(utils::string::unquote(inst->data[1])); + break; + case opcode::OP_GetAnimTree: + script_->write(static_cast(inst->opcode)); + script_->write(0); + stack_->write_c_string(utils::string::unquote(inst->data[0])); + break; + case opcode::OP_waittillmatch: + script_->write(static_cast(inst->opcode)); + script_->write(0); + break; + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_EvalLocalArrayCached: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + this->assemble_field_variable(inst); + break; + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + this->assemble_local_call(inst, false); + break; + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + this->assemble_local_call(inst, true); + break; + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + this->assemble_far_call(inst, false); + break; + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + this->assemble_far_call(inst, true); + break; + case opcode::OP_CallBuiltin: + this->assemble_builtin_call(inst, false, true); + break; + case opcode::OP_CallBuiltinMethod: + this->assemble_builtin_call(inst, true, true); + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + this->assemble_builtin_call(inst, false, false); + break; + case opcode::OP_GetBuiltinMethod: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + this->assemble_builtin_call(inst, true, false); + break; + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + this->assemble_jump(inst, true, false); + break; + case opcode::OP_jumpback: + this->assemble_jump(inst, false, true); + break; + case opcode::OP_jump: + this->assemble_jump(inst, false, false); + break; + case opcode::OP_switch: + this->assemble_switch(inst); + break; + case opcode::OP_endswitch: + this->assemble_end_switch(inst); + break; + default: + throw gsc::asm_error(utils::string::va("Unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); + } +} + +void assembler::assemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num) +{ + script_->write(static_cast(inst->opcode)); + + std::uint16_t id = 0; + + if (arg_num) + { + script_->write(static_cast(std::stol(inst->data[0]))); + + if (method) + id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::method_id(inst->data[1]); + else + id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::function_id(inst->data[1]); + } + else + { + if (method) + id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::method_id(inst->data[0]); + else + id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::function_id(inst->data[0]); + } + + script_->write(id); +} + +void assembler::assemble_local_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_function(inst->data[0]); + + std::int32_t offset = addr - inst->index - 1; + + this->assemble_offset(offset); + + if (thread) + { + script_->write(static_cast(std::stol(inst->data[1]))); + } +} + +void assembler::assemble_far_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->write(static_cast(inst->opcode)); + script_->write(0); + script_->write(0); + + std::uint32_t file_id = 0; + std::uint32_t func_id = 0; + + if (thread) + { + script_->write(static_cast(std::stol(inst->data[0]))); + + file_id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::file_id(inst->data[1]); + func_id = inst->data[2].substr(0, 3) == "_ID" ? std::stol(inst->data[2].substr(3)) : resolver::token_id(inst->data[2]); + } + else + { + file_id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::file_id(inst->data[0]); + func_id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::token_id(inst->data[1]); + } + + stack_->write(file_id); + if (file_id == 0) stack_->write_c_string(thread ? inst->data[1] : inst->data[0]); + stack_->write(func_id); + if (func_id == 0) stack_->write_c_string(thread ? inst->data[2] : inst->data[1]); +} + +void assembler::assemble_switch(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_label(inst->data[0]); + + script_->write(addr - inst->index - 4); +} + +void assembler::assemble_end_switch(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::uint16_t casenum = 0; + + if (utils::string::is_number(inst->data[0])) + { + casenum = std::stol(inst->data[0]); + } + else + { + throw gsc::asm_error("invalid endswitch number!"); + } + + script_->write(casenum); + + std::uint32_t internal_index = inst->index + 3; + + for (std::uint16_t i = 0; i < casenum; i++) + { + if (inst->data[1 + (3 * i)] == "case") + { + if (utils::string::is_number(inst->data[1 + (3 * i) + 1])) + { + script_->write((std::stol(inst->data[1 + (3 * i) + 1]) & 0xFFFFFF) + 0x800000); + } + else + { + script_->write(i + 1); + stack_->write_c_string(utils::string::unquote(inst->data[1 + (3 * i) + 1])); + } + + internal_index += 4; + + std::int32_t addr = this->resolve_label(inst->data[1 + (3 * i) + 2]); + + this->assemble_offset(addr - internal_index); + + internal_index += 3; + } + else if (inst->data[1 + (3 * i)] == "default") + { + script_->write(0); + stack_->write_c_string("\x01"); + + internal_index += 4; + std::int32_t addr = this->resolve_label(inst->data[1 + (3 * i) + 1]); + + this->assemble_offset(addr - internal_index); + + internal_index += 3; + } + } +} + +void assembler::assemble_field_variable(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::uint32_t field_id = 0; + + if (inst->data[0].substr(0, 3) == "_ID") + { + field_id = std::stoul(inst->data[0].substr(3)); + } + else + { + field_id = resolver::token_id(inst->data[0]); + + if (field_id == 0) + { + field_id = 0xFFFF; + } + } + + script_->write(field_id); + + if (field_id > 0x13FCC) + { + stack_->write(0); + stack_->write_c_string(inst->data[0]); + } +} + +void assembler::assemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_label(inst->data[0]); + + if (expr) + { + script_->write(addr - inst->index - 3); + } + else if (back) + { + script_->write((inst->index + 3) - addr); + } + else + { + script_->write(addr - inst->index - 5); + } +} + +void assembler::assemble_offset(std::int32_t offset) +{ + std::array bytes = {}; + + offset = (offset << 9) >> 8; + + *reinterpret_cast(bytes.data()) = offset; + + script_->write(bytes[0]); + script_->write(bytes[1]); + script_->write(bytes[2]); +} + +auto assembler::resolve_function(const std::string& name) -> std::uint32_t +{ + auto temp = name.substr(0, 4) == "sub_" ? name.substr(4) : name; + + for (const auto& func : functions_) + { + if (func->name == temp) + { + return func->index; + } + } + + throw gsc::asm_error("Couldn't resolve local function address of '" + temp + "'!"); +} + +auto assembler::resolve_label(const std::string& name) -> std::uint32_t +{ + for (auto& func : labels_) + { + if (func.second == name) + { + return func.first; + } + } + + throw gsc::asm_error("Couldn't resolve label address of '" + name + "'!"); +} + +} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/assembler.hpp b/src/iw7/xsk/assembler.hpp new file mode 100644 index 00000000..a37444f7 --- /dev/null +++ b/src/iw7/xsk/assembler.hpp @@ -0,0 +1,40 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::iw7 +{ + +class assembler : public gsc::assembler +{ + std::string filename_; + utils::byte_buffer_ptr script_; + utils::byte_buffer_ptr stack_; + std::vector functions_; + std::unordered_map labels_; + +public: + auto output_script() -> std::vector; + auto output_stack() -> std::vector; + void assemble(const std::string& file, std::vector& data); + void assemble(const std::string& file, std::vector& functions); + +private: + void assemble_function(const gsc::function_ptr& func); + void assemble_instruction(const gsc::instruction_ptr& inst); + void assemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num); + void assemble_local_call(const gsc::instruction_ptr& inst, bool thread); + void assemble_far_call(const gsc::instruction_ptr& inst, bool thread); + void assemble_switch(const gsc::instruction_ptr& inst); + void assemble_end_switch(const gsc::instruction_ptr& inst); + void assemble_field_variable(const gsc::instruction_ptr& inst); + void assemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back); + void assemble_offset(std::int32_t offset); + auto resolve_function(const std::string& name) -> std::uint32_t; + auto resolve_label(const std::string& name) -> std::uint32_t; +}; + +} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/compiler.cpp b/src/iw7/xsk/compiler.cpp new file mode 100644 index 00000000..13f4f866 --- /dev/null +++ b/src/iw7/xsk/compiler.cpp @@ -0,0 +1,2289 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw7.hpp" +#include "parser.hpp" +#include "lexer.hpp" + +namespace xsk::gsc::iw7 +{ + +auto compiler::output() -> std::vector +{ + return std::move(assembly_); +} + +void compiler::compile(const std::string& file, std::vector& data) +{ + filename_ = file; + + auto result = parse_buffer(filename_, data); + + compile_program(result); +} + +void compiler::set_readf_callback(std::function(const std::string&)> func) +{ + callback_readf_ = func; +} + +auto compiler::parse_buffer(const std::string& file, std::vector& data) -> gsc::program_ptr +{ + yyscan_t scanner; + gsc::location loc; + gsc::program_ptr result(nullptr); + + loc.initialize(&file); + // Add the two NULL terminators, required by flex. + data.push_back(0); + data.push_back(0); + + if (iw7_lex_init(&scanner)) + exit(1); + + YY_BUFFER_STATE yybuffer = iw7__scan_buffer(reinterpret_cast(data.data()), data.size(), scanner); + + parser parser(scanner, loc, result); + + if(parser.parse() || result == nullptr) + { + throw gsc::comp_error(loc, "An unknown error ocurred while parsing gsc file."); + } + + iw7__delete_buffer(yybuffer, scanner); + iw7_lex_destroy(scanner); + + return result; +} + +auto compiler::parse_file(const std::string& file) -> gsc::program_ptr +{ + auto buffer = callback_readf_(file); + auto result = parse_buffer(file, buffer); + + return result; +} + +void compiler::compile_program(const gsc::program_ptr& program) +{ + assembly_.clear(); + includes_.clear(); + animtrees_.clear(); + constants_.clear(); + local_functions_.clear(); + index_ = 1; + + for(const auto& def : program->definitions) + { + if(def.as_node->type == gsc::node_t::thread) + { + local_functions_.push_back(def.as_thread->name->value); + } + } + + for(const auto& include : program->includes) + { + emit_include(include); + } + + for(const auto& def : program->definitions) + { + emit_define(def); + } + +#ifdef DEBUG_GSC_COMPILER + print_debug_info(); +#endif +} + +void compiler::emit_include(const gsc::include_ptr& include) +{ + const auto& path = include->file->value; + + for(const auto& inc : includes_) + { + if(inc.name == path) + { + throw gsc::comp_error(include->loc, "error duplicated include file '" + path + "'."); + } + } + + if(map_known_includes(path)) return; + + try + { + auto program = parse_file(path); + + std::vector funcs; + + for(const auto& def : program->definitions) + { + if(def.as_node->type == gsc::node_t::thread) + { + funcs.push_back(def.as_thread->name->value); + } + } + + if(funcs.size() == 0) + { + throw gsc::comp_error(include->loc, "error empty include file '" + path + "'."); + } + + includes_.push_back(include_t(path, funcs)); + } + catch(const std::exception& e) + { + throw gsc::comp_error(include->loc, "error parsing include file '" + path + "': " + e.what()); + } +} + +void compiler::emit_define(const gsc::define_ptr& define) +{ + switch(define.as_node->type) + { + case gsc::node_t::usingtree: emit_usingtree(define.as_usingtree); break; + case gsc::node_t::constant: emit_constant(define.as_constant); break; + case gsc::node_t::thread: emit_thread(define.as_thread); break; + default: break; + } +} + +void compiler::emit_usingtree(const gsc::usingtree_ptr& animtree) +{ + animtrees_.push_back({ animtree->animtree->value, false }); +} + +void compiler::emit_constant(const gsc::constant_ptr& constant) +{ + constants_.insert({ constant->name->value, std::move(constant->value) }); +} + +void compiler::emit_thread(const gsc::thread_ptr& thread) +{ + function_ = std::make_unique(); + function_->index = index_; + function_->name = thread->name->value; + + auto ctx = std::make_unique(); + stack_idx_ = 0; + label_idx_ = 0; + can_break_ = false; + can_continue_ = false; + local_stack_.clear(); + break_ctxs_.clear(); + continue_ctxs_.clear(); + + process_thread(ctx, thread); + + emit_parameters(ctx, thread->params); + emit_stmt_list(ctx, thread->block, true); + emit_opcode(ctx, opcode::OP_End); + + function_->size = index_ - function_->index; + assembly_.push_back(std::move(function_)); +} + +void compiler::emit_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + initialize_variable(ctx, param); + emit_opcode(ctx, opcode::OP_SafeCreateVariableFieldCached, variable_create_index(ctx, param)); + } + + emit_opcode(ctx, opcode::OP_checkclearparams); +} + +void compiler::emit_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt, bool last) +{ + switch(stmt.as_node->type) + { + case gsc::node_t::stmt_list: emit_stmt_list(ctx, stmt.as_list, last); break; + case gsc::node_t::stmt_call: emit_stmt_call(ctx, stmt.as_call); break; + case gsc::node_t::stmt_assign: emit_stmt_assign(ctx, stmt.as_assign); break; + case gsc::node_t::stmt_endon: emit_stmt_endon(ctx, stmt.as_endon); break; + case gsc::node_t::stmt_notify: emit_stmt_notify(ctx, stmt.as_notify); break; + case gsc::node_t::stmt_wait: emit_stmt_wait(ctx, stmt.as_wait); break; + case gsc::node_t::stmt_waittill: emit_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_waittillmatch: emit_stmt_waittillmatch(ctx, stmt.as_waittillmatch); break; + case gsc::node_t::stmt_waittillframeend: emit_stmt_waittillframeend(ctx, stmt.as_waittillframeend); break; + case gsc::node_t::stmt_if: emit_stmt_if(ctx, stmt.as_if, last); break; + case gsc::node_t::stmt_ifelse: emit_stmt_ifelse(ctx, stmt.as_ifelse, last); break; + case gsc::node_t::stmt_while: emit_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: emit_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: emit_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: emit_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_case: emit_stmt_case(ctx, stmt.as_case); break; + case gsc::node_t::stmt_default: emit_stmt_default(ctx, stmt.as_default); break; + case gsc::node_t::stmt_break: emit_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_continue: emit_stmt_continue(ctx, stmt.as_continue); break; + case gsc::node_t::stmt_return: emit_stmt_return(ctx, stmt.as_return); break; + default: break; + } +} + +void compiler::emit_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt, bool last) +{ + for (const auto& entry : stmt->stmts) + { + bool last_ = (&entry == &stmt->stmts.back() && last) ? true : false; + emit_stmt(ctx, entry, last_); + } +} + +void compiler::emit_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt) +{ + if(stmt->expr->func.as_node->type == gsc::node_t::expr_call_function) + { + const auto& name = stmt->expr->func.as_func->name->value; + + if(name == "assert" || name == "assertex" || name == "assertmsg") return; + } + + emit_expr_call(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_DecTop); +} + +void compiler::emit_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt) +{ + emit_expr_assign(ctx, stmt->expr); +} + +void compiler::emit_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_endon); +} + +void compiler::emit_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt) +{ + emit_opcode(ctx, opcode::OP_voidCodepos); + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + emit_expr(ctx, arg); + } + + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_notify); +} + +void compiler::emit_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_wait); +} + +void compiler::emit_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_waittill); + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + create_variable(ctx, arg.as_name); + emit_opcode(ctx, opcode::OP_SafeSetWaittillVariableFieldCached, variable_access_index(ctx, arg.as_name)); + } + + emit_opcode(ctx, opcode::OP_clearparams); +} + +void compiler::emit_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt) +{ + emit_expr_arguments(ctx, stmt->args); + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_waittillmatch); + emit_opcode(ctx, opcode::OP_clearparams); +} + +void compiler::emit_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt) +{ + emit_opcode(ctx, opcode::OP_waittillFrameEnd); +} + +void compiler::emit_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt, bool last) +{ + auto end_loc = create_label(); + + if(stmt->expr.as_node->type == gsc::node_t::expr_not) + { + emit_expr(ctx, stmt->expr.as_not->rvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrue, end_loc); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, end_loc); + } + + ctx->transfer(stmt->ctx); + stmt->ctx->is_last = last; + + emit_stmt(stmt->ctx, stmt->stmt, last); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_remove_local_vars(stmt->ctx); + + insert_label(end_loc); +} + +void compiler::emit_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt, bool last) +{ + std::vector childs; + auto else_loc = create_label(); + auto end_loc = create_label(); + + if(stmt->expr.as_node->type == gsc::node_t::expr_not) + { + emit_expr(ctx, stmt->expr.as_not->rvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrue, else_loc); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, else_loc); + } + + ctx->transfer(stmt->ctx_if); + stmt->ctx_if->is_last = last; + + emit_stmt(stmt->ctx_if, stmt->stmt_if, last); + + emit_remove_local_vars(stmt->ctx_if); + + if(stmt->ctx_if->abort == abort_t::abort_none) + childs.push_back(stmt->ctx_if.get()); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_opcode(ctx, opcode::OP_jump, end_loc); + + insert_label(else_loc); + + ctx->transfer(stmt->ctx_else); + stmt->ctx_else->is_last = last; + + emit_stmt(stmt->ctx_else, stmt->stmt_else, last); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_remove_local_vars(stmt->ctx_else); + + if(stmt->ctx_else->abort == abort_t::abort_none) + childs.push_back(stmt->ctx_else.get()); + + insert_label(end_loc); + + ctx->init_from_child(childs); +} + +void compiler::emit_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = true; + can_continue_ = true; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + + auto begin_loc = insert_label(); + + bool const_cond = is_constant_condition(stmt->expr); + + if(!const_cond) + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + } + + emit_stmt(stmt->ctx, stmt->stmt, false); + + insert_label(continue_loc); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + + if(const_cond) + ctx->init_from_child(break_ctxs_); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = false; + can_continue_ = false; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + emit_stmt(ctx, stmt->pre_expr, false); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + ctx->transfer(stmt->ctx_post); + + auto begin_loc = insert_label(); + + bool const_cond = is_constant_condition(stmt->expr); + + if(!const_cond) + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + } + + can_break_ = true; + can_continue_ = true; + + emit_stmt(stmt->ctx, stmt->stmt, false); + + if(stmt->ctx->abort == abort_t::abort_none) + continue_ctxs_.push_back(stmt->ctx.get()); + + can_break_ = false; + can_continue_ = false; + + insert_label(continue_loc); + + stmt->ctx_post->init_from_child(continue_ctxs_); + + emit_stmt(stmt->ctx_post, stmt->post_expr, false); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + + if(const_cond) + ctx->init_from_child(break_ctxs_); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = false; + can_continue_ = false; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + emit_expr(ctx, stmt->array_expr); + emit_variable_ref(ctx, stmt->array, true); + emit_variable(ctx, stmt->array); + emit_opcode(ctx, opcode::OP_CallBuiltin1, "getfirstarraykey"); + emit_variable_ref(ctx, stmt->key_expr, true); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + + ctx->transfer(stmt->ctx_post); + + auto begin_loc = insert_label(); + + emit_variable(ctx, stmt->key_expr); + emit_opcode(ctx, opcode::OP_CallBuiltin1, "isdefined"); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + + can_break_ = true; + can_continue_ = true; + + emit_variable(stmt->ctx, stmt->key_expr); + emit_opcode(stmt->ctx, opcode::OP_EvalLocalArrayCached, variable_access_index(stmt->ctx, stmt->array.as_name)); + emit_variable_ref(stmt->ctx, stmt->value_expr, true); + emit_stmt(stmt->ctx, stmt->stmt, false); + + if(stmt->ctx->abort == abort_t::abort_none) + continue_ctxs_.push_back(stmt->ctx.get()); + + can_break_ = false; + can_continue_ = false; + + insert_label(continue_loc); + + stmt->ctx_post->init_from_child(continue_ctxs_); + + emit_variable(stmt->ctx_post, stmt->key_expr); + emit_variable(stmt->ctx_post, stmt->array); + emit_opcode(stmt->ctx_post, opcode::OP_CallBuiltin2, "getnextarraykey"); + emit_variable_ref(stmt->ctx_post, stmt->key_expr, true); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + emit_clear_local_variable(ctx, stmt->array.as_name); + if(!stmt->use_key) emit_clear_local_variable(ctx, stmt->key_expr.as_name); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_break = can_break_; + break_ctxs_.clear(); + can_break_ = false; + + auto jmptable_loc = create_label(); + auto break_loc = create_label(); + + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_switch, jmptable_loc); + + can_break_ = true; + + std::vector data; + data.push_back(utils::string::va("%d", stmt->stmt->stmts.size())); + + bool has_default = false; + gsc::context* default_ctx = nullptr; + + for(auto i = 0; i < stmt->stmt->stmts.size(); i++) + { + auto& entry = stmt->stmt->stmts[i]; + + if(entry.as_node->type == gsc::node_t::stmt_case) + { + auto& case_ = entry.as_case; + if(case_->value.as_node->type == gsc::node_t::data_integer) + { + auto loc = insert_label(); + data.push_back("case"); + data.push_back(case_->value.as_integer->value); + data.push_back(loc); + } + else if(case_->value.as_node->type == gsc::node_t::data_string) + { + auto loc = insert_label(); + data.push_back("case"); + data.push_back(case_->value.as_string->value); + data.push_back(loc); + } + else + { + throw gsc::comp_error(stmt->loc, "case type must be int or string"); + } + + ctx->transfer(case_->ctx); + case_->ctx->loc_break = break_loc; + emit_stmt_list(case_->ctx, case_->stmt, false); + if(case_->stmt->stmts.size() > 0) + emit_remove_local_vars(case_->ctx); + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + auto loc = insert_label(); + data.push_back("default"); + data.push_back(loc); + + has_default = true; + default_ctx = entry.as_default->ctx.get(); + + ctx->transfer(entry.as_default->ctx); + entry.as_default->ctx->loc_break = break_loc; + emit_stmt_list(entry.as_default->ctx, entry.as_default->stmt, false); + if(entry.as_default->stmt->stmts.size() > 0) + emit_remove_local_vars(entry.as_default->ctx); + } + else + { + throw gsc::comp_error(entry.as_node->loc, "missing case statement"); + } + } + + if(has_default) + { + if(default_ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(default_ctx); + } + ctx->init_from_child(break_ctxs_); + } + + insert_label(jmptable_loc); + + emit_opcode(ctx, opcode::OP_endswitch, data); + + auto offset = 7 * stmt->stmt->stmts.size(); + function_->instructions.back()->size += offset; + index_ += offset; + + insert_label(break_loc); + + can_break_ = old_break; + break_ctxs_ = old_breaks; +} + +void compiler::emit_stmt_case(const gsc::context_ptr& ctx, const gsc::stmt_case_ptr& stmt) +{ + throw gsc::comp_error(stmt->loc, "illegal case statement"); +} + +void compiler::emit_stmt_default(const gsc::context_ptr& ctx, const gsc::stmt_default_ptr& stmt) +{ + throw gsc::comp_error(stmt->loc, "illegal default statement"); +} + +void compiler::emit_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + if(can_break_ && ctx->abort == abort_t::abort_none && ctx->loc_break != "") + { + break_ctxs_.push_back(ctx.get()); + emit_remove_local_vars(ctx); + ctx->abort = abort_t::abort_break; + emit_opcode(ctx, opcode::OP_jump, ctx->loc_break); + } + else + { + throw gsc::comp_error(stmt->loc, "illegal break statement"); + } +} + +void compiler::emit_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt) +{ + if(can_break_ && ctx->abort == abort_t::abort_none && ctx->loc_continue != "") + { + continue_ctxs_.push_back(ctx.get()); + emit_remove_local_vars(ctx); + ctx->abort = abort_t::abort_continue; + emit_opcode(ctx, opcode::OP_jump, ctx->loc_continue); + } + else + { + throw gsc::comp_error(stmt->loc, "illegal continue statement"); + } +} + +void compiler::emit_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + ctx->abort = abort_t::abort_return; + } + + if(stmt->expr.as_node->type == gsc::node_t::null) + { + emit_opcode(ctx, opcode::OP_End); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_Return); + } +} + +void compiler::emit_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_and: emit_expr_and(ctx, expr.as_and); break; + case gsc::node_t::expr_or: emit_expr_or(ctx, expr.as_or); break; + case gsc::node_t::expr_equality: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_inequality: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less_equal: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater_equal: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_or: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_and: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_exor: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_left: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_right: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_add: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_sub: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mult: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_div: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mod: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_complement: emit_expr_complement(ctx, expr.as_complement); break; + case gsc::node_t::expr_not: emit_expr_not(ctx, expr.as_not); break; + case gsc::node_t::expr_call: emit_expr_call(ctx, expr.as_call); break; + case gsc::node_t::expr_function: emit_expr_function(ctx, expr.as_function); break; + case gsc::node_t::expr_add_array: emit_expr_add_array(ctx, expr.as_add_array); break; + case gsc::node_t::expr_array: emit_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: emit_field_variable(ctx, expr.as_field); break; + case gsc::node_t::expr_size: emit_expr_size(ctx, expr.as_size); break; + case gsc::node_t::data_thisthread: emit_opcode(ctx, opcode::OP_GetThisthread); break; + case gsc::node_t::data_empty_array: emit_opcode(ctx, opcode::OP_EmptyArray); break; + case gsc::node_t::data_undefined: emit_opcode(ctx, opcode::OP_GetUndefined); break; + case gsc::node_t::data_game: emit_opcode(ctx, opcode::OP_GetGame); break; + case gsc::node_t::data_self: emit_opcode(ctx, opcode::OP_GetSelf); break; + case gsc::node_t::data_anim: emit_opcode(ctx, opcode::OP_GetAnim); break; + case gsc::node_t::data_level: emit_opcode(ctx, opcode::OP_GetLevel); break; + case gsc::node_t::data_animation: emit_animation(ctx, expr.as_animation); break; + case gsc::node_t::data_animtree: emit_animtree(ctx, expr.as_animtree); break; + case gsc::node_t::data_name: emit_local_variable(ctx, expr.as_name); break; + case gsc::node_t::data_istring: emit_istring(ctx, expr.as_istring); break; + case gsc::node_t::data_string: emit_string(ctx, expr.as_string); break; + case gsc::node_t::data_vector: emit_vector(ctx, expr.as_vector); break; + case gsc::node_t::data_float: emit_float(ctx, expr.as_float); break; + case gsc::node_t::data_integer: emit_integer(ctx, expr.as_integer); break; + case gsc::node_t::data_false: emit_false(ctx, expr.as_false); break; + case gsc::node_t::data_true: emit_true(ctx, expr.as_true); break; + default: throw gsc::comp_error(expr.as_node->loc, "unknown expression"); break; + } +} + +void compiler::emit_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr) +{ + if(expr->type == gsc::node_t::expr_increment) + { + emit_variable_ref(ctx, expr->lvalue, false); + emit_opcode(ctx, opcode::OP_inc); + emit_opcode(ctx, opcode::OP_SetVariableField); + } + else if(expr->type == gsc::node_t::expr_decrement) + { + emit_variable_ref(ctx, expr->lvalue, false); + emit_opcode(ctx, opcode::OP_dec); + emit_opcode(ctx, opcode::OP_SetVariableField); + } + else if(expr->type == gsc::node_t::expr_assign_equal) + { + if(expr->rvalue.as_node->type == gsc::node_t::data_undefined) + { + emit_expr_clear_variable(ctx, expr->lvalue); + } + else + { + emit_expr(ctx, expr->rvalue); + emit_variable_ref(ctx, expr->lvalue, true); + } + } + else + { + emit_expr(ctx, expr->lvalue); + emit_expr(ctx, expr->rvalue); + + switch(expr->type) + { + case gsc::node_t::expr_assign_add: emit_opcode(ctx, opcode::OP_plus); break; + case gsc::node_t::expr_assign_sub: emit_opcode(ctx, opcode::OP_minus); break; + case gsc::node_t::expr_assign_mult: emit_opcode(ctx, opcode::OP_multiply); break; + case gsc::node_t::expr_assign_div: emit_opcode(ctx, opcode::OP_divide); break; + case gsc::node_t::expr_assign_mod: emit_opcode(ctx, opcode::OP_mod); break; + case gsc::node_t::expr_assign_shift_left: emit_opcode(ctx, opcode::OP_shift_left); break; + case gsc::node_t::expr_assign_shift_right: emit_opcode(ctx, opcode::OP_shift_right); break; + case gsc::node_t::expr_assign_bitwise_or: emit_opcode(ctx, opcode::OP_bit_or); break; + case gsc::node_t::expr_assign_bitwise_and: emit_opcode(ctx, opcode::OP_bit_and); break; + case gsc::node_t::expr_assign_bitwise_exor: emit_opcode(ctx, opcode::OP_bit_ex_or); break; + default: throw gsc::comp_error(expr->loc, "unknown assign operation"); break; + } + + emit_variable_ref(ctx, expr->lvalue, true); + } +} + +void compiler::emit_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr) +{ + emit_expr(ctx, expr->lvalue); + emit_expr(ctx, expr->rvalue); + + switch(expr->type) + { + case gsc::node_t::expr_equality: emit_opcode(ctx, opcode::OP_equality); break; + case gsc::node_t::expr_inequality: emit_opcode(ctx, opcode::OP_inequality); break; + case gsc::node_t::expr_less: emit_opcode(ctx, opcode::OP_less); break; + case gsc::node_t::expr_greater: emit_opcode(ctx, opcode::OP_greater); break; + case gsc::node_t::expr_less_equal: emit_opcode(ctx, opcode::OP_less_equal); break; + case gsc::node_t::expr_greater_equal: emit_opcode(ctx, opcode::OP_greater_equal); break; + case gsc::node_t::expr_bitwise_or: emit_opcode(ctx, opcode::OP_bit_or); break; + case gsc::node_t::expr_bitwise_and: emit_opcode(ctx, opcode::OP_bit_and); break; + case gsc::node_t::expr_bitwise_exor: emit_opcode(ctx, opcode::OP_bit_ex_or); break; + case gsc::node_t::expr_shift_left: emit_opcode(ctx, opcode::OP_shift_left); break; + case gsc::node_t::expr_shift_right: emit_opcode(ctx, opcode::OP_shift_right); break; + case gsc::node_t::expr_add: emit_opcode(ctx, opcode::OP_plus); break; + case gsc::node_t::expr_sub: emit_opcode(ctx, opcode::OP_minus); break; + case gsc::node_t::expr_mult: emit_opcode(ctx, opcode::OP_multiply); break; + case gsc::node_t::expr_div: emit_opcode(ctx, opcode::OP_divide); break; + case gsc::node_t::expr_mod: emit_opcode(ctx, opcode::OP_mod); break; + default: throw gsc::comp_error(expr->loc, "unknown binary expression"); break; + } +} + +void compiler::emit_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr) +{ + auto label = create_label(); + + emit_expr(ctx, expr->lvalue); + emit_opcode(ctx, opcode::OP_JumpOnFalseExpr, label); + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_CastBool); + + insert_label(label); +} + +void compiler::emit_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr) +{ + auto label = create_label(); + + emit_expr(ctx, expr->lvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrueExpr, label); + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_CastBool); + + insert_label(label); +} + +void compiler::emit_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr) +{ + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_BoolComplement); +} + +void compiler::emit_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr) +{ + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_BoolNot); +} + +void compiler::emit_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + if(expr->func.as_node->type == gsc::node_t::expr_call_pointer) + { + emit_expr_call_pointer(ctx, expr); + } + else + { + emit_expr_call_function(ctx, expr); + } +} + +void compiler::emit_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + bool thread = expr->thread; + bool child = expr->child; + bool method = expr->obj.as_node->type != gsc::node_t::null ? true : false; + bool builtin = builtin = expr->func.as_pointer->builtin; + std::uint32_t args = expr->func.as_pointer->args->list.size(); + + if(thread && child || thread && builtin || child && builtin) + throw gsc::comp_error(expr->loc, "function call have more than 1 type (thread, childthread, builtin)"); + + if(!thread && !child && !builtin) emit_opcode(ctx, opcode::OP_PreScriptCall); + + emit_expr_arguments(ctx, expr->func.as_pointer->args); + + if(method) emit_expr(ctx, expr->obj); + + emit_expr(ctx, expr->func.as_pointer->expr); + emit_expr_call_pointer_type(ctx, args, builtin, method, thread, child); +} + +void compiler::emit_expr_call_pointer_type(const gsc::context_ptr& ctx, int args, bool builtin, bool method, bool thread, bool child) +{ + if(builtin && !method) + { + emit_opcode(ctx, opcode::OP_CallBuiltinPointer, utils::string::va("%d", args)); + } + else if(builtin && method) + { + emit_opcode(ctx, opcode::OP_CallBuiltinMethodPointer, utils::string::va("%d", args)); + } + else if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptThreadCallPointer, utils::string::va("%d", args)); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptMethodThreadCallPointer, utils::string::va("%d", args)); + } + else if (child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptChildThreadCallPointer, utils::string::va("%d", args)); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptMethodChildThreadCallPointer, utils::string::va("%d", args)); + } + else + { + method ? emit_opcode(ctx, opcode::OP_ScriptMethodCallPointer) : emit_opcode(ctx, opcode::OP_ScriptFunctionCallPointer); + } +} + +void compiler::emit_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + bool thread = expr->thread; + bool child = expr->child; + bool method = expr->obj.as_node->type != gsc::node_t::null ? true : false; + std::uint32_t args = expr->func.as_func->args->list.size(); + auto name = expr->func.as_func->name->value; + auto file = expr->func.as_func->file->value; + + bool builtin = false, far = false, local = false; + + if(file != "") far = true; + else + { + if(is_local_call(name)) local = true; + else if(method && is_builtin_method(name)) builtin = true; + else if(!method && is_builtin_func(name)) builtin = true; + else + { + for(const auto& inc : includes_) + { + for(const auto& fun : inc.funcs) + { + if(name == fun) + { + far = true; + file = inc.name; + break; + } + } + } + + if(!builtin && !far && !local) + throw gsc::comp_error(expr->loc, "unknown function call " + name); + } + } + + if(thread && child || thread && builtin || child && builtin) + throw gsc::comp_error(expr->loc, "function call have more than 1 type (thread, childthread, builtin)"); + + if(!thread && !child && !builtin && !(!method && args == 0)) + emit_opcode(ctx, opcode::OP_PreScriptCall); + + emit_expr_arguments(ctx, expr->func.as_func->args); + + if(method) emit_expr(ctx, expr->obj); + + if(builtin) emit_expr_call_function_builtin(ctx, name, args, method); + else if(local) emit_expr_call_function_local(ctx, name, args, method, thread, child); + else if(far) emit_expr_call_function_far(ctx, file, name, args, method, thread, child); +} + +void compiler::emit_expr_call_function_builtin(const gsc::context_ptr& ctx, const std::string& func, int args, bool method) +{ + if(method) + { + switch(args) + { + case 0: emit_opcode(ctx, opcode::OP_CallBuiltinMethod0, func); break; + case 1: emit_opcode(ctx, opcode::OP_CallBuiltinMethod1, func); break; + case 2: emit_opcode(ctx, opcode::OP_CallBuiltinMethod2, func); break; + case 3: emit_opcode(ctx, opcode::OP_CallBuiltinMethod3, func); break; + case 4: emit_opcode(ctx, opcode::OP_CallBuiltinMethod4, func); break; + case 5: emit_opcode(ctx, opcode::OP_CallBuiltinMethod5, func); break; + default: emit_opcode(ctx, opcode::OP_CallBuiltinMethod, { utils::string::va("%d", args), func }); break; + } + } + else + { + switch(args) + { + case 0: emit_opcode(ctx, opcode::OP_CallBuiltin0, func); break; + case 1: emit_opcode(ctx, opcode::OP_CallBuiltin1, func); break; + case 2: emit_opcode(ctx, opcode::OP_CallBuiltin2, func); break; + case 3: emit_opcode(ctx, opcode::OP_CallBuiltin3, func); break; + case 4: emit_opcode(ctx, opcode::OP_CallBuiltin4, func); break; + case 5: emit_opcode(ctx, opcode::OP_CallBuiltin5, func); break; + default: emit_opcode(ctx, opcode::OP_CallBuiltin, { utils::string::va("%d", args), func }); break; + } + } +} + +void compiler::emit_expr_call_function_local(const gsc::context_ptr& ctx, const std::string& func, int args, bool method, bool thread, bool child) +{ + if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalThreadCall, { func, utils::string::va("%d", args) }); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodThreadCall, { func, utils::string::va("%d", args) }); + } + else if(child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptLocalChildThreadCall, { func, utils::string::va("%d", args) }); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodChildThreadCall, { func, utils::string::va("%d", args) }); + } + else if(method && !thread && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodCall, func); + } + else if(!thread && !child && !method && args == 0) + { + emit_opcode(ctx, opcode::OP_ScriptLocalFunctionCall2, func); + } + else if(!thread && !child && !method && args != 0) + { + emit_opcode(ctx, opcode::OP_ScriptLocalFunctionCall, func); + } +} + +void compiler::emit_expr_call_function_far(const gsc::context_ptr& ctx, const std::string& file, const std::string& func, int args, bool method, bool thread, bool child) +{ + if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptFarThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptFarChildThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodChildThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(!thread && !child && method) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodCall, { file, func }); + } + else if(!thread && !child && !method && args == 0) + { + emit_opcode(ctx, opcode::OP_ScriptFarFunctionCall2, { file, func }); + } + else if(!thread && !child && !method && args != 0) + { + emit_opcode(ctx, opcode::OP_ScriptFarFunctionCall, { file, func }); + } +} + +void compiler::emit_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& args) +{ + std::reverse(args->list.begin(), args->list.end()); + + for(auto& arg : args->list) + { + emit_expr(ctx, arg); + } +} + +void compiler::emit_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& expr) +{ + bool far = false, local = false, builtin = false, method = false; + auto name = expr->name->value; + auto file = expr->file->value; + + if(file != "") + { + far = true; + } + else if(is_builtin_method(name)) + { + builtin = true; + method = true; + } + else if(is_builtin_func(name)) + { + builtin = true; + } + else if(is_local_call(name)) + { + local = true; + } + + if(local) + { + emit_opcode(ctx, opcode::OP_GetLocalFunction, name); + } + else if(far) + { + emit_opcode(ctx, opcode::OP_GetFarFunction, { file, name } ); + } + else if(builtin && method) + { + emit_opcode(ctx, opcode::OP_GetBuiltinMethod, name); + } + else if(builtin && !method) + { + emit_opcode(ctx, opcode::OP_GetBuiltinFunction, name); + } +} + +void compiler::emit_expr_clear_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& lvalue) +{ + switch(lvalue.as_node->type) + { + case gsc::node_t::expr_array: + emit_expr(ctx, lvalue.as_array->key); + lvalue.as_array->obj.as_node->type == gsc::node_t::data_game ? emit_opcode(ctx, opcode::OP_GetGameRef) : emit_variable_ref(ctx, lvalue.as_array->obj, false); + emit_opcode(ctx, opcode::OP_ClearArray); + break; + case gsc::node_t::expr_field: + emit_object(ctx, lvalue.as_field->obj); + emit_opcode(ctx, opcode::OP_ClearFieldVariable,lvalue.as_field->field->value); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_GetUndefined); + emit_local_variable_ref(ctx, lvalue.as_name, true); + break; + default: + throw gsc::comp_error(lvalue.as_node->loc, "unknown clear variable lvalue"); + break; + } +} + +void compiler::emit_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr) +{ + if(expr->args->list.size() <= 0) + { + throw gsc::comp_error(expr->loc, "invalid empty add array. did u mean '[]' ?"); + } + + emit_opcode(ctx, opcode::OP_EmptyArray); + + for(const auto& arg : expr->args->list) + { + emit_expr(ctx, arg); + emit_opcode(ctx, opcode::OP_AddArray); + } +} + +void compiler::emit_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr) +{ + emit_variable(ctx, expr->obj); + emit_opcode(ctx, opcode::OP_size); +} + +void compiler::emit_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr, bool set) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_array: emit_array_variable_ref(ctx, expr.as_array, set); break; + case gsc::node_t::expr_field: emit_field_variable_ref(ctx, expr.as_field, set); break; + case gsc::node_t::data_name: emit_local_variable_ref(ctx, expr.as_name, set); break; + default: throw gsc::comp_error(expr.as_node->loc, "invalid variable reference type."); break; + } +} + +void compiler::emit_array_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr, bool set) +{ + emit_expr(ctx, expr->key); + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_game: + emit_opcode(ctx, opcode::OP_GetGameRef); + emit_opcode(ctx, opcode::OP_EvalArrayRef); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_array: + case gsc::node_t::expr_field: + emit_variable_ref(ctx, expr->obj, false); + emit_opcode(ctx, opcode::OP_EvalArrayRef); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::data_name: + { + if(!variable_initialized(ctx, expr->obj.as_name)) + { + initialize_variable(ctx, expr->obj.as_name); + emit_opcode(ctx, opcode::OP_EvalNewLocalArrayRefCached0, variable_create_index(ctx, expr->obj.as_name)); + + if(!set) + { + throw gsc::comp_error(expr->loc, "INTERNAL: VAR CREATED BUT NOT SET!"); + } + } + else if(variable_stack_index(ctx, expr->obj.as_name) == 0) + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayRefCached0); + } + else + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayRefCached, variable_access_index(ctx, expr->obj.as_name)); + } + + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + } + break; + case gsc::node_t::expr_call: + throw gsc::comp_error(expr->loc, "call result can't be referenced."); + break; + default: + throw gsc::comp_error(expr->loc, "unknown array object type"); + break; + } +} + +void compiler::emit_field_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr, bool set) +{ + const auto& field = expr->field->value; + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_level: + set ? emit_opcode(ctx, opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalLevelFieldVariableRef, field); + break; + case gsc::node_t::data_anim: + set ? emit_opcode(ctx, opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalAnimFieldVariableRef, field); + break; + case gsc::node_t::data_self: + set ? emit_opcode(ctx, opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalSelfFieldVariableRef, field); + break; + case gsc::node_t::expr_array: + emit_array_variable(ctx, expr->obj.as_array); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_field: + emit_field_variable(ctx, expr->obj.as_field); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr->obj.as_name)); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_call: + throw gsc::comp_error(expr->loc, "function call result can't be referenced"); + break; + default: + throw gsc::comp_error(expr->loc, "unknown field variable object type"); + break; + } +} + +void compiler::emit_local_variable_ref(const gsc::context_ptr& ctx, const gsc::name_ptr& expr, bool set) +{ + const auto itr = constants_.find(expr->value); + + if (itr != constants_.end()) + { + throw gsc::comp_error(expr->loc, "variable name already defined as constant " + expr->value); + } + + if(set) + { + if(!variable_initialized(ctx, expr)) + { + initialize_variable(ctx, expr); + emit_opcode(ctx, opcode::OP_SetNewLocalVariableFieldCached0, variable_create_index(ctx, expr)); + } + else if(variable_stack_index(ctx, expr) == 0) + { + emit_opcode(ctx, opcode::OP_SetLocalVariableFieldCached0); + } + else + { + emit_opcode(ctx, opcode::OP_SetLocalVariableFieldCached, variable_access_index(ctx, expr)); + } + } + else + { + auto index = variable_stack_index(ctx, expr); + + if(index == 0) + emit_opcode(ctx, opcode::OP_EvalLocalVariableRefCached0); + else + emit_opcode(ctx, opcode::OP_EvalLocalVariableRefCached, variable_access_index(ctx, expr)); + } +} + +void compiler::emit_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + // for obj.size + switch(expr.as_node->type) + { + case gsc::node_t::expr_array: emit_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: emit_field_variable(ctx, expr.as_field); break; + case gsc::node_t::data_name: emit_local_variable(ctx, expr.as_name); break; + case gsc::node_t::expr_call: emit_expr_call(ctx, expr.as_call); break; + default: throw gsc::comp_error(expr.as_node->loc, "invalid variable type."); break; + } +} + +void compiler::emit_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr) +{ + emit_expr(ctx, expr->key); + + if(expr->obj.as_node->type == gsc::node_t::data_name) + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayCached, variable_access_index(ctx, expr->obj.as_name)); + } + else + { + emit_expr(ctx, expr->obj); + emit_opcode(ctx, opcode::OP_EvalArray); + } +} + +void compiler::emit_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr) +{ + const auto& field = expr->field->value; + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_level: + emit_opcode(ctx, opcode::OP_EvalLevelFieldVariable, field); + break; + case gsc::node_t::data_anim: + emit_opcode(ctx, opcode::OP_EvalAnimFieldVariable, field); + break; + case gsc::node_t::data_self: + emit_opcode(ctx, opcode::OP_EvalSelfFieldVariable, field); + break; + case gsc::node_t::expr_array: + emit_array_variable(ctx, expr->obj.as_array); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::expr_field: + emit_field_variable(ctx, expr->obj.as_field); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::expr_call: + emit_expr_call(ctx, expr->obj.as_call); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr->obj.as_name)); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + default: + throw gsc::comp_error(expr->loc, "unknown field variable object type"); + break; + } +} + +void compiler::emit_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + // is constant ( should only allow: string, loc string, number, vector) + const auto itr = constants_.find(expr->value); + + if (itr != constants_.end()) + { + const auto& value = itr->second; + emit_expr(ctx, value); + return; + } + + // is local var + auto index = variable_stack_index(ctx, expr); + + switch(index) + { + case 0: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached0); break; + case 1: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached1); break; + case 2: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached2); break; + case 3: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached3); break; + case 4: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached4); break; + case 5: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached5); break; + default: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached, variable_access_index(ctx, expr)); break; + } +} + +void compiler::emit_clear_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + auto index = variable_stack_index(ctx, expr); + + if(index == 0) + { + emit_opcode(ctx, opcode::OP_ClearLocalVariableFieldCached0); + } + else + { + emit_opcode(ctx, opcode::OP_ClearLocalVariableFieldCached, variable_access_index(ctx, expr)); + } +} + +void compiler::emit_create_local_vars(const gsc::context_ptr& ctx) +{ + if ( ctx->local_vars_create_count != ctx->local_vars_public_count ) + { + for(auto i = ctx->local_vars_create_count; i < ctx->local_vars_public_count; i++) + { + auto data = utils::string::va("%d", ctx->local_vars.at(i).create); + emit_opcode(ctx, opcode::OP_CreateLocalVariable, data); + ctx->local_vars.at(i).init = true; + } + ctx->local_vars_create_count = ctx->local_vars_public_count; + } +} + +void compiler::emit_remove_local_vars(const gsc::context_ptr& ctx) +{ + if(ctx->abort == abort_t::abort_none) + { + auto count = ctx->local_vars_create_count - ctx->local_vars_public_count; + + if(count > 0) + { + auto data = utils::string::va("%d", count); + emit_opcode(ctx, opcode::OP_RemoveLocalVariables, data); + } + } +} + +void compiler::emit_object(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + // need revision used for clear variable + switch(expr.as_node->type) + { + case gsc::node_t::data_level: + emit_opcode(ctx, opcode::OP_GetLevelObject); + break; + case gsc::node_t::data_anim: + emit_opcode(ctx, opcode::OP_GetAnimObject); + break; + case gsc::node_t::data_self: + emit_opcode(ctx, opcode::OP_GetSelfObject); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr.as_name)); + break; + case gsc::node_t::expr_call: + emit_expr_call(ctx, expr.as_call); + emit_opcode(ctx, opcode::OP_CastFieldObject); + break; + // array ? + // field ? + default: + throw gsc::comp_error(expr.as_node->loc, "unknown object type"); + break; + } +} + +void compiler::emit_animtree(const gsc::context_ptr& ctx, const gsc::animtree_ptr& animtree) +{ + if(animtrees_.size() == 0) + { + throw gsc::comp_error( animtree->loc, "trying to use animtree without specified using animtree"); + } + + auto& tree = animtrees_.back(); + + if(tree.loaded) + { + emit_opcode(ctx, opcode::OP_GetAnimTree, "''"); + } + else + { + emit_opcode(ctx, opcode::OP_GetAnimTree, tree.name); + tree.loaded = true; + } +} + +void compiler::emit_animation(const gsc::context_ptr& ctx, const gsc::animation_ptr& animation) +{ + if(animtrees_.size() == 0) + { + throw gsc::comp_error(animation->loc, "trying to use animation without specified using animtree"); + } + + auto& tree = animtrees_.back(); + + if(tree.loaded) + { + emit_opcode(ctx, opcode::OP_GetAnimation, { "''", animation->value }); + } + else + { + emit_opcode(ctx, opcode::OP_GetAnimation, { tree.name, animation->value }); + tree.loaded = true; + } +} + +void compiler::emit_istring(const gsc::context_ptr& ctx, const gsc::istring_ptr& str) +{ + emit_opcode(ctx, opcode::OP_GetIString, str->value); +} + +void compiler::emit_string(const gsc::context_ptr& ctx, const gsc::string_ptr& str) +{ + emit_opcode(ctx, opcode::OP_GetString, str->value); +} + +void compiler::emit_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec) +{ + std::vector data; + + bool expr = false; + + if(vec->x.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->x.as_integer->value); + else if(vec->x.as_node->type == gsc::node_t::data_float) + data.push_back(vec->x.as_float->value); + else expr = true; + + if(vec->y.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->y.as_integer->value); + else if(vec->y.as_node->type == gsc::node_t::data_float) + data.push_back(vec->y.as_float->value); + else expr = true; + + if(vec->z.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->z.as_integer->value); + else if(vec->z.as_node->type == gsc::node_t::data_float) + data.push_back(vec->z.as_float->value); + else expr = true; + + if(!expr) + { + emit_opcode(ctx, opcode::OP_GetVector, data); + } + else + { + emit_expr(ctx, vec->z); + emit_expr(ctx, vec->y); + emit_expr(ctx, vec->x); + emit_opcode(ctx, opcode::OP_vector); + } +} + +void compiler::emit_float(const gsc::context_ptr& ctx, const gsc::float_ptr& num) +{ + emit_opcode(ctx, opcode::OP_GetFloat, num->value); +} + +void compiler::emit_integer(const gsc::context_ptr& ctx, const gsc::integer_ptr& num) +{ + auto value = std::atoi(num->value.data()); + + if(value == 0) + { + emit_opcode(ctx, opcode::OP_GetZero); + } + else if(value > 0 && value < 256) + { + emit_opcode(ctx, opcode::OP_GetByte, num->value); + } + else if(value < 0 && value > -256) + { + emit_opcode(ctx, opcode::OP_GetNegByte, num->value.substr(1)); + } + else if(value < 65536) + { + emit_opcode(ctx, opcode::OP_GetUnsignedShort, num->value); + } + else if(value < 0 && value > -65536) + { + emit_opcode(ctx, opcode::OP_GetNegUnsignedShort, num->value.substr(1)); + } + else + { + emit_opcode(ctx, opcode::OP_GetInteger, num->value); + } +} + +void compiler::emit_false(const gsc::context_ptr& ctx, const gsc::false_ptr& expr) +{ + emit_opcode(ctx, opcode::OP_GetZero); +} + +void compiler::emit_true(const gsc::context_ptr& ctx, const gsc::true_ptr& expr) +{ + emit_opcode(ctx, opcode::OP_GetByte, "1"); +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + + index_ += inst->size; +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::string& data) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + inst->data.push_back(data); + + index_ += inst->size; +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::vector& data) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + inst->data = data; + + index_ += inst->size; +} + +void compiler::process_thread(const gsc::context_ptr& ctx, const gsc::thread_ptr& thread) +{ + process_parameters(ctx, thread->params); + process_stmt_list(ctx, thread->block); +} + +void compiler::process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + register_variable(ctx, param->value); + } +} + +void compiler::process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt) +{ + switch (stmt.as_node->type) + { + case gsc::node_t::stmt_list: process_stmt_list(ctx, stmt.as_list); break; + case gsc::node_t::stmt_assign: process_expr(ctx, stmt.as_assign->expr->lvalue); break; + case gsc::node_t::stmt_waittill: process_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_if: process_stmt_if(ctx, stmt.as_if); break; + case gsc::node_t::stmt_ifelse: process_stmt_ifelse(ctx, stmt.as_ifelse); break; + case gsc::node_t::stmt_while: process_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: process_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: process_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: process_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_break: process_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_continue: process_stmt_continue(ctx, stmt.as_continue); break; + case gsc::node_t::stmt_return: process_stmt_return(ctx, stmt.as_return); break; + default: break; + } +} + +void compiler::process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + for (const auto& entry : stmt->stmts) + { + process_stmt(ctx, entry); + } +} + +void compiler::process_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + if(expr.as_node->type == gsc::node_t::data_name) + { + register_variable(ctx, expr.as_name->value); + } + else if(expr.as_node->type == gsc::node_t::expr_array) + { + process_expr(ctx, expr.as_array->obj); + } +} + +void compiler::process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + register_variable(ctx, arg.as_name->value); + } + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); +} + +void compiler::process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt) +{ + stmt->ctx = std::make_unique(); + + ctx->copy(stmt->ctx); + process_stmt(stmt->ctx, stmt->stmt); + + std::vector childs({ stmt->ctx.get() }); + ctx->merge(childs); +} + +void compiler::process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt) +{ + std::vector childs; + auto abort = abort_t::abort_return; + + stmt->ctx_if = std::make_unique(); + stmt->ctx_else = std::make_unique(); + + ctx->copy(stmt->ctx_if); + process_stmt(stmt->ctx_if, stmt->stmt_if); + + if(stmt->ctx_if->abort <= abort_t::abort_return) + { + abort = stmt->ctx_if->abort; + if(abort == abort_t::abort_none) + childs.push_back(stmt->ctx_if.get()); + } + + ctx->copy(stmt->ctx_else); + process_stmt(stmt->ctx_else, stmt->stmt_else); + + if(stmt->ctx_else->abort <= abort) + { + abort = stmt->ctx_else->abort; + if(abort == abort_t::abort_none) + childs.push_back(stmt->ctx_else.get()); + } + + if(ctx->abort == abort_t::abort_none) + ctx->abort = abort; + + ctx->append(childs); + ctx->merge(childs); +} + +void compiler::process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + bool const_cond = is_constant_condition(stmt->expr); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + stmt->ctx = std::make_unique(); + + ctx->copy(stmt->ctx); + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + if(const_cond) ctx->append(break_ctxs_); + + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + bool const_cond = is_constant_condition(stmt->expr); + + stmt->ctx = std::make_unique(); + stmt->ctx_post = std::make_unique(); + + process_stmt(ctx, stmt->pre_expr); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + ctx->copy(stmt->ctx); + ctx->copy(stmt->ctx_post); + + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + process_stmt(stmt->ctx_post, stmt->post_expr); + + ctx->append({ stmt->ctx_post.get() }); + ctx->merge({ stmt->ctx_post.get() }); + + if(const_cond) ctx->append(break_ctxs_); + + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + auto array_name = utils::string::va("temp_%d", ++label_idx_); + auto key_name = utils::string::va("temp_%d", ++label_idx_); + + stmt->array = expr_ptr(std::make_unique(stmt->loc, array_name)); + + if(!stmt->use_key) + stmt->key_expr = expr_ptr(std::make_unique(stmt->loc, key_name)); + + key_name = stmt->key_expr.as_name->value; + + // calculate variables + + stmt->ctx = std::make_unique(); + stmt->ctx_post = std::make_unique(); + + // calculate pre_expr variables + process_expr(ctx, stmt->array); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + ctx->copy(stmt->ctx); + ctx->copy(stmt->ctx_post); + + // calculate stmt variables & add missing array access as first stmt + process_expr(stmt->ctx, stmt->value_expr); + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + process_expr(stmt->ctx_post, stmt->key_expr); + + ctx->append({ stmt->ctx_post.get() }); + ctx->merge({ stmt->ctx_post.get() }); + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + auto stmt_list = std::make_unique(stmt->stmt->loc); + auto current_case = gsc::stmt_ptr(std::make_unique()); + + auto num = stmt->stmt->stmts.size(); + + for(auto i = 0; i < num; i++) + { + auto& entry = stmt->stmt->stmts[0]; + + if(entry.as_node->type == gsc::node_t::stmt_case || entry.as_node->type == gsc::node_t::stmt_default) + { + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + current_case = std::move(stmt->stmt->stmts[0]); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + else + { + if(current_case.as_node->type != gsc::node_t::null) + { + if(current_case.as_node->type == gsc::node_t::stmt_case) + { + current_case.as_case->stmt->stmts.push_back(std::move(entry)); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + else + { + current_case.as_default->stmt->stmts.push_back(std::move(entry)); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + } + else + { + gsc::comp_error(entry.as_node->loc, "missing case statement"); + } + } + } + + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + // calculate variables + stmt->ctx = std::make_unique(); + std::vector childs; + auto abort = abort_t::abort_return; + bool has_default = false; + gsc::context* default_ctx = nullptr; + auto old_breaks = break_ctxs_; + break_ctxs_.clear(); + + for(auto i = 0; i < stmt_list->stmts.size(); i++) + { + auto& entry = stmt_list->stmts[i]; + + if(entry.as_node->type == gsc::node_t::stmt_case) + { + entry.as_case->ctx = std::make_unique(); + ctx->copy(entry.as_case->ctx); + process_stmt_list(entry.as_case->ctx, entry.as_case->stmt); + + if (entry.as_case->ctx->abort != abort_t::abort_none) + { + if (entry.as_case->ctx->abort == abort_t::abort_break ) + { + entry.as_case->ctx->abort = abort_t::abort_none; + abort = abort_t::abort_none; + childs.push_back(entry.as_case->ctx.get()); + } + else if (entry.as_case->ctx->abort <= abort ) + { + abort = entry.as_case->ctx->abort; + } + } + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + entry.as_default->ctx = std::make_unique(); + ctx->copy(entry.as_default->ctx); + process_stmt_list(entry.as_default->ctx, entry.as_default->stmt); + has_default = true; + default_ctx = entry.as_default->ctx.get(); + + if (entry.as_default->ctx->abort != abort_t::abort_none) + { + if (entry.as_default->ctx->abort == abort_t::abort_break ) + { + entry.as_default->ctx->abort = abort_t::abort_none; + abort = abort_t::abort_none; + childs.push_back(entry.as_default->ctx.get()); + } + else if (entry.as_default->ctx->abort <= abort ) + { + abort = entry.as_default->ctx->abort; + } + } + } + } + + stmt->stmt =std::move(stmt_list); + + if(has_default) + { + if(default_ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(default_ctx); + + if(ctx->abort == abort_t::abort_none) + ctx->abort = abort; + } + + ctx->append(break_ctxs_); + ctx->merge(childs); + } + + break_ctxs_ = old_breaks; +} + +void compiler::process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(ctx.get()); + ctx->abort = abort_t::abort_break; + } +} + +void compiler::process_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + continue_ctxs_.push_back(ctx.get()); + ctx->abort = abort_t::abort_continue; + } +} + +void compiler::process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + ctx->abort = abort_t::abort_return; + } +} + +void compiler::register_variable(const gsc::context_ptr& ctx, const std::string& name) +{ + auto it = std::find_if(ctx->local_vars.begin(), ctx->local_vars.end(), + [&](const gsc::local_var& v) { return v.name == name; }); + + if(it == ctx->local_vars.end()) + { + auto found = false; + for(std::size_t i = 0; i < local_stack_.size(); i++) + { + if(local_stack_[i] == name) + { + ctx->local_vars.push_back({ name, static_cast(i), false }); + found = true; + break; + } + } + + if(!found) + { + ctx->local_vars.push_back({ name, stack_idx_, false }); + local_stack_.push_back(name); + stack_idx_++; + } + } +} + +void compiler::initialize_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name) +{ + for(std::uint32_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(!ctx->local_vars[i].init) + { + for(std::uint32_t j = 0; j < i; j++) + { + if(!ctx->local_vars[j].init) + { + emit_opcode(ctx, opcode::OP_CreateLocalVariable, utils::string::va("%d", ctx->local_vars[j].create)); + ctx->local_vars[j].init = true; + //ctx->local_vars_create_count++; + } + } + ctx->local_vars[i].init = true; + ctx->local_vars_create_count = i + 1; + return; + } + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +void compiler::create_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name) +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + auto& var = ctx->local_vars.at(i); + if(var.name == name->value) + { + if(!var.init) + { + emit_opcode(ctx, opcode::OP_CreateLocalVariable, utils::string::va("%d", var.create)); + var.init = true; + ctx->local_vars_create_count++; + } + return; + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_stack_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::uint8_t +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(ctx->local_vars.at(i).init) + { + return ctx->local_vars_create_count - 1 - i; + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not initialized."); + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_create_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + return utils::string::va("%d", ctx->local_vars[i].create); + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_access_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(ctx->local_vars.at(i).init) + { + return utils::string::va("%d", ctx->local_vars_create_count - 1 - i); + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not initialized."); + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_initialized(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> bool +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + return ctx->local_vars.at(i).init; + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::is_local_call(const std::string& name) -> bool +{ + for(const auto& f : local_functions_) + { + if(f == name) return true; + } + + return false; +} + +auto compiler::is_builtin_call(const std::string& name) -> bool +{ + if(is_builtin_func(name)) return true; + + if(is_builtin_method(name)) return true; + + return false; +} + +auto compiler::is_builtin_func(const std::string& name) -> bool +{ + return resolver::find_function(name); +} +auto compiler::is_builtin_method(const std::string& name) -> bool +{ + return resolver::find_method(name); +} + +auto compiler::is_constant_condition(const gsc::expr_ptr& expr) -> bool +{ + switch(expr.as_node->type) + { + case gsc::node_t::null: + case gsc::node_t::data_true: + return true; + case gsc::node_t::data_false: + throw gsc::comp_error(expr.as_node->loc, "condition can't be always false!"); + case gsc::node_t::data_integer: + { + auto num = std::stoi(expr.as_integer->value); + if(num != 0) + return true; + else + throw gsc::comp_error(expr.as_node->loc, "condition can't be always false!"); + } + default: + break; + } + + return false; +} + +auto compiler::create_label() -> std::string +{ + label_idx_++; + auto name = utils::string::va("loc_%d", label_idx_); + return name; +} + +auto compiler::insert_label() -> std::string +{ + const auto itr = function_->labels.find(index_); + + if (itr != function_->labels.end()) + { + return itr->second; + } + else + { + label_idx_++; + auto name = utils::string::va("loc_%d", label_idx_); + function_->labels.insert({index_, name}); + return name; + } +} + +void compiler::insert_label(const std::string& name) +{ + const auto itr = function_->labels.find(index_); + + if (itr != function_->labels.end()) + { + for(auto& inst : function_->instructions) + { + switch (opcode(inst->opcode)) + { + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_jump: + case opcode::OP_jumpback: + case opcode::OP_switch: + if(inst->data[0] == name) + inst->data[0] = itr->second; + break; + case opcode::OP_endswitch: + default: + break; + } + } + } + else + { + function_->labels.insert({index_, name}); + } +} + +auto compiler::map_known_includes(const std::string& include) -> bool +{ + return false; +} + +} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/compiler.hpp b/src/iw7/xsk/compiler.hpp new file mode 100644 index 00000000..3285f3e1 --- /dev/null +++ b/src/iw7/xsk/compiler.hpp @@ -0,0 +1,145 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::iw7 +{ + +enum class opcode : std::uint8_t; + +class compiler : public gsc::compiler +{ + std::string filename_; + std::vector assembly_; + gsc::function_ptr function_; + std::uint32_t index_; + std::uint32_t label_idx_; + std::uint8_t stack_idx_; + std::vector local_stack_; + std::vector local_functions_; + std::vector includes_; + std::vector animtrees_; + std::unordered_map constants_; + std::function(const std::string&)> callback_readf_; + std::vector break_ctxs_; + std::vector continue_ctxs_; + bool can_break_; + bool can_continue_; + +public: + auto output() -> std::vector; + void compile(const std::string& file, std::vector& data); + void set_readf_callback(std::function(const std::string&)> func); + +private: + auto parse_buffer(const std::string& file, std::vector& data) -> gsc::program_ptr; + auto parse_file(const std::string& file) -> gsc::program_ptr; + void compile_program(const gsc::program_ptr& program); + void emit_include(const gsc::include_ptr& include); + void emit_define(const gsc::define_ptr& define); + void emit_usingtree(const gsc::usingtree_ptr& animtree); + void emit_constant(const gsc::constant_ptr& constant); + void emit_thread(const gsc::thread_ptr& thread); + void emit_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void emit_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt, bool last); + void emit_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt, bool last); + void emit_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt); + void emit_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt); + void emit_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt); + void emit_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt); + void emit_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt); + void emit_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void emit_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt); + void emit_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt); + void emit_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt, bool last); + void emit_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt, bool last); + void emit_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void emit_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void emit_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void emit_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void emit_stmt_case(const gsc::context_ptr& ctx, const gsc::stmt_case_ptr& stmt); + void emit_stmt_default(const gsc::context_ptr& ctx, const gsc::stmt_default_ptr& stmt); + void emit_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void emit_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt); + void emit_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void emit_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr); + void emit_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr); + void emit_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr); + void emit_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr); + void emit_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr); + void emit_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr); + void emit_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_pointer_type(const gsc::context_ptr& ctx, int args, bool builtin, bool method, bool thread, bool child); + void emit_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_function_builtin(const gsc::context_ptr& ctx, const std::string& func, int args, bool method); + void emit_expr_call_function_local(const gsc::context_ptr& ctx, const std::string& func, int args, bool method, bool thread, bool child); + void emit_expr_call_function_far(const gsc::context_ptr& ctx, const std::string& file, const std::string& func, int args, bool method, bool thread, bool child); + void emit_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& arg_list); + void emit_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& node); + void emit_expr_clear_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& lvalue); + void emit_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr); + void emit_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr); + void emit_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr, bool set); + void emit_array_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr, bool set); + void emit_field_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr, bool set); + void emit_local_variable_ref(const gsc::context_ptr& ctx, const gsc::name_ptr& expr, bool set); + void emit_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr); + void emit_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr); + void emit_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void emit_clear_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void emit_create_local_vars(const gsc::context_ptr& ctx); + void emit_remove_local_vars(const gsc::context_ptr& ctx); + void emit_object(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_animtree(const gsc::context_ptr& ctx, const gsc::animtree_ptr& animtree); + void emit_animation(const gsc::context_ptr& ctx, const gsc::animation_ptr& animation); + void emit_istring(const gsc::context_ptr& ctx, const gsc::istring_ptr& str); + void emit_string(const gsc::context_ptr& ctx, const gsc::string_ptr& str); + void emit_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec); + void emit_float(const gsc::context_ptr& ctx, const gsc::float_ptr& num); + void emit_integer(const gsc::context_ptr& ctx, const gsc::integer_ptr& num); + void emit_false(const gsc::context_ptr& ctx, const gsc::false_ptr& expr); + void emit_true(const gsc::context_ptr& ctx, const gsc::true_ptr& expr); + void emit_opcode(const gsc::context_ptr& ctx, opcode op); + void emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::string& data); + void emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::vector& data); + void process_thread(const gsc::context_ptr& ctx, const gsc::thread_ptr& thread); + void process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt); + void process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt); + void process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt); + void process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void process_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt); + void process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void register_variable(const gsc::context_ptr& ctx, const std::string& name); + void initialize_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name); + void create_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name); + auto variable_stack_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::uint8_t; + auto variable_create_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string; + auto variable_access_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string; + auto variable_initialized(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> bool; + auto is_local_call(const std::string& name) -> bool; + auto is_builtin_call(const std::string& name) -> bool; + auto is_builtin_func(const std::string& name) -> bool; + auto is_builtin_method(const std::string& name) -> bool; + auto is_constant_condition(const gsc::expr_ptr& expr) -> bool; + auto create_label() -> std::string; + auto insert_label() -> std::string; + void insert_label(const std::string& label); + + auto map_known_includes(const std::string& include) -> bool; +}; + +} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/decompiler.cpp b/src/iw7/xsk/decompiler.cpp new file mode 100644 index 00000000..4ce7afd1 --- /dev/null +++ b/src/iw7/xsk/decompiler.cpp @@ -0,0 +1,3154 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw7.hpp" + +namespace xsk::gsc::iw7 +{ + +auto decompiler::output() -> std::vector +{ + std::vector output; + + auto data = std::make_unique(0x100000); + data->write_string("// IW7 PC GSC\n// Decompiled by https://github.com/xensik/gsc-tool\n"); + data->write_string(program_->print()); + + output.resize(data->pos()); + std::memcpy(output.data(), data->buffer().data(), output.size()); + + return output; +} + +void decompiler::decompile(const std::string& file, std::vector& functions) +{ + filename_ = file; + program_ = std::make_unique(); + + for (auto& func : functions) + { + auto name = std::make_unique(func->name.substr(4)); + auto params = std::make_unique(); + auto block = std::make_unique(); + func_ = std::make_unique(std::move(name),std::move(params),std::move(block)); + + labels_ = func->labels; + expr_labels_.clear(); + stack_ = std::stack(); + + this->decompile_function(func); + + this->process_stack(func_); + + program_->definitions.push_back(gsc::define_ptr(std::move(func_))); + } +} + +void decompiler::decompile_function(const gsc::function_ptr& func) +{ + this->decompile_statements(func); + + if(stack_.size() > 0) + { + throw gsc::decomp_error("stack not emty at function end"); + } + + auto& block = func_->block; + + gsc::context ctx; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.back().as_node->loc.begin.line); + + // remove last return + block->stmts.pop_back(); + + // hotfix empty else block at func end + if(block->stmts.size() > 0 && block->stmts.back().as_node->type == gsc::node_t::asm_jump) + { + if(block->stmts.back().as_jump->value == ctx.loc_end) + block->stmts.pop_back(); + } + + blocks_.push_back(ctx); + this->decompile_block(block); + blocks_.pop_back(); +} + +void decompiler::decompile_statements(const gsc::function_ptr& func) +{ + std::uint32_t last_null_loc = 0; + + for (auto& inst : func->instructions) + { + auto loc = gsc::location(&filename_, inst->index); + + const auto itr = func->labels.find(inst->index); + + if (itr != func->labels.end()) + { + for(auto& entry : expr_labels_) + { + if(entry == itr->second) + { + decompile_expr(); + } + } + } + + switch (opcode(inst->opcode)) + { + case opcode::OP_End: + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::make_unique())); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_Return: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + auto stmt = gsc::stmt_ptr(std::make_unique(expr->loc, std::move(expr))); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_GetZero: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetByte: + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetInteger: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetNegByte: + case opcode::OP_GetNegUnsignedShort: + { + auto node = std::make_unique(loc, "-" + inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetFloat: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetVector: + { + auto x = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto y = gsc::expr_ptr(std::make_unique(loc, inst->data[1])); + auto z = gsc::expr_ptr(std::make_unique(loc, inst->data[2])); + auto node = std::make_unique(loc, std::move(x), std::move(y), std::move(z)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetString: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetIString: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetUndefined: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EmptyArray: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetLevel: + case opcode::OP_GetLevelObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnim: + case opcode::OP_GetAnimObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetSelf: + case opcode::OP_GetSelfObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetGame: + case opcode::OP_GetGameRef: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnimation: + { + auto tree = utils::string::unquote(inst->data[0]); + + if(tree != "") + { + auto treename = std::make_unique(loc, inst->data[0]); + auto animtree = std::make_unique(loc, std::move(treename)); + program_->definitions.push_back(gsc::define_ptr(std::move(animtree))); + } + + auto node = std::make_unique(loc, utils::string::unquote(inst->data[1])); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnimTree: + { + auto tree = utils::string::unquote(inst->data[0]); + + if(tree != "") + { + auto treename = std::make_unique(loc, inst->data[0]); + auto animtree = std::make_unique(loc, std::move(treename)); + program_->definitions.push_back(gsc::define_ptr(std::move(animtree))); + } + + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetThisthread: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_GetBuiltinMethod: + { + auto file = std::make_unique(loc); + auto func = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_GetLocalFunction: + { + auto file = std::make_unique(loc); + auto func = std::make_unique(loc, inst->data[0].substr(4)); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_GetFarFunction: + { + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + auto func = std::make_unique(loc, inst->data[1]); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + }; + break; + case opcode::OP_CreateLocalVariable: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_RemoveLocalVariables: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_EvalLocalVariableCached0: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached1: + { + auto node = std::make_unique(loc, "1"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached2: + { + auto node = std::make_unique(loc, "2"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached3: + { + auto node = std::make_unique(loc, "3"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached4: + { + auto node = std::make_unique(loc, "4"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached5: + { + auto node = std::make_unique(loc, "5"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayCached: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalArray: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalNewLocalArrayRefCached0: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayRefCached0: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, "0")); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayRefCached: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalArrayRef: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_ClearArray: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = key.as_node->loc; + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(key))); + auto rvalue = gsc::expr_ptr(std::make_unique(loc)); + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr))); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_AddArray: + { + auto var = std::move(stack_.top()); + stack_.pop(); + auto array = std::move(stack_.top()); + stack_.pop(); + + if (array->type == gsc::node_t::data_empty_array) + { + auto args = std::make_unique(loc); + args->list.push_back(std::move(var)); + auto expr = std::make_unique(array->loc, std::move(args)); + stack_.push(std::move(expr)); + } + else if (array->type == gsc::node_t::expr_add_array) + { + (*(gsc::expr_add_array_ptr*)&array)->args->list.push_back(std::move(var)); + stack_.push(std::move(array)); + } + else + { + throw gsc::decomp_error("unknown add array type (could be an array variable name?)"); + } + } + break; + case opcode::OP_PreScriptCall: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_ScriptLocalFunctionCall2: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalFunctionCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalChildThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodThreadCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodChildThreadCall: + { + // TODO: child things... + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarFunctionCall2: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarFunctionCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarMethodCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[2]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[1])); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarMethodThreadCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[2]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[1])); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFunctionCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodCallPointer: + { + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptChildThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodChildThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto obj = gsc::expr_ptr(std::make_unique()); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, true, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethodPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, true, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin0: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin1: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 1; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin2: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 2; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin3: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 3; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin4: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 4; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin5: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 5; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod0: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod1: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 1; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod2: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 2; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod3: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 3; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod4: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 4; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod5: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 5; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_DecTop: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + loc = expr->loc; + auto stmt = std::make_unique(loc, std::move(*(gsc::expr_call_ptr*)&expr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_inc: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_dec: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_or: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_ex_or: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_and: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_equality: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_inequality: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_less: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_greater: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_less_equal: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_greater_equal: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_shift_left: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_shift_right: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_plus: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_minus: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_multiply: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_divide: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_mod: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_wait: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + loc = expr->loc; + auto stmt = std::make_unique(loc, std::move(expr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_waittillFrameEnd: + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_waittill: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = nstr.as_node->loc; + auto args = std::make_unique(loc); + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr), std::move(args)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_waittillmatch: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto expr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = expr.as_node->loc; + + gsc::expr_arguments_ptr args = std::make_unique(); + args->loc = loc; + + while(stack_.size() > 0) + { + auto node = std::move(stack_.top()); + stack_.pop(); + args->loc = node->loc; + args->list.push_back(std::move(node)); + + } + loc = args->loc; + + auto stmt = std::make_unique(loc, std::move(obj), std::move(expr), std::move(args)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_clearparams: + { + auto args = std::make_unique(loc); + auto var = std::move(stack_.top()); + stack_.pop(); + + while(var->type != gsc::node_t::stmt_waittill && var->type != gsc::node_t::stmt_waittillmatch) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + } + + if(var->type == gsc::node_t::stmt_waittill) + { + (*(gsc::stmt_waittill_ptr*)&var)->args = std::move(args); + } + + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(var))); + } + break; + case opcode::OP_checkclearparams: + { + // no needed + } + break; + case opcode::OP_notify: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_voidcodepos) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr), std::move(args)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_endon: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = nstr.as_node->loc; + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_voidCodepos: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_vector: + { + auto x = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto y = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto z = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = z.as_node->loc; + auto expr = std::make_unique(loc, std::move(x), std::move(y), std::move(z)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_size: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_EvalLevelFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalAnimFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalSelfFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalFieldVariable: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalLevelFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalAnimFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalSelfFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_ClearFieldVariable: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto expr = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto undef = gsc::expr_ptr(std::make_unique(loc)); + auto e = std::make_unique(loc, std::move(expr), std::move(undef)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::make_unique(loc, std::move(e)))); + } + break; + case opcode::OP_SafeCreateVariableFieldCached: + { + func_->params->list.push_back(std::make_unique(loc, "var_" + inst->data[0])); + } + break; + case opcode::OP_SafeSetWaittillVariableFieldCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableRefCached0: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableRefCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_SetLevelFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc,std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetVariableField: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + + if(lvalue.as_node->type == gsc::node_t::expr_increment) + { + auto stmt = std::make_unique(loc, std::move(lvalue.as_increment)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + else if(lvalue.as_node->type == gsc::node_t::expr_decrement) + { + auto stmt = std::make_unique(loc, std::move(lvalue.as_decrement)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + else + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + } + break; + case opcode::OP_SetAnimFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetSelfFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetLocalVariableFieldCached0: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, "0")); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetNewLocalVariableFieldCached0: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + + if(func_->block->stmts.size() > 0) + { + std::vector creates; + + while(func_->block->stmts.back().as_node->type == gsc::node_t::asm_create) + { + auto& entry = func_->block->stmts.back(); + if(loc.begin.line < entry.as_node->loc.begin.line) + { + creates.push_back(entry.as_asm_create->index); + func_->block->stmts.pop_back(); + continue; + } + break; + } + + std::reverse(creates.begin(), creates.end()); + lvalue.as_asm_create->vars = creates; + } + + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetLocalVariableFieldCached: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_ClearLocalVariableFieldCached: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_ClearLocalVariableFieldCached0: + { + auto stmt = std::make_unique(loc,"0"); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_EvalLocalVariableObjectCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_CastFieldObject: + case opcode::OP_CastBool: + { + //continue; + } + break; + case opcode::OP_BoolNot: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_BoolComplement: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_switch: + { + auto expr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = expr.as_node->loc; + auto sw = std::make_unique(loc, std::move(expr), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(sw))); + } + break; + case opcode::OP_endswitch: + { + auto count = inst->data[0]; + inst->data.erase(inst->data.begin()); + auto data = inst->data; + auto end = std::make_unique(loc, data, count); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(end))); + } + break; + case opcode::OP_jump: + { + auto expr = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + + } + break; + case opcode::OP_jumpback: + { + auto expr = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnTrue: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto e_not = gsc::expr_ptr(std::make_unique(loc, std::move(lvalue))); + auto expr = std::make_unique(loc, std::move(e_not), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnFalse: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnTrueExpr: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + stack_.push(std::move(expr)); + expr_labels_.push_back(inst->data[0]); + } + break; + case opcode::OP_JumpOnFalseExpr: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + stack_.push(std::move(expr)); + expr_labels_.push_back(inst->data[0]); + } + break; + default: + throw gsc::decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); + break; + } + } +} + +void decompiler::decompile_expr() +{ + auto expr = std::move(stack_.top()); + stack_.pop(); + + auto jump_expr = std::move(stack_.top()); + stack_.pop(); + auto loc = jump_expr->loc; + + if(jump_expr->type == gsc::node_t::asm_jump_true_expr) + { + auto lvalue = std::move((*(gsc::asm_jump_true_expr_ptr*)&jump_expr)->expr); + auto rvalue = gsc::expr_ptr(std::move(expr)); + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(e)); + } + else if(jump_expr->type == gsc::node_t::asm_jump_false_expr) + { + auto lvalue = std::move((*(gsc::asm_jump_false_expr_ptr*)&jump_expr)->expr); + auto rvalue = gsc::expr_ptr(std::move(expr)); + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(e)); + } + else + { + throw gsc::decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); + } +} + +void decompiler::decompile_block(const gsc::stmt_list_ptr& block) +{ + this->decompile_search_infinite(block); + this->decompile_search_loop(block); + this->decompile_search_switch(block); + this->decompile_search_ifelse(block); + this->decompile_break_continue(block); + this->decompile_nulls(block); +} + +void decompiler::decompile_nulls(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::null) + { + block->stmts.erase(block->stmts.begin() + index); + } + else index++; + } +} + +void decompiler::decompile_search_infinite(const gsc::stmt_list_ptr& block) +{ + std::int32_t index = block->stmts.size() - 1; + + while(index >= 0) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_jump_back) + { + auto break_loc = last_location_index(block, index) ? blocks_.back().loc_end : utils::string::va("loc_%X", block->stmts.at(index+1).as_node->loc.begin.line); + auto begin_loc = block->stmts.at(index).as_jump_back->value; + auto start = find_location_index(block, begin_loc); + + if(block->stmts.at(start).as_node->type != gsc::node_t::asm_jump_cond) + { + decompile_infinite(block, start, index); + index = start; + } + else if (block->stmts.at(start).as_cond->value != break_loc) + { + decompile_infinite(block, start, index); + index = start; + } + } + + index--; + } +} + +void decompiler::decompile_search_loop(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + auto& stmt = block->stmts.at(index); + + if(stmt.as_node->type == gsc::node_t::asm_jump_cond) + { + std::uint32_t end; + if(stmt.as_cond->value == blocks_.back().loc_end) + { + end = block->stmts.size() - 1; + } + else + { + end = find_location_index(block, stmt.as_cond->value) - 1; + } + + if(block->stmts.at(end).as_node->type == gsc::node_t::asm_jump_back + && utils::string::va("loc_%X", block->stmts.at(index).as_node->loc.begin.line) == block->stmts.at(end).as_jump_back->value) + { + decompile_loop(block, index, end); + index = 0; + } + } + index++; + } +} + +void decompiler::decompile_search_switch(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_switch) + { + decompile_switch(block, index); + } + + index++; + } +} + +void decompiler::decompile_search_ifelse(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + auto& stmt = block->stmts.at(index); + + if(stmt.as_node->type == gsc::node_t::asm_jump_cond) + { + std::uint32_t end; + if(stmt.as_cond->value == blocks_.back().loc_end) + { + end = block->stmts.size() - 1; + } + else + { + end = find_location_index(block, stmt.as_cond->value) - 1; + } + + auto last_loc = blocks_.back().loc_end; + + if(block->stmts.at(end).as_node->type == gsc::node_t::asm_jump) + { + // if block is a loop check break, continue + if(block->stmts.at(end).as_jump->value == blocks_.back().loc_continue) + { + // last if/else inside a loop still trigger this :( + decompile_if(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == blocks_.back().loc_break) + { + decompile_if(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == blocks_.back().loc_end) + { + decompile_ifelse(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == stmt.as_cond->value) + { + decompile_if(block, index, end); // if block, have a last empty else inside + } + else + { + decompile_ifelse(block, index, end); // TODO: if else block is empty, convert it to only if! + } + } + else if(block->stmts.at(end).as_node->type == gsc::node_t::stmt_return + && block->stmts.at(end).as_return->expr.as_node->type == gsc::node_t::null) + { + if(blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") + { + decompile_if(block, index, end); // inside a loop cant be last + } + else if(end - index == 1) + { + decompile_if(block, index, end); // only one explicit return + } + else if(block->stmts.back().as_node->type != gsc::node_t::stmt_return) + { + decompile_if(block, index, end); // block end is not a last return + } + else if(blocks_.back().is_last && block->stmts.back().as_node->type != gsc::node_t::stmt_return) + { + decompile_if(block, index, end); // inside a last block but is not and inner last + } + else if(find_location_reference(block, end, block->stmts.size(), last_loc)) + { + decompile_if(block, index, end); // reference to func end after the if + } + else if(blocks_.size() > 1 && !blocks_.back().is_last) + { + decompile_if(block, index, end); // fake last ifelse + } + else + { + decompile_last_ifelse(block, index, end); // special case + } + } + else + { + decompile_if(block, index, end); + } + } + index++; + } +} + +void decompiler::decompile_break_continue(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_jump) + { + auto loc = block->stmts.at(index).as_node->loc; + auto jump_loc = block->stmts.at(index).as_jump->value; + + if(jump_loc == blocks_.back().loc_continue) + { + block->stmts.erase(block->stmts.begin() + index); + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + block->stmts.insert(block->stmts.begin() + index, std::move(stmt)); + } + else if(jump_loc == blocks_.back().loc_break) + { + block->stmts.erase(block->stmts.begin() + index); + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + block->stmts.insert(block->stmts.begin() + index, std::move(stmt)); + } + } + + index++; + } +} + +void decompiler::decompile_if(const gsc::stmt_list_ptr& block, std::uint32_t begin, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_end = block->stmts.at(begin).as_cond->value; + ctx.loc_break = blocks_.back().loc_break; + ctx.loc_continue = blocks_.back().loc_continue; + + auto loc = block->stmts.at(begin).as_node->loc; + auto expr = std::move(block->stmts.at(begin).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + begin); // remove condition + + auto if_block = std::make_unique(loc); + + for(auto i = begin; i < end; i++) + { + if_block->stmts.push_back(std::move(block->stmts[begin])); + block->stmts.erase(block->stmts.begin() + begin); + } + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)))); + block->stmts.insert(block->stmts.begin() + begin, std::move(stmt)); +} + +void decompiler::decompile_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_break = blocks_.back().loc_break; + ctx.loc_continue = blocks_.back().loc_continue; + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto if_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) // skip the jump + { + if_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + auto end_loc = block->stmts.at(start).as_jump->value; + + block->stmts.erase(block->stmts.begin() + start); // remove jump + + std::uint32_t end_index; + + if(end_loc == blocks_.back().loc_end) + { + end_index = block->stmts.size(); + } + else + { + end_index = find_location_index(block, end_loc); + } + + gsc::context ctx2; + ctx2.loc_end = end_loc; + ctx2.loc_break = blocks_.back().loc_break; + ctx2.loc_continue = blocks_.back().loc_continue; + + auto else_block = std::make_unique(loc); + + for(auto i = start; i < end_index; i++) + { + else_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx2); + decompile_block(else_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)), gsc::stmt_ptr(std::move(else_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_last_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.is_last = true; + + auto inner_end = find_location_index(block, block->stmts.at(start).as_cond->value) - 1; + ctx.loc_end = utils::string::va("loc_%X",block->stmts.at(inner_end).as_node->loc.begin.line); + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto if_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + if_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + block->stmts.erase(block->stmts.begin() + start); // remove if block return; + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + if(start == block->stmts.size()) + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); + } + else + { + gsc::context ctx2; + ctx2.is_last = true; + + auto else_block = std::make_unique(loc); + + end = block->stmts.size(); + ctx2.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); // return is the block end + + for(auto i = start; i < end; i++) + { + else_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + else_block->stmts.pop_back(); // remove else return; + + blocks_.push_back(ctx2); + decompile_block(else_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)), gsc::stmt_ptr(std::move(else_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); + } +} + +void decompiler::decompile_infinite(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = last_location_index(block, end) ? blocks_.back().loc_end : utils::string::va("loc_%X", block->stmts.at(end+1).as_node->loc.begin.line); + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + + auto loc = block->stmts.at(start).as_node->loc; + + block->stmts.erase(block->stmts.begin() + end); // remove jump back + + auto for_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + for_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(for_block); + blocks_.pop_back(); + + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + auto expr = gsc::expr_ptr(std::make_unique()); + auto post_expr = gsc::stmt_ptr(std::make_unique()); + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(pre_expr), std::move(expr), std::move(post_expr), gsc::stmt_ptr(std::move(for_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + auto& last_stmt = block->stmts.at(end-1); + if(last_stmt.as_node->type == gsc::node_t::stmt_assign) + { + if(last_stmt.as_assign->expr->type == gsc::node_t::expr_assign_equal) + { + auto& rval = last_stmt.as_assign->expr->rvalue; + if(rval.as_node->type == gsc::node_t::expr_call) + { + if(rval.as_call->func.as_node->type == gsc::node_t::expr_call_function) + { + if(utils::string::to_lower(rval.as_call->func.as_func->name->value) == "getnextarraykey") + { + auto ref2 = utils::string::va("loc_%X", block->stmts.at(start).as_node->loc.begin.line); + if(find_location_reference(block, 0, start, ref2)) + { + // begin is at condition, not pre-expr + //decompile_while(block, start, end); + //return; + } + else + { + decompile_foreach(block, start, end); + return; + } + } + } + } + } + + if(start > 0) // while at func start + { + auto index = 1; + while(block->stmts.at(start - index).as_node->type == gsc::node_t::asm_create) + { + if(start - index > 0) + index++; + } + + if(block->stmts.at(start - index).as_node->type == gsc::node_t::stmt_assign) + { + auto ref = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + auto ref2 = utils::string::va("loc_%X", block->stmts.at(start).as_node->loc.begin.line); + + if(find_location_reference(block, start, end, ref)) + { + // continue is at jumpback, not post-expr + decompile_while(block, start, end); + return; + } + else if(find_location_reference(block, 0, start, ref2)) + { + // begin is at condition, not pre-expr + decompile_while(block, start, end); + return; + } + else + { + decompile_for(block, start, end); + return; + } + } + } + } + + decompile_while(block, start, end); +} + +void decompiler::decompile_while(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(start).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X",block->stmts.at(end).as_node->loc.begin.line); + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + end); // remove jump back + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto while_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + while_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(while_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(while_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_for(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(start).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + + // remove emit local var_creates + std::vector creates; + while(block->stmts.at(start - 1).as_node->type == gsc::node_t::asm_create) + { + creates.push_back(block->stmts.at(start - 1).as_asm_create->index); + block->stmts.erase(block->stmts.begin() + start - 1); + start--; + end--; + } + + std::reverse(creates.begin(), creates.end()); + + auto loc = block->stmts.at(start - 1).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + pre_expr.as_list->stmts.push_back(std::move(block->stmts.at(start - 1))); + pre_expr.as_list->is_expr = true; + auto post_expr = gsc::stmt_ptr(std::make_unique()); + post_expr.as_list->stmts.push_back(std::move(block->stmts.at(end - 1))); + post_expr.as_list->is_expr = true; + + start = start - 1; + end = end - 2; + for(auto i = start; i < start + 2; i++) // remove prologue (pre-expr, condition) + { + block->stmts.erase(block->stmts.begin() + start); + } + + end = end - 1; // set end in post-expr + for(auto i = end; i < end + 2; i++) // remove epilogue (post-expr, jump back) + { + block->stmts.erase(block->stmts.begin() + end); + } + + auto for_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + for_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(for_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(pre_expr), std::move(expr), std::move(post_expr), gsc::stmt_ptr(std::move(for_block)))); + stmt.as_for->vars = creates; + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_foreach(const gsc::stmt_list_ptr& block, std::uint32_t begin, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(begin).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + + // remove local var_creates + std::vector creates; + while(block->stmts.at(begin - 1).as_node->type == gsc::node_t::asm_create) + { + creates.push_back(block->stmts.at(begin - 1).as_asm_create->index); + block->stmts.erase(block->stmts.begin() + begin - 1); + begin--; + end--; + } + + std::reverse(creates.begin(), creates.end()); + + auto loc = block->stmts.at(begin - 2).as_node->loc; + + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + pre_expr.as_list->stmts.push_back(std::move(block->stmts[begin-2])); + pre_expr.as_list->stmts.push_back(std::move(block->stmts[begin-1])); + auto stmt0 = std::move(block->stmts[begin+1]); + + begin = begin - 2; + end = end - 4; + for(auto i = begin; i < begin + 4; i++) // remove prologue ( array, elem, cond, elemRef) + { + block->stmts.erase(block->stmts.begin() + begin); + } + + end = end - 1; // set end to post-expr + + for(auto i = end; i < end + 2; i++) // remove epilogue ( post-expr, jump back) + { + block->stmts.erase(block->stmts.begin() + end); + } + + if(block->stmts.size() > end && block->stmts.at(end).as_node->type == gsc::node_t::asm_clear) + { + block->stmts.erase(block->stmts.begin() + end); + } + + auto use_key = true; + + if(block->stmts.size() > end && block->stmts.at(end).as_node->type == gsc::node_t::asm_clear) + { + block->stmts.erase(block->stmts.begin() + end); + use_key = false; + } + + auto foreach_block = std::make_unique(loc); + + for(auto i = begin; i < end; i++) + { + foreach_block->stmts.push_back(std::move(block->stmts[begin])); + block->stmts.erase(block->stmts.begin() + begin); + } + + blocks_.push_back(ctx); + decompile_block(foreach_block); + blocks_.pop_back(); + + auto foreach_stmt = gsc::stmt_ptr(std::make_unique(loc, gsc::stmt_ptr(std::move(foreach_block)), use_key)); + foreach_stmt.as_foreach->vars = creates; + foreach_stmt.as_foreach->pre_expr = std::move(pre_expr); + foreach_stmt.as_foreach->stmt0 = std::move(stmt0); + + block->stmts.insert(block->stmts.begin() + begin, std::move(foreach_stmt)); +} + +void decompiler::decompile_switch(const gsc::stmt_list_ptr& block, std::uint32_t start) +{ + gsc::context ctx; + ctx.loc_continue = blocks_.back().loc_continue; + ctx.loc_end = block->stmts.at(start).as_asm_switch->value; + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_asm_switch->expr); + auto end_loc = block->stmts.at(start).as_asm_switch->value; + auto end = find_location_index(block, end_loc); + + if(end == block->stmts.size() - 1) + { + ctx.loc_break = blocks_.back().loc_end; + } + else + { + ctx.loc_break = utils::string::va("loc_%X", block->stmts.at(end + 1).as_node->loc.begin.line); + } + + // collect cases + auto casenum = std::atol(block->stmts.at(end).as_asm_endswitch->count.data()); + auto data = block->stmts.at(end).as_asm_endswitch->data; + auto idx = 0; + + for(auto i = 0; i < casenum; i++) + { + if(data.at(idx) == "case") + { + auto loc_str = data.at(idx+2); + auto loc_idx = find_location_index(block, loc_str); + auto loc_pos = gsc::location(&filename_, std::stol(loc_str.substr(4), 0, 16)); + auto value = gsc::expr_ptr(std::make_unique(loc_pos, data.at(idx+1))); + auto list = std::make_unique(loc); + list->is_case = true; + auto stmt = gsc::stmt_ptr(std::make_unique(loc_pos, std::move(value), std::move(list))); + block->stmts.insert(block->stmts.begin() + loc_idx, std::move(stmt)); + idx += 3; + } + else if(data.at(idx) == "default") + { + auto loc_str = data.at(idx+1); + auto loc_idx = find_location_index(block, loc_str); + auto loc_pos = gsc::location(&filename_, std::stol(loc_str.substr(4), 0, 16)); + auto list = std::make_unique(loc); + list->is_case = true; + auto stmt = gsc::stmt_ptr(std::make_unique(loc_pos, std::move(list))); + block->stmts.insert(block->stmts.begin() + loc_idx, std::move(stmt)); + idx += 2; + } + } + + end = find_location_index(block, end_loc) - 1; // update end; + block->stmts.erase(block->stmts.begin() + start); // remove switch + block->stmts.erase(block->stmts.begin() + end); // remove endswitch + + //decompile block + auto sw_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + sw_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(sw_block); + blocks_.pop_back(); + + auto stmt_list = std::make_unique(loc); + gsc::stmt_ptr current_case = gsc::stmt_ptr(std::make_unique()); + + auto num = sw_block->stmts.size(); + for(auto i = 0; i < num; i++) + { + auto& entry = sw_block->stmts[0]; + + if(entry.as_node->type == gsc::node_t::stmt_case || entry.as_node->type == gsc::node_t::stmt_default) + { + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + current_case = std::move(sw_block->stmts[0]); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + else + { + if(current_case.as_node->type != gsc::node_t::null) + { + if(current_case.as_node->type == gsc::node_t::stmt_case) + { + current_case.as_case->stmt->stmts.push_back(std::move(sw_block->stmts[0])); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + else + { + current_case.as_default->stmt->stmts.push_back(std::move(sw_block->stmts[0])); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + } + else + { + gsc::decomp_error("missing case before stmt inside switch!"); + } + } + } + + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), std::move(stmt_list))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +auto decompiler::find_location_reference(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end, const std::string& location) -> bool +{ + for(auto i = start; i < end; i++) + { + if(block->stmts.at(i).as_node->type == gsc::node_t::asm_jump_cond) + { + if(block->stmts.at(i).as_cond->value == location) + return true; + } + else if(block->stmts.at(i).as_node->type == gsc::node_t::asm_jump) + { + if(block->stmts.at(i).as_jump->value == location) + return true; + } + } + + return false; +} + +auto decompiler::find_location_index(const gsc::stmt_list_ptr& block, const std::string& location) -> std::uint32_t +{ + auto index = 0; + + if(location == blocks_.back().loc_end) + return block->stmts.size(); + + for(auto& stmt : block->stmts) + { + if(stmt.as_node->loc.begin.line == std::stol(location.substr(4), 0, 16)) + return index; + + index++; + } + + throw gsc::decomp_error("LOCATION NOT FOUND! (" + location + ")"); +} + +auto decompiler::last_location_index(const gsc::stmt_list_ptr& block, std::uint32_t index) -> bool +{ + if(index == block->stmts.size() - 1) + return true; + + return false; +} + +void decompiler::process_stack(const gsc::thread_ptr& thread) +{ + auto ctx = std::make_unique(); + + process_parameters(ctx, thread->params); + process_stmt_list(ctx, thread->block); + +} + +void decompiler::process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + ctx->local_vars.push_back({ param->value, static_cast(std::stoi(param->value.substr(4))), true }); + ctx->local_vars_create_count++; + } +} + +void decompiler::process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt) +{ + switch(stmt.as_node->type) + { + case gsc::node_t::stmt_list: process_stmt_list(ctx, stmt.as_list); break; + case gsc::node_t::stmt_call: process_stmt_call(ctx, stmt.as_call); break; + case gsc::node_t::stmt_assign: process_stmt_assign(ctx, stmt.as_assign); break; + case gsc::node_t::stmt_endon: process_stmt_endon(ctx, stmt.as_endon); break; + case gsc::node_t::stmt_notify: process_stmt_notify(ctx, stmt.as_notify); break; + case gsc::node_t::stmt_wait: process_stmt_wait(ctx, stmt.as_wait); break; + case gsc::node_t::stmt_waittill: process_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_waittillmatch: process_stmt_waittillmatch(ctx, stmt.as_waittillmatch); break; + case gsc::node_t::stmt_if: process_stmt_if(ctx, stmt.as_if); break; + case gsc::node_t::stmt_ifelse: process_stmt_ifelse(ctx, stmt.as_ifelse); break; + case gsc::node_t::stmt_while: process_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: process_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: process_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: process_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_break: process_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_return: process_stmt_return(ctx, stmt.as_return); break; + case gsc::node_t::asm_remove: process_var_remove(ctx, stmt.as_asm_remove); break; + case gsc::node_t::asm_create: + { + auto expr = gsc::expr_ptr(std::make_unique(stmt.as_asm_create->index)); + process_var_create(ctx, expr, true); + } + break; + default: break; + } +} + +void decompiler::process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + for (const auto& entry : stmt->stmts) + { + process_stmt(ctx, entry); + } + + for(auto i = 0; i < stmt->stmts.size(); i++) + { + auto type = stmt->stmts.at(i).as_node->type; + + if(type == gsc::node_t::asm_create || type == gsc::node_t::asm_remove) + { + stmt->stmts.erase(stmt->stmts.begin() + i); + i--; + } + } +} + +void decompiler::process_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt) +{ + process_expr_call(ctx, stmt->expr); +} + +void decompiler::process_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt) +{ + process_expr_assign(ctx, stmt->expr); +} + +void decompiler::process_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt) +{ + process_expr_arguments(ctx, stmt->args); + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt) +{ + process_expr(ctx, stmt->expr); +} + +void decompiler::process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); + process_expr_arguments(ctx, stmt->args); +} + +void decompiler::process_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt) +{ + process_expr_arguments(ctx, stmt->args); + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx_if = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx_if); + + process_stmt(stmt->ctx_if, stmt->stmt_if); + + stmt->ctx_else = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx_else); + + process_stmt(stmt->ctx_else, stmt->stmt_else); + + std::vector childs({stmt->ctx_if.get(), stmt->ctx_else.get()}); + ctx->append(childs); + + if(stmt->stmt_if.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt_if.as_list->stmts.at(0))) + { + stmt->stmt_if = std::move(stmt->stmt_if.as_list->stmts.back()); + } + + if(stmt->stmt_else.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt_noif(stmt->stmt_else.as_list->stmts.at(0))) + { + stmt->stmt_else = std::move(stmt->stmt_else.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt); + + std::vector childs({ stmt->ctx.get() }); + + if(stmt->expr.as_node->type == gsc::node_t::null) + ctx->append_decompiler(stmt->ctx); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + process_stmt(ctx, stmt->pre_expr); + + for(auto& index : stmt->vars) + { + auto var = utils::string::va("var_%d", std::stoi(index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(index)), true }); + ctx->local_vars_create_count++; + } + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_expr(ctx, stmt->expr); + + process_stmt(stmt->ctx, stmt->stmt); + + process_stmt(ctx, stmt->post_expr); + + if(stmt->expr.as_node->type == gsc::node_t::null) + ctx->append_decompiler(stmt->ctx); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + process_stmt(ctx, stmt->pre_expr); + + for(auto& index : stmt->vars) + { + auto var1 = utils::string::va("var_%d", std::stoi(index)); + ctx->local_vars.push_back({ var1, static_cast(std::stoi(index)), true }); + ctx->local_vars_create_count++; + } + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt0); + process_stmt(stmt->ctx, stmt->stmt); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } + + stmt->array_expr = std::move(stmt->pre_expr.as_list->stmts[0].as_assign->expr->rvalue); + stmt->value_expr = std::move(stmt->stmt0.as_assign->expr->lvalue); + stmt->key_expr = std::move(stmt->pre_expr.as_list->stmts[1].as_assign->expr->lvalue); +} + +void decompiler::process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt_cases(stmt->ctx, stmt->stmt); + + ctx->append_decompiler(stmt->ctx, true); +} + +void decompiler::process_stmt_cases(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + std::vector childs; + + for(auto& entry : stmt->stmts) + { + if(entry.as_node->type == gsc::node_t::stmt_case) + { + entry.as_case->ctx = std::make_unique(); + ctx->transfer_decompiler(entry.as_case->ctx); + + process_stmt_list(entry.as_case->ctx, entry.as_case->stmt); + + if(entry.as_case->ctx->abort == gsc::abort_t::abort_break) + { + childs.push_back(entry.as_case->ctx.get()); + } + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + entry.as_default->ctx = std::make_unique(); + ctx->transfer_decompiler(entry.as_default->ctx); + + process_stmt_list(entry.as_default->ctx, entry.as_default->stmt); + + if(entry.as_default->ctx->abort == gsc::abort_t::abort_break) + { + childs.push_back(entry.as_default->ctx.get()); + } + } + } + + ctx->append(childs); +} + +void decompiler::process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + ctx->abort = gsc::abort_t::abort_break; +} + +void decompiler::process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(stmt->expr.as_node->type == gsc::node_t::null) + { + return; + } + + process_expr(ctx, stmt->expr); +} + +void decompiler::process_expr(const gsc::context_ptr& ctx, gsc::expr_ptr& expr) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_increment: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_decrement: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_equal: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_add: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_sub: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_mult: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_div: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_mod: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_shift_left: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_shift_right: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_or: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_and: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_exor: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_and: process_expr_and(ctx, expr.as_and); break; + case gsc::node_t::expr_or: process_expr_or(ctx, expr.as_or); break; + case gsc::node_t::expr_equality: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_inequality: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less_equal: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater_equal: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_or: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_and: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_exor: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_left: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_right: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_add: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_sub: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mult: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_div: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mod: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_complement: process_expr_complement(ctx, expr.as_complement); break; + case gsc::node_t::expr_not: process_expr_not(ctx, expr.as_not); break; + case gsc::node_t::expr_call: process_expr_call(ctx, expr.as_call); break; + case gsc::node_t::expr_function: process_expr_function(ctx, expr.as_function); break; + case gsc::node_t::expr_add_array: process_expr_add_array(ctx, expr.as_add_array); break; + case gsc::node_t::expr_array: process_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: process_field_variable(ctx, expr.as_field); break; + case gsc::node_t::expr_size: process_expr_size(ctx, expr.as_size); break; + case gsc::node_t::data_name: process_local_variable(ctx, expr.as_name); break; + case gsc::node_t::data_vector: process_vector(ctx, expr.as_vector); break; + case gsc::node_t::asm_create: process_var_create(ctx, expr); break; + case gsc::node_t::asm_access: process_var_access(ctx, expr); break; + default: break; + } +} + +void decompiler::process_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr) +{ + if(expr->type == gsc::node_t::expr_increment) + { + process_expr(ctx, expr->lvalue); + } + else if(expr->type == gsc::node_t::expr_decrement) + { + process_expr(ctx, expr->lvalue); + } + else + { + process_expr(ctx, expr->rvalue); + process_expr(ctx, expr->lvalue); + } +} + +void decompiler::process_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr) +{ + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr) +{ + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + if(expr->func.as_node->type == gsc::node_t::expr_call_pointer) + { + process_expr_call_pointer(ctx, expr); + } + else + { + process_expr_call_function(ctx, expr); + } +} + +void decompiler::process_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + process_expr_arguments(ctx, expr->func.as_pointer->args); + + if(expr->obj.as_node->type != gsc::node_t::null) + process_expr(ctx, expr->obj); + + process_expr(ctx, expr->func.as_pointer->expr); +} + +void decompiler::process_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + process_expr_arguments(ctx, expr->func.as_func->args); + + if(expr->obj.as_node->type != gsc::node_t::null) + process_expr(ctx, expr->obj); +} + +void decompiler::process_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& args) +{ + for(auto i = args->list.size(); i > 0; i--) + { + process_expr(ctx, args->list.at(i - 1)); + } +} + +void decompiler::process_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& expr) +{ + return; +} + +void decompiler::process_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr) +{ + for(auto& arg : expr->args->list) + { + process_expr(ctx, arg); + } +} + +void decompiler::process_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr) +{ + process_expr(ctx, expr->obj); +} + +void decompiler::process_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr) +{ + process_expr(ctx, expr->key); + process_expr(ctx, expr->obj); +} + +void decompiler::process_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr) +{ + process_expr(ctx, expr->obj); +} + +void decompiler::process_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + return; +} + +void decompiler::process_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec) +{ + process_expr(ctx, vec->z); + process_expr(ctx, vec->y); + process_expr(ctx, vec->x); +} + +void decompiler::process_var_create(const gsc::context_ptr& ctx, gsc::expr_ptr& expr, bool fromstmt) +{ + if(fromstmt) + { + auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); + ctx->local_vars_create_count++; + } + else + { + for(auto& entry : expr.as_asm_create->vars) + { + ctx->local_vars.push_back({ utils::string::va("var_%d", std::stoi(entry)), static_cast(std::stoi(entry)), true }); + ctx->local_vars_create_count++; + } + + auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); + ctx->local_vars_create_count++; + + expr = gsc::expr_ptr(std::make_unique(var)); + } +} + +void decompiler::process_var_access(const gsc::context_ptr& ctx, gsc::expr_ptr& expr) +{ + if(ctx->local_vars.size() <= std::stoi(expr.as_asm_access->index)) + { + printf("WARNING: bad local var access\n"); + } + else + { + auto var = ctx->local_vars.at(ctx->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; + expr = gsc::expr_ptr(std::make_unique(var)); + } +} + +void decompiler::process_var_remove(const gsc::context_ptr& ctx, const gsc::asm_remove_ptr& expr) +{ + ctx->local_vars_public_count = ctx->local_vars.size() - std::stoi(expr->index); +} + +} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/decompiler.hpp b/src/iw7/xsk/decompiler.hpp new file mode 100644 index 00000000..96f56888 --- /dev/null +++ b/src/iw7/xsk/decompiler.hpp @@ -0,0 +1,93 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::iw7 +{ + +class decompiler : public gsc::decompiler +{ + std::string filename_; + std::unique_ptr output_; + gsc::program_ptr program_; + gsc::thread_ptr func_; + std::unordered_map labels_; + std::vector expr_labels_; + std::stack stack_; + std::vector blocks_; + +public: + auto output() -> std::vector; + void decompile(const std::string& file, std::vector& functions); + +private: + void decompile_function(const gsc::function_ptr& func); + void decompile_statements(const gsc::function_ptr& func); + void decompile_expr(); + void decompile_block(const gsc::stmt_list_ptr& block); + void decompile_nulls(const gsc::stmt_list_ptr& block); + void decompile_search_infinite(const gsc::stmt_list_ptr& block); + void decompile_search_loop(const gsc::stmt_list_ptr& block); + void decompile_search_switch(const gsc::stmt_list_ptr& block); + void decompile_search_ifelse(const gsc::stmt_list_ptr& block); + void decompile_break_continue(const gsc::stmt_list_ptr& block); + void decompile_if(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_last_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_infinite(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_while(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_for(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_foreach(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_switch(const gsc::stmt_list_ptr& block, std::uint32_t start); + auto find_location_reference(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end, const std::string& location) -> bool; + auto find_location_index(const gsc::stmt_list_ptr& block, const std::string& location) -> std::uint32_t; + auto last_location_index(const gsc::stmt_list_ptr& block, std::uint32_t index) -> bool; + void process_stack(const gsc::thread_ptr& thread); + void process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt); + void process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt); + void process_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt); + void process_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt); + void process_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt); + void process_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt); + void process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void process_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt); + void process_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt); + void process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt); + void process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt); + void process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void process_stmt_cases(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void process_expr(const gsc::context_ptr& ctx, gsc::expr_ptr& expr); + void process_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr); + void process_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr); + void process_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr); + void process_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr); + void process_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr); + void process_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr); + void process_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& arg_list); + void process_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& node); + void process_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr); + void process_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr); + void process_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr); + void process_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr); + void process_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void process_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec); + void process_var_create(const gsc::context_ptr& ctx, gsc::expr_ptr& expr, bool fromstmt = false); + void process_var_access(const gsc::context_ptr& ctx, gsc::expr_ptr& expr); + void process_var_remove(const gsc::context_ptr& ctx, const gsc::asm_remove_ptr& expr); +}; + +} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/disassembler.cpp b/src/iw7/xsk/disassembler.cpp new file mode 100644 index 00000000..d160b3be --- /dev/null +++ b/src/iw7/xsk/disassembler.cpp @@ -0,0 +1,571 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw7.hpp" + +namespace xsk::gsc::iw7 +{ + +auto disassembler::output() -> std::vector +{ + return std::move(functions_); +} + +auto disassembler::output_data() -> std::vector +{ + output_ = std::make_unique(0x100000); + + output_->write_string("// IW7 PC GSCASM\n"); + output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); + + for (auto& func : functions_) + { + this->print_function(func); + } + + std::vector output; + + output.resize(output_->pos()); + memcpy(output.data(), output_->buffer().data(), output.size()); + + return output; +} + +void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) +{ + filename_ = file; + script_ = std::make_unique(script); + stack_ = std::make_unique(stack); + functions_.clear(); + + script_->seek(1); + + while (stack_->is_avail() && script_->is_avail()) + { + functions_.push_back(std::make_unique()); + auto& func = functions_.back(); + + func->index = static_cast(script_->pos()); + func->size = stack_->read(); + func->id = stack_->read(); + func->name = "sub_"s + (func->id == 0 ? stack_->read_c_string() : resolver::token_name(func->id)); + + this->dissasemble_function(func); + + func->labels = labels_; + labels_.clear(); + } + + this->resolve_local_functions(); +} + +void disassembler::dissasemble_function(const gsc::function_ptr& func) +{ + auto size = func->size; + + while (size > 0) + { + func->instructions.push_back(std::make_unique()); + + auto& inst = func->instructions.back(); + inst->index = static_cast(script_->pos()); + inst->opcode = script_->read(); + inst->size = opcode_size(inst->opcode); + + this->dissasemble_instruction(inst); + + size -= inst->size; + } +} + +void disassembler::dissasemble_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_Return: + case opcode::OP_BoolNot: + case opcode::OP_CastBool: + case opcode::OP_inequality: + case opcode::OP_GetThisthread: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_checkclearparams: + case opcode::OP_CastFieldObject: + case opcode::OP_End: + case opcode::OP_size: + case opcode::OP_EmptyArray: + case opcode::OP_bit_and: + case opcode::OP_less_equal: + case opcode::OP_voidCodepos: + case opcode::OP_ClearVariableField: + case opcode::OP_divide: + case opcode::OP_GetSelf: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_plus: + case opcode::OP_BoolComplement: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_inc: + case opcode::OP_clearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_endon: + case opcode::OP_greater_equal: + case opcode::OP_GetSelfObject: + case opcode::OP_SetVariableField: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_less: + case opcode::OP_GetGameRef: + case opcode::OP_waittillFrameEnd: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_notify: + case opcode::OP_DecTop: + case opcode::OP_shift_left: + case opcode::OP_greater: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_minus: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_multiply: + case opcode::OP_mod: + case opcode::OP_GetGame: + case opcode::OP_waittill: + case opcode::OP_dec: + case opcode::OP_PreScriptCall: + case opcode::OP_GetAnim: + case opcode::OP_GetUndefined: + case opcode::OP_GetAnimObject: + case opcode::OP_GetLevelObject: + case opcode::OP_bit_ex_or: + case opcode::OP_equality: + case opcode::OP_ClearArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalArray: + case opcode::OP_vector: + case opcode::OP_bit_or: + case opcode::OP_AddArray: + case opcode::OP_waittillmatch2: + case opcode::OP_shift_right: + break; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetInteger: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetFloat: + inst->data.push_back(utils::string::va("%g", script_->read())); + break; + case opcode::OP_GetVector: + inst->data.push_back(utils::string::va("%g", script_->read())); + inst->data.push_back(utils::string::va("%g", script_->read())); + inst->data.push_back(utils::string::va("%g", script_->read())); + break; + case opcode::OP_GetString: + case opcode::OP_GetIString: + script_->seek(4); + inst->data.push_back(utils::string::to_literal(stack_->read_c_string())); + break; + case opcode::OP_GetAnimation: + script_->seek(8); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + break; + case opcode::OP_GetAnimTree: + script_->seek(1); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + break; + case opcode::OP_waittillmatch: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_EvalLocalArrayCached: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + this->disassemble_field_variable(inst); + break; + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + this->disassemble_local_call(inst, false); + break; + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + this->disassemble_local_call(inst, true); + break; + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + this->disassemble_far_call(inst, false); + break; + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + this->disassemble_far_call(inst, true); + break; + case opcode::OP_CallBuiltin: + this->disassemble_builtin_call(inst, false, true); + break; + case opcode::OP_CallBuiltinMethod: + this->disassemble_builtin_call(inst, true, true); + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + this->disassemble_builtin_call(inst, false, false); + break; + case opcode::OP_GetBuiltinMethod: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + this->disassemble_builtin_call(inst, true, false); + break; + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + this->disassemble_jump(inst, true, false); + break; + case opcode::OP_jumpback: + this->disassemble_jump(inst, false, true); + break; + case opcode::OP_jump: + this->disassemble_jump(inst, false, false); + break; + case opcode::OP_switch: + this->disassemble_switch(inst); + break; + case opcode::OP_endswitch: + this->disassemble_end_switch(inst); + break; + default: + throw gsc::disasm_error(utils::string::va("Unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); + } +} + +void disassembler::disassemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num) +{ + if (arg_num) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } + + if (method) + { + inst->data.push_back(resolver::method_name(script_->read())); + } + else + { + inst->data.push_back(resolver::function_name(script_->read())); + } +} + +void disassembler::disassemble_local_call(const gsc::instruction_ptr& inst, bool thread) +{ + std::int32_t offset = this->disassemble_offset(); + + inst->data.push_back(utils::string::va("%X", offset + inst->index + 1)); + + if (thread) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } +} + +void disassembler::disassemble_far_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->seek(3); + + if (thread) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } + + auto file_id = stack_->read(); + auto file_name = file_id == 0 ? stack_->read_c_string() : resolver::file_name(file_id); + auto func_id = stack_->read(); + auto func_name = func_id == 0 ? stack_->read_c_string() : resolver::token_name(func_id); + + inst->data.push_back(file_name != "" ? file_name : utils::string::va("_ID%i", file_id)); + inst->data.push_back(func_name != "" ? func_name : utils::string::va("_ID%i", func_id)); +} + +void disassembler::disassemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back) +{ + std::int32_t addr; + std::string label; + + if (expr) + { + addr = inst->index + 3 + script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + else if (back) + { + addr = inst->index + 3 - script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + else + { + addr = inst->index + 5 + script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + + labels_.insert({addr, label}); +} + +void disassembler::disassemble_field_variable(const gsc::instruction_ptr& inst) +{ + std::uint32_t field_id = script_->read(); + std::string field_name; + + if(field_id > 0x13FCC) + { + auto temp = stack_->read(); + field_name = temp == 0 ? stack_->read_c_string() : std::to_string(temp); + } + else + { + field_name = resolver::token_name(field_id); + } + + inst->data.push_back(field_name != "" ? field_name : utils::string::va("_ID%i", field_id)); +} + +void disassembler::disassemble_switch(const gsc::instruction_ptr& inst) +{ + std::int32_t addr = inst->index + 4 + script_->read(); + std::string label = utils::string::va("loc_%X", addr); + + inst->data.push_back(label); + labels_.insert({addr, label}); +} + +void disassembler::disassemble_end_switch(const gsc::instruction_ptr& inst) +{ + std::uint16_t case_num = script_->read(); + inst->data.push_back(utils::string::va("%i", case_num)); + + std::uint32_t internal_index = inst->index + 3; + + if (case_num) + { + for (auto i = case_num; i > 0; i--) + { + std::uint32_t case_label = script_->read(); + + if (case_label < 0x40000 && case_label > 0) + { + inst->data.push_back("case"); + inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); + } + else if (case_label == 0) + { + inst->data.push_back("default"); + stack_->read(); + } + else + { + inst->data.push_back("case"); + inst->data.push_back(utils::string::va("%i", (case_label - 0x800000) & 0xFFFFFF)); + } + + inst->size += 4; + internal_index += 4; + + auto addr = this->disassemble_offset() + internal_index; + std::string label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + + labels_.insert({addr, label}); + + inst->size += 3; + internal_index += 3; + } + } +} + +auto disassembler::disassemble_offset() -> std::int32_t +{ + std::array bytes = {}; + + for (auto i = 0; i < 3; i++) + { + bytes[i] = script_->read(); + } + + std::int32_t offset = *reinterpret_cast(bytes.data()); + + offset = (offset << 8) >> 9; + + return offset; +} + +void disassembler::resolve_local_functions() +{ + for (auto& func : functions_) + { + for (auto& inst : func->instructions) + { + switch (opcode(inst->opcode)) + { + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + inst->data.at(0) = this->resolve_function(inst->data[0]); + break; + default: + break; + } + } + } +} + +auto disassembler::resolve_function(const std::string& index) -> std::string +{ + if (utils::string::is_hex_number(index)) + { + std::uint32_t idx = std::stoul(index, nullptr, 16); + + for (auto& func : functions_) + { + if (func->index == idx) + { + return func->name; + } + } + + throw gsc::disasm_error(utils::string::va("Couldn't resolve function name at index '0x%04X'!", idx)); + } + + throw gsc::disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); +} + +void disassembler::print_function(const gsc::function_ptr& func) +{ + output_->write_string("\n"); + output_->write_string(utils::string::va("%s %X\n", func->name.data(), func->index)); + + for (auto& inst : func->instructions) + { + const auto itr = func->labels.find(inst->index); + + if (itr != func->labels.end()) + { + output_->write_string(utils::string::va("\t%s\n", itr->second.data())); + } + + this->print_instruction(inst); + } + + output_->write_string("\n"); + output_->write_string(utils::string::va("end_%s\n", func->name.substr(4).data())); +} + +void disassembler::print_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_endswitch: + output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); + output_->write_string(utils::string::va(" %s\n", inst->data[0].data())); + { + std::uint32_t totalcase = std::stoul(inst->data[0]); + auto index = 0; + for (auto casenum = 0u; casenum < totalcase; casenum++) + { + if (inst->data[1 + index] == "case") + { + output_->write_string(utils::string::va("\t\t\t%s %s %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data(), inst->data[1 + index + 2].data())); + index += 3; + } + else if (inst->data[1 + index] == "default") + { + output_->write_string(utils::string::va("\t\t\t%s %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data())); + index += 2; + } + if (casenum != totalcase - 1) + { + output_->write_string("\n"); + } + } + } + break; + default: + output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); + for (auto& d : inst->data) + { + output_->write_string(utils::string::va(" %s", d.data())); + } + break; + } + + output_->write_string("\n"); +} + +} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/disassembler.hpp b/src/iw7/xsk/disassembler.hpp new file mode 100644 index 00000000..79f60975 --- /dev/null +++ b/src/iw7/xsk/disassembler.hpp @@ -0,0 +1,42 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::iw7 +{ + +class disassembler : public gsc::disassembler +{ + std::string filename_; + utils::byte_buffer_ptr script_; + utils::byte_buffer_ptr stack_; + utils::byte_buffer_ptr output_; + std::vector functions_; + std::unordered_map labels_; + +public: + auto output() -> std::vector; + auto output_data() -> std::vector; + void disassemble(const std::string& file, std::vector& script, std::vector& stack); + +private: + void dissasemble_function(const gsc::function_ptr& func); + void dissasemble_instruction(const gsc::instruction_ptr& inst); + void disassemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num); + void disassemble_local_call(const gsc::instruction_ptr& inst, bool thread); + void disassemble_far_call(const gsc::instruction_ptr& inst, bool thread); + void disassemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back); + void disassemble_field_variable(const gsc::instruction_ptr& inst); + void disassemble_switch(const gsc::instruction_ptr& inst); + void disassemble_end_switch(const gsc::instruction_ptr& inst); + auto disassemble_offset() -> std::int32_t; + void resolve_local_functions(); + auto resolve_function(const std::string& index) -> std::string; + void print_function(const gsc::function_ptr& func); + void print_instruction(const gsc::instruction_ptr& inst); +}; + +} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/iw7.cpp b/src/iw7/xsk/iw7.cpp new file mode 100644 index 00000000..ae5f4a77 --- /dev/null +++ b/src/iw7/xsk/iw7.cpp @@ -0,0 +1,181 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw7.hpp" + +namespace xsk::gsc::iw7 +{ + +auto opcode_size(std::uint8_t id) -> std::uint32_t +{ + switch (opcode(id)) + { + case opcode::OP_Return: + case opcode::OP_BoolNot: + case opcode::OP_CastBool: + case opcode::OP_inequality: + case opcode::OP_GetThisthread: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_checkclearparams: + case opcode::OP_CastFieldObject: + case opcode::OP_End: + case opcode::OP_size: + case opcode::OP_EmptyArray: + case opcode::OP_bit_and: + case opcode::OP_less_equal: + case opcode::OP_voidCodepos: + case opcode::OP_ClearVariableField: + case opcode::OP_divide: + case opcode::OP_GetSelf: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_plus: + case opcode::OP_BoolComplement: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_inc: + case opcode::OP_clearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_endon: + case opcode::OP_greater_equal: + case opcode::OP_GetSelfObject: + case opcode::OP_SetVariableField: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_less: + case opcode::OP_GetGameRef: + case opcode::OP_waittillFrameEnd: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_notify: + case opcode::OP_DecTop: + case opcode::OP_shift_left: + case opcode::OP_greater: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_minus: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_multiply: + case opcode::OP_mod: + case opcode::OP_GetGame: + case opcode::OP_waittill: + case opcode::OP_dec: + case opcode::OP_PreScriptCall: + case opcode::OP_GetAnim: + case opcode::OP_GetUndefined: + case opcode::OP_GetAnimObject: + case opcode::OP_GetLevelObject: + case opcode::OP_bit_ex_or: + case opcode::OP_equality: + case opcode::OP_ClearArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalArray: + case opcode::OP_vector: + case opcode::OP_bit_or: + case opcode::OP_AddArray: + case opcode::OP_waittillmatch2: + case opcode::OP_shift_right: + return 1; + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_CallBuiltinPointer: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_ScriptMethodChildThreadCallPointer: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_GetNegByte: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_EvalLocalArrayCached: + case opcode::OP_GetByte: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_GetAnimTree: + return 2; + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_GetUnsignedShort: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_GetBuiltinFunction: + case opcode::OP_jumpback: + case opcode::OP_GetBuiltinMethod: + case opcode::OP_waittillmatch: + case opcode::OP_GetNegUnsignedShort: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + case opcode::OP_JumpOnFalse: + case opcode::OP_endswitch: + return 3; + case opcode::OP_CallBuiltin: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_GetLocalFunction: + case opcode::OP_CallBuiltinMethod: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarMethodCall: + return 4; + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_GetFloat: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_switch: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + case opcode::OP_jump: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_GetInteger: + case opcode::OP_GetString: + case opcode::OP_GetIString: + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + return 5; + case opcode::OP_GetAnimation: + return 9; + case opcode::OP_GetVector: + return 13; + default: + throw std::runtime_error("Couldn't resolve instruction size for " + std::to_string(id)); + } +} + +} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/iw7.hpp b/src/iw7/xsk/iw7.hpp new file mode 100644 index 00000000..8003830d --- /dev/null +++ b/src/iw7/xsk/iw7.hpp @@ -0,0 +1,179 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "utils/xsk/utils.hpp" + +#include "assembler.hpp" +#include "disassembler.hpp" +#include "compiler.hpp" +#include "decompiler.hpp" +#include "resolver.hpp" + +namespace xsk::gsc::iw7 +{ + +enum class opcode : std::uint8_t +{ + OP_SetNewLocalVariableFieldCached0 = 0x17, + OP_EvalSelfFieldVariable = 0x18, + OP_Return = 0x19, + OP_CallBuiltin0 = 0x1A, + OP_CallBuiltin1 = 0x1B, + OP_CallBuiltin2 = 0x1C, + OP_CallBuiltin3 = 0x1D, + OP_CallBuiltin4 = 0x1E, + OP_CallBuiltin5 = 0x1F, + OP_CallBuiltin = 0x20, + OP_BoolNot = 0x21, + OP_ScriptFarMethodThreadCall = 0x22, + OP_JumpOnTrueExpr = 0x23, + OP_SetLevelFieldVariableField = 0x24, + OP_CastBool = 0x25, + OP_EvalNewLocalArrayRefCached0 = 0x26, + OP_CallBuiltinPointer = 0x27, + OP_inequality = 0x28, + OP_GetThisthread = 0x29, + OP_ClearFieldVariable = 0x2A, + OP_GetFloat = 0x2B, + OP_SafeCreateVariableFieldCached = 0x2C, + OP_ScriptFarFunctionCall2 = 0x2D, + OP_ScriptFarFunctionCall = 0x2E, + OP_ScriptFarChildThreadCall = 0x2F, + OP_ClearLocalVariableFieldCached0 = 0x30, + OP_ClearLocalVariableFieldCached = 0x31, + OP_checkclearparams = 0x32, + OP_CastFieldObject = 0x33, + OP_End = 0x34, + OP_size = 0x35, + OP_EmptyArray = 0x36, + OP_bit_and = 0x37, + OP_less_equal = 0x38, + OP_voidCodepos = 0x39, + OP_ScriptMethodThreadCallPointer = 0x3A, + OP_endswitch = 0x3B, + OP_ClearVariableField = 0x3C, + OP_divide = 0x3D, + OP_ScriptFarMethodChildThreadCall = 0x3E, + OP_GetUnsignedShort = 0x3F, + OP_JumpOnTrue = 0x40, + OP_GetSelf = 0x41, + OP_ScriptFarThreadCall = 0x42, + OP_ScriptLocalThreadCall = 0x43, + OP_SetLocalVariableFieldCached0 = 0x44, + OP_SetLocalVariableFieldCached = 0x45, + OP_plus = 0x46, + OP_BoolComplement = 0x47, + OP_ScriptMethodCallPointer = 0x48, + OP_inc = 0x49, + OP_RemoveLocalVariables = 0x4A, + OP_JumpOnFalseExpr = 0x4B, + OP_switch = 0x4C, + OP_clearparams = 0x4D, + OP_EvalLocalVariableRefCached0 = 0x4E, + OP_EvalLocalVariableRefCached = 0x4F, + OP_ScriptLocalMethodCall = 0x50, + OP_EvalFieldVariable = 0x51, + OP_EvalFieldVariableRef = 0x52, + OP_GetString = 0x53, + OP_ScriptFunctionCallPointer = 0x54, + OP_EvalLevelFieldVariable = 0x55, + OP_GetVector = 0x56, + OP_endon = 0x57, + OP_greater_equal = 0x58, + OP_GetSelfObject = 0x59, + OP_SetAnimFieldVariableField = 0x5A, + OP_SetVariableField = 0x5B, + OP_ScriptLocalFunctionCall2 = 0x5C, + OP_ScriptLocalFunctionCall = 0x5D, + OP_EvalLocalArrayRefCached0 = 0x5E, + OP_EvalLocalArrayRefCached = 0x5F, + OP_GetFarFunction = 0x60, + OP_less = 0x61, + OP_GetGameRef = 0x62, + OP_waittillFrameEnd = 0x63, + OP_SafeSetVariableFieldCached0 = 0x64, + OP_SafeSetVariableFieldCached = 0x65, + OP_ScriptMethodChildThreadCallPointer = 0x66, + OP_GetLevel = 0x67, + OP_notify = 0x68, + OP_DecTop = 0x69, + OP_shift_left = 0x6A, + OP_ScriptLocalMethodThreadCall = 0x6B, + OP_ScriptLocalMethodChildThreadCall = 0x6C, + OP_greater = 0x6D, + OP_EvalLocalVariableCached0 = 0x6E, + OP_EvalLocalVariableCached1 = 0x6F, + OP_EvalLocalVariableCached2 = 0x70, + OP_EvalLocalVariableCached3 = 0x71, + OP_EvalLocalVariableCached4 = 0x72, + OP_EvalLocalVariableCached5 = 0x73, + OP_EvalLocalVariableCached = 0x74, + OP_SafeSetWaittillVariableFieldCached = 0x75, + OP_jump = 0x76, + OP_ScriptThreadCallPointer = 0x77, + OP_GetZero = 0x78, + OP_wait = 0x79, + OP_minus = 0x7A, + OP_SetSelfFieldVariableField = 0x7B, + OP_EvalNewLocalVariableRefCached0 = 0x7C, + OP_multiply = 0x7D, + OP_CreateLocalVariable = 0x7E, + OP_ScriptLocalChildThreadCall = 0x7F, + OP_GetInteger = 0x80, + OP_mod = 0x81, + OP_EvalAnimFieldVariableRef = 0x82, + OP_GetBuiltinFunction = 0x83, + OP_GetGame = 0x84, + OP_waittill = 0x85, + OP_dec = 0x86, + OP_EvalLocalVariableObjectCached = 0x87, + OP_PreScriptCall = 0x88, + OP_GetAnim = 0x89, + OP_GetUndefined = 0x8A, + OP_EvalLevelFieldVariableRef = 0x8B, + OP_GetAnimObject = 0x8C, + OP_GetLevelObject = 0x8D, + OP_bit_ex_or = 0x8E, + OP_equality = 0x8F, + OP_ClearArray = 0x90, + OP_jumpback = 0x91, + OP_GetAnimation = 0x92, + OP_EvalAnimFieldVariable = 0x93, + OP_GetAnimTree = 0x94, + OP_GetIString = 0x95, + OP_EvalArrayRef = 0x96, + OP_EvalSelfFieldVariableRef = 0x97, + OP_GetNegByte = 0x98, + OP_GetBuiltinMethod = 0x99, + OP_CallBuiltinMethodPointer = 0x9A, + OP_EvalArray = 0x9B, + OP_vector = 0x9C, + OP_ScriptFarMethodCall = 0x9D, + OP_EvalLocalArrayCached = 0x9E, + OP_GetByte = 0x9F, + OP_ScriptChildThreadCallPointer = 0xA0, + OP_bit_or = 0xA1, + OP_AddArray = 0xA2, + OP_waittillmatch2 = 0xA3, + OP_waittillmatch = 0xA4, + OP_GetLocalFunction = 0xA5, + OP_GetNegUnsignedShort = 0xA6, + OP_shift_right = 0xA7, + OP_CallBuiltinMethod0 = 0xA8, + OP_CallBuiltinMethod1 = 0xA9, + OP_CallBuiltinMethod2 = 0xAA, + OP_CallBuiltinMethod3 = 0xAB, + OP_CallBuiltinMethod4 = 0xAC, + OP_CallBuiltinMethod5 = 0xAD, + OP_CallBuiltinMethod = 0xAE, + OP_JumpOnFalse = 0xAF, + OP_Count = 0xB0, +}; + +auto opcode_size(std::uint8_t op) -> std::uint32_t; + +} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/lexer.cpp b/src/iw7/xsk/lexer.cpp new file mode 100644 index 00000000..3464f409 --- /dev/null +++ b/src/iw7/xsk/lexer.cpp @@ -0,0 +1,2816 @@ +#line 1 "lexer.cpp" +#include "stdafx.hpp" +#include "iw7.hpp" +#include "parser.hpp" +using namespace xsk::gsc; + +#line 7 "lexer.cpp" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define iw7__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer iw7__create_buffer +#endif + +#ifdef yy_delete_buffer +#define iw7__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer iw7__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define iw7__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer iw7__scan_buffer +#endif + +#ifdef yy_scan_string +#define iw7__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string iw7__scan_string +#endif + +#ifdef yy_scan_bytes +#define iw7__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes iw7__scan_bytes +#endif + +#ifdef yy_init_buffer +#define iw7__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer iw7__init_buffer +#endif + +#ifdef yy_flush_buffer +#define iw7__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer iw7__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define iw7__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state iw7__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define iw7__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer iw7__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define iw7_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state iw7_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define iw7_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state iw7_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define iw7_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack iw7_ensure_buffer_stack +#endif + +#ifdef yylex +#define iw7_lex_ALREADY_DEFINED +#else +#define yylex iw7_lex +#endif + +#ifdef yyrestart +#define iw7_restart_ALREADY_DEFINED +#else +#define yyrestart iw7_restart +#endif + +#ifdef yylex_init +#define iw7_lex_init_ALREADY_DEFINED +#else +#define yylex_init iw7_lex_init +#endif + +#ifdef yylex_init_extra +#define iw7_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra iw7_lex_init_extra +#endif + +#ifdef yylex_destroy +#define iw7_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy iw7_lex_destroy +#endif + +#ifdef yyget_debug +#define iw7_get_debug_ALREADY_DEFINED +#else +#define yyget_debug iw7_get_debug +#endif + +#ifdef yyset_debug +#define iw7_set_debug_ALREADY_DEFINED +#else +#define yyset_debug iw7_set_debug +#endif + +#ifdef yyget_extra +#define iw7_get_extra_ALREADY_DEFINED +#else +#define yyget_extra iw7_get_extra +#endif + +#ifdef yyset_extra +#define iw7_set_extra_ALREADY_DEFINED +#else +#define yyset_extra iw7_set_extra +#endif + +#ifdef yyget_in +#define iw7_get_in_ALREADY_DEFINED +#else +#define yyget_in iw7_get_in +#endif + +#ifdef yyset_in +#define iw7_set_in_ALREADY_DEFINED +#else +#define yyset_in iw7_set_in +#endif + +#ifdef yyget_out +#define iw7_get_out_ALREADY_DEFINED +#else +#define yyget_out iw7_get_out +#endif + +#ifdef yyset_out +#define iw7_set_out_ALREADY_DEFINED +#else +#define yyset_out iw7_set_out +#endif + +#ifdef yyget_leng +#define iw7_get_leng_ALREADY_DEFINED +#else +#define yyget_leng iw7_get_leng +#endif + +#ifdef yyget_text +#define iw7_get_text_ALREADY_DEFINED +#else +#define yyget_text iw7_get_text +#endif + +#ifdef yyget_lineno +#define iw7_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno iw7_get_lineno +#endif + +#ifdef yyset_lineno +#define iw7_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno iw7_set_lineno +#endif + +#ifdef yyget_column +#define iw7_get_column_ALREADY_DEFINED +#else +#define yyget_column iw7_get_column +#endif + +#ifdef yyset_column +#define iw7_set_column_ALREADY_DEFINED +#else +#define yyset_column iw7_set_column +#endif + +#ifdef yywrap +#define iw7_wrap_ALREADY_DEFINED +#else +#define yywrap iw7_wrap +#endif + +#ifdef yyalloc +#define iw7_alloc_ALREADY_DEFINED +#else +#define yyalloc iw7_alloc +#endif + +#ifdef yyrealloc +#define iw7_realloc_ALREADY_DEFINED +#else +#define yyrealloc iw7_realloc +#endif + +#ifdef yyfree +#define iw7_free_ALREADY_DEFINED +#else +#define yyfree iw7_free +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. + */ +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yyg->yy_start = 1 + 2 * +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yyg->yy_start - 1) / 2) +#define YYSTATE YY_START +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +#define yy_new_buffer yy_create_buffer +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define iw7_wrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; + +typedef int yy_state_type; + +#define yytext_ptr yytext_r + +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yyg->yy_c_buf_p = yy_cp; +#define YY_NUM_RULES 96 +#define YY_END_OF_BUFFER 97 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[281] = + { 0, + 0, 0, 0, 0, 0, 0, 97, 95, 1, 2, + 84, 95, 95, 83, 87, 95, 45, 46, 81, 79, + 51, 80, 52, 82, 94, 54, 55, 68, 78, 69, + 90, 49, 50, 88, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, 90, 47, + 86, 48, 85, 5, 6, 5, 9, 10, 9, 65, + 0, 92, 0, 0, 0, 0, 74, 0, 63, 0, + 76, 0, 0, 72, 56, 70, 57, 71, 93, 8, + 4, 3, 73, 93, 94, 0, 0, 53, 60, 66, + 64, 67, 61, 90, 77, 90, 90, 90, 90, 90, + + 90, 90, 90, 90, 90, 90, 21, 26, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, 90, 75, + 62, 7, 11, 0, 92, 0, 0, 0, 0, 0, + 91, 0, 0, 0, 0, 92, 0, 93, 3, 93, + 93, 89, 58, 59, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 24, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, 0, 0, + 0, 0, 91, 0, 0, 91, 0, 43, 90, 36, + 28, 90, 90, 90, 22, 90, 90, 90, 41, 90, + 90, 90, 42, 40, 90, 90, 90, 37, 90, 17, + + 90, 0, 0, 0, 30, 90, 90, 90, 15, 38, + 90, 44, 90, 90, 90, 90, 90, 90, 90, 23, + 0, 0, 0, 90, 90, 90, 90, 16, 32, 27, + 90, 33, 90, 90, 0, 0, 0, 90, 90, 29, + 25, 90, 90, 90, 0, 12, 0, 90, 31, 90, + 90, 18, 14, 0, 90, 90, 39, 90, 90, 0, + 90, 35, 90, 90, 0, 34, 90, 90, 0, 90, + 90, 0, 90, 19, 0, 90, 13, 90, 20, 0 + } ; + +static const YY_CHAR yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 5, 6, 1, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, + 22, 23, 1, 1, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 25, 26, 27, 28, 29, 1, 30, 31, 32, 33, + + 34, 35, 36, 37, 38, 24, 39, 40, 41, 42, + 43, 24, 24, 44, 45, 46, 47, 48, 49, 24, + 50, 51, 52, 53, 54, 55, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static const YY_CHAR yy_meta[56] = + { 0, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 1, 4, 1, 1, + 1, 1, 1, 4, 1, 5, 1, 1, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 1, 1, 1, 1 + } ; + +static const flex_int16_t yy_base[295] = + { 0, + 0, 0, 53, 54, 55, 56, 530, 531, 531, 531, + 507, 55, 33, 506, 64, 58, 531, 531, 505, 55, + 531, 60, 508, 73, 71, 506, 531, 70, 502, 71, + 497, 531, 531, 500, 57, 44, 70, 72, 75, 78, + 48, 76, 86, 79, 90, 93, 88, 84, 103, 531, + 81, 531, 531, 531, 531, 504, 531, 531, 503, 531, + 104, 531, 132, 477, 476, 472, 531, 118, 531, 119, + 531, 127, 138, 531, 531, 531, 531, 531, 120, 531, + 531, 0, 531, 121, 133, 134, 0, 531, 494, 531, + 531, 531, 493, 488, 531, 38, 120, 117, 135, 126, + + 137, 122, 143, 139, 140, 144, 487, 486, 145, 148, + 149, 151, 152, 154, 160, 155, 156, 161, 162, 531, + 531, 531, 531, 185, 191, 202, 473, 478, 471, 192, + 531, 203, 200, 207, 204, 205, 212, 531, 0, 201, + 531, 482, 531, 531, 186, 194, 197, 206, 199, 196, + 215, 209, 208, 218, 220, 221, 222, 223, 224, 227, + 226, 231, 233, 232, 238, 239, 241, 242, 466, 466, + 463, 264, 265, 271, 266, 270, 277, 478, 255, 477, + 476, 262, 263, 257, 475, 258, 259, 272, 474, 273, + 279, 157, 473, 472, 280, 281, 285, 471, 282, 283, + + 284, 450, 448, 458, 467, 290, 293, 294, 466, 465, + 296, 464, 295, 297, 300, 304, 298, 306, 312, 463, + 444, 454, 457, 314, 299, 307, 317, 459, 458, 457, + 316, 456, 321, 322, 447, 446, 449, 323, 330, 452, + 451, 331, 332, 329, 442, 531, 433, 342, 448, 344, + 326, 345, 531, 435, 347, 346, 446, 349, 352, 430, + 355, 444, 357, 358, 423, 429, 359, 363, 363, 364, + 365, 372, 371, 377, 365, 366, 531, 368, 370, 531, + 408, 413, 418, 423, 426, 428, 433, 438, 443, 448, + 453, 357, 458, 463 + + } ; + +static const flex_int16_t yy_def[295] = + { 0, + 280, 1, 281, 281, 282, 282, 280, 280, 280, 280, + 280, 283, 280, 280, 280, 284, 280, 280, 280, 280, + 280, 280, 280, 280, 285, 280, 280, 280, 280, 280, + 286, 280, 280, 280, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 286, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 283, 280, 287, 280, 280, 280, 280, 288, 280, 289, + 280, 284, 290, 280, 280, 280, 280, 280, 280, 280, + 280, 291, 280, 280, 285, 285, 292, 280, 280, 280, + 280, 280, 280, 286, 280, 286, 286, 286, 286, 286, + + 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 286, 280, + 280, 280, 280, 283, 283, 287, 280, 280, 280, 288, + 280, 293, 289, 294, 284, 284, 290, 280, 291, 280, + 280, 292, 280, 280, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 280, 280, + 280, 288, 288, 293, 289, 289, 294, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, + + 286, 280, 280, 280, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, + 280, 280, 280, 286, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 280, 280, 280, 286, 286, 286, + 286, 286, 286, 286, 280, 280, 280, 286, 286, 286, + 286, 286, 280, 280, 286, 286, 286, 286, 286, 280, + 286, 286, 286, 286, 280, 286, 286, 286, 280, 286, + 286, 280, 286, 286, 280, 286, 280, 286, 286, 0, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280 + + } ; + +static const flex_int16_t yy_nxt[587] = + { 0, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 8, 33, 34, 31, 35, + 36, 37, 38, 39, 40, 41, 31, 42, 31, 43, + 31, 44, 31, 45, 46, 47, 48, 31, 49, 31, + 31, 50, 51, 52, 53, 55, 55, 58, 58, 62, + 59, 59, 64, 87, 56, 56, 62, 75, 68, 87, + 65, 69, 70, 87, 77, 145, 76, 106, 80, 66, + 63, 78, 87, 73, 81, 71, 84, 97, 85, 82, + 89, 90, 92, 93, 83, 87, 87, 87, 96, 98, + + 87, 87, 120, 87, 87, 101, 99, 104, 62, 87, + 107, 87, 100, 87, 102, 87, 103, 108, 87, 109, + 105, 110, 131, 111, 115, 117, 112, 131, 87, 63, + 113, 116, 118, 121, 61, 62, 125, 79, 140, 119, + 72, 114, 87, 132, 134, 87, 136, 87, 84, 280, + 85, 87, 73, 146, 138, 141, 147, 126, 87, 87, + 87, 148, 87, 137, 87, 87, 152, 150, 87, 87, + 87, 151, 149, 87, 87, 153, 87, 87, 154, 87, + 87, 87, 87, 155, 156, 87, 87, 87, 166, 62, + 160, 162, 157, 158, 159, 62, 131, 163, 167, 168, + + 214, 165, 161, 164, 61, 130, 125, 173, 131, 133, + 63, 87, 62, 62, 72, 176, 63, 132, 140, 87, + 136, 87, 87, 179, 87, 134, 178, 126, 174, 73, + 73, 87, 177, 87, 87, 141, 180, 137, 182, 181, + 87, 183, 185, 87, 184, 87, 87, 87, 87, 87, + 186, 87, 87, 188, 189, 190, 87, 87, 87, 194, + 191, 193, 187, 87, 87, 197, 87, 87, 131, 131, + 192, 198, 199, 130, 131, 173, 195, 196, 131, 133, + 87, 201, 87, 87, 87, 176, 200, 87, 87, 132, + 132, 134, 210, 205, 206, 134, 174, 87, 87, 209, + + 207, 211, 177, 208, 87, 87, 87, 87, 87, 87, + 87, 215, 212, 213, 217, 87, 218, 220, 87, 87, + 87, 87, 87, 87, 87, 87, 216, 227, 219, 87, + 232, 87, 87, 226, 225, 224, 230, 87, 229, 87, + 231, 87, 87, 233, 228, 239, 87, 87, 87, 234, + 238, 87, 240, 241, 87, 87, 87, 87, 257, 242, + 142, 244, 243, 249, 250, 251, 248, 87, 252, 87, + 87, 87, 87, 256, 87, 255, 261, 87, 262, 258, + 87, 264, 87, 87, 87, 259, 267, 266, 87, 87, + 87, 87, 263, 87, 271, 87, 87, 273, 277, 270, + + 279, 274, 87, 268, 276, 275, 272, 278, 54, 54, + 54, 54, 54, 57, 57, 57, 57, 57, 61, 61, + 61, 61, 61, 72, 72, 72, 72, 72, 86, 86, + 86, 94, 94, 124, 124, 124, 124, 124, 130, 130, + 130, 130, 130, 133, 133, 133, 133, 133, 135, 135, + 135, 135, 135, 139, 87, 139, 139, 139, 172, 172, + 172, 172, 172, 175, 175, 175, 175, 175, 269, 87, + 265, 87, 260, 87, 254, 253, 87, 87, 247, 246, + 245, 87, 87, 87, 87, 237, 236, 235, 87, 87, + 87, 87, 87, 223, 222, 221, 87, 87, 87, 87, + + 87, 87, 87, 87, 204, 203, 202, 87, 171, 170, + 169, 87, 87, 87, 144, 143, 129, 128, 127, 123, + 122, 95, 87, 91, 88, 79, 74, 67, 60, 280, + 7, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280 + } ; + +static const flex_int16_t yy_chk[587] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 4, 5, 6, 12, + 5, 6, 13, 96, 3, 4, 16, 20, 15, 36, + 13, 15, 15, 41, 22, 96, 20, 41, 24, 13, + 12, 22, 35, 16, 24, 15, 25, 36, 25, 24, + 28, 28, 30, 30, 24, 37, 25, 38, 35, 37, + + 39, 42, 51, 40, 44, 38, 37, 40, 61, 48, + 42, 43, 37, 47, 39, 45, 39, 42, 46, 43, + 40, 44, 68, 45, 47, 48, 46, 70, 49, 61, + 46, 47, 49, 51, 63, 72, 63, 79, 84, 49, + 73, 46, 98, 68, 70, 97, 73, 102, 85, 86, + 85, 100, 72, 97, 79, 84, 98, 63, 85, 86, + 99, 98, 101, 73, 104, 105, 102, 100, 103, 106, + 109, 101, 99, 110, 111, 103, 112, 113, 104, 114, + 116, 117, 192, 105, 106, 115, 118, 119, 117, 124, + 112, 114, 109, 110, 111, 125, 130, 115, 118, 119, + + 192, 116, 113, 115, 126, 132, 126, 132, 133, 134, + 124, 145, 135, 136, 137, 134, 125, 130, 140, 146, + 137, 150, 147, 146, 149, 133, 145, 126, 132, 135, + 136, 148, 134, 153, 152, 140, 147, 137, 149, 148, + 151, 150, 152, 154, 151, 155, 156, 157, 158, 159, + 153, 161, 160, 155, 156, 157, 162, 164, 163, 161, + 158, 160, 154, 165, 166, 164, 167, 168, 172, 173, + 159, 165, 166, 174, 175, 174, 162, 163, 176, 177, + 179, 168, 184, 186, 187, 177, 167, 182, 183, 172, + 173, 175, 187, 179, 182, 176, 174, 188, 190, 186, + + 183, 188, 177, 184, 191, 195, 196, 199, 200, 201, + 197, 195, 190, 191, 197, 206, 199, 201, 207, 208, + 213, 211, 214, 217, 225, 215, 196, 211, 200, 216, + 217, 218, 226, 208, 207, 206, 215, 219, 214, 224, + 216, 231, 227, 218, 213, 225, 233, 234, 238, 219, + 224, 251, 226, 227, 244, 239, 242, 243, 251, 231, + 292, 234, 233, 239, 242, 243, 238, 248, 244, 250, + 252, 256, 255, 250, 258, 248, 255, 259, 256, 252, + 261, 259, 263, 264, 267, 252, 263, 261, 268, 270, + 271, 276, 258, 278, 268, 279, 273, 270, 275, 267, + + 278, 271, 274, 264, 273, 272, 269, 276, 281, 281, + 281, 281, 281, 282, 282, 282, 282, 282, 283, 283, + 283, 283, 283, 284, 284, 284, 284, 284, 285, 285, + 285, 286, 286, 287, 287, 287, 287, 287, 288, 288, + 288, 288, 288, 289, 289, 289, 289, 289, 290, 290, + 290, 290, 290, 291, 266, 291, 291, 291, 293, 293, + 293, 293, 293, 294, 294, 294, 294, 294, 265, 262, + 260, 257, 254, 249, 247, 245, 241, 240, 237, 236, + 235, 232, 230, 229, 228, 223, 222, 221, 220, 212, + 210, 209, 205, 204, 203, 202, 198, 194, 193, 189, + + 185, 181, 180, 178, 171, 170, 169, 142, 129, 128, + 127, 108, 107, 94, 93, 89, 66, 65, 64, 59, + 56, 34, 31, 29, 26, 23, 19, 14, 11, 7, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280 + } ; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +#line 1 "lexer.lpp" +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ +#define YY_NO_INPUT 1 +#define YY_NO_UNISTD_H 1 + +#line 23 "lexer.lpp" +#define YY_USER_ACTION loc.columns(yyleng); +#line 869 "lexer.cpp" + +#line 871 "lexer.cpp" + +#define INITIAL 0 +#define COMMENT_BLOCK_STATE 1 +#define DEVELOPER_BLOCK_STATE 2 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +/* Holds the entire state of the reentrant scanner. */ +struct yyguts_t + { + + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; + + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + int yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + int yylineno_r; + int yy_flex_debug_r; + + char *yytext_r; + int yy_more_flag; + int yy_more_len; + + }; /* end struct yyguts_t */ + +static int yy_init_globals ( yyscan_t yyscanner ); + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput ( yyscan_t yyscanner ); +#else +static int input ( yyscan_t yyscanner ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + int n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK /*LINTED*/break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_load_buffer_state( yyscanner ); + } + + { +#line 36 "lexer.lpp" + + + +#line 40 "lexer.lpp" + loc.step(); + + +#line 1139 "lexer.cpp" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yyg->yy_start; +yy_match: + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 281 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + ++yy_cp; + } + while ( yy_current_state != 280 ); + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 43 "lexer.lpp" +{ loc.step(); } + YY_BREAK +case 2: +/* rule 2 can match eol */ +YY_RULE_SETUP +#line 45 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 47 "lexer.lpp" + + YY_BREAK +case 4: +YY_RULE_SETUP +#line 49 "lexer.lpp" +{ BEGIN(COMMENT_BLOCK_STATE); } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 50 "lexer.lpp" + + YY_BREAK +case 6: +/* rule 6 can match eol */ +YY_RULE_SETUP +#line 51 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 52 "lexer.lpp" +{ BEGIN(INITIAL); } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 54 "lexer.lpp" +{ BEGIN(DEVELOPER_BLOCK_STATE); } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 55 "lexer.lpp" + + YY_BREAK +case 10: +/* rule 10 can match eol */ +YY_RULE_SETUP +#line 56 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 57 "lexer.lpp" +{ BEGIN(INITIAL); } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 59 "lexer.lpp" +{ return iw7::parser::make_INCLUDE(loc); } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 60 "lexer.lpp" +{ return iw7::parser::make_USINGTREE(loc); } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 61 "lexer.lpp" +{ return iw7::parser::make_ANIMTREE(loc); } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 62 "lexer.lpp" +{ return iw7::parser::make_ENDON(loc); } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 63 "lexer.lpp" +{ return iw7::parser::make_NOTIFY(loc); } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 64 "lexer.lpp" +{ return iw7::parser::make_WAIT(loc); } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 65 "lexer.lpp" +{ return iw7::parser::make_WAITTILL(loc); } + YY_BREAK +case 19: +YY_RULE_SETUP +#line 66 "lexer.lpp" +{ return iw7::parser::make_WAITTILLMATCH(loc); } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 67 "lexer.lpp" +{ return iw7::parser::make_WAITTILLFRAMEEND(loc); } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 68 "lexer.lpp" +{ return iw7::parser::make_IF(loc); } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 69 "lexer.lpp" +{ return iw7::parser::make_ELSE(loc); } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 70 "lexer.lpp" +{ return iw7::parser::make_WHILE(loc); } + YY_BREAK +case 24: +YY_RULE_SETUP +#line 71 "lexer.lpp" +{ return iw7::parser::make_FOR(loc); } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 72 "lexer.lpp" +{ return iw7::parser::make_FOREACH(loc); } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 73 "lexer.lpp" +{ return iw7::parser::make_IN(loc); } + YY_BREAK +case 27: +YY_RULE_SETUP +#line 74 "lexer.lpp" +{ return iw7::parser::make_SWITCH(loc); } + YY_BREAK +case 28: +YY_RULE_SETUP +#line 75 "lexer.lpp" +{ return iw7::parser::make_CASE(loc); } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 76 "lexer.lpp" +{ return iw7::parser::make_DEFAULT(loc); } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 77 "lexer.lpp" +{ return iw7::parser::make_BREAK(loc); } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 78 "lexer.lpp" +{ return iw7::parser::make_CONTINUE(loc); } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 79 "lexer.lpp" +{ return iw7::parser::make_RETURN(loc); } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 80 "lexer.lpp" +{ return iw7::parser::make_THREAD(loc); } + YY_BREAK +case 34: +YY_RULE_SETUP +#line 81 "lexer.lpp" +{ return iw7::parser::make_CHILDTHREAD(loc); } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 82 "lexer.lpp" +{ return iw7::parser::make_THISTHREAD(loc); } + YY_BREAK +case 36: +YY_RULE_SETUP +#line 83 "lexer.lpp" +{ return iw7::parser::make_CALL(loc); } + YY_BREAK +case 37: +YY_RULE_SETUP +#line 84 "lexer.lpp" +{ return iw7::parser::make_TRUE(loc); } + YY_BREAK +case 38: +YY_RULE_SETUP +#line 85 "lexer.lpp" +{ return iw7::parser::make_FALSE(loc); } + YY_BREAK +case 39: +YY_RULE_SETUP +#line 86 "lexer.lpp" +{ return iw7::parser::make_UNDEFINED(loc); } + YY_BREAK +case 40: +YY_RULE_SETUP +#line 87 "lexer.lpp" +{ return iw7::parser::make_SIZE(loc); } + YY_BREAK +case 41: +YY_RULE_SETUP +#line 88 "lexer.lpp" +{ return iw7::parser::make_GAME(loc); } + YY_BREAK +case 42: +YY_RULE_SETUP +#line 89 "lexer.lpp" +{ return iw7::parser::make_SELF(loc); } + YY_BREAK +case 43: +YY_RULE_SETUP +#line 90 "lexer.lpp" +{ return iw7::parser::make_ANIM(loc); } + YY_BREAK +case 44: +YY_RULE_SETUP +#line 91 "lexer.lpp" +{ return iw7::parser::make_LEVEL(loc); } + YY_BREAK +case 45: +YY_RULE_SETUP +#line 92 "lexer.lpp" +{ return iw7::parser::make_LPAREN(loc); } + YY_BREAK +case 46: +YY_RULE_SETUP +#line 93 "lexer.lpp" +{ return iw7::parser::make_RPAREN(loc); } + YY_BREAK +case 47: +YY_RULE_SETUP +#line 94 "lexer.lpp" +{ return iw7::parser::make_LBRACE(loc); } + YY_BREAK +case 48: +YY_RULE_SETUP +#line 95 "lexer.lpp" +{ return iw7::parser::make_RBRACE(loc); } + YY_BREAK +case 49: +YY_RULE_SETUP +#line 96 "lexer.lpp" +{ return iw7::parser::make_LBRACKET(loc); } + YY_BREAK +case 50: +YY_RULE_SETUP +#line 97 "lexer.lpp" +{ return iw7::parser::make_RBRACKET(loc); } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 98 "lexer.lpp" +{ return iw7::parser::make_COMMA(loc); } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 99 "lexer.lpp" +{ return iw7::parser::make_DOT(loc); } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 100 "lexer.lpp" +{ return iw7::parser::make_DOUBLECOLON(loc); } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 101 "lexer.lpp" +{ return iw7::parser::make_COLON(loc); } + YY_BREAK +case 55: +YY_RULE_SETUP +#line 102 "lexer.lpp" +{ return iw7::parser::make_SEMICOLON(loc); } + YY_BREAK +case 56: +YY_RULE_SETUP +#line 103 "lexer.lpp" +{ return iw7::parser::make_INCREMENT(loc); } + YY_BREAK +case 57: +YY_RULE_SETUP +#line 104 "lexer.lpp" +{ return iw7::parser::make_DECREMENT(loc); } + YY_BREAK +case 58: +YY_RULE_SETUP +#line 105 "lexer.lpp" +{ return iw7::parser::make_ASSIGN_LSHIFT(loc); } + YY_BREAK +case 59: +YY_RULE_SETUP +#line 106 "lexer.lpp" +{ return iw7::parser::make_ASSIGN_RSHIFT(loc); } + YY_BREAK +case 60: +YY_RULE_SETUP +#line 107 "lexer.lpp" +{ return iw7::parser::make_LSHIFT(loc); } + YY_BREAK +case 61: +YY_RULE_SETUP +#line 108 "lexer.lpp" +{ return iw7::parser::make_RSHIFT(loc); } + YY_BREAK +case 62: +YY_RULE_SETUP +#line 109 "lexer.lpp" +{ return iw7::parser::make_OR(loc); } + YY_BREAK +case 63: +YY_RULE_SETUP +#line 110 "lexer.lpp" +{ return iw7::parser::make_AND(loc); } + YY_BREAK +case 64: +YY_RULE_SETUP +#line 111 "lexer.lpp" +{ return iw7::parser::make_EQUALITY(loc); } + YY_BREAK +case 65: +YY_RULE_SETUP +#line 112 "lexer.lpp" +{ return iw7::parser::make_INEQUALITY(loc); } + YY_BREAK +case 66: +YY_RULE_SETUP +#line 113 "lexer.lpp" +{ return iw7::parser::make_LESS_EQUAL(loc); } + YY_BREAK +case 67: +YY_RULE_SETUP +#line 114 "lexer.lpp" +{ return iw7::parser::make_GREATER_EQUAL(loc); } + YY_BREAK +case 68: +YY_RULE_SETUP +#line 115 "lexer.lpp" +{ return iw7::parser::make_LESS(loc); } + YY_BREAK +case 69: +YY_RULE_SETUP +#line 116 "lexer.lpp" +{ return iw7::parser::make_GREATER(loc); } + YY_BREAK +case 70: +YY_RULE_SETUP +#line 117 "lexer.lpp" +{ return iw7::parser::make_ASSIGN_ADD(loc); } + YY_BREAK +case 71: +YY_RULE_SETUP +#line 118 "lexer.lpp" +{ return iw7::parser::make_ASSIGN_SUB(loc); } + YY_BREAK +case 72: +YY_RULE_SETUP +#line 119 "lexer.lpp" +{ return iw7::parser::make_ASSIGN_MULT(loc); } + YY_BREAK +case 73: +YY_RULE_SETUP +#line 120 "lexer.lpp" +{ return iw7::parser::make_ASSIGN_DIV(loc); } + YY_BREAK +case 74: +YY_RULE_SETUP +#line 121 "lexer.lpp" +{ return iw7::parser::make_ASSIGN_MOD(loc); } + YY_BREAK +case 75: +YY_RULE_SETUP +#line 122 "lexer.lpp" +{ return iw7::parser::make_ASSIGN_BITWISE_OR(loc); } + YY_BREAK +case 76: +YY_RULE_SETUP +#line 123 "lexer.lpp" +{ return iw7::parser::make_ASSIGN_BITWISE_AND(loc); } + YY_BREAK +case 77: +YY_RULE_SETUP +#line 124 "lexer.lpp" +{ return iw7::parser::make_ASSIGN_BITWISE_EXOR(loc); } + YY_BREAK +case 78: +YY_RULE_SETUP +#line 125 "lexer.lpp" +{ return iw7::parser::make_ASSIGN(loc); } + YY_BREAK +case 79: +YY_RULE_SETUP +#line 126 "lexer.lpp" +{ return iw7::parser::make_ADD(loc); } + YY_BREAK +case 80: +YY_RULE_SETUP +#line 127 "lexer.lpp" +{ return iw7::parser::make_SUB(loc); } + YY_BREAK +case 81: +YY_RULE_SETUP +#line 128 "lexer.lpp" +{ return iw7::parser::make_MULT(loc); } + YY_BREAK +case 82: +YY_RULE_SETUP +#line 129 "lexer.lpp" +{ return iw7::parser::make_DIV(loc); } + YY_BREAK +case 83: +YY_RULE_SETUP +#line 130 "lexer.lpp" +{ return iw7::parser::make_MOD(loc); } + YY_BREAK +case 84: +YY_RULE_SETUP +#line 131 "lexer.lpp" +{ return iw7::parser::make_NOT(loc); } + YY_BREAK +case 85: +YY_RULE_SETUP +#line 132 "lexer.lpp" +{ return iw7::parser::make_COMPLEMENT(loc); } + YY_BREAK +case 86: +YY_RULE_SETUP +#line 133 "lexer.lpp" +{ return iw7::parser::make_BITWISE_OR(loc); } + YY_BREAK +case 87: +YY_RULE_SETUP +#line 134 "lexer.lpp" +{ return iw7::parser::make_BITWISE_AND(loc); } + YY_BREAK +case 88: +YY_RULE_SETUP +#line 135 "lexer.lpp" +{ return iw7::parser::make_BITWISE_EXOR(loc); } + YY_BREAK +case 89: +YY_RULE_SETUP +#line 136 "lexer.lpp" +{ return iw7::parser::make_FILE(utils::string::fordslash(yytext), loc); } + YY_BREAK +case 90: +YY_RULE_SETUP +#line 137 "lexer.lpp" +{ return iw7::parser::make_NAME((std::string(yytext, 3) == "_ID") ? std::string(yytext) : utils::string::to_lower(yytext), loc); } + YY_BREAK +case 91: +/* rule 91 can match eol */ +YY_RULE_SETUP +#line 138 "lexer.lpp" +{ return iw7::parser::make_ISTRING(std::string(yytext).substr(1), loc); } + YY_BREAK +case 92: +/* rule 92 can match eol */ +YY_RULE_SETUP +#line 139 "lexer.lpp" +{ return iw7::parser::make_STRING(std::string(yytext), loc); } + YY_BREAK +case 93: +YY_RULE_SETUP +#line 140 "lexer.lpp" +{ return iw7::parser::make_FLOAT(std::string(yytext), loc); } + YY_BREAK +case 94: +YY_RULE_SETUP +#line 141 "lexer.lpp" +{ return iw7::parser::make_INTEGER(std::string(yytext), loc); } + YY_BREAK +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(COMMENT_BLOCK_STATE): +case YY_STATE_EOF(DEVELOPER_BLOCK_STATE): +#line 142 "lexer.lpp" +{ return iw7::parser::make_IW7EOF(loc); } + YY_BREAK +case 95: +/* rule 95 can match eol */ +YY_RULE_SETUP +#line 143 "lexer.lpp" +{ throw iw7::parser::syntax_error(loc, "bad token: \'" + std::string(yytext) + "\'"); } + YY_BREAK +case 96: +YY_RULE_SETUP +#line 145 "lexer.lpp" +ECHO; + YY_BREAK +#line 1684 "lexer.cpp" + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( yywrap( yyscanner ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + yyg->yy_n_chars, num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin , yyscanner); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) +{ + yy_state_type yy_current_state; + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_current_state = yyg->yy_start; + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 281 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) +{ + int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + char *yy_cp = yyg->yy_c_buf_p; + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 281 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 280); + + (void)yyg; + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (yyscan_t yyscanner) +#else + static int input (yyscan_t yyscanner) +#endif + +{ + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin , yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( yyscanner ) ) + return 0; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(yyscanner); +#else + return input(yyscanner); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * @param yyscanner The scanner object. + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * @param yyscanner The scanner object. + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( yyscanner ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yyg->yy_did_buffer_switch_on_eof = 1; +} + +static void yy_load_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyg->yy_hold_char = *yyg->yy_c_buf_p; +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * @param yyscanner The scanner object. + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file , yyscanner); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * @param yyscanner The scanner object. + */ + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf , yyscanner ); + + yyfree( (void *) b , yyscanner ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + +{ + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_flush_buffer( b , yyscanner); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param yyscanner The scanner object. + */ + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( yyscanner ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * @param yyscanner The scanner object. + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(yyscanner); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * @param yyscanner The scanner object. + */ +void yypop_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (yyscan_t yyscanner) +{ + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (!yyg->yy_buffer_stack) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->yy_buffer_stack_max = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b , yyscanner ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n , yyscanner); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the user-defined data for this scanner. + * @param yyscanner The scanner object. + */ +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; +} + +/** Get the current line number. + * @param yyscanner The scanner object. + */ +int yyget_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; +} + +/** Get the current column number. + * @param yyscanner The scanner object. + */ +int yyget_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; +} + +/** Get the input stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; +} + +/** Get the output stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; +} + +/** Get the length of the current token. + * @param yyscanner The scanner object. + */ +int yyget_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; +} + +/** Get the current token. + * @param yyscanner The scanner object. + */ + +char *yyget_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; +} + +/** Set the user-defined data. This data is never touched by the scanner. + * @param user_defined The data to be associated with this scanner. + * @param yyscanner The scanner object. + */ +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; +} + +/** Set the current line number. + * @param _line_number line number + * @param yyscanner The scanner object. + */ +void yyset_lineno (int _line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + + yylineno = _line_number; +} + +/** Set the current column. + * @param _column_no column number + * @param yyscanner The scanner object. + */ +void yyset_column (int _column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + + yycolumn = _column_no; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * @param yyscanner The scanner object. + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * _in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; +} + +void yyset_out (FILE * _out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; +} + +int yyget_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; +} + +void yyset_debug (int _bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; +} + +/* Accessor methods for yylval and yylloc */ + +/* User-visible API */ + +/* yylex_init is special because it creates the scanner itself, so it is + * the ONLY reentrant function that doesn't take the scanner as the last argument. + * That's why we explicitly handle the declaration, instead of using our macros. + */ +int yylex_init(yyscan_t* ptr_yy_globals) +{ + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + return yy_init_globals ( *ptr_yy_globals ); +} + +/* yylex_init_extra has the same functionality as yylex_init, but follows the + * convention of taking the scanner as the last argument. Note however, that + * this is a *pointer* to a scanner, as it will be allocated by this call (and + * is the reason, too, why this function also must handle its own declaration). + * The user defined value in the first argument will be available to yyalloc in + * the yyextra field. + */ +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) +{ + struct yyguts_t dummy_yyguts; + + yyset_extra (yy_user_defined, &dummy_yyguts); + + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + yyset_extra (yy_user_defined, *ptr_yy_globals); + + return yy_init_globals ( *ptr_yy_globals ); +} + +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + yyg->yy_buffer_stack = NULL; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = NULL; + yyg->yy_init = 0; + yyg->yy_start = 0; + + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = NULL; + yyout = NULL; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(yyscanner); + } + + /* Destroy the stack itself. */ + yyfree(yyg->yy_buffer_stack , yyscanner); + yyg->yy_buffer_stack = NULL; + + /* Destroy the start condition stack. */ + yyfree( yyg->yy_start_stack , yyscanner ); + yyg->yy_start_stack = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( yyscanner); + + /* Destroy the main struct (reentrant only). */ + yyfree ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); +} + +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); +} + +void yyfree (void * ptr , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 145 "lexer.lpp" + + diff --git a/src/iw7/xsk/lexer.hpp b/src/iw7/xsk/lexer.hpp new file mode 100644 index 00000000..005bcf8a --- /dev/null +++ b/src/iw7/xsk/lexer.hpp @@ -0,0 +1,708 @@ +#ifndef iw7_HEADER_H +#define iw7_HEADER_H 1 +#define iw7_IN_HEADER 1 + +#line 5 "lexer.hpp" +#include "stdafx.hpp" +#include "iw7.hpp" +#include "parser.hpp" +using namespace xsk::gsc; + +#line 11 "lexer.hpp" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define iw7__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer iw7__create_buffer +#endif + +#ifdef yy_delete_buffer +#define iw7__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer iw7__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define iw7__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer iw7__scan_buffer +#endif + +#ifdef yy_scan_string +#define iw7__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string iw7__scan_string +#endif + +#ifdef yy_scan_bytes +#define iw7__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes iw7__scan_bytes +#endif + +#ifdef yy_init_buffer +#define iw7__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer iw7__init_buffer +#endif + +#ifdef yy_flush_buffer +#define iw7__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer iw7__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define iw7__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state iw7__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define iw7__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer iw7__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define iw7_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state iw7_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define iw7_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state iw7_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define iw7_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack iw7_ensure_buffer_stack +#endif + +#ifdef yylex +#define iw7_lex_ALREADY_DEFINED +#else +#define yylex iw7_lex +#endif + +#ifdef yyrestart +#define iw7_restart_ALREADY_DEFINED +#else +#define yyrestart iw7_restart +#endif + +#ifdef yylex_init +#define iw7_lex_init_ALREADY_DEFINED +#else +#define yylex_init iw7_lex_init +#endif + +#ifdef yylex_init_extra +#define iw7_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra iw7_lex_init_extra +#endif + +#ifdef yylex_destroy +#define iw7_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy iw7_lex_destroy +#endif + +#ifdef yyget_debug +#define iw7_get_debug_ALREADY_DEFINED +#else +#define yyget_debug iw7_get_debug +#endif + +#ifdef yyset_debug +#define iw7_set_debug_ALREADY_DEFINED +#else +#define yyset_debug iw7_set_debug +#endif + +#ifdef yyget_extra +#define iw7_get_extra_ALREADY_DEFINED +#else +#define yyget_extra iw7_get_extra +#endif + +#ifdef yyset_extra +#define iw7_set_extra_ALREADY_DEFINED +#else +#define yyset_extra iw7_set_extra +#endif + +#ifdef yyget_in +#define iw7_get_in_ALREADY_DEFINED +#else +#define yyget_in iw7_get_in +#endif + +#ifdef yyset_in +#define iw7_set_in_ALREADY_DEFINED +#else +#define yyset_in iw7_set_in +#endif + +#ifdef yyget_out +#define iw7_get_out_ALREADY_DEFINED +#else +#define yyget_out iw7_get_out +#endif + +#ifdef yyset_out +#define iw7_set_out_ALREADY_DEFINED +#else +#define yyset_out iw7_set_out +#endif + +#ifdef yyget_leng +#define iw7_get_leng_ALREADY_DEFINED +#else +#define yyget_leng iw7_get_leng +#endif + +#ifdef yyget_text +#define iw7_get_text_ALREADY_DEFINED +#else +#define yyget_text iw7_get_text +#endif + +#ifdef yyget_lineno +#define iw7_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno iw7_get_lineno +#endif + +#ifdef yyset_lineno +#define iw7_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno iw7_set_lineno +#endif + +#ifdef yyget_column +#define iw7_get_column_ALREADY_DEFINED +#else +#define yyget_column iw7_get_column +#endif + +#ifdef yyset_column +#define iw7_set_column_ALREADY_DEFINED +#else +#define yyset_column iw7_set_column +#endif + +#ifdef yywrap +#define iw7_wrap_ALREADY_DEFINED +#else +#define yywrap iw7_wrap +#endif + +#ifdef yyalloc +#define iw7_alloc_ALREADY_DEFINED +#else +#define yyalloc iw7_alloc +#endif + +#ifdef yyrealloc +#define iw7_realloc_ALREADY_DEFINED +#else +#define yyrealloc iw7_realloc +#endif + +#ifdef yyfree +#define iw7_free_ALREADY_DEFINED +#else +#define yyfree iw7_free +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +/* Begin user sect3 */ + +#define iw7_wrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP + +#define yytext_ptr yytext_r + +#ifdef YY_HEADER_EXPORT_START_CONDITIONS +#define INITIAL 0 +#define COMMENT_BLOCK_STATE 1 +#define DEVELOPER_BLOCK_STATE 2 + +#endif + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +#undef YY_NEW_FILE +#undef YY_FLUSH_BUFFER +#undef yy_set_bol +#undef yy_new_buffer +#undef yy_set_interactive +#undef YY_DO_BEFORE_ACTION + +#ifdef YY_DECL_IS_OURS +#undef YY_DECL_IS_OURS +#undef YY_DECL +#endif + +#ifndef iw7__create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef iw7__delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef iw7__scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef iw7__scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef iw7__scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef iw7__init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef iw7__flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef iw7__load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef iw7__switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef iw7_push_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef iw7_pop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef iw7_ensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef iw7_lex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef iw7_restart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef iw7_lex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef iw7_lex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef iw7_lex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef iw7_get_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef iw7_set_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef iw7_get_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef iw7_set_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef iw7_get_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef iw7_set_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef iw7_get_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef iw7_set_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef iw7_get_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef iw7_get_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef iw7_get_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef iw7_set_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef iw7_get_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef iw7_set_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef iw7_wrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef iw7_get_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef iw7_set_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef iw7_get_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef iw7_set_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef iw7_alloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef iw7_realloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef iw7_free_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef iw7_text_ALREADY_DEFINED +#undef yytext +#endif +#ifndef iw7_leng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef iw7_in_ALREADY_DEFINED +#undef yyin +#endif +#ifndef iw7_out_ALREADY_DEFINED +#undef yyout +#endif +#ifndef iw7__flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef iw7_lineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef iw7_tables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef iw7_tables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef iw7_TABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + +#line 145 "lexer.lpp" + + +#line 706 "lexer.hpp" +#undef iw7_IN_HEADER +#endif /* iw7_HEADER_H */ diff --git a/src/iw7/xsk/parser.cpp b/src/iw7/xsk/parser.cpp new file mode 100644 index 00000000..e4e93a3f --- /dev/null +++ b/src/iw7/xsk/parser.cpp @@ -0,0 +1,3956 @@ +// A Bison parser, made by GNU Bison 3.7.5. + +// Skeleton implementation for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. + +// 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 . + +// As a special exception, you may create a larger work that contains +// part or all of the Bison parser skeleton and distribute that work +// under terms of your choice, so long as that work isn't itself a +// parser generator using the skeleton or a modified version thereof +// as a parser skeleton. Alternatively, if you modify or redistribute +// the parser skeleton itself, you may (at your option) remove this +// special exception, which will cause the skeleton and the resulting +// Bison output files to be licensed under the GNU General Public +// License without this special exception. + +// This special exception was added by the Free Software Foundation in +// version 2.2 of Bison. + +// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, +// especially those whose name start with YY_ or yy_. They are +// private implementation details that can be changed or removed. + +// "%code top" blocks. +#line 40 "parser.ypp" + +#include "stdafx.hpp" +#include "parser.hpp" +#include "lexer.hpp" +using namespace xsk::gsc; +xsk::gsc::iw7::parser::symbol_type IW7lex(yyscan_t yyscanner, xsk::gsc::location& loc); + +#line 47 "parser.cpp" + +// Take the name prefix into account. +#define yylex IW7lex + + + +#include "parser.hpp" + + + + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include // FIXME: INFRINGES ON USER NAME SPACE. +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + + +// Whether we are compiled with exception support. +#ifndef YY_EXCEPTIONS +# if defined __GNUC__ && !defined __EXCEPTIONS +# define YY_EXCEPTIONS 0 +# else +# define YY_EXCEPTIONS 1 +# endif +#endif + +#define YYRHSLOC(Rhs, K) ((Rhs)[K].location) +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +# ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).begin = YYRHSLOC (Rhs, 1).begin; \ + (Current).end = YYRHSLOC (Rhs, N).end; \ + } \ + else \ + { \ + (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ + } \ + while (false) +# endif + + +// Enable debugging if requested. +#if IW7DEBUG + +// A pseudo ostream that takes yydebug_ into account. +# define YYCDEBUG if (yydebug_) (*yycdebug_) + +# define YY_SYMBOL_PRINT(Title, Symbol) \ + do { \ + if (yydebug_) \ + { \ + *yycdebug_ << Title << ' '; \ + yy_print_ (*yycdebug_, Symbol); \ + *yycdebug_ << '\n'; \ + } \ + } while (false) + +# define YY_REDUCE_PRINT(Rule) \ + do { \ + if (yydebug_) \ + yy_reduce_print_ (Rule); \ + } while (false) + +# define YY_STACK_PRINT() \ + do { \ + if (yydebug_) \ + yy_stack_print_ (); \ + } while (false) + +#else // !IW7DEBUG + +# define YYCDEBUG if (false) std::cerr +# define YY_SYMBOL_PRINT(Title, Symbol) YY_USE (Symbol) +# define YY_REDUCE_PRINT(Rule) static_cast (0) +# define YY_STACK_PRINT() static_cast (0) + +#endif // !IW7DEBUG + +#define yyerrok (yyerrstatus_ = 0) +#define yyclearin (yyla.clear ()) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYRECOVERING() (!!yyerrstatus_) + +#line 13 "parser.ypp" +namespace xsk { namespace gsc { namespace iw7 { +#line 149 "parser.cpp" + + /// Build a parser object. + parser::parser (yyscan_t yyscanner_yyarg, xsk::gsc::location& loc_yyarg, xsk::gsc::program_ptr& ast_yyarg) +#if IW7DEBUG + : yydebug_ (false), + yycdebug_ (&std::cerr), +#else + : +#endif + yy_lac_established_ (false), + yyscanner (yyscanner_yyarg), + loc (loc_yyarg), + ast (ast_yyarg) + {} + + parser::~parser () + {} + + parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW + {} + + /*---------------. + | symbol kinds. | + `---------------*/ + + + + // by_state. + parser::by_state::by_state () YY_NOEXCEPT + : state (empty_state) + {} + + parser::by_state::by_state (const by_state& that) YY_NOEXCEPT + : state (that.state) + {} + + void + parser::by_state::clear () YY_NOEXCEPT + { + state = empty_state; + } + + void + parser::by_state::move (by_state& that) + { + state = that.state; + that.clear (); + } + + parser::by_state::by_state (state_type s) YY_NOEXCEPT + : state (s) + {} + + parser::symbol_kind_type + parser::by_state::kind () const YY_NOEXCEPT + { + if (state == empty_state) + return symbol_kind::S_YYEMPTY; + else + return YY_CAST (symbol_kind_type, yystos_[+state]); + } + + parser::stack_symbol_type::stack_symbol_type () + {} + + parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) + : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.YY_MOVE_OR_COPY< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.YY_MOVE_OR_COPY< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.YY_MOVE_OR_COPY< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.YY_MOVE_OR_COPY< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.YY_MOVE_OR_COPY< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.YY_MOVE_OR_COPY< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.YY_MOVE_OR_COPY< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.YY_MOVE_OR_COPY< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.YY_MOVE_OR_COPY< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.YY_MOVE_OR_COPY< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.YY_MOVE_OR_COPY< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.YY_MOVE_OR_COPY< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.YY_MOVE_OR_COPY< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.YY_MOVE_OR_COPY< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.YY_MOVE_OR_COPY< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.YY_MOVE_OR_COPY< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.YY_MOVE_OR_COPY< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.YY_MOVE_OR_COPY< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.YY_MOVE_OR_COPY< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.YY_MOVE_OR_COPY< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.YY_MOVE_OR_COPY< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.YY_MOVE_OR_COPY< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.YY_MOVE_OR_COPY< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.YY_MOVE_OR_COPY< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.YY_MOVE_OR_COPY< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.YY_MOVE_OR_COPY< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.YY_MOVE_OR_COPY< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.YY_MOVE_OR_COPY< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.YY_MOVE_OR_COPY< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.YY_MOVE_OR_COPY< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.YY_MOVE_OR_COPY< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.YY_MOVE_OR_COPY< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.YY_MOVE_OR_COPY< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.YY_MOVE_OR_COPY< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.YY_MOVE_OR_COPY< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.YY_MOVE_OR_COPY< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.YY_MOVE_OR_COPY< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.YY_MOVE_OR_COPY< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.YY_MOVE_OR_COPY< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.YY_MOVE_OR_COPY< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.YY_MOVE_OR_COPY< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.YY_MOVE_OR_COPY< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.YY_MOVE_OR_COPY< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.YY_MOVE_OR_COPY< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.YY_MOVE_OR_COPY< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.YY_MOVE_OR_COPY< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.YY_MOVE_OR_COPY< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.YY_MOVE_OR_COPY< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.YY_MOVE_OR_COPY< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.YY_MOVE_OR_COPY< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.YY_MOVE_OR_COPY< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.YY_MOVE_OR_COPY< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + +#if 201103L <= YY_CPLUSPLUS + // that is emptied. + that.state = empty_state; +#endif + } + + parser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that) + : super_type (s, YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + + // that is emptied. + that.kind_ = symbol_kind::S_YYEMPTY; + } + +#if YY_CPLUSPLUS < 201103L + parser::stack_symbol_type& + parser::stack_symbol_type::operator= (const stack_symbol_type& that) + { + state = that.state; + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.copy< anim_ptr > (that.value); + break; + + case symbol_kind::S_animation: // animation + value.copy< animation_ptr > (that.value); + break; + + case symbol_kind::S_animtree: // animtree + value.copy< animtree_ptr > (that.value); + break; + + case symbol_kind::S_constant: // constant + value.copy< constant_ptr > (that.value); + break; + + case symbol_kind::S_define: // define + value.copy< define_ptr > (that.value); + break; + + case symbol_kind::S_empty_array: // empty_array + value.copy< empty_array_ptr > (that.value); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.copy< expr_arguments_ptr > (that.value); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.copy< expr_assign_ptr > (that.value); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.copy< expr_call_ptr > (that.value); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.copy< expr_call_type_ptr > (that.value); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.copy< expr_ptr > (that.value); + break; + + case symbol_kind::S_false: // false + value.copy< false_ptr > (that.value); + break; + + case symbol_kind::S_file: // file + value.copy< file_ptr > (that.value); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.copy< float_ptr > (that.value); + break; + + case symbol_kind::S_game: // game + value.copy< game_ptr > (that.value); + break; + + case symbol_kind::S_include: // include + value.copy< include_ptr > (that.value); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.copy< integer_ptr > (that.value); + break; + + case symbol_kind::S_istring: // istring + value.copy< istring_ptr > (that.value); + break; + + case symbol_kind::S_level: // level + value.copy< level_ptr > (that.value); + break; + + case symbol_kind::S_name: // name + value.copy< name_ptr > (that.value); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.copy< node_ptr > (that.value); + break; + + case symbol_kind::S_parameters: // parameters + value.copy< parameters_ptr > (that.value); + break; + + case symbol_kind::S_program: // program + value.copy< program_ptr > (that.value); + break; + + case symbol_kind::S_self: // self + value.copy< self_ptr > (that.value); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.copy< std::string > (that.value); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.copy< stmt_assign_ptr > (that.value); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.copy< stmt_break_ptr > (that.value); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.copy< stmt_call_ptr > (that.value); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.copy< stmt_case_ptr > (that.value); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.copy< stmt_continue_ptr > (that.value); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.copy< stmt_default_ptr > (that.value); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.copy< stmt_endon_ptr > (that.value); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.copy< stmt_for_ptr > (that.value); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.copy< stmt_foreach_ptr > (that.value); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.copy< stmt_if_ptr > (that.value); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.copy< stmt_ifelse_ptr > (that.value); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.copy< stmt_list_ptr > (that.value); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.copy< stmt_notify_ptr > (that.value); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.copy< stmt_ptr > (that.value); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.copy< stmt_return_ptr > (that.value); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.copy< stmt_switch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.copy< stmt_wait_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.copy< stmt_waittill_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.copy< stmt_waittillframeend_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.copy< stmt_waittillmatch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.copy< stmt_while_ptr > (that.value); + break; + + case symbol_kind::S_string: // string + value.copy< string_ptr > (that.value); + break; + + case symbol_kind::S_thisthread: // thisthread + value.copy< thisthread_ptr > (that.value); + break; + + case symbol_kind::S_thread: // thread + value.copy< thread_ptr > (that.value); + break; + + case symbol_kind::S_true: // true + value.copy< true_ptr > (that.value); + break; + + case symbol_kind::S_undefined: // undefined + value.copy< undefined_ptr > (that.value); + break; + + case symbol_kind::S_usingtree: // usingtree + value.copy< usingtree_ptr > (that.value); + break; + + case symbol_kind::S_vector: // vector + value.copy< vector_ptr > (that.value); + break; + + default: + break; + } + + location = that.location; + return *this; + } + + parser::stack_symbol_type& + parser::stack_symbol_type::operator= (stack_symbol_type& that) + { + state = that.state; + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (that.value); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (that.value); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (that.value); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (that.value); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (that.value); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (that.value); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (that.value); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (that.value); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (that.value); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (that.value); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (that.value); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (that.value); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (that.value); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (that.value); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (that.value); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (that.value); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (that.value); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (that.value); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (that.value); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (that.value); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (that.value); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (that.value); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (that.value); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (that.value); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (that.value); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (that.value); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (that.value); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (that.value); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (that.value); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (that.value); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (that.value); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (that.value); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (that.value); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (that.value); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (that.value); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (that.value); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (that.value); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (that.value); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (that.value); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (that.value); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (that.value); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (that.value); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (that.value); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (that.value); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (that.value); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (that.value); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (that.value); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (that.value); + break; + + default: + break; + } + + location = that.location; + // that is emptied. + that.state = empty_state; + return *this; + } +#endif + + template + void + parser::yy_destroy_ (const char* yymsg, basic_symbol& yysym) const + { + if (yymsg) + YY_SYMBOL_PRINT (yymsg, yysym); + } + +#if IW7DEBUG + template + void + parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const + { + std::ostream& yyoutput = yyo; + YY_USE (yyoutput); + if (yysym.empty ()) + yyo << "empty symbol"; + else + { + symbol_kind_type yykind = yysym.kind (); + yyo << (yykind < YYNTOKENS ? "token" : "nterm") + << ' ' << yysym.name () << " (" + << yysym.location << ": "; + YY_USE (yykind); + yyo << ')'; + } + } +#endif + + void + parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) + { + if (m) + YY_SYMBOL_PRINT (m, sym); + yystack_.push (YY_MOVE (sym)); + } + + void + parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) + { +#if 201103L <= YY_CPLUSPLUS + yypush_ (m, stack_symbol_type (s, std::move (sym))); +#else + stack_symbol_type ss (s, sym); + yypush_ (m, ss); +#endif + } + + void + parser::yypop_ (int n) + { + yystack_.pop (n); + } + +#if IW7DEBUG + std::ostream& + parser::debug_stream () const + { + return *yycdebug_; + } + + void + parser::set_debug_stream (std::ostream& o) + { + yycdebug_ = &o; + } + + + parser::debug_level_type + parser::debug_level () const + { + return yydebug_; + } + + void + parser::set_debug_level (debug_level_type l) + { + yydebug_ = l; + } +#endif // IW7DEBUG + + parser::state_type + parser::yy_lr_goto_state_ (state_type yystate, int yysym) + { + int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; + if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) + return yytable_[yyr]; + else + return yydefgoto_[yysym - YYNTOKENS]; + } + + bool + parser::yy_pact_value_is_default_ (int yyvalue) + { + return yyvalue == yypact_ninf_; + } + + bool + parser::yy_table_value_is_error_ (int yyvalue) + { + return yyvalue == yytable_ninf_; + } + + int + parser::operator() () + { + return parse (); + } + + int + parser::parse () + { + int yyn; + /// Length of the RHS of the rule being reduced. + int yylen = 0; + + // Error handling. + int yynerrs_ = 0; + int yyerrstatus_ = 0; + + /// The lookahead symbol. + symbol_type yyla; + + /// The locations where the error started and ended. + stack_symbol_type yyerror_range[3]; + + /// The return value of parse (). + int yyresult; + + /// Discard the LAC context in case there still is one left from a + /// previous invocation. + yy_lac_discard_ ("init"); + +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + YYCDEBUG << "Starting parse\n"; + + + /* Initialize the stack. The initial state will be set in + yynewstate, since the latter expects the semantical and the + location values to have been already stored, initialize these + stacks with a primary value. */ + yystack_.clear (); + yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); + + /*-----------------------------------------------. + | yynewstate -- push a new symbol on the stack. | + `-----------------------------------------------*/ + yynewstate: + YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; + YY_STACK_PRINT (); + + // Accept? + if (yystack_[0].state == yyfinal_) + YYACCEPT; + + goto yybackup; + + + /*-----------. + | yybackup. | + `-----------*/ + yybackup: + // Try to take a decision without lookahead. + yyn = yypact_[+yystack_[0].state]; + if (yy_pact_value_is_default_ (yyn)) + goto yydefault; + + // Read a lookahead token. + if (yyla.empty ()) + { + YYCDEBUG << "Reading a token\n"; +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + symbol_type yylookahead (yylex (yyscanner, loc)); + yyla.move (yylookahead); + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + goto yyerrlab1; + } +#endif // YY_EXCEPTIONS + } + YY_SYMBOL_PRINT ("Next token is", yyla); + + if (yyla.kind () == symbol_kind::S_YYerror) + { + // The scanner already issued an error message, process directly + // to error recovery. But do not keep the error token as + // lookahead, it is too special and may lead us to an endless + // loop in error recovery. */ + yyla.kind_ = symbol_kind::S_YYUNDEF; + goto yyerrlab1; + } + + /* If the proper action on seeing token YYLA.TYPE is to reduce or + to detect an error, take that action. */ + yyn += yyla.kind (); + if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) + { + if (!yy_lac_establish_ (yyla.kind ())) + goto yyerrlab; + goto yydefault; + } + + // Reduce or error. + yyn = yytable_[yyn]; + if (yyn <= 0) + { + if (yy_table_value_is_error_ (yyn)) + goto yyerrlab; + if (!yy_lac_establish_ (yyla.kind ())) + goto yyerrlab; + + yyn = -yyn; + goto yyreduce; + } + + // Count tokens shifted since error; after three, turn off error status. + if (yyerrstatus_) + --yyerrstatus_; + + // Shift the lookahead token. + yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); + yy_lac_discard_ ("shift"); + goto yynewstate; + + + /*-----------------------------------------------------------. + | yydefault -- do the default action for the current state. | + `-----------------------------------------------------------*/ + yydefault: + yyn = yydefact_[+yystack_[0].state]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + + /*-----------------------------. + | yyreduce -- do a reduction. | + `-----------------------------*/ + yyreduce: + yylen = yyr2_[yyn]; + { + stack_symbol_type yylhs; + yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); + /* Variants are always initialized to an empty instance of the + correct type. The default '$$ = $1' action is NOT applied + when using variants. */ + switch (yyr1_[yyn]) + { + case symbol_kind::S_anim: // anim + yylhs.value.emplace< anim_ptr > (); + break; + + case symbol_kind::S_animation: // animation + yylhs.value.emplace< animation_ptr > (); + break; + + case symbol_kind::S_animtree: // animtree + yylhs.value.emplace< animtree_ptr > (); + break; + + case symbol_kind::S_constant: // constant + yylhs.value.emplace< constant_ptr > (); + break; + + case symbol_kind::S_define: // define + yylhs.value.emplace< define_ptr > (); + break; + + case symbol_kind::S_empty_array: // empty_array + yylhs.value.emplace< empty_array_ptr > (); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + yylhs.value.emplace< expr_arguments_ptr > (); + break; + + case symbol_kind::S_expr_assign: // expr_assign + yylhs.value.emplace< expr_assign_ptr > (); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + yylhs.value.emplace< expr_call_ptr > (); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + yylhs.value.emplace< expr_call_type_ptr > (); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + yylhs.value.emplace< expr_ptr > (); + break; + + case symbol_kind::S_false: // false + yylhs.value.emplace< false_ptr > (); + break; + + case symbol_kind::S_file: // file + yylhs.value.emplace< file_ptr > (); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + yylhs.value.emplace< float_ptr > (); + break; + + case symbol_kind::S_game: // game + yylhs.value.emplace< game_ptr > (); + break; + + case symbol_kind::S_include: // include + yylhs.value.emplace< include_ptr > (); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + yylhs.value.emplace< integer_ptr > (); + break; + + case symbol_kind::S_istring: // istring + yylhs.value.emplace< istring_ptr > (); + break; + + case symbol_kind::S_level: // level + yylhs.value.emplace< level_ptr > (); + break; + + case symbol_kind::S_name: // name + yylhs.value.emplace< name_ptr > (); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + yylhs.value.emplace< node_ptr > (); + break; + + case symbol_kind::S_parameters: // parameters + yylhs.value.emplace< parameters_ptr > (); + break; + + case symbol_kind::S_program: // program + yylhs.value.emplace< program_ptr > (); + break; + + case symbol_kind::S_self: // self + yylhs.value.emplace< self_ptr > (); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + yylhs.value.emplace< std::string > (); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + yylhs.value.emplace< stmt_assign_ptr > (); + break; + + case symbol_kind::S_stmt_break: // stmt_break + yylhs.value.emplace< stmt_break_ptr > (); + break; + + case symbol_kind::S_stmt_call: // stmt_call + yylhs.value.emplace< stmt_call_ptr > (); + break; + + case symbol_kind::S_stmt_case: // stmt_case + yylhs.value.emplace< stmt_case_ptr > (); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + yylhs.value.emplace< stmt_continue_ptr > (); + break; + + case symbol_kind::S_stmt_default: // stmt_default + yylhs.value.emplace< stmt_default_ptr > (); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + yylhs.value.emplace< stmt_endon_ptr > (); + break; + + case symbol_kind::S_stmt_for: // stmt_for + yylhs.value.emplace< stmt_for_ptr > (); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + yylhs.value.emplace< stmt_foreach_ptr > (); + break; + + case symbol_kind::S_stmt_if: // stmt_if + yylhs.value.emplace< stmt_if_ptr > (); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + yylhs.value.emplace< stmt_ifelse_ptr > (); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + yylhs.value.emplace< stmt_list_ptr > (); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + yylhs.value.emplace< stmt_notify_ptr > (); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + yylhs.value.emplace< stmt_ptr > (); + break; + + case symbol_kind::S_stmt_return: // stmt_return + yylhs.value.emplace< stmt_return_ptr > (); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + yylhs.value.emplace< stmt_switch_ptr > (); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + yylhs.value.emplace< stmt_wait_ptr > (); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + yylhs.value.emplace< stmt_waittill_ptr > (); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + yylhs.value.emplace< stmt_waittillframeend_ptr > (); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + yylhs.value.emplace< stmt_waittillmatch_ptr > (); + break; + + case symbol_kind::S_stmt_while: // stmt_while + yylhs.value.emplace< stmt_while_ptr > (); + break; + + case symbol_kind::S_string: // string + yylhs.value.emplace< string_ptr > (); + break; + + case symbol_kind::S_thisthread: // thisthread + yylhs.value.emplace< thisthread_ptr > (); + break; + + case symbol_kind::S_thread: // thread + yylhs.value.emplace< thread_ptr > (); + break; + + case symbol_kind::S_true: // true + yylhs.value.emplace< true_ptr > (); + break; + + case symbol_kind::S_undefined: // undefined + yylhs.value.emplace< undefined_ptr > (); + break; + + case symbol_kind::S_usingtree: // usingtree + yylhs.value.emplace< usingtree_ptr > (); + break; + + case symbol_kind::S_vector: // vector + yylhs.value.emplace< vector_ptr > (); + break; + + default: + break; + } + + + // Default location. + { + stack_type::slice range (yystack_, yylen); + YYLLOC_DEFAULT (yylhs.location, range, yylen); + yyerror_range[1].location = yylhs.location; + } + + // Perform the reduction. + YY_REDUCE_PRINT (yyn); +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + switch (yyn) + { + case 2: // root: program +#line 231 "parser.ypp" + { ast = std::move(yystack_[0].value.as < program_ptr > ()); } +#line 1731 "parser.cpp" + break; + + case 3: // root: %empty +#line 232 "parser.ypp" + { ast = std::make_unique(yylhs.location); } +#line 1737 "parser.cpp" + break; + + case 4: // program: program include +#line 237 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::move(yystack_[1].value.as < program_ptr > ()); yylhs.value.as < program_ptr > ()->includes.push_back(std::move(yystack_[0].value.as < include_ptr > ())); } +#line 1743 "parser.cpp" + break; + + case 5: // program: program define +#line 239 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::move(yystack_[1].value.as < program_ptr > ()); yylhs.value.as < program_ptr > ()->definitions.push_back(std::move(yystack_[0].value.as < define_ptr > ())); } +#line 1749 "parser.cpp" + break; + + case 6: // program: include +#line 241 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < program_ptr > ()->includes.push_back(std::move(yystack_[0].value.as < include_ptr > ())); } +#line 1755 "parser.cpp" + break; + + case 7: // program: define +#line 243 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < program_ptr > ()->definitions.push_back(std::move(yystack_[0].value.as < define_ptr > ())); } +#line 1761 "parser.cpp" + break; + + case 8: // include: "#include" file ";" +#line 248 "parser.ypp" + { yylhs.value.as < include_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < file_ptr > ())); } +#line 1767 "parser.cpp" + break; + + case 9: // define: usingtree +#line 252 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_usingtree = std::move(yystack_[0].value.as < usingtree_ptr > ()); } +#line 1773 "parser.cpp" + break; + + case 10: // define: constant +#line 253 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_constant = std::move(yystack_[0].value.as < constant_ptr > ()); } +#line 1779 "parser.cpp" + break; + + case 11: // define: thread +#line 254 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_thread = std::move(yystack_[0].value.as < thread_ptr > ()); } +#line 1785 "parser.cpp" + break; + + case 12: // usingtree: "#using_animtree" "(" string ")" ";" +#line 259 "parser.ypp" + { yylhs.value.as < usingtree_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < string_ptr > ())); } +#line 1791 "parser.cpp" + break; + + case 13: // constant: name "=" expr ";" +#line 264 "parser.ypp" + { yylhs.value.as < constant_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 1797 "parser.cpp" + break; + + case 14: // thread: name "(" parameters ")" stmt_block +#line 269 "parser.ypp" + { yylhs.value.as < thread_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < name_ptr > ()), std::move(yystack_[2].value.as < parameters_ptr > ()), std::move(yystack_[0].value.as < stmt_list_ptr > ())); } +#line 1803 "parser.cpp" + break; + + case 15: // parameters: parameters "," name +#line 274 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::move(yystack_[2].value.as < parameters_ptr > ()); yylhs.value.as < parameters_ptr > ()->list.push_back(std::move(yystack_[0].value.as < name_ptr > ())); } +#line 1809 "parser.cpp" + break; + + case 16: // parameters: name +#line 276 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < parameters_ptr > ()->list.push_back(std::move(yystack_[0].value.as < name_ptr > ())); } +#line 1815 "parser.cpp" + break; + + case 17: // parameters: %empty +#line 278 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::make_unique(yylhs.location); } +#line 1821 "parser.cpp" + break; + + case 18: // stmt: stmt_block +#line 282 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_list = std::move(yystack_[0].value.as < stmt_list_ptr > ()); } +#line 1827 "parser.cpp" + break; + + case 19: // stmt: stmt_call +#line 283 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_call = std::move(yystack_[0].value.as < stmt_call_ptr > ()); } +#line 1833 "parser.cpp" + break; + + case 20: // stmt: stmt_assign +#line 284 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_assign = std::move(yystack_[0].value.as < stmt_assign_ptr > ()); } +#line 1839 "parser.cpp" + break; + + case 21: // stmt: stmt_endon +#line 285 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_endon = std::move(yystack_[0].value.as < stmt_endon_ptr > ()); } +#line 1845 "parser.cpp" + break; + + case 22: // stmt: stmt_notify +#line 286 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_notify = std::move(yystack_[0].value.as < stmt_notify_ptr > ()); } +#line 1851 "parser.cpp" + break; + + case 23: // stmt: stmt_wait +#line 287 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_wait = std::move(yystack_[0].value.as < stmt_wait_ptr > ()); } +#line 1857 "parser.cpp" + break; + + case 24: // stmt: stmt_waittill +#line 288 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittill = std::move(yystack_[0].value.as < stmt_waittill_ptr > ()); } +#line 1863 "parser.cpp" + break; + + case 25: // stmt: stmt_waittillmatch +#line 289 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittillmatch = std::move(yystack_[0].value.as < stmt_waittillmatch_ptr > ()); } +#line 1869 "parser.cpp" + break; + + case 26: // stmt: stmt_waittillframeend +#line 290 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittillframeend = std::move(yystack_[0].value.as < stmt_waittillframeend_ptr > ()); } +#line 1875 "parser.cpp" + break; + + case 27: // stmt: stmt_if +#line 291 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_if = std::move(yystack_[0].value.as < stmt_if_ptr > ()); } +#line 1881 "parser.cpp" + break; + + case 28: // stmt: stmt_ifelse +#line 292 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_ifelse = std::move(yystack_[0].value.as < stmt_ifelse_ptr > ()); } +#line 1887 "parser.cpp" + break; + + case 29: // stmt: stmt_while +#line 293 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_while = std::move(yystack_[0].value.as < stmt_while_ptr > ()); } +#line 1893 "parser.cpp" + break; + + case 30: // stmt: stmt_for +#line 294 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_for = std::move(yystack_[0].value.as < stmt_for_ptr > ()); } +#line 1899 "parser.cpp" + break; + + case 31: // stmt: stmt_foreach +#line 295 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_foreach = std::move(yystack_[0].value.as < stmt_foreach_ptr > ()); } +#line 1905 "parser.cpp" + break; + + case 32: // stmt: stmt_switch +#line 296 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_switch = std::move(yystack_[0].value.as < stmt_switch_ptr > ()); } +#line 1911 "parser.cpp" + break; + + case 33: // stmt: stmt_case +#line 297 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_case = std::move(yystack_[0].value.as < stmt_case_ptr > ()); } +#line 1917 "parser.cpp" + break; + + case 34: // stmt: stmt_default +#line 298 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_default = std::move(yystack_[0].value.as < stmt_default_ptr > ()); } +#line 1923 "parser.cpp" + break; + + case 35: // stmt: stmt_break +#line 299 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_break = std::move(yystack_[0].value.as < stmt_break_ptr > ()); } +#line 1929 "parser.cpp" + break; + + case 36: // stmt: stmt_continue +#line 300 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_continue = std::move(yystack_[0].value.as < stmt_continue_ptr > ()); } +#line 1935 "parser.cpp" + break; + + case 37: // stmt: stmt_return +#line 301 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_return = std::move(yystack_[0].value.as < stmt_return_ptr > ()); } +#line 1941 "parser.cpp" + break; + + case 38: // stmt_block: "{" stmt_list "}" +#line 305 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::move(yystack_[1].value.as < stmt_list_ptr > ()); } +#line 1947 "parser.cpp" + break; + + case 39: // stmt_block: "{" "}" +#line 306 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::make_unique(yylhs.location); } +#line 1953 "parser.cpp" + break; + + case 40: // stmt_list: stmt_list stmt +#line 311 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::move(yystack_[1].value.as < stmt_list_ptr > ()); yylhs.value.as < stmt_list_ptr > ()->stmts.push_back(std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 1959 "parser.cpp" + break; + + case 41: // stmt_list: stmt +#line 313 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < stmt_list_ptr > ()->stmts.push_back(std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 1965 "parser.cpp" + break; + + case 42: // stmt_call: expr_call ";" +#line 318 "parser.ypp" + { yylhs.value.as < stmt_call_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_call_ptr > ())); } +#line 1971 "parser.cpp" + break; + + case 43: // stmt_call: expr_call_thread ";" +#line 320 "parser.ypp" + { yylhs.value.as < stmt_call_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_call_ptr > ())); } +#line 1977 "parser.cpp" + break; + + case 44: // stmt_assign: expr_assign ";" +#line 325 "parser.ypp" + { yylhs.value.as < stmt_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_assign_ptr > ())); } +#line 1983 "parser.cpp" + break; + + case 45: // stmt_endon: object "endon" "(" expr ")" ";" +#line 330 "parser.ypp" + { yylhs.value.as < stmt_endon_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ())); } +#line 1989 "parser.cpp" + break; + + case 46: // stmt_notify: object "notify" "(" expr "," expr_arguments ")" ";" +#line 335 "parser.ypp" + { yylhs.value.as < stmt_notify_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 1995 "parser.cpp" + break; + + case 47: // stmt_notify: object "notify" "(" expr ")" ";" +#line 337 "parser.ypp" + { yylhs.value.as < stmt_notify_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2001 "parser.cpp" + break; + + case 48: // stmt_wait: "wait" expr ";" +#line 342 "parser.ypp" + { yylhs.value.as < stmt_wait_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2007 "parser.cpp" + break; + + case 49: // stmt_waittill: object "waittill" "(" expr "," expr_arguments ")" ";" +#line 347 "parser.ypp" + { yylhs.value.as < stmt_waittill_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 2013 "parser.cpp" + break; + + case 50: // stmt_waittill: object "waittill" "(" expr ")" ";" +#line 349 "parser.ypp" + { yylhs.value.as < stmt_waittill_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2019 "parser.cpp" + break; + + case 51: // stmt_waittillmatch: object "waittillmatch" "(" expr "," expr_arguments ")" ";" +#line 354 "parser.ypp" + { yylhs.value.as < stmt_waittillmatch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 2025 "parser.cpp" + break; + + case 52: // stmt_waittillmatch: object "waittillmatch" "(" expr ")" ";" +#line 356 "parser.ypp" + { yylhs.value.as < stmt_waittillmatch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2031 "parser.cpp" + break; + + case 53: // stmt_waittillframeend: "waittillframeend" ";" +#line 361 "parser.ypp" + { yylhs.value.as < stmt_waittillframeend_ptr > () = std::make_unique(yylhs.location); } +#line 2037 "parser.cpp" + break; + + case 54: // stmt_if: "if" "(" expr ")" stmt +#line 366 "parser.ypp" + { yylhs.value.as < stmt_if_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2043 "parser.cpp" + break; + + case 55: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt +#line 371 "parser.ypp" + { yylhs.value.as < stmt_ifelse_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < stmt_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2049 "parser.cpp" + break; + + case 56: // stmt_while: "while" "(" expr ")" stmt +#line 376 "parser.ypp" + { yylhs.value.as < stmt_while_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2055 "parser.cpp" + break; + + case 57: // stmt_for: "for" "(" for_stmt ";" for_expr ";" for_stmt ")" stmt +#line 381 "parser.ypp" + { yylhs.value.as < stmt_for_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[6].value.as < stmt_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < stmt_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2061 "parser.cpp" + break; + + case 58: // stmt_foreach: "foreach" "(" name "in" expr ")" stmt +#line 386 "parser.ypp" + { yylhs.value.as < stmt_foreach_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[4].value.as < name_ptr > ())), std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2067 "parser.cpp" + break; + + case 59: // stmt_foreach: "foreach" "(" name "," name "in" expr ")" stmt +#line 388 "parser.ypp" + { yylhs.value.as < stmt_foreach_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[6].value.as < name_ptr > ())), expr_ptr(std::move(yystack_[4].value.as < name_ptr > ())), std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2073 "parser.cpp" + break; + + case 60: // stmt_switch: "switch" "(" expr ")" stmt_block +#line 393 "parser.ypp" + { yylhs.value.as < stmt_switch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_list_ptr > ())); } +#line 2079 "parser.cpp" + break; + + case 61: // stmt_case: "case" integer ":" +#line 398 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < integer_ptr > ())), std::make_unique(yylhs.location)); } +#line 2085 "parser.cpp" + break; + + case 62: // stmt_case: "case" neg_integer ":" +#line 400 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < integer_ptr > ())), std::make_unique(yylhs.location)); } +#line 2091 "parser.cpp" + break; + + case 63: // stmt_case: "case" string ":" +#line 402 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < string_ptr > ())), std::make_unique(yylhs.location)); } +#line 2097 "parser.cpp" + break; + + case 64: // stmt_default: "default" ":" +#line 407 "parser.ypp" + { yylhs.value.as < stmt_default_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } +#line 2103 "parser.cpp" + break; + + case 65: // stmt_break: "break" ";" +#line 412 "parser.ypp" + { yylhs.value.as < stmt_break_ptr > () = std::make_unique(yylhs.location); } +#line 2109 "parser.cpp" + break; + + case 66: // stmt_continue: "continue" ";" +#line 417 "parser.ypp" + { yylhs.value.as < stmt_continue_ptr > () = std::make_unique(yylhs.location); } +#line 2115 "parser.cpp" + break; + + case 67: // stmt_return: "return" expr ";" +#line 422 "parser.ypp" + { yylhs.value.as < stmt_return_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2121 "parser.cpp" + break; + + case 68: // stmt_return: "return" ";" +#line 424 "parser.ypp" + { yylhs.value.as < stmt_return_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } +#line 2127 "parser.cpp" + break; + + case 69: // for_stmt: expr_assign +#line 428 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_list = std::make_unique(yylhs.location); yylhs.value.as < stmt_ptr > ().as_list->stmts.push_back(stmt_ptr(std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_assign_ptr > ())))); } +#line 2133 "parser.cpp" + break; + + case 70: // for_stmt: %empty +#line 429 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_node = std::make_unique(yylhs.location); } +#line 2139 "parser.cpp" + break; + + case 71: // for_expr: expr +#line 433 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2145 "parser.cpp" + break; + + case 72: // for_expr: %empty +#line 434 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location); } +#line 2151 "parser.cpp" + break; + + case 73: // expr: expr_compare +#line 438 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2157 "parser.cpp" + break; + + case 74: // expr: expr_binary +#line 439 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2163 "parser.cpp" + break; + + case 75: // expr: expr_primitive +#line 440 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2169 "parser.cpp" + break; + + case 76: // expr_assign: "++" object +#line 444 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < node_ptr > ())); } +#line 2175 "parser.cpp" + break; + + case 77: // expr_assign: "--" object +#line 445 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < node_ptr > ())); } +#line 2181 "parser.cpp" + break; + + case 78: // expr_assign: object "++" +#line 446 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < node_ptr > ())); } +#line 2187 "parser.cpp" + break; + + case 79: // expr_assign: object "--" +#line 447 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < node_ptr > ())); } +#line 2193 "parser.cpp" + break; + + case 80: // expr_assign: object "=" expr +#line 448 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2199 "parser.cpp" + break; + + case 81: // expr_assign: object "|=" expr +#line 449 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2205 "parser.cpp" + break; + + case 82: // expr_assign: object "&=" expr +#line 450 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2211 "parser.cpp" + break; + + case 83: // expr_assign: object "^=" expr +#line 451 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2217 "parser.cpp" + break; + + case 84: // expr_assign: object "<<=" expr +#line 452 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()),std::move( yystack_[0].value.as < expr_ptr > ())); } +#line 2223 "parser.cpp" + break; + + case 85: // expr_assign: object ">>=" expr +#line 453 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2229 "parser.cpp" + break; + + case 86: // expr_assign: object "+=" expr +#line 454 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2235 "parser.cpp" + break; + + case 87: // expr_assign: object "-=" expr +#line 455 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2241 "parser.cpp" + break; + + case 88: // expr_assign: object "*=" expr +#line 456 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2247 "parser.cpp" + break; + + case 89: // expr_assign: object "/=" expr +#line 457 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2253 "parser.cpp" + break; + + case 90: // expr_assign: object "%=" expr +#line 458 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2259 "parser.cpp" + break; + + case 91: // expr_compare: expr "||" expr +#line 462 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2265 "parser.cpp" + break; + + case 92: // expr_compare: expr "&&" expr +#line 463 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2271 "parser.cpp" + break; + + case 93: // expr_compare: expr "==" expr +#line 464 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2277 "parser.cpp" + break; + + case 94: // expr_compare: expr "!=" expr +#line 465 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2283 "parser.cpp" + break; + + case 95: // expr_compare: expr "<=" expr +#line 466 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2289 "parser.cpp" + break; + + case 96: // expr_compare: expr ">=" expr +#line 467 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2295 "parser.cpp" + break; + + case 97: // expr_compare: expr "<" expr +#line 468 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2301 "parser.cpp" + break; + + case 98: // expr_compare: expr ">" expr +#line 469 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2307 "parser.cpp" + break; + + case 99: // expr_binary: expr "|" expr +#line 473 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2313 "parser.cpp" + break; + + case 100: // expr_binary: expr "&" expr +#line 474 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2319 "parser.cpp" + break; + + case 101: // expr_binary: expr "^" expr +#line 475 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2325 "parser.cpp" + break; + + case 102: // expr_binary: expr "<<" expr +#line 476 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2331 "parser.cpp" + break; + + case 103: // expr_binary: expr ">>" expr +#line 477 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2337 "parser.cpp" + break; + + case 104: // expr_binary: expr "+" expr +#line 478 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2343 "parser.cpp" + break; + + case 105: // expr_binary: expr "-" expr +#line 479 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2349 "parser.cpp" + break; + + case 106: // expr_binary: expr "*" expr +#line 480 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2355 "parser.cpp" + break; + + case 107: // expr_binary: expr "/" expr +#line 481 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2361 "parser.cpp" + break; + + case 108: // expr_binary: expr "%" expr +#line 482 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2367 "parser.cpp" + break; + + case 109: // expr_primitive: "(" expr ")" +#line 486 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[1].value.as < expr_ptr > ()); } +#line 2373 "parser.cpp" + break; + + case 110: // expr_primitive: "~" expr +#line 487 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2379 "parser.cpp" + break; + + case 111: // expr_primitive: "!" expr +#line 488 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2385 "parser.cpp" + break; + + case 112: // expr_primitive: expr_call +#line 489 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2391 "parser.cpp" + break; + + case 113: // expr_primitive: expr_call_thread +#line 490 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2397 "parser.cpp" + break; + + case 114: // expr_primitive: expr_call_childthread +#line 491 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2403 "parser.cpp" + break; + + case 115: // expr_primitive: expr_function +#line 492 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2409 "parser.cpp" + break; + + case 116: // expr_primitive: expr_add_array +#line 493 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2415 "parser.cpp" + break; + + case 117: // expr_primitive: expr_array +#line 494 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2421 "parser.cpp" + break; + + case 118: // expr_primitive: expr_field +#line 495 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2427 "parser.cpp" + break; + + case 119: // expr_primitive: expr_size +#line 496 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2433 "parser.cpp" + break; + + case 120: // expr_primitive: thisthread +#line 497 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < thisthread_ptr > ()); } +#line 2439 "parser.cpp" + break; + + case 121: // expr_primitive: empty_array +#line 498 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < empty_array_ptr > ()); } +#line 2445 "parser.cpp" + break; + + case 122: // expr_primitive: undefined +#line 499 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < undefined_ptr > ()); } +#line 2451 "parser.cpp" + break; + + case 123: // expr_primitive: game +#line 500 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < game_ptr > ()); } +#line 2457 "parser.cpp" + break; + + case 124: // expr_primitive: self +#line 501 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < self_ptr > ()); } +#line 2463 "parser.cpp" + break; + + case 125: // expr_primitive: anim +#line 502 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < anim_ptr > ()); } +#line 2469 "parser.cpp" + break; + + case 126: // expr_primitive: level +#line 503 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < level_ptr > ()); } +#line 2475 "parser.cpp" + break; + + case 127: // expr_primitive: animation +#line 504 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < animation_ptr > ()); } +#line 2481 "parser.cpp" + break; + + case 128: // expr_primitive: animtree +#line 505 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < animtree_ptr > ()); } +#line 2487 "parser.cpp" + break; + + case 129: // expr_primitive: name +#line 506 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < name_ptr > ()); } +#line 2493 "parser.cpp" + break; + + case 130: // expr_primitive: istring +#line 507 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < istring_ptr > ()); } +#line 2499 "parser.cpp" + break; + + case 131: // expr_primitive: string +#line 508 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < string_ptr > ()); } +#line 2505 "parser.cpp" + break; + + case 132: // expr_primitive: vector +#line 509 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < vector_ptr > ()); } +#line 2511 "parser.cpp" + break; + + case 133: // expr_primitive: neg_float +#line 510 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < float_ptr > ()); } +#line 2517 "parser.cpp" + break; + + case 134: // expr_primitive: neg_integer +#line 511 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < integer_ptr > ()); } +#line 2523 "parser.cpp" + break; + + case 135: // expr_primitive: float +#line 512 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < float_ptr > ()); } +#line 2529 "parser.cpp" + break; + + case 136: // expr_primitive: integer +#line 513 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < integer_ptr > ()); } +#line 2535 "parser.cpp" + break; + + case 137: // expr_primitive: false +#line 514 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < false_ptr > ()); } +#line 2541 "parser.cpp" + break; + + case 138: // expr_primitive: true +#line 515 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < true_ptr > ()); } +#line 2547 "parser.cpp" + break; + + case 139: // expr_call: expr_call_function +#line 519 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2553 "parser.cpp" + break; + + case 140: // expr_call: expr_call_pointer +#line 520 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2559 "parser.cpp" + break; + + case 141: // expr_call: object expr_call_function +#line 521 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::move(yystack_[1].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2565 "parser.cpp" + break; + + case 142: // expr_call: object expr_call_pointer +#line 522 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::move(yystack_[1].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2571 "parser.cpp" + break; + + case 143: // expr_call_thread: "thread" expr_call_function +#line 526 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2577 "parser.cpp" + break; + + case 144: // expr_call_thread: "thread" expr_call_pointer +#line 527 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2583 "parser.cpp" + break; + + case 145: // expr_call_thread: object "thread" expr_call_function +#line 528 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2589 "parser.cpp" + break; + + case 146: // expr_call_thread: object "thread" expr_call_pointer +#line 529 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2595 "parser.cpp" + break; + + case 147: // expr_call_childthread: "childthread" expr_call_function +#line 533 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2601 "parser.cpp" + break; + + case 148: // expr_call_childthread: "childthread" expr_call_pointer +#line 534 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2607 "parser.cpp" + break; + + case 149: // expr_call_childthread: object "childthread" expr_call_function +#line 535 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2613 "parser.cpp" + break; + + case 150: // expr_call_childthread: object "childthread" expr_call_pointer +#line 536 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2619 "parser.cpp" + break; + + case 151: // expr_call_function: name "(" expr_arguments ")" +#line 541 "parser.ypp" + {yylhs.value.as < expr_call_type_ptr > ().as_func = std::make_unique(yylhs.location, std::make_unique(), std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2625 "parser.cpp" + break; + + case 152: // expr_call_function: file "::" name "(" expr_arguments ")" +#line 543 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_func = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < file_ptr > ()), std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2631 "parser.cpp" + break; + + case 153: // expr_call_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 548 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_pointer = std::make_unique(yylhs.location, false, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2637 "parser.cpp" + break; + + case 154: // expr_call_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 550 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_pointer = std::make_unique(yylhs.location, true, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2643 "parser.cpp" + break; + + case 155: // expr_arguments: expr_arguments_filled +#line 554 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[0].value.as < expr_arguments_ptr > ()); } +#line 2649 "parser.cpp" + break; + + case 156: // expr_arguments: expr_arguments_empty +#line 555 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[0].value.as < expr_arguments_ptr > ()); } +#line 2655 "parser.cpp" + break; + + case 157: // expr_arguments_filled: expr_arguments "," expr +#line 560 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[2].value.as < expr_arguments_ptr > ()); yylhs.value.as < expr_arguments_ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2661 "parser.cpp" + break; + + case 158: // expr_arguments_filled: expr +#line 562 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < expr_arguments_ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2667 "parser.cpp" + break; + + case 159: // expr_arguments_empty: %empty +#line 567 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::make_unique(yylhs.location); } +#line 2673 "parser.cpp" + break; + + case 160: // expr_function: "::" name +#line 572 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2679 "parser.cpp" + break; + + case 161: // expr_function: file "::" name +#line 574 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < file_ptr > ()), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2685 "parser.cpp" + break; + + case 162: // expr_add_array: "[" expr_arguments_filled "]" +#line 579 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2691 "parser.cpp" + break; + + case 163: // expr_array: object "[" expr "]" +#line 584 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < node_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2697 "parser.cpp" + break; + + case 164: // expr_field: object "." name +#line 589 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2703 "parser.cpp" + break; + + case 165: // expr_size: object "." "size" +#line 594 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ())); } +#line 2709 "parser.cpp" + break; + + case 166: // object: expr_call +#line 598 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2715 "parser.cpp" + break; + + case 167: // object: expr_array +#line 599 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2721 "parser.cpp" + break; + + case 168: // object: expr_field +#line 600 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2727 "parser.cpp" + break; + + case 169: // object: game +#line 601 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < game_ptr > ()); } +#line 2733 "parser.cpp" + break; + + case 170: // object: self +#line 602 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < self_ptr > ()); } +#line 2739 "parser.cpp" + break; + + case 171: // object: anim +#line 603 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < anim_ptr > ()); } +#line 2745 "parser.cpp" + break; + + case 172: // object: level +#line 604 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < level_ptr > ()); } +#line 2751 "parser.cpp" + break; + + case 173: // object: name +#line 605 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < name_ptr > ()); } +#line 2757 "parser.cpp" + break; + + case 174: // thisthread: "thisthread" +#line 608 "parser.ypp" + { yylhs.value.as < thisthread_ptr > () = std::make_unique(yylhs.location); } +#line 2763 "parser.cpp" + break; + + case 175: // empty_array: "[" "]" +#line 609 "parser.ypp" + { yylhs.value.as < empty_array_ptr > () = std::make_unique(yylhs.location); } +#line 2769 "parser.cpp" + break; + + case 176: // undefined: "undefined" +#line 610 "parser.ypp" + { yylhs.value.as < undefined_ptr > () = std::make_unique(yylhs.location); } +#line 2775 "parser.cpp" + break; + + case 177: // game: "game" +#line 611 "parser.ypp" + { yylhs.value.as < game_ptr > () = std::make_unique(yylhs.location); } +#line 2781 "parser.cpp" + break; + + case 178: // self: "self" +#line 612 "parser.ypp" + { yylhs.value.as < self_ptr > () = std::make_unique(yylhs.location); } +#line 2787 "parser.cpp" + break; + + case 179: // anim: "anim" +#line 613 "parser.ypp" + { yylhs.value.as < anim_ptr > () = std::make_unique(yylhs.location); } +#line 2793 "parser.cpp" + break; + + case 180: // level: "level" +#line 614 "parser.ypp" + { yylhs.value.as < level_ptr > () = std::make_unique(yylhs.location); } +#line 2799 "parser.cpp" + break; + + case 181: // animation: "%" "identifier" +#line 615 "parser.ypp" + { yylhs.value.as < animation_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2805 "parser.cpp" + break; + + case 182: // animtree: "#animtree" +#line 616 "parser.ypp" + { yylhs.value.as < animtree_ptr > () = std::make_unique(yylhs.location); } +#line 2811 "parser.cpp" + break; + + case 183: // name: "identifier" +#line 617 "parser.ypp" + { yylhs.value.as < name_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2817 "parser.cpp" + break; + + case 184: // file: "file path" +#line 618 "parser.ypp" + { yylhs.value.as < file_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2823 "parser.cpp" + break; + + case 185: // istring: "localized string" +#line 619 "parser.ypp" + { yylhs.value.as < istring_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2829 "parser.cpp" + break; + + case 186: // string: "string literal" +#line 620 "parser.ypp" + { yylhs.value.as < string_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2835 "parser.cpp" + break; + + case 187: // vector: "(" expr "," expr "," expr ")" +#line 621 "parser.ypp" + { yylhs.value.as < vector_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[3].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2841 "parser.cpp" + break; + + case 188: // neg_float: "-" "float" +#line 622 "parser.ypp" + { yylhs.value.as < float_ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 2847 "parser.cpp" + break; + + case 189: // neg_integer: "-" "int" +#line 623 "parser.ypp" + { yylhs.value.as < integer_ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 2853 "parser.cpp" + break; + + case 190: // float: "float" +#line 624 "parser.ypp" + { yylhs.value.as < float_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2859 "parser.cpp" + break; + + case 191: // integer: "int" +#line 625 "parser.ypp" + { yylhs.value.as < integer_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2865 "parser.cpp" + break; + + case 192: // false: "false" +#line 626 "parser.ypp" + { yylhs.value.as < false_ptr > () = std::make_unique(yylhs.location); } +#line 2871 "parser.cpp" + break; + + case 193: // true: "true" +#line 627 "parser.ypp" + { yylhs.value.as < true_ptr > () = std::make_unique(yylhs.location); } +#line 2877 "parser.cpp" + break; + + +#line 2881 "parser.cpp" + + default: + break; + } + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + YYERROR; + } +#endif // YY_EXCEPTIONS + YY_SYMBOL_PRINT ("-> $$ =", yylhs); + yypop_ (yylen); + yylen = 0; + + // Shift the result of the reduction. + yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); + } + goto yynewstate; + + + /*--------------------------------------. + | yyerrlab -- here on detecting error. | + `--------------------------------------*/ + yyerrlab: + // If not already recovering from an error, report this error. + if (!yyerrstatus_) + { + ++yynerrs_; + context yyctx (*this, yyla); + std::string msg = yysyntax_error_ (yyctx); + error (yyla.location, YY_MOVE (msg)); + } + + + yyerror_range[1].location = yyla.location; + if (yyerrstatus_ == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + // Return failure if at end of input. + if (yyla.kind () == symbol_kind::S_YYEOF) + YYABORT; + else if (!yyla.empty ()) + { + yy_destroy_ ("Error: discarding", yyla); + yyla.clear (); + } + } + + // Else will try to reuse lookahead token after shifting the error token. + goto yyerrlab1; + + + /*---------------------------------------------------. + | yyerrorlab -- error raised explicitly by YYERROR. | + `---------------------------------------------------*/ + yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and + the label yyerrorlab therefore never appears in user code. */ + if (false) + YYERROR; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + yypop_ (yylen); + yylen = 0; + YY_STACK_PRINT (); + goto yyerrlab1; + + + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ + yyerrlab1: + yyerrstatus_ = 3; // Each real token shifted decrements this. + // Pop stack until we find a state that shifts the error token. + for (;;) + { + yyn = yypact_[+yystack_[0].state]; + if (!yy_pact_value_is_default_ (yyn)) + { + yyn += symbol_kind::S_YYerror; + if (0 <= yyn && yyn <= yylast_ + && yycheck_[yyn] == symbol_kind::S_YYerror) + { + yyn = yytable_[yyn]; + if (0 < yyn) + break; + } + } + + // Pop the current state because it cannot handle the error token. + if (yystack_.size () == 1) + YYABORT; + + yyerror_range[1].location = yystack_[0].location; + yy_destroy_ ("Error: popping", yystack_[0]); + yypop_ (); + YY_STACK_PRINT (); + } + { + stack_symbol_type error_token; + + yyerror_range[2].location = yyla.location; + YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); + + // Shift the error token. + yy_lac_discard_ ("error recovery"); + error_token.state = state_type (yyn); + yypush_ ("Shifting", YY_MOVE (error_token)); + } + goto yynewstate; + + + /*-------------------------------------. + | yyacceptlab -- YYACCEPT comes here. | + `-------------------------------------*/ + yyacceptlab: + yyresult = 0; + goto yyreturn; + + + /*-----------------------------------. + | yyabortlab -- YYABORT comes here. | + `-----------------------------------*/ + yyabortlab: + yyresult = 1; + goto yyreturn; + + + /*-----------------------------------------------------. + | yyreturn -- parsing is finished, return the result. | + `-----------------------------------------------------*/ + yyreturn: + if (!yyla.empty ()) + yy_destroy_ ("Cleanup: discarding lookahead", yyla); + + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + yypop_ (yylen); + YY_STACK_PRINT (); + while (1 < yystack_.size ()) + { + yy_destroy_ ("Cleanup: popping", yystack_[0]); + yypop_ (); + } + + return yyresult; + } +#if YY_EXCEPTIONS + catch (...) + { + YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; + // Do not try to display the values of the reclaimed symbols, + // as their printers might throw an exception. + if (!yyla.empty ()) + yy_destroy_ (YY_NULLPTR, yyla); + + while (1 < yystack_.size ()) + { + yy_destroy_ (YY_NULLPTR, yystack_[0]); + yypop_ (); + } + throw; + } +#endif // YY_EXCEPTIONS + } + + void + parser::error (const syntax_error& yyexc) + { + error (yyexc.location, yyexc.what ()); + } + + const char * + parser::symbol_name (symbol_kind_type yysymbol) + { + static const char *const yy_sname[] = + { + "end of file", "error", "invalid token", "#include", "#using_animtree", + "#animtree", "endon", "notify", "wait", "waittill", "waittillmatch", + "waittillframeend", "if", "else", "while", "for", "foreach", "in", + "switch", "case", "default", "break", "continue", "return", "thread", + "childthread", "thisthread", "call", "true", "false", "undefined", + "size", "game", "self", "anim", "level", "(", ")", "{", "}", "[", "]", + ",", ".", "::", ":", ";", "++", "--", "<<", ">>", "||", "&&", "==", "!=", + "<=", ">=", "<", ">", "!", "~", "=", "+=", "-=", "*=", "/=", "%=", "|=", + "&=", "^=", ">>=", "<<=", "|", "&", "^", "+", "-", "*", "/", "%", + "file path", "identifier", "string literal", "localized string", "float", + "int", "ADD_ARRAY", "THEN", "NEG", "ANIMREF", "PREINC", "PREDEC", + "POSTINC", "POSTDEC", "$accept", "root", "program", "include", "define", + "usingtree", "constant", "thread", "parameters", "stmt", "stmt_block", + "stmt_list", "stmt_call", "stmt_assign", "stmt_endon", "stmt_notify", + "stmt_wait", "stmt_waittill", "stmt_waittillmatch", + "stmt_waittillframeend", "stmt_if", "stmt_ifelse", "stmt_while", + "stmt_for", "stmt_foreach", "stmt_switch", "stmt_case", "stmt_default", + "stmt_break", "stmt_continue", "stmt_return", "for_stmt", "for_expr", + "expr", "expr_assign", "expr_compare", "expr_binary", "expr_primitive", + "expr_call", "expr_call_thread", "expr_call_childthread", + "expr_call_function", "expr_call_pointer", "expr_arguments", + "expr_arguments_filled", "expr_arguments_empty", "expr_function", + "expr_add_array", "expr_array", "expr_field", "expr_size", "object", + "thisthread", "empty_array", "undefined", "game", "self", "anim", + "level", "animation", "animtree", "name", "file", "istring", "string", + "vector", "neg_float", "neg_integer", "float", "integer", "false", + "true", YY_NULLPTR + }; + return yy_sname[yysymbol]; + } + + + + // parser::context. + parser::context::context (const parser& yyparser, const symbol_type& yyla) + : yyparser_ (yyparser) + , yyla_ (yyla) + {} + + int + parser::context::expected_tokens (symbol_kind_type yyarg[], int yyargn) const + { + // Actual number of expected tokens + int yycount = 0; + +#if IW7DEBUG + // Execute LAC once. We don't care if it is successful, we + // only do it for the sake of debugging output. + if (!yyparser_.yy_lac_established_) + yyparser_.yy_lac_check_ (yyla_.kind ()); +#endif + + for (int yyx = 0; yyx < YYNTOKENS; ++yyx) + { + symbol_kind_type yysym = YY_CAST (symbol_kind_type, yyx); + if (yysym != symbol_kind::S_YYerror + && yysym != symbol_kind::S_YYUNDEF + && yyparser_.yy_lac_check_ (yysym)) + { + if (!yyarg) + ++yycount; + else if (yycount == yyargn) + return 0; + else + yyarg[yycount++] = yysym; + } + } + if (yyarg && yycount == 0 && 0 < yyargn) + yyarg[0] = symbol_kind::S_YYEMPTY; + return yycount; + } + + + bool + parser::yy_lac_check_ (symbol_kind_type yytoken) const + { + // Logically, the yylac_stack's lifetime is confined to this function. + // Clear it, to get rid of potential left-overs from previous call. + yylac_stack_.clear (); + // Reduce until we encounter a shift and thereby accept the token. +#if IW7DEBUG + YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; +#endif + std::ptrdiff_t lac_top = 0; + while (true) + { + state_type top_state = (yylac_stack_.empty () + ? yystack_[lac_top].state + : yylac_stack_.back ()); + int yyrule = yypact_[+top_state]; + if (yy_pact_value_is_default_ (yyrule) + || (yyrule += yytoken) < 0 || yylast_ < yyrule + || yycheck_[yyrule] != yytoken) + { + // Use the default action. + yyrule = yydefact_[+top_state]; + if (yyrule == 0) + { + YYCDEBUG << " Err\n"; + return false; + } + } + else + { + // Use the action from yytable. + yyrule = yytable_[yyrule]; + if (yy_table_value_is_error_ (yyrule)) + { + YYCDEBUG << " Err\n"; + return false; + } + if (0 < yyrule) + { + YYCDEBUG << " S" << yyrule << '\n'; + return true; + } + yyrule = -yyrule; + } + // By now we know we have to simulate a reduce. + YYCDEBUG << " R" << yyrule - 1; + // Pop the corresponding number of values from the stack. + { + std::ptrdiff_t yylen = yyr2_[yyrule]; + // First pop from the LAC stack as many tokens as possible. + std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); + if (yylen < lac_size) + { + yylac_stack_.resize (std::size_t (lac_size - yylen)); + yylen = 0; + } + else if (lac_size) + { + yylac_stack_.clear (); + yylen -= lac_size; + } + // Only afterwards look at the main stack. + // We simulate popping elements by incrementing lac_top. + lac_top += yylen; + } + // Keep top_state in sync with the updated stack. + top_state = (yylac_stack_.empty () + ? yystack_[lac_top].state + : yylac_stack_.back ()); + // Push the resulting state of the reduction. + state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); + YYCDEBUG << " G" << int (state); + yylac_stack_.push_back (state); + } + } + + // Establish the initial context if no initial context currently exists. + bool + parser::yy_lac_establish_ (symbol_kind_type yytoken) + { + /* Establish the initial context for the current lookahead if no initial + context is currently established. + + We define a context as a snapshot of the parser stacks. We define + the initial context for a lookahead as the context in which the + parser initially examines that lookahead in order to select a + syntactic action. Thus, if the lookahead eventually proves + syntactically unacceptable (possibly in a later context reached via a + series of reductions), the initial context can be used to determine + the exact set of tokens that would be syntactically acceptable in the + lookahead's place. Moreover, it is the context after which any + further semantic actions would be erroneous because they would be + determined by a syntactically unacceptable token. + + yy_lac_establish_ should be invoked when a reduction is about to be + performed in an inconsistent state (which, for the purposes of LAC, + includes consistent states that don't know they're consistent because + their default reductions have been disabled). + + For parse.lac=full, the implementation of yy_lac_establish_ is as + follows. If no initial context is currently established for the + current lookahead, then check if that lookahead can eventually be + shifted if syntactic actions continue from the current context. */ + if (!yy_lac_established_) + { +#if IW7DEBUG + YYCDEBUG << "LAC: initial context established for " + << symbol_name (yytoken) << '\n'; +#endif + yy_lac_established_ = true; + return yy_lac_check_ (yytoken); + } + return true; + } + + // Discard any previous initial lookahead context. + void + parser::yy_lac_discard_ (const char* evt) + { + /* Discard any previous initial lookahead context because of Event, + which may be a lookahead change or an invalidation of the currently + established initial context for the current lookahead. + + The most common example of a lookahead change is a shift. An example + of both cases is syntax error recovery. That is, a syntax error + occurs when the lookahead is syntactically erroneous for the + currently established initial context, so error recovery manipulates + the parser stacks to try to find a new initial context in which the + current lookahead is syntactically acceptable. If it fails to find + such a context, it discards the lookahead. */ + if (yy_lac_established_) + { + YYCDEBUG << "LAC: initial context discarded due to " + << evt << '\n'; + yy_lac_established_ = false; + } + } + + int + parser::yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const + { + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yyla) is + if this state is a consistent state with a default action. + Thus, detecting the absence of a lookahead is sufficient to + determine that there is no unexpected or expected token to + report. In that case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is + a consistent state with a default action. There might have + been a previous inconsistent state, consistent state with a + non-default action, or user semantic action that manipulated + yyla. (However, yyla is currently not documented for users.) + In the first two cases, it might appear that the current syntax + error should have been detected in the previous state when + yy_lac_check was invoked. However, at that time, there might + have been a different syntax error that discarded a different + initial context during error recovery, leaving behind the + current lookahead. + */ + + if (!yyctx.lookahead ().empty ()) + { + if (yyarg) + yyarg[0] = yyctx.token (); + int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); + return yyn + 1; + } + return 0; + } + + // Generate an error message. + std::string + parser::yysyntax_error_ (const context& yyctx) const + { + // Its maximum. + enum { YYARGS_MAX = 5 }; + // Arguments of yyformat. + symbol_kind_type yyarg[YYARGS_MAX]; + int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); + + char const* yyformat = YY_NULLPTR; + switch (yycount) + { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + default: // Avoid compiler warnings. + YYCASE_ (0, YY_("syntax error")); + YYCASE_ (1, YY_("syntax error, unexpected %s")); + YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +#undef YYCASE_ + } + + std::string yyres; + // Argument number. + std::ptrdiff_t yyi = 0; + for (char const* yyp = yyformat; *yyp; ++yyp) + if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) + { + yyres += symbol_name (yyarg[yyi++]); + ++yyp; + } + else + yyres += *yyp; + return yyres; + } + + + const short parser::yypact_ninf_ = -232; + + const short parser::yytable_ninf_ = -174; + + const short + parser::yypact_[] = + { + -2, -68, -15, -232, 42, -2, -232, -232, -232, -232, + -232, -23, -232, 7, -35, -232, -232, -232, -24, 663, + -232, -232, 23, -12, -232, -232, -3, -3, -232, 28, + -232, -232, -232, -232, -232, -232, -232, 663, 539, -24, + 663, 663, -76, -8, -232, -232, -232, 1372, -232, -232, + -232, 40, -232, -232, -232, -232, -232, -232, 251, 387, + -232, 407, -232, -232, -232, 416, 449, 474, 562, -232, + -232, 19, 25, -232, -232, -232, -232, -232, -232, -232, + -232, -232, 55, 78, -24, 63, -232, -232, 59, 75, + -232, -232, 83, 975, 539, -232, 1450, 87, 92, -232, + -232, -232, -232, -232, -232, -232, -232, 663, 663, 663, + 663, 663, 663, 663, 663, 663, 663, 663, 663, 663, + 663, 663, 663, 663, 663, -3, -3, 725, -9, -232, + -232, 663, -24, -232, 842, -232, -232, 663, -24, 663, + -232, 663, 659, 663, -232, 66, 66, 1460, 1008, 535, + 535, 322, 322, 322, 322, 1051, 1491, 1501, 10, 10, + -232, -232, -232, -232, -232, -232, -232, 1282, -232, -232, + 14, -232, 88, 663, 89, 100, 101, 110, 111, 114, + -62, 112, 113, 116, 601, -232, 121, 121, -232, -232, + 880, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + 117, 136, 139, -232, -232, 771, -232, -232, -232, -232, + 59, 659, 88, 1321, 1359, 119, 1450, -232, -232, 663, + 1406, -232, 663, 663, 1, -24, 663, 73, 143, 144, + 152, -232, -232, -232, -232, 1419, -232, 31, 31, -232, + -232, -232, -232, -232, 170, 171, 173, 174, -24, -232, + -232, 663, 663, 663, 663, 663, 663, 663, 663, 663, + 663, 663, 167, 663, 175, 33, -232, 1114, 1147, 166, + -232, 940, 12, 1157, -232, -232, -232, -232, 663, 663, + 663, 663, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, + 1450, 1450, 1450, 182, 1190, 663, -232, 918, 918, 663, + 663, -24, 78, 1200, 1018, 1061, 1104, 663, -232, 48, + 209, -232, 177, 1450, 1233, 207, -232, 181, 192, 663, + 194, 663, 199, 663, 49, -232, 918, 1, 918, 663, + -232, -232, 65, -232, 76, -232, 85, -232, -232, 191, + -232, 1243, 200, 204, 211, 918, 918, -232, -232, -232, + -232, -232 + }; + + const unsigned char + parser::yydefact_[] = + { + 3, 0, 0, 183, 0, 2, 6, 7, 9, 10, + 11, 0, 184, 0, 0, 1, 4, 5, 17, 0, + 8, 186, 0, 0, 16, 182, 0, 0, 174, 0, + 193, 192, 176, 177, 178, 179, 180, 0, 159, 0, + 0, 0, 0, 0, 185, 190, 191, 0, 73, 74, + 75, 112, 113, 114, 139, 140, 115, 116, 117, 118, + 119, 0, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 0, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 0, 0, 0, 0, 143, 144, 0, 0, + 147, 148, 0, 0, 159, 175, 158, 0, 155, 156, + 160, 111, 110, 188, 189, 181, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, + 142, 159, 0, 12, 0, 14, 15, 0, 0, 0, + 109, 0, 158, 0, 162, 102, 103, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 104, 105, + 106, 107, 108, 145, 146, 149, 150, 0, 165, 164, + 0, 155, 161, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 39, 0, 0, 41, 18, + 0, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 0, 166, 0, 167, 168, 0, 169, 170, 171, 172, + 173, 0, 0, 0, 0, 0, 157, 163, 151, 159, + 0, 53, 0, 0, 70, 0, 0, 0, 0, 0, + 0, 64, 65, 66, 68, 0, 166, 76, 77, 38, + 40, 44, 42, 43, 0, 0, 0, 0, 0, 78, + 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 48, 0, 0, 0, + 69, 0, 0, 0, 63, 62, 61, 67, 0, 0, + 0, 0, 80, 86, 87, 88, 89, 90, 81, 82, + 83, 85, 84, 0, 0, 159, 152, 0, 0, 72, + 0, 0, 0, 0, 0, 0, 0, 159, 187, 0, + 54, 56, 0, 71, 0, 0, 60, 0, 0, 159, + 0, 159, 0, 159, 0, 153, 0, 70, 0, 0, + 45, 47, 0, 50, 0, 52, 0, 154, 55, 0, + 58, 0, 0, 0, 0, 0, 0, 46, 49, 51, + 57, 59 + }; + + const short + parser::yypgoto_[] = + { + -232, -232, -232, 224, 246, -232, -232, -232, -232, -41, + -79, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -232, -232, -232, -232, -232, -232, -232, -232, -232, + -232, -77, -232, 57, -231, -232, -232, -232, -94, 69, + -232, -16, -11, -112, -31, -232, -232, -232, -82, 82, + -232, 115, -232, -232, -232, 172, 183, 195, 205, -232, + -232, 0, 5, -232, 3, -232, -232, 84, -232, 91, + -232, -232 + }; + + const short + parser::yydefgoto_[] = + { + 0, 4, 5, 6, 7, 8, 9, 10, 23, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 279, 322, 96, 210, 48, 49, 50, 51, 52, + 53, 54, 55, 97, 171, 99, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81 + }; + + const short + parser::yytable_[] = + { + 11, 1, 2, 280, 135, 11, 13, 98, 103, 104, + 86, 90, 12, 18, 237, 87, 91, 22, 24, 170, + 21, 14, 168, 46, 29, 83, 88, 88, 29, 310, + 84, 89, 89, 33, 34, 35, 36, 85, 19, 100, + 211, 85, 15, -173, -173, 129, -173, 21, 186, 187, + 130, 228, 213, 20, 311, 131, 143, 3, 29, -173, + 82, 88, -173, 98, -166, -166, 89, -166, 92, 132, + 306, 127, 3, 105, 258, 143, 47, 12, 3, 3, + -166, 12, 3, -166, 136, 335, 347, 122, 123, 124, + 143, 143, 246, 246, 93, 131, 211, 101, 102, -173, + -173, 133, 352, 137, 213, 213, 280, 143, 213, 163, + 165, 12, 3, 353, 164, 166, 134, 275, 143, 138, + -166, -166, 354, 139, 229, 88, 88, 143, 169, 143, + 89, 89, 172, 144, 220, 231, 232, 233, 222, 89, + 246, 120, 121, 122, 123, 124, 234, 235, 29, 250, + 236, 142, 213, 33, 34, 35, 36, 241, 104, 242, + 274, 85, 243, 251, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 252, 238, 167, 253, 220, 220, 284, 285, + 220, 89, 89, 319, 221, 89, 223, 286, 224, 129, + 226, 12, 3, 212, 130, 334, 288, 289, 303, 290, + 291, 305, 309, 211, 211, 88, 214, 342, 317, 344, + 89, 346, 336, 337, 339, 213, 213, 340, 355, 16, + 230, 129, 129, 326, 220, 282, 130, 130, 341, 89, + 343, 245, 211, 246, 211, 345, 357, 88, 88, 215, + 358, 17, 89, 89, 213, 213, 213, 359, 169, 212, + 349, 211, 211, 0, 239, 129, 320, 321, 214, 214, + 130, 240, 214, 213, 213, -167, -167, 0, -167, 0, + 0, 88, 0, 0, 0, 0, 89, 0, 0, 277, + 278, -167, 0, 283, -167, 348, 0, 350, 0, 0, + 0, 247, 248, 0, 0, 215, 216, 220, 220, 0, + 0, 325, 89, 89, 360, 361, 214, 217, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 218, + 304, -167, -167, 0, 0, 0, 220, 220, 220, 219, + 0, 89, 89, 89, 0, 313, 314, 315, 316, 281, + 0, 0, 0, 0, 0, 220, 220, 0, 216, 216, + 89, 89, 216, 0, 0, 0, 323, 324, 0, 217, + 217, 107, 108, 217, 0, 0, 212, 212, 0, 0, + 0, 218, 218, 0, 0, 218, 0, 0, 0, 214, + 214, 219, 219, 0, 0, 219, 351, 120, 121, 122, + 123, 124, 0, 0, 0, 212, 216, 212, 0, 0, + 0, -168, -168, 0, -168, 0, 0, 217, 214, 214, + 214, 0, 215, 215, 212, 212, 0, -168, 0, 218, + -168, 125, 126, 0, 29, 0, 0, 214, 214, 219, + -169, -169, 0, -169, 0, 0, 0, 127, 0, 0, + 128, 215, 281, 215, 0, 0, -169, 0, 0, -169, + 0, 0, 0, 0, 0, 0, 0, -168, -168, 0, + 215, 215, 0, -170, -170, 0, -170, 0, 0, 216, + 216, 0, 0, 0, 0, 0, 0, 12, 3, -170, + 217, 217, -170, 0, 0, 0, -169, -169, -171, -171, + 0, -171, 218, 218, 0, 0, 0, 0, 216, 216, + 216, 0, 219, 219, -171, 0, 0, -171, 0, 217, + 217, 217, 0, 0, 0, 0, 0, 216, 216, -170, + -170, 218, 218, 218, 0, 0, 0, 0, 217, 217, + 0, 219, 219, 219, 25, 0, 0, 0, 0, 0, + 218, 218, 0, 0, -171, -171, 0, 0, 0, 0, + 219, 219, 0, 26, 27, 28, 29, 30, 31, 32, + 0, 33, 34, 35, 36, 37, 0, 0, 0, 94, + 95, 0, 0, 39, 107, 108, -172, -172, 0, -172, + 113, 114, 115, 116, 0, 0, 0, 0, 40, 41, + 0, 0, -172, 0, 0, -172, 25, 0, 0, 0, + 120, 121, 122, 123, 124, 42, 0, 0, 43, 12, + 3, 21, 44, 45, 46, 26, 27, 28, 29, 30, + 31, 32, 0, 33, 34, 35, 36, 37, 0, 0, + 0, 38, -172, -172, 0, 39, 0, 244, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 40, 41, 0, 0, 0, 0, 0, 0, 25, 0, + 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, + 43, 12, 3, 21, 44, 45, 46, 26, 27, 28, + 29, 30, 31, 32, 0, 33, 34, 35, 36, 37, + 225, 0, 0, 38, 0, 0, 0, 39, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 0, 0, + 0, 0, 40, 41, 0, 0, 0, 0, 0, 0, + 25, 117, 118, 119, 120, 121, 122, 123, 124, 42, + 0, 0, 43, 12, 3, 21, 44, 45, 46, 26, + 27, 28, 29, 30, 31, 32, 0, 33, 34, 35, + 36, 37, 0, 0, 0, 94, 0, 0, 0, 39, + 0, 0, 0, 0, 0, 0, 0, 254, 255, 0, + 256, 257, 0, 0, 40, 41, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 125, 0, 0, 29, 0, + 0, 42, 0, 0, 43, 12, 3, 21, 44, 45, + 46, 127, 0, 0, 258, 0, 0, 0, 259, 260, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 0, 0, 0, 0, 0, 0, 0, + 173, 12, 3, 174, 175, 0, 176, 177, 178, 0, + 179, 180, 181, 182, 183, 184, 26, 0, 0, 29, + 0, 0, 0, 0, 33, 34, 35, 36, 0, 0, + 134, 185, 85, 0, 0, 0, 0, 0, 173, 186, + 187, 174, 175, 0, 176, 177, 178, 0, 179, 180, + 181, 182, 183, 184, 26, 0, 0, 29, 0, 0, + 0, 0, 33, 34, 35, 36, 0, 0, 134, 249, + 85, 0, 12, 3, 0, 0, 173, 186, 187, 174, + 175, 0, 176, 177, 178, 0, 179, 180, 181, 182, + 183, 184, 26, 0, 0, 29, 0, 0, 0, 0, + 33, 34, 35, 36, 0, 0, 134, 0, 85, 0, + 12, 3, 0, 0, 0, 186, 187, 29, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 127, 0, 0, 258, 0, 0, 0, 259, 260, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 12, 3, + 0, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 140, 0, 0, 0, 0, 141, 0, 0, + 12, 3, 0, 0, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 117, 118, 119, + 120, 121, 122, 123, 124, 328, 0, 107, 108, 0, + 329, 111, 112, 113, 114, 115, 116, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 0, 0, 0, + 117, 118, 119, 120, 121, 122, 123, 124, 0, 0, + 117, 118, 119, 120, 121, 122, 123, 124, 330, 0, + 107, 108, 0, 331, 111, 112, 113, 114, 115, 116, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 0, 0, 0, 0, 118, 119, 120, 121, 122, 123, + 124, 0, 0, 117, 118, 119, 120, 121, 122, 123, + 124, 332, 0, 0, 0, 0, 333, 0, 0, 0, + 0, 307, 0, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 0, 0, 0, 117, 118, 119, 120, + 121, 122, 123, 124, 308, 0, 117, 118, 119, 120, + 121, 122, 123, 124, 312, 0, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 0, 0, 0, 117, + 118, 119, 120, 121, 122, 123, 124, 318, 0, 117, + 118, 119, 120, 121, 122, 123, 124, 327, 0, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 0, + 0, 0, 117, 118, 119, 120, 121, 122, 123, 124, + 338, 0, 117, 118, 119, 120, 121, 122, 123, 124, + 356, 0, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 0, 0, 0, 117, 118, 119, 120, 121, + 122, 123, 124, 0, 0, 117, 118, 119, 120, 121, + 122, 123, 124, 227, 0, 0, 0, 0, 0, 0, + 0, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 117, 118, 119, 120, 121, 122, + 123, 124, 272, 0, 0, 0, 0, 0, 0, 0, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, + 124, 273, 0, 0, 0, 0, 0, 0, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 106, 0, + 0, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 0, + 0, 0, 0, 0, 117, 118, 119, 120, 121, 122, + 123, 124, 276, 0, 0, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 287, 0, 0, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 0, 0, 0, 0, + 0, 117, 118, 119, 120, 121, 122, 123, 124, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 107, + 108, 0, 110, 111, 112, 113, 114, 115, 116, 0, + 0, 0, 117, 118, 119, 120, 121, 122, 123, 124, + 0, 0, 117, 118, 119, 120, 121, 122, 123, 124, + 107, 108, 0, 0, 111, 112, 113, 114, 115, 116, + 107, 108, 0, 0, 111, 112, 113, 114, 115, 116, + 0, 0, 0, 0, 0, 119, 120, 121, 122, 123, + 124, 0, 0, 0, 0, 0, 120, 121, 122, 123, + 124 + }; + + const short + parser::yycheck_[] = + { + 0, 3, 4, 234, 83, 5, 1, 38, 84, 85, + 26, 27, 80, 36, 76, 26, 27, 14, 18, 131, + 82, 36, 31, 85, 27, 37, 26, 27, 27, 17, + 42, 26, 27, 32, 33, 34, 35, 40, 61, 39, + 134, 40, 0, 24, 25, 61, 27, 82, 47, 48, + 61, 37, 134, 46, 42, 36, 42, 81, 27, 40, + 37, 61, 43, 94, 24, 25, 61, 27, 40, 44, + 37, 40, 81, 81, 43, 42, 19, 80, 81, 81, + 40, 80, 81, 43, 84, 37, 37, 77, 78, 79, + 42, 42, 186, 187, 37, 36, 190, 40, 41, 80, + 81, 46, 37, 40, 186, 187, 337, 42, 190, 125, + 126, 80, 81, 37, 125, 126, 38, 229, 42, 44, + 80, 81, 37, 40, 36, 125, 126, 42, 128, 42, + 125, 126, 132, 41, 134, 46, 36, 36, 138, 134, + 234, 75, 76, 77, 78, 79, 36, 36, 27, 190, + 36, 94, 234, 32, 33, 34, 35, 45, 85, 46, + 41, 40, 46, 46, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 46, 180, 127, 46, 186, 187, 45, 45, + 190, 186, 187, 305, 137, 190, 139, 45, 141, 215, + 143, 80, 81, 134, 215, 317, 36, 36, 41, 36, + 36, 36, 46, 307, 308, 215, 134, 329, 36, 331, + 215, 333, 13, 46, 17, 307, 308, 46, 37, 5, + 173, 247, 248, 312, 234, 235, 247, 248, 46, 234, + 46, 184, 336, 337, 338, 46, 46, 247, 248, 134, + 46, 5, 247, 248, 336, 337, 338, 46, 258, 190, + 337, 355, 356, -1, 180, 281, 307, 308, 186, 187, + 281, 180, 190, 355, 356, 24, 25, -1, 27, -1, + -1, 281, -1, -1, -1, -1, 281, -1, -1, 232, + 233, 40, -1, 236, 43, 336, -1, 338, -1, -1, + -1, 186, 187, -1, -1, 190, 134, 307, 308, -1, + -1, 311, 307, 308, 355, 356, 234, 134, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 134, + 273, 80, 81, -1, -1, -1, 336, 337, 338, 134, + -1, 336, 337, 338, -1, 288, 289, 290, 291, 234, + -1, -1, -1, -1, -1, 355, 356, -1, 186, 187, + 355, 356, 190, -1, -1, -1, 309, 310, -1, 186, + 187, 49, 50, 190, -1, -1, 307, 308, -1, -1, + -1, 186, 187, -1, -1, 190, -1, -1, -1, 307, + 308, 186, 187, -1, -1, 190, 339, 75, 76, 77, + 78, 79, -1, -1, -1, 336, 234, 338, -1, -1, + -1, 24, 25, -1, 27, -1, -1, 234, 336, 337, + 338, -1, 307, 308, 355, 356, -1, 40, -1, 234, + 43, 24, 25, -1, 27, -1, -1, 355, 356, 234, + 24, 25, -1, 27, -1, -1, -1, 40, -1, -1, + 43, 336, 337, 338, -1, -1, 40, -1, -1, 43, + -1, -1, -1, -1, -1, -1, -1, 80, 81, -1, + 355, 356, -1, 24, 25, -1, 27, -1, -1, 307, + 308, -1, -1, -1, -1, -1, -1, 80, 81, 40, + 307, 308, 43, -1, -1, -1, 80, 81, 24, 25, + -1, 27, 307, 308, -1, -1, -1, -1, 336, 337, + 338, -1, 307, 308, 40, -1, -1, 43, -1, 336, + 337, 338, -1, -1, -1, -1, -1, 355, 356, 80, + 81, 336, 337, 338, -1, -1, -1, -1, 355, 356, + -1, 336, 337, 338, 5, -1, -1, -1, -1, -1, + 355, 356, -1, -1, 80, 81, -1, -1, -1, -1, + 355, 356, -1, 24, 25, 26, 27, 28, 29, 30, + -1, 32, 33, 34, 35, 36, -1, -1, -1, 40, + 41, -1, -1, 44, 49, 50, 24, 25, -1, 27, + 55, 56, 57, 58, -1, -1, -1, -1, 59, 60, + -1, -1, 40, -1, -1, 43, 5, -1, -1, -1, + 75, 76, 77, 78, 79, 76, -1, -1, 79, 80, + 81, 82, 83, 84, 85, 24, 25, 26, 27, 28, + 29, 30, -1, 32, 33, 34, 35, 36, -1, -1, + -1, 40, 80, 81, -1, 44, -1, 46, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 59, 60, -1, -1, -1, -1, -1, -1, 5, -1, + -1, -1, -1, -1, -1, -1, -1, 76, -1, -1, + 79, 80, 81, 82, 83, 84, 85, 24, 25, 26, + 27, 28, 29, 30, -1, 32, 33, 34, 35, 36, + 41, -1, -1, 40, -1, -1, -1, 44, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, -1, -1, + -1, -1, 59, 60, -1, -1, -1, -1, -1, -1, + 5, 72, 73, 74, 75, 76, 77, 78, 79, 76, + -1, -1, 79, 80, 81, 82, 83, 84, 85, 24, + 25, 26, 27, 28, 29, 30, -1, 32, 33, 34, + 35, 36, -1, -1, -1, 40, -1, -1, -1, 44, + -1, -1, -1, -1, -1, -1, -1, 6, 7, -1, + 9, 10, -1, -1, 59, 60, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 24, -1, -1, 27, -1, + -1, 76, -1, -1, 79, 80, 81, 82, 83, 84, + 85, 40, -1, -1, 43, -1, -1, -1, 47, 48, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, -1, -1, -1, -1, -1, -1, -1, + 8, 80, 81, 11, 12, -1, 14, 15, 16, -1, + 18, 19, 20, 21, 22, 23, 24, -1, -1, 27, + -1, -1, -1, -1, 32, 33, 34, 35, -1, -1, + 38, 39, 40, -1, -1, -1, -1, -1, 8, 47, + 48, 11, 12, -1, 14, 15, 16, -1, 18, 19, + 20, 21, 22, 23, 24, -1, -1, 27, -1, -1, + -1, -1, 32, 33, 34, 35, -1, -1, 38, 39, + 40, -1, 80, 81, -1, -1, 8, 47, 48, 11, + 12, -1, 14, 15, 16, -1, 18, 19, 20, 21, + 22, 23, 24, -1, -1, 27, -1, -1, -1, -1, + 32, 33, 34, 35, -1, -1, 38, -1, 40, -1, + 80, 81, -1, -1, -1, 47, 48, 27, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 40, -1, -1, 43, -1, -1, -1, 47, 48, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 80, 81, + -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 37, -1, -1, -1, -1, 42, -1, -1, + 80, 81, -1, -1, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 72, 73, 74, + 75, 76, 77, 78, 79, 37, -1, 49, 50, -1, + 42, 53, 54, 55, 56, 57, 58, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, -1, -1, -1, + 72, 73, 74, 75, 76, 77, 78, 79, -1, -1, + 72, 73, 74, 75, 76, 77, 78, 79, 37, -1, + 49, 50, -1, 42, 53, 54, 55, 56, 57, 58, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + -1, -1, -1, -1, 73, 74, 75, 76, 77, 78, + 79, -1, -1, 72, 73, 74, 75, 76, 77, 78, + 79, 37, -1, -1, -1, -1, 42, -1, -1, -1, + -1, 37, -1, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, -1, -1, -1, 72, 73, 74, 75, + 76, 77, 78, 79, 37, -1, 72, 73, 74, 75, + 76, 77, 78, 79, 37, -1, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, -1, -1, -1, 72, + 73, 74, 75, 76, 77, 78, 79, 37, -1, 72, + 73, 74, 75, 76, 77, 78, 79, 37, -1, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, -1, + -1, -1, 72, 73, 74, 75, 76, 77, 78, 79, + 37, -1, 72, 73, 74, 75, 76, 77, 78, 79, + 37, -1, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, -1, -1, -1, 72, 73, 74, 75, 76, + 77, 78, 79, -1, -1, 72, 73, 74, 75, 76, + 77, 78, 79, 41, -1, -1, -1, -1, -1, -1, + -1, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 72, 73, 74, 75, 76, 77, + 78, 79, 41, -1, -1, -1, -1, -1, -1, -1, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 72, 73, 74, 75, 76, 77, 78, + 79, 42, -1, -1, -1, -1, -1, -1, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 46, -1, + -1, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 72, 73, 74, 75, 76, 77, 78, 79, -1, + -1, -1, -1, -1, 72, 73, 74, 75, 76, 77, + 78, 79, 46, -1, -1, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 46, -1, -1, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 72, 73, + 74, 75, 76, 77, 78, 79, -1, -1, -1, -1, + -1, 72, 73, 74, 75, 76, 77, 78, 79, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 49, + 50, -1, 52, 53, 54, 55, 56, 57, 58, -1, + -1, -1, 72, 73, 74, 75, 76, 77, 78, 79, + -1, -1, 72, 73, 74, 75, 76, 77, 78, 79, + 49, 50, -1, -1, 53, 54, 55, 56, 57, 58, + 49, 50, -1, -1, 53, 54, 55, 56, 57, 58, + -1, -1, -1, -1, -1, 74, 75, 76, 77, 78, + 79, -1, -1, -1, -1, -1, 75, 76, 77, 78, + 79 + }; + + const unsigned char + parser::yystos_[] = + { + 0, 3, 4, 81, 95, 96, 97, 98, 99, 100, + 101, 155, 80, 156, 36, 0, 97, 98, 36, 61, + 46, 82, 158, 102, 155, 5, 24, 25, 26, 27, + 28, 29, 30, 32, 33, 34, 35, 36, 40, 44, + 59, 60, 76, 79, 83, 84, 85, 127, 129, 130, + 131, 132, 133, 134, 135, 136, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 37, 37, 42, 40, 135, 136, 155, 156, + 135, 136, 40, 127, 40, 41, 127, 137, 138, 139, + 155, 127, 127, 84, 85, 81, 46, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 72, 73, 74, + 75, 76, 77, 78, 79, 24, 25, 40, 43, 135, + 136, 36, 44, 46, 38, 104, 155, 40, 44, 40, + 37, 42, 127, 42, 41, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 135, 136, 135, 136, 127, 31, 155, + 137, 138, 155, 8, 11, 12, 14, 15, 16, 18, + 19, 20, 21, 22, 23, 39, 47, 48, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 128, 132, 133, 142, 143, 145, 149, 150, 151, 152, + 155, 127, 155, 127, 127, 41, 127, 41, 37, 36, + 127, 46, 36, 36, 36, 36, 36, 76, 158, 161, + 163, 45, 46, 46, 46, 127, 132, 145, 145, 39, + 103, 46, 46, 46, 6, 7, 9, 10, 43, 47, + 48, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 41, 42, 41, 137, 46, 127, 127, 125, + 128, 145, 155, 127, 45, 45, 45, 46, 36, 36, + 36, 36, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 41, 127, 36, 37, 37, 37, 46, + 17, 42, 37, 127, 127, 127, 127, 36, 37, 137, + 103, 103, 126, 127, 127, 155, 104, 37, 37, 42, + 37, 42, 37, 42, 137, 37, 13, 46, 37, 17, + 46, 46, 137, 46, 137, 46, 137, 37, 103, 125, + 103, 127, 37, 37, 37, 37, 37, 46, 46, 46, + 103, 103 + }; + + const unsigned char + parser::yyr1_[] = + { + 0, 94, 95, 95, 96, 96, 96, 96, 97, 98, + 98, 98, 99, 100, 101, 102, 102, 102, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 104, 104, + 105, 105, 106, 106, 107, 108, 109, 109, 110, 111, + 111, 112, 112, 113, 114, 115, 116, 117, 118, 118, + 119, 120, 120, 120, 121, 122, 123, 124, 124, 125, + 125, 126, 126, 127, 127, 127, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 129, 129, 129, 129, 129, 129, 129, 129, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 132, + 132, 132, 132, 133, 133, 133, 133, 134, 134, 134, + 134, 135, 135, 136, 136, 137, 137, 138, 138, 139, + 140, 140, 141, 142, 143, 144, 145, 145, 145, 145, + 145, 145, 145, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165 + }; + + const signed char + parser::yyr2_[] = + { + 0, 2, 1, 0, 2, 2, 1, 1, 3, 1, + 1, 1, 5, 4, 5, 3, 1, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, + 2, 1, 2, 2, 2, 6, 8, 6, 3, 8, + 6, 8, 6, 2, 5, 7, 5, 9, 7, 9, + 5, 3, 3, 3, 2, 2, 2, 3, 2, 1, + 0, 1, 0, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 2, 2, 2, 3, 3, 2, 2, 3, + 3, 4, 6, 8, 9, 1, 1, 3, 1, 0, + 2, 3, 3, 4, 3, 3, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, + 1, 2, 1, 1, 1, 1, 1, 7, 2, 2, + 1, 1, 1, 1 + }; + + + + +#if IW7DEBUG + const short + parser::yyrline_[] = + { + 0, 231, 231, 232, 236, 238, 240, 242, 247, 252, + 253, 254, 258, 263, 268, 273, 275, 278, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 305, 306, + 310, 312, 317, 319, 324, 329, 334, 336, 341, 346, + 348, 353, 355, 360, 365, 370, 375, 380, 385, 387, + 392, 397, 399, 401, 406, 411, 416, 421, 423, 428, + 429, 433, 434, 438, 439, 440, 444, 445, 446, 447, + 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 462, 463, 464, 465, 466, 467, 468, 469, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 519, + 520, 521, 522, 526, 527, 528, 529, 533, 534, 535, + 536, 540, 542, 547, 549, 554, 555, 559, 561, 567, + 571, 573, 578, 583, 588, 593, 598, 599, 600, 601, + 602, 603, 604, 605, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627 + }; + + void + parser::yy_stack_print_ () const + { + *yycdebug_ << "Stack now"; + for (stack_type::const_iterator + i = yystack_.begin (), + i_end = yystack_.end (); + i != i_end; ++i) + *yycdebug_ << ' ' << int (i->state); + *yycdebug_ << '\n'; + } + + void + parser::yy_reduce_print_ (int yyrule) const + { + int yylno = yyrline_[yyrule]; + int yynrhs = yyr2_[yyrule]; + // Print the symbols being reduced, and their result. + *yycdebug_ << "Reducing stack by rule " << yyrule - 1 + << " (line " << yylno << "):\n"; + // The symbols being reduced. + for (int yyi = 0; yyi < yynrhs; yyi++) + YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", + yystack_[(yynrhs) - (yyi + 1)]); + } +#endif // IW7DEBUG + + +#line 13 "parser.ypp" +} } } // xsk::gsc::iw7 +#line 3949 "parser.cpp" + +#line 629 "parser.ypp" + + +void xsk::gsc::iw7::parser::error(const xsk::gsc::location& loc, const std::string& msg) +{ + throw xsk::gsc::comp_error(loc, msg); +} diff --git a/src/iw7/xsk/parser.hpp b/src/iw7/xsk/parser.hpp new file mode 100644 index 00000000..36197adc --- /dev/null +++ b/src/iw7/xsk/parser.hpp @@ -0,0 +1,4717 @@ +// A Bison parser, made by GNU Bison 3.7.5. + +// Skeleton interface for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. + +// 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 . + +// As a special exception, you may create a larger work that contains +// part or all of the Bison parser skeleton and distribute that work +// under terms of your choice, so long as that work isn't itself a +// parser generator using the skeleton or a modified version thereof +// as a parser skeleton. Alternatively, if you modify or redistribute +// the parser skeleton itself, you may (at your option) remove this +// special exception, which will cause the skeleton and the resulting +// Bison output files to be licensed under the GNU General Public +// License without this special exception. + +// This special exception was added by the Free Software Foundation in +// version 2.2 of Bison. + + +/** + ** \file parser.hpp + ** Define the xsk::gsc::iw7::parser class. + */ + +// C++ LALR(1) parser skeleton written by Akim Demaille. + +// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, +// especially those whose name start with YY_ or yy_. They are +// private implementation details that can be changed or removed. + +#ifndef YY_IW7_PARSER_HPP_INCLUDED +# define YY_IW7_PARSER_HPP_INCLUDED +// "%code requires" blocks. +#line 33 "parser.ypp" + +#include "iw7.hpp" +typedef void *yyscan_t; +#define YY_DECL xsk::gsc::iw7::parser::symbol_type IW7lex(yyscan_t yyscanner, xsk::gsc::location& loc) + +#line 55 "parser.hpp" + +# include +# include // std::abort +# include +# include +# include +# include + +#if defined __cplusplus +# define YY_CPLUSPLUS __cplusplus +#else +# define YY_CPLUSPLUS 199711L +#endif + +// Support move semantics when possible. +#if 201103L <= YY_CPLUSPLUS +# define YY_MOVE std::move +# define YY_MOVE_OR_COPY move +# define YY_MOVE_REF(Type) Type&& +# define YY_RVREF(Type) Type&& +# define YY_COPY(Type) Type +#else +# define YY_MOVE +# define YY_MOVE_OR_COPY copy +# define YY_MOVE_REF(Type) Type& +# define YY_RVREF(Type) const Type& +# define YY_COPY(Type) const Type& +#endif + +// Support noexcept when possible. +#if 201103L <= YY_CPLUSPLUS +# define YY_NOEXCEPT noexcept +# define YY_NOTHROW +#else +# define YY_NOEXCEPT +# define YY_NOTHROW throw () +#endif + +// Support constexpr when possible. +#if 201703 <= YY_CPLUSPLUS +# define YY_CONSTEXPR constexpr +#else +# define YY_CONSTEXPR +#endif + +#include +#ifndef IW7_ASSERT +# include +# define IW7_ASSERT assert +#endif + + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YY_USE(E) ((void) (E)) +#else +# define YY_USE(E) /* empty */ +#endif + +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +/* Debug traces. */ +#ifndef IW7DEBUG +# if defined YYDEBUG +#if YYDEBUG +# define IW7DEBUG 1 +# else +# define IW7DEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define IW7DEBUG 1 +# endif /* ! defined YYDEBUG */ +#endif /* ! defined IW7DEBUG */ + +#line 13 "parser.ypp" +namespace xsk { namespace gsc { namespace iw7 { +#line 198 "parser.hpp" + + + + + /// A Bison parser. + class parser + { + public: +#ifndef IW7STYPE + /// A buffer to store and retrieve objects. + /// + /// Sort of a variant, but does not keep track of the nature + /// of the stored data, since that knowledge is available + /// via the current parser state. + class semantic_type + { + public: + /// Type of *this. + typedef semantic_type self_type; + + /// Empty construction. + semantic_type () YY_NOEXCEPT + : yybuffer_ () + , yytypeid_ (YY_NULLPTR) + {} + + /// Construct and fill. + template + semantic_type (YY_RVREF (T) t) + : yytypeid_ (&typeid (T)) + { + IW7_ASSERT (sizeof (T) <= size); + new (yyas_ ()) T (YY_MOVE (t)); + } + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + semantic_type (const self_type&) = delete; + /// Non copyable. + self_type& operator= (const self_type&) = delete; +#endif + + /// Destruction, allowed only if empty. + ~semantic_type () YY_NOEXCEPT + { + IW7_ASSERT (!yytypeid_); + } + +# if 201103L <= YY_CPLUSPLUS + /// Instantiate a \a T in here from \a t. + template + T& + emplace (U&&... u) + { + IW7_ASSERT (!yytypeid_); + IW7_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (std::forward (u)...); + } +# else + /// Instantiate an empty \a T in here. + template + T& + emplace () + { + IW7_ASSERT (!yytypeid_); + IW7_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (); + } + + /// Instantiate a \a T in here from \a t. + template + T& + emplace (const T& t) + { + IW7_ASSERT (!yytypeid_); + IW7_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (t); + } +# endif + + /// Instantiate an empty \a T in here. + /// Obsolete, use emplace. + template + T& + build () + { + return emplace (); + } + + /// Instantiate a \a T in here from \a t. + /// Obsolete, use emplace. + template + T& + build (const T& t) + { + return emplace (t); + } + + /// Accessor to a built \a T. + template + T& + as () YY_NOEXCEPT + { + IW7_ASSERT (yytypeid_); + IW7_ASSERT (*yytypeid_ == typeid (T)); + IW7_ASSERT (sizeof (T) <= size); + return *yyas_ (); + } + + /// Const accessor to a built \a T (for %printer). + template + const T& + as () const YY_NOEXCEPT + { + IW7_ASSERT (yytypeid_); + IW7_ASSERT (*yytypeid_ == typeid (T)); + IW7_ASSERT (sizeof (T) <= size); + return *yyas_ (); + } + + /// Swap the content with \a that, of same type. + /// + /// Both variants must be built beforehand, because swapping the actual + /// data requires reading it (with as()), and this is not possible on + /// unconstructed variants: it would require some dynamic testing, which + /// should not be the variant's responsibility. + /// Swapping between built and (possibly) non-built is done with + /// self_type::move (). + template + void + swap (self_type& that) YY_NOEXCEPT + { + IW7_ASSERT (yytypeid_); + IW7_ASSERT (*yytypeid_ == *that.yytypeid_); + std::swap (as (), that.as ()); + } + + /// Move the content of \a that to this. + /// + /// Destroys \a that. + template + void + move (self_type& that) + { +# if 201103L <= YY_CPLUSPLUS + emplace (std::move (that.as ())); +# else + emplace (); + swap (that); +# endif + that.destroy (); + } + +# if 201103L <= YY_CPLUSPLUS + /// Move the content of \a that to this. + template + void + move (self_type&& that) + { + emplace (std::move (that.as ())); + that.destroy (); + } +#endif + + /// Copy the content of \a that to this. + template + void + copy (const self_type& that) + { + emplace (that.as ()); + } + + /// Destroy the stored \a T. + template + void + destroy () + { + as ().~T (); + yytypeid_ = YY_NULLPTR; + } + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + semantic_type (const self_type&); + /// Non copyable. + self_type& operator= (const self_type&); +#endif + + /// Accessor to raw memory as \a T. + template + T* + yyas_ () YY_NOEXCEPT + { + void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + /// Const accessor to raw memory as \a T. + template + const T* + yyas_ () const YY_NOEXCEPT + { + const void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + /// An auxiliary type to compute the largest semantic type. + union union_type + { + // anim + char dummy1[sizeof (anim_ptr)]; + + // animation + char dummy2[sizeof (animation_ptr)]; + + // animtree + char dummy3[sizeof (animtree_ptr)]; + + // constant + char dummy4[sizeof (constant_ptr)]; + + // define + char dummy5[sizeof (define_ptr)]; + + // empty_array + char dummy6[sizeof (empty_array_ptr)]; + + // expr_arguments + // expr_arguments_filled + // expr_arguments_empty + char dummy7[sizeof (expr_arguments_ptr)]; + + // expr_assign + char dummy8[sizeof (expr_assign_ptr)]; + + // expr_call + // expr_call_thread + // expr_call_childthread + char dummy9[sizeof (expr_call_ptr)]; + + // expr_call_function + // expr_call_pointer + char dummy10[sizeof (expr_call_type_ptr)]; + + // for_expr + // expr + // expr_compare + // expr_binary + // expr_primitive + char dummy11[sizeof (expr_ptr)]; + + // false + char dummy12[sizeof (false_ptr)]; + + // file + char dummy13[sizeof (file_ptr)]; + + // neg_float + // float + char dummy14[sizeof (float_ptr)]; + + // game + char dummy15[sizeof (game_ptr)]; + + // include + char dummy16[sizeof (include_ptr)]; + + // neg_integer + // integer + char dummy17[sizeof (integer_ptr)]; + + // istring + char dummy18[sizeof (istring_ptr)]; + + // level + char dummy19[sizeof (level_ptr)]; + + // name + char dummy20[sizeof (name_ptr)]; + + // expr_function + // expr_add_array + // expr_array + // expr_field + // expr_size + // object + char dummy21[sizeof (node_ptr)]; + + // parameters + char dummy22[sizeof (parameters_ptr)]; + + // program + char dummy23[sizeof (program_ptr)]; + + // self + char dummy24[sizeof (self_ptr)]; + + // "file path" + // "identifier" + // "string literal" + // "localized string" + // "float" + // "int" + char dummy25[sizeof (std::string)]; + + // stmt_assign + char dummy26[sizeof (stmt_assign_ptr)]; + + // stmt_break + char dummy27[sizeof (stmt_break_ptr)]; + + // stmt_call + char dummy28[sizeof (stmt_call_ptr)]; + + // stmt_case + char dummy29[sizeof (stmt_case_ptr)]; + + // stmt_continue + char dummy30[sizeof (stmt_continue_ptr)]; + + // stmt_default + char dummy31[sizeof (stmt_default_ptr)]; + + // stmt_endon + char dummy32[sizeof (stmt_endon_ptr)]; + + // stmt_for + char dummy33[sizeof (stmt_for_ptr)]; + + // stmt_foreach + char dummy34[sizeof (stmt_foreach_ptr)]; + + // stmt_if + char dummy35[sizeof (stmt_if_ptr)]; + + // stmt_ifelse + char dummy36[sizeof (stmt_ifelse_ptr)]; + + // stmt_block + // stmt_list + char dummy37[sizeof (stmt_list_ptr)]; + + // stmt_notify + char dummy38[sizeof (stmt_notify_ptr)]; + + // stmt + // for_stmt + char dummy39[sizeof (stmt_ptr)]; + + // stmt_return + char dummy40[sizeof (stmt_return_ptr)]; + + // stmt_switch + char dummy41[sizeof (stmt_switch_ptr)]; + + // stmt_wait + char dummy42[sizeof (stmt_wait_ptr)]; + + // stmt_waittill + char dummy43[sizeof (stmt_waittill_ptr)]; + + // stmt_waittillframeend + char dummy44[sizeof (stmt_waittillframeend_ptr)]; + + // stmt_waittillmatch + char dummy45[sizeof (stmt_waittillmatch_ptr)]; + + // stmt_while + char dummy46[sizeof (stmt_while_ptr)]; + + // string + char dummy47[sizeof (string_ptr)]; + + // thisthread + char dummy48[sizeof (thisthread_ptr)]; + + // thread + char dummy49[sizeof (thread_ptr)]; + + // true + char dummy50[sizeof (true_ptr)]; + + // undefined + char dummy51[sizeof (undefined_ptr)]; + + // usingtree + char dummy52[sizeof (usingtree_ptr)]; + + // vector + char dummy53[sizeof (vector_ptr)]; + }; + + /// The size of the largest semantic type. + enum { size = sizeof (union_type) }; + + /// A buffer to store semantic values. + union + { + /// Strongest alignment constraints. + long double yyalign_me; + /// A buffer large enough to store any of the semantic values. + char yyraw[size]; + } yybuffer_; + + /// Whether the content is built: if defined, the name of the stored type. + const std::type_info *yytypeid_; + }; + +#else + typedef IW7STYPE semantic_type; +#endif + /// Symbol locations. + typedef xsk::gsc::location location_type; + + /// Syntax errors thrown from user actions. + struct syntax_error : std::runtime_error + { + syntax_error (const location_type& l, const std::string& m) + : std::runtime_error (m) + , location (l) + {} + + syntax_error (const syntax_error& s) + : std::runtime_error (s.what ()) + , location (s.location) + {} + + ~syntax_error () YY_NOEXCEPT YY_NOTHROW; + + location_type location; + }; + + /// Token kinds. + struct token + { + enum token_kind_type + { + IW7EMPTY = -2, + IW7EOF = 0, // "end of file" + IW7error = 1, // error + IW7UNDEF = 2, // "invalid token" + INCLUDE = 3, // "#include" + USINGTREE = 4, // "#using_animtree" + ANIMTREE = 5, // "#animtree" + ENDON = 6, // "endon" + NOTIFY = 7, // "notify" + WAIT = 8, // "wait" + WAITTILL = 9, // "waittill" + WAITTILLMATCH = 10, // "waittillmatch" + WAITTILLFRAMEEND = 11, // "waittillframeend" + IF = 12, // "if" + ELSE = 13, // "else" + WHILE = 14, // "while" + FOR = 15, // "for" + FOREACH = 16, // "foreach" + IN = 17, // "in" + SWITCH = 18, // "switch" + CASE = 19, // "case" + DEFAULT = 20, // "default" + BREAK = 21, // "break" + CONTINUE = 22, // "continue" + RETURN = 23, // "return" + THREAD = 24, // "thread" + CHILDTHREAD = 25, // "childthread" + THISTHREAD = 26, // "thisthread" + CALL = 27, // "call" + TRUE = 28, // "true" + FALSE = 29, // "false" + UNDEFINED = 30, // "undefined" + SIZE = 31, // "size" + GAME = 32, // "game" + SELF = 33, // "self" + ANIM = 34, // "anim" + LEVEL = 35, // "level" + LPAREN = 36, // "(" + RPAREN = 37, // ")" + LBRACE = 38, // "{" + RBRACE = 39, // "}" + LBRACKET = 40, // "[" + RBRACKET = 41, // "]" + COMMA = 42, // "," + DOT = 43, // "." + DOUBLECOLON = 44, // "::" + COLON = 45, // ":" + SEMICOLON = 46, // ";" + INCREMENT = 47, // "++" + DECREMENT = 48, // "--" + LSHIFT = 49, // "<<" + RSHIFT = 50, // ">>" + OR = 51, // "||" + AND = 52, // "&&" + EQUALITY = 53, // "==" + INEQUALITY = 54, // "!=" + LESS_EQUAL = 55, // "<=" + GREATER_EQUAL = 56, // ">=" + LESS = 57, // "<" + GREATER = 58, // ">" + NOT = 59, // "!" + COMPLEMENT = 60, // "~" + ASSIGN = 61, // "=" + ASSIGN_ADD = 62, // "+=" + ASSIGN_SUB = 63, // "-=" + ASSIGN_MULT = 64, // "*=" + ASSIGN_DIV = 65, // "/=" + ASSIGN_MOD = 66, // "%=" + ASSIGN_BITWISE_OR = 67, // "|=" + ASSIGN_BITWISE_AND = 68, // "&=" + ASSIGN_BITWISE_EXOR = 69, // "^=" + ASSIGN_RSHIFT = 70, // ">>=" + ASSIGN_LSHIFT = 71, // "<<=" + BITWISE_OR = 72, // "|" + BITWISE_AND = 73, // "&" + BITWISE_EXOR = 74, // "^" + ADD = 75, // "+" + SUB = 76, // "-" + MULT = 77, // "*" + DIV = 78, // "/" + MOD = 79, // "%" + FILE = 80, // "file path" + NAME = 81, // "identifier" + STRING = 82, // "string literal" + ISTRING = 83, // "localized string" + FLOAT = 84, // "float" + INTEGER = 85, // "int" + ADD_ARRAY = 86, // ADD_ARRAY + THEN = 87, // THEN + NEG = 88, // NEG + ANIMREF = 89, // ANIMREF + PREINC = 90, // PREINC + PREDEC = 91, // PREDEC + POSTINC = 92, // POSTINC + POSTDEC = 93 // POSTDEC + }; + /// Backward compatibility alias (Bison 3.6). + typedef token_kind_type yytokentype; + }; + + /// Token kind, as returned by yylex. + typedef token::yytokentype token_kind_type; + + /// Backward compatibility alias (Bison 3.6). + typedef token_kind_type token_type; + + /// Symbol kinds. + struct symbol_kind + { + enum symbol_kind_type + { + YYNTOKENS = 94, ///< Number of tokens. + S_YYEMPTY = -2, + S_YYEOF = 0, // "end of file" + S_YYerror = 1, // error + S_YYUNDEF = 2, // "invalid token" + S_INCLUDE = 3, // "#include" + S_USINGTREE = 4, // "#using_animtree" + S_ANIMTREE = 5, // "#animtree" + S_ENDON = 6, // "endon" + S_NOTIFY = 7, // "notify" + S_WAIT = 8, // "wait" + S_WAITTILL = 9, // "waittill" + S_WAITTILLMATCH = 10, // "waittillmatch" + S_WAITTILLFRAMEEND = 11, // "waittillframeend" + S_IF = 12, // "if" + S_ELSE = 13, // "else" + S_WHILE = 14, // "while" + S_FOR = 15, // "for" + S_FOREACH = 16, // "foreach" + S_IN = 17, // "in" + S_SWITCH = 18, // "switch" + S_CASE = 19, // "case" + S_DEFAULT = 20, // "default" + S_BREAK = 21, // "break" + S_CONTINUE = 22, // "continue" + S_RETURN = 23, // "return" + S_THREAD = 24, // "thread" + S_CHILDTHREAD = 25, // "childthread" + S_THISTHREAD = 26, // "thisthread" + S_CALL = 27, // "call" + S_TRUE = 28, // "true" + S_FALSE = 29, // "false" + S_UNDEFINED = 30, // "undefined" + S_SIZE = 31, // "size" + S_GAME = 32, // "game" + S_SELF = 33, // "self" + S_ANIM = 34, // "anim" + S_LEVEL = 35, // "level" + S_LPAREN = 36, // "(" + S_RPAREN = 37, // ")" + S_LBRACE = 38, // "{" + S_RBRACE = 39, // "}" + S_LBRACKET = 40, // "[" + S_RBRACKET = 41, // "]" + S_COMMA = 42, // "," + S_DOT = 43, // "." + S_DOUBLECOLON = 44, // "::" + S_COLON = 45, // ":" + S_SEMICOLON = 46, // ";" + S_INCREMENT = 47, // "++" + S_DECREMENT = 48, // "--" + S_LSHIFT = 49, // "<<" + S_RSHIFT = 50, // ">>" + S_OR = 51, // "||" + S_AND = 52, // "&&" + S_EQUALITY = 53, // "==" + S_INEQUALITY = 54, // "!=" + S_LESS_EQUAL = 55, // "<=" + S_GREATER_EQUAL = 56, // ">=" + S_LESS = 57, // "<" + S_GREATER = 58, // ">" + S_NOT = 59, // "!" + S_COMPLEMENT = 60, // "~" + S_ASSIGN = 61, // "=" + S_ASSIGN_ADD = 62, // "+=" + S_ASSIGN_SUB = 63, // "-=" + S_ASSIGN_MULT = 64, // "*=" + S_ASSIGN_DIV = 65, // "/=" + S_ASSIGN_MOD = 66, // "%=" + S_ASSIGN_BITWISE_OR = 67, // "|=" + S_ASSIGN_BITWISE_AND = 68, // "&=" + S_ASSIGN_BITWISE_EXOR = 69, // "^=" + S_ASSIGN_RSHIFT = 70, // ">>=" + S_ASSIGN_LSHIFT = 71, // "<<=" + S_BITWISE_OR = 72, // "|" + S_BITWISE_AND = 73, // "&" + S_BITWISE_EXOR = 74, // "^" + S_ADD = 75, // "+" + S_SUB = 76, // "-" + S_MULT = 77, // "*" + S_DIV = 78, // "/" + S_MOD = 79, // "%" + S_FILE = 80, // "file path" + S_NAME = 81, // "identifier" + S_STRING = 82, // "string literal" + S_ISTRING = 83, // "localized string" + S_FLOAT = 84, // "float" + S_INTEGER = 85, // "int" + S_ADD_ARRAY = 86, // ADD_ARRAY + S_THEN = 87, // THEN + S_NEG = 88, // NEG + S_ANIMREF = 89, // ANIMREF + S_PREINC = 90, // PREINC + S_PREDEC = 91, // PREDEC + S_POSTINC = 92, // POSTINC + S_POSTDEC = 93, // POSTDEC + S_YYACCEPT = 94, // $accept + S_root = 95, // root + S_program = 96, // program + S_include = 97, // include + S_define = 98, // define + S_usingtree = 99, // usingtree + S_constant = 100, // constant + S_thread = 101, // thread + S_parameters = 102, // parameters + S_stmt = 103, // stmt + S_stmt_block = 104, // stmt_block + S_stmt_list = 105, // stmt_list + S_stmt_call = 106, // stmt_call + S_stmt_assign = 107, // stmt_assign + S_stmt_endon = 108, // stmt_endon + S_stmt_notify = 109, // stmt_notify + S_stmt_wait = 110, // stmt_wait + S_stmt_waittill = 111, // stmt_waittill + S_stmt_waittillmatch = 112, // stmt_waittillmatch + S_stmt_waittillframeend = 113, // stmt_waittillframeend + S_stmt_if = 114, // stmt_if + S_stmt_ifelse = 115, // stmt_ifelse + S_stmt_while = 116, // stmt_while + S_stmt_for = 117, // stmt_for + S_stmt_foreach = 118, // stmt_foreach + S_stmt_switch = 119, // stmt_switch + S_stmt_case = 120, // stmt_case + S_stmt_default = 121, // stmt_default + S_stmt_break = 122, // stmt_break + S_stmt_continue = 123, // stmt_continue + S_stmt_return = 124, // stmt_return + S_for_stmt = 125, // for_stmt + S_for_expr = 126, // for_expr + S_expr = 127, // expr + S_expr_assign = 128, // expr_assign + S_expr_compare = 129, // expr_compare + S_expr_binary = 130, // expr_binary + S_expr_primitive = 131, // expr_primitive + S_expr_call = 132, // expr_call + S_expr_call_thread = 133, // expr_call_thread + S_expr_call_childthread = 134, // expr_call_childthread + S_expr_call_function = 135, // expr_call_function + S_expr_call_pointer = 136, // expr_call_pointer + S_expr_arguments = 137, // expr_arguments + S_expr_arguments_filled = 138, // expr_arguments_filled + S_expr_arguments_empty = 139, // expr_arguments_empty + S_expr_function = 140, // expr_function + S_expr_add_array = 141, // expr_add_array + S_expr_array = 142, // expr_array + S_expr_field = 143, // expr_field + S_expr_size = 144, // expr_size + S_object = 145, // object + S_thisthread = 146, // thisthread + S_empty_array = 147, // empty_array + S_undefined = 148, // undefined + S_game = 149, // game + S_self = 150, // self + S_anim = 151, // anim + S_level = 152, // level + S_animation = 153, // animation + S_animtree = 154, // animtree + S_name = 155, // name + S_file = 156, // file + S_istring = 157, // istring + S_string = 158, // string + S_vector = 159, // vector + S_neg_float = 160, // neg_float + S_neg_integer = 161, // neg_integer + S_float = 162, // float + S_integer = 163, // integer + S_false = 164, // false + S_true = 165 // true + }; + }; + + /// (Internal) symbol kind. + typedef symbol_kind::symbol_kind_type symbol_kind_type; + + /// The number of tokens. + static const symbol_kind_type YYNTOKENS = symbol_kind::YYNTOKENS; + + /// A complete symbol. + /// + /// Expects its Base type to provide access to the symbol kind + /// via kind (). + /// + /// Provide access to semantic value and location. + template + struct basic_symbol : Base + { + /// Alias to Base. + typedef Base super_type; + + /// Default constructor. + basic_symbol () + : value () + , location () + {} + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + basic_symbol (basic_symbol&& that) + : Base (std::move (that)) + , value () + , location (std::move (that.location)) + { + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (std::move (that.value)); + break; + + default: + break; + } + + } +#endif + + /// Copy constructor. + basic_symbol (const basic_symbol& that); + + /// Constructors for typed symbols. +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, location_type&& l) + : Base (t) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const location_type& l) + : Base (t) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, anim_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const anim_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, animation_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const animation_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, animtree_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const animtree_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, constant_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const constant_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, define_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const define_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, empty_array_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const empty_array_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_arguments_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_arguments_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_assign_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_assign_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_call_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_call_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_call_type_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_call_type_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, false_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const false_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, file_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const file_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, float_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const float_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, game_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const game_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, include_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const include_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, integer_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const integer_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, istring_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const istring_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, level_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const level_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, name_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const name_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, node_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const node_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, parameters_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const parameters_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, program_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const program_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, self_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const self_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_assign_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_assign_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_break_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_break_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_call_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_call_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_case_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_case_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_continue_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_continue_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_default_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_default_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_endon_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_endon_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_for_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_for_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_foreach_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_foreach_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_if_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_if_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_ifelse_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_ifelse_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_list_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_list_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_notify_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_notify_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_return_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_return_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_switch_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_switch_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_wait_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_wait_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittill_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittill_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittillframeend_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittillframeend_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittillmatch_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittillmatch_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_while_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_while_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, string_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const string_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, thisthread_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const thisthread_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, thread_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const thread_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, true_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const true_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, undefined_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const undefined_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, usingtree_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const usingtree_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, vector_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const vector_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + + /// Destroy the symbol. + ~basic_symbol () + { + clear (); + } + + /// Destroy contents, and record that is empty. + void clear () YY_NOEXCEPT + { + // User destructor. + symbol_kind_type yykind = this->kind (); + basic_symbol& yysym = *this; + (void) yysym; + switch (yykind) + { + default: + break; + } + + // Value type destructor. +switch (yykind) + { + case symbol_kind::S_anim: // anim + value.template destroy< anim_ptr > (); + break; + + case symbol_kind::S_animation: // animation + value.template destroy< animation_ptr > (); + break; + + case symbol_kind::S_animtree: // animtree + value.template destroy< animtree_ptr > (); + break; + + case symbol_kind::S_constant: // constant + value.template destroy< constant_ptr > (); + break; + + case symbol_kind::S_define: // define + value.template destroy< define_ptr > (); + break; + + case symbol_kind::S_empty_array: // empty_array + value.template destroy< empty_array_ptr > (); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.template destroy< expr_arguments_ptr > (); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.template destroy< expr_assign_ptr > (); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.template destroy< expr_call_ptr > (); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.template destroy< expr_call_type_ptr > (); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.template destroy< expr_ptr > (); + break; + + case symbol_kind::S_false: // false + value.template destroy< false_ptr > (); + break; + + case symbol_kind::S_file: // file + value.template destroy< file_ptr > (); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.template destroy< float_ptr > (); + break; + + case symbol_kind::S_game: // game + value.template destroy< game_ptr > (); + break; + + case symbol_kind::S_include: // include + value.template destroy< include_ptr > (); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.template destroy< integer_ptr > (); + break; + + case symbol_kind::S_istring: // istring + value.template destroy< istring_ptr > (); + break; + + case symbol_kind::S_level: // level + value.template destroy< level_ptr > (); + break; + + case symbol_kind::S_name: // name + value.template destroy< name_ptr > (); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.template destroy< node_ptr > (); + break; + + case symbol_kind::S_parameters: // parameters + value.template destroy< parameters_ptr > (); + break; + + case symbol_kind::S_program: // program + value.template destroy< program_ptr > (); + break; + + case symbol_kind::S_self: // self + value.template destroy< self_ptr > (); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.template destroy< std::string > (); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.template destroy< stmt_assign_ptr > (); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.template destroy< stmt_break_ptr > (); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.template destroy< stmt_call_ptr > (); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.template destroy< stmt_case_ptr > (); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.template destroy< stmt_continue_ptr > (); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.template destroy< stmt_default_ptr > (); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.template destroy< stmt_endon_ptr > (); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.template destroy< stmt_for_ptr > (); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.template destroy< stmt_foreach_ptr > (); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.template destroy< stmt_if_ptr > (); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.template destroy< stmt_ifelse_ptr > (); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.template destroy< stmt_list_ptr > (); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.template destroy< stmt_notify_ptr > (); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.template destroy< stmt_ptr > (); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.template destroy< stmt_return_ptr > (); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.template destroy< stmt_switch_ptr > (); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.template destroy< stmt_wait_ptr > (); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.template destroy< stmt_waittill_ptr > (); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.template destroy< stmt_waittillframeend_ptr > (); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.template destroy< stmt_waittillmatch_ptr > (); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.template destroy< stmt_while_ptr > (); + break; + + case symbol_kind::S_string: // string + value.template destroy< string_ptr > (); + break; + + case symbol_kind::S_thisthread: // thisthread + value.template destroy< thisthread_ptr > (); + break; + + case symbol_kind::S_thread: // thread + value.template destroy< thread_ptr > (); + break; + + case symbol_kind::S_true: // true + value.template destroy< true_ptr > (); + break; + + case symbol_kind::S_undefined: // undefined + value.template destroy< undefined_ptr > (); + break; + + case symbol_kind::S_usingtree: // usingtree + value.template destroy< usingtree_ptr > (); + break; + + case symbol_kind::S_vector: // vector + value.template destroy< vector_ptr > (); + break; + + default: + break; + } + + Base::clear (); + } + + /// The user-facing name of this symbol. + const char *name () const YY_NOEXCEPT + { + return parser::symbol_name (this->kind ()); + } + + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; + + /// Whether empty. + bool empty () const YY_NOEXCEPT; + + /// Destructive move, \a s is emptied into this. + void move (basic_symbol& s); + + /// The semantic value. + semantic_type value; + + /// The location. + location_type location; + + private: +#if YY_CPLUSPLUS < 201103L + /// Assignment operator. + basic_symbol& operator= (const basic_symbol& that); +#endif + }; + + /// Type access provider for token (enum) based symbols. + struct by_kind + { + /// Default constructor. + by_kind (); + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + by_kind (by_kind&& that); +#endif + + /// Copy constructor. + by_kind (const by_kind& that); + + /// The symbol kind as needed by the constructor. + typedef token_kind_type kind_type; + + /// Constructor from (external) token numbers. + by_kind (kind_type t); + + /// Record that this symbol is empty. + void clear () YY_NOEXCEPT; + + /// Steal the symbol kind from \a that. + void move (by_kind& that); + + /// The (internal) type number (corresponding to \a type). + /// \a empty when empty. + symbol_kind_type kind () const YY_NOEXCEPT; + + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; + + /// The symbol kind. + /// \a S_YYEMPTY when empty. + symbol_kind_type kind_; + }; + + /// Backward compatibility for a private implementation detail (Bison 3.6). + typedef by_kind by_type; + + /// "External" symbols: returned by the scanner. + struct symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + + /// Empty symbol. + symbol_type () {} + + /// Constructor for valueless symbols, and symbols from each type. +#if 201103L <= YY_CPLUSPLUS + symbol_type (int tok, location_type l) + : super_type(token_type (tok), std::move (l)) +#else + symbol_type (int tok, const location_type& l) + : super_type(token_type (tok), l) +#endif + { + IW7_ASSERT (tok == token::IW7EOF + || (token::IW7error <= tok && tok <= token::MOD) + || (token::ADD_ARRAY <= tok && tok <= token::POSTDEC)); + } +#if 201103L <= YY_CPLUSPLUS + symbol_type (int tok, std::string v, location_type l) + : super_type(token_type (tok), std::move (v), std::move (l)) +#else + symbol_type (int tok, const std::string& v, const location_type& l) + : super_type(token_type (tok), v, l) +#endif + { + IW7_ASSERT ((token::FILE <= tok && tok <= token::INTEGER)); + } + }; + + /// Build a parser object. + parser (yyscan_t yyscanner_yyarg, xsk::gsc::location& loc_yyarg, xsk::gsc::program_ptr& ast_yyarg); + virtual ~parser (); + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + parser (const parser&) = delete; + /// Non copyable. + parser& operator= (const parser&) = delete; +#endif + + /// Parse. An alias for parse (). + /// \returns 0 iff parsing succeeded. + int operator() (); + + /// Parse. + /// \returns 0 iff parsing succeeded. + virtual int parse (); + +#if IW7DEBUG + /// The current debugging stream. + std::ostream& debug_stream () const YY_ATTRIBUTE_PURE; + /// Set the current debugging stream. + void set_debug_stream (std::ostream &); + + /// Type for debugging levels. + typedef int debug_level_type; + /// The current debugging level. + debug_level_type debug_level () const YY_ATTRIBUTE_PURE; + /// Set the current debugging level. + void set_debug_level (debug_level_type l); +#endif + + /// Report a syntax error. + /// \param loc where the syntax error is found. + /// \param msg a description of the syntax error. + virtual void error (const location_type& loc, const std::string& msg); + + /// Report a syntax error. + void error (const syntax_error& err); + + /// The user-facing name of the symbol whose (internal) number is + /// YYSYMBOL. No bounds checking. + static const char *symbol_name (symbol_kind_type yysymbol); + + // Implementation of make_symbol for each symbol type. +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IW7EOF (location_type l) + { + return symbol_type (token::IW7EOF, std::move (l)); + } +#else + static + symbol_type + make_IW7EOF (const location_type& l) + { + return symbol_type (token::IW7EOF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IW7error (location_type l) + { + return symbol_type (token::IW7error, std::move (l)); + } +#else + static + symbol_type + make_IW7error (const location_type& l) + { + return symbol_type (token::IW7error, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IW7UNDEF (location_type l) + { + return symbol_type (token::IW7UNDEF, std::move (l)); + } +#else + static + symbol_type + make_IW7UNDEF (const location_type& l) + { + return symbol_type (token::IW7UNDEF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INCLUDE (location_type l) + { + return symbol_type (token::INCLUDE, std::move (l)); + } +#else + static + symbol_type + make_INCLUDE (const location_type& l) + { + return symbol_type (token::INCLUDE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_USINGTREE (location_type l) + { + return symbol_type (token::USINGTREE, std::move (l)); + } +#else + static + symbol_type + make_USINGTREE (const location_type& l) + { + return symbol_type (token::USINGTREE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIMTREE (location_type l) + { + return symbol_type (token::ANIMTREE, std::move (l)); + } +#else + static + symbol_type + make_ANIMTREE (const location_type& l) + { + return symbol_type (token::ANIMTREE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ENDON (location_type l) + { + return symbol_type (token::ENDON, std::move (l)); + } +#else + static + symbol_type + make_ENDON (const location_type& l) + { + return symbol_type (token::ENDON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NOTIFY (location_type l) + { + return symbol_type (token::NOTIFY, std::move (l)); + } +#else + static + symbol_type + make_NOTIFY (const location_type& l) + { + return symbol_type (token::NOTIFY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAIT (location_type l) + { + return symbol_type (token::WAIT, std::move (l)); + } +#else + static + symbol_type + make_WAIT (const location_type& l) + { + return symbol_type (token::WAIT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILL (location_type l) + { + return symbol_type (token::WAITTILL, std::move (l)); + } +#else + static + symbol_type + make_WAITTILL (const location_type& l) + { + return symbol_type (token::WAITTILL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILLMATCH (location_type l) + { + return symbol_type (token::WAITTILLMATCH, std::move (l)); + } +#else + static + symbol_type + make_WAITTILLMATCH (const location_type& l) + { + return symbol_type (token::WAITTILLMATCH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILLFRAMEEND (location_type l) + { + return symbol_type (token::WAITTILLFRAMEEND, std::move (l)); + } +#else + static + symbol_type + make_WAITTILLFRAMEEND (const location_type& l) + { + return symbol_type (token::WAITTILLFRAMEEND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IF (location_type l) + { + return symbol_type (token::IF, std::move (l)); + } +#else + static + symbol_type + make_IF (const location_type& l) + { + return symbol_type (token::IF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ELSE (location_type l) + { + return symbol_type (token::ELSE, std::move (l)); + } +#else + static + symbol_type + make_ELSE (const location_type& l) + { + return symbol_type (token::ELSE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WHILE (location_type l) + { + return symbol_type (token::WHILE, std::move (l)); + } +#else + static + symbol_type + make_WHILE (const location_type& l) + { + return symbol_type (token::WHILE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FOR (location_type l) + { + return symbol_type (token::FOR, std::move (l)); + } +#else + static + symbol_type + make_FOR (const location_type& l) + { + return symbol_type (token::FOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FOREACH (location_type l) + { + return symbol_type (token::FOREACH, std::move (l)); + } +#else + static + symbol_type + make_FOREACH (const location_type& l) + { + return symbol_type (token::FOREACH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IN (location_type l) + { + return symbol_type (token::IN, std::move (l)); + } +#else + static + symbol_type + make_IN (const location_type& l) + { + return symbol_type (token::IN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SWITCH (location_type l) + { + return symbol_type (token::SWITCH, std::move (l)); + } +#else + static + symbol_type + make_SWITCH (const location_type& l) + { + return symbol_type (token::SWITCH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CASE (location_type l) + { + return symbol_type (token::CASE, std::move (l)); + } +#else + static + symbol_type + make_CASE (const location_type& l) + { + return symbol_type (token::CASE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DEFAULT (location_type l) + { + return symbol_type (token::DEFAULT, std::move (l)); + } +#else + static + symbol_type + make_DEFAULT (const location_type& l) + { + return symbol_type (token::DEFAULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BREAK (location_type l) + { + return symbol_type (token::BREAK, std::move (l)); + } +#else + static + symbol_type + make_BREAK (const location_type& l) + { + return symbol_type (token::BREAK, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CONTINUE (location_type l) + { + return symbol_type (token::CONTINUE, std::move (l)); + } +#else + static + symbol_type + make_CONTINUE (const location_type& l) + { + return symbol_type (token::CONTINUE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RETURN (location_type l) + { + return symbol_type (token::RETURN, std::move (l)); + } +#else + static + symbol_type + make_RETURN (const location_type& l) + { + return symbol_type (token::RETURN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THREAD (location_type l) + { + return symbol_type (token::THREAD, std::move (l)); + } +#else + static + symbol_type + make_THREAD (const location_type& l) + { + return symbol_type (token::THREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CHILDTHREAD (location_type l) + { + return symbol_type (token::CHILDTHREAD, std::move (l)); + } +#else + static + symbol_type + make_CHILDTHREAD (const location_type& l) + { + return symbol_type (token::CHILDTHREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THISTHREAD (location_type l) + { + return symbol_type (token::THISTHREAD, std::move (l)); + } +#else + static + symbol_type + make_THISTHREAD (const location_type& l) + { + return symbol_type (token::THISTHREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CALL (location_type l) + { + return symbol_type (token::CALL, std::move (l)); + } +#else + static + symbol_type + make_CALL (const location_type& l) + { + return symbol_type (token::CALL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_TRUE (location_type l) + { + return symbol_type (token::TRUE, std::move (l)); + } +#else + static + symbol_type + make_TRUE (const location_type& l) + { + return symbol_type (token::TRUE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FALSE (location_type l) + { + return symbol_type (token::FALSE, std::move (l)); + } +#else + static + symbol_type + make_FALSE (const location_type& l) + { + return symbol_type (token::FALSE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_UNDEFINED (location_type l) + { + return symbol_type (token::UNDEFINED, std::move (l)); + } +#else + static + symbol_type + make_UNDEFINED (const location_type& l) + { + return symbol_type (token::UNDEFINED, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SIZE (location_type l) + { + return symbol_type (token::SIZE, std::move (l)); + } +#else + static + symbol_type + make_SIZE (const location_type& l) + { + return symbol_type (token::SIZE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GAME (location_type l) + { + return symbol_type (token::GAME, std::move (l)); + } +#else + static + symbol_type + make_GAME (const location_type& l) + { + return symbol_type (token::GAME, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SELF (location_type l) + { + return symbol_type (token::SELF, std::move (l)); + } +#else + static + symbol_type + make_SELF (const location_type& l) + { + return symbol_type (token::SELF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIM (location_type l) + { + return symbol_type (token::ANIM, std::move (l)); + } +#else + static + symbol_type + make_ANIM (const location_type& l) + { + return symbol_type (token::ANIM, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LEVEL (location_type l) + { + return symbol_type (token::LEVEL, std::move (l)); + } +#else + static + symbol_type + make_LEVEL (const location_type& l) + { + return symbol_type (token::LEVEL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LPAREN (location_type l) + { + return symbol_type (token::LPAREN, std::move (l)); + } +#else + static + symbol_type + make_LPAREN (const location_type& l) + { + return symbol_type (token::LPAREN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RPAREN (location_type l) + { + return symbol_type (token::RPAREN, std::move (l)); + } +#else + static + symbol_type + make_RPAREN (const location_type& l) + { + return symbol_type (token::RPAREN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LBRACE (location_type l) + { + return symbol_type (token::LBRACE, std::move (l)); + } +#else + static + symbol_type + make_LBRACE (const location_type& l) + { + return symbol_type (token::LBRACE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RBRACE (location_type l) + { + return symbol_type (token::RBRACE, std::move (l)); + } +#else + static + symbol_type + make_RBRACE (const location_type& l) + { + return symbol_type (token::RBRACE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LBRACKET (location_type l) + { + return symbol_type (token::LBRACKET, std::move (l)); + } +#else + static + symbol_type + make_LBRACKET (const location_type& l) + { + return symbol_type (token::LBRACKET, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RBRACKET (location_type l) + { + return symbol_type (token::RBRACKET, std::move (l)); + } +#else + static + symbol_type + make_RBRACKET (const location_type& l) + { + return symbol_type (token::RBRACKET, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COMMA (location_type l) + { + return symbol_type (token::COMMA, std::move (l)); + } +#else + static + symbol_type + make_COMMA (const location_type& l) + { + return symbol_type (token::COMMA, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DOT (location_type l) + { + return symbol_type (token::DOT, std::move (l)); + } +#else + static + symbol_type + make_DOT (const location_type& l) + { + return symbol_type (token::DOT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DOUBLECOLON (location_type l) + { + return symbol_type (token::DOUBLECOLON, std::move (l)); + } +#else + static + symbol_type + make_DOUBLECOLON (const location_type& l) + { + return symbol_type (token::DOUBLECOLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COLON (location_type l) + { + return symbol_type (token::COLON, std::move (l)); + } +#else + static + symbol_type + make_COLON (const location_type& l) + { + return symbol_type (token::COLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SEMICOLON (location_type l) + { + return symbol_type (token::SEMICOLON, std::move (l)); + } +#else + static + symbol_type + make_SEMICOLON (const location_type& l) + { + return symbol_type (token::SEMICOLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INCREMENT (location_type l) + { + return symbol_type (token::INCREMENT, std::move (l)); + } +#else + static + symbol_type + make_INCREMENT (const location_type& l) + { + return symbol_type (token::INCREMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DECREMENT (location_type l) + { + return symbol_type (token::DECREMENT, std::move (l)); + } +#else + static + symbol_type + make_DECREMENT (const location_type& l) + { + return symbol_type (token::DECREMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LSHIFT (location_type l) + { + return symbol_type (token::LSHIFT, std::move (l)); + } +#else + static + symbol_type + make_LSHIFT (const location_type& l) + { + return symbol_type (token::LSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RSHIFT (location_type l) + { + return symbol_type (token::RSHIFT, std::move (l)); + } +#else + static + symbol_type + make_RSHIFT (const location_type& l) + { + return symbol_type (token::RSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_OR (location_type l) + { + return symbol_type (token::OR, std::move (l)); + } +#else + static + symbol_type + make_OR (const location_type& l) + { + return symbol_type (token::OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_AND (location_type l) + { + return symbol_type (token::AND, std::move (l)); + } +#else + static + symbol_type + make_AND (const location_type& l) + { + return symbol_type (token::AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_EQUALITY (location_type l) + { + return symbol_type (token::EQUALITY, std::move (l)); + } +#else + static + symbol_type + make_EQUALITY (const location_type& l) + { + return symbol_type (token::EQUALITY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INEQUALITY (location_type l) + { + return symbol_type (token::INEQUALITY, std::move (l)); + } +#else + static + symbol_type + make_INEQUALITY (const location_type& l) + { + return symbol_type (token::INEQUALITY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LESS_EQUAL (location_type l) + { + return symbol_type (token::LESS_EQUAL, std::move (l)); + } +#else + static + symbol_type + make_LESS_EQUAL (const location_type& l) + { + return symbol_type (token::LESS_EQUAL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GREATER_EQUAL (location_type l) + { + return symbol_type (token::GREATER_EQUAL, std::move (l)); + } +#else + static + symbol_type + make_GREATER_EQUAL (const location_type& l) + { + return symbol_type (token::GREATER_EQUAL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LESS (location_type l) + { + return symbol_type (token::LESS, std::move (l)); + } +#else + static + symbol_type + make_LESS (const location_type& l) + { + return symbol_type (token::LESS, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GREATER (location_type l) + { + return symbol_type (token::GREATER, std::move (l)); + } +#else + static + symbol_type + make_GREATER (const location_type& l) + { + return symbol_type (token::GREATER, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NOT (location_type l) + { + return symbol_type (token::NOT, std::move (l)); + } +#else + static + symbol_type + make_NOT (const location_type& l) + { + return symbol_type (token::NOT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COMPLEMENT (location_type l) + { + return symbol_type (token::COMPLEMENT, std::move (l)); + } +#else + static + symbol_type + make_COMPLEMENT (const location_type& l) + { + return symbol_type (token::COMPLEMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN (location_type l) + { + return symbol_type (token::ASSIGN, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN (const location_type& l) + { + return symbol_type (token::ASSIGN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_ADD (location_type l) + { + return symbol_type (token::ASSIGN_ADD, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_ADD (const location_type& l) + { + return symbol_type (token::ASSIGN_ADD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_SUB (location_type l) + { + return symbol_type (token::ASSIGN_SUB, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_SUB (const location_type& l) + { + return symbol_type (token::ASSIGN_SUB, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_MULT (location_type l) + { + return symbol_type (token::ASSIGN_MULT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_MULT (const location_type& l) + { + return symbol_type (token::ASSIGN_MULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_DIV (location_type l) + { + return symbol_type (token::ASSIGN_DIV, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_DIV (const location_type& l) + { + return symbol_type (token::ASSIGN_DIV, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_MOD (location_type l) + { + return symbol_type (token::ASSIGN_MOD, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_MOD (const location_type& l) + { + return symbol_type (token::ASSIGN_MOD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_OR (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_OR, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_OR (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_AND (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_AND, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_AND (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_EXOR (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_EXOR, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_EXOR (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_EXOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_RSHIFT (location_type l) + { + return symbol_type (token::ASSIGN_RSHIFT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_RSHIFT (const location_type& l) + { + return symbol_type (token::ASSIGN_RSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_LSHIFT (location_type l) + { + return symbol_type (token::ASSIGN_LSHIFT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_LSHIFT (const location_type& l) + { + return symbol_type (token::ASSIGN_LSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_OR (location_type l) + { + return symbol_type (token::BITWISE_OR, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_OR (const location_type& l) + { + return symbol_type (token::BITWISE_OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_AND (location_type l) + { + return symbol_type (token::BITWISE_AND, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_AND (const location_type& l) + { + return symbol_type (token::BITWISE_AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_EXOR (location_type l) + { + return symbol_type (token::BITWISE_EXOR, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_EXOR (const location_type& l) + { + return symbol_type (token::BITWISE_EXOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ADD (location_type l) + { + return symbol_type (token::ADD, std::move (l)); + } +#else + static + symbol_type + make_ADD (const location_type& l) + { + return symbol_type (token::ADD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SUB (location_type l) + { + return symbol_type (token::SUB, std::move (l)); + } +#else + static + symbol_type + make_SUB (const location_type& l) + { + return symbol_type (token::SUB, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_MULT (location_type l) + { + return symbol_type (token::MULT, std::move (l)); + } +#else + static + symbol_type + make_MULT (const location_type& l) + { + return symbol_type (token::MULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DIV (location_type l) + { + return symbol_type (token::DIV, std::move (l)); + } +#else + static + symbol_type + make_DIV (const location_type& l) + { + return symbol_type (token::DIV, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_MOD (location_type l) + { + return symbol_type (token::MOD, std::move (l)); + } +#else + static + symbol_type + make_MOD (const location_type& l) + { + return symbol_type (token::MOD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FILE (std::string v, location_type l) + { + return symbol_type (token::FILE, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_FILE (const std::string& v, const location_type& l) + { + return symbol_type (token::FILE, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NAME (std::string v, location_type l) + { + return symbol_type (token::NAME, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_NAME (const std::string& v, const location_type& l) + { + return symbol_type (token::NAME, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_STRING (std::string v, location_type l) + { + return symbol_type (token::STRING, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_STRING (const std::string& v, const location_type& l) + { + return symbol_type (token::STRING, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ISTRING (std::string v, location_type l) + { + return symbol_type (token::ISTRING, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_ISTRING (const std::string& v, const location_type& l) + { + return symbol_type (token::ISTRING, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FLOAT (std::string v, location_type l) + { + return symbol_type (token::FLOAT, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_FLOAT (const std::string& v, const location_type& l) + { + return symbol_type (token::FLOAT, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INTEGER (std::string v, location_type l) + { + return symbol_type (token::INTEGER, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_INTEGER (const std::string& v, const location_type& l) + { + return symbol_type (token::INTEGER, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ADD_ARRAY (location_type l) + { + return symbol_type (token::ADD_ARRAY, std::move (l)); + } +#else + static + symbol_type + make_ADD_ARRAY (const location_type& l) + { + return symbol_type (token::ADD_ARRAY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THEN (location_type l) + { + return symbol_type (token::THEN, std::move (l)); + } +#else + static + symbol_type + make_THEN (const location_type& l) + { + return symbol_type (token::THEN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NEG (location_type l) + { + return symbol_type (token::NEG, std::move (l)); + } +#else + static + symbol_type + make_NEG (const location_type& l) + { + return symbol_type (token::NEG, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIMREF (location_type l) + { + return symbol_type (token::ANIMREF, std::move (l)); + } +#else + static + symbol_type + make_ANIMREF (const location_type& l) + { + return symbol_type (token::ANIMREF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_PREINC (location_type l) + { + return symbol_type (token::PREINC, std::move (l)); + } +#else + static + symbol_type + make_PREINC (const location_type& l) + { + return symbol_type (token::PREINC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_PREDEC (location_type l) + { + return symbol_type (token::PREDEC, std::move (l)); + } +#else + static + symbol_type + make_PREDEC (const location_type& l) + { + return symbol_type (token::PREDEC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_POSTINC (location_type l) + { + return symbol_type (token::POSTINC, std::move (l)); + } +#else + static + symbol_type + make_POSTINC (const location_type& l) + { + return symbol_type (token::POSTINC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_POSTDEC (location_type l) + { + return symbol_type (token::POSTDEC, std::move (l)); + } +#else + static + symbol_type + make_POSTDEC (const location_type& l) + { + return symbol_type (token::POSTDEC, l); + } +#endif + + + class context + { + public: + context (const parser& yyparser, const symbol_type& yyla); + const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; } + symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); } + const location_type& location () const YY_NOEXCEPT { return yyla_.location; } + + /// Put in YYARG at most YYARGN of the expected tokens, and return the + /// number of tokens stored in YYARG. If YYARG is null, return the + /// number of expected tokens (guaranteed to be less than YYNTOKENS). + int expected_tokens (symbol_kind_type yyarg[], int yyargn) const; + + private: + const parser& yyparser_; + const symbol_type& yyla_; + }; + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + parser (const parser&); + /// Non copyable. + parser& operator= (const parser&); +#endif + + /// Check the lookahead yytoken. + /// \returns true iff the token will be eventually shifted. + bool yy_lac_check_ (symbol_kind_type yytoken) const; + /// Establish the initial context if no initial context currently exists. + /// \returns true iff the token will be eventually shifted. + bool yy_lac_establish_ (symbol_kind_type yytoken); + /// Discard any previous initial lookahead context because of event. + /// \param event the event which caused the lookahead to be discarded. + /// Only used for debbuging output. + void yy_lac_discard_ (const char* event); + + /// Stored state numbers (used for stacks). + typedef short state_type; + + /// The arguments of the error message. + int yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const; + + /// Generate an error message. + /// \param yyctx the context in which the error occurred. + virtual std::string yysyntax_error_ (const context& yyctx) const; + /// Compute post-reduction state. + /// \param yystate the current state + /// \param yysym the nonterminal to push on the stack + static state_type yy_lr_goto_state_ (state_type yystate, int yysym); + + /// Whether the given \c yypact_ value indicates a defaulted state. + /// \param yyvalue the value to check + static bool yy_pact_value_is_default_ (int yyvalue); + + /// Whether the given \c yytable_ value indicates a syntax error. + /// \param yyvalue the value to check + static bool yy_table_value_is_error_ (int yyvalue); + + static const short yypact_ninf_; + static const short yytable_ninf_; + + /// Convert a scanner token kind \a t to a symbol kind. + /// In theory \a t should be a token_kind_type, but character literals + /// are valid, yet not members of the token_type enum. + static symbol_kind_type yytranslate_ (int t); + + + + // Tables. + // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + // STATE-NUM. + static const short yypact_[]; + + // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + // Performed when YYTABLE does not specify something else to do. Zero + // means the default is an error. + static const unsigned char yydefact_[]; + + // YYPGOTO[NTERM-NUM]. + static const short yypgoto_[]; + + // YYDEFGOTO[NTERM-NUM]. + static const short yydefgoto_[]; + + // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + // positive, shift that token. If negative, reduce the rule whose + // number is the opposite. If YYTABLE_NINF, syntax error. + static const short yytable_[]; + + static const short yycheck_[]; + + // YYSTOS[STATE-NUM] -- The (internal number of the) accessing + // symbol of state STATE-NUM. + static const unsigned char yystos_[]; + + // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + static const unsigned char yyr1_[]; + + // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + static const signed char yyr2_[]; + + +#if IW7DEBUG + // YYRLINE[YYN] -- Source line where rule number YYN was defined. + static const short yyrline_[]; + /// Report on the debug stream that the rule \a r is going to be reduced. + virtual void yy_reduce_print_ (int r) const; + /// Print the state stack on the debug stream. + virtual void yy_stack_print_ () const; + + /// Debugging level. + int yydebug_; + /// Debug stream. + std::ostream* yycdebug_; + + /// \brief Display a symbol kind, value and location. + /// \param yyo The output stream. + /// \param yysym The symbol. + template + void yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const; +#endif + + /// \brief Reclaim the memory associated to a symbol. + /// \param yymsg Why this token is reclaimed. + /// If null, print nothing. + /// \param yysym The symbol. + template + void yy_destroy_ (const char* yymsg, basic_symbol& yysym) const; + + private: + /// Type access provider for state based symbols. + struct by_state + { + /// Default constructor. + by_state () YY_NOEXCEPT; + + /// The symbol kind as needed by the constructor. + typedef state_type kind_type; + + /// Constructor. + by_state (kind_type s) YY_NOEXCEPT; + + /// Copy constructor. + by_state (const by_state& that) YY_NOEXCEPT; + + /// Record that this symbol is empty. + void clear () YY_NOEXCEPT; + + /// Steal the symbol kind from \a that. + void move (by_state& that); + + /// The symbol kind (corresponding to \a state). + /// \a symbol_kind::S_YYEMPTY when empty. + symbol_kind_type kind () const YY_NOEXCEPT; + + /// The state number used to denote an empty symbol. + /// We use the initial state, as it does not have a value. + enum { empty_state = 0 }; + + /// The state. + /// \a empty when empty. + state_type state; + }; + + /// "Internal" symbol: element of the stack. + struct stack_symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + /// Construct an empty symbol. + stack_symbol_type (); + /// Move or copy construction. + stack_symbol_type (YY_RVREF (stack_symbol_type) that); + /// Steal the contents from \a sym to build this. + stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym); +#if YY_CPLUSPLUS < 201103L + /// Assignment, needed by push_back by some old implementations. + /// Moves the contents of that. + stack_symbol_type& operator= (stack_symbol_type& that); + + /// Assignment, needed by push_back by other implementations. + /// Needed by some other old implementations. + stack_symbol_type& operator= (const stack_symbol_type& that); +#endif + }; + + /// A stack with random access from its top. + template > + class stack + { + public: + // Hide our reversed order. + typedef typename S::iterator iterator; + typedef typename S::const_iterator const_iterator; + typedef typename S::size_type size_type; + typedef typename std::ptrdiff_t index_type; + + stack (size_type n = 200) + : seq_ (n) + {} + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + stack (const stack&) = delete; + /// Non copyable. + stack& operator= (const stack&) = delete; +#endif + + /// Random access. + /// + /// Index 0 returns the topmost element. + const T& + operator[] (index_type i) const + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Random access. + /// + /// Index 0 returns the topmost element. + T& + operator[] (index_type i) + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Steal the contents of \a t. + /// + /// Close to move-semantics. + void + push (YY_MOVE_REF (T) t) + { + seq_.push_back (T ()); + operator[] (0).move (t); + } + + /// Pop elements from the stack. + void + pop (std::ptrdiff_t n = 1) YY_NOEXCEPT + { + for (; 0 < n; --n) + seq_.pop_back (); + } + + /// Pop all elements from the stack. + void + clear () YY_NOEXCEPT + { + seq_.clear (); + } + + /// Number of elements on the stack. + index_type + size () const YY_NOEXCEPT + { + return index_type (seq_.size ()); + } + + /// Iterator on top of the stack (going downwards). + const_iterator + begin () const YY_NOEXCEPT + { + return seq_.begin (); + } + + /// Bottom of the stack. + const_iterator + end () const YY_NOEXCEPT + { + return seq_.end (); + } + + /// Present a slice of the top of a stack. + class slice + { + public: + slice (const stack& stack, index_type range) + : stack_ (stack) + , range_ (range) + {} + + const T& + operator[] (index_type i) const + { + return stack_[range_ - i]; + } + + private: + const stack& stack_; + index_type range_; + }; + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + stack (const stack&); + /// Non copyable. + stack& operator= (const stack&); +#endif + /// The wrapped container. + S seq_; + }; + + + /// Stack type. + typedef stack stack_type; + + /// The stack. + stack_type yystack_; + /// The stack for LAC. + /// Logically, the yy_lac_stack's lifetime is confined to the function + /// yy_lac_check_. We just store it as a member of this class to hold + /// on to the memory and to avoid frequent reallocations. + /// Since yy_lac_check_ is const, this member must be mutable. + mutable std::vector yylac_stack_; + /// Whether an initial LAC context was established. + bool yy_lac_established_; + + + /// Push a new state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param sym the symbol + /// \warning the contents of \a s.value is stolen. + void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym); + + /// Push a new look ahead token on the state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param s the state + /// \param sym the symbol (for its value and location). + /// \warning the contents of \a sym.value is stolen. + void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); + + /// Pop \a n symbols from the stack. + void yypop_ (int n = 1); + + /// Constants. + enum + { + yylast_ = 1580, ///< Last index in yytable_. + yynnts_ = 72, ///< Number of nonterminal symbols. + yyfinal_ = 15 ///< Termination state number. + }; + + + // User arguments. + yyscan_t yyscanner; + xsk::gsc::location& loc; + xsk::gsc::program_ptr& ast; + + }; + + inline + parser::symbol_kind_type + parser::yytranslate_ (int t) + { + return static_cast (t); + } + + // basic_symbol. + template + parser::basic_symbol::basic_symbol (const basic_symbol& that) + : Base (that) + , value () + , location (that.location) + { + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.copy< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.copy< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.copy< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.copy< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.copy< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.copy< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.copy< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.copy< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.copy< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.copy< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.copy< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.copy< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.copy< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.copy< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.copy< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.copy< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.copy< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.copy< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.copy< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.copy< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.copy< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.copy< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.copy< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.copy< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.copy< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.copy< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.copy< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.copy< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.copy< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.copy< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.copy< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.copy< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.copy< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.copy< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.copy< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.copy< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.copy< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.copy< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.copy< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.copy< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.copy< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.copy< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.copy< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.copy< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.copy< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.copy< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.copy< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.copy< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.copy< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.copy< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.copy< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.copy< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.copy< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + + } + + + + template + parser::symbol_kind_type + parser::basic_symbol::type_get () const YY_NOEXCEPT + { + return this->kind (); + } + + template + bool + parser::basic_symbol::empty () const YY_NOEXCEPT + { + return this->kind () == symbol_kind::S_YYEMPTY; + } + + template + void + parser::basic_symbol::move (basic_symbol& s) + { + super_type::move (s); + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (YY_MOVE (s.value)); + break; + + default: + break; + } + + location = YY_MOVE (s.location); + } + + // by_kind. + inline + parser::by_kind::by_kind () + : kind_ (symbol_kind::S_YYEMPTY) + {} + +#if 201103L <= YY_CPLUSPLUS + inline + parser::by_kind::by_kind (by_kind&& that) + : kind_ (that.kind_) + { + that.clear (); + } +#endif + + inline + parser::by_kind::by_kind (const by_kind& that) + : kind_ (that.kind_) + {} + + inline + parser::by_kind::by_kind (token_kind_type t) + : kind_ (yytranslate_ (t)) + {} + + inline + void + parser::by_kind::clear () YY_NOEXCEPT + { + kind_ = symbol_kind::S_YYEMPTY; + } + + inline + void + parser::by_kind::move (by_kind& that) + { + kind_ = that.kind_; + that.clear (); + } + + inline + parser::symbol_kind_type + parser::by_kind::kind () const YY_NOEXCEPT + { + return kind_; + } + + inline + parser::symbol_kind_type + parser::by_kind::type_get () const YY_NOEXCEPT + { + return this->kind (); + } + +#line 13 "parser.ypp" +} } } // xsk::gsc::iw7 +#line 4713 "parser.hpp" + + + + +#endif // !YY_IW7_PARSER_HPP_INCLUDED diff --git a/src/iw7/xsk/resolver.cpp b/src/iw7/xsk/resolver.cpp new file mode 100644 index 00000000..1b40f535 --- /dev/null +++ b/src/iw7/xsk/resolver.cpp @@ -0,0 +1,2702 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "iw7.hpp" + +namespace xsk::gsc::iw7 +{ + +std::unordered_map opcode_map; +std::unordered_map function_map; +std::unordered_map method_map; +std::unordered_map file_map; +std::unordered_map token_map; +std::unordered_map opcode_map_rev; +std::unordered_map function_map_rev; +std::unordered_map method_map_rev; +std::unordered_map file_map_rev; +std::unordered_map token_map_rev; + +auto resolver::opcode_id(const std::string& name) -> std::uint8_t +{ + const auto itr = opcode_map_rev.find(name); + + if (itr != opcode_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve opcode id for name '%s'!", name.data())); +} + +auto resolver::opcode_name(std::uint8_t id) -> std::string +{ + const auto itr = opcode_map.find(id); + + if (itr != opcode_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve opcode name for id '0x%hhX'!", id)); +} + +auto resolver::function_id(const std::string& name) -> std::uint16_t +{ + const auto itr = function_map_rev.find(name); + + if (itr != function_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin function id for name '%s'!", name.data())); +} + +auto resolver::function_name(std::uint16_t id) -> std::string +{ + const auto itr = function_map.find(id); + + if (itr != function_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin function name for id '%i'!", id)); +} + +auto resolver::method_id(const std::string& name) -> std::uint16_t +{ + const auto itr = method_map_rev.find(name); + + if (itr != method_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin method id for name '%s'!", name.data())); +} + +auto resolver::method_name(std::uint16_t id) -> std::string +{ + const auto itr = method_map.find(id); + + if (itr != method_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin method name for id '%i'!", id)); +} + +auto resolver::file_id(const std::string& name) -> std::uint32_t +{ + const auto itr = file_map_rev.find(name); + + if (itr != file_map_rev.end()) + { + return itr->second; + } + + return 0; +} + +auto resolver::file_name(std::uint32_t id) -> std::string +{ + const auto itr = file_map.find(id); + + if (itr != file_map.end()) + { + return itr->second; + } + + return utils::string::va("_ID%i", id); +} + +auto resolver::token_id(const std::string& name) -> std::uint32_t +{ + const auto itr = token_map_rev.find(name); + + if (itr != token_map_rev.end()) + { + return itr->second; + } + + return 0; +} + +auto resolver::token_name(std::uint32_t id) -> std::string +{ + const auto itr = token_map.find(id); + + if (itr != token_map.end()) + { + return itr->second; + } + + return utils::string::va("_ID%i", id); +} + +auto resolver::find_function(const std::string& name) -> bool +{ + const auto itr = function_map_rev.find(name); + + if (itr != function_map_rev.end()) + { + return true; + } + + return false; +} + +auto resolver::find_method(const std::string& name) -> bool +{ + const auto itr = method_map_rev.find(name); + + if (itr != method_map_rev.end()) + { + return true; + } + + return false; +} + +const std::array opcode_list +{{ + { std::uint8_t(opcode::OP_End),"END" }, + { std::uint8_t(opcode::OP_Return),"RETN" }, + { std::uint8_t(opcode::OP_GetByte),"GET_BYTE" }, + { std::uint8_t(opcode::OP_GetNegByte),"GET_NBYTE" }, + { std::uint8_t(opcode::OP_GetUnsignedShort),"GET_USHORT" }, + { std::uint8_t(opcode::OP_GetNegUnsignedShort),"GET_NUSHORT" }, + { std::uint8_t(opcode::OP_GetInteger),"GET_INT" }, + { std::uint8_t(opcode::OP_GetBuiltinFunction),"GET_BUILTIN_FUNC" }, + { std::uint8_t(opcode::OP_GetBuiltinMethod),"GET_BUILTIN_METHOD" }, + { std::uint8_t(opcode::OP_GetFloat),"GET_FLOAT" }, + { std::uint8_t(opcode::OP_GetString),"GET_STRING" }, + { std::uint8_t(opcode::OP_GetUndefined),"GET_UNDEFINED" }, + { std::uint8_t(opcode::OP_GetZero),"GET_ZERO" }, + { std::uint8_t(opcode::OP_waittillFrameEnd),"WAITTILLFRAMEEND" }, + { std::uint8_t(opcode::OP_CreateLocalVariable),"CREATE_LOCAL_VARIABLE" }, + { std::uint8_t(opcode::OP_RemoveLocalVariables),"REMOVE_LOCAL_VARIABLES" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached0),"EVAL_LOCAL_VARIABLE_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached1),"EVAL_LOCAL_VARIABLE_CACHED1" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached2),"EVAL_LOCAL_VARIABLE_CACHED2" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached3),"EVAL_LOCAL_VARIABLE_CACHED3" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached4),"EVAL_LOCAL_VARIABLE_CACHED4" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached5),"EVAL_LOCAL_VARIABLE_CACHED5" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached),"EVAL_LOCAL_VARIABLE_CACHED" }, + { std::uint8_t(opcode::OP_EvalLocalArrayCached),"EVAL_LOCAL_ARRAY_CACHED" }, + { std::uint8_t(opcode::OP_EvalArray),"EVAL_ARRAY" }, + { std::uint8_t(opcode::OP_EvalNewLocalArrayRefCached0),"EVAL_NEW_LOCAL_ARRAY_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalArrayRefCached0),"EVAL_LOCAL_ARRAY_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalArrayRefCached),"EVAL_LOCAL_ARRAY_REF_CACHED" }, + { std::uint8_t(opcode::OP_EvalArrayRef),"EVAL_ARRAY_REF" }, + { std::uint8_t(opcode::OP_ClearArray),"CLEAR_ARRAY" }, + { std::uint8_t(opcode::OP_EmptyArray),"EMPTY_ARRAY" }, + { std::uint8_t(opcode::OP_AddArray),"ADD_ARRAY" }, + { std::uint8_t(opcode::OP_PreScriptCall),"PRE_CALL" }, + { std::uint8_t(opcode::OP_ScriptLocalFunctionCall2),"CALL_LOCAL_FUNC2" }, + { std::uint8_t(opcode::OP_ScriptLocalFunctionCall),"CALL_LOCAL_FUNC" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodCall),"CALL_LOCAL_METHOD" }, + { std::uint8_t(opcode::OP_ScriptLocalThreadCall),"CALL_LOCAL_FUNC_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalChildThreadCall),"CALL_LOCAL_FUNC_CHILD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodThreadCall),"CALL_LOCAL_METHOD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodChildThreadCall),"CALL_LOCAL_METHOD_CHILD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptFarFunctionCall2),"CALL_FAR_FUNC2" }, + { std::uint8_t(opcode::OP_ScriptFarFunctionCall),"CALL_FAR_FUNC" }, + { std::uint8_t(opcode::OP_ScriptFarMethodCall),"CALL_FAR_METHOD" }, + { std::uint8_t(opcode::OP_ScriptFarThreadCall),"CALL_FAR_FUNC_THREAD" }, + { std::uint8_t(opcode::OP_ScriptFarChildThreadCall),"CALL_FAR_FUNC_CHILD_THREAD"}, + { std::uint8_t(opcode::OP_ScriptFarMethodThreadCall),"CALL_FAR_METHOD_THEAD" }, + { std::uint8_t(opcode::OP_ScriptFarMethodChildThreadCall),"CALL_FAR_METHOD_CHILD_THEAD" }, + { std::uint8_t(opcode::OP_ScriptFunctionCallPointer),"CALL_FUNC_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodCallPointer),"CALL_METHOD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptThreadCallPointer),"CALL_FUNC_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptChildThreadCallPointer),"CALL_FUNC_CHILD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodThreadCallPointer),"CALL_METHOD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodChildThreadCallPointer),"CALL_METHOD_CHILD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_CallBuiltinPointer),"CALL_BUILTIN_FUNC_POINTER" }, + { std::uint8_t(opcode::OP_CallBuiltinMethodPointer),"CALL_BUILTIN_METHOD_POINTER" }, + { std::uint8_t(opcode::OP_GetIString),"GET_ISTRING" }, + { std::uint8_t(opcode::OP_GetVector),"GET_VECTOR" }, + { std::uint8_t(opcode::OP_GetLevelObject),"GET_LEVEL_OBJ" }, + { std::uint8_t(opcode::OP_GetAnimObject),"GET_ANIM_OBJ" }, + { std::uint8_t(opcode::OP_GetSelf),"GET_SELF" }, + { std::uint8_t(opcode::OP_GetThisthread),"GET_THISTHREAD" }, + { std::uint8_t(opcode::OP_GetLevel),"GET_LEVEL" }, + { std::uint8_t(opcode::OP_GetGame),"GET_GAME" }, + { std::uint8_t(opcode::OP_GetAnim),"GET_ANIM" }, + { std::uint8_t(opcode::OP_GetAnimation),"GET_ANIMATION" }, + { std::uint8_t(opcode::OP_GetGameRef),"GET_GAME_REF" }, + { std::uint8_t(opcode::OP_inc),"INC" }, + { std::uint8_t(opcode::OP_dec),"DEC" }, + { std::uint8_t(opcode::OP_bit_or),"BIT_OR" }, + { std::uint8_t(opcode::OP_JumpOnFalseExpr),"JMP_EXPR_FALSE" }, + { std::uint8_t(opcode::OP_bit_ex_or),"BIT_EXOR" }, + { std::uint8_t(opcode::OP_bit_and),"BIT_AND" }, + { std::uint8_t(opcode::OP_equality),"EQUALITY" }, + { std::uint8_t(opcode::OP_inequality),"INEQUALITY" }, + { std::uint8_t(opcode::OP_less),"LESS" }, + { std::uint8_t(opcode::OP_greater),"GREATER" }, + { std::uint8_t(opcode::OP_JumpOnTrueExpr),"JMP_EXPR_TRUE" }, + { std::uint8_t(opcode::OP_less_equal),"LESSEQUAL" }, + { std::uint8_t(opcode::OP_jumpback),"JMP_BACK" }, + { std::uint8_t(opcode::OP_waittillmatch2),"WAITTILLMATCH2" }, + { std::uint8_t(opcode::OP_waittill),"WAITTILL" }, + { std::uint8_t(opcode::OP_notify),"NOTIFY" }, + { std::uint8_t(opcode::OP_endon),"ENDON" }, + { std::uint8_t(opcode::OP_voidCodepos),"VOIDCODEPOS" }, + { std::uint8_t(opcode::OP_switch),"SWITCH" }, + { std::uint8_t(opcode::OP_endswitch),"ENDSWITCH" }, + { std::uint8_t(opcode::OP_vector),"VECTOR" }, + { std::uint8_t(opcode::OP_JumpOnFalse),"JMP_FALSE" }, + { std::uint8_t(opcode::OP_greater_equal),"GREATEREQUAL" }, + { std::uint8_t(opcode::OP_shift_left),"SHIFT_LEFT" }, + { std::uint8_t(opcode::OP_shift_right),"SHIFT_RIGHT" }, + { std::uint8_t(opcode::OP_plus),"PLUS" }, + { std::uint8_t(opcode::OP_jump),"JMP" }, + { std::uint8_t(opcode::OP_minus),"MINUS" }, + { std::uint8_t(opcode::OP_multiply),"MULT" }, + { std::uint8_t(opcode::OP_divide),"DIV" }, + { std::uint8_t(opcode::OP_mod),"MOD" }, + { std::uint8_t(opcode::OP_JumpOnTrue),"JMP_TRUE" }, + { std::uint8_t(opcode::OP_size),"SIZE" }, + { std::uint8_t(opcode::OP_waittillmatch),"WAITTILLMATCH" }, + { std::uint8_t(opcode::OP_GetLocalFunction),"GET_LOCAL_FUNC" }, + { std::uint8_t(opcode::OP_GetFarFunction),"GET_FAR_FUNC" }, + { std::uint8_t(opcode::OP_GetSelfObject),"GET_SELF_OBJ" }, + { std::uint8_t(opcode::OP_EvalLevelFieldVariable),"EVAL_LEVEL_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalAnimFieldVariable),"EVAL_ANIM_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalSelfFieldVariable),"EVAL_SELF_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalFieldVariable),"EVAL_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalLevelFieldVariableRef),"EVAL_LEVEL_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalAnimFieldVariableRef),"EVAL_ANIM_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalSelfFieldVariableRef),"EVAL_SELF_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalFieldVariableRef),"EVAL_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_ClearFieldVariable),"CLEAR_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_SafeCreateVariableFieldCached),"SAFE_CREATE_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_SafeSetVariableFieldCached0),"SAFE_SET_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SafeSetVariableFieldCached),"SAFE_SET_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_SafeSetWaittillVariableFieldCached),"SAFE_SET_WAITTILL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_GetAnimTree),"GET_ANIMTREE" }, + { std::uint8_t(opcode::OP_clearparams),"CLEAR_PARAMS" }, + { std::uint8_t(opcode::OP_checkclearparams),"CHECK_CLEAR_PARAMS" }, + { std::uint8_t(opcode::OP_EvalLocalVariableRefCached0),"EVAL_LOCAL_VARIABLE_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalNewLocalVariableRefCached0),"EVAL_NEW_LOCAL_VARIABLE_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalVariableRefCached),"EVAL_LOCAL_VARIABLE_REF_CACHED" }, + { std::uint8_t(opcode::OP_SetLevelFieldVariableField),"SET_LEVEL_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetVariableField),"SET_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_ClearVariableField),"CLEAR_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetAnimFieldVariableField),"SET_ANIM_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetSelfFieldVariableField),"SET_SELF_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetLocalVariableFieldCached0),"SET_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SetNewLocalVariableFieldCached0),"SET_NEW_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SetLocalVariableFieldCached),"SET_LOCAL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_ClearLocalVariableFieldCached),"CLEAR_LOCAL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_ClearLocalVariableFieldCached0),"CLEAR_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_CallBuiltin0),"CALL_BUILTIN_FUNC_0" }, + { std::uint8_t(opcode::OP_CallBuiltin1),"CALL_BUILTIN_FUNC_1" }, + { std::uint8_t(opcode::OP_CallBuiltin2),"CALL_BUILTIN_FUNC_2" }, + { std::uint8_t(opcode::OP_CallBuiltin3),"CALL_BUILTIN_FUNC_3" }, + { std::uint8_t(opcode::OP_CallBuiltin4),"CALL_BUILTIN_FUNC_4" }, + { std::uint8_t(opcode::OP_CallBuiltin5),"CALL_BUILTIN_FUNC_5" }, + { std::uint8_t(opcode::OP_CallBuiltin),"CALL_BUILTIN_FUNC" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod0),"CALL_BUILTIN_METHOD_0" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod1),"CALL_BUILTIN_METHOD_1" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod2),"CALL_BUILTIN_METHOD_2" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod3),"CALL_BUILTIN_METHOD_3" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod4),"CALL_BUILTIN_METHOD_4" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod5),"CALL_BUILTIN_METHOD_5" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod),"CALL_BUILTIN_METHOD" }, + { std::uint8_t(opcode::OP_wait),"WAIT" }, + { std::uint8_t(opcode::OP_DecTop),"DEC_TOP" }, + { std::uint8_t(opcode::OP_CastFieldObject),"CAST_FIELD_OBJ" }, + { std::uint8_t(opcode::OP_EvalLocalVariableObjectCached),"EVAL_LOCAL_VARIABLE_OBJECT_CACHED" }, + { std::uint8_t(opcode::OP_CastBool),"CAST_BOOL" }, + { std::uint8_t(opcode::OP_BoolNot),"BOOL_NOT" }, + { std::uint8_t(opcode::OP_BoolComplement),"BOOL_COMPLEMENT" }, +}}; + +const std::array function_list +{{ + { 0x001, "_func_001" }, + { 0x002, "_func_002" }, + { 0x003, "_func_003" }, + { 0x004, "_func_004" }, + { 0x005, "_func_005" }, + { 0x006, "_func_006" }, + { 0x007, "_func_007" }, + { 0x008, "_func_008" }, + { 0x009, "_func_009" }, + { 0x00A, "_func_00A" }, + { 0x00B, "_func_00B" }, + { 0x00C, "_func_00C" }, + { 0x00D, "_func_00D" }, + { 0x00E, "_func_00E" }, + { 0x00F, "_func_00F" }, + { 0x010, "_func_010" }, + { 0x011, "_func_011" }, + { 0x012, "_func_012" }, + { 0x013, "_func_013" }, + { 0x014, "_func_014" }, + { 0x015, "_func_015" }, + { 0x016, "_func_016" }, + { 0x017, "_func_017" }, + { 0x018, "_func_018" }, + { 0x019, "_func_019" }, + { 0x01A, "_func_01A" }, + { 0x01B, "_func_01B" }, + { 0x01C, "_func_01C" }, + { 0x01D, "_func_01D" }, + { 0x01E, "_func_01E" }, + { 0x01F, "_func_01F" }, + { 0x020, "_func_020" }, + { 0x021, "_func_021" }, + { 0x022, "_func_022" }, + { 0x023, "_func_023" }, + { 0x024, "_func_024" }, + { 0x025, "_func_025" }, + { 0x026, "_func_026" }, + { 0x027, "_func_027" }, + { 0x028, "_func_028" }, + { 0x029, "_func_029" }, + { 0x02A, "_func_02A" }, + { 0x02B, "_func_02B" }, + { 0x02C, "_func_02C" }, + { 0x02D, "_func_02D" }, + { 0x02E, "_func_02E" }, + { 0x02F, "_func_02F" }, + { 0x030, "_func_030" }, + { 0x031, "_func_031" }, + { 0x032, "_func_032" }, + { 0x033, "_func_033" }, + { 0x034, "_func_034" }, + { 0x035, "_func_035" }, + { 0x036, "_func_036" }, + { 0x037, "_func_037" }, + { 0x038, "_func_038" }, + { 0x039, "_func_039" }, + { 0x03A, "_func_03A" }, + { 0x03B, "_func_03B" }, + { 0x03C, "_func_03C" }, + { 0x03D, "_func_03D" }, + { 0x03E, "_func_03E" }, + { 0x03F, "_func_03F" }, + { 0x040, "_func_040" }, + { 0x041, "_func_041" }, + { 0x042, "_func_042" }, + { 0x043, "_func_043" }, + { 0x044, "_func_044" }, + { 0x045, "_func_045" }, + { 0x046, "_func_046" }, + { 0x047, "_func_047" }, + { 0x048, "_func_048" }, + { 0x049, "_func_049" }, + { 0x04A, "_func_04A" }, + { 0x04B, "_func_04B" }, + { 0x04C, "_func_04C" }, + { 0x04D, "_func_04D" }, + { 0x04E, "_func_04E" }, + { 0x04F, "_func_04F" }, + { 0x050, "_func_050" }, + { 0x051, "_func_051" }, + { 0x052, "_func_052" }, + { 0x053, "_func_053" }, + { 0x054, "_func_054" }, + { 0x055, "_func_055" }, + { 0x056, "_func_056" }, + { 0x057, "_func_057" }, + { 0x058, "_func_058" }, + { 0x059, "_func_059" }, + { 0x05A, "_func_05A" }, + { 0x05B, "_func_05B" }, + { 0x05C, "_func_05C" }, + { 0x05D, "_func_05D" }, + { 0x05E, "_func_05E" }, + { 0x05F, "_func_05F" }, + { 0x060, "_func_060" }, + { 0x061, "_func_061" }, + { 0x062, "_func_062" }, + { 0x063, "_func_063" }, + { 0x064, "_func_064" }, + { 0x065, "_func_065" }, + { 0x066, "_func_066" }, + { 0x067, "_func_067" }, + { 0x068, "_func_068" }, + { 0x069, "_func_069" }, + { 0x06A, "_func_06A" }, + { 0x06B, "_func_06B" }, + { 0x06C, "_func_06C" }, + { 0x06D, "_func_06D" }, + { 0x06E, "_func_06E" }, + { 0x06F, "_func_06F" }, + { 0x070, "_func_070" }, + { 0x071, "_func_071" }, + { 0x072, "_func_072" }, + { 0x073, "_func_073" }, + { 0x074, "_func_074" }, + { 0x075, "_func_075" }, + { 0x076, "_func_076" }, + { 0x077, "_func_077" }, + { 0x078, "_func_078" }, + { 0x079, "_func_079" }, + { 0x07A, "_func_07A" }, + { 0x07B, "_func_07B" }, + { 0x07C, "_func_07C" }, + { 0x07D, "_func_07D" }, + { 0x07E, "_func_07E" }, + { 0x07F, "_func_07F" }, + { 0x080, "_func_080" }, + { 0x081, "_func_081" }, + { 0x082, "_func_082" }, + { 0x083, "_func_083" }, + { 0x084, "_func_084" }, + { 0x085, "_func_085" }, + { 0x086, "_func_086" }, + { 0x087, "_func_087" }, + { 0x088, "_func_088" }, + { 0x089, "_func_089" }, + { 0x08A, "_func_08A" }, + { 0x08B, "_func_08B" }, + { 0x08C, "_func_08C" }, + { 0x08D, "_func_08D" }, + { 0x08E, "_func_08E" }, + { 0x08F, "_func_08F" }, + { 0x090, "_func_090" }, + { 0x091, "_func_091" }, + { 0x092, "_func_092" }, + { 0x093, "_func_093" }, + { 0x094, "_func_094" }, + { 0x095, "_func_095" }, + { 0x096, "_func_096" }, + { 0x097, "_func_097" }, + { 0x098, "_func_098" }, + { 0x099, "_func_099" }, + { 0x09A, "_func_09A" }, + { 0x09B, "_func_09B" }, + { 0x09C, "getfirstarraykey" }, + { 0x09D, "_func_09D" }, + { 0x09E, "_func_09E" }, + { 0x09F, "_func_09F" }, + { 0x0A0, "_func_0A0" }, + { 0x0A1, "_func_0A1" }, + { 0x0A2, "_func_0A2" }, + { 0x0A3, "_func_0A3" }, + { 0x0A4, "_func_0A4" }, + { 0x0A5, "_func_0A5" }, + { 0x0A6, "_func_0A6" }, + { 0x0A7, "_func_0A7" }, + { 0x0A8, "_func_0A8" }, + { 0x0A9, "_func_0A9" }, + { 0x0AA, "_func_0AA" }, + { 0x0AB, "_func_0AB" }, + { 0x0AC, "_func_0AC" }, + { 0x0AD, "_func_0AD" }, + { 0x0AE, "_func_0AE" }, + { 0x0AF, "_func_0AF" }, + { 0x0B0, "_func_0B0" }, + { 0x0B1, "_func_0B1" }, + { 0x0B2, "getnextarraykey" }, + { 0x0B3, "_func_0B3" }, + { 0x0B4, "_func_0B4" }, + { 0x0B5, "_func_0B5" }, + { 0x0B6, "_func_0B6" }, + { 0x0B7, "_func_0B7" }, + { 0x0B8, "_func_0B8" }, + { 0x0B9, "_func_0B9" }, + { 0x0BA, "_func_0BA" }, + { 0x0BB, "_func_0BB" }, + { 0x0BC, "_func_0BC" }, + { 0x0BD, "_func_0BD" }, + { 0x0BE, "_func_0BE" }, + { 0x0BF, "_func_0BF" }, + { 0x0C0, "_func_0C0" }, + { 0x0C1, "_func_0C1" }, + { 0x0C2, "_func_0C2" }, + { 0x0C3, "_func_0C3" }, + { 0x0C4, "_func_0C4" }, + { 0x0C5, "_func_0C5" }, + { 0x0C6, "_func_0C6" }, + { 0x0C7, "_func_0C7" }, + { 0x0C8, "_func_0C8" }, + { 0x0C9, "_func_0C9" }, + { 0x0CA, "_func_0CA" }, + { 0x0CB, "_func_0CB" }, + { 0x0CC, "_func_0CC" }, + { 0x0CD, "_func_0CD" }, + { 0x0CE, "_func_0CE" }, + { 0x0CF, "_func_0CF" }, + { 0x0D0, "_func_0D0" }, + { 0x0D1, "_func_0D1" }, + { 0x0D2, "_func_0D2" }, + { 0x0D3, "_func_0D3" }, + { 0x0D4, "_func_0D4" }, + { 0x0D5, "_func_0D5" }, + { 0x0D6, "_func_0D6" }, + { 0x0D7, "_func_0D7" }, + { 0x0D8, "_func_0D8" }, + { 0x0D9, "_func_0D9" }, + { 0x0DA, "_func_0DA" }, + { 0x0DB, "_func_0DB" }, + { 0x0DC, "_func_0DC" }, + { 0x0DD, "_func_0DD" }, + { 0x0DE, "_func_0DE" }, + { 0x0DF, "_func_0DF" }, + { 0x0E0, "_func_0E0" }, + { 0x0E1, "_func_0E1" }, + { 0x0E2, "_func_0E2" }, + { 0x0E3, "_func_0E3" }, + { 0x0E4, "_func_0E4" }, + { 0x0E5, "_func_0E5" }, + { 0x0E6, "_func_0E6" }, + { 0x0E7, "_func_0E7" }, + { 0x0E8, "_func_0E8" }, + { 0x0E9, "_func_0E9" }, + { 0x0EA, "_func_0EA" }, + { 0x0EB, "_func_0EB" }, + { 0x0EC, "_func_0EC" }, + { 0x0ED, "_func_0ED" }, + { 0x0EE, "_func_0EE" }, + { 0x0EF, "_func_0EF" }, + { 0x0F0, "_func_0F0" }, + { 0x0F1, "_func_0F1" }, + { 0x0F2, "_func_0F2" }, + { 0x0F3, "_func_0F3" }, + { 0x0F4, "_func_0F4" }, + { 0x0F5, "_func_0F5" }, + { 0x0F6, "_func_0F6" }, + { 0x0F7, "_func_0F7" }, + { 0x0F8, "_func_0F8" }, + { 0x0F9, "_func_0F9" }, + { 0x0FA, "_func_0FA" }, + { 0x0FB, "_func_0FB" }, + { 0x0FC, "_func_0FC" }, + { 0x0FD, "_func_0FD" }, + { 0x0FE, "_func_0FE" }, + { 0x0FF, "_func_0FF" }, + { 0x100, "_func_100" }, + { 0x101, "_func_101" }, + { 0x102, "_func_102" }, + { 0x103, "_func_103" }, + { 0x104, "isdefined" }, + { 0x105, "_func_105" }, + { 0x106, "_func_106" }, + { 0x107, "_func_107" }, + { 0x108, "_func_108" }, + { 0x109, "_func_109" }, + { 0x10A, "_func_10A" }, + { 0x10B, "_func_10B" }, + { 0x10C, "_func_10C" }, + { 0x10D, "_func_10D" }, + { 0x10E, "_func_10E" }, + { 0x10F, "_func_10F" }, + { 0x110, "_func_110" }, + { 0x111, "_func_111" }, + { 0x112, "_func_112" }, + { 0x113, "_func_113" }, + { 0x114, "_func_114" }, + { 0x115, "_func_115" }, + { 0x116, "_func_116" }, + { 0x117, "_func_117" }, + { 0x118, "_func_118" }, + { 0x119, "_func_119" }, + { 0x11A, "_func_11A" }, + { 0x11B, "_func_11B" }, + { 0x11C, "_func_11C" }, + { 0x11D, "_func_11D" }, + { 0x11E, "_func_11E" }, + { 0x11F, "_func_11F" }, + { 0x120, "_func_120" }, + { 0x121, "_func_121" }, + { 0x122, "_func_122" }, + { 0x123, "_func_123" }, + { 0x124, "_func_124" }, + { 0x125, "_func_125" }, + { 0x126, "_func_126" }, + { 0x127, "_func_127" }, + { 0x128, "_func_128" }, + { 0x129, "_func_129" }, + { 0x12A, "_func_12A" }, + { 0x12B, "_func_12B" }, + { 0x12C, "_func_12C" }, + { 0x12D, "_func_12D" }, + { 0x12E, "_func_12E" }, + { 0x12F, "_func_12F" }, + { 0x130, "_func_130" }, + { 0x131, "_func_131" }, + { 0x132, "_func_132" }, + { 0x133, "_func_133" }, + { 0x134, "_func_134" }, + { 0x135, "_func_135" }, + { 0x136, "_func_136" }, + { 0x137, "_func_137" }, + { 0x138, "_func_138" }, + { 0x139, "_func_139" }, + { 0x13A, "_func_13A" }, + { 0x13B, "_func_13B" }, + { 0x13C, "_func_13C" }, + { 0x13D, "_func_13D" }, + { 0x13E, "_func_13E" }, + { 0x13F, "_func_13F" }, + { 0x140, "_func_140" }, + { 0x141, "_func_141" }, + { 0x142, "_func_142" }, + { 0x143, "_func_143" }, + { 0x144, "_func_144" }, + { 0x145, "_func_145" }, + { 0x146, "_func_146" }, + { 0x147, "_func_147" }, + { 0x148, "_func_148" }, + { 0x149, "_func_149" }, + { 0x14A, "_func_14A" }, + { 0x14B, "_func_14B" }, + { 0x14C, "_func_14C" }, + { 0x14D, "_func_14D" }, + { 0x14E, "_func_14E" }, + { 0x14F, "_func_14F" }, + { 0x150, "_func_150" }, + { 0x151, "_func_151" }, + { 0x152, "_func_152" }, + { 0x153, "_func_153" }, + { 0x154, "_func_154" }, + { 0x155, "_func_155" }, + { 0x156, "_func_156" }, + { 0x157, "_func_157" }, + { 0x158, "_func_158" }, + { 0x159, "_func_159" }, + { 0x15A, "_func_15A" }, + { 0x15B, "_func_15B" }, + { 0x15C, "_func_15C" }, + { 0x15D, "_func_15D" }, + { 0x15E, "_func_15E" }, + { 0x15F, "_func_15F" }, + { 0x160, "_func_160" }, + { 0x161, "_func_161" }, + { 0x162, "_func_162" }, + { 0x163, "_func_163" }, + { 0x164, "_func_164" }, + { 0x165, "_func_165" }, + { 0x166, "_func_166" }, + { 0x167, "_func_167" }, + { 0x168, "_func_168" }, + { 0x169, "_func_169" }, + { 0x16A, "_func_16A" }, + { 0x16B, "_func_16B" }, + { 0x16C, "_func_16C" }, + { 0x16D, "_func_16D" }, + { 0x16E, "_func_16E" }, + { 0x16F, "_func_16F" }, + { 0x170, "_func_170" }, + { 0x171, "_func_171" }, + { 0x172, "_func_172" }, + { 0x173, "_func_173" }, + { 0x174, "_func_174" }, + { 0x175, "_func_175" }, + { 0x176, "_func_176" }, + { 0x177, "_func_177" }, + { 0x178, "_func_178" }, + { 0x179, "_func_179" }, + { 0x17A, "_func_17A" }, + { 0x17B, "_func_17B" }, + { 0x17C, "_func_17C" }, + { 0x17D, "_func_17D" }, + { 0x17E, "_func_17E" }, + { 0x17F, "_func_17F" }, + { 0x180, "_func_180" }, + { 0x181, "_func_181" }, + { 0x182, "_func_182" }, + { 0x183, "_func_183" }, + { 0x184, "_func_184" }, + { 0x185, "_func_185" }, + { 0x186, "_func_186" }, + { 0x187, "_func_187" }, + { 0x188, "_func_188" }, + { 0x189, "_func_189" }, + { 0x18A, "_func_18A" }, + { 0x18B, "_func_18B" }, + { 0x18C, "_func_18C" }, + { 0x18D, "_func_18D" }, + { 0x18E, "_func_18E" }, + { 0x18F, "_func_18F" }, + { 0x190, "_func_190" }, + { 0x191, "_func_191" }, + { 0x192, "_func_192" }, + { 0x193, "_func_193" }, + { 0x194, "_func_194" }, + { 0x195, "_func_195" }, + { 0x196, "_func_196" }, + { 0x197, "_func_197" }, + { 0x198, "_func_198" }, + { 0x199, "_func_199" }, + { 0x19A, "_func_19A" }, + { 0x19B, "_func_19B" }, + { 0x19C, "_func_19C" }, + { 0x19D, "_func_19D" }, + { 0x19E, "_func_19E" }, + { 0x19F, "_func_19F" }, + { 0x1A0, "_func_1A0" }, + { 0x1A1, "_func_1A1" }, + { 0x1A2, "_func_1A2" }, + { 0x1A3, "_func_1A3" }, + { 0x1A4, "_func_1A4" }, + { 0x1A5, "_func_1A5" }, + { 0x1A6, "_func_1A6" }, + { 0x1A7, "_func_1A7" }, + { 0x1A8, "_func_1A8" }, + { 0x1A9, "_func_1A9" }, + { 0x1AA, "_func_1AA" }, + { 0x1AB, "_func_1AB" }, + { 0x1AC, "_func_1AC" }, + { 0x1AD, "_func_1AD" }, + { 0x1AE, "_func_1AE" }, + { 0x1AF, "_func_1AF" }, + { 0x1B0, "_func_1B0" }, + { 0x1B1, "_func_1B1" }, + { 0x1B2, "_func_1B2" }, + { 0x1B3, "_func_1B3" }, + { 0x1B4, "_func_1B4" }, + { 0x1B5, "_func_1B5" }, + { 0x1B6, "_func_1B6" }, + { 0x1B7, "_func_1B7" }, + { 0x1B8, "_func_1B8" }, + { 0x1B9, "_func_1B9" }, + { 0x1BA, "_func_1BA" }, + { 0x1BB, "_func_1BB" }, + { 0x1BC, "_func_1BC" }, + { 0x1BD, "_func_1BD" }, + { 0x1BE, "_func_1BE" }, + { 0x1BF, "_func_1BF" }, + { 0x1C0, "_func_1C0" }, + { 0x1C1, "_func_1C1" }, + { 0x1C2, "_func_1C2" }, + { 0x1C3, "_func_1C3" }, + { 0x1C4, "_func_1C4" }, + { 0x1C5, "_func_1C5" }, + { 0x1C6, "_func_1C6" }, + { 0x1C7, "_func_1C7" }, + { 0x1C8, "_func_1C8" }, + { 0x1C9, "_func_1C9" }, + { 0x1CA, "_func_1CA" }, + { 0x1CB, "_func_1CB" }, + { 0x1CC, "_func_1CC" }, + { 0x1CD, "_func_1CD" }, + { 0x1CE, "_func_1CE" }, + { 0x1CF, "_func_1CF" }, + { 0x1D0, "_func_1D0" }, + { 0x1D1, "_func_1D1" }, + { 0x1D2, "_func_1D2" }, + { 0x1D3, "_func_1D3" }, + { 0x1D4, "_func_1D4" }, + { 0x1D5, "_func_1D5" }, + { 0x1D6, "_func_1D6" }, + { 0x1D7, "_func_1D7" }, + { 0x1D8, "_func_1D8" }, + { 0x1D9, "_func_1D9" }, + { 0x1DA, "_func_1DA" }, + { 0x1DB, "_func_1DB" }, + { 0x1DC, "_func_1DC" }, + { 0x1DD, "_func_1DD" }, + { 0x1DE, "_func_1DE" }, + { 0x1DF, "_func_1DF" }, + { 0x1E0, "_func_1E0" }, + { 0x1E1, "_func_1E1" }, + { 0x1E2, "_func_1E2" }, + { 0x1E3, "_func_1E3" }, + { 0x1E4, "_func_1E4" }, + { 0x1E5, "_func_1E5" }, + { 0x1E6, "_func_1E6" }, + { 0x1E7, "_func_1E7" }, + { 0x1E8, "_func_1E8" }, + { 0x1E9, "_func_1E9" }, + { 0x1EA, "_func_1EA" }, + { 0x1EB, "_func_1EB" }, + { 0x1EC, "_func_1EC" }, + { 0x1ED, "_func_1ED" }, + { 0x1EE, "_func_1EE" }, + { 0x1EF, "_func_1EF" }, + { 0x1F0, "_func_1F0" }, + { 0x1F1, "_func_1F1" }, + { 0x1F2, "_func_1F2" }, + { 0x1F3, "_func_1F3" }, + { 0x1F4, "_func_1F4" }, + { 0x1F5, "_func_1F5" }, + { 0x1F6, "_func_1F6" }, + { 0x1F7, "_func_1F7" }, + { 0x1F8, "_func_1F8" }, + { 0x1F9, "_func_1F9" }, + { 0x1FA, "_func_1FA" }, + { 0x1FB, "_func_1FB" }, + { 0x1FC, "_func_1FC" }, + { 0x1FD, "_func_1FD" }, + { 0x1FE, "_func_1FE" }, + { 0x1FF, "_func_1FF" }, + { 0x200, "_func_200" }, + { 0x201, "_func_201" }, + { 0x202, "_func_202" }, + { 0x203, "_func_203" }, + { 0x204, "_func_204" }, + { 0x205, "_func_205" }, + { 0x206, "_func_206" }, + { 0x207, "_func_207" }, + { 0x208, "_func_208" }, + { 0x209, "_func_209" }, + { 0x20A, "_func_20A" }, + { 0x20B, "_func_20B" }, + { 0x20C, "_func_20C" }, + { 0x20D, "_func_20D" }, + { 0x20E, "_func_20E" }, + { 0x20F, "_func_20F" }, + { 0x210, "_func_210" }, + { 0x211, "_func_211" }, + { 0x212, "_func_212" }, + { 0x213, "_func_213" }, + { 0x214, "_func_214" }, + { 0x215, "_func_215" }, + { 0x216, "_func_216" }, + { 0x217, "_func_217" }, + { 0x218, "_func_218" }, + { 0x219, "_func_219" }, + { 0x21A, "_func_21A" }, + { 0x21B, "_func_21B" }, + { 0x21C, "_func_21C" }, + { 0x21D, "_func_21D" }, + { 0x21E, "_func_21E" }, + { 0x21F, "_func_21F" }, + { 0x220, "_func_220" }, + { 0x221, "_func_221" }, + { 0x222, "_func_222" }, + { 0x223, "_func_223" }, + { 0x224, "_func_224" }, + { 0x225, "_func_225" }, + { 0x226, "_func_226" }, + { 0x227, "_func_227" }, + { 0x228, "_func_228" }, + { 0x229, "_func_229" }, + { 0x22A, "_func_22A" }, + { 0x22B, "_func_22B" }, + { 0x22C, "_func_22C" }, + { 0x22D, "_func_22D" }, + { 0x22E, "_func_22E" }, + { 0x22F, "_func_22F" }, + { 0x230, "_func_230" }, + { 0x231, "_func_231" }, + { 0x232, "_func_232" }, + { 0x233, "_func_233" }, + { 0x234, "_func_234" }, + { 0x235, "_func_235" }, + { 0x236, "_func_236" }, + { 0x237, "_func_237" }, + { 0x238, "_func_238" }, + { 0x239, "_func_239" }, + { 0x23A, "_func_23A" }, + { 0x23B, "_func_23B" }, + { 0x23C, "_func_23C" }, + { 0x23D, "_func_23D" }, + { 0x23E, "_func_23E" }, + { 0x23F, "_func_23F" }, + { 0x240, "_func_240" }, + { 0x241, "_func_241" }, + { 0x242, "_func_242" }, + { 0x243, "_func_243" }, + { 0x244, "_func_244" }, + { 0x245, "_func_245" }, + { 0x246, "_func_246" }, + { 0x247, "_func_247" }, + { 0x248, "_func_248" }, + { 0x249, "_func_249" }, + { 0x24A, "_func_24A" }, + { 0x24B, "_func_24B" }, + { 0x24C, "_func_24C" }, + { 0x24D, "_func_24D" }, + { 0x24E, "_func_24E" }, + { 0x24F, "_func_24F" }, + { 0x250, "_func_250" }, + { 0x251, "_func_251" }, + { 0x252, "_func_252" }, + { 0x253, "_func_253" }, + { 0x254, "_func_254" }, + { 0x255, "_func_255" }, + { 0x256, "_func_256" }, + { 0x257, "_func_257" }, + { 0x258, "_func_258" }, + { 0x259, "_func_259" }, + { 0x25A, "_func_25A" }, + { 0x25B, "_func_25B" }, + { 0x25C, "_func_25C" }, + { 0x25D, "_func_25D" }, + { 0x25E, "_func_25E" }, + { 0x25F, "_func_25F" }, + { 0x260, "_func_260" }, + { 0x261, "_func_261" }, + { 0x262, "_func_262" }, + { 0x263, "_func_263" }, + { 0x264, "_func_264" }, + { 0x265, "_func_265" }, + { 0x266, "_func_266" }, + { 0x267, "_func_267" }, + { 0x268, "_func_268" }, + { 0x269, "_func_269" }, + { 0x26A, "_func_26A" }, + { 0x26B, "_func_26B" }, + { 0x26C, "_func_26C" }, + { 0x26D, "_func_26D" }, + { 0x26E, "_func_26E" }, + { 0x26F, "_func_26F" }, + { 0x270, "_func_270" }, + { 0x271, "_func_271" }, + { 0x272, "_func_272" }, + { 0x273, "_func_273" }, + { 0x274, "_func_274" }, + { 0x275, "_func_275" }, + { 0x276, "_func_276" }, + { 0x277, "_func_277" }, + { 0x278, "_func_278" }, + { 0x279, "_func_279" }, + { 0x27A, "_func_27A" }, + { 0x27B, "_func_27B" }, + { 0x27C, "_func_27C" }, + { 0x27D, "_func_27D" }, + { 0x27E, "_func_27E" }, + { 0x27F, "_func_27F" }, + { 0x280, "_func_280" }, + { 0x281, "_func_281" }, + { 0x282, "_func_282" }, + { 0x283, "_func_283" }, + { 0x284, "_func_284" }, + { 0x285, "_func_285" }, + { 0x286, "_func_286" }, + { 0x287, "_func_287" }, + { 0x288, "_func_288" }, + { 0x289, "_func_289" }, + { 0x28A, "_func_28A" }, + { 0x28B, "_func_28B" }, + { 0x28C, "_func_28C" }, + { 0x28D, "_func_28D" }, + { 0x28E, "_func_28E" }, + { 0x28F, "_func_28F" }, + { 0x290, "_func_290" }, + { 0x291, "_func_291" }, + { 0x292, "_func_292" }, + { 0x293, "_func_293" }, + { 0x294, "_func_294" }, + { 0x295, "_func_295" }, + { 0x296, "_func_296" }, + { 0x297, "_func_297" }, + { 0x298, "_func_298" }, + { 0x299, "_func_299" }, + { 0x29A, "_func_29A" }, + { 0x29B, "_func_29B" }, + { 0x29C, "_func_29C" }, + { 0x29D, "_func_29D" }, + { 0x29E, "_func_29E" }, + { 0x29F, "_func_29F" }, + { 0x2A0, "_func_2A0" }, + { 0x2A1, "_func_2A1" }, + { 0x2A2, "_func_2A2" }, + { 0x2A3, "_func_2A3" }, + { 0x2A4, "_func_2A4" }, + { 0x2A5, "_func_2A5" }, + { 0x2A6, "_func_2A6" }, + { 0x2A7, "_func_2A7" }, + { 0x2A8, "_func_2A8" }, + { 0x2A9, "_func_2A9" }, + { 0x2AA, "_func_2AA" }, + { 0x2AB, "_func_2AB" }, + { 0x2AC, "_func_2AC" }, + { 0x2AD, "_func_2AD" }, + { 0x2AE, "_func_2AE" }, + { 0x2AF, "_func_2AF" }, + { 0x2B0, "_func_2B0" }, + { 0x2B1, "_func_2B1" }, + { 0x2B2, "_func_2B2" }, + { 0x2B3, "_func_2B3" }, + { 0x2B4, "_func_2B4" }, + { 0x2B5, "_func_2B5" }, + { 0x2B6, "_func_2B6" }, + { 0x2B7, "_func_2B7" }, + { 0x2B8, "_func_2B8" }, + { 0x2B9, "_func_2B9" }, + { 0x2BA, "_func_2BA" }, + { 0x2BB, "_func_2BB" }, + { 0x2BC, "_func_2BC" }, + { 0x2BD, "_func_2BD" }, + { 0x2BE, "_func_2BE" }, + { 0x2BF, "_func_2BF" }, + { 0x2C0, "_func_2C0" }, + { 0x2C1, "_func_2C1" }, + { 0x2C2, "_func_2C2" }, + { 0x2C3, "_func_2C3" }, + { 0x2C4, "_func_2C4" }, + { 0x2C5, "_func_2C5" }, + { 0x2C6, "_func_2C6" }, + { 0x2C7, "_func_2C7" }, + { 0x2C8, "_func_2C8" }, + { 0x2C9, "_func_2C9" }, + { 0x2CA, "_func_2CA" }, + { 0x2CB, "_func_2CB" }, + { 0x2CC, "_func_2CC" }, + { 0x2CD, "_func_2CD" }, + { 0x2CE, "_func_2CE" }, + { 0x2CF, "_func_2CF" }, + { 0x2D0, "_func_2D0" }, + { 0x2D1, "_func_2D1" }, + { 0x2D2, "_func_2D2" }, + { 0x2D3, "_func_2D3" }, + { 0x2D4, "_func_2D4" }, + { 0x2D5, "_func_2D5" }, + { 0x2D6, "_func_2D6" }, + { 0x2D7, "_func_2D7" }, + { 0x2D8, "_func_2D8" }, + { 0x2D9, "_func_2D9" }, + { 0x2DA, "_func_2DA" }, + { 0x2DB, "_func_2DB" }, + { 0x2DC, "_func_2DC" }, + { 0x2DD, "_func_2DD" }, + { 0x2DE, "_func_2DE" }, + { 0x2DF, "_func_2DF" }, + { 0x2E0, "_func_2E0" }, + { 0x2E1, "_func_2E1" }, + { 0x2E2, "_func_2E2" }, + { 0x2E3, "_func_2E3" }, + { 0x2E4, "_func_2E4" }, + { 0x2E5, "_func_2E5" }, + { 0x2E6, "_func_2E6" }, + { 0x2E7, "_func_2E7" }, + { 0x2E8, "_func_2E8" }, + { 0x2E9, "_func_2E9" }, + { 0x2EA, "_func_2EA" }, + { 0x2EB, "_func_2EB" }, + { 0x2EC, "_func_2EC" }, + { 0x2ED, "_func_2ED" }, + { 0x2EE, "_func_2EE" }, + { 0x2EF, "_func_2EF" }, + { 0x2F0, "_func_2F0" }, + { 0x2F1, "_func_2F1" }, + { 0x2F2, "_func_2F2" }, + { 0x2F3, "_func_2F3" }, + { 0x2F4, "_func_2F4" }, + { 0x2F5, "_func_2F5" }, + { 0x2F6, "_func_2F6" }, + { 0x2F7, "_func_2F7" }, + { 0x2F8, "_func_2F8" }, + { 0x2F9, "_func_2F9" }, + { 0x2FA, "_func_2FA" }, + { 0x2FB, "_func_2FB" }, + { 0x2FC, "_func_2FC" }, + { 0x2FD, "_func_2FD" }, + { 0x2FE, "_func_2FE" }, + { 0x2FF, "_func_2FF" }, + { 0x300, "_func_300" }, + { 0x301, "_func_301" }, + { 0x302, "_func_302" }, + { 0x303, "_func_303" }, + { 0x304, "_func_304" }, + { 0x305, "_func_305" }, + { 0x306, "_func_306" }, + { 0x307, "_func_307" }, + { 0x308, "_func_308" }, + { 0x309, "_func_309" }, + { 0x30A, "_func_30A" }, + { 0x30B, "_func_30B" }, + { 0x30C, "_func_30C" }, + { 0x30D, "_func_30D" }, + { 0x30E, "_func_30E" }, + { 0x30F, "_func_30F" }, + { 0x310, "_func_310" }, + { 0x311, "_func_311" }, + { 0x312, "_func_312" }, + { 0x313, "_func_313" }, + { 0x314, "_func_314" }, + { 0x315, "_func_315" }, + { 0x316, "_func_316" }, + { 0x317, "_func_317" }, + { 0x318, "_func_318" }, + { 0x319, "_func_319" }, + { 0x31A, "_func_31A" }, + { 0x31B, "_func_31B" }, + { 0x31C, "_func_31C" }, + { 0x31D, "_func_31D" }, + { 0x31E, "_func_31E" }, + { 0x31F, "_func_31F" }, + { 0x320, "_func_320" }, + { 0x321, "_func_321" }, + { 0x322, "_func_322" }, + { 0x323, "_func_323" }, + { 0x324, "_func_324" }, + { 0x325, "_func_325" }, + { 0x326, "_func_326" }, + { 0x327, "_func_327" }, +}}; + +const std::array method_list +{{ + { 0x8000, "_meth_8000" }, + { 0x8001, "_meth_8001" }, + { 0x8002, "_meth_8002" }, + { 0x8003, "_meth_8003" }, + { 0x8004, "_meth_8004" }, + { 0x8005, "_meth_8005" }, + { 0x8006, "_meth_8006" }, + { 0x8007, "_meth_8007" }, + { 0x8008, "_meth_8008" }, + { 0x8009, "_meth_8009" }, + { 0x800A, "_meth_800A" }, + { 0x800B, "_meth_800B" }, + { 0x800C, "_meth_800C" }, + { 0x800D, "_meth_800D" }, + { 0x800E, "_meth_800E" }, + { 0x800F, "_meth_800F" }, + { 0x8010, "_meth_8010" }, + { 0x8011, "_meth_8011" }, + { 0x8012, "_meth_8012" }, + { 0x8013, "_meth_8013" }, + { 0x8014, "_meth_8014" }, + { 0x8015, "_meth_8015" }, + { 0x8016, "_meth_8016" }, + { 0x8017, "_meth_8017" }, + { 0x8018, "_meth_8018" }, + { 0x8019, "_meth_8019" }, + { 0x801A, "_meth_801A" }, + { 0x801B, "_meth_801B" }, + { 0x801C, "_meth_801C" }, + { 0x801D, "_meth_801D" }, + { 0x801E, "_meth_801E" }, + { 0x801F, "_meth_801F" }, + { 0x8020, "_meth_8020" }, + { 0x8021, "_meth_8021" }, + { 0x8022, "_meth_8022" }, + { 0x8023, "_meth_8023" }, + { 0x8024, "_meth_8024" }, + { 0x8025, "_meth_8025" }, + { 0x8026, "_meth_8026" }, + { 0x8027, "_meth_8027" }, + { 0x8028, "_meth_8028" }, + { 0x8029, "_meth_8029" }, + { 0x802A, "_meth_802A" }, + { 0x802B, "_meth_802B" }, + { 0x802C, "_meth_802C" }, + { 0x802D, "_meth_802D" }, + { 0x802E, "_meth_802E" }, + { 0x802F, "_meth_802F" }, + { 0x8030, "_meth_8030" }, + { 0x8031, "_meth_8031" }, + { 0x8032, "_meth_8032" }, + { 0x8033, "_meth_8033" }, + { 0x8034, "_meth_8034" }, + { 0x8035, "_meth_8035" }, + { 0x8036, "_meth_8036" }, + { 0x8037, "_meth_8037" }, + { 0x8038, "_meth_8038" }, + { 0x8039, "_meth_8039" }, + { 0x803A, "_meth_803A" }, + { 0x803B, "_meth_803B" }, + { 0x803C, "_meth_803C" }, + { 0x803D, "_meth_803D" }, + { 0x803E, "_meth_803E" }, + { 0x803F, "_meth_803F" }, + { 0x8040, "_meth_8040" }, + { 0x8041, "_meth_8041" }, + { 0x8042, "_meth_8042" }, + { 0x8043, "_meth_8043" }, + { 0x8044, "_meth_8044" }, + { 0x8045, "_meth_8045" }, + { 0x8046, "_meth_8046" }, + { 0x8047, "_meth_8047" }, + { 0x8048, "_meth_8048" }, + { 0x8049, "_meth_8049" }, + { 0x804A, "_meth_804A" }, + { 0x804B, "_meth_804B" }, + { 0x804C, "_meth_804C" }, + { 0x804D, "_meth_804D" }, + { 0x804E, "_meth_804E" }, + { 0x804F, "_meth_804F" }, + { 0x8050, "_meth_8050" }, + { 0x8051, "_meth_8051" }, + { 0x8052, "_meth_8052" }, + { 0x8053, "_meth_8053" }, + { 0x8054, "_meth_8054" }, + { 0x8055, "_meth_8055" }, + { 0x8056, "_meth_8056" }, + { 0x8057, "_meth_8057" }, + { 0x8058, "_meth_8058" }, + { 0x8059, "_meth_8059" }, + { 0x805A, "_meth_805A" }, + { 0x805B, "_meth_805B" }, + { 0x805C, "_meth_805C" }, + { 0x805D, "_meth_805D" }, + { 0x805E, "_meth_805E" }, + { 0x805F, "_meth_805F" }, + { 0x8060, "_meth_8060" }, + { 0x8061, "_meth_8061" }, + { 0x8062, "_meth_8062" }, + { 0x8063, "_meth_8063" }, + { 0x8064, "_meth_8064" }, + { 0x8065, "_meth_8065" }, + { 0x8066, "_meth_8066" }, + { 0x8067, "_meth_8067" }, + { 0x8068, "_meth_8068" }, + { 0x8069, "_meth_8069" }, + { 0x806A, "_meth_806A" }, + { 0x806B, "_meth_806B" }, + { 0x806C, "_meth_806C" }, + { 0x806D, "_meth_806D" }, + { 0x806E, "_meth_806E" }, + { 0x806F, "_meth_806F" }, + { 0x8070, "_meth_8070" }, + { 0x8071, "_meth_8071" }, + { 0x8072, "_meth_8072" }, + { 0x8073, "_meth_8073" }, + { 0x8074, "_meth_8074" }, + { 0x8075, "_meth_8075" }, + { 0x8076, "_meth_8076" }, + { 0x8077, "_meth_8077" }, + { 0x8078, "_meth_8078" }, + { 0x8079, "_meth_8079" }, + { 0x807A, "_meth_807A" }, + { 0x807B, "_meth_807B" }, + { 0x807C, "_meth_807C" }, + { 0x807D, "_meth_807D" }, + { 0x807E, "_meth_807E" }, + { 0x807F, "_meth_807F" }, + { 0x8080, "_meth_8080" }, + { 0x8081, "_meth_8081" }, + { 0x8082, "_meth_8082" }, + { 0x8083, "_meth_8083" }, + { 0x8084, "_meth_8084" }, + { 0x8085, "_meth_8085" }, + { 0x8086, "_meth_8086" }, + { 0x8087, "_meth_8087" }, + { 0x8088, "_meth_8088" }, + { 0x8089, "_meth_8089" }, + { 0x808A, "_meth_808A" }, + { 0x808B, "_meth_808B" }, + { 0x808C, "_meth_808C" }, + { 0x808D, "_meth_808D" }, + { 0x808E, "_meth_808E" }, + { 0x808F, "_meth_808F" }, + { 0x8090, "_meth_8090" }, + { 0x8091, "_meth_8091" }, + { 0x8092, "_meth_8092" }, + { 0x8093, "_meth_8093" }, + { 0x8094, "_meth_8094" }, + { 0x8095, "_meth_8095" }, + { 0x8096, "_meth_8096" }, + { 0x8097, "_meth_8097" }, + { 0x8098, "_meth_8098" }, + { 0x8099, "_meth_8099" }, + { 0x809A, "_meth_809A" }, + { 0x809B, "_meth_809B" }, + { 0x809C, "_meth_809C" }, + { 0x809D, "_meth_809D" }, + { 0x809E, "_meth_809E" }, + { 0x809F, "_meth_809F" }, + { 0x80A0, "_meth_80A0" }, + { 0x80A1, "_meth_80A1" }, + { 0x80A2, "_meth_80A2" }, + { 0x80A3, "_meth_80A3" }, + { 0x80A4, "_meth_80A4" }, + { 0x80A5, "_meth_80A5" }, + { 0x80A6, "_meth_80A6" }, + { 0x80A7, "_meth_80A7" }, + { 0x80A8, "_meth_80A8" }, + { 0x80A9, "_meth_80A9" }, + { 0x80AA, "_meth_80AA" }, + { 0x80AB, "_meth_80AB" }, + { 0x80AC, "_meth_80AC" }, + { 0x80AD, "_meth_80AD" }, + { 0x80AE, "_meth_80AE" }, + { 0x80AF, "_meth_80AF" }, + { 0x80B0, "_meth_80B0" }, + { 0x80B1, "_meth_80B1" }, + { 0x80B2, "_meth_80B2" }, + { 0x80B3, "_meth_80B3" }, + { 0x80B4, "_meth_80B4" }, + { 0x80B5, "_meth_80B5" }, + { 0x80B6, "_meth_80B6" }, + { 0x80B7, "_meth_80B7" }, + { 0x80B8, "_meth_80B8" }, + { 0x80B9, "_meth_80B9" }, + { 0x80BA, "_meth_80BA" }, + { 0x80BB, "_meth_80BB" }, + { 0x80BC, "_meth_80BC" }, + { 0x80BD, "_meth_80BD" }, + { 0x80BE, "_meth_80BE" }, + { 0x80BF, "_meth_80BF" }, + { 0x80C0, "_meth_80C0" }, + { 0x80C1, "_meth_80C1" }, + { 0x80C2, "_meth_80C2" }, + { 0x80C3, "_meth_80C3" }, + { 0x80C4, "_meth_80C4" }, + { 0x80C5, "_meth_80C5" }, + { 0x80C6, "_meth_80C6" }, + { 0x80C7, "_meth_80C7" }, + { 0x80C8, "_meth_80C8" }, + { 0x80C9, "_meth_80C9" }, + { 0x80CA, "_meth_80CA" }, + { 0x80CB, "_meth_80CB" }, + { 0x80CC, "_meth_80CC" }, + { 0x80CD, "_meth_80CD" }, + { 0x80CE, "_meth_80CE" }, + { 0x80CF, "_meth_80CF" }, + { 0x80D0, "_meth_80D0" }, + { 0x80D1, "_meth_80D1" }, + { 0x80D2, "_meth_80D2" }, + { 0x80D3, "_meth_80D3" }, + { 0x80D4, "_meth_80D4" }, + { 0x80D5, "_meth_80D5" }, + { 0x80D6, "_meth_80D6" }, + { 0x80D7, "_meth_80D7" }, + { 0x80D8, "_meth_80D8" }, + { 0x80D9, "_meth_80D9" }, + { 0x80DA, "_meth_80DA" }, + { 0x80DB, "_meth_80DB" }, + { 0x80DC, "_meth_80DC" }, + { 0x80DD, "_meth_80DD" }, + { 0x80DE, "_meth_80DE" }, + { 0x80DF, "_meth_80DF" }, + { 0x80E0, "_meth_80E0" }, + { 0x80E1, "_meth_80E1" }, + { 0x80E2, "_meth_80E2" }, + { 0x80E3, "_meth_80E3" }, + { 0x80E4, "_meth_80E4" }, + { 0x80E5, "_meth_80E5" }, + { 0x80E6, "_meth_80E6" }, + { 0x80E7, "_meth_80E7" }, + { 0x80E8, "_meth_80E8" }, + { 0x80E9, "_meth_80E9" }, + { 0x80EA, "_meth_80EA" }, + { 0x80EB, "_meth_80EB" }, + { 0x80EC, "_meth_80EC" }, + { 0x80ED, "_meth_80ED" }, + { 0x80EE, "_meth_80EE" }, + { 0x80EF, "_meth_80EF" }, + { 0x80F0, "_meth_80F0" }, + { 0x80F1, "_meth_80F1" }, + { 0x80F2, "_meth_80F2" }, + { 0x80F3, "_meth_80F3" }, + { 0x80F4, "_meth_80F4" }, + { 0x80F5, "_meth_80F5" }, + { 0x80F6, "_meth_80F6" }, + { 0x80F7, "_meth_80F7" }, + { 0x80F8, "_meth_80F8" }, + { 0x80F9, "_meth_80F9" }, + { 0x80FA, "_meth_80FA" }, + { 0x80FB, "_meth_80FB" }, + { 0x80FC, "_meth_80FC" }, + { 0x80FD, "_meth_80FD" }, + { 0x80FE, "_meth_80FE" }, + { 0x80FF, "_meth_80FF" }, + { 0x8100, "_meth_8100" }, + { 0x8101, "_meth_8101" }, + { 0x8102, "_meth_8102" }, + { 0x8103, "_meth_8103" }, + { 0x8104, "_meth_8104" }, + { 0x8105, "_meth_8105" }, + { 0x8106, "_meth_8106" }, + { 0x8107, "_meth_8107" }, + { 0x8108, "_meth_8108" }, + { 0x8109, "_meth_8109" }, + { 0x810A, "_meth_810A" }, + { 0x810B, "_meth_810B" }, + { 0x810C, "_meth_810C" }, + { 0x810D, "_meth_810D" }, + { 0x810E, "_meth_810E" }, + { 0x810F, "_meth_810F" }, + { 0x8110, "_meth_8110" }, + { 0x8111, "_meth_8111" }, + { 0x8112, "_meth_8112" }, + { 0x8113, "_meth_8113" }, + { 0x8114, "_meth_8114" }, + { 0x8115, "_meth_8115" }, + { 0x8116, "_meth_8116" }, + { 0x8117, "_meth_8117" }, + { 0x8118, "_meth_8118" }, + { 0x8119, "_meth_8119" }, + { 0x811A, "_meth_811A" }, + { 0x811B, "_meth_811B" }, + { 0x811C, "_meth_811C" }, + { 0x811D, "_meth_811D" }, + { 0x811E, "_meth_811E" }, + { 0x811F, "_meth_811F" }, + { 0x8120, "_meth_8120" }, + { 0x8121, "_meth_8121" }, + { 0x8122, "_meth_8122" }, + { 0x8123, "_meth_8123" }, + { 0x8124, "_meth_8124" }, + { 0x8125, "_meth_8125" }, + { 0x8126, "_meth_8126" }, + { 0x8127, "_meth_8127" }, + { 0x8128, "_meth_8128" }, + { 0x8129, "_meth_8129" }, + { 0x812A, "_meth_812A" }, + { 0x812B, "_meth_812B" }, + { 0x812C, "_meth_812C" }, + { 0x812D, "_meth_812D" }, + { 0x812E, "_meth_812E" }, + { 0x812F, "_meth_812F" }, + { 0x8130, "_meth_8130" }, + { 0x8131, "_meth_8131" }, + { 0x8132, "_meth_8132" }, + { 0x8133, "_meth_8133" }, + { 0x8134, "_meth_8134" }, + { 0x8135, "_meth_8135" }, + { 0x8136, "_meth_8136" }, + { 0x8137, "_meth_8137" }, + { 0x8138, "_meth_8138" }, + { 0x8139, "_meth_8139" }, + { 0x813A, "_meth_813A" }, + { 0x813B, "_meth_813B" }, + { 0x813C, "_meth_813C" }, + { 0x813D, "_meth_813D" }, + { 0x813E, "_meth_813E" }, + { 0x813F, "_meth_813F" }, + { 0x8140, "_meth_8140" }, + { 0x8141, "_meth_8141" }, + { 0x8142, "_meth_8142" }, + { 0x8143, "_meth_8143" }, + { 0x8144, "_meth_8144" }, + { 0x8145, "_meth_8145" }, + { 0x8146, "_meth_8146" }, + { 0x8147, "_meth_8147" }, + { 0x8148, "_meth_8148" }, + { 0x8149, "_meth_8149" }, + { 0x814A, "_meth_814A" }, + { 0x814B, "_meth_814B" }, + { 0x814C, "_meth_814C" }, + { 0x814D, "_meth_814D" }, + { 0x814E, "_meth_814E" }, + { 0x814F, "_meth_814F" }, + { 0x8150, "_meth_8150" }, + { 0x8151, "_meth_8151" }, + { 0x8152, "_meth_8152" }, + { 0x8153, "_meth_8153" }, + { 0x8154, "_meth_8154" }, + { 0x8155, "_meth_8155" }, + { 0x8156, "_meth_8156" }, + { 0x8157, "_meth_8157" }, + { 0x8158, "_meth_8158" }, + { 0x8159, "_meth_8159" }, + { 0x815A, "_meth_815A" }, + { 0x815B, "_meth_815B" }, + { 0x815C, "_meth_815C" }, + { 0x815D, "_meth_815D" }, + { 0x815E, "_meth_815E" }, + { 0x815F, "_meth_815F" }, + { 0x8160, "_meth_8160" }, + { 0x8161, "_meth_8161" }, + { 0x8162, "_meth_8162" }, + { 0x8163, "_meth_8163" }, + { 0x8164, "_meth_8164" }, + { 0x8165, "_meth_8165" }, + { 0x8166, "_meth_8166" }, + { 0x8167, "_meth_8167" }, + { 0x8168, "_meth_8168" }, + { 0x8169, "_meth_8169" }, + { 0x816A, "_meth_816A" }, + { 0x816B, "_meth_816B" }, + { 0x816C, "_meth_816C" }, + { 0x816D, "_meth_816D" }, + { 0x816E, "_meth_816E" }, + { 0x816F, "_meth_816F" }, + { 0x8170, "_meth_8170" }, + { 0x8171, "_meth_8171" }, + { 0x8172, "_meth_8172" }, + { 0x8173, "_meth_8173" }, + { 0x8174, "_meth_8174" }, + { 0x8175, "_meth_8175" }, + { 0x8176, "_meth_8176" }, + { 0x8177, "_meth_8177" }, + { 0x8178, "_meth_8178" }, + { 0x8179, "_meth_8179" }, + { 0x817A, "_meth_817A" }, + { 0x817B, "_meth_817B" }, + { 0x817C, "_meth_817C" }, + { 0x817D, "_meth_817D" }, + { 0x817E, "_meth_817E" }, + { 0x817F, "_meth_817F" }, + { 0x8180, "_meth_8180" }, + { 0x8181, "_meth_8181" }, + { 0x8182, "_meth_8182" }, + { 0x8183, "_meth_8183" }, + { 0x8184, "_meth_8184" }, + { 0x8185, "_meth_8185" }, + { 0x8186, "_meth_8186" }, + { 0x8187, "_meth_8187" }, + { 0x8188, "_meth_8188" }, + { 0x8189, "_meth_8189" }, + { 0x818A, "_meth_818A" }, + { 0x818B, "_meth_818B" }, + { 0x818C, "_meth_818C" }, + { 0x818D, "_meth_818D" }, + { 0x818E, "_meth_818E" }, + { 0x818F, "_meth_818F" }, + { 0x8190, "_meth_8190" }, + { 0x8191, "_meth_8191" }, + { 0x8192, "_meth_8192" }, + { 0x8193, "_meth_8193" }, + { 0x8194, "_meth_8194" }, + { 0x8195, "_meth_8195" }, + { 0x8196, "_meth_8196" }, + { 0x8197, "_meth_8197" }, + { 0x8198, "_meth_8198" }, + { 0x8199, "_meth_8199" }, + { 0x819A, "_meth_819A" }, + { 0x819B, "_meth_819B" }, + { 0x819C, "_meth_819C" }, + { 0x819D, "_meth_819D" }, + { 0x819E, "_meth_819E" }, + { 0x819F, "_meth_819F" }, + { 0x81A0, "_meth_81A0" }, + { 0x81A1, "_meth_81A1" }, + { 0x81A2, "_meth_81A2" }, + { 0x81A3, "_meth_81A3" }, + { 0x81A4, "_meth_81A4" }, + { 0x81A5, "_meth_81A5" }, + { 0x81A6, "_meth_81A6" }, + { 0x81A7, "_meth_81A7" }, + { 0x81A8, "_meth_81A8" }, + { 0x81A9, "_meth_81A9" }, + { 0x81AA, "_meth_81AA" }, + { 0x81AB, "_meth_81AB" }, + { 0x81AC, "_meth_81AC" }, + { 0x81AD, "_meth_81AD" }, + { 0x81AE, "_meth_81AE" }, + { 0x81AF, "_meth_81AF" }, + { 0x81B0, "_meth_81B0" }, + { 0x81B1, "_meth_81B1" }, + { 0x81B2, "_meth_81B2" }, + { 0x81B3, "_meth_81B3" }, + { 0x81B4, "_meth_81B4" }, + { 0x81B5, "_meth_81B5" }, + { 0x81B6, "_meth_81B6" }, + { 0x81B7, "_meth_81B7" }, + { 0x81B8, "_meth_81B8" }, + { 0x81B9, "_meth_81B9" }, + { 0x81BA, "_meth_81BA" }, + { 0x81BB, "_meth_81BB" }, + { 0x81BC, "_meth_81BC" }, + { 0x81BD, "_meth_81BD" }, + { 0x81BE, "_meth_81BE" }, + { 0x81BF, "_meth_81BF" }, + { 0x81C0, "_meth_81C0" }, + { 0x81C1, "_meth_81C1" }, + { 0x81C2, "_meth_81C2" }, + { 0x81C3, "_meth_81C3" }, + { 0x81C4, "_meth_81C4" }, + { 0x81C5, "_meth_81C5" }, + { 0x81C6, "_meth_81C6" }, + { 0x81C7, "_meth_81C7" }, + { 0x81C8, "_meth_81C8" }, + { 0x81C9, "_meth_81C9" }, + { 0x81CA, "_meth_81CA" }, + { 0x81CB, "_meth_81CB" }, + { 0x81CC, "_meth_81CC" }, + { 0x81CD, "_meth_81CD" }, + { 0x81CE, "_meth_81CE" }, + { 0x81CF, "_meth_81CF" }, + { 0x81D0, "_meth_81D0" }, + { 0x81D1, "_meth_81D1" }, + { 0x81D2, "_meth_81D2" }, + { 0x81D3, "_meth_81D3" }, + { 0x81D4, "_meth_81D4" }, + { 0x81D5, "_meth_81D5" }, + { 0x81D6, "_meth_81D6" }, + { 0x81D7, "_meth_81D7" }, + { 0x81D8, "_meth_81D8" }, + { 0x81D9, "_meth_81D9" }, + { 0x81DA, "_meth_81DA" }, + { 0x81DB, "_meth_81DB" }, + { 0x81DC, "_meth_81DC" }, + { 0x81DD, "_meth_81DD" }, + { 0x81DE, "_meth_81DE" }, + { 0x81DF, "_meth_81DF" }, + { 0x81E0, "_meth_81E0" }, + { 0x81E1, "_meth_81E1" }, + { 0x81E2, "_meth_81E2" }, + { 0x81E3, "_meth_81E3" }, + { 0x81E4, "_meth_81E4" }, + { 0x81E5, "_meth_81E5" }, + { 0x81E6, "_meth_81E6" }, + { 0x81E7, "_meth_81E7" }, + { 0x81E8, "_meth_81E8" }, + { 0x81E9, "_meth_81E9" }, + { 0x81EA, "_meth_81EA" }, + { 0x81EB, "_meth_81EB" }, + { 0x81EC, "_meth_81EC" }, + { 0x81ED, "_meth_81ED" }, + { 0x81EE, "_meth_81EE" }, + { 0x81EF, "_meth_81EF" }, + { 0x81F0, "_meth_81F0" }, + { 0x81F1, "_meth_81F1" }, + { 0x81F2, "_meth_81F2" }, + { 0x81F3, "_meth_81F3" }, + { 0x81F4, "_meth_81F4" }, + { 0x81F5, "_meth_81F5" }, + { 0x81F6, "_meth_81F6" }, + { 0x81F7, "_meth_81F7" }, + { 0x81F8, "_meth_81F8" }, + { 0x81F9, "_meth_81F9" }, + { 0x81FA, "_meth_81FA" }, + { 0x81FB, "_meth_81FB" }, + { 0x81FC, "_meth_81FC" }, + { 0x81FD, "_meth_81FD" }, + { 0x81FE, "_meth_81FE" }, + { 0x81FF, "_meth_81FF" }, + { 0x8200, "_meth_8200" }, + { 0x8201, "_meth_8201" }, + { 0x8202, "_meth_8202" }, + { 0x8203, "_meth_8203" }, + { 0x8204, "_meth_8204" }, + { 0x8205, "_meth_8205" }, + { 0x8206, "_meth_8206" }, + { 0x8207, "_meth_8207" }, + { 0x8208, "_meth_8208" }, + { 0x8209, "_meth_8209" }, + { 0x820A, "_meth_820A" }, + { 0x820B, "_meth_820B" }, + { 0x820C, "_meth_820C" }, + { 0x820D, "_meth_820D" }, + { 0x820E, "_meth_820E" }, + { 0x820F, "_meth_820F" }, + { 0x8210, "_meth_8210" }, + { 0x8211, "_meth_8211" }, + { 0x8212, "_meth_8212" }, + { 0x8213, "_meth_8213" }, + { 0x8214, "_meth_8214" }, + { 0x8215, "_meth_8215" }, + { 0x8216, "_meth_8216" }, + { 0x8217, "_meth_8217" }, + { 0x8218, "_meth_8218" }, + { 0x8219, "_meth_8219" }, + { 0x821A, "_meth_821A" }, + { 0x821B, "_meth_821B" }, + { 0x821C, "_meth_821C" }, + { 0x821D, "_meth_821D" }, + { 0x821E, "_meth_821E" }, + { 0x821F, "_meth_821F" }, + { 0x8220, "_meth_8220" }, + { 0x8221, "_meth_8221" }, + { 0x8222, "_meth_8222" }, + { 0x8223, "_meth_8223" }, + { 0x8224, "_meth_8224" }, + { 0x8225, "_meth_8225" }, + { 0x8226, "_meth_8226" }, + { 0x8227, "_meth_8227" }, + { 0x8228, "_meth_8228" }, + { 0x8229, "_meth_8229" }, + { 0x822A, "_meth_822A" }, + { 0x822B, "_meth_822B" }, + { 0x822C, "_meth_822C" }, + { 0x822D, "_meth_822D" }, + { 0x822E, "_meth_822E" }, + { 0x822F, "_meth_822F" }, + { 0x8230, "_meth_8230" }, + { 0x8231, "_meth_8231" }, + { 0x8232, "_meth_8232" }, + { 0x8233, "_meth_8233" }, + { 0x8234, "_meth_8234" }, + { 0x8235, "_meth_8235" }, + { 0x8236, "_meth_8236" }, + { 0x8237, "_meth_8237" }, + { 0x8238, "_meth_8238" }, + { 0x8239, "_meth_8239" }, + { 0x823A, "_meth_823A" }, + { 0x823B, "_meth_823B" }, + { 0x823C, "_meth_823C" }, + { 0x823D, "_meth_823D" }, + { 0x823E, "_meth_823E" }, + { 0x823F, "_meth_823F" }, + { 0x8240, "_meth_8240" }, + { 0x8241, "_meth_8241" }, + { 0x8242, "_meth_8242" }, + { 0x8243, "_meth_8243" }, + { 0x8244, "_meth_8244" }, + { 0x8245, "_meth_8245" }, + { 0x8246, "_meth_8246" }, + { 0x8247, "_meth_8247" }, + { 0x8248, "_meth_8248" }, + { 0x8249, "_meth_8249" }, + { 0x824A, "_meth_824A" }, + { 0x824B, "_meth_824B" }, + { 0x824C, "_meth_824C" }, + { 0x824D, "_meth_824D" }, + { 0x824E, "_meth_824E" }, + { 0x824F, "_meth_824F" }, + { 0x8250, "_meth_8250" }, + { 0x8251, "_meth_8251" }, + { 0x8252, "_meth_8252" }, + { 0x8253, "_meth_8253" }, + { 0x8254, "_meth_8254" }, + { 0x8255, "_meth_8255" }, + { 0x8256, "_meth_8256" }, + { 0x8257, "_meth_8257" }, + { 0x8258, "_meth_8258" }, + { 0x8259, "_meth_8259" }, + { 0x825A, "_meth_825A" }, + { 0x825B, "_meth_825B" }, + { 0x825C, "_meth_825C" }, + { 0x825D, "_meth_825D" }, + { 0x825E, "_meth_825E" }, + { 0x825F, "_meth_825F" }, + { 0x8260, "_meth_8260" }, + { 0x8261, "_meth_8261" }, + { 0x8262, "_meth_8262" }, + { 0x8263, "_meth_8263" }, + { 0x8264, "_meth_8264" }, + { 0x8265, "_meth_8265" }, + { 0x8266, "_meth_8266" }, + { 0x8267, "_meth_8267" }, + { 0x8268, "_meth_8268" }, + { 0x8269, "_meth_8269" }, + { 0x826A, "_meth_826A" }, + { 0x826B, "_meth_826B" }, + { 0x826C, "_meth_826C" }, + { 0x826D, "_meth_826D" }, + { 0x826E, "_meth_826E" }, + { 0x826F, "_meth_826F" }, + { 0x8270, "_meth_8270" }, + { 0x8271, "_meth_8271" }, + { 0x8272, "_meth_8272" }, + { 0x8273, "_meth_8273" }, + { 0x8274, "_meth_8274" }, + { 0x8275, "_meth_8275" }, + { 0x8276, "_meth_8276" }, + { 0x8277, "_meth_8277" }, + { 0x8278, "_meth_8278" }, + { 0x8279, "_meth_8279" }, + { 0x827A, "_meth_827A" }, + { 0x827B, "_meth_827B" }, + { 0x827C, "_meth_827C" }, + { 0x827D, "_meth_827D" }, + { 0x827E, "_meth_827E" }, + { 0x827F, "_meth_827F" }, + { 0x8280, "_meth_8280" }, + { 0x8281, "_meth_8281" }, + { 0x8282, "_meth_8282" }, + { 0x8283, "_meth_8283" }, + { 0x8284, "_meth_8284" }, + { 0x8285, "_meth_8285" }, + { 0x8286, "_meth_8286" }, + { 0x8287, "_meth_8287" }, + { 0x8288, "_meth_8288" }, + { 0x8289, "_meth_8289" }, + { 0x828A, "_meth_828A" }, + { 0x828B, "_meth_828B" }, + { 0x828C, "_meth_828C" }, + { 0x828D, "_meth_828D" }, + { 0x828E, "_meth_828E" }, + { 0x828F, "_meth_828F" }, + { 0x8290, "_meth_8290" }, + { 0x8291, "_meth_8291" }, + { 0x8292, "_meth_8292" }, + { 0x8293, "_meth_8293" }, + { 0x8294, "_meth_8294" }, + { 0x8295, "_meth_8295" }, + { 0x8296, "_meth_8296" }, + { 0x8297, "_meth_8297" }, + { 0x8298, "_meth_8298" }, + { 0x8299, "_meth_8299" }, + { 0x829A, "_meth_829A" }, + { 0x829B, "_meth_829B" }, + { 0x829C, "_meth_829C" }, + { 0x829D, "_meth_829D" }, + { 0x829E, "_meth_829E" }, + { 0x829F, "_meth_829F" }, + { 0x82A0, "_meth_82A0" }, + { 0x82A1, "_meth_82A1" }, + { 0x82A2, "_meth_82A2" }, + { 0x82A3, "_meth_82A3" }, + { 0x82A4, "_meth_82A4" }, + { 0x82A5, "_meth_82A5" }, + { 0x82A6, "_meth_82A6" }, + { 0x82A7, "_meth_82A7" }, + { 0x82A8, "_meth_82A8" }, + { 0x82A9, "_meth_82A9" }, + { 0x82AA, "_meth_82AA" }, + { 0x82AB, "_meth_82AB" }, + { 0x82AC, "_meth_82AC" }, + { 0x82AD, "_meth_82AD" }, + { 0x82AE, "_meth_82AE" }, + { 0x82AF, "_meth_82AF" }, + { 0x82B0, "_meth_82B0" }, + { 0x82B1, "_meth_82B1" }, + { 0x82B2, "_meth_82B2" }, + { 0x82B3, "_meth_82B3" }, + { 0x82B4, "_meth_82B4" }, + { 0x82B5, "_meth_82B5" }, + { 0x82B6, "_meth_82B6" }, + { 0x82B7, "_meth_82B7" }, + { 0x82B8, "_meth_82B8" }, + { 0x82B9, "_meth_82B9" }, + { 0x82BA, "_meth_82BA" }, + { 0x82BB, "_meth_82BB" }, + { 0x82BC, "_meth_82BC" }, + { 0x82BD, "_meth_82BD" }, + { 0x82BE, "_meth_82BE" }, + { 0x82BF, "_meth_82BF" }, + { 0x82C0, "_meth_82C0" }, + { 0x82C1, "_meth_82C1" }, + { 0x82C2, "_meth_82C2" }, + { 0x82C3, "_meth_82C3" }, + { 0x82C4, "_meth_82C4" }, + { 0x82C5, "_meth_82C5" }, + { 0x82C6, "_meth_82C6" }, + { 0x82C7, "_meth_82C7" }, + { 0x82C8, "_meth_82C8" }, + { 0x82C9, "_meth_82C9" }, + { 0x82CA, "_meth_82CA" }, + { 0x82CB, "_meth_82CB" }, + { 0x82CC, "_meth_82CC" }, + { 0x82CD, "_meth_82CD" }, + { 0x82CE, "_meth_82CE" }, + { 0x82CF, "_meth_82CF" }, + { 0x82D0, "_meth_82D0" }, + { 0x82D1, "_meth_82D1" }, + { 0x82D2, "_meth_82D2" }, + { 0x82D3, "_meth_82D3" }, + { 0x82D4, "_meth_82D4" }, + { 0x82D5, "_meth_82D5" }, + { 0x82D6, "_meth_82D6" }, + { 0x82D7, "_meth_82D7" }, + { 0x82D8, "_meth_82D8" }, + { 0x82D9, "_meth_82D9" }, + { 0x82DA, "_meth_82DA" }, + { 0x82DB, "_meth_82DB" }, + { 0x82DC, "_meth_82DC" }, + { 0x82DD, "_meth_82DD" }, + { 0x82DE, "_meth_82DE" }, + { 0x82DF, "_meth_82DF" }, + { 0x82E0, "_meth_82E0" }, + { 0x82E1, "_meth_82E1" }, + { 0x82E2, "_meth_82E2" }, + { 0x82E3, "_meth_82E3" }, + { 0x82E4, "_meth_82E4" }, + { 0x82E5, "_meth_82E5" }, + { 0x82E6, "_meth_82E6" }, + { 0x82E7, "_meth_82E7" }, + { 0x82E8, "_meth_82E8" }, + { 0x82E9, "_meth_82E9" }, + { 0x82EA, "_meth_82EA" }, + { 0x82EB, "_meth_82EB" }, + { 0x82EC, "_meth_82EC" }, + { 0x82ED, "_meth_82ED" }, + { 0x82EE, "_meth_82EE" }, + { 0x82EF, "_meth_82EF" }, + { 0x82F0, "_meth_82F0" }, + { 0x82F1, "_meth_82F1" }, + { 0x82F2, "_meth_82F2" }, + { 0x82F3, "_meth_82F3" }, + { 0x82F4, "_meth_82F4" }, + { 0x82F5, "_meth_82F5" }, + { 0x82F6, "_meth_82F6" }, + { 0x82F7, "_meth_82F7" }, + { 0x82F8, "_meth_82F8" }, + { 0x82F9, "_meth_82F9" }, + { 0x82FA, "_meth_82FA" }, + { 0x82FB, "_meth_82FB" }, + { 0x82FC, "_meth_82FC" }, + { 0x82FD, "_meth_82FD" }, + { 0x82FE, "_meth_82FE" }, + { 0x82FF, "_meth_82FF" }, + { 0x8300, "_meth_8300" }, + { 0x8301, "_meth_8301" }, + { 0x8302, "_meth_8302" }, + { 0x8303, "_meth_8303" }, + { 0x8304, "_meth_8304" }, + { 0x8305, "_meth_8305" }, + { 0x8306, "_meth_8306" }, + { 0x8307, "_meth_8307" }, + { 0x8308, "_meth_8308" }, + { 0x8309, "_meth_8309" }, + { 0x830A, "_meth_830A" }, + { 0x830B, "_meth_830B" }, + { 0x830C, "_meth_830C" }, + { 0x830D, "_meth_830D" }, + { 0x830E, "_meth_830E" }, + { 0x830F, "_meth_830F" }, + { 0x8310, "_meth_8310" }, + { 0x8311, "_meth_8311" }, + { 0x8312, "_meth_8312" }, + { 0x8313, "_meth_8313" }, + { 0x8314, "_meth_8314" }, + { 0x8315, "_meth_8315" }, + { 0x8316, "_meth_8316" }, + { 0x8317, "_meth_8317" }, + { 0x8318, "_meth_8318" }, + { 0x8319, "_meth_8319" }, + { 0x831A, "_meth_831A" }, + { 0x831B, "_meth_831B" }, + { 0x831C, "_meth_831C" }, + { 0x831D, "_meth_831D" }, + { 0x831E, "_meth_831E" }, + { 0x831F, "_meth_831F" }, + { 0x8320, "_meth_8320" }, + { 0x8321, "_meth_8321" }, + { 0x8322, "_meth_8322" }, + { 0x8323, "_meth_8323" }, + { 0x8324, "_meth_8324" }, + { 0x8325, "_meth_8325" }, + { 0x8326, "_meth_8326" }, + { 0x8327, "_meth_8327" }, + { 0x8328, "_meth_8328" }, + { 0x8329, "_meth_8329" }, + { 0x832A, "_meth_832A" }, + { 0x832B, "_meth_832B" }, + { 0x832C, "_meth_832C" }, + { 0x832D, "_meth_832D" }, + { 0x832E, "_meth_832E" }, + { 0x832F, "_meth_832F" }, + { 0x8330, "_meth_8330" }, + { 0x8331, "_meth_8331" }, + { 0x8332, "_meth_8332" }, + { 0x8333, "_meth_8333" }, + { 0x8334, "_meth_8334" }, + { 0x8335, "_meth_8335" }, + { 0x8336, "_meth_8336" }, + { 0x8337, "_meth_8337" }, + { 0x8338, "_meth_8338" }, + { 0x8339, "_meth_8339" }, + { 0x833A, "_meth_833A" }, + { 0x833B, "_meth_833B" }, + { 0x833C, "_meth_833C" }, + { 0x833D, "_meth_833D" }, + { 0x833E, "_meth_833E" }, + { 0x833F, "_meth_833F" }, + { 0x8340, "_meth_8340" }, + { 0x8341, "_meth_8341" }, + { 0x8342, "_meth_8342" }, + { 0x8343, "_meth_8343" }, + { 0x8344, "_meth_8344" }, + { 0x8345, "_meth_8345" }, + { 0x8346, "_meth_8346" }, + { 0x8347, "_meth_8347" }, + { 0x8348, "_meth_8348" }, + { 0x8349, "_meth_8349" }, + { 0x834A, "_meth_834A" }, + { 0x834B, "_meth_834B" }, + { 0x834C, "_meth_834C" }, + { 0x834D, "_meth_834D" }, + { 0x834E, "_meth_834E" }, + { 0x834F, "_meth_834F" }, + { 0x8350, "_meth_8350" }, + { 0x8351, "_meth_8351" }, + { 0x8352, "_meth_8352" }, + { 0x8353, "_meth_8353" }, + { 0x8354, "_meth_8354" }, + { 0x8355, "_meth_8355" }, + { 0x8356, "_meth_8356" }, + { 0x8357, "_meth_8357" }, + { 0x8358, "_meth_8358" }, + { 0x8359, "_meth_8359" }, + { 0x835A, "_meth_835A" }, + { 0x835B, "_meth_835B" }, + { 0x835C, "_meth_835C" }, + { 0x835D, "_meth_835D" }, + { 0x835E, "_meth_835E" }, + { 0x835F, "_meth_835F" }, + { 0x8360, "_meth_8360" }, + { 0x8361, "_meth_8361" }, + { 0x8362, "_meth_8362" }, + { 0x8363, "_meth_8363" }, + { 0x8364, "_meth_8364" }, + { 0x8365, "_meth_8365" }, + { 0x8366, "_meth_8366" }, + { 0x8367, "_meth_8367" }, + { 0x8368, "_meth_8368" }, + { 0x8369, "_meth_8369" }, + { 0x836A, "_meth_836A" }, + { 0x836B, "_meth_836B" }, + { 0x836C, "_meth_836C" }, + { 0x836D, "_meth_836D" }, + { 0x836E, "_meth_836E" }, + { 0x836F, "_meth_836F" }, + { 0x8370, "_meth_8370" }, + { 0x8371, "_meth_8371" }, + { 0x8372, "_meth_8372" }, + { 0x8373, "_meth_8373" }, + { 0x8374, "_meth_8374" }, + { 0x8375, "_meth_8375" }, + { 0x8376, "_meth_8376" }, + { 0x8377, "_meth_8377" }, + { 0x8378, "_meth_8378" }, + { 0x8379, "_meth_8379" }, + { 0x837A, "_meth_837A" }, + { 0x837B, "_meth_837B" }, + { 0x837C, "_meth_837C" }, + { 0x837D, "_meth_837D" }, + { 0x837E, "_meth_837E" }, + { 0x837F, "_meth_837F" }, + { 0x8380, "_meth_8380" }, + { 0x8381, "_meth_8381" }, + { 0x8382, "_meth_8382" }, + { 0x8383, "_meth_8383" }, + { 0x8384, "_meth_8384" }, + { 0x8385, "_meth_8385" }, + { 0x8386, "_meth_8386" }, + { 0x8387, "_meth_8387" }, + { 0x8388, "_meth_8388" }, + { 0x8389, "_meth_8389" }, + { 0x838A, "_meth_838A" }, + { 0x838B, "_meth_838B" }, + { 0x838C, "_meth_838C" }, + { 0x838D, "_meth_838D" }, + { 0x838E, "_meth_838E" }, + { 0x838F, "_meth_838F" }, + { 0x8390, "_meth_8390" }, + { 0x8391, "_meth_8391" }, + { 0x8392, "_meth_8392" }, + { 0x8393, "_meth_8393" }, + { 0x8394, "_meth_8394" }, + { 0x8395, "_meth_8395" }, + { 0x8396, "_meth_8396" }, + { 0x8397, "_meth_8397" }, + { 0x8398, "_meth_8398" }, + { 0x8399, "_meth_8399" }, + { 0x839A, "_meth_839A" }, + { 0x839B, "_meth_839B" }, + { 0x839C, "_meth_839C" }, + { 0x839D, "_meth_839D" }, + { 0x839E, "_meth_839E" }, + { 0x839F, "_meth_839F" }, + { 0x83A0, "_meth_83A0" }, + { 0x83A1, "_meth_83A1" }, + { 0x83A2, "_meth_83A2" }, + { 0x83A3, "_meth_83A3" }, + { 0x83A4, "_meth_83A4" }, + { 0x83A5, "_meth_83A5" }, + { 0x83A6, "_meth_83A6" }, + { 0x83A7, "_meth_83A7" }, + { 0x83A8, "_meth_83A8" }, + { 0x83A9, "_meth_83A9" }, + { 0x83AA, "_meth_83AA" }, + { 0x83AB, "_meth_83AB" }, + { 0x83AC, "_meth_83AC" }, + { 0x83AD, "_meth_83AD" }, + { 0x83AE, "_meth_83AE" }, + { 0x83AF, "_meth_83AF" }, + { 0x83B0, "_meth_83B0" }, + { 0x83B1, "_meth_83B1" }, + { 0x83B2, "_meth_83B2" }, + { 0x83B3, "_meth_83B3" }, + { 0x83B4, "_meth_83B4" }, + { 0x83B5, "_meth_83B5" }, + { 0x83B6, "_meth_83B6" }, + { 0x83B7, "_meth_83B7" }, + { 0x83B8, "_meth_83B8" }, + { 0x83B9, "_meth_83B9" }, + { 0x83BA, "_meth_83BA" }, + { 0x83BB, "_meth_83BB" }, + { 0x83BC, "_meth_83BC" }, + { 0x83BD, "_meth_83BD" }, + { 0x83BE, "_meth_83BE" }, + { 0x83BF, "_meth_83BF" }, + { 0x83C0, "_meth_83C0" }, + { 0x83C1, "_meth_83C1" }, + { 0x83C2, "_meth_83C2" }, + { 0x83C3, "_meth_83C3" }, + { 0x83C4, "_meth_83C4" }, + { 0x83C5, "_meth_83C5" }, + { 0x83C6, "_meth_83C6" }, + { 0x83C7, "_meth_83C7" }, + { 0x83C8, "_meth_83C8" }, + { 0x83C9, "_meth_83C9" }, + { 0x83CA, "_meth_83CA" }, + { 0x83CB, "_meth_83CB" }, + { 0x83CC, "_meth_83CC" }, + { 0x83CD, "_meth_83CD" }, + { 0x83CE, "_meth_83CE" }, + { 0x83CF, "_meth_83CF" }, + { 0x83D0, "_meth_83D0" }, + { 0x83D1, "_meth_83D1" }, + { 0x83D2, "_meth_83D2" }, + { 0x83D3, "_meth_83D3" }, + { 0x83D4, "_meth_83D4" }, + { 0x83D5, "_meth_83D5" }, + { 0x83D6, "_meth_83D6" }, + { 0x83D7, "_meth_83D7" }, + { 0x83D8, "_meth_83D8" }, + { 0x83D9, "_meth_83D9" }, + { 0x83DA, "_meth_83DA" }, + { 0x83DB, "_meth_83DB" }, + { 0x83DC, "_meth_83DC" }, + { 0x83DD, "_meth_83DD" }, + { 0x83DE, "_meth_83DE" }, + { 0x83DF, "_meth_83DF" }, + { 0x83E0, "_meth_83E0" }, + { 0x83E1, "_meth_83E1" }, + { 0x83E2, "_meth_83E2" }, + { 0x83E3, "_meth_83E3" }, + { 0x83E4, "_meth_83E4" }, + { 0x83E5, "_meth_83E5" }, + { 0x83E6, "_meth_83E6" }, + { 0x83E7, "_meth_83E7" }, + { 0x83E8, "_meth_83E8" }, + { 0x83E9, "_meth_83E9" }, + { 0x83EA, "_meth_83EA" }, + { 0x83EB, "_meth_83EB" }, + { 0x83EC, "_meth_83EC" }, + { 0x83ED, "_meth_83ED" }, + { 0x83EE, "_meth_83EE" }, + { 0x83EF, "_meth_83EF" }, + { 0x83F0, "_meth_83F0" }, + { 0x83F1, "_meth_83F1" }, + { 0x83F2, "_meth_83F2" }, + { 0x83F3, "_meth_83F3" }, + { 0x83F4, "_meth_83F4" }, + { 0x83F5, "_meth_83F5" }, + { 0x83F6, "_meth_83F6" }, + { 0x83F7, "_meth_83F7" }, + { 0x83F8, "_meth_83F8" }, + { 0x83F9, "_meth_83F9" }, + { 0x83FA, "_meth_83FA" }, + { 0x83FB, "_meth_83FB" }, + { 0x83FC, "_meth_83FC" }, + { 0x83FD, "_meth_83FD" }, + { 0x83FE, "_meth_83FE" }, + { 0x83FF, "_meth_83FF" }, + { 0x8400, "_meth_8400" }, + { 0x8401, "_meth_8401" }, + { 0x8402, "_meth_8402" }, + { 0x8403, "_meth_8403" }, + { 0x8404, "_meth_8404" }, + { 0x8405, "_meth_8405" }, + { 0x8406, "_meth_8406" }, + { 0x8407, "_meth_8407" }, + { 0x8408, "_meth_8408" }, + { 0x8409, "_meth_8409" }, + { 0x840A, "_meth_840A" }, + { 0x840B, "_meth_840B" }, + { 0x840C, "_meth_840C" }, + { 0x840D, "_meth_840D" }, + { 0x840E, "_meth_840E" }, + { 0x840F, "_meth_840F" }, + { 0x8410, "_meth_8410" }, + { 0x8411, "_meth_8411" }, + { 0x8412, "_meth_8412" }, + { 0x8413, "_meth_8413" }, + { 0x8414, "_meth_8414" }, + { 0x8415, "_meth_8415" }, + { 0x8416, "_meth_8416" }, + { 0x8417, "_meth_8417" }, + { 0x8418, "_meth_8418" }, + { 0x8419, "_meth_8419" }, + { 0x841A, "_meth_841A" }, + { 0x841B, "_meth_841B" }, + { 0x841C, "_meth_841C" }, + { 0x841D, "_meth_841D" }, + { 0x841E, "_meth_841E" }, + { 0x841F, "_meth_841F" }, + { 0x8420, "_meth_8420" }, + { 0x8421, "_meth_8421" }, + { 0x8422, "_meth_8422" }, + { 0x8423, "_meth_8423" }, + { 0x8424, "_meth_8424" }, + { 0x8425, "_meth_8425" }, + { 0x8426, "_meth_8426" }, + { 0x8427, "_meth_8427" }, + { 0x8428, "_meth_8428" }, + { 0x8429, "_meth_8429" }, + { 0x842A, "_meth_842A" }, + { 0x842B, "_meth_842B" }, + { 0x842C, "_meth_842C" }, + { 0x842D, "_meth_842D" }, + { 0x842E, "_meth_842E" }, + { 0x842F, "_meth_842F" }, + { 0x8430, "_meth_8430" }, + { 0x8431, "_meth_8431" }, + { 0x8432, "_meth_8432" }, + { 0x8433, "_meth_8433" }, + { 0x8434, "_meth_8434" }, + { 0x8435, "_meth_8435" }, + { 0x8436, "_meth_8436" }, + { 0x8437, "_meth_8437" }, + { 0x8438, "_meth_8438" }, + { 0x8439, "_meth_8439" }, + { 0x843A, "_meth_843A" }, + { 0x843B, "_meth_843B" }, + { 0x843C, "_meth_843C" }, + { 0x843D, "_meth_843D" }, + { 0x843E, "_meth_843E" }, + { 0x843F, "_meth_843F" }, + { 0x8440, "_meth_8440" }, + { 0x8441, "_meth_8441" }, + { 0x8442, "_meth_8442" }, + { 0x8443, "_meth_8443" }, + { 0x8444, "_meth_8444" }, + { 0x8445, "_meth_8445" }, + { 0x8446, "_meth_8446" }, + { 0x8447, "_meth_8447" }, + { 0x8448, "_meth_8448" }, + { 0x8449, "_meth_8449" }, + { 0x844A, "_meth_844A" }, + { 0x844B, "_meth_844B" }, + { 0x844C, "_meth_844C" }, + { 0x844D, "_meth_844D" }, + { 0x844E, "_meth_844E" }, + { 0x844F, "_meth_844F" }, + { 0x8450, "_meth_8450" }, + { 0x8451, "_meth_8451" }, + { 0x8452, "_meth_8452" }, + { 0x8453, "_meth_8453" }, + { 0x8454, "_meth_8454" }, + { 0x8455, "_meth_8455" }, + { 0x8456, "_meth_8456" }, + { 0x8457, "_meth_8457" }, + { 0x8458, "_meth_8458" }, + { 0x8459, "_meth_8459" }, + { 0x845A, "_meth_845A" }, + { 0x845B, "_meth_845B" }, + { 0x845C, "_meth_845C" }, + { 0x845D, "_meth_845D" }, + { 0x845E, "_meth_845E" }, + { 0x845F, "_meth_845F" }, + { 0x8460, "_meth_8460" }, + { 0x8461, "_meth_8461" }, + { 0x8462, "_meth_8462" }, + { 0x8463, "_meth_8463" }, + { 0x8464, "_meth_8464" }, + { 0x8465, "_meth_8465" }, + { 0x8466, "_meth_8466" }, + { 0x8467, "_meth_8467" }, + { 0x8468, "_meth_8468" }, + { 0x8469, "_meth_8469" }, + { 0x846A, "_meth_846A" }, + { 0x846B, "_meth_846B" }, + { 0x846C, "_meth_846C" }, + { 0x846D, "_meth_846D" }, + { 0x846E, "_meth_846E" }, + { 0x846F, "_meth_846F" }, + { 0x8470, "_meth_8470" }, + { 0x8471, "_meth_8471" }, + { 0x8472, "_meth_8472" }, + { 0x8473, "_meth_8473" }, + { 0x8474, "_meth_8474" }, + { 0x8475, "_meth_8475" }, + { 0x8476, "_meth_8476" }, + { 0x8477, "_meth_8477" }, + { 0x8478, "_meth_8478" }, + { 0x8479, "_meth_8479" }, + { 0x847A, "_meth_847A" }, + { 0x847B, "_meth_847B" }, + { 0x847C, "_meth_847C" }, + { 0x847D, "_meth_847D" }, + { 0x847E, "_meth_847E" }, + { 0x847F, "_meth_847F" }, + { 0x8480, "_meth_8480" }, + { 0x8481, "_meth_8481" }, + { 0x8482, "_meth_8482" }, + { 0x8483, "_meth_8483" }, + { 0x8484, "_meth_8484" }, + { 0x8485, "_meth_8485" }, + { 0x8486, "_meth_8486" }, + { 0x8487, "_meth_8487" }, + { 0x8488, "_meth_8488" }, + { 0x8489, "_meth_8489" }, + { 0x848A, "_meth_848A" }, + { 0x848B, "_meth_848B" }, + { 0x848C, "_meth_848C" }, + { 0x848D, "_meth_848D" }, + { 0x848E, "_meth_848E" }, + { 0x848F, "_meth_848F" }, + { 0x8490, "_meth_8490" }, + { 0x8491, "_meth_8491" }, + { 0x8492, "_meth_8492" }, + { 0x8493, "_meth_8493" }, + { 0x8494, "_meth_8494" }, + { 0x8495, "_meth_8495" }, + { 0x8496, "_meth_8496" }, + { 0x8497, "_meth_8497" }, + { 0x8498, "_meth_8498" }, + { 0x8499, "_meth_8499" }, + { 0x849A, "_meth_849A" }, + { 0x849B, "_meth_849B" }, + { 0x849C, "_meth_849C" }, + { 0x849D, "_meth_849D" }, + { 0x849E, "_meth_849E" }, + { 0x849F, "_meth_849F" }, + { 0x84A0, "_meth_84A0" }, + { 0x84A1, "_meth_84A1" }, + { 0x84A2, "_meth_84A2" }, + { 0x84A3, "_meth_84A3" }, + { 0x84A4, "_meth_84A4" }, + { 0x84A5, "_meth_84A5" }, + { 0x84A6, "_meth_84A6" }, + { 0x84A7, "_meth_84A7" }, + { 0x84A8, "_meth_84A8" }, + { 0x84A9, "_meth_84A9" }, + { 0x84AA, "_meth_84AA" }, + { 0x84AB, "_meth_84AB" }, + { 0x84AC, "_meth_84AC" }, + { 0x84AD, "_meth_84AD" }, + { 0x84AE, "_meth_84AE" }, + { 0x84AF, "_meth_84AF" }, + { 0x84B0, "_meth_84B0" }, + { 0x84B1, "_meth_84B1" }, + { 0x84B2, "_meth_84B2" }, + { 0x84B3, "_meth_84B3" }, + { 0x84B4, "_meth_84B4" }, + { 0x84B5, "_meth_84B5" }, + { 0x84B6, "_meth_84B6" }, + { 0x84B7, "_meth_84B7" }, + { 0x84B8, "_meth_84B8" }, + { 0x84B9, "_meth_84B9" }, + { 0x84BA, "_meth_84BA" }, + { 0x84BB, "_meth_84BB" }, + { 0x84BC, "_meth_84BC" }, + { 0x84BD, "_meth_84BD" }, + { 0x84BE, "_meth_84BE" }, + { 0x84BF, "_meth_84BF" }, + { 0x84C0, "_meth_84C0" }, + { 0x84C1, "_meth_84C1" }, + { 0x84C2, "_meth_84C2" }, + { 0x84C3, "_meth_84C3" }, + { 0x84C4, "_meth_84C4" }, + { 0x84C5, "_meth_84C5" }, + { 0x84C6, "_meth_84C6" }, + { 0x84C7, "_meth_84C7" }, + { 0x84C8, "_meth_84C8" }, + { 0x84C9, "_meth_84C9" }, + { 0x84CA, "_meth_84CA" }, + { 0x84CB, "_meth_84CB" }, + { 0x84CC, "_meth_84CC" }, + { 0x84CD, "_meth_84CD" }, + { 0x84CE, "_meth_84CE" }, + { 0x84CF, "_meth_84CF" }, + { 0x84D0, "_meth_84D0" }, + { 0x84D1, "_meth_84D1" }, + { 0x84D2, "_meth_84D2" }, + { 0x84D3, "_meth_84D3" }, + { 0x84D4, "_meth_84D4" }, + { 0x84D5, "_meth_84D5" }, + { 0x84D6, "_meth_84D6" }, + { 0x84D7, "_meth_84D7" }, + { 0x84D8, "_meth_84D8" }, + { 0x84D9, "_meth_84D9" }, + { 0x84DA, "_meth_84DA" }, + { 0x84DB, "_meth_84DB" }, + { 0x84DC, "_meth_84DC" }, + { 0x84DD, "_meth_84DD" }, + { 0x84DE, "_meth_84DE" }, + { 0x84DF, "_meth_84DF" }, + { 0x84E0, "_meth_84E0" }, + { 0x84E1, "_meth_84E1" }, + { 0x84E2, "_meth_84E2" }, + { 0x84E3, "_meth_84E3" }, + { 0x84E4, "_meth_84E4" }, + { 0x84E5, "_meth_84E5" }, + { 0x84E6, "_meth_84E6" }, + { 0x84E7, "_meth_84E7" }, + { 0x84E8, "_meth_84E8" }, + { 0x84E9, "_meth_84E9" }, + { 0x84EA, "_meth_84EA" }, + { 0x84EB, "_meth_84EB" }, + { 0x84EC, "_meth_84EC" }, + { 0x84ED, "_meth_84ED" }, + { 0x84EE, "_meth_84EE" }, + { 0x84EF, "_meth_84EF" }, + { 0x84F0, "_meth_84F0" }, + { 0x84F1, "_meth_84F1" }, + { 0x84F2, "_meth_84F2" }, + { 0x84F3, "_meth_84F3" }, + { 0x84F4, "_meth_84F4" }, + { 0x84F5, "_meth_84F5" }, + { 0x84F6, "_meth_84F6" }, + { 0x84F7, "_meth_84F7" }, + { 0x84F8, "_meth_84F8" }, + { 0x84F9, "_meth_84F9" }, + { 0x84FA, "_meth_84FA" }, + { 0x84FB, "_meth_84FB" }, + { 0x84FC, "_meth_84FC" }, + { 0x84FD, "_meth_84FD" }, + { 0x84FE, "_meth_84FE" }, + { 0x84FF, "_meth_84FF" }, + { 0x8500, "_meth_8500" }, + { 0x8501, "_meth_8501" }, + { 0x8502, "_meth_8502" }, + { 0x8503, "_meth_8503" }, + { 0x8504, "_meth_8504" }, + { 0x8505, "_meth_8505" }, + { 0x8506, "_meth_8506" }, + { 0x8507, "_meth_8507" }, + { 0x8508, "_meth_8508" }, + { 0x8509, "_meth_8509" }, + { 0x850A, "_meth_850A" }, + { 0x850B, "_meth_850B" }, + { 0x850C, "_meth_850C" }, + { 0x850D, "_meth_850D" }, + { 0x850E, "_meth_850E" }, + { 0x850F, "_meth_850F" }, + { 0x8510, "_meth_8510" }, + { 0x8511, "_meth_8511" }, + { 0x8512, "_meth_8512" }, + { 0x8513, "_meth_8513" }, + { 0x8514, "_meth_8514" }, + { 0x8515, "_meth_8515" }, + { 0x8516, "_meth_8516" }, + { 0x8517, "_meth_8517" }, + { 0x8518, "_meth_8518" }, + { 0x8519, "_meth_8519" }, + { 0x851A, "_meth_851A" }, + { 0x851B, "_meth_851B" }, + { 0x851C, "_meth_851C" }, + { 0x851D, "_meth_851D" }, + { 0x851E, "_meth_851E" }, + { 0x851F, "_meth_851F" }, + { 0x8520, "_meth_8520" }, + { 0x8521, "_meth_8521" }, + { 0x8522, "_meth_8522" }, + { 0x8523, "_meth_8523" }, + { 0x8524, "_meth_8524" }, + { 0x8525, "_meth_8525" }, + { 0x8526, "_meth_8526" }, + { 0x8527, "_meth_8527" }, + { 0x8528, "_meth_8528" }, + { 0x8529, "_meth_8529" }, + { 0x852A, "_meth_852A" }, + { 0x852B, "_meth_852B" }, + { 0x852C, "_meth_852C" }, + { 0x852D, "_meth_852D" }, + { 0x852E, "_meth_852E" }, + { 0x852F, "_meth_852F" }, + { 0x8530, "_meth_8530" }, + { 0x8531, "_meth_8531" }, + { 0x8532, "_meth_8532" }, + { 0x8533, "_meth_8533" }, + { 0x8534, "_meth_8534" }, + { 0x8535, "_meth_8535" }, + { 0x8536, "_meth_8536" }, + { 0x8537, "_meth_8537" }, + { 0x8538, "_meth_8538" }, + { 0x8539, "_meth_8539" }, + { 0x853A, "_meth_853A" }, + { 0x853B, "_meth_853B" }, + { 0x853C, "_meth_853C" }, + { 0x853D, "_meth_853D" }, + { 0x853E, "_meth_853E" }, + { 0x853F, "_meth_853F" }, + { 0x8540, "_meth_8540" }, + { 0x8541, "_meth_8541" }, + { 0x8542, "_meth_8542" }, + { 0x8543, "_meth_8543" }, + { 0x8544, "_meth_8544" }, + { 0x8545, "_meth_8545" }, + { 0x8546, "_meth_8546" }, + { 0x8547, "_meth_8547" }, + { 0x8548, "_meth_8548" }, + { 0x8549, "_meth_8549" }, + { 0x854A, "_meth_854A" }, + { 0x854B, "_meth_854B" }, + { 0x854C, "_meth_854C" }, + { 0x854D, "_meth_854D" }, + { 0x854E, "_meth_854E" }, + { 0x854F, "_meth_854F" }, + { 0x8550, "_meth_8550" }, + { 0x8551, "_meth_8551" }, + { 0x8552, "_meth_8552" }, + { 0x8553, "_meth_8553" }, + { 0x8554, "_meth_8554" }, + { 0x8555, "_meth_8555" }, + { 0x8556, "_meth_8556" }, + { 0x8557, "_meth_8557" }, + { 0x8558, "_meth_8558" }, + { 0x8559, "_meth_8559" }, + { 0x855A, "_meth_855A" }, + { 0x855B, "_meth_855B" }, + { 0x855C, "_meth_855C" }, + { 0x855D, "_meth_855D" }, + { 0x855E, "_meth_855E" }, + { 0x855F, "_meth_855F" }, + { 0x8560, "_meth_8560" }, + { 0x8561, "_meth_8561" }, + { 0x8562, "_meth_8562" }, + { 0x8563, "_meth_8563" }, + { 0x8564, "_meth_8564" }, + { 0x8565, "_meth_8565" }, + { 0x8566, "_meth_8566" }, + { 0x8567, "_meth_8567" }, + { 0x8568, "_meth_8568" }, + { 0x8569, "_meth_8569" }, + { 0x856A, "_meth_856A" }, + { 0x856B, "_meth_856B" }, + { 0x856C, "_meth_856C" }, + { 0x856D, "_meth_856D" }, + { 0x856E, "_meth_856E" }, + { 0x856F, "_meth_856F" }, + { 0x8570, "_meth_8570" }, + { 0x8571, "_meth_8571" }, + { 0x8572, "_meth_8572" }, + { 0x8573, "_meth_8573" }, + { 0x8574, "_meth_8574" }, + { 0x8575, "_meth_8575" }, + { 0x8576, "_meth_8576" }, + { 0x8577, "_meth_8577" }, + { 0x8578, "_meth_8578" }, + { 0x8579, "_meth_8579" }, + { 0x857A, "_meth_857A" }, + { 0x857B, "_meth_857B" }, + { 0x857C, "_meth_857C" }, + { 0x857D, "_meth_857D" }, + { 0x857E, "_meth_857E" }, + { 0x857F, "_meth_857F" }, + { 0x8580, "_meth_8580" }, + { 0x8581, "_meth_8581" }, + { 0x8582, "_meth_8582" }, + { 0x8583, "_meth_8583" }, + { 0x8584, "_meth_8584" }, + { 0x8585, "_meth_8585" }, + { 0x8586, "_meth_8586" }, + { 0x8587, "_meth_8587" }, + { 0x8588, "_meth_8588" }, + { 0x8589, "_meth_8589" }, + { 0x858A, "_meth_858A" }, + { 0x858B, "_meth_858B" }, + { 0x858C, "_meth_858C" }, + { 0x858D, "_meth_858D" }, + { 0x858E, "_meth_858E" }, + { 0x858F, "_meth_858F" }, + { 0x8590, "_meth_8590" }, + { 0x8591, "_meth_8591" }, + { 0x8592, "_meth_8592" }, + { 0x8593, "_meth_8593" }, + { 0x8594, "_meth_8594" }, + { 0x8595, "_meth_8595" }, + { 0x8596, "_meth_8596" }, + { 0x8597, "_meth_8597" }, + { 0x8598, "_meth_8598" }, + { 0x8599, "_meth_8599" }, + { 0x859A, "_meth_859A" }, + { 0x859B, "_meth_859B" }, + { 0x859C, "_meth_859C" }, + { 0x859D, "_meth_859D" }, + { 0x859E, "_meth_859E" }, + { 0x859F, "_meth_859F" }, + { 0x85A0, "_meth_85A0" }, + { 0x85A1, "_meth_85A1" }, + { 0x85A2, "_meth_85A2" }, + { 0x85A3, "_meth_85A3" }, + { 0x85A4, "_meth_85A4" }, + { 0x85A5, "_meth_85A5" }, + { 0x85A6, "_meth_85A6" }, + { 0x85A7, "_meth_85A7" }, + { 0x85A8, "_meth_85A8" }, + { 0x85A9, "_meth_85A9" }, + { 0x85AA, "_meth_85AA" }, + { 0x85AB, "_meth_85AB" }, + { 0x85AC, "_meth_85AC" }, + { 0x85AD, "_meth_85AD" }, + { 0x85AE, "_meth_85AE" }, + { 0x85AF, "_meth_85AF" }, + { 0x85B0, "_meth_85B0" }, + { 0x85B1, "_meth_85B1" }, + { 0x85B2, "_meth_85B2" }, + { 0x85B3, "_meth_85B3" }, + { 0x85B4, "_meth_85B4" }, + { 0x85B5, "_meth_85B5" }, + { 0x85B6, "_meth_85B6" }, + { 0x85B7, "_meth_85B7" }, + { 0x85B8, "_meth_85B8" }, + { 0x85B9, "_meth_85B9" }, + { 0x85BA, "_meth_85BA" }, + { 0x85BB, "_meth_85BB" }, + { 0x85BC, "_meth_85BC" }, + { 0x85BD, "_meth_85BD" }, + { 0x85BE, "_meth_85BE" }, + { 0x85BF, "_meth_85BF" }, + { 0x85C0, "_meth_85C0" }, + { 0x85C1, "_meth_85C1" }, + { 0x85C2, "_meth_85C2" }, + { 0x85C3, "_meth_85C3" }, + { 0x85C4, "_meth_85C4" }, + { 0x85C5, "_meth_85C5" }, + { 0x85C6, "_meth_85C6" }, + { 0x85C7, "_meth_85C7" }, + { 0x85C8, "_meth_85C8" }, + { 0x85C9, "_meth_85C9" }, + { 0x85CA, "_meth_85CA" }, + { 0x85CB, "_meth_85CB" }, + { 0x85CC, "_meth_85CC" }, + { 0x85CD, "_meth_85CD" }, + { 0x85CE, "_meth_85CE" }, + { 0x85CF, "_meth_85CF" }, + { 0x85D0, "_meth_85D0" }, + { 0x85D1, "_meth_85D1" }, + { 0x85D2, "_meth_85D2" }, + { 0x85D3, "_meth_85D3" }, + { 0x85D4, "_meth_85D4" }, + { 0x85D5, "_meth_85D5" }, + { 0x85D6, "_meth_85D6" }, + { 0x85D7, "_meth_85D7" }, + { 0x85D8, "_meth_85D8" }, + { 0x85D9, "_meth_85D9" }, + { 0x85DA, "_meth_85DA" }, + { 0x85DB, "_meth_85DB" }, +}}; + +const std::array file_list +{{ + { 0, "DUMMY" }, +}}; + +const std::array token_list +{{ + { 0, "DUMMY" }, +}}; + +struct __init__ +{ + __init__() + { + static bool init = false; + if(init) return; + init = true; + + opcode_map.reserve(opcode_list.size()); + opcode_map_rev.reserve(opcode_list.size()); + function_map.reserve(function_list.size()); + function_map_rev.reserve(function_list.size()); + method_map.reserve(method_list.size()); + method_map_rev.reserve(method_list.size()); + file_map.reserve(file_list.size()); + file_map_rev.reserve(file_list.size()); + token_map.reserve(token_list.size()); + token_map_rev.reserve(token_list.size()); + + for(const auto& entry : opcode_list) + { + opcode_map.insert({ entry.key, entry.value }); + opcode_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : function_list) + { + function_map.insert({ entry.key, entry.value }); + function_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : method_list) + { + method_map.insert({ entry.key, entry.value }); + method_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : file_list) + { + file_map.insert({ entry.key, entry.value }); + file_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : token_list) + { + token_map.insert({ entry.key, entry.value }); + token_map_rev.insert({ utils::string::to_lower(entry.value), entry.key }); + } + } +}; + +__init__ _; + +} // namespace xsk::gsc::iw7 diff --git a/src/iw7/xsk/resolver.hpp b/src/iw7/xsk/resolver.hpp new file mode 100644 index 00000000..449cb6b9 --- /dev/null +++ b/src/iw7/xsk/resolver.hpp @@ -0,0 +1,33 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::iw7 +{ + +class resolver +{ +public: + static auto opcode_id(const std::string& name) -> std::uint8_t; + static auto opcode_name(std::uint8_t id) -> std::string; + + static auto function_id(const std::string& name) -> std::uint16_t; + static auto function_name(std::uint16_t id) -> std::string; + + static auto method_id(const std::string& name) -> std::uint16_t; + static auto method_name(std::uint16_t id) -> std::string; + + static auto file_id(const std::string& name) -> std::uint32_t; + static auto file_name(std::uint32_t id) -> std::string; + + static auto token_id(const std::string& name) -> std::uint32_t; + static auto token_name(std::uint32_t id) -> std::string; + + static auto find_function(const std::string& name) -> bool; + static auto find_method(const std::string& name) -> bool; +}; + +} // namespace xsk::gsc::iw7 diff --git a/src/s1/stdafx.cpp b/src/s1/stdafx.cpp new file mode 100644 index 00000000..0f0f08c2 --- /dev/null +++ b/src/s1/stdafx.cpp @@ -0,0 +1,6 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" diff --git a/src/s1/stdafx.hpp b/src/s1/stdafx.hpp new file mode 100644 index 00000000..45502c5b --- /dev/null +++ b/src/s1/stdafx.hpp @@ -0,0 +1,38 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +// Warnings +#ifdef _WIN32 +#pragma warning(disable:4244) +#pragma warning(disable:4267) +#pragma warning(disable:4005) +#pragma warning(disable:4065) +#define _CRT_SECURE_NO_WARNINGS +#endif + +// C/C++ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Ext +using namespace std::literals; + +#include "xsk/s1.hpp" diff --git a/src/s1/xsk/assembler.cpp b/src/s1/xsk/assembler.cpp new file mode 100644 index 00000000..8fc6a21c --- /dev/null +++ b/src/s1/xsk/assembler.cpp @@ -0,0 +1,604 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "s1.hpp" + +namespace xsk::gsc::s1 +{ + +auto assembler::output_script() -> std::vector +{ + std::vector script; + + if(script_ == nullptr) return script; + + script.resize(script_->pos()); + memcpy(script.data(), script_->buffer().data(), script.size()); + + return script; +} + +auto assembler::output_stack() -> std::vector +{ + std::vector stack; + + if(stack_ == nullptr) return stack; + + stack.resize(stack_->pos()); + memcpy(stack.data(), stack_->buffer().data(), stack.size()); + + return stack; +} + +void assembler::assemble(const std::string& file, std::vector& data) +{ + std::vector assembly = utils::string::clean_buffer_lines(data); + std::vector functions; + gsc::function_ptr func = nullptr; + std::uint32_t index = 1; + std::uint16_t switchnum = 0; + + for (auto& line : assembly) + { + if (line == "" || line.substr(0, 2) == "//") + { + continue; + } + else if (line.substr(0, 4) == "sub_") + { + func = std::make_unique(); + func->index = index; + func->name = line.substr(4); + } + else if (line.substr(0, 4) == "end_") + { + if (func != nullptr) + { + func->size = index - func->index; + functions.push_back(std::move(func)); + } + } + else if (line.substr(0, 4) == "loc_") + { + func->labels[index] = line; + } + else + { + auto data = utils::string::parse_code(line); + + if (switchnum) + { + if (data[0] == "case" || data[0] == "default") + { + for (auto& entry : data) + { + func->instructions.back()->data.push_back(entry); + } + switchnum--; + continue; + } + + throw gsc::asm_error("invalid instruction inside endswitch \""s + line + "\"!"); + } + else + { + auto inst = std::make_unique(); + inst->index = index; + inst->opcode = static_cast(resolver::opcode_id(data[0])); + inst->size = opcode_size(inst->opcode); + data.erase(data.begin()); + inst->data = std::move(data); + + if (opcode(inst->opcode) == opcode::OP_endswitch) + { + switchnum = static_cast(std::stoul(inst->data[0])); + inst->size += 7 * switchnum; + } + + index += inst->size; + func->instructions.push_back(std::move(inst)); + } + } + } + + this->assemble(file, functions); +} + +void assembler::assemble(const std::string& file, std::vector& functions) +{ + script_ = std::make_unique(0x100000); + stack_ = std::make_unique(0x100000); + filename_ = file; + functions_ = std::move(functions); + + script_->write(static_cast(opcode::OP_End)); + stack_->write(0x69773630); + + for (const auto& func : functions_) + { + this->assemble_function(func); + } +} + +void assembler::assemble_function(const gsc::function_ptr& func) +{ + labels_ = func->labels; + + stack_->write(func->size); + + func->id = func->name.substr(0, 3) == "_ID" ? std::stoul(func->name.substr(3)) : resolver::token_id(func->name); + stack_->write(func->id); + + if (func->id == 0) + { + stack_->write_c_string(func->name); + } + + for (const auto& inst : func->instructions) + { + this->assemble_instruction(inst); + } +} + +void assembler::assemble_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_Return: + case opcode::OP_BoolNot: + case opcode::OP_CastBool: + case opcode::OP_inequality: + case opcode::OP_GetThisthread: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_checkclearparams: + case opcode::OP_CastFieldObject: + case opcode::OP_End: + case opcode::OP_size: + case opcode::OP_EmptyArray: + case opcode::OP_bit_and: + case opcode::OP_less_equal: + case opcode::OP_voidCodepos: + case opcode::OP_ClearVariableField: + case opcode::OP_divide: + case opcode::OP_GetSelf: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_plus: + case opcode::OP_BoolComplement: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_inc: + case opcode::OP_clearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_endon: + case opcode::OP_greater_equal: + case opcode::OP_GetSelfObject: + case opcode::OP_SetVariableField: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_less: + case opcode::OP_GetGameRef: + case opcode::OP_waitFrame: + case opcode::OP_waittillFrameEnd: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_notify: + case opcode::OP_DecTop: + case opcode::OP_shift_left: + case opcode::OP_greater: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_minus: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_multiply: + case opcode::OP_mod: + case opcode::OP_GetGame: + case opcode::OP_waittill: + case opcode::OP_dec: + case opcode::OP_PreScriptCall: + case opcode::OP_GetAnim: + case opcode::OP_GetUndefined: + case opcode::OP_GetAnimObject: + case opcode::OP_GetLevelObject: + case opcode::OP_bit_ex_or: + case opcode::OP_equality: + case opcode::OP_ClearArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalArray: + case opcode::OP_vector: + case opcode::OP_bit_or: + case opcode::OP_AddArray: + case opcode::OP_waittillmatch2: + case opcode::OP_shift_right: + script_->write(static_cast(inst->opcode)); + break; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetInteger: + script_->write(static_cast(inst->opcode)); + script_->write(std::stoi(inst->data[0])); + break; + case opcode::OP_GetFloat: + script_->write(static_cast(inst->opcode)); + script_->write(std::stof(inst->data[0])); + break; + case opcode::OP_GetVector: + script_->write(static_cast(inst->opcode)); + script_->write(std::stof(inst->data[0])); + script_->write(std::stof(inst->data[1])); + script_->write(std::stof(inst->data[2])); + break; + case opcode::OP_GetString: + case opcode::OP_GetIString: + script_->write(static_cast(inst->opcode)); + script_->write(0); + stack_->write_c_string(utils::string::to_code(inst->data[0])); + break; + case opcode::OP_GetAnimation: + script_->write(static_cast(inst->opcode)); + script_->write(0); + script_->write(0); + stack_->write_c_string(utils::string::unquote(inst->data[0])); + stack_->write_c_string(utils::string::unquote(inst->data[1])); + break; + case opcode::OP_GetAnimTree: + script_->write(static_cast(inst->opcode)); + script_->write(0); + stack_->write_c_string(utils::string::unquote(inst->data[0])); + break; + case opcode::OP_waittillmatch: + script_->write(static_cast(inst->opcode)); + script_->write(0); + break; + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_EvalLocalArrayCached: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + this->assemble_field_variable(inst); + break; + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + this->assemble_local_call(inst, false); + break; + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + this->assemble_local_call(inst, true); + break; + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + this->assemble_far_call(inst, false); + break; + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + this->assemble_far_call(inst, true); + break; + case opcode::OP_CallBuiltin: + this->assemble_builtin_call(inst, false, true); + break; + case opcode::OP_CallBuiltinMethod: + this->assemble_builtin_call(inst, true, true); + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + this->assemble_builtin_call(inst, false, false); + break; + case opcode::OP_GetBuiltinMethod: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + this->assemble_builtin_call(inst, true, false); + break; + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + this->assemble_jump(inst, true, false); + break; + case opcode::OP_jumpback: + this->assemble_jump(inst, false, true); + break; + case opcode::OP_jump: + this->assemble_jump(inst, false, false); + break; + case opcode::OP_switch: + this->assemble_switch(inst); + break; + case opcode::OP_endswitch: + this->assemble_end_switch(inst); + break; + default: + throw gsc::asm_error(utils::string::va("Unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); + } +} + +void assembler::assemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num) +{ + script_->write(static_cast(inst->opcode)); + + std::uint16_t id = 0; + + if (arg_num) + { + script_->write(static_cast(std::stol(inst->data[0]))); + + if (method) + id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::method_id(inst->data[1]); + else + id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::function_id(inst->data[1]); + } + else + { + if (method) + id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::method_id(inst->data[0]); + else + id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::function_id(inst->data[0]); + } + + script_->write(id); +} + +void assembler::assemble_local_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_function(inst->data[0]); + + std::int32_t offset = addr - inst->index - 1; + + this->assemble_offset(offset); + + if (thread) + { + script_->write(static_cast(std::stol(inst->data[1]))); + } +} + +void assembler::assemble_far_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->write(static_cast(inst->opcode)); + script_->write(0); + script_->write(0); + + std::uint16_t file_id = 0; + std::uint16_t func_id = 0; + + if (thread) + { + script_->write(static_cast(std::stol(inst->data[0]))); + + file_id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::file_id(inst->data[1]); + func_id = inst->data[2].substr(0, 3) == "_ID" ? std::stol(inst->data[2].substr(3)) : resolver::token_id(inst->data[2]); + } + else + { + file_id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::file_id(inst->data[0]); + func_id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::token_id(inst->data[1]); + } + + stack_->write(file_id); + if (file_id == 0) stack_->write_c_string(thread ? inst->data[1] : inst->data[0]); + stack_->write(func_id); + if (func_id == 0) stack_->write_c_string(thread ? inst->data[2] : inst->data[1]); +} + +void assembler::assemble_switch(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_label(inst->data[0]); + + script_->write(addr - inst->index - 4); +} + +void assembler::assemble_end_switch(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::uint16_t casenum = 0; + + if (utils::string::is_number(inst->data[0])) + { + casenum = std::stol(inst->data[0]); + } + else + { + throw gsc::asm_error("invalid endswitch number!"); + } + + script_->write(casenum); + + std::uint32_t internal_index = inst->index + 3; + + for (std::uint16_t i = 0; i < casenum; i++) + { + if (inst->data[1 + (3 * i)] == "case") + { + if (utils::string::is_number(inst->data[1 + (3 * i) + 1])) + { + script_->write((std::stol(inst->data[1 + (3 * i) + 1]) & 0xFFFFFF) + 0x800000); + } + else + { + script_->write(i + 1); + stack_->write_c_string(utils::string::unquote(inst->data[1 + (3 * i) + 1])); + } + + internal_index += 4; + + std::int32_t addr = this->resolve_label(inst->data[1 + (3 * i) + 2]); + + this->assemble_offset(addr - internal_index); + + internal_index += 3; + } + else if (inst->data[1 + (3 * i)] == "default") + { + script_->write(0); + stack_->write_c_string("\x01"); + + internal_index += 4; + std::int32_t addr = this->resolve_label(inst->data[1 + (3 * i) + 1]); + + this->assemble_offset(addr - internal_index); + + internal_index += 3; + } + } +} + +void assembler::assemble_field_variable(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::uint16_t field_id = 0; + + if (inst->data[0].substr(0, 3) == "_ID") + { + field_id = (std::uint16_t)std::stol(inst->data[0].substr(3)); + } + else + { + field_id = resolver::token_id(inst->data[0]); + + if (field_id == 0) + { + field_id = 0xFFFF; + } + } + + script_->write(field_id); + + if (field_id > 0xA7DC) + { + stack_->write(0); + stack_->write_c_string(inst->data[0]); + } +} + +void assembler::assemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_label(inst->data[0]); + + if (expr) + { + script_->write(addr - inst->index - 3); + } + else if (back) + { + script_->write((inst->index + 3) - addr); + } + else + { + script_->write(addr - inst->index - 5); + } +} + +void assembler::assemble_offset(std::int32_t offset) +{ + std::array bytes = {}; + + offset = (offset << 10) >> 8; + + *reinterpret_cast(bytes.data()) = offset; + + script_->write(bytes[0]); + script_->write(bytes[1]); + script_->write(bytes[2]); +} + +auto assembler::resolve_function(const std::string& name) -> std::uint32_t +{ + auto temp = name.substr(0, 4) == "sub_" ? name.substr(4) : name; + + for (const auto& func : functions_) + { + if (func->name == temp) + { + return func->index; + } + } + + throw gsc::asm_error("Couldn't resolve local function address of '" + temp + "'!"); +} + +auto assembler::resolve_label(const std::string& name) -> std::uint32_t +{ + for (auto& func : labels_) + { + if (func.second == name) + { + return func.first; + } + } + + throw gsc::asm_error("Couldn't resolve label address of '" + name + "'!"); +} + +} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/assembler.hpp b/src/s1/xsk/assembler.hpp new file mode 100644 index 00000000..699595d5 --- /dev/null +++ b/src/s1/xsk/assembler.hpp @@ -0,0 +1,40 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::s1 +{ + +class assembler : public gsc::assembler +{ + std::string filename_; + utils::byte_buffer_ptr script_; + utils::byte_buffer_ptr stack_; + std::vector functions_; + std::unordered_map labels_; + +public: + auto output_script() -> std::vector; + auto output_stack() -> std::vector; + void assemble(const std::string& file, std::vector& data); + void assemble(const std::string& file, std::vector& functions); + +private: + void assemble_function(const gsc::function_ptr& func); + void assemble_instruction(const gsc::instruction_ptr& inst); + void assemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num); + void assemble_local_call(const gsc::instruction_ptr& inst, bool thread); + void assemble_far_call(const gsc::instruction_ptr& inst, bool thread); + void assemble_switch(const gsc::instruction_ptr& inst); + void assemble_end_switch(const gsc::instruction_ptr& inst); + void assemble_field_variable(const gsc::instruction_ptr& inst); + void assemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back); + void assemble_offset(std::int32_t offset); + auto resolve_function(const std::string& name) -> std::uint32_t; + auto resolve_label(const std::string& name) -> std::uint32_t; +}; + +} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/compiler.cpp b/src/s1/xsk/compiler.cpp new file mode 100644 index 00000000..9bf13f23 --- /dev/null +++ b/src/s1/xsk/compiler.cpp @@ -0,0 +1,2295 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "s1.hpp" +#include "parser.hpp" +#include "lexer.hpp" + +namespace xsk::gsc::s1 +{ + +auto compiler::output() -> std::vector +{ + return std::move(assembly_); +} + +void compiler::compile(const std::string& file, std::vector& data) +{ + filename_ = file; + + auto result = parse_buffer(filename_, data); + + compile_program(result); +} + +void compiler::set_readf_callback(std::function(const std::string&)> func) +{ + callback_readf_ = func; +} + +auto compiler::parse_buffer(const std::string& file, std::vector& data) -> gsc::program_ptr +{ + yyscan_t scanner; + gsc::location loc; + gsc::program_ptr result(nullptr); + + loc.initialize(&file); + // Add the two NULL terminators, required by flex. + data.push_back(0); + data.push_back(0); + + if (s1_lex_init(&scanner)) + exit(1); + + YY_BUFFER_STATE yybuffer = s1__scan_buffer(reinterpret_cast(data.data()), data.size(), scanner); + + parser parser(scanner, loc, result); + + if(parser.parse() || result == nullptr) + { + throw gsc::comp_error(loc, "An unknown error ocurred while parsing gsc file."); + } + + s1__delete_buffer(yybuffer, scanner); + s1_lex_destroy(scanner); + + return result; +} + +auto compiler::parse_file(const std::string& file) -> gsc::program_ptr +{ + auto buffer = callback_readf_(file); + auto result = parse_buffer(file, buffer); + + return result; +} + +void compiler::compile_program(const gsc::program_ptr& program) +{ + assembly_.clear(); + includes_.clear(); + animtrees_.clear(); + constants_.clear(); + local_functions_.clear(); + index_ = 1; + + for(const auto& def : program->definitions) + { + if(def.as_node->type == gsc::node_t::thread) + { + local_functions_.push_back(def.as_thread->name->value); + } + } + + for(const auto& include : program->includes) + { + emit_include(include); + } + + for(const auto& def : program->definitions) + { + emit_define(def); + } + +#ifdef DEBUG_GSC_COMPILER + print_debug_info(); +#endif +} + +void compiler::emit_include(const gsc::include_ptr& include) +{ + const auto& path = include->file->value; + + for(const auto& inc : includes_) + { + if(inc.name == path) + { + throw gsc::comp_error(include->loc, "error duplicated include file '" + path + "'."); + } + } + + if(map_known_includes(path)) return; + + try + { + auto program = parse_file(path); + + std::vector funcs; + + for(const auto& def : program->definitions) + { + if(def.as_node->type == gsc::node_t::thread) + { + funcs.push_back(def.as_thread->name->value); + } + } + + if(funcs.size() == 0) + { + throw gsc::comp_error(include->loc, "error empty include file '" + path + "'."); + } + + includes_.push_back(include_t(path, funcs)); + } + catch(const std::exception& e) + { + throw gsc::comp_error(include->loc, "error parsing include file '" + path + "': " + e.what()); + } +} + +void compiler::emit_define(const gsc::define_ptr& define) +{ + switch(define.as_node->type) + { + case gsc::node_t::usingtree: emit_usingtree(define.as_usingtree); break; + case gsc::node_t::constant: emit_constant(define.as_constant); break; + case gsc::node_t::thread: emit_thread(define.as_thread); break; + default: break; + } +} + +void compiler::emit_usingtree(const gsc::usingtree_ptr& animtree) +{ + animtrees_.push_back({ animtree->animtree->value, false }); +} + +void compiler::emit_constant(const gsc::constant_ptr& constant) +{ + constants_.insert({ constant->name->value, std::move(constant->value) }); +} + +void compiler::emit_thread(const gsc::thread_ptr& thread) +{ + function_ = std::make_unique(); + function_->index = index_; + function_->name = thread->name->value; + + auto ctx = std::make_unique(); + stack_idx_ = 0; + label_idx_ = 0; + can_break_ = false; + can_continue_ = false; + local_stack_.clear(); + break_ctxs_.clear(); + continue_ctxs_.clear(); + + process_thread(ctx, thread); + + emit_parameters(ctx, thread->params); + emit_stmt_list(ctx, thread->block, true); + emit_opcode(ctx, opcode::OP_End); + + function_->size = index_ - function_->index; + assembly_.push_back(std::move(function_)); +} + +void compiler::emit_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + initialize_variable(ctx, param); + emit_opcode(ctx, opcode::OP_SafeCreateVariableFieldCached, variable_create_index(ctx, param)); + } + + emit_opcode(ctx, opcode::OP_checkclearparams); +} + +void compiler::emit_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt, bool last) +{ + switch(stmt.as_node->type) + { + case gsc::node_t::stmt_list: emit_stmt_list(ctx, stmt.as_list, last); break; + case gsc::node_t::stmt_call: emit_stmt_call(ctx, stmt.as_call); break; + case gsc::node_t::stmt_assign: emit_stmt_assign(ctx, stmt.as_assign); break; + case gsc::node_t::stmt_endon: emit_stmt_endon(ctx, stmt.as_endon); break; + case gsc::node_t::stmt_notify: emit_stmt_notify(ctx, stmt.as_notify); break; + case gsc::node_t::stmt_wait: emit_stmt_wait(ctx, stmt.as_wait); break; + case gsc::node_t::stmt_waittill: emit_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_waittillmatch: emit_stmt_waittillmatch(ctx, stmt.as_waittillmatch); break; + case gsc::node_t::stmt_waittillframeend: emit_stmt_waittillframeend(ctx, stmt.as_waittillframeend); break; + case gsc::node_t::stmt_waitframe: emit_stmt_waitframe(ctx, stmt.as_waitframe); break; + case gsc::node_t::stmt_if: emit_stmt_if(ctx, stmt.as_if, last); break; + case gsc::node_t::stmt_ifelse: emit_stmt_ifelse(ctx, stmt.as_ifelse, last); break; + case gsc::node_t::stmt_while: emit_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: emit_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: emit_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: emit_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_case: emit_stmt_case(ctx, stmt.as_case); break; + case gsc::node_t::stmt_default: emit_stmt_default(ctx, stmt.as_default); break; + case gsc::node_t::stmt_break: emit_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_continue: emit_stmt_continue(ctx, stmt.as_continue); break; + case gsc::node_t::stmt_return: emit_stmt_return(ctx, stmt.as_return); break; + default: break; + } +} + +void compiler::emit_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt, bool last) +{ + for (const auto& entry : stmt->stmts) + { + bool last_ = (&entry == &stmt->stmts.back() && last) ? true : false; + emit_stmt(ctx, entry, last_); + } +} + +void compiler::emit_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt) +{ + if(stmt->expr->func.as_node->type == gsc::node_t::expr_call_function) + { + const auto& name = stmt->expr->func.as_func->name->value; + + if(name == "assert" || name == "assertex" || name == "assertmsg") return; + } + + emit_expr_call(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_DecTop); +} + +void compiler::emit_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt) +{ + emit_expr_assign(ctx, stmt->expr); +} + +void compiler::emit_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_endon); +} + +void compiler::emit_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt) +{ + emit_opcode(ctx, opcode::OP_voidCodepos); + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + emit_expr(ctx, arg); + } + + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_notify); +} + +void compiler::emit_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_wait); +} + +void compiler::emit_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_waittill); + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + create_variable(ctx, arg.as_name); + emit_opcode(ctx, opcode::OP_SafeSetWaittillVariableFieldCached, variable_access_index(ctx, arg.as_name)); + } + + emit_opcode(ctx, opcode::OP_clearparams); +} + +void compiler::emit_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt) +{ + emit_expr_arguments(ctx, stmt->args); + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_waittillmatch); + emit_opcode(ctx, opcode::OP_clearparams); +} + +void compiler::emit_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt) +{ + emit_opcode(ctx, opcode::OP_waittillFrameEnd); +} + +void compiler::emit_stmt_waitframe(const gsc::context_ptr& ctx, const gsc::stmt_waitframe_ptr& stmt) +{ + emit_opcode(ctx, opcode::OP_waitFrame); +} + +void compiler::emit_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt, bool last) +{ + auto end_loc = create_label(); + + if(stmt->expr.as_node->type == gsc::node_t::expr_not) + { + emit_expr(ctx, stmt->expr.as_not->rvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrue, end_loc); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, end_loc); + } + + ctx->transfer(stmt->ctx); + stmt->ctx->is_last = last; + + emit_stmt(stmt->ctx, stmt->stmt, last); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_remove_local_vars(stmt->ctx); + + insert_label(end_loc); +} + +void compiler::emit_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt, bool last) +{ + std::vector childs; + auto else_loc = create_label(); + auto end_loc = create_label(); + + if(stmt->expr.as_node->type == gsc::node_t::expr_not) + { + emit_expr(ctx, stmt->expr.as_not->rvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrue, else_loc); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, else_loc); + } + + ctx->transfer(stmt->ctx_if); + stmt->ctx_if->is_last = last; + + emit_stmt(stmt->ctx_if, stmt->stmt_if, last); + + emit_remove_local_vars(stmt->ctx_if); + + if(stmt->ctx_if->abort == abort_t::abort_none) + childs.push_back(stmt->ctx_if.get()); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_opcode(ctx, opcode::OP_jump, end_loc); + + insert_label(else_loc); + + ctx->transfer(stmt->ctx_else); + stmt->ctx_else->is_last = last; + + emit_stmt(stmt->ctx_else, stmt->stmt_else, last); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_remove_local_vars(stmt->ctx_else); + + if(stmt->ctx_else->abort == abort_t::abort_none) + childs.push_back(stmt->ctx_else.get()); + + insert_label(end_loc); + + ctx->init_from_child(childs); +} + +void compiler::emit_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = true; + can_continue_ = true; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + + auto begin_loc = insert_label(); + + bool const_cond = is_constant_condition(stmt->expr); + + if(!const_cond) + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + } + + emit_stmt(stmt->ctx, stmt->stmt, false); + + insert_label(continue_loc); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + + if(const_cond) + ctx->init_from_child(break_ctxs_); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = false; + can_continue_ = false; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + emit_stmt(ctx, stmt->pre_expr, false); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + ctx->transfer(stmt->ctx_post); + + auto begin_loc = insert_label(); + + bool const_cond = is_constant_condition(stmt->expr); + + if(!const_cond) + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + } + + can_break_ = true; + can_continue_ = true; + + emit_stmt(stmt->ctx, stmt->stmt, false); + + if(stmt->ctx->abort == abort_t::abort_none) + continue_ctxs_.push_back(stmt->ctx.get()); + + can_break_ = false; + can_continue_ = false; + + insert_label(continue_loc); + + stmt->ctx_post->init_from_child(continue_ctxs_); + + emit_stmt(stmt->ctx_post, stmt->post_expr, false); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + + if(const_cond) + ctx->init_from_child(break_ctxs_); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = false; + can_continue_ = false; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + emit_expr(ctx, stmt->array_expr); + emit_variable_ref(ctx, stmt->array, true); + emit_variable(ctx, stmt->array); + emit_opcode(ctx, opcode::OP_CallBuiltin1, "getfirstarraykey"); + emit_variable_ref(ctx, stmt->key_expr, true); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + + ctx->transfer(stmt->ctx_post); + + auto begin_loc = insert_label(); + + emit_variable(ctx, stmt->key_expr); + emit_opcode(ctx, opcode::OP_CallBuiltin1, "isdefined"); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + + can_break_ = true; + can_continue_ = true; + + emit_variable(stmt->ctx, stmt->key_expr); + emit_opcode(stmt->ctx, opcode::OP_EvalLocalArrayCached, variable_access_index(stmt->ctx, stmt->array.as_name)); + emit_variable_ref(stmt->ctx, stmt->value_expr, true); + emit_stmt(stmt->ctx, stmt->stmt, false); + + if(stmt->ctx->abort == abort_t::abort_none) + continue_ctxs_.push_back(stmt->ctx.get()); + + can_break_ = false; + can_continue_ = false; + + insert_label(continue_loc); + + stmt->ctx_post->init_from_child(continue_ctxs_); + + emit_variable(stmt->ctx_post, stmt->key_expr); + emit_variable(stmt->ctx_post, stmt->array); + emit_opcode(stmt->ctx_post, opcode::OP_CallBuiltin2, "getnextarraykey"); + emit_variable_ref(stmt->ctx_post, stmt->key_expr, true); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + emit_clear_local_variable(ctx, stmt->array.as_name); + if(!stmt->use_key) emit_clear_local_variable(ctx, stmt->key_expr.as_name); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_break = can_break_; + break_ctxs_.clear(); + can_break_ = false; + + auto jmptable_loc = create_label(); + auto break_loc = create_label(); + + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_switch, jmptable_loc); + + can_break_ = true; + + std::vector data; + data.push_back(utils::string::va("%d", stmt->stmt->stmts.size())); + + bool has_default = false; + gsc::context* default_ctx = nullptr; + + for(auto i = 0; i < stmt->stmt->stmts.size(); i++) + { + auto& entry = stmt->stmt->stmts[i]; + + if(entry.as_node->type == gsc::node_t::stmt_case) + { + auto& case_ = entry.as_case; + if(case_->value.as_node->type == gsc::node_t::data_integer) + { + auto loc = insert_label(); + data.push_back("case"); + data.push_back(case_->value.as_integer->value); + data.push_back(loc); + } + else if(case_->value.as_node->type == gsc::node_t::data_string) + { + auto loc = insert_label(); + data.push_back("case"); + data.push_back(case_->value.as_string->value); + data.push_back(loc); + } + else + { + throw gsc::comp_error(stmt->loc, "case type must be int or string"); + } + + ctx->transfer(case_->ctx); + case_->ctx->loc_break = break_loc; + emit_stmt_list(case_->ctx, case_->stmt, false); + if(case_->stmt->stmts.size() > 0) + emit_remove_local_vars(case_->ctx); + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + auto loc = insert_label(); + data.push_back("default"); + data.push_back(loc); + + has_default = true; + default_ctx = entry.as_default->ctx.get(); + + ctx->transfer(entry.as_default->ctx); + entry.as_default->ctx->loc_break = break_loc; + emit_stmt_list(entry.as_default->ctx, entry.as_default->stmt, false); + if(entry.as_default->stmt->stmts.size() > 0) + emit_remove_local_vars(entry.as_default->ctx); + } + else + { + throw gsc::comp_error(entry.as_node->loc, "missing case statement"); + } + } + + if(has_default) + { + if(default_ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(default_ctx); + } + ctx->init_from_child(break_ctxs_); + } + + insert_label(jmptable_loc); + + emit_opcode(ctx, opcode::OP_endswitch, data); + + auto offset = 7 * stmt->stmt->stmts.size(); + function_->instructions.back()->size += offset; + index_ += offset; + + insert_label(break_loc); + + can_break_ = old_break; + break_ctxs_ = old_breaks; +} + +void compiler::emit_stmt_case(const gsc::context_ptr& ctx, const gsc::stmt_case_ptr& stmt) +{ + throw gsc::comp_error(stmt->loc, "illegal case statement"); +} + +void compiler::emit_stmt_default(const gsc::context_ptr& ctx, const gsc::stmt_default_ptr& stmt) +{ + throw gsc::comp_error(stmt->loc, "illegal default statement"); +} + +void compiler::emit_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + if(can_break_ && ctx->abort == abort_t::abort_none && ctx->loc_break != "") + { + break_ctxs_.push_back(ctx.get()); + emit_remove_local_vars(ctx); + ctx->abort = abort_t::abort_break; + emit_opcode(ctx, opcode::OP_jump, ctx->loc_break); + } + else + { + throw gsc::comp_error(stmt->loc, "illegal break statement"); + } +} + +void compiler::emit_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt) +{ + if(can_break_ && ctx->abort == abort_t::abort_none && ctx->loc_continue != "") + { + continue_ctxs_.push_back(ctx.get()); + emit_remove_local_vars(ctx); + ctx->abort = abort_t::abort_continue; + emit_opcode(ctx, opcode::OP_jump, ctx->loc_continue); + } + else + { + throw gsc::comp_error(stmt->loc, "illegal continue statement"); + } +} + +void compiler::emit_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + ctx->abort = abort_t::abort_return; + } + + if(stmt->expr.as_node->type == gsc::node_t::null) + { + emit_opcode(ctx, opcode::OP_End); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_Return); + } +} + +void compiler::emit_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_and: emit_expr_and(ctx, expr.as_and); break; + case gsc::node_t::expr_or: emit_expr_or(ctx, expr.as_or); break; + case gsc::node_t::expr_equality: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_inequality: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less_equal: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater_equal: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_or: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_and: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_exor: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_left: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_right: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_add: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_sub: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mult: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_div: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mod: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_complement: emit_expr_complement(ctx, expr.as_complement); break; + case gsc::node_t::expr_not: emit_expr_not(ctx, expr.as_not); break; + case gsc::node_t::expr_call: emit_expr_call(ctx, expr.as_call); break; + case gsc::node_t::expr_function: emit_expr_function(ctx, expr.as_function); break; + case gsc::node_t::expr_add_array: emit_expr_add_array(ctx, expr.as_add_array); break; + case gsc::node_t::expr_array: emit_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: emit_field_variable(ctx, expr.as_field); break; + case gsc::node_t::expr_size: emit_expr_size(ctx, expr.as_size); break; + case gsc::node_t::data_thisthread: emit_opcode(ctx, opcode::OP_GetThisthread); break; + case gsc::node_t::data_empty_array: emit_opcode(ctx, opcode::OP_EmptyArray); break; + case gsc::node_t::data_undefined: emit_opcode(ctx, opcode::OP_GetUndefined); break; + case gsc::node_t::data_game: emit_opcode(ctx, opcode::OP_GetGame); break; + case gsc::node_t::data_self: emit_opcode(ctx, opcode::OP_GetSelf); break; + case gsc::node_t::data_anim: emit_opcode(ctx, opcode::OP_GetAnim); break; + case gsc::node_t::data_level: emit_opcode(ctx, opcode::OP_GetLevel); break; + case gsc::node_t::data_animation: emit_animation(ctx, expr.as_animation); break; + case gsc::node_t::data_animtree: emit_animtree(ctx, expr.as_animtree); break; + case gsc::node_t::data_name: emit_local_variable(ctx, expr.as_name); break; + case gsc::node_t::data_istring: emit_istring(ctx, expr.as_istring); break; + case gsc::node_t::data_string: emit_string(ctx, expr.as_string); break; + case gsc::node_t::data_vector: emit_vector(ctx, expr.as_vector); break; + case gsc::node_t::data_float: emit_float(ctx, expr.as_float); break; + case gsc::node_t::data_integer: emit_integer(ctx, expr.as_integer); break; + case gsc::node_t::data_false: emit_false(ctx, expr.as_false); break; + case gsc::node_t::data_true: emit_true(ctx, expr.as_true); break; + default: throw gsc::comp_error(expr.as_node->loc, "unknown expression"); break; + } +} + +void compiler::emit_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr) +{ + if(expr->type == gsc::node_t::expr_increment) + { + emit_variable_ref(ctx, expr->lvalue, false); + emit_opcode(ctx, opcode::OP_inc); + emit_opcode(ctx, opcode::OP_SetVariableField); + } + else if(expr->type == gsc::node_t::expr_decrement) + { + emit_variable_ref(ctx, expr->lvalue, false); + emit_opcode(ctx, opcode::OP_dec); + emit_opcode(ctx, opcode::OP_SetVariableField); + } + else if(expr->type == gsc::node_t::expr_assign_equal) + { + if(expr->rvalue.as_node->type == gsc::node_t::data_undefined) + { + emit_expr_clear_variable(ctx, expr->lvalue); + } + else + { + emit_expr(ctx, expr->rvalue); + emit_variable_ref(ctx, expr->lvalue, true); + } + } + else + { + emit_expr(ctx, expr->lvalue); + emit_expr(ctx, expr->rvalue); + + switch(expr->type) + { + case gsc::node_t::expr_assign_add: emit_opcode(ctx, opcode::OP_plus); break; + case gsc::node_t::expr_assign_sub: emit_opcode(ctx, opcode::OP_minus); break; + case gsc::node_t::expr_assign_mult: emit_opcode(ctx, opcode::OP_multiply); break; + case gsc::node_t::expr_assign_div: emit_opcode(ctx, opcode::OP_divide); break; + case gsc::node_t::expr_assign_mod: emit_opcode(ctx, opcode::OP_mod); break; + case gsc::node_t::expr_assign_shift_left: emit_opcode(ctx, opcode::OP_shift_left); break; + case gsc::node_t::expr_assign_shift_right: emit_opcode(ctx, opcode::OP_shift_right); break; + case gsc::node_t::expr_assign_bitwise_or: emit_opcode(ctx, opcode::OP_bit_or); break; + case gsc::node_t::expr_assign_bitwise_and: emit_opcode(ctx, opcode::OP_bit_and); break; + case gsc::node_t::expr_assign_bitwise_exor: emit_opcode(ctx, opcode::OP_bit_ex_or); break; + default: throw gsc::comp_error(expr->loc, "unknown assign operation"); break; + } + + emit_variable_ref(ctx, expr->lvalue, true); + } +} + +void compiler::emit_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr) +{ + emit_expr(ctx, expr->lvalue); + emit_expr(ctx, expr->rvalue); + + switch(expr->type) + { + case gsc::node_t::expr_equality: emit_opcode(ctx, opcode::OP_equality); break; + case gsc::node_t::expr_inequality: emit_opcode(ctx, opcode::OP_inequality); break; + case gsc::node_t::expr_less: emit_opcode(ctx, opcode::OP_less); break; + case gsc::node_t::expr_greater: emit_opcode(ctx, opcode::OP_greater); break; + case gsc::node_t::expr_less_equal: emit_opcode(ctx, opcode::OP_less_equal); break; + case gsc::node_t::expr_greater_equal: emit_opcode(ctx, opcode::OP_greater_equal); break; + case gsc::node_t::expr_bitwise_or: emit_opcode(ctx, opcode::OP_bit_or); break; + case gsc::node_t::expr_bitwise_and: emit_opcode(ctx, opcode::OP_bit_and); break; + case gsc::node_t::expr_bitwise_exor: emit_opcode(ctx, opcode::OP_bit_ex_or); break; + case gsc::node_t::expr_shift_left: emit_opcode(ctx, opcode::OP_shift_left); break; + case gsc::node_t::expr_shift_right: emit_opcode(ctx, opcode::OP_shift_right); break; + case gsc::node_t::expr_add: emit_opcode(ctx, opcode::OP_plus); break; + case gsc::node_t::expr_sub: emit_opcode(ctx, opcode::OP_minus); break; + case gsc::node_t::expr_mult: emit_opcode(ctx, opcode::OP_multiply); break; + case gsc::node_t::expr_div: emit_opcode(ctx, opcode::OP_divide); break; + case gsc::node_t::expr_mod: emit_opcode(ctx, opcode::OP_mod); break; + default: throw gsc::comp_error(expr->loc, "unknown binary expression"); break; + } +} + +void compiler::emit_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr) +{ + auto label = create_label(); + + emit_expr(ctx, expr->lvalue); + emit_opcode(ctx, opcode::OP_JumpOnFalseExpr, label); + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_CastBool); + + insert_label(label); +} + +void compiler::emit_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr) +{ + auto label = create_label(); + + emit_expr(ctx, expr->lvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrueExpr, label); + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_CastBool); + + insert_label(label); +} + +void compiler::emit_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr) +{ + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_BoolComplement); +} + +void compiler::emit_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr) +{ + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_BoolNot); +} + +void compiler::emit_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + if(expr->func.as_node->type == gsc::node_t::expr_call_pointer) + { + emit_expr_call_pointer(ctx, expr); + } + else + { + emit_expr_call_function(ctx, expr); + } +} + +void compiler::emit_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + bool thread = expr->thread; + bool child = expr->child; + bool method = expr->obj.as_node->type != gsc::node_t::null ? true : false; + bool builtin = builtin = expr->func.as_pointer->builtin; + std::uint32_t args = expr->func.as_pointer->args->list.size(); + + if(thread && child || thread && builtin || child && builtin) + throw gsc::comp_error(expr->loc, "function call have more than 1 type (thread, childthread, builtin)"); + + if(!thread && !child && !builtin) emit_opcode(ctx, opcode::OP_PreScriptCall); + + emit_expr_arguments(ctx, expr->func.as_pointer->args); + + if(method) emit_expr(ctx, expr->obj); + + emit_expr(ctx, expr->func.as_pointer->expr); + emit_expr_call_pointer_type(ctx, args, builtin, method, thread, child); +} + +void compiler::emit_expr_call_pointer_type(const gsc::context_ptr& ctx, int args, bool builtin, bool method, bool thread, bool child) +{ + if(builtin && !method) + { + emit_opcode(ctx, opcode::OP_CallBuiltinPointer, utils::string::va("%d", args)); + } + else if(builtin && method) + { + emit_opcode(ctx, opcode::OP_CallBuiltinMethodPointer, utils::string::va("%d", args)); + } + else if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptThreadCallPointer, utils::string::va("%d", args)); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptMethodThreadCallPointer, utils::string::va("%d", args)); + } + else if (child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptChildThreadCallPointer, utils::string::va("%d", args)); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptMethodChildThreadCallPointer, utils::string::va("%d", args)); + } + else + { + method ? emit_opcode(ctx, opcode::OP_ScriptMethodCallPointer) : emit_opcode(ctx, opcode::OP_ScriptFunctionCallPointer); + } +} + +void compiler::emit_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + bool thread = expr->thread; + bool child = expr->child; + bool method = expr->obj.as_node->type != gsc::node_t::null ? true : false; + std::uint32_t args = expr->func.as_func->args->list.size(); + auto name = expr->func.as_func->name->value; + auto file = expr->func.as_func->file->value; + + bool builtin = false, far = false, local = false; + + if(file != "") far = true; + else + { + if(is_local_call(name)) local = true; + else if(method && is_builtin_method(name)) builtin = true; + else if(!method && is_builtin_func(name)) builtin = true; + else + { + for(const auto& inc : includes_) + { + for(const auto& fun : inc.funcs) + { + if(name == fun) + { + far = true; + file = inc.name; + break; + } + } + } + + if(!builtin && !far && !local) + throw gsc::comp_error(expr->loc, "unknown function call " + name); + } + } + + if(thread && child || thread && builtin || child && builtin) + throw gsc::comp_error(expr->loc, "function call have more than 1 type (thread, childthread, builtin)"); + + if(!thread && !child && !builtin && !(!method && args == 0)) + emit_opcode(ctx, opcode::OP_PreScriptCall); + + emit_expr_arguments(ctx, expr->func.as_func->args); + + if(method) emit_expr(ctx, expr->obj); + + if(builtin) emit_expr_call_function_builtin(ctx, name, args, method); + else if(local) emit_expr_call_function_local(ctx, name, args, method, thread, child); + else if(far) emit_expr_call_function_far(ctx, file, name, args, method, thread, child); +} + +void compiler::emit_expr_call_function_builtin(const gsc::context_ptr& ctx, const std::string& func, int args, bool method) +{ + if(method) + { + switch(args) + { + case 0: emit_opcode(ctx, opcode::OP_CallBuiltinMethod0, func); break; + case 1: emit_opcode(ctx, opcode::OP_CallBuiltinMethod1, func); break; + case 2: emit_opcode(ctx, opcode::OP_CallBuiltinMethod2, func); break; + case 3: emit_opcode(ctx, opcode::OP_CallBuiltinMethod3, func); break; + case 4: emit_opcode(ctx, opcode::OP_CallBuiltinMethod4, func); break; + case 5: emit_opcode(ctx, opcode::OP_CallBuiltinMethod5, func); break; + default: emit_opcode(ctx, opcode::OP_CallBuiltinMethod, { utils::string::va("%d", args), func }); break; + } + } + else + { + switch(args) + { + case 0: emit_opcode(ctx, opcode::OP_CallBuiltin0, func); break; + case 1: emit_opcode(ctx, opcode::OP_CallBuiltin1, func); break; + case 2: emit_opcode(ctx, opcode::OP_CallBuiltin2, func); break; + case 3: emit_opcode(ctx, opcode::OP_CallBuiltin3, func); break; + case 4: emit_opcode(ctx, opcode::OP_CallBuiltin4, func); break; + case 5: emit_opcode(ctx, opcode::OP_CallBuiltin5, func); break; + default: emit_opcode(ctx, opcode::OP_CallBuiltin, { utils::string::va("%d", args), func }); break; + } + } +} + +void compiler::emit_expr_call_function_local(const gsc::context_ptr& ctx, const std::string& func, int args, bool method, bool thread, bool child) +{ + if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalThreadCall, { func, utils::string::va("%d", args) }); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodThreadCall, { func, utils::string::va("%d", args) }); + } + else if(child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptLocalChildThreadCall, { func, utils::string::va("%d", args) }); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodChildThreadCall, { func, utils::string::va("%d", args) }); + } + else if(method && !thread && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodCall, func); + } + else if(!thread && !child && !method && args == 0) + { + emit_opcode(ctx, opcode::OP_ScriptLocalFunctionCall2, func); + } + else if(!thread && !child && !method && args != 0) + { + emit_opcode(ctx, opcode::OP_ScriptLocalFunctionCall, func); + } +} + +void compiler::emit_expr_call_function_far(const gsc::context_ptr& ctx, const std::string& file, const std::string& func, int args, bool method, bool thread, bool child) +{ + if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptFarThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptFarChildThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodChildThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(!thread && !child && method) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodCall, { file, func }); + } + else if(!thread && !child && !method && args == 0) + { + emit_opcode(ctx, opcode::OP_ScriptFarFunctionCall2, { file, func }); + } + else if(!thread && !child && !method && args != 0) + { + emit_opcode(ctx, opcode::OP_ScriptFarFunctionCall, { file, func }); + } +} + +void compiler::emit_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& args) +{ + std::reverse(args->list.begin(), args->list.end()); + + for(auto& arg : args->list) + { + emit_expr(ctx, arg); + } +} + +void compiler::emit_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& expr) +{ + bool far = false, local = false, builtin = false, method = false; + auto name = expr->name->value; + auto file = expr->file->value; + + if(file != "") + { + far = true; + } + else if(is_builtin_method(name)) + { + builtin = true; + method = true; + } + else if(is_builtin_func(name)) + { + builtin = true; + } + else if(is_local_call(name)) + { + local = true; + } + + if(local) + { + emit_opcode(ctx, opcode::OP_GetLocalFunction, name); + } + else if(far) + { + emit_opcode(ctx, opcode::OP_GetFarFunction, { file, name } ); + } + else if(builtin && method) + { + emit_opcode(ctx, opcode::OP_GetBuiltinMethod, name); + } + else if(builtin && !method) + { + emit_opcode(ctx, opcode::OP_GetBuiltinFunction, name); + } +} + +void compiler::emit_expr_clear_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& lvalue) +{ + switch(lvalue.as_node->type) + { + case gsc::node_t::expr_array: + emit_expr(ctx, lvalue.as_array->key); + lvalue.as_array->obj.as_node->type == gsc::node_t::data_game ? emit_opcode(ctx, opcode::OP_GetGameRef) : emit_variable_ref(ctx, lvalue.as_array->obj, false); + emit_opcode(ctx, opcode::OP_ClearArray); + break; + case gsc::node_t::expr_field: + emit_object(ctx, lvalue.as_field->obj); + emit_opcode(ctx, opcode::OP_ClearFieldVariable,lvalue.as_field->field->value); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_GetUndefined); + emit_local_variable_ref(ctx, lvalue.as_name, true); + break; + default: + throw gsc::comp_error(lvalue.as_node->loc, "unknown clear variable lvalue"); + break; + } +} + +void compiler::emit_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr) +{ + if(expr->args->list.size() <= 0) + { + throw gsc::comp_error(expr->loc, "invalid empty add array. did u mean '[]' ?"); + } + + emit_opcode(ctx, opcode::OP_EmptyArray); + + for(const auto& arg : expr->args->list) + { + emit_expr(ctx, arg); + emit_opcode(ctx, opcode::OP_AddArray); + } +} + +void compiler::emit_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr) +{ + emit_variable(ctx, expr->obj); + emit_opcode(ctx, opcode::OP_size); +} + +void compiler::emit_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr, bool set) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_array: emit_array_variable_ref(ctx, expr.as_array, set); break; + case gsc::node_t::expr_field: emit_field_variable_ref(ctx, expr.as_field, set); break; + case gsc::node_t::data_name: emit_local_variable_ref(ctx, expr.as_name, set); break; + default: throw gsc::comp_error(expr.as_node->loc, "invalid variable reference type."); break; + } +} + +void compiler::emit_array_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr, bool set) +{ + emit_expr(ctx, expr->key); + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_game: + emit_opcode(ctx, opcode::OP_GetGameRef); + emit_opcode(ctx, opcode::OP_EvalArrayRef); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_array: + case gsc::node_t::expr_field: + emit_variable_ref(ctx, expr->obj, false); + emit_opcode(ctx, opcode::OP_EvalArrayRef); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::data_name: + { + if(!variable_initialized(ctx, expr->obj.as_name)) + { + initialize_variable(ctx, expr->obj.as_name); + emit_opcode(ctx, opcode::OP_EvalNewLocalArrayRefCached0, variable_create_index(ctx, expr->obj.as_name)); + + if(!set) + { + throw gsc::comp_error(expr->loc, "INTERNAL: VAR CREATED BUT NOT SET!"); + } + } + else if(variable_stack_index(ctx, expr->obj.as_name) == 0) + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayRefCached0); + } + else + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayRefCached, variable_access_index(ctx, expr->obj.as_name)); + } + + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + } + break; + case gsc::node_t::expr_call: + throw gsc::comp_error(expr->loc, "call result can't be referenced."); + break; + default: + throw gsc::comp_error(expr->loc, "unknown array object type"); + break; + } +} + +void compiler::emit_field_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr, bool set) +{ + const auto& field = expr->field->value; + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_level: + set ? emit_opcode(ctx, opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalLevelFieldVariableRef, field); + break; + case gsc::node_t::data_anim: + set ? emit_opcode(ctx, opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalAnimFieldVariableRef, field); + break; + case gsc::node_t::data_self: + set ? emit_opcode(ctx, opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalSelfFieldVariableRef, field); + break; + case gsc::node_t::expr_array: + emit_array_variable(ctx, expr->obj.as_array); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_field: + emit_field_variable(ctx, expr->obj.as_field); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr->obj.as_name)); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_call: + throw gsc::comp_error(expr->loc, "function call result can't be referenced"); + break; + default: + throw gsc::comp_error(expr->loc, "unknown field variable object type"); + break; + } +} + +void compiler::emit_local_variable_ref(const gsc::context_ptr& ctx, const gsc::name_ptr& expr, bool set) +{ + const auto itr = constants_.find(expr->value); + + if (itr != constants_.end()) + { + throw gsc::comp_error(expr->loc, "variable name already defined as constant " + expr->value); + } + + if(set) + { + if(!variable_initialized(ctx, expr)) + { + initialize_variable(ctx, expr); + emit_opcode(ctx, opcode::OP_SetNewLocalVariableFieldCached0, variable_create_index(ctx, expr)); + } + else if(variable_stack_index(ctx, expr) == 0) + { + emit_opcode(ctx, opcode::OP_SetLocalVariableFieldCached0); + } + else + { + emit_opcode(ctx, opcode::OP_SetLocalVariableFieldCached, variable_access_index(ctx, expr)); + } + } + else + { + auto index = variable_stack_index(ctx, expr); + + if(index == 0) + emit_opcode(ctx, opcode::OP_EvalLocalVariableRefCached0); + else + emit_opcode(ctx, opcode::OP_EvalLocalVariableRefCached, variable_access_index(ctx, expr)); + } +} + +void compiler::emit_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + // for obj.size + switch(expr.as_node->type) + { + case gsc::node_t::expr_array: emit_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: emit_field_variable(ctx, expr.as_field); break; + case gsc::node_t::data_name: emit_local_variable(ctx, expr.as_name); break; + case gsc::node_t::expr_call: emit_expr_call(ctx, expr.as_call); break; + default: throw gsc::comp_error(expr.as_node->loc, "invalid variable type."); break; + } +} + +void compiler::emit_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr) +{ + emit_expr(ctx, expr->key); + + if(expr->obj.as_node->type == gsc::node_t::data_name) + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayCached, variable_access_index(ctx, expr->obj.as_name)); + } + else + { + emit_expr(ctx, expr->obj); + emit_opcode(ctx, opcode::OP_EvalArray); + } +} + +void compiler::emit_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr) +{ + const auto& field = expr->field->value; + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_level: + emit_opcode(ctx, opcode::OP_EvalLevelFieldVariable, field); + break; + case gsc::node_t::data_anim: + emit_opcode(ctx, opcode::OP_EvalAnimFieldVariable, field); + break; + case gsc::node_t::data_self: + emit_opcode(ctx, opcode::OP_EvalSelfFieldVariable, field); + break; + case gsc::node_t::expr_array: + emit_array_variable(ctx, expr->obj.as_array); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::expr_field: + emit_field_variable(ctx, expr->obj.as_field); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::expr_call: + emit_expr_call(ctx, expr->obj.as_call); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr->obj.as_name)); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + default: + throw gsc::comp_error(expr->loc, "unknown field variable object type"); + break; + } +} + +void compiler::emit_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + // is constant ( should only allow: string, loc string, number, vector) + const auto itr = constants_.find(expr->value); + + if (itr != constants_.end()) + { + const auto& value = itr->second; + emit_expr(ctx, value); + return; + } + + // is local var + auto index = variable_stack_index(ctx, expr); + + switch(index) + { + case 0: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached0); break; + case 1: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached1); break; + case 2: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached2); break; + case 3: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached3); break; + case 4: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached4); break; + case 5: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached5); break; + default: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached, variable_access_index(ctx, expr)); break; + } +} + +void compiler::emit_clear_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + auto index = variable_stack_index(ctx, expr); + + if(index == 0) + { + emit_opcode(ctx, opcode::OP_ClearLocalVariableFieldCached0); + } + else + { + emit_opcode(ctx, opcode::OP_ClearLocalVariableFieldCached, variable_access_index(ctx, expr)); + } +} + +void compiler::emit_create_local_vars(const gsc::context_ptr& ctx) +{ + if ( ctx->local_vars_create_count != ctx->local_vars_public_count ) + { + for(auto i = ctx->local_vars_create_count; i < ctx->local_vars_public_count; i++) + { + auto data = utils::string::va("%d", ctx->local_vars.at(i).create); + emit_opcode(ctx, opcode::OP_CreateLocalVariable, data); + ctx->local_vars.at(i).init = true; + } + ctx->local_vars_create_count = ctx->local_vars_public_count; + } +} + +void compiler::emit_remove_local_vars(const gsc::context_ptr& ctx) +{ + if(ctx->abort == abort_t::abort_none) + { + auto count = ctx->local_vars_create_count - ctx->local_vars_public_count; + + if(count > 0) + { + auto data = utils::string::va("%d", count); + emit_opcode(ctx, opcode::OP_RemoveLocalVariables, data); + } + } +} + +void compiler::emit_object(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + // need revision used for clear variable + switch(expr.as_node->type) + { + case gsc::node_t::data_level: + emit_opcode(ctx, opcode::OP_GetLevelObject); + break; + case gsc::node_t::data_anim: + emit_opcode(ctx, opcode::OP_GetAnimObject); + break; + case gsc::node_t::data_self: + emit_opcode(ctx, opcode::OP_GetSelfObject); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr.as_name)); + break; + case gsc::node_t::expr_call: + emit_expr_call(ctx, expr.as_call); + emit_opcode(ctx, opcode::OP_CastFieldObject); + break; + // array ? + // field ? + default: + throw gsc::comp_error(expr.as_node->loc, "unknown object type"); + break; + } +} + +void compiler::emit_animtree(const gsc::context_ptr& ctx, const gsc::animtree_ptr& animtree) +{ + if(animtrees_.size() == 0) + { + throw gsc::comp_error( animtree->loc, "trying to use animtree without specified using animtree"); + } + + auto& tree = animtrees_.back(); + + if(tree.loaded) + { + emit_opcode(ctx, opcode::OP_GetAnimTree, "''"); + } + else + { + emit_opcode(ctx, opcode::OP_GetAnimTree, tree.name); + tree.loaded = true; + } +} + +void compiler::emit_animation(const gsc::context_ptr& ctx, const gsc::animation_ptr& animation) +{ + if(animtrees_.size() == 0) + { + throw gsc::comp_error(animation->loc, "trying to use animation without specified using animtree"); + } + + auto& tree = animtrees_.back(); + + if(tree.loaded) + { + emit_opcode(ctx, opcode::OP_GetAnimation, { "''", animation->value }); + } + else + { + emit_opcode(ctx, opcode::OP_GetAnimation, { tree.name, animation->value }); + tree.loaded = true; + } +} + +void compiler::emit_istring(const gsc::context_ptr& ctx, const gsc::istring_ptr& str) +{ + emit_opcode(ctx, opcode::OP_GetIString, str->value); +} + +void compiler::emit_string(const gsc::context_ptr& ctx, const gsc::string_ptr& str) +{ + emit_opcode(ctx, opcode::OP_GetString, str->value); +} + +void compiler::emit_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec) +{ + std::vector data; + + bool expr = false; + + if(vec->x.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->x.as_integer->value); + else if(vec->x.as_node->type == gsc::node_t::data_float) + data.push_back(vec->x.as_float->value); + else expr = true; + + if(vec->y.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->y.as_integer->value); + else if(vec->y.as_node->type == gsc::node_t::data_float) + data.push_back(vec->y.as_float->value); + else expr = true; + + if(vec->z.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->z.as_integer->value); + else if(vec->z.as_node->type == gsc::node_t::data_float) + data.push_back(vec->z.as_float->value); + else expr = true; + + if(!expr) + { + emit_opcode(ctx, opcode::OP_GetVector, data); + } + else + { + emit_expr(ctx, vec->z); + emit_expr(ctx, vec->y); + emit_expr(ctx, vec->x); + emit_opcode(ctx, opcode::OP_vector); + } +} + +void compiler::emit_float(const gsc::context_ptr& ctx, const gsc::float_ptr& num) +{ + emit_opcode(ctx, opcode::OP_GetFloat, num->value); +} + +void compiler::emit_integer(const gsc::context_ptr& ctx, const gsc::integer_ptr& num) +{ + auto value = std::atoi(num->value.data()); + + if(value == 0) + { + emit_opcode(ctx, opcode::OP_GetZero); + } + else if(value > 0 && value < 256) + { + emit_opcode(ctx, opcode::OP_GetByte, num->value); + } + else if(value < 0 && value > -256) + { + emit_opcode(ctx, opcode::OP_GetNegByte, num->value.substr(1)); + } + else if(value < 65536) + { + emit_opcode(ctx, opcode::OP_GetUnsignedShort, num->value); + } + else if(value < 0 && value > -65536) + { + emit_opcode(ctx, opcode::OP_GetNegUnsignedShort, num->value.substr(1)); + } + else + { + emit_opcode(ctx, opcode::OP_GetInteger, num->value); + } +} + +void compiler::emit_false(const gsc::context_ptr& ctx, const gsc::false_ptr& expr) +{ + emit_opcode(ctx, opcode::OP_GetZero); +} + +void compiler::emit_true(const gsc::context_ptr& ctx, const gsc::true_ptr& expr) +{ + emit_opcode(ctx, opcode::OP_GetByte, "1"); +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + + index_ += inst->size; +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::string& data) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + inst->data.push_back(data); + + index_ += inst->size; +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::vector& data) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + inst->data = data; + + index_ += inst->size; +} + +void compiler::process_thread(const gsc::context_ptr& ctx, const gsc::thread_ptr& thread) +{ + process_parameters(ctx, thread->params); + process_stmt_list(ctx, thread->block); +} + +void compiler::process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + register_variable(ctx, param->value); + } +} + +void compiler::process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt) +{ + switch (stmt.as_node->type) + { + case gsc::node_t::stmt_list: process_stmt_list(ctx, stmt.as_list); break; + case gsc::node_t::stmt_assign: process_expr(ctx, stmt.as_assign->expr->lvalue); break; + case gsc::node_t::stmt_waittill: process_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_if: process_stmt_if(ctx, stmt.as_if); break; + case gsc::node_t::stmt_ifelse: process_stmt_ifelse(ctx, stmt.as_ifelse); break; + case gsc::node_t::stmt_while: process_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: process_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: process_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: process_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_break: process_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_continue: process_stmt_continue(ctx, stmt.as_continue); break; + case gsc::node_t::stmt_return: process_stmt_return(ctx, stmt.as_return); break; + default: break; + } +} + +void compiler::process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + for (const auto& entry : stmt->stmts) + { + process_stmt(ctx, entry); + } +} + +void compiler::process_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + if(expr.as_node->type == gsc::node_t::data_name) + { + register_variable(ctx, expr.as_name->value); + } + else if(expr.as_node->type == gsc::node_t::expr_array) + { + process_expr(ctx, expr.as_array->obj); + } +} + +void compiler::process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + register_variable(ctx, arg.as_name->value); + } + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); +} + +void compiler::process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt) +{ + stmt->ctx = std::make_unique(); + + ctx->copy(stmt->ctx); + process_stmt(stmt->ctx, stmt->stmt); + + std::vector childs({ stmt->ctx.get() }); + ctx->merge(childs); +} + +void compiler::process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt) +{ + std::vector childs; + auto abort = abort_t::abort_return; + + stmt->ctx_if = std::make_unique(); + stmt->ctx_else = std::make_unique(); + + ctx->copy(stmt->ctx_if); + process_stmt(stmt->ctx_if, stmt->stmt_if); + + if(stmt->ctx_if->abort <= abort_t::abort_return) + { + abort = stmt->ctx_if->abort; + if(abort == abort_t::abort_none) + childs.push_back(stmt->ctx_if.get()); + } + + ctx->copy(stmt->ctx_else); + process_stmt(stmt->ctx_else, stmt->stmt_else); + + if(stmt->ctx_else->abort <= abort) + { + abort = stmt->ctx_else->abort; + if(abort == abort_t::abort_none) + childs.push_back(stmt->ctx_else.get()); + } + + if(ctx->abort == abort_t::abort_none) + ctx->abort = abort; + + ctx->append(childs); + ctx->merge(childs); +} + +void compiler::process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + bool const_cond = is_constant_condition(stmt->expr); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + stmt->ctx = std::make_unique(); + + ctx->copy(stmt->ctx); + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + if(const_cond) ctx->append(break_ctxs_); + + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + bool const_cond = is_constant_condition(stmt->expr); + + stmt->ctx = std::make_unique(); + stmt->ctx_post = std::make_unique(); + + process_stmt(ctx, stmt->pre_expr); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + ctx->copy(stmt->ctx); + ctx->copy(stmt->ctx_post); + + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + process_stmt(stmt->ctx_post, stmt->post_expr); + + ctx->append({ stmt->ctx_post.get() }); + ctx->merge({ stmt->ctx_post.get() }); + + if(const_cond) ctx->append(break_ctxs_); + + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + auto array_name = utils::string::va("temp_%d", ++label_idx_); + auto key_name = utils::string::va("temp_%d", ++label_idx_); + + stmt->array = expr_ptr(std::make_unique(stmt->loc, array_name)); + + if(!stmt->use_key) + stmt->key_expr = expr_ptr(std::make_unique(stmt->loc, key_name)); + + key_name = stmt->key_expr.as_name->value; + + // calculate variables + + stmt->ctx = std::make_unique(); + stmt->ctx_post = std::make_unique(); + + // calculate pre_expr variables + process_expr(ctx, stmt->array); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + ctx->copy(stmt->ctx); + ctx->copy(stmt->ctx_post); + + // calculate stmt variables & add missing array access as first stmt + process_expr(stmt->ctx, stmt->value_expr); + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + process_expr(stmt->ctx_post, stmt->key_expr); + + ctx->append({ stmt->ctx_post.get() }); + ctx->merge({ stmt->ctx_post.get() }); + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + auto stmt_list = std::make_unique(stmt->stmt->loc); + auto current_case = gsc::stmt_ptr(std::make_unique()); + + auto num = stmt->stmt->stmts.size(); + + for(auto i = 0; i < num; i++) + { + auto& entry = stmt->stmt->stmts[0]; + + if(entry.as_node->type == gsc::node_t::stmt_case || entry.as_node->type == gsc::node_t::stmt_default) + { + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + current_case = std::move(stmt->stmt->stmts[0]); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + else + { + if(current_case.as_node->type != gsc::node_t::null) + { + if(current_case.as_node->type == gsc::node_t::stmt_case) + { + current_case.as_case->stmt->stmts.push_back(std::move(entry)); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + else + { + current_case.as_default->stmt->stmts.push_back(std::move(entry)); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + } + else + { + gsc::comp_error(entry.as_node->loc, "missing case statement"); + } + } + } + + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + // calculate variables + stmt->ctx = std::make_unique(); + std::vector childs; + auto abort = abort_t::abort_return; + bool has_default = false; + gsc::context* default_ctx = nullptr; + auto old_breaks = break_ctxs_; + break_ctxs_.clear(); + + for(auto i = 0; i < stmt_list->stmts.size(); i++) + { + auto& entry = stmt_list->stmts[i]; + + if(entry.as_node->type == gsc::node_t::stmt_case) + { + entry.as_case->ctx = std::make_unique(); + ctx->copy(entry.as_case->ctx); + process_stmt_list(entry.as_case->ctx, entry.as_case->stmt); + + if (entry.as_case->ctx->abort != abort_t::abort_none) + { + if (entry.as_case->ctx->abort == abort_t::abort_break ) + { + entry.as_case->ctx->abort = abort_t::abort_none; + abort = abort_t::abort_none; + childs.push_back(entry.as_case->ctx.get()); + } + else if (entry.as_case->ctx->abort <= abort ) + { + abort = entry.as_case->ctx->abort; + } + } + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + entry.as_default->ctx = std::make_unique(); + ctx->copy(entry.as_default->ctx); + process_stmt_list(entry.as_default->ctx, entry.as_default->stmt); + has_default = true; + default_ctx = entry.as_default->ctx.get(); + + if (entry.as_default->ctx->abort != abort_t::abort_none) + { + if (entry.as_default->ctx->abort == abort_t::abort_break ) + { + entry.as_default->ctx->abort = abort_t::abort_none; + abort = abort_t::abort_none; + childs.push_back(entry.as_default->ctx.get()); + } + else if (entry.as_default->ctx->abort <= abort ) + { + abort = entry.as_default->ctx->abort; + } + } + } + } + + stmt->stmt =std::move(stmt_list); + + if(has_default) + { + if(default_ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(default_ctx); + + if(ctx->abort == abort_t::abort_none) + ctx->abort = abort; + } + + ctx->append(break_ctxs_); + ctx->merge(childs); + } + + break_ctxs_ = old_breaks; +} + +void compiler::process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(ctx.get()); + ctx->abort = abort_t::abort_break; + } +} + +void compiler::process_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + continue_ctxs_.push_back(ctx.get()); + ctx->abort = abort_t::abort_continue; + } +} + +void compiler::process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + ctx->abort = abort_t::abort_return; + } +} + +void compiler::register_variable(const gsc::context_ptr& ctx, const std::string& name) +{ + auto it = std::find_if(ctx->local_vars.begin(), ctx->local_vars.end(), + [&](const gsc::local_var& v) { return v.name == name; }); + + if(it == ctx->local_vars.end()) + { + auto found = false; + for(std::size_t i = 0; i < local_stack_.size(); i++) + { + if(local_stack_[i] == name) + { + ctx->local_vars.push_back({ name, static_cast(i), false }); + found = true; + break; + } + } + + if(!found) + { + ctx->local_vars.push_back({ name, stack_idx_, false }); + local_stack_.push_back(name); + stack_idx_++; + } + } +} + +void compiler::initialize_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name) +{ + for(std::uint32_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(!ctx->local_vars[i].init) + { + for(std::uint32_t j = 0; j < i; j++) + { + if(!ctx->local_vars[j].init) + { + emit_opcode(ctx, opcode::OP_CreateLocalVariable, utils::string::va("%d", ctx->local_vars[j].create)); + ctx->local_vars[j].init = true; + //ctx->local_vars_create_count++; + } + } + ctx->local_vars[i].init = true; + ctx->local_vars_create_count = i + 1; + return; + } + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +void compiler::create_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name) +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + auto& var = ctx->local_vars.at(i); + if(var.name == name->value) + { + if(!var.init) + { + emit_opcode(ctx, opcode::OP_CreateLocalVariable, utils::string::va("%d", var.create)); + var.init = true; + ctx->local_vars_create_count++; + } + return; + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_stack_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::uint8_t +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(ctx->local_vars.at(i).init) + { + return ctx->local_vars_create_count - 1 - i; + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not initialized."); + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_create_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + return utils::string::va("%d", ctx->local_vars[i].create); + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_access_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(ctx->local_vars.at(i).init) + { + return utils::string::va("%d", ctx->local_vars_create_count - 1 - i); + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not initialized."); + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_initialized(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> bool +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + return ctx->local_vars.at(i).init; + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::is_local_call(const std::string& name) -> bool +{ + for(const auto& f : local_functions_) + { + if(f == name) return true; + } + + return false; +} + +auto compiler::is_builtin_call(const std::string& name) -> bool +{ + if(is_builtin_func(name)) return true; + + if(is_builtin_method(name)) return true; + + return false; +} + +auto compiler::is_builtin_func(const std::string& name) -> bool +{ + return resolver::find_function(name); +} +auto compiler::is_builtin_method(const std::string& name) -> bool +{ + return resolver::find_method(name); +} + +auto compiler::is_constant_condition(const gsc::expr_ptr& expr) -> bool +{ + switch(expr.as_node->type) + { + case gsc::node_t::null: + case gsc::node_t::data_true: + return true; + case gsc::node_t::data_false: + throw gsc::comp_error(expr.as_node->loc, "condition can't be always false!"); + case gsc::node_t::data_integer: + { + auto num = std::stoi(expr.as_integer->value); + if(num != 0) + return true; + else + throw gsc::comp_error(expr.as_node->loc, "condition can't be always false!"); + } + default: + break; + } + + return false; +} + +auto compiler::create_label() -> std::string +{ + label_idx_++; + auto name = utils::string::va("loc_%d", label_idx_); + return name; +} + +auto compiler::insert_label() -> std::string +{ + const auto itr = function_->labels.find(index_); + + if (itr != function_->labels.end()) + { + return itr->second; + } + else + { + label_idx_++; + auto name = utils::string::va("loc_%d", label_idx_); + function_->labels.insert({index_, name}); + return name; + } +} + +void compiler::insert_label(const std::string& name) +{ + const auto itr = function_->labels.find(index_); + + if (itr != function_->labels.end()) + { + for(auto& inst : function_->instructions) + { + switch (opcode(inst->opcode)) + { + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_jump: + case opcode::OP_jumpback: + case opcode::OP_switch: + if(inst->data[0] == name) + inst->data[0] = itr->second; + break; + case opcode::OP_endswitch: + default: + break; + } + } + } + else + { + function_->labels.insert({index_, name}); + } +} + +auto compiler::map_known_includes(const std::string& include) -> bool +{ + return false; +} + +} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/compiler.hpp b/src/s1/xsk/compiler.hpp new file mode 100644 index 00000000..d173ca79 --- /dev/null +++ b/src/s1/xsk/compiler.hpp @@ -0,0 +1,146 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::s1 +{ + +enum class opcode : std::uint8_t; + +class compiler : public gsc::compiler +{ + std::string filename_; + std::vector assembly_; + gsc::function_ptr function_; + std::uint32_t index_; + std::uint32_t label_idx_; + std::uint8_t stack_idx_; + std::vector local_stack_; + std::vector local_functions_; + std::vector includes_; + std::vector animtrees_; + std::unordered_map constants_; + std::function(const std::string&)> callback_readf_; + std::vector break_ctxs_; + std::vector continue_ctxs_; + bool can_break_; + bool can_continue_; + +public: + auto output() -> std::vector; + void compile(const std::string& file, std::vector& data); + void set_readf_callback(std::function(const std::string&)> func); + +private: + auto parse_buffer(const std::string& file, std::vector& data) -> gsc::program_ptr; + auto parse_file(const std::string& file) -> gsc::program_ptr; + void compile_program(const gsc::program_ptr& program); + void emit_include(const gsc::include_ptr& include); + void emit_define(const gsc::define_ptr& define); + void emit_usingtree(const gsc::usingtree_ptr& animtree); + void emit_constant(const gsc::constant_ptr& constant); + void emit_thread(const gsc::thread_ptr& thread); + void emit_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void emit_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt, bool last); + void emit_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt, bool last); + void emit_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt); + void emit_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt); + void emit_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt); + void emit_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt); + void emit_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt); + void emit_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void emit_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt); + void emit_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt); + void emit_stmt_waitframe(const gsc::context_ptr& ctx, const gsc::stmt_waitframe_ptr& stmt); + void emit_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt, bool last); + void emit_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt, bool last); + void emit_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void emit_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void emit_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void emit_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void emit_stmt_case(const gsc::context_ptr& ctx, const gsc::stmt_case_ptr& stmt); + void emit_stmt_default(const gsc::context_ptr& ctx, const gsc::stmt_default_ptr& stmt); + void emit_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void emit_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt); + void emit_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void emit_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr); + void emit_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr); + void emit_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr); + void emit_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr); + void emit_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr); + void emit_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr); + void emit_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_pointer_type(const gsc::context_ptr& ctx, int args, bool builtin, bool method, bool thread, bool child); + void emit_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_function_builtin(const gsc::context_ptr& ctx, const std::string& func, int args, bool method); + void emit_expr_call_function_local(const gsc::context_ptr& ctx, const std::string& func, int args, bool method, bool thread, bool child); + void emit_expr_call_function_far(const gsc::context_ptr& ctx, const std::string& file, const std::string& func, int args, bool method, bool thread, bool child); + void emit_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& arg_list); + void emit_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& node); + void emit_expr_clear_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& lvalue); + void emit_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr); + void emit_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr); + void emit_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr, bool set); + void emit_array_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr, bool set); + void emit_field_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr, bool set); + void emit_local_variable_ref(const gsc::context_ptr& ctx, const gsc::name_ptr& expr, bool set); + void emit_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr); + void emit_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr); + void emit_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void emit_clear_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void emit_create_local_vars(const gsc::context_ptr& ctx); + void emit_remove_local_vars(const gsc::context_ptr& ctx); + void emit_object(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_animtree(const gsc::context_ptr& ctx, const gsc::animtree_ptr& animtree); + void emit_animation(const gsc::context_ptr& ctx, const gsc::animation_ptr& animation); + void emit_istring(const gsc::context_ptr& ctx, const gsc::istring_ptr& str); + void emit_string(const gsc::context_ptr& ctx, const gsc::string_ptr& str); + void emit_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec); + void emit_float(const gsc::context_ptr& ctx, const gsc::float_ptr& num); + void emit_integer(const gsc::context_ptr& ctx, const gsc::integer_ptr& num); + void emit_false(const gsc::context_ptr& ctx, const gsc::false_ptr& expr); + void emit_true(const gsc::context_ptr& ctx, const gsc::true_ptr& expr); + void emit_opcode(const gsc::context_ptr& ctx, opcode op); + void emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::string& data); + void emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::vector& data); + void process_thread(const gsc::context_ptr& ctx, const gsc::thread_ptr& thread); + void process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt); + void process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt); + void process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt); + void process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void process_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt); + void process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void register_variable(const gsc::context_ptr& ctx, const std::string& name); + void initialize_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name); + void create_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name); + auto variable_stack_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::uint8_t; + auto variable_create_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string; + auto variable_access_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string; + auto variable_initialized(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> bool; + auto is_local_call(const std::string& name) -> bool; + auto is_builtin_call(const std::string& name) -> bool; + auto is_builtin_func(const std::string& name) -> bool; + auto is_builtin_method(const std::string& name) -> bool; + auto is_constant_condition(const gsc::expr_ptr& expr) -> bool; + auto create_label() -> std::string; + auto insert_label() -> std::string; + void insert_label(const std::string& label); + + auto map_known_includes(const std::string& include) -> bool; +}; + +} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/decompiler.cpp b/src/s1/xsk/decompiler.cpp new file mode 100644 index 00000000..4f6e40df --- /dev/null +++ b/src/s1/xsk/decompiler.cpp @@ -0,0 +1,3160 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "s1.hpp" + +namespace xsk::gsc::s1 +{ + +auto decompiler::output() -> std::vector +{ + std::vector output; + + auto data = std::make_unique(0x100000); + data->write_string("// S1 PC GSC\n// Decompiled by https://github.com/xensik/gsc-tool\n"); + data->write_string(program_->print()); + + output.resize(data->pos()); + std::memcpy(output.data(), data->buffer().data(), output.size()); + + return output; +} + +void decompiler::decompile(const std::string& file, std::vector& functions) +{ + filename_ = file; + program_ = std::make_unique(); + + for (auto& func : functions) + { + auto name = std::make_unique(func->name.substr(4)); + auto params = std::make_unique(); + auto block = std::make_unique(); + func_ = std::make_unique(std::move(name),std::move(params),std::move(block)); + + labels_ = func->labels; + expr_labels_.clear(); + stack_ = std::stack(); + + this->decompile_function(func); + + this->process_stack(func_); + + program_->definitions.push_back(gsc::define_ptr(std::move(func_))); + } +} + +void decompiler::decompile_function(const gsc::function_ptr& func) +{ + this->decompile_statements(func); + + if(stack_.size() > 0) + { + throw gsc::decomp_error("stack not emty at function end"); + } + + auto& block = func_->block; + + gsc::context ctx; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.back().as_node->loc.begin.line); + + // remove last return + block->stmts.pop_back(); + + // hotfix empty else block at func end + if(block->stmts.size() > 0 && block->stmts.back().as_node->type == gsc::node_t::asm_jump) + { + if(block->stmts.back().as_jump->value == ctx.loc_end) + block->stmts.pop_back(); + } + + blocks_.push_back(ctx); + this->decompile_block(block); + blocks_.pop_back(); +} + +void decompiler::decompile_statements(const gsc::function_ptr& func) +{ + std::uint32_t last_null_loc = 0; + + for (auto& inst : func->instructions) + { + auto loc = gsc::location(&filename_, inst->index); + + const auto itr = func->labels.find(inst->index); + + if (itr != func->labels.end()) + { + for(auto& entry : expr_labels_) + { + if(entry == itr->second) + { + decompile_expr(); + } + } + } + + switch (opcode(inst->opcode)) + { + case opcode::OP_End: + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::make_unique())); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_Return: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + auto stmt = gsc::stmt_ptr(std::make_unique(expr->loc, std::move(expr))); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_GetZero: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetByte: + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetInteger: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetNegByte: + case opcode::OP_GetNegUnsignedShort: + { + auto node = std::make_unique(loc, "-" + inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetFloat: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetVector: + { + auto x = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto y = gsc::expr_ptr(std::make_unique(loc, inst->data[1])); + auto z = gsc::expr_ptr(std::make_unique(loc, inst->data[2])); + auto node = std::make_unique(loc, std::move(x), std::move(y), std::move(z)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetString: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetIString: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetUndefined: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EmptyArray: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetLevel: + case opcode::OP_GetLevelObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnim: + case opcode::OP_GetAnimObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetSelf: + case opcode::OP_GetSelfObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetGame: + case opcode::OP_GetGameRef: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnimation: + { + auto tree = utils::string::unquote(inst->data[0]); + + if(tree != "") + { + auto treename = std::make_unique(loc, inst->data[0]); + auto animtree = std::make_unique(loc, std::move(treename)); + program_->definitions.push_back(gsc::define_ptr(std::move(animtree))); + } + + auto node = std::make_unique(loc, utils::string::unquote(inst->data[1])); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnimTree: + { + auto tree = utils::string::unquote(inst->data[0]); + + if(tree != "") + { + auto treename = std::make_unique(loc, inst->data[0]); + auto animtree = std::make_unique(loc, std::move(treename)); + program_->definitions.push_back(gsc::define_ptr(std::move(animtree))); + } + + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetThisthread: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_GetBuiltinMethod: + { + auto file = std::make_unique(loc); + auto func = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_GetLocalFunction: + { + auto file = std::make_unique(loc); + auto func = std::make_unique(loc, inst->data[0].substr(4)); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_GetFarFunction: + { + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + auto func = std::make_unique(loc, inst->data[1]); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + }; + break; + case opcode::OP_CreateLocalVariable: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_RemoveLocalVariables: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_EvalLocalVariableCached0: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached1: + { + auto node = std::make_unique(loc, "1"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached2: + { + auto node = std::make_unique(loc, "2"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached3: + { + auto node = std::make_unique(loc, "3"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached4: + { + auto node = std::make_unique(loc, "4"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached5: + { + auto node = std::make_unique(loc, "5"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayCached: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalArray: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalNewLocalArrayRefCached0: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayRefCached0: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, "0")); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayRefCached: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalArrayRef: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_ClearArray: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = key.as_node->loc; + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(key))); + auto rvalue = gsc::expr_ptr(std::make_unique(loc)); + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr))); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_AddArray: + { + auto var = std::move(stack_.top()); + stack_.pop(); + auto array = std::move(stack_.top()); + stack_.pop(); + + if (array->type == gsc::node_t::data_empty_array) + { + auto args = std::make_unique(loc); + args->list.push_back(std::move(var)); + auto expr = std::make_unique(array->loc, std::move(args)); + stack_.push(std::move(expr)); + } + else if (array->type == gsc::node_t::expr_add_array) + { + (*(gsc::expr_add_array_ptr*)&array)->args->list.push_back(std::move(var)); + stack_.push(std::move(array)); + } + else + { + throw gsc::decomp_error("unknown add array type (could be an array variable name?)"); + } + } + break; + case opcode::OP_PreScriptCall: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_ScriptLocalFunctionCall2: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalFunctionCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalChildThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodThreadCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodChildThreadCall: + { + // TODO: child things... + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarFunctionCall2: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarFunctionCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarMethodCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[2]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[1])); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarMethodThreadCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[2]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[1])); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFunctionCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodCallPointer: + { + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptChildThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodChildThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto obj = gsc::expr_ptr(std::make_unique()); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, true, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethodPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, true, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin0: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin1: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 1; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin2: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 2; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin3: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 3; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin4: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 4; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin5: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 5; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod0: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod1: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 1; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod2: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 2; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod3: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 3; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod4: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 4; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod5: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 5; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_DecTop: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + loc = expr->loc; + auto stmt = std::make_unique(loc, std::move(*(gsc::expr_call_ptr*)&expr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_inc: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_dec: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_or: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_ex_or: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_and: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_equality: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_inequality: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_less: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_greater: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_less_equal: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_greater_equal: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_shift_left: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_shift_right: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_plus: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_minus: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_multiply: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_divide: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_mod: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_wait: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + loc = expr->loc; + auto stmt = std::make_unique(loc, std::move(expr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_waittillFrameEnd: + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_waitFrame: + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_waittill: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = nstr.as_node->loc; + auto args = std::make_unique(loc); + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr), std::move(args)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_waittillmatch: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto expr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = expr.as_node->loc; + + gsc::expr_arguments_ptr args = std::make_unique(); + args->loc = loc; + + while(stack_.size() > 0) + { + auto node = std::move(stack_.top()); + stack_.pop(); + args->loc = node->loc; + args->list.push_back(std::move(node)); + + } + loc = args->loc; + + auto stmt = std::make_unique(loc, std::move(obj), std::move(expr), std::move(args)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_clearparams: + { + auto args = std::make_unique(loc); + auto var = std::move(stack_.top()); + stack_.pop(); + + while(var->type != gsc::node_t::stmt_waittill && var->type != gsc::node_t::stmt_waittillmatch) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + } + + if(var->type == gsc::node_t::stmt_waittill) + { + (*(gsc::stmt_waittill_ptr*)&var)->args = std::move(args); + } + + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(var))); + } + break; + case opcode::OP_checkclearparams: + { + // no needed + } + break; + case opcode::OP_notify: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_voidcodepos) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr), std::move(args)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_endon: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = nstr.as_node->loc; + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_voidCodepos: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_vector: + { + auto x = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto y = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto z = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = z.as_node->loc; + auto expr = std::make_unique(loc, std::move(x), std::move(y), std::move(z)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_size: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_EvalLevelFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalAnimFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalSelfFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalFieldVariable: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalLevelFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalAnimFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalSelfFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_ClearFieldVariable: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto expr = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto undef = gsc::expr_ptr(std::make_unique(loc)); + auto e = std::make_unique(loc, std::move(expr), std::move(undef)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::make_unique(loc, std::move(e)))); + } + break; + case opcode::OP_SafeCreateVariableFieldCached: + { + func_->params->list.push_back(std::make_unique(loc, "var_" + inst->data[0])); + } + break; + case opcode::OP_SafeSetWaittillVariableFieldCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableRefCached0: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableRefCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_SetLevelFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc,std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetVariableField: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + + if(lvalue.as_node->type == gsc::node_t::expr_increment) + { + auto stmt = std::make_unique(loc, std::move(lvalue.as_increment)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + else if(lvalue.as_node->type == gsc::node_t::expr_decrement) + { + auto stmt = std::make_unique(loc, std::move(lvalue.as_decrement)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + else + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + } + break; + case opcode::OP_SetAnimFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetSelfFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetLocalVariableFieldCached0: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, "0")); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetNewLocalVariableFieldCached0: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + + if(func_->block->stmts.size() > 0) + { + std::vector creates; + + while(func_->block->stmts.back().as_node->type == gsc::node_t::asm_create) + { + auto& entry = func_->block->stmts.back(); + if(loc.begin.line < entry.as_node->loc.begin.line) + { + creates.push_back(entry.as_asm_create->index); + func_->block->stmts.pop_back(); + continue; + } + break; + } + + std::reverse(creates.begin(), creates.end()); + lvalue.as_asm_create->vars = creates; + } + + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetLocalVariableFieldCached: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_ClearLocalVariableFieldCached: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_ClearLocalVariableFieldCached0: + { + auto stmt = std::make_unique(loc,"0"); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_EvalLocalVariableObjectCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_CastFieldObject: + case opcode::OP_CastBool: + { + //continue; + } + break; + case opcode::OP_BoolNot: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_BoolComplement: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_switch: + { + auto expr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = expr.as_node->loc; + auto sw = std::make_unique(loc, std::move(expr), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(sw))); + } + break; + case opcode::OP_endswitch: + { + auto count = inst->data[0]; + inst->data.erase(inst->data.begin()); + auto data = inst->data; + auto end = std::make_unique(loc, data, count); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(end))); + } + break; + case opcode::OP_jump: + { + auto expr = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + + } + break; + case opcode::OP_jumpback: + { + auto expr = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnTrue: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto e_not = gsc::expr_ptr(std::make_unique(loc, std::move(lvalue))); + auto expr = std::make_unique(loc, std::move(e_not), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnFalse: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnTrueExpr: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + stack_.push(std::move(expr)); + expr_labels_.push_back(inst->data[0]); + } + break; + case opcode::OP_JumpOnFalseExpr: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + stack_.push(std::move(expr)); + expr_labels_.push_back(inst->data[0]); + } + break; + default: + throw gsc::decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); + break; + } + } +} + +void decompiler::decompile_expr() +{ + auto expr = std::move(stack_.top()); + stack_.pop(); + + auto jump_expr = std::move(stack_.top()); + stack_.pop(); + auto loc = jump_expr->loc; + + if(jump_expr->type == gsc::node_t::asm_jump_true_expr) + { + auto lvalue = std::move((*(gsc::asm_jump_true_expr_ptr*)&jump_expr)->expr); + auto rvalue = gsc::expr_ptr(std::move(expr)); + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(e)); + } + else if(jump_expr->type == gsc::node_t::asm_jump_false_expr) + { + auto lvalue = std::move((*(gsc::asm_jump_false_expr_ptr*)&jump_expr)->expr); + auto rvalue = gsc::expr_ptr(std::move(expr)); + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(e)); + } + else + { + throw gsc::decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); + } +} + +void decompiler::decompile_block(const gsc::stmt_list_ptr& block) +{ + this->decompile_search_infinite(block); + this->decompile_search_loop(block); + this->decompile_search_switch(block); + this->decompile_search_ifelse(block); + this->decompile_break_continue(block); + this->decompile_nulls(block); +} + +void decompiler::decompile_nulls(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::null) + { + block->stmts.erase(block->stmts.begin() + index); + } + else index++; + } +} + +void decompiler::decompile_search_infinite(const gsc::stmt_list_ptr& block) +{ + std::int32_t index = block->stmts.size() - 1; + + while(index >= 0) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_jump_back) + { + auto break_loc = last_location_index(block, index) ? blocks_.back().loc_end : utils::string::va("loc_%X", block->stmts.at(index+1).as_node->loc.begin.line); + auto begin_loc = block->stmts.at(index).as_jump_back->value; + auto start = find_location_index(block, begin_loc); + + if(block->stmts.at(start).as_node->type != gsc::node_t::asm_jump_cond) + { + decompile_infinite(block, start, index); + index = start; + } + else if (block->stmts.at(start).as_cond->value != break_loc) + { + decompile_infinite(block, start, index); + index = start; + } + } + + index--; + } +} + +void decompiler::decompile_search_loop(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + auto& stmt = block->stmts.at(index); + + if(stmt.as_node->type == gsc::node_t::asm_jump_cond) + { + std::uint32_t end; + if(stmt.as_cond->value == blocks_.back().loc_end) + { + end = block->stmts.size() - 1; + } + else + { + end = find_location_index(block, stmt.as_cond->value) - 1; + } + + if(block->stmts.at(end).as_node->type == gsc::node_t::asm_jump_back + && utils::string::va("loc_%X", block->stmts.at(index).as_node->loc.begin.line) == block->stmts.at(end).as_jump_back->value) + { + decompile_loop(block, index, end); + index = 0; + } + } + index++; + } +} + +void decompiler::decompile_search_switch(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_switch) + { + decompile_switch(block, index); + } + + index++; + } +} + +void decompiler::decompile_search_ifelse(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + auto& stmt = block->stmts.at(index); + + if(stmt.as_node->type == gsc::node_t::asm_jump_cond) + { + std::uint32_t end; + if(stmt.as_cond->value == blocks_.back().loc_end) + { + end = block->stmts.size() - 1; + } + else + { + end = find_location_index(block, stmt.as_cond->value) - 1; + } + + auto last_loc = blocks_.back().loc_end; + + if(block->stmts.at(end).as_node->type == gsc::node_t::asm_jump) + { + // if block is a loop check break, continue + if(block->stmts.at(end).as_jump->value == blocks_.back().loc_continue) + { + // last if/else inside a loop still trigger this :( + decompile_if(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == blocks_.back().loc_break) + { + decompile_if(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == blocks_.back().loc_end) + { + decompile_ifelse(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == stmt.as_cond->value) + { + decompile_if(block, index, end); // if block, have a last empty else inside + } + else + { + decompile_ifelse(block, index, end); // TODO: if else block is empty, convert it to only if! + } + } + else if(block->stmts.at(end).as_node->type == gsc::node_t::stmt_return + && block->stmts.at(end).as_return->expr.as_node->type == gsc::node_t::null) + { + if(blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") + { + decompile_if(block, index, end); // inside a loop cant be last + } + else if(end - index == 1) + { + decompile_if(block, index, end); // only one explicit return + } + else if(block->stmts.back().as_node->type != gsc::node_t::stmt_return) + { + decompile_if(block, index, end); // block end is not a last return + } + else if(blocks_.back().is_last && block->stmts.back().as_node->type != gsc::node_t::stmt_return) + { + decompile_if(block, index, end); // inside a last block but is not and inner last + } + else if(find_location_reference(block, end, block->stmts.size(), last_loc)) + { + decompile_if(block, index, end); // reference to func end after the if + } + else if(blocks_.size() > 1 && !blocks_.back().is_last) + { + decompile_if(block, index, end); // fake last ifelse + } + else + { + decompile_last_ifelse(block, index, end); // special case + } + } + else + { + decompile_if(block, index, end); + } + } + index++; + } +} + +void decompiler::decompile_break_continue(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_jump) + { + auto loc = block->stmts.at(index).as_node->loc; + auto jump_loc = block->stmts.at(index).as_jump->value; + + if(jump_loc == blocks_.back().loc_continue) + { + block->stmts.erase(block->stmts.begin() + index); + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + block->stmts.insert(block->stmts.begin() + index, std::move(stmt)); + } + else if(jump_loc == blocks_.back().loc_break) + { + block->stmts.erase(block->stmts.begin() + index); + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + block->stmts.insert(block->stmts.begin() + index, std::move(stmt)); + } + } + + index++; + } +} + +void decompiler::decompile_if(const gsc::stmt_list_ptr& block, std::uint32_t begin, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_end = block->stmts.at(begin).as_cond->value; + ctx.loc_break = blocks_.back().loc_break; + ctx.loc_continue = blocks_.back().loc_continue; + + auto loc = block->stmts.at(begin).as_node->loc; + auto expr = std::move(block->stmts.at(begin).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + begin); // remove condition + + auto if_block = std::make_unique(loc); + + for(auto i = begin; i < end; i++) + { + if_block->stmts.push_back(std::move(block->stmts[begin])); + block->stmts.erase(block->stmts.begin() + begin); + } + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)))); + block->stmts.insert(block->stmts.begin() + begin, std::move(stmt)); +} + +void decompiler::decompile_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_break = blocks_.back().loc_break; + ctx.loc_continue = blocks_.back().loc_continue; + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto if_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) // skip the jump + { + if_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + auto end_loc = block->stmts.at(start).as_jump->value; + + block->stmts.erase(block->stmts.begin() + start); // remove jump + + std::uint32_t end_index; + + if(end_loc == blocks_.back().loc_end) + { + end_index = block->stmts.size(); + } + else + { + end_index = find_location_index(block, end_loc); + } + + gsc::context ctx2; + ctx2.loc_end = end_loc; + ctx2.loc_break = blocks_.back().loc_break; + ctx2.loc_continue = blocks_.back().loc_continue; + + auto else_block = std::make_unique(loc); + + for(auto i = start; i < end_index; i++) + { + else_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx2); + decompile_block(else_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)), gsc::stmt_ptr(std::move(else_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_last_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.is_last = true; + + auto inner_end = find_location_index(block, block->stmts.at(start).as_cond->value) - 1; + ctx.loc_end = utils::string::va("loc_%X",block->stmts.at(inner_end).as_node->loc.begin.line); + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto if_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + if_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + block->stmts.erase(block->stmts.begin() + start); // remove if block return; + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + if(start == block->stmts.size()) + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); + } + else + { + gsc::context ctx2; + ctx2.is_last = true; + + auto else_block = std::make_unique(loc); + + end = block->stmts.size(); + ctx2.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); // return is the block end + + for(auto i = start; i < end; i++) + { + else_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + else_block->stmts.pop_back(); // remove else return; + + blocks_.push_back(ctx2); + decompile_block(else_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)), gsc::stmt_ptr(std::move(else_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); + } +} + +void decompiler::decompile_infinite(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = last_location_index(block, end) ? blocks_.back().loc_end : utils::string::va("loc_%X", block->stmts.at(end+1).as_node->loc.begin.line); + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + + auto loc = block->stmts.at(start).as_node->loc; + + block->stmts.erase(block->stmts.begin() + end); // remove jump back + + auto for_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + for_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(for_block); + blocks_.pop_back(); + + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + auto expr = gsc::expr_ptr(std::make_unique()); + auto post_expr = gsc::stmt_ptr(std::make_unique()); + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(pre_expr), std::move(expr), std::move(post_expr), gsc::stmt_ptr(std::move(for_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + auto& last_stmt = block->stmts.at(end-1); + if(last_stmt.as_node->type == gsc::node_t::stmt_assign) + { + if(last_stmt.as_assign->expr->type == gsc::node_t::expr_assign_equal) + { + auto& rval = last_stmt.as_assign->expr->rvalue; + if(rval.as_node->type == gsc::node_t::expr_call) + { + if(rval.as_call->func.as_node->type == gsc::node_t::expr_call_function) + { + if(utils::string::to_lower(rval.as_call->func.as_func->name->value) == "getnextarraykey") + { + auto ref2 = utils::string::va("loc_%X", block->stmts.at(start).as_node->loc.begin.line); + if(find_location_reference(block, 0, start, ref2)) + { + // begin is at condition, not pre-expr + //decompile_while(block, start, end); + //return; + } + else + { + decompile_foreach(block, start, end); + return; + } + } + } + } + } + + if(start > 0) // while at func start + { + auto index = 1; + while(block->stmts.at(start - index).as_node->type == gsc::node_t::asm_create) + { + if(start - index > 0) + index++; + } + + if(block->stmts.at(start - index).as_node->type == gsc::node_t::stmt_assign) + { + auto ref = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + auto ref2 = utils::string::va("loc_%X", block->stmts.at(start).as_node->loc.begin.line); + + if(find_location_reference(block, start, end, ref)) + { + // continue is at jumpback, not post-expr + decompile_while(block, start, end); + return; + } + else if(find_location_reference(block, 0, start, ref2)) + { + // begin is at condition, not pre-expr + decompile_while(block, start, end); + return; + } + else + { + decompile_for(block, start, end); + return; + } + } + } + } + + decompile_while(block, start, end); +} + +void decompiler::decompile_while(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(start).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X",block->stmts.at(end).as_node->loc.begin.line); + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + end); // remove jump back + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto while_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + while_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(while_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(while_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_for(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(start).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + + // remove emit local var_creates + std::vector creates; + while(block->stmts.at(start - 1).as_node->type == gsc::node_t::asm_create) + { + creates.push_back(block->stmts.at(start - 1).as_asm_create->index); + block->stmts.erase(block->stmts.begin() + start - 1); + start--; + end--; + } + + std::reverse(creates.begin(), creates.end()); + + auto loc = block->stmts.at(start - 1).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + pre_expr.as_list->stmts.push_back(std::move(block->stmts.at(start - 1))); + pre_expr.as_list->is_expr = true; + auto post_expr = gsc::stmt_ptr(std::make_unique()); + post_expr.as_list->stmts.push_back(std::move(block->stmts.at(end - 1))); + post_expr.as_list->is_expr = true; + + start = start - 1; + end = end - 2; + for(auto i = start; i < start + 2; i++) // remove prologue (pre-expr, condition) + { + block->stmts.erase(block->stmts.begin() + start); + } + + end = end - 1; // set end in post-expr + for(auto i = end; i < end + 2; i++) // remove epilogue (post-expr, jump back) + { + block->stmts.erase(block->stmts.begin() + end); + } + + auto for_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + for_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(for_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(pre_expr), std::move(expr), std::move(post_expr), gsc::stmt_ptr(std::move(for_block)))); + stmt.as_for->vars = creates; + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_foreach(const gsc::stmt_list_ptr& block, std::uint32_t begin, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(begin).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + + // remove local var_creates + std::vector creates; + while(block->stmts.at(begin - 1).as_node->type == gsc::node_t::asm_create) + { + creates.push_back(block->stmts.at(begin - 1).as_asm_create->index); + block->stmts.erase(block->stmts.begin() + begin - 1); + begin--; + end--; + } + + std::reverse(creates.begin(), creates.end()); + + auto loc = block->stmts.at(begin - 2).as_node->loc; + + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + pre_expr.as_list->stmts.push_back(std::move(block->stmts[begin-2])); + pre_expr.as_list->stmts.push_back(std::move(block->stmts[begin-1])); + auto stmt0 = std::move(block->stmts[begin+1]); + + begin = begin - 2; + end = end - 4; + for(auto i = begin; i < begin + 4; i++) // remove prologue ( array, elem, cond, elemRef) + { + block->stmts.erase(block->stmts.begin() + begin); + } + + end = end - 1; // set end to post-expr + + for(auto i = end; i < end + 2; i++) // remove epilogue ( post-expr, jump back) + { + block->stmts.erase(block->stmts.begin() + end); + } + + if(block->stmts.size() > end && block->stmts.at(end).as_node->type == gsc::node_t::asm_clear) + { + block->stmts.erase(block->stmts.begin() + end); + } + + auto use_key = true; + + if(block->stmts.size() > end && block->stmts.at(end).as_node->type == gsc::node_t::asm_clear) + { + block->stmts.erase(block->stmts.begin() + end); + use_key = false; + } + + auto foreach_block = std::make_unique(loc); + + for(auto i = begin; i < end; i++) + { + foreach_block->stmts.push_back(std::move(block->stmts[begin])); + block->stmts.erase(block->stmts.begin() + begin); + } + + blocks_.push_back(ctx); + decompile_block(foreach_block); + blocks_.pop_back(); + + auto foreach_stmt = gsc::stmt_ptr(std::make_unique(loc, gsc::stmt_ptr(std::move(foreach_block)), use_key)); + foreach_stmt.as_foreach->vars = creates; + foreach_stmt.as_foreach->pre_expr = std::move(pre_expr); + foreach_stmt.as_foreach->stmt0 = std::move(stmt0); + + block->stmts.insert(block->stmts.begin() + begin, std::move(foreach_stmt)); +} + +void decompiler::decompile_switch(const gsc::stmt_list_ptr& block, std::uint32_t start) +{ + gsc::context ctx; + ctx.loc_continue = blocks_.back().loc_continue; + ctx.loc_end = block->stmts.at(start).as_asm_switch->value; + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_asm_switch->expr); + auto end_loc = block->stmts.at(start).as_asm_switch->value; + auto end = find_location_index(block, end_loc); + + if(end == block->stmts.size() - 1) + { + ctx.loc_break = blocks_.back().loc_end; + } + else + { + ctx.loc_break = utils::string::va("loc_%X", block->stmts.at(end + 1).as_node->loc.begin.line); + } + + // collect cases + auto casenum = std::atol(block->stmts.at(end).as_asm_endswitch->count.data()); + auto data = block->stmts.at(end).as_asm_endswitch->data; + auto idx = 0; + + for(auto i = 0; i < casenum; i++) + { + if(data.at(idx) == "case") + { + auto loc_str = data.at(idx+2); + auto loc_idx = find_location_index(block, loc_str); + auto loc_pos = gsc::location(&filename_, std::stol(loc_str.substr(4), 0, 16)); + auto value = gsc::expr_ptr(std::make_unique(loc_pos, data.at(idx+1))); + auto list = std::make_unique(loc); + list->is_case = true; + auto stmt = gsc::stmt_ptr(std::make_unique(loc_pos, std::move(value), std::move(list))); + block->stmts.insert(block->stmts.begin() + loc_idx, std::move(stmt)); + idx += 3; + } + else if(data.at(idx) == "default") + { + auto loc_str = data.at(idx+1); + auto loc_idx = find_location_index(block, loc_str); + auto loc_pos = gsc::location(&filename_, std::stol(loc_str.substr(4), 0, 16)); + auto list = std::make_unique(loc); + list->is_case = true; + auto stmt = gsc::stmt_ptr(std::make_unique(loc_pos, std::move(list))); + block->stmts.insert(block->stmts.begin() + loc_idx, std::move(stmt)); + idx += 2; + } + } + + end = find_location_index(block, end_loc) - 1; // update end; + block->stmts.erase(block->stmts.begin() + start); // remove switch + block->stmts.erase(block->stmts.begin() + end); // remove endswitch + + //decompile block + auto sw_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + sw_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(sw_block); + blocks_.pop_back(); + + auto stmt_list = std::make_unique(loc); + gsc::stmt_ptr current_case = gsc::stmt_ptr(std::make_unique()); + + auto num = sw_block->stmts.size(); + for(auto i = 0; i < num; i++) + { + auto& entry = sw_block->stmts[0]; + + if(entry.as_node->type == gsc::node_t::stmt_case || entry.as_node->type == gsc::node_t::stmt_default) + { + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + current_case = std::move(sw_block->stmts[0]); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + else + { + if(current_case.as_node->type != gsc::node_t::null) + { + if(current_case.as_node->type == gsc::node_t::stmt_case) + { + current_case.as_case->stmt->stmts.push_back(std::move(sw_block->stmts[0])); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + else + { + current_case.as_default->stmt->stmts.push_back(std::move(sw_block->stmts[0])); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + } + else + { + gsc::decomp_error("missing case before stmt inside switch!"); + } + } + } + + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), std::move(stmt_list))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +auto decompiler::find_location_reference(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end, const std::string& location) -> bool +{ + for(auto i = start; i < end; i++) + { + if(block->stmts.at(i).as_node->type == gsc::node_t::asm_jump_cond) + { + if(block->stmts.at(i).as_cond->value == location) + return true; + } + else if(block->stmts.at(i).as_node->type == gsc::node_t::asm_jump) + { + if(block->stmts.at(i).as_jump->value == location) + return true; + } + } + + return false; +} + +auto decompiler::find_location_index(const gsc::stmt_list_ptr& block, const std::string& location) -> std::uint32_t +{ + auto index = 0; + + if(location == blocks_.back().loc_end) + return block->stmts.size(); + + for(auto& stmt : block->stmts) + { + if(stmt.as_node->loc.begin.line == std::stol(location.substr(4), 0, 16)) + return index; + + index++; + } + + throw gsc::decomp_error("LOCATION NOT FOUND! (" + location + ")"); +} + +auto decompiler::last_location_index(const gsc::stmt_list_ptr& block, std::uint32_t index) -> bool +{ + if(index == block->stmts.size() - 1) + return true; + + return false; +} + +void decompiler::process_stack(const gsc::thread_ptr& thread) +{ + auto ctx = std::make_unique(); + + process_parameters(ctx, thread->params); + process_stmt_list(ctx, thread->block); + +} + +void decompiler::process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + ctx->local_vars.push_back({ param->value, static_cast(std::stoi(param->value.substr(4))), true }); + ctx->local_vars_create_count++; + } +} + +void decompiler::process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt) +{ + switch(stmt.as_node->type) + { + case gsc::node_t::stmt_list: process_stmt_list(ctx, stmt.as_list); break; + case gsc::node_t::stmt_call: process_stmt_call(ctx, stmt.as_call); break; + case gsc::node_t::stmt_assign: process_stmt_assign(ctx, stmt.as_assign); break; + case gsc::node_t::stmt_endon: process_stmt_endon(ctx, stmt.as_endon); break; + case gsc::node_t::stmt_notify: process_stmt_notify(ctx, stmt.as_notify); break; + case gsc::node_t::stmt_wait: process_stmt_wait(ctx, stmt.as_wait); break; + case gsc::node_t::stmt_waittill: process_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_waittillmatch: process_stmt_waittillmatch(ctx, stmt.as_waittillmatch); break; + case gsc::node_t::stmt_if: process_stmt_if(ctx, stmt.as_if); break; + case gsc::node_t::stmt_ifelse: process_stmt_ifelse(ctx, stmt.as_ifelse); break; + case gsc::node_t::stmt_while: process_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: process_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: process_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: process_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_break: process_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_return: process_stmt_return(ctx, stmt.as_return); break; + case gsc::node_t::asm_remove: process_var_remove(ctx, stmt.as_asm_remove); break; + case gsc::node_t::asm_create: + { + auto expr = gsc::expr_ptr(std::make_unique(stmt.as_asm_create->index)); + process_var_create(ctx, expr, true); + } + break; + default: break; + } +} + +void decompiler::process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + for (const auto& entry : stmt->stmts) + { + process_stmt(ctx, entry); + } + + for(auto i = 0; i < stmt->stmts.size(); i++) + { + auto type = stmt->stmts.at(i).as_node->type; + + if(type == gsc::node_t::asm_create || type == gsc::node_t::asm_remove) + { + stmt->stmts.erase(stmt->stmts.begin() + i); + i--; + } + } +} + +void decompiler::process_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt) +{ + process_expr_call(ctx, stmt->expr); +} + +void decompiler::process_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt) +{ + process_expr_assign(ctx, stmt->expr); +} + +void decompiler::process_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt) +{ + process_expr_arguments(ctx, stmt->args); + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt) +{ + process_expr(ctx, stmt->expr); +} + +void decompiler::process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); + process_expr_arguments(ctx, stmt->args); +} + +void decompiler::process_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt) +{ + process_expr_arguments(ctx, stmt->args); + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx_if = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx_if); + + process_stmt(stmt->ctx_if, stmt->stmt_if); + + stmt->ctx_else = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx_else); + + process_stmt(stmt->ctx_else, stmt->stmt_else); + + std::vector childs({stmt->ctx_if.get(), stmt->ctx_else.get()}); + ctx->append(childs); + + if(stmt->stmt_if.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt_if.as_list->stmts.at(0))) + { + stmt->stmt_if = std::move(stmt->stmt_if.as_list->stmts.back()); + } + + if(stmt->stmt_else.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt_noif(stmt->stmt_else.as_list->stmts.at(0))) + { + stmt->stmt_else = std::move(stmt->stmt_else.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt); + + std::vector childs({ stmt->ctx.get() }); + + if(stmt->expr.as_node->type == gsc::node_t::null) + ctx->append_decompiler(stmt->ctx); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + process_stmt(ctx, stmt->pre_expr); + + for(auto& index : stmt->vars) + { + auto var = utils::string::va("var_%d", std::stoi(index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(index)), true }); + ctx->local_vars_create_count++; + } + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_expr(ctx, stmt->expr); + + process_stmt(stmt->ctx, stmt->stmt); + + process_stmt(ctx, stmt->post_expr); + + if(stmt->expr.as_node->type == gsc::node_t::null) + ctx->append_decompiler(stmt->ctx); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + process_stmt(ctx, stmt->pre_expr); + + for(auto& index : stmt->vars) + { + auto var1 = utils::string::va("var_%d", std::stoi(index)); + ctx->local_vars.push_back({ var1, static_cast(std::stoi(index)), true }); + ctx->local_vars_create_count++; + } + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt0); + process_stmt(stmt->ctx, stmt->stmt); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } + + stmt->array_expr = std::move(stmt->pre_expr.as_list->stmts[0].as_assign->expr->rvalue); + stmt->value_expr = std::move(stmt->stmt0.as_assign->expr->lvalue); + stmt->key_expr = std::move(stmt->pre_expr.as_list->stmts[1].as_assign->expr->lvalue); +} + +void decompiler::process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt_cases(stmt->ctx, stmt->stmt); + + ctx->append_decompiler(stmt->ctx, true); +} + +void decompiler::process_stmt_cases(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + std::vector childs; + + for(auto& entry : stmt->stmts) + { + if(entry.as_node->type == gsc::node_t::stmt_case) + { + entry.as_case->ctx = std::make_unique(); + ctx->transfer_decompiler(entry.as_case->ctx); + + process_stmt_list(entry.as_case->ctx, entry.as_case->stmt); + + if(entry.as_case->ctx->abort == gsc::abort_t::abort_break) + { + childs.push_back(entry.as_case->ctx.get()); + } + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + entry.as_default->ctx = std::make_unique(); + ctx->transfer_decompiler(entry.as_default->ctx); + + process_stmt_list(entry.as_default->ctx, entry.as_default->stmt); + + if(entry.as_default->ctx->abort == gsc::abort_t::abort_break) + { + childs.push_back(entry.as_default->ctx.get()); + } + } + } + + ctx->append(childs); +} + +void decompiler::process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + ctx->abort = gsc::abort_t::abort_break; +} + +void decompiler::process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(stmt->expr.as_node->type == gsc::node_t::null) + { + return; + } + + process_expr(ctx, stmt->expr); +} + +void decompiler::process_expr(const gsc::context_ptr& ctx, gsc::expr_ptr& expr) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_increment: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_decrement: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_equal: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_add: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_sub: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_mult: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_div: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_mod: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_shift_left: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_shift_right: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_or: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_and: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_exor: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_and: process_expr_and(ctx, expr.as_and); break; + case gsc::node_t::expr_or: process_expr_or(ctx, expr.as_or); break; + case gsc::node_t::expr_equality: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_inequality: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less_equal: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater_equal: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_or: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_and: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_exor: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_left: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_right: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_add: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_sub: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mult: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_div: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mod: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_complement: process_expr_complement(ctx, expr.as_complement); break; + case gsc::node_t::expr_not: process_expr_not(ctx, expr.as_not); break; + case gsc::node_t::expr_call: process_expr_call(ctx, expr.as_call); break; + case gsc::node_t::expr_function: process_expr_function(ctx, expr.as_function); break; + case gsc::node_t::expr_add_array: process_expr_add_array(ctx, expr.as_add_array); break; + case gsc::node_t::expr_array: process_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: process_field_variable(ctx, expr.as_field); break; + case gsc::node_t::expr_size: process_expr_size(ctx, expr.as_size); break; + case gsc::node_t::data_name: process_local_variable(ctx, expr.as_name); break; + case gsc::node_t::data_vector: process_vector(ctx, expr.as_vector); break; + case gsc::node_t::asm_create: process_var_create(ctx, expr); break; + case gsc::node_t::asm_access: process_var_access(ctx, expr); break; + default: break; + } +} + +void decompiler::process_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr) +{ + if(expr->type == gsc::node_t::expr_increment) + { + process_expr(ctx, expr->lvalue); + } + else if(expr->type == gsc::node_t::expr_decrement) + { + process_expr(ctx, expr->lvalue); + } + else + { + process_expr(ctx, expr->rvalue); + process_expr(ctx, expr->lvalue); + } +} + +void decompiler::process_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr) +{ + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr) +{ + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + if(expr->func.as_node->type == gsc::node_t::expr_call_pointer) + { + process_expr_call_pointer(ctx, expr); + } + else + { + process_expr_call_function(ctx, expr); + } +} + +void decompiler::process_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + process_expr_arguments(ctx, expr->func.as_pointer->args); + + if(expr->obj.as_node->type != gsc::node_t::null) + process_expr(ctx, expr->obj); + + process_expr(ctx, expr->func.as_pointer->expr); +} + +void decompiler::process_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + process_expr_arguments(ctx, expr->func.as_func->args); + + if(expr->obj.as_node->type != gsc::node_t::null) + process_expr(ctx, expr->obj); +} + +void decompiler::process_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& args) +{ + for(auto i = args->list.size(); i > 0; i--) + { + process_expr(ctx, args->list.at(i - 1)); + } +} + +void decompiler::process_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& expr) +{ + return; +} + +void decompiler::process_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr) +{ + for(auto& arg : expr->args->list) + { + process_expr(ctx, arg); + } +} + +void decompiler::process_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr) +{ + process_expr(ctx, expr->obj); +} + +void decompiler::process_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr) +{ + process_expr(ctx, expr->key); + process_expr(ctx, expr->obj); +} + +void decompiler::process_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr) +{ + process_expr(ctx, expr->obj); +} + +void decompiler::process_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + return; +} + +void decompiler::process_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec) +{ + process_expr(ctx, vec->z); + process_expr(ctx, vec->y); + process_expr(ctx, vec->x); +} + +void decompiler::process_var_create(const gsc::context_ptr& ctx, gsc::expr_ptr& expr, bool fromstmt) +{ + if(fromstmt) + { + auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); + ctx->local_vars_create_count++; + } + else + { + for(auto& entry : expr.as_asm_create->vars) + { + ctx->local_vars.push_back({ utils::string::va("var_%d", std::stoi(entry)), static_cast(std::stoi(entry)), true }); + ctx->local_vars_create_count++; + } + + auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); + ctx->local_vars_create_count++; + + expr = gsc::expr_ptr(std::make_unique(var)); + } +} + +void decompiler::process_var_access(const gsc::context_ptr& ctx, gsc::expr_ptr& expr) +{ + if(ctx->local_vars.size() <= std::stoi(expr.as_asm_access->index)) + { + printf("WARNING: bad local var access\n"); + } + else + { + auto var = ctx->local_vars.at(ctx->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; + expr = gsc::expr_ptr(std::make_unique(var)); + } +} + +void decompiler::process_var_remove(const gsc::context_ptr& ctx, const gsc::asm_remove_ptr& expr) +{ + ctx->local_vars_public_count = ctx->local_vars.size() - std::stoi(expr->index); +} + +} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/decompiler.hpp b/src/s1/xsk/decompiler.hpp new file mode 100644 index 00000000..7c8992da --- /dev/null +++ b/src/s1/xsk/decompiler.hpp @@ -0,0 +1,93 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::s1 +{ + +class decompiler : public gsc::decompiler +{ + std::string filename_; + std::unique_ptr output_; + gsc::program_ptr program_; + gsc::thread_ptr func_; + std::unordered_map labels_; + std::vector expr_labels_; + std::stack stack_; + std::vector blocks_; + +public: + auto output() -> std::vector; + void decompile(const std::string& file, std::vector& functions); + +private: + void decompile_function(const gsc::function_ptr& func); + void decompile_statements(const gsc::function_ptr& func); + void decompile_expr(); + void decompile_block(const gsc::stmt_list_ptr& block); + void decompile_nulls(const gsc::stmt_list_ptr& block); + void decompile_search_infinite(const gsc::stmt_list_ptr& block); + void decompile_search_loop(const gsc::stmt_list_ptr& block); + void decompile_search_switch(const gsc::stmt_list_ptr& block); + void decompile_search_ifelse(const gsc::stmt_list_ptr& block); + void decompile_break_continue(const gsc::stmt_list_ptr& block); + void decompile_if(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_last_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_infinite(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_while(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_for(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_foreach(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_switch(const gsc::stmt_list_ptr& block, std::uint32_t start); + auto find_location_reference(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end, const std::string& location) -> bool; + auto find_location_index(const gsc::stmt_list_ptr& block, const std::string& location) -> std::uint32_t; + auto last_location_index(const gsc::stmt_list_ptr& block, std::uint32_t index) -> bool; + void process_stack(const gsc::thread_ptr& thread); + void process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt); + void process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt); + void process_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt); + void process_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt); + void process_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt); + void process_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt); + void process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void process_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt); + void process_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt); + void process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt); + void process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt); + void process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void process_stmt_cases(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void process_expr(const gsc::context_ptr& ctx, gsc::expr_ptr& expr); + void process_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr); + void process_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr); + void process_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr); + void process_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr); + void process_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr); + void process_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr); + void process_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& arg_list); + void process_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& node); + void process_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr); + void process_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr); + void process_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr); + void process_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr); + void process_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void process_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec); + void process_var_create(const gsc::context_ptr& ctx, gsc::expr_ptr& expr, bool fromstmt = false); + void process_var_access(const gsc::context_ptr& ctx, gsc::expr_ptr& expr); + void process_var_remove(const gsc::context_ptr& ctx, const gsc::asm_remove_ptr& expr); +}; + +} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/disassembler.cpp b/src/s1/xsk/disassembler.cpp new file mode 100644 index 00000000..4d238a11 --- /dev/null +++ b/src/s1/xsk/disassembler.cpp @@ -0,0 +1,572 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "s1.hpp" + +namespace xsk::gsc::s1 +{ + +auto disassembler::output() -> std::vector +{ + return std::move(functions_); +} + +auto disassembler::output_data() -> std::vector +{ + output_ = std::make_unique(0x100000); + + output_->write_string("// S1 PC GSCASM\n"); + output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); + + for (auto& func : functions_) + { + this->print_function(func); + } + + std::vector output; + + output.resize(output_->pos()); + memcpy(output.data(), output_->buffer().data(), output.size()); + + return output; +} + +void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) +{ + filename_ = file; + script_ = std::make_unique(script); + stack_ = std::make_unique(stack); + functions_.clear(); + + script_->seek(1); + + while (stack_->is_avail() && script_->is_avail()) + { + functions_.push_back(std::make_unique()); + auto& func = functions_.back(); + + func->index = static_cast(script_->pos()); + func->size = stack_->read(); + func->id = stack_->read(); + func->name = "sub_"s + (func->id == 0 ? stack_->read_c_string() : resolver::token_name(func->id)); + + this->dissasemble_function(func); + + func->labels = labels_; + labels_.clear(); + } + + this->resolve_local_functions(); +} + +void disassembler::dissasemble_function(const gsc::function_ptr& func) +{ + auto size = func->size; + + while (size > 0) + { + func->instructions.push_back(std::make_unique()); + + auto& inst = func->instructions.back(); + inst->index = static_cast(script_->pos()); + inst->opcode = script_->read(); + inst->size = opcode_size(inst->opcode); + + this->dissasemble_instruction(inst); + + size -= inst->size; + } +} + +void disassembler::dissasemble_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_Return: + case opcode::OP_BoolNot: + case opcode::OP_CastBool: + case opcode::OP_inequality: + case opcode::OP_GetThisthread: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_checkclearparams: + case opcode::OP_CastFieldObject: + case opcode::OP_End: + case opcode::OP_size: + case opcode::OP_EmptyArray: + case opcode::OP_bit_and: + case opcode::OP_less_equal: + case opcode::OP_voidCodepos: + case opcode::OP_ClearVariableField: + case opcode::OP_divide: + case opcode::OP_GetSelf: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_plus: + case opcode::OP_BoolComplement: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_inc: + case opcode::OP_clearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_endon: + case opcode::OP_greater_equal: + case opcode::OP_GetSelfObject: + case opcode::OP_SetVariableField: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_less: + case opcode::OP_GetGameRef: + case opcode::OP_waitFrame: + case opcode::OP_waittillFrameEnd: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_notify: + case opcode::OP_DecTop: + case opcode::OP_shift_left: + case opcode::OP_greater: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_minus: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_multiply: + case opcode::OP_mod: + case opcode::OP_GetGame: + case opcode::OP_waittill: + case opcode::OP_dec: + case opcode::OP_PreScriptCall: + case opcode::OP_GetAnim: + case opcode::OP_GetUndefined: + case opcode::OP_GetAnimObject: + case opcode::OP_GetLevelObject: + case opcode::OP_bit_ex_or: + case opcode::OP_equality: + case opcode::OP_ClearArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalArray: + case opcode::OP_vector: + case opcode::OP_bit_or: + case opcode::OP_AddArray: + case opcode::OP_waittillmatch2: + case opcode::OP_shift_right: + break; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetInteger: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetFloat: + inst->data.push_back(utils::string::va("%g", script_->read())); + break; + case opcode::OP_GetVector: + inst->data.push_back(utils::string::va("%g", script_->read())); + inst->data.push_back(utils::string::va("%g", script_->read())); + inst->data.push_back(utils::string::va("%g", script_->read())); + break; + case opcode::OP_GetString: + case opcode::OP_GetIString: + script_->seek(4); + inst->data.push_back(utils::string::to_literal(stack_->read_c_string())); + break; + case opcode::OP_GetAnimation: + script_->seek(8); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + break; + case opcode::OP_GetAnimTree: + script_->seek(1); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + break; + case opcode::OP_waittillmatch: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_EvalLocalArrayCached: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + this->disassemble_field_variable(inst); + break; + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + this->disassemble_local_call(inst, false); + break; + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + this->disassemble_local_call(inst, true); + break; + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + this->disassemble_far_call(inst, false); + break; + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + this->disassemble_far_call(inst, true); + break; + case opcode::OP_CallBuiltin: + this->disassemble_builtin_call(inst, false, true); + break; + case opcode::OP_CallBuiltinMethod: + this->disassemble_builtin_call(inst, true, true); + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + this->disassemble_builtin_call(inst, false, false); + break; + case opcode::OP_GetBuiltinMethod: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + this->disassemble_builtin_call(inst, true, false); + break; + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + this->disassemble_jump(inst, true, false); + break; + case opcode::OP_jumpback: + this->disassemble_jump(inst, false, true); + break; + case opcode::OP_jump: + this->disassemble_jump(inst, false, false); + break; + case opcode::OP_switch: + this->disassemble_switch(inst); + break; + case opcode::OP_endswitch: + this->disassemble_end_switch(inst); + break; + default: + throw gsc::disasm_error(utils::string::va("Unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); + } +} + +void disassembler::disassemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num) +{ + if (arg_num) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } + + if (method) + { + inst->data.push_back(resolver::method_name(script_->read())); + } + else + { + inst->data.push_back(resolver::function_name(script_->read())); + } +} + +void disassembler::disassemble_local_call(const gsc::instruction_ptr& inst, bool thread) +{ + std::int32_t offset = this->disassemble_offset(); + + inst->data.push_back(utils::string::va("%X", offset + inst->index + 1)); + + if (thread) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } +} + +void disassembler::disassemble_far_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->seek(3); + + if (thread) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } + + auto file_id = stack_->read(); + auto file_name = file_id == 0 ? stack_->read_c_string() : resolver::file_name(file_id); + auto func_id = stack_->read(); + auto func_name = func_id == 0 ? stack_->read_c_string() : resolver::token_name(func_id); + + inst->data.push_back(file_name != "" ? file_name : utils::string::va("_ID%i", file_id)); + inst->data.push_back(func_name != "" ? func_name : utils::string::va("_ID%i", func_id)); +} + +void disassembler::disassemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back) +{ + std::int32_t addr; + std::string label; + + if (expr) + { + addr = inst->index + 3 + script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + else if (back) + { + addr = inst->index + 3 - script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + else + { + addr = inst->index + 5 + script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + + labels_.insert({addr, label}); +} + +void disassembler::disassemble_field_variable(const gsc::instruction_ptr& inst) +{ + std::uint16_t field_id = script_->read(); + std::string field_name; + + if(field_id > 0xA7DC) + { + auto temp = stack_->read(); + field_name = temp == 0 ? stack_->read_c_string() : std::to_string(temp); + } + else + { + field_name = resolver::token_name(field_id); + } + + inst->data.push_back(field_name != "" ? field_name : utils::string::va("_ID%i", field_id)); +} + +void disassembler::disassemble_switch(const gsc::instruction_ptr& inst) +{ + std::int32_t addr = inst->index + 4 + script_->read(); + std::string label = utils::string::va("loc_%X", addr); + + inst->data.push_back(label); + labels_.insert({addr, label}); +} + +void disassembler::disassemble_end_switch(const gsc::instruction_ptr& inst) +{ + std::uint16_t case_num = script_->read(); + inst->data.push_back(utils::string::va("%i", case_num)); + + std::uint32_t internal_index = inst->index + 3; + + if (case_num) + { + for (auto i = case_num; i > 0; i--) + { + std::uint32_t case_label = script_->read(); + + if (case_label < 0x40000 && case_label > 0) + { + inst->data.push_back("case"); + inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); + } + else if (case_label == 0) + { + inst->data.push_back("default"); + stack_->read(); + } + else + { + inst->data.push_back("case"); + inst->data.push_back(utils::string::va("%i", (case_label - 0x800000) & 0xFFFFFF)); + } + + inst->size += 4; + internal_index += 4; + + auto addr = this->disassemble_offset() + internal_index; + std::string label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + + labels_.insert({addr, label}); + + inst->size += 3; + internal_index += 3; + } + } +} + +auto disassembler::disassemble_offset() -> std::int32_t +{ + std::array bytes = {}; + + for (auto i = 0; i < 3; i++) + { + bytes[i] = script_->read(); + } + + std::int32_t offset = *reinterpret_cast(bytes.data()); + + offset = (offset << 8) >> 10; + + return offset; +} + +void disassembler::resolve_local_functions() +{ + for (auto& func : functions_) + { + for (auto& inst : func->instructions) + { + switch (opcode(inst->opcode)) + { + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + inst->data.at(0) = this->resolve_function(inst->data[0]); + break; + default: + break; + } + } + } +} + +auto disassembler::resolve_function(const std::string& index) -> std::string +{ + if (utils::string::is_hex_number(index)) + { + std::uint32_t idx = std::stoul(index, nullptr, 16); + + for (auto& func : functions_) + { + if (func->index == idx) + { + return func->name; + } + } + + throw gsc::disasm_error(utils::string::va("Couldn't resolve function name at index '0x%04X'!", idx)); + } + + throw gsc::disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); +} + +void disassembler::print_function(const gsc::function_ptr& func) +{ + output_->write_string("\n"); + output_->write_string(utils::string::va("%s\n", func->name.data())); + + for (auto& inst : func->instructions) + { + const auto itr = func->labels.find(inst->index); + + if (itr != func->labels.end()) + { + output_->write_string(utils::string::va("\t%s\n", itr->second.data())); + } + + this->print_instruction(inst); + } + + output_->write_string("\n"); + output_->write_string(utils::string::va("end_%s\n", func->name.substr(4).data())); +} + +void disassembler::print_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_endswitch: + output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); + output_->write_string(utils::string::va(" %s\n", inst->data[0].data())); + { + std::uint32_t totalcase = std::stoul(inst->data[0]); + auto index = 0; + for (auto casenum = 0u; casenum < totalcase; casenum++) + { + if (inst->data[1 + index] == "case") + { + output_->write_string(utils::string::va("\t\t\t%s %s %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data(), inst->data[1 + index + 2].data())); + index += 3; + } + else if (inst->data[1 + index] == "default") + { + output_->write_string(utils::string::va("\t\t\t%s %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data())); + index += 2; + } + if (casenum != totalcase - 1) + { + output_->write_string("\n"); + } + } + } + break; + default: + output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); + for (auto& d : inst->data) + { + output_->write_string(utils::string::va(" %s", d.data())); + } + break; + } + + output_->write_string("\n"); +} + +} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/disassembler.hpp b/src/s1/xsk/disassembler.hpp new file mode 100644 index 00000000..d9cdae55 --- /dev/null +++ b/src/s1/xsk/disassembler.hpp @@ -0,0 +1,42 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::s1 +{ + +class disassembler : public gsc::disassembler +{ + std::string filename_; + utils::byte_buffer_ptr script_; + utils::byte_buffer_ptr stack_; + utils::byte_buffer_ptr output_; + std::vector functions_; + std::unordered_map labels_; + +public: + auto output() -> std::vector; + auto output_data() -> std::vector; + void disassemble(const std::string& file, std::vector& script, std::vector& stack); + +private: + void dissasemble_function(const gsc::function_ptr& func); + void dissasemble_instruction(const gsc::instruction_ptr& inst); + void disassemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num); + void disassemble_local_call(const gsc::instruction_ptr& inst, bool thread); + void disassemble_far_call(const gsc::instruction_ptr& inst, bool thread); + void disassemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back); + void disassemble_field_variable(const gsc::instruction_ptr& inst); + void disassemble_switch(const gsc::instruction_ptr& inst); + void disassemble_end_switch(const gsc::instruction_ptr& inst); + auto disassemble_offset() -> std::int32_t; + void resolve_local_functions(); + auto resolve_function(const std::string& index) -> std::string; + void print_function(const gsc::function_ptr& func); + void print_instruction(const gsc::instruction_ptr& inst); +}; + +} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/lexer.cpp b/src/s1/xsk/lexer.cpp new file mode 100644 index 00000000..d1b802a0 --- /dev/null +++ b/src/s1/xsk/lexer.cpp @@ -0,0 +1,2826 @@ +#line 1 "lexer.cpp" +#include "stdafx.hpp" +#include "s1.hpp" +#include "parser.hpp" +using namespace xsk::gsc; + +#line 7 "lexer.cpp" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define s1__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer s1__create_buffer +#endif + +#ifdef yy_delete_buffer +#define s1__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer s1__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define s1__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer s1__scan_buffer +#endif + +#ifdef yy_scan_string +#define s1__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string s1__scan_string +#endif + +#ifdef yy_scan_bytes +#define s1__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes s1__scan_bytes +#endif + +#ifdef yy_init_buffer +#define s1__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer s1__init_buffer +#endif + +#ifdef yy_flush_buffer +#define s1__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer s1__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define s1__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state s1__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define s1__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer s1__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define s1_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state s1_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define s1_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state s1_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define s1_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack s1_ensure_buffer_stack +#endif + +#ifdef yylex +#define s1_lex_ALREADY_DEFINED +#else +#define yylex s1_lex +#endif + +#ifdef yyrestart +#define s1_restart_ALREADY_DEFINED +#else +#define yyrestart s1_restart +#endif + +#ifdef yylex_init +#define s1_lex_init_ALREADY_DEFINED +#else +#define yylex_init s1_lex_init +#endif + +#ifdef yylex_init_extra +#define s1_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra s1_lex_init_extra +#endif + +#ifdef yylex_destroy +#define s1_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy s1_lex_destroy +#endif + +#ifdef yyget_debug +#define s1_get_debug_ALREADY_DEFINED +#else +#define yyget_debug s1_get_debug +#endif + +#ifdef yyset_debug +#define s1_set_debug_ALREADY_DEFINED +#else +#define yyset_debug s1_set_debug +#endif + +#ifdef yyget_extra +#define s1_get_extra_ALREADY_DEFINED +#else +#define yyget_extra s1_get_extra +#endif + +#ifdef yyset_extra +#define s1_set_extra_ALREADY_DEFINED +#else +#define yyset_extra s1_set_extra +#endif + +#ifdef yyget_in +#define s1_get_in_ALREADY_DEFINED +#else +#define yyget_in s1_get_in +#endif + +#ifdef yyset_in +#define s1_set_in_ALREADY_DEFINED +#else +#define yyset_in s1_set_in +#endif + +#ifdef yyget_out +#define s1_get_out_ALREADY_DEFINED +#else +#define yyget_out s1_get_out +#endif + +#ifdef yyset_out +#define s1_set_out_ALREADY_DEFINED +#else +#define yyset_out s1_set_out +#endif + +#ifdef yyget_leng +#define s1_get_leng_ALREADY_DEFINED +#else +#define yyget_leng s1_get_leng +#endif + +#ifdef yyget_text +#define s1_get_text_ALREADY_DEFINED +#else +#define yyget_text s1_get_text +#endif + +#ifdef yyget_lineno +#define s1_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno s1_get_lineno +#endif + +#ifdef yyset_lineno +#define s1_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno s1_set_lineno +#endif + +#ifdef yyget_column +#define s1_get_column_ALREADY_DEFINED +#else +#define yyget_column s1_get_column +#endif + +#ifdef yyset_column +#define s1_set_column_ALREADY_DEFINED +#else +#define yyset_column s1_set_column +#endif + +#ifdef yywrap +#define s1_wrap_ALREADY_DEFINED +#else +#define yywrap s1_wrap +#endif + +#ifdef yyalloc +#define s1_alloc_ALREADY_DEFINED +#else +#define yyalloc s1_alloc +#endif + +#ifdef yyrealloc +#define s1_realloc_ALREADY_DEFINED +#else +#define yyrealloc s1_realloc +#endif + +#ifdef yyfree +#define s1_free_ALREADY_DEFINED +#else +#define yyfree s1_free +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. + */ +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yyg->yy_start = 1 + 2 * +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yyg->yy_start - 1) / 2) +#define YYSTATE YY_START +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +#define yy_new_buffer yy_create_buffer +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define s1_wrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; + +typedef int yy_state_type; + +#define yytext_ptr yytext_r + +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yyg->yy_c_buf_p = yy_cp; +#define YY_NUM_RULES 97 +#define YY_END_OF_BUFFER 98 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[286] = + { 0, + 0, 0, 0, 0, 0, 0, 98, 96, 1, 2, + 85, 96, 96, 84, 88, 96, 46, 47, 82, 80, + 52, 81, 53, 83, 95, 55, 56, 69, 79, 70, + 91, 50, 51, 89, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 48, + 87, 49, 86, 5, 6, 5, 9, 10, 9, 66, + 0, 93, 0, 0, 0, 0, 75, 0, 64, 0, + 77, 0, 0, 73, 57, 71, 58, 72, 94, 8, + 4, 3, 74, 94, 95, 0, 0, 54, 61, 67, + 65, 68, 62, 91, 78, 91, 91, 91, 91, 91, + + 91, 91, 91, 91, 91, 91, 22, 27, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 76, + 63, 7, 11, 0, 93, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 0, 93, 0, 94, 3, 94, + 94, 90, 59, 60, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 25, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 0, 0, + 0, 0, 92, 0, 0, 92, 0, 44, 91, 37, + 29, 91, 91, 91, 23, 91, 91, 91, 42, 91, + 91, 91, 43, 41, 91, 91, 91, 38, 91, 17, + + 91, 0, 0, 0, 31, 91, 91, 91, 15, 39, + 91, 45, 91, 91, 91, 91, 91, 91, 91, 91, + 24, 0, 0, 0, 91, 91, 91, 91, 16, 33, + 28, 91, 34, 91, 91, 91, 0, 0, 0, 91, + 91, 30, 26, 91, 91, 91, 91, 0, 12, 0, + 91, 32, 91, 91, 91, 18, 14, 0, 91, 91, + 40, 21, 91, 91, 0, 91, 36, 91, 91, 0, + 35, 91, 91, 0, 91, 91, 0, 91, 19, 0, + 91, 13, 91, 20, 0 + } ; + +static const YY_CHAR yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 5, 6, 1, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, + 22, 23, 1, 1, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 25, 26, 27, 28, 29, 1, 30, 31, 32, 33, + + 34, 35, 36, 37, 38, 24, 39, 40, 41, 42, + 43, 24, 24, 44, 45, 46, 47, 48, 49, 24, + 50, 51, 52, 53, 54, 55, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static const YY_CHAR yy_meta[56] = + { 0, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 1, 4, 1, 1, + 1, 1, 1, 4, 1, 5, 1, 1, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 1, 1, 1, 1 + } ; + +static const flex_int16_t yy_base[300] = + { 0, + 0, 0, 53, 54, 55, 56, 540, 541, 541, 541, + 517, 55, 33, 516, 64, 58, 541, 541, 515, 55, + 541, 60, 518, 73, 71, 516, 541, 70, 512, 71, + 507, 541, 541, 510, 57, 44, 70, 72, 75, 78, + 48, 76, 86, 79, 90, 93, 88, 84, 103, 541, + 81, 541, 541, 541, 541, 514, 541, 541, 513, 541, + 104, 541, 132, 487, 486, 482, 541, 118, 541, 119, + 541, 127, 138, 541, 541, 541, 541, 541, 120, 541, + 541, 0, 541, 121, 133, 134, 0, 541, 504, 541, + 541, 541, 503, 498, 541, 38, 120, 117, 135, 126, + + 137, 122, 143, 139, 140, 144, 497, 496, 145, 148, + 149, 151, 152, 154, 160, 155, 156, 161, 162, 541, + 541, 541, 541, 185, 191, 202, 483, 488, 481, 192, + 541, 203, 200, 207, 204, 205, 212, 541, 0, 201, + 541, 492, 541, 541, 186, 194, 197, 206, 199, 196, + 215, 209, 208, 218, 220, 221, 222, 223, 224, 227, + 226, 231, 233, 232, 238, 239, 241, 242, 476, 476, + 473, 264, 265, 271, 266, 270, 277, 488, 255, 487, + 486, 262, 263, 257, 485, 258, 259, 272, 484, 273, + 279, 157, 483, 482, 280, 281, 285, 481, 282, 283, + + 290, 460, 458, 468, 477, 284, 293, 294, 476, 475, + 296, 474, 295, 297, 299, 300, 305, 306, 307, 314, + 473, 454, 464, 467, 316, 315, 317, 320, 469, 468, + 467, 321, 466, 322, 324, 329, 457, 456, 459, 323, + 332, 462, 461, 334, 344, 330, 333, 452, 541, 443, + 346, 458, 349, 348, 350, 351, 541, 445, 357, 356, + 456, 455, 359, 364, 426, 362, 393, 367, 365, 372, + 391, 372, 370, 371, 373, 375, 380, 374, 384, 372, + 378, 541, 383, 379, 541, 420, 425, 430, 435, 438, + 440, 445, 450, 455, 460, 465, 357, 470, 475 + + } ; + +static const flex_int16_t yy_def[300] = + { 0, + 285, 1, 286, 286, 287, 287, 285, 285, 285, 285, + 285, 288, 285, 285, 285, 289, 285, 285, 285, 285, + 285, 285, 285, 285, 290, 285, 285, 285, 285, 285, + 291, 285, 285, 285, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 288, 285, 292, 285, 285, 285, 285, 293, 285, 294, + 285, 289, 295, 285, 285, 285, 285, 285, 285, 285, + 285, 296, 285, 285, 290, 290, 297, 285, 285, 285, + 285, 285, 285, 291, 285, 291, 291, 291, 291, 291, + + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 285, + 285, 285, 285, 288, 288, 292, 285, 285, 285, 293, + 285, 298, 294, 299, 289, 289, 295, 285, 296, 285, + 285, 297, 285, 285, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 285, 285, + 285, 293, 293, 298, 294, 294, 299, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + + 291, 285, 285, 285, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 285, 285, 285, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 285, 285, 285, 291, + 291, 291, 291, 291, 291, 291, 291, 285, 285, 285, + 291, 291, 291, 291, 291, 291, 285, 285, 291, 291, + 291, 291, 291, 291, 285, 291, 291, 291, 291, 285, + 291, 291, 291, 285, 291, 291, 285, 291, 291, 285, + 291, 285, 291, 291, 0, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285 + + } ; + +static const flex_int16_t yy_nxt[597] = + { 0, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 8, 33, 34, 31, 35, + 36, 37, 38, 39, 40, 41, 31, 42, 31, 43, + 31, 44, 31, 45, 46, 47, 48, 31, 49, 31, + 31, 50, 51, 52, 53, 55, 55, 58, 58, 62, + 59, 59, 64, 87, 56, 56, 62, 75, 68, 87, + 65, 69, 70, 87, 77, 145, 76, 106, 80, 66, + 63, 78, 87, 73, 81, 71, 84, 97, 85, 82, + 89, 90, 92, 93, 83, 87, 87, 87, 96, 98, + + 87, 87, 120, 87, 87, 101, 99, 104, 62, 87, + 107, 87, 100, 87, 102, 87, 103, 108, 87, 109, + 105, 110, 131, 111, 115, 117, 112, 131, 87, 63, + 113, 116, 118, 121, 61, 62, 125, 79, 140, 119, + 72, 114, 87, 132, 134, 87, 136, 87, 84, 285, + 85, 87, 73, 146, 138, 141, 147, 126, 87, 87, + 87, 148, 87, 137, 87, 87, 152, 150, 87, 87, + 87, 151, 149, 87, 87, 153, 87, 87, 154, 87, + 87, 87, 87, 155, 156, 87, 87, 87, 166, 62, + 160, 162, 157, 158, 159, 62, 131, 163, 167, 168, + + 214, 165, 161, 164, 61, 130, 125, 173, 131, 133, + 63, 87, 62, 62, 72, 176, 63, 132, 140, 87, + 136, 87, 87, 179, 87, 134, 178, 126, 174, 73, + 73, 87, 177, 87, 87, 141, 180, 137, 182, 181, + 87, 183, 185, 87, 184, 87, 87, 87, 87, 87, + 186, 87, 87, 188, 189, 190, 87, 87, 87, 194, + 191, 193, 187, 87, 87, 197, 87, 87, 131, 131, + 192, 198, 199, 130, 131, 173, 195, 196, 131, 133, + 87, 201, 87, 87, 87, 176, 200, 87, 87, 132, + 132, 134, 210, 205, 206, 134, 174, 87, 87, 209, + + 207, 211, 177, 208, 87, 87, 87, 87, 87, 87, + 87, 215, 212, 213, 217, 87, 218, 219, 87, 87, + 87, 87, 87, 221, 87, 87, 216, 228, 220, 225, + 87, 87, 87, 227, 226, 231, 232, 233, 230, 87, + 87, 87, 87, 234, 229, 87, 87, 87, 87, 87, + 235, 236, 240, 246, 87, 87, 243, 87, 87, 87, + 142, 241, 242, 245, 244, 252, 251, 253, 247, 87, + 255, 87, 256, 87, 87, 87, 87, 254, 260, 259, + 261, 87, 87, 262, 87, 263, 266, 87, 267, 87, + 87, 264, 87, 269, 271, 87, 272, 87, 87, 87, + + 87, 276, 268, 87, 87, 282, 278, 281, 87, 87, + 273, 279, 275, 280, 277, 284, 87, 274, 87, 283, + 54, 54, 54, 54, 54, 57, 57, 57, 57, 57, + 61, 61, 61, 61, 61, 72, 72, 72, 72, 72, + 86, 86, 86, 94, 94, 124, 124, 124, 124, 124, + 130, 130, 130, 130, 130, 133, 133, 133, 133, 133, + 135, 135, 135, 135, 135, 139, 270, 139, 139, 139, + 172, 172, 172, 172, 172, 175, 175, 175, 175, 175, + 87, 87, 265, 87, 258, 257, 87, 87, 250, 249, + 248, 87, 87, 87, 87, 239, 238, 237, 87, 87, + + 87, 87, 87, 224, 223, 222, 87, 87, 87, 87, + 87, 87, 87, 87, 204, 203, 202, 87, 171, 170, + 169, 87, 87, 87, 144, 143, 129, 128, 127, 123, + 122, 95, 87, 91, 88, 79, 74, 67, 60, 285, + 7, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285 + + } ; + +static const flex_int16_t yy_chk[597] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 4, 5, 6, 12, + 5, 6, 13, 96, 3, 4, 16, 20, 15, 36, + 13, 15, 15, 41, 22, 96, 20, 41, 24, 13, + 12, 22, 35, 16, 24, 15, 25, 36, 25, 24, + 28, 28, 30, 30, 24, 37, 25, 38, 35, 37, + + 39, 42, 51, 40, 44, 38, 37, 40, 61, 48, + 42, 43, 37, 47, 39, 45, 39, 42, 46, 43, + 40, 44, 68, 45, 47, 48, 46, 70, 49, 61, + 46, 47, 49, 51, 63, 72, 63, 79, 84, 49, + 73, 46, 98, 68, 70, 97, 73, 102, 85, 86, + 85, 100, 72, 97, 79, 84, 98, 63, 85, 86, + 99, 98, 101, 73, 104, 105, 102, 100, 103, 106, + 109, 101, 99, 110, 111, 103, 112, 113, 104, 114, + 116, 117, 192, 105, 106, 115, 118, 119, 117, 124, + 112, 114, 109, 110, 111, 125, 130, 115, 118, 119, + + 192, 116, 113, 115, 126, 132, 126, 132, 133, 134, + 124, 145, 135, 136, 137, 134, 125, 130, 140, 146, + 137, 150, 147, 146, 149, 133, 145, 126, 132, 135, + 136, 148, 134, 153, 152, 140, 147, 137, 149, 148, + 151, 150, 152, 154, 151, 155, 156, 157, 158, 159, + 153, 161, 160, 155, 156, 157, 162, 164, 163, 161, + 158, 160, 154, 165, 166, 164, 167, 168, 172, 173, + 159, 165, 166, 174, 175, 174, 162, 163, 176, 177, + 179, 168, 184, 186, 187, 177, 167, 182, 183, 172, + 173, 175, 187, 179, 182, 176, 174, 188, 190, 186, + + 183, 188, 177, 184, 191, 195, 196, 199, 200, 206, + 197, 195, 190, 191, 197, 201, 199, 200, 207, 208, + 213, 211, 214, 201, 215, 216, 196, 211, 200, 206, + 217, 218, 219, 208, 207, 215, 216, 217, 214, 220, + 226, 225, 227, 218, 213, 228, 232, 234, 240, 235, + 219, 220, 225, 235, 236, 246, 228, 241, 247, 244, + 297, 226, 227, 234, 232, 241, 240, 244, 236, 245, + 246, 251, 247, 254, 253, 255, 256, 245, 253, 251, + 254, 260, 259, 255, 263, 256, 259, 266, 260, 264, + 269, 256, 268, 264, 266, 273, 268, 272, 275, 278, + + 276, 273, 263, 281, 284, 280, 275, 278, 283, 279, + 269, 276, 272, 277, 274, 283, 271, 270, 267, 281, + 286, 286, 286, 286, 286, 287, 287, 287, 287, 287, + 288, 288, 288, 288, 288, 289, 289, 289, 289, 289, + 290, 290, 290, 291, 291, 292, 292, 292, 292, 292, + 293, 293, 293, 293, 293, 294, 294, 294, 294, 294, + 295, 295, 295, 295, 295, 296, 265, 296, 296, 296, + 298, 298, 298, 298, 298, 299, 299, 299, 299, 299, + 262, 261, 258, 252, 250, 248, 243, 242, 239, 238, + 237, 233, 231, 230, 229, 224, 223, 222, 221, 212, + + 210, 209, 205, 204, 203, 202, 198, 194, 193, 189, + 185, 181, 180, 178, 171, 170, 169, 142, 129, 128, + 127, 108, 107, 94, 93, 89, 66, 65, 64, 59, + 56, 34, 31, 29, 26, 23, 19, 14, 11, 7, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285 + + } ; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +#line 1 "lexer.lpp" +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ +#define YY_NO_INPUT 1 +#define YY_NO_UNISTD_H 1 + +#line 23 "lexer.lpp" +#define YY_USER_ACTION loc.columns(yyleng); +#line 874 "lexer.cpp" + +#line 876 "lexer.cpp" + +#define INITIAL 0 +#define COMMENT_BLOCK_STATE 1 +#define DEVELOPER_BLOCK_STATE 2 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +/* Holds the entire state of the reentrant scanner. */ +struct yyguts_t + { + + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; + + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + int yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + int yylineno_r; + int yy_flex_debug_r; + + char *yytext_r; + int yy_more_flag; + int yy_more_len; + + }; /* end struct yyguts_t */ + +static int yy_init_globals ( yyscan_t yyscanner ); + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput ( yyscan_t yyscanner ); +#else +static int input ( yyscan_t yyscanner ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + int n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK /*LINTED*/break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_load_buffer_state( yyscanner ); + } + + { +#line 36 "lexer.lpp" + + + +#line 40 "lexer.lpp" + loc.step(); + + +#line 1144 "lexer.cpp" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yyg->yy_start; +yy_match: + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 286 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + ++yy_cp; + } + while ( yy_current_state != 285 ); + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 43 "lexer.lpp" +{ loc.step(); } + YY_BREAK +case 2: +/* rule 2 can match eol */ +YY_RULE_SETUP +#line 45 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 47 "lexer.lpp" + + YY_BREAK +case 4: +YY_RULE_SETUP +#line 49 "lexer.lpp" +{ BEGIN(COMMENT_BLOCK_STATE); } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 50 "lexer.lpp" + + YY_BREAK +case 6: +/* rule 6 can match eol */ +YY_RULE_SETUP +#line 51 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 52 "lexer.lpp" +{ BEGIN(INITIAL); } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 54 "lexer.lpp" +{ BEGIN(DEVELOPER_BLOCK_STATE); } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 55 "lexer.lpp" + + YY_BREAK +case 10: +/* rule 10 can match eol */ +YY_RULE_SETUP +#line 56 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 57 "lexer.lpp" +{ BEGIN(INITIAL); } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 59 "lexer.lpp" +{ return s1::parser::make_INCLUDE(loc); } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 60 "lexer.lpp" +{ return s1::parser::make_USINGTREE(loc); } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 61 "lexer.lpp" +{ return s1::parser::make_ANIMTREE(loc); } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 62 "lexer.lpp" +{ return s1::parser::make_ENDON(loc); } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 63 "lexer.lpp" +{ return s1::parser::make_NOTIFY(loc); } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 64 "lexer.lpp" +{ return s1::parser::make_WAIT(loc); } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 65 "lexer.lpp" +{ return s1::parser::make_WAITTILL(loc); } + YY_BREAK +case 19: +YY_RULE_SETUP +#line 66 "lexer.lpp" +{ return s1::parser::make_WAITTILLMATCH(loc); } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 67 "lexer.lpp" +{ return s1::parser::make_WAITTILLFRAMEEND(loc); } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 68 "lexer.lpp" +{ return s1::parser::make_WAITFRAME(loc); } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 69 "lexer.lpp" +{ return s1::parser::make_IF(loc); } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 70 "lexer.lpp" +{ return s1::parser::make_ELSE(loc); } + YY_BREAK +case 24: +YY_RULE_SETUP +#line 71 "lexer.lpp" +{ return s1::parser::make_WHILE(loc); } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 72 "lexer.lpp" +{ return s1::parser::make_FOR(loc); } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 73 "lexer.lpp" +{ return s1::parser::make_FOREACH(loc); } + YY_BREAK +case 27: +YY_RULE_SETUP +#line 74 "lexer.lpp" +{ return s1::parser::make_IN(loc); } + YY_BREAK +case 28: +YY_RULE_SETUP +#line 75 "lexer.lpp" +{ return s1::parser::make_SWITCH(loc); } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 76 "lexer.lpp" +{ return s1::parser::make_CASE(loc); } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 77 "lexer.lpp" +{ return s1::parser::make_DEFAULT(loc); } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 78 "lexer.lpp" +{ return s1::parser::make_BREAK(loc); } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 79 "lexer.lpp" +{ return s1::parser::make_CONTINUE(loc); } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 80 "lexer.lpp" +{ return s1::parser::make_RETURN(loc); } + YY_BREAK +case 34: +YY_RULE_SETUP +#line 81 "lexer.lpp" +{ return s1::parser::make_THREAD(loc); } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 82 "lexer.lpp" +{ return s1::parser::make_CHILDTHREAD(loc); } + YY_BREAK +case 36: +YY_RULE_SETUP +#line 83 "lexer.lpp" +{ return s1::parser::make_THISTHREAD(loc); } + YY_BREAK +case 37: +YY_RULE_SETUP +#line 84 "lexer.lpp" +{ return s1::parser::make_CALL(loc); } + YY_BREAK +case 38: +YY_RULE_SETUP +#line 85 "lexer.lpp" +{ return s1::parser::make_TRUE(loc); } + YY_BREAK +case 39: +YY_RULE_SETUP +#line 86 "lexer.lpp" +{ return s1::parser::make_FALSE(loc); } + YY_BREAK +case 40: +YY_RULE_SETUP +#line 87 "lexer.lpp" +{ return s1::parser::make_UNDEFINED(loc); } + YY_BREAK +case 41: +YY_RULE_SETUP +#line 88 "lexer.lpp" +{ return s1::parser::make_SIZE(loc); } + YY_BREAK +case 42: +YY_RULE_SETUP +#line 89 "lexer.lpp" +{ return s1::parser::make_GAME(loc); } + YY_BREAK +case 43: +YY_RULE_SETUP +#line 90 "lexer.lpp" +{ return s1::parser::make_SELF(loc); } + YY_BREAK +case 44: +YY_RULE_SETUP +#line 91 "lexer.lpp" +{ return s1::parser::make_ANIM(loc); } + YY_BREAK +case 45: +YY_RULE_SETUP +#line 92 "lexer.lpp" +{ return s1::parser::make_LEVEL(loc); } + YY_BREAK +case 46: +YY_RULE_SETUP +#line 93 "lexer.lpp" +{ return s1::parser::make_LPAREN(loc); } + YY_BREAK +case 47: +YY_RULE_SETUP +#line 94 "lexer.lpp" +{ return s1::parser::make_RPAREN(loc); } + YY_BREAK +case 48: +YY_RULE_SETUP +#line 95 "lexer.lpp" +{ return s1::parser::make_LBRACE(loc); } + YY_BREAK +case 49: +YY_RULE_SETUP +#line 96 "lexer.lpp" +{ return s1::parser::make_RBRACE(loc); } + YY_BREAK +case 50: +YY_RULE_SETUP +#line 97 "lexer.lpp" +{ return s1::parser::make_LBRACKET(loc); } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 98 "lexer.lpp" +{ return s1::parser::make_RBRACKET(loc); } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 99 "lexer.lpp" +{ return s1::parser::make_COMMA(loc); } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 100 "lexer.lpp" +{ return s1::parser::make_DOT(loc); } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 101 "lexer.lpp" +{ return s1::parser::make_DOUBLECOLON(loc); } + YY_BREAK +case 55: +YY_RULE_SETUP +#line 102 "lexer.lpp" +{ return s1::parser::make_COLON(loc); } + YY_BREAK +case 56: +YY_RULE_SETUP +#line 103 "lexer.lpp" +{ return s1::parser::make_SEMICOLON(loc); } + YY_BREAK +case 57: +YY_RULE_SETUP +#line 104 "lexer.lpp" +{ return s1::parser::make_INCREMENT(loc); } + YY_BREAK +case 58: +YY_RULE_SETUP +#line 105 "lexer.lpp" +{ return s1::parser::make_DECREMENT(loc); } + YY_BREAK +case 59: +YY_RULE_SETUP +#line 106 "lexer.lpp" +{ return s1::parser::make_ASSIGN_LSHIFT(loc); } + YY_BREAK +case 60: +YY_RULE_SETUP +#line 107 "lexer.lpp" +{ return s1::parser::make_ASSIGN_RSHIFT(loc); } + YY_BREAK +case 61: +YY_RULE_SETUP +#line 108 "lexer.lpp" +{ return s1::parser::make_LSHIFT(loc); } + YY_BREAK +case 62: +YY_RULE_SETUP +#line 109 "lexer.lpp" +{ return s1::parser::make_RSHIFT(loc); } + YY_BREAK +case 63: +YY_RULE_SETUP +#line 110 "lexer.lpp" +{ return s1::parser::make_OR(loc); } + YY_BREAK +case 64: +YY_RULE_SETUP +#line 111 "lexer.lpp" +{ return s1::parser::make_AND(loc); } + YY_BREAK +case 65: +YY_RULE_SETUP +#line 112 "lexer.lpp" +{ return s1::parser::make_EQUALITY(loc); } + YY_BREAK +case 66: +YY_RULE_SETUP +#line 113 "lexer.lpp" +{ return s1::parser::make_INEQUALITY(loc); } + YY_BREAK +case 67: +YY_RULE_SETUP +#line 114 "lexer.lpp" +{ return s1::parser::make_LESS_EQUAL(loc); } + YY_BREAK +case 68: +YY_RULE_SETUP +#line 115 "lexer.lpp" +{ return s1::parser::make_GREATER_EQUAL(loc); } + YY_BREAK +case 69: +YY_RULE_SETUP +#line 116 "lexer.lpp" +{ return s1::parser::make_LESS(loc); } + YY_BREAK +case 70: +YY_RULE_SETUP +#line 117 "lexer.lpp" +{ return s1::parser::make_GREATER(loc); } + YY_BREAK +case 71: +YY_RULE_SETUP +#line 118 "lexer.lpp" +{ return s1::parser::make_ASSIGN_ADD(loc); } + YY_BREAK +case 72: +YY_RULE_SETUP +#line 119 "lexer.lpp" +{ return s1::parser::make_ASSIGN_SUB(loc); } + YY_BREAK +case 73: +YY_RULE_SETUP +#line 120 "lexer.lpp" +{ return s1::parser::make_ASSIGN_MULT(loc); } + YY_BREAK +case 74: +YY_RULE_SETUP +#line 121 "lexer.lpp" +{ return s1::parser::make_ASSIGN_DIV(loc); } + YY_BREAK +case 75: +YY_RULE_SETUP +#line 122 "lexer.lpp" +{ return s1::parser::make_ASSIGN_MOD(loc); } + YY_BREAK +case 76: +YY_RULE_SETUP +#line 123 "lexer.lpp" +{ return s1::parser::make_ASSIGN_BITWISE_OR(loc); } + YY_BREAK +case 77: +YY_RULE_SETUP +#line 124 "lexer.lpp" +{ return s1::parser::make_ASSIGN_BITWISE_AND(loc); } + YY_BREAK +case 78: +YY_RULE_SETUP +#line 125 "lexer.lpp" +{ return s1::parser::make_ASSIGN_BITWISE_EXOR(loc); } + YY_BREAK +case 79: +YY_RULE_SETUP +#line 126 "lexer.lpp" +{ return s1::parser::make_ASSIGN(loc); } + YY_BREAK +case 80: +YY_RULE_SETUP +#line 127 "lexer.lpp" +{ return s1::parser::make_ADD(loc); } + YY_BREAK +case 81: +YY_RULE_SETUP +#line 128 "lexer.lpp" +{ return s1::parser::make_SUB(loc); } + YY_BREAK +case 82: +YY_RULE_SETUP +#line 129 "lexer.lpp" +{ return s1::parser::make_MULT(loc); } + YY_BREAK +case 83: +YY_RULE_SETUP +#line 130 "lexer.lpp" +{ return s1::parser::make_DIV(loc); } + YY_BREAK +case 84: +YY_RULE_SETUP +#line 131 "lexer.lpp" +{ return s1::parser::make_MOD(loc); } + YY_BREAK +case 85: +YY_RULE_SETUP +#line 132 "lexer.lpp" +{ return s1::parser::make_NOT(loc); } + YY_BREAK +case 86: +YY_RULE_SETUP +#line 133 "lexer.lpp" +{ return s1::parser::make_COMPLEMENT(loc); } + YY_BREAK +case 87: +YY_RULE_SETUP +#line 134 "lexer.lpp" +{ return s1::parser::make_BITWISE_OR(loc); } + YY_BREAK +case 88: +YY_RULE_SETUP +#line 135 "lexer.lpp" +{ return s1::parser::make_BITWISE_AND(loc); } + YY_BREAK +case 89: +YY_RULE_SETUP +#line 136 "lexer.lpp" +{ return s1::parser::make_BITWISE_EXOR(loc); } + YY_BREAK +case 90: +YY_RULE_SETUP +#line 137 "lexer.lpp" +{ return s1::parser::make_FILE(utils::string::fordslash(yytext), loc); } + YY_BREAK +case 91: +YY_RULE_SETUP +#line 138 "lexer.lpp" +{ return s1::parser::make_NAME((std::string(yytext, 3) == "_ID") ? std::string(yytext) : utils::string::to_lower(yytext), loc); } + YY_BREAK +case 92: +/* rule 92 can match eol */ +YY_RULE_SETUP +#line 139 "lexer.lpp" +{ return s1::parser::make_ISTRING(std::string(yytext).substr(1), loc); } + YY_BREAK +case 93: +/* rule 93 can match eol */ +YY_RULE_SETUP +#line 140 "lexer.lpp" +{ return s1::parser::make_STRING(std::string(yytext), loc); } + YY_BREAK +case 94: +YY_RULE_SETUP +#line 141 "lexer.lpp" +{ return s1::parser::make_FLOAT(std::string(yytext), loc); } + YY_BREAK +case 95: +YY_RULE_SETUP +#line 142 "lexer.lpp" +{ return s1::parser::make_INTEGER(std::string(yytext), loc); } + YY_BREAK +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(COMMENT_BLOCK_STATE): +case YY_STATE_EOF(DEVELOPER_BLOCK_STATE): +#line 143 "lexer.lpp" +{ return s1::parser::make_S1EOF(loc); } + YY_BREAK +case 96: +/* rule 96 can match eol */ +YY_RULE_SETUP +#line 144 "lexer.lpp" +{ throw s1::parser::syntax_error(loc, "bad token: \'" + std::string(yytext) + "\'"); } + YY_BREAK +case 97: +YY_RULE_SETUP +#line 146 "lexer.lpp" +ECHO; + YY_BREAK +#line 1694 "lexer.cpp" + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( yywrap( yyscanner ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + yyg->yy_n_chars, num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin , yyscanner); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) +{ + yy_state_type yy_current_state; + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_current_state = yyg->yy_start; + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 286 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) +{ + int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + char *yy_cp = yyg->yy_c_buf_p; + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 286 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 285); + + (void)yyg; + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (yyscan_t yyscanner) +#else + static int input (yyscan_t yyscanner) +#endif + +{ + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin , yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( yyscanner ) ) + return 0; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(yyscanner); +#else + return input(yyscanner); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * @param yyscanner The scanner object. + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * @param yyscanner The scanner object. + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( yyscanner ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yyg->yy_did_buffer_switch_on_eof = 1; +} + +static void yy_load_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyg->yy_hold_char = *yyg->yy_c_buf_p; +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * @param yyscanner The scanner object. + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file , yyscanner); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * @param yyscanner The scanner object. + */ + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf , yyscanner ); + + yyfree( (void *) b , yyscanner ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + +{ + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_flush_buffer( b , yyscanner); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param yyscanner The scanner object. + */ + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( yyscanner ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * @param yyscanner The scanner object. + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(yyscanner); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * @param yyscanner The scanner object. + */ +void yypop_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (yyscan_t yyscanner) +{ + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (!yyg->yy_buffer_stack) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->yy_buffer_stack_max = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b , yyscanner ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n , yyscanner); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the user-defined data for this scanner. + * @param yyscanner The scanner object. + */ +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; +} + +/** Get the current line number. + * @param yyscanner The scanner object. + */ +int yyget_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; +} + +/** Get the current column number. + * @param yyscanner The scanner object. + */ +int yyget_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; +} + +/** Get the input stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; +} + +/** Get the output stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; +} + +/** Get the length of the current token. + * @param yyscanner The scanner object. + */ +int yyget_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; +} + +/** Get the current token. + * @param yyscanner The scanner object. + */ + +char *yyget_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; +} + +/** Set the user-defined data. This data is never touched by the scanner. + * @param user_defined The data to be associated with this scanner. + * @param yyscanner The scanner object. + */ +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; +} + +/** Set the current line number. + * @param _line_number line number + * @param yyscanner The scanner object. + */ +void yyset_lineno (int _line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + + yylineno = _line_number; +} + +/** Set the current column. + * @param _column_no column number + * @param yyscanner The scanner object. + */ +void yyset_column (int _column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + + yycolumn = _column_no; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * @param yyscanner The scanner object. + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * _in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; +} + +void yyset_out (FILE * _out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; +} + +int yyget_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; +} + +void yyset_debug (int _bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; +} + +/* Accessor methods for yylval and yylloc */ + +/* User-visible API */ + +/* yylex_init is special because it creates the scanner itself, so it is + * the ONLY reentrant function that doesn't take the scanner as the last argument. + * That's why we explicitly handle the declaration, instead of using our macros. + */ +int yylex_init(yyscan_t* ptr_yy_globals) +{ + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + return yy_init_globals ( *ptr_yy_globals ); +} + +/* yylex_init_extra has the same functionality as yylex_init, but follows the + * convention of taking the scanner as the last argument. Note however, that + * this is a *pointer* to a scanner, as it will be allocated by this call (and + * is the reason, too, why this function also must handle its own declaration). + * The user defined value in the first argument will be available to yyalloc in + * the yyextra field. + */ +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) +{ + struct yyguts_t dummy_yyguts; + + yyset_extra (yy_user_defined, &dummy_yyguts); + + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + yyset_extra (yy_user_defined, *ptr_yy_globals); + + return yy_init_globals ( *ptr_yy_globals ); +} + +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + yyg->yy_buffer_stack = NULL; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = NULL; + yyg->yy_init = 0; + yyg->yy_start = 0; + + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = NULL; + yyout = NULL; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(yyscanner); + } + + /* Destroy the stack itself. */ + yyfree(yyg->yy_buffer_stack , yyscanner); + yyg->yy_buffer_stack = NULL; + + /* Destroy the start condition stack. */ + yyfree( yyg->yy_start_stack , yyscanner ); + yyg->yy_start_stack = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( yyscanner); + + /* Destroy the main struct (reentrant only). */ + yyfree ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); +} + +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); +} + +void yyfree (void * ptr , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 146 "lexer.lpp" + + diff --git a/src/s1/xsk/lexer.hpp b/src/s1/xsk/lexer.hpp new file mode 100644 index 00000000..6d8b6a37 --- /dev/null +++ b/src/s1/xsk/lexer.hpp @@ -0,0 +1,708 @@ +#ifndef s1_HEADER_H +#define s1_HEADER_H 1 +#define s1_IN_HEADER 1 + +#line 5 "lexer.hpp" +#include "stdafx.hpp" +#include "s1.hpp" +#include "parser.hpp" +using namespace xsk::gsc; + +#line 11 "lexer.hpp" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define s1__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer s1__create_buffer +#endif + +#ifdef yy_delete_buffer +#define s1__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer s1__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define s1__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer s1__scan_buffer +#endif + +#ifdef yy_scan_string +#define s1__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string s1__scan_string +#endif + +#ifdef yy_scan_bytes +#define s1__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes s1__scan_bytes +#endif + +#ifdef yy_init_buffer +#define s1__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer s1__init_buffer +#endif + +#ifdef yy_flush_buffer +#define s1__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer s1__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define s1__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state s1__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define s1__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer s1__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define s1_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state s1_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define s1_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state s1_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define s1_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack s1_ensure_buffer_stack +#endif + +#ifdef yylex +#define s1_lex_ALREADY_DEFINED +#else +#define yylex s1_lex +#endif + +#ifdef yyrestart +#define s1_restart_ALREADY_DEFINED +#else +#define yyrestart s1_restart +#endif + +#ifdef yylex_init +#define s1_lex_init_ALREADY_DEFINED +#else +#define yylex_init s1_lex_init +#endif + +#ifdef yylex_init_extra +#define s1_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra s1_lex_init_extra +#endif + +#ifdef yylex_destroy +#define s1_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy s1_lex_destroy +#endif + +#ifdef yyget_debug +#define s1_get_debug_ALREADY_DEFINED +#else +#define yyget_debug s1_get_debug +#endif + +#ifdef yyset_debug +#define s1_set_debug_ALREADY_DEFINED +#else +#define yyset_debug s1_set_debug +#endif + +#ifdef yyget_extra +#define s1_get_extra_ALREADY_DEFINED +#else +#define yyget_extra s1_get_extra +#endif + +#ifdef yyset_extra +#define s1_set_extra_ALREADY_DEFINED +#else +#define yyset_extra s1_set_extra +#endif + +#ifdef yyget_in +#define s1_get_in_ALREADY_DEFINED +#else +#define yyget_in s1_get_in +#endif + +#ifdef yyset_in +#define s1_set_in_ALREADY_DEFINED +#else +#define yyset_in s1_set_in +#endif + +#ifdef yyget_out +#define s1_get_out_ALREADY_DEFINED +#else +#define yyget_out s1_get_out +#endif + +#ifdef yyset_out +#define s1_set_out_ALREADY_DEFINED +#else +#define yyset_out s1_set_out +#endif + +#ifdef yyget_leng +#define s1_get_leng_ALREADY_DEFINED +#else +#define yyget_leng s1_get_leng +#endif + +#ifdef yyget_text +#define s1_get_text_ALREADY_DEFINED +#else +#define yyget_text s1_get_text +#endif + +#ifdef yyget_lineno +#define s1_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno s1_get_lineno +#endif + +#ifdef yyset_lineno +#define s1_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno s1_set_lineno +#endif + +#ifdef yyget_column +#define s1_get_column_ALREADY_DEFINED +#else +#define yyget_column s1_get_column +#endif + +#ifdef yyset_column +#define s1_set_column_ALREADY_DEFINED +#else +#define yyset_column s1_set_column +#endif + +#ifdef yywrap +#define s1_wrap_ALREADY_DEFINED +#else +#define yywrap s1_wrap +#endif + +#ifdef yyalloc +#define s1_alloc_ALREADY_DEFINED +#else +#define yyalloc s1_alloc +#endif + +#ifdef yyrealloc +#define s1_realloc_ALREADY_DEFINED +#else +#define yyrealloc s1_realloc +#endif + +#ifdef yyfree +#define s1_free_ALREADY_DEFINED +#else +#define yyfree s1_free +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +/* Begin user sect3 */ + +#define s1_wrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP + +#define yytext_ptr yytext_r + +#ifdef YY_HEADER_EXPORT_START_CONDITIONS +#define INITIAL 0 +#define COMMENT_BLOCK_STATE 1 +#define DEVELOPER_BLOCK_STATE 2 + +#endif + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +#undef YY_NEW_FILE +#undef YY_FLUSH_BUFFER +#undef yy_set_bol +#undef yy_new_buffer +#undef yy_set_interactive +#undef YY_DO_BEFORE_ACTION + +#ifdef YY_DECL_IS_OURS +#undef YY_DECL_IS_OURS +#undef YY_DECL +#endif + +#ifndef s1__create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef s1__delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef s1__scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef s1__scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef s1__scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef s1__init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef s1__flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef s1__load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef s1__switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef s1_push_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef s1_pop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef s1_ensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef s1_lex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef s1_restart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef s1_lex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef s1_lex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef s1_lex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef s1_get_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef s1_set_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef s1_get_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef s1_set_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef s1_get_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef s1_set_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef s1_get_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef s1_set_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef s1_get_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef s1_get_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef s1_get_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef s1_set_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef s1_get_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef s1_set_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef s1_wrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef s1_get_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef s1_set_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef s1_get_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef s1_set_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef s1_alloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef s1_realloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef s1_free_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef s1_text_ALREADY_DEFINED +#undef yytext +#endif +#ifndef s1_leng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef s1_in_ALREADY_DEFINED +#undef yyin +#endif +#ifndef s1_out_ALREADY_DEFINED +#undef yyout +#endif +#ifndef s1__flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef s1_lineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef s1_tables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef s1_tables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef s1_TABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + +#line 146 "lexer.lpp" + + +#line 706 "lexer.hpp" +#undef s1_IN_HEADER +#endif /* s1_HEADER_H */ diff --git a/src/s1/xsk/parser.cpp b/src/s1/xsk/parser.cpp new file mode 100644 index 00000000..5245817c --- /dev/null +++ b/src/s1/xsk/parser.cpp @@ -0,0 +1,3994 @@ +// A Bison parser, made by GNU Bison 3.7.5. + +// Skeleton implementation for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. + +// 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 . + +// As a special exception, you may create a larger work that contains +// part or all of the Bison parser skeleton and distribute that work +// under terms of your choice, so long as that work isn't itself a +// parser generator using the skeleton or a modified version thereof +// as a parser skeleton. Alternatively, if you modify or redistribute +// the parser skeleton itself, you may (at your option) remove this +// special exception, which will cause the skeleton and the resulting +// Bison output files to be licensed under the GNU General Public +// License without this special exception. + +// This special exception was added by the Free Software Foundation in +// version 2.2 of Bison. + +// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, +// especially those whose name start with YY_ or yy_. They are +// private implementation details that can be changed or removed. + +// "%code top" blocks. +#line 40 "parser.ypp" + +#include "stdafx.hpp" +#include "parser.hpp" +#include "lexer.hpp" +using namespace xsk::gsc; +xsk::gsc::s1::parser::symbol_type S1lex(yyscan_t yyscanner, xsk::gsc::location& loc); + +#line 47 "parser.cpp" + +// Take the name prefix into account. +#define yylex S1lex + + + +#include "parser.hpp" + + + + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include // FIXME: INFRINGES ON USER NAME SPACE. +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + + +// Whether we are compiled with exception support. +#ifndef YY_EXCEPTIONS +# if defined __GNUC__ && !defined __EXCEPTIONS +# define YY_EXCEPTIONS 0 +# else +# define YY_EXCEPTIONS 1 +# endif +#endif + +#define YYRHSLOC(Rhs, K) ((Rhs)[K].location) +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +# ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).begin = YYRHSLOC (Rhs, 1).begin; \ + (Current).end = YYRHSLOC (Rhs, N).end; \ + } \ + else \ + { \ + (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ + } \ + while (false) +# endif + + +// Enable debugging if requested. +#if S1DEBUG + +// A pseudo ostream that takes yydebug_ into account. +# define YYCDEBUG if (yydebug_) (*yycdebug_) + +# define YY_SYMBOL_PRINT(Title, Symbol) \ + do { \ + if (yydebug_) \ + { \ + *yycdebug_ << Title << ' '; \ + yy_print_ (*yycdebug_, Symbol); \ + *yycdebug_ << '\n'; \ + } \ + } while (false) + +# define YY_REDUCE_PRINT(Rule) \ + do { \ + if (yydebug_) \ + yy_reduce_print_ (Rule); \ + } while (false) + +# define YY_STACK_PRINT() \ + do { \ + if (yydebug_) \ + yy_stack_print_ (); \ + } while (false) + +#else // !S1DEBUG + +# define YYCDEBUG if (false) std::cerr +# define YY_SYMBOL_PRINT(Title, Symbol) YY_USE (Symbol) +# define YY_REDUCE_PRINT(Rule) static_cast (0) +# define YY_STACK_PRINT() static_cast (0) + +#endif // !S1DEBUG + +#define yyerrok (yyerrstatus_ = 0) +#define yyclearin (yyla.clear ()) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYRECOVERING() (!!yyerrstatus_) + +#line 13 "parser.ypp" +namespace xsk { namespace gsc { namespace s1 { +#line 149 "parser.cpp" + + /// Build a parser object. + parser::parser (yyscan_t yyscanner_yyarg, xsk::gsc::location& loc_yyarg, xsk::gsc::program_ptr& ast_yyarg) +#if S1DEBUG + : yydebug_ (false), + yycdebug_ (&std::cerr), +#else + : +#endif + yy_lac_established_ (false), + yyscanner (yyscanner_yyarg), + loc (loc_yyarg), + ast (ast_yyarg) + {} + + parser::~parser () + {} + + parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW + {} + + /*---------------. + | symbol kinds. | + `---------------*/ + + + + // by_state. + parser::by_state::by_state () YY_NOEXCEPT + : state (empty_state) + {} + + parser::by_state::by_state (const by_state& that) YY_NOEXCEPT + : state (that.state) + {} + + void + parser::by_state::clear () YY_NOEXCEPT + { + state = empty_state; + } + + void + parser::by_state::move (by_state& that) + { + state = that.state; + that.clear (); + } + + parser::by_state::by_state (state_type s) YY_NOEXCEPT + : state (s) + {} + + parser::symbol_kind_type + parser::by_state::kind () const YY_NOEXCEPT + { + if (state == empty_state) + return symbol_kind::S_YYEMPTY; + else + return YY_CAST (symbol_kind_type, yystos_[+state]); + } + + parser::stack_symbol_type::stack_symbol_type () + {} + + parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) + : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.YY_MOVE_OR_COPY< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.YY_MOVE_OR_COPY< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.YY_MOVE_OR_COPY< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.YY_MOVE_OR_COPY< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.YY_MOVE_OR_COPY< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.YY_MOVE_OR_COPY< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.YY_MOVE_OR_COPY< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.YY_MOVE_OR_COPY< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.YY_MOVE_OR_COPY< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.YY_MOVE_OR_COPY< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.YY_MOVE_OR_COPY< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.YY_MOVE_OR_COPY< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.YY_MOVE_OR_COPY< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.YY_MOVE_OR_COPY< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.YY_MOVE_OR_COPY< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.YY_MOVE_OR_COPY< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.YY_MOVE_OR_COPY< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.YY_MOVE_OR_COPY< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.YY_MOVE_OR_COPY< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.YY_MOVE_OR_COPY< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.YY_MOVE_OR_COPY< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.YY_MOVE_OR_COPY< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.YY_MOVE_OR_COPY< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.YY_MOVE_OR_COPY< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.YY_MOVE_OR_COPY< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.YY_MOVE_OR_COPY< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.YY_MOVE_OR_COPY< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.YY_MOVE_OR_COPY< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.YY_MOVE_OR_COPY< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.YY_MOVE_OR_COPY< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.YY_MOVE_OR_COPY< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.YY_MOVE_OR_COPY< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.YY_MOVE_OR_COPY< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.YY_MOVE_OR_COPY< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.YY_MOVE_OR_COPY< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.YY_MOVE_OR_COPY< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.YY_MOVE_OR_COPY< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.YY_MOVE_OR_COPY< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.YY_MOVE_OR_COPY< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.YY_MOVE_OR_COPY< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.YY_MOVE_OR_COPY< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.YY_MOVE_OR_COPY< stmt_waitframe_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.YY_MOVE_OR_COPY< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.YY_MOVE_OR_COPY< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.YY_MOVE_OR_COPY< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.YY_MOVE_OR_COPY< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.YY_MOVE_OR_COPY< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.YY_MOVE_OR_COPY< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.YY_MOVE_OR_COPY< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.YY_MOVE_OR_COPY< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.YY_MOVE_OR_COPY< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.YY_MOVE_OR_COPY< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.YY_MOVE_OR_COPY< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + +#if 201103L <= YY_CPLUSPLUS + // that is emptied. + that.state = empty_state; +#endif + } + + parser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that) + : super_type (s, YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + + // that is emptied. + that.kind_ = symbol_kind::S_YYEMPTY; + } + +#if YY_CPLUSPLUS < 201103L + parser::stack_symbol_type& + parser::stack_symbol_type::operator= (const stack_symbol_type& that) + { + state = that.state; + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.copy< anim_ptr > (that.value); + break; + + case symbol_kind::S_animation: // animation + value.copy< animation_ptr > (that.value); + break; + + case symbol_kind::S_animtree: // animtree + value.copy< animtree_ptr > (that.value); + break; + + case symbol_kind::S_constant: // constant + value.copy< constant_ptr > (that.value); + break; + + case symbol_kind::S_define: // define + value.copy< define_ptr > (that.value); + break; + + case symbol_kind::S_empty_array: // empty_array + value.copy< empty_array_ptr > (that.value); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.copy< expr_arguments_ptr > (that.value); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.copy< expr_assign_ptr > (that.value); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.copy< expr_call_ptr > (that.value); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.copy< expr_call_type_ptr > (that.value); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.copy< expr_ptr > (that.value); + break; + + case symbol_kind::S_false: // false + value.copy< false_ptr > (that.value); + break; + + case symbol_kind::S_file: // file + value.copy< file_ptr > (that.value); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.copy< float_ptr > (that.value); + break; + + case symbol_kind::S_game: // game + value.copy< game_ptr > (that.value); + break; + + case symbol_kind::S_include: // include + value.copy< include_ptr > (that.value); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.copy< integer_ptr > (that.value); + break; + + case symbol_kind::S_istring: // istring + value.copy< istring_ptr > (that.value); + break; + + case symbol_kind::S_level: // level + value.copy< level_ptr > (that.value); + break; + + case symbol_kind::S_name: // name + value.copy< name_ptr > (that.value); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.copy< node_ptr > (that.value); + break; + + case symbol_kind::S_parameters: // parameters + value.copy< parameters_ptr > (that.value); + break; + + case symbol_kind::S_program: // program + value.copy< program_ptr > (that.value); + break; + + case symbol_kind::S_self: // self + value.copy< self_ptr > (that.value); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.copy< std::string > (that.value); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.copy< stmt_assign_ptr > (that.value); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.copy< stmt_break_ptr > (that.value); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.copy< stmt_call_ptr > (that.value); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.copy< stmt_case_ptr > (that.value); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.copy< stmt_continue_ptr > (that.value); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.copy< stmt_default_ptr > (that.value); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.copy< stmt_endon_ptr > (that.value); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.copy< stmt_for_ptr > (that.value); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.copy< stmt_foreach_ptr > (that.value); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.copy< stmt_if_ptr > (that.value); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.copy< stmt_ifelse_ptr > (that.value); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.copy< stmt_list_ptr > (that.value); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.copy< stmt_notify_ptr > (that.value); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.copy< stmt_ptr > (that.value); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.copy< stmt_return_ptr > (that.value); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.copy< stmt_switch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.copy< stmt_wait_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.copy< stmt_waitframe_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.copy< stmt_waittill_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.copy< stmt_waittillframeend_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.copy< stmt_waittillmatch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.copy< stmt_while_ptr > (that.value); + break; + + case symbol_kind::S_string: // string + value.copy< string_ptr > (that.value); + break; + + case symbol_kind::S_thisthread: // thisthread + value.copy< thisthread_ptr > (that.value); + break; + + case symbol_kind::S_thread: // thread + value.copy< thread_ptr > (that.value); + break; + + case symbol_kind::S_true: // true + value.copy< true_ptr > (that.value); + break; + + case symbol_kind::S_undefined: // undefined + value.copy< undefined_ptr > (that.value); + break; + + case symbol_kind::S_usingtree: // usingtree + value.copy< usingtree_ptr > (that.value); + break; + + case symbol_kind::S_vector: // vector + value.copy< vector_ptr > (that.value); + break; + + default: + break; + } + + location = that.location; + return *this; + } + + parser::stack_symbol_type& + parser::stack_symbol_type::operator= (stack_symbol_type& that) + { + state = that.state; + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (that.value); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (that.value); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (that.value); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (that.value); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (that.value); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (that.value); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (that.value); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (that.value); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (that.value); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (that.value); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (that.value); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (that.value); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (that.value); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (that.value); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (that.value); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (that.value); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (that.value); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (that.value); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (that.value); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (that.value); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (that.value); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (that.value); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (that.value); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (that.value); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (that.value); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (that.value); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (that.value); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (that.value); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (that.value); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (that.value); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (that.value); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (that.value); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (that.value); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (that.value); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (that.value); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (that.value); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (that.value); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (that.value); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (that.value); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (that.value); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (that.value); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (that.value); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (that.value); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (that.value); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (that.value); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (that.value); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (that.value); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (that.value); + break; + + default: + break; + } + + location = that.location; + // that is emptied. + that.state = empty_state; + return *this; + } +#endif + + template + void + parser::yy_destroy_ (const char* yymsg, basic_symbol& yysym) const + { + if (yymsg) + YY_SYMBOL_PRINT (yymsg, yysym); + } + +#if S1DEBUG + template + void + parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const + { + std::ostream& yyoutput = yyo; + YY_USE (yyoutput); + if (yysym.empty ()) + yyo << "empty symbol"; + else + { + symbol_kind_type yykind = yysym.kind (); + yyo << (yykind < YYNTOKENS ? "token" : "nterm") + << ' ' << yysym.name () << " (" + << yysym.location << ": "; + YY_USE (yykind); + yyo << ')'; + } + } +#endif + + void + parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) + { + if (m) + YY_SYMBOL_PRINT (m, sym); + yystack_.push (YY_MOVE (sym)); + } + + void + parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) + { +#if 201103L <= YY_CPLUSPLUS + yypush_ (m, stack_symbol_type (s, std::move (sym))); +#else + stack_symbol_type ss (s, sym); + yypush_ (m, ss); +#endif + } + + void + parser::yypop_ (int n) + { + yystack_.pop (n); + } + +#if S1DEBUG + std::ostream& + parser::debug_stream () const + { + return *yycdebug_; + } + + void + parser::set_debug_stream (std::ostream& o) + { + yycdebug_ = &o; + } + + + parser::debug_level_type + parser::debug_level () const + { + return yydebug_; + } + + void + parser::set_debug_level (debug_level_type l) + { + yydebug_ = l; + } +#endif // S1DEBUG + + parser::state_type + parser::yy_lr_goto_state_ (state_type yystate, int yysym) + { + int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; + if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) + return yytable_[yyr]; + else + return yydefgoto_[yysym - YYNTOKENS]; + } + + bool + parser::yy_pact_value_is_default_ (int yyvalue) + { + return yyvalue == yypact_ninf_; + } + + bool + parser::yy_table_value_is_error_ (int yyvalue) + { + return yyvalue == yytable_ninf_; + } + + int + parser::operator() () + { + return parse (); + } + + int + parser::parse () + { + int yyn; + /// Length of the RHS of the rule being reduced. + int yylen = 0; + + // Error handling. + int yynerrs_ = 0; + int yyerrstatus_ = 0; + + /// The lookahead symbol. + symbol_type yyla; + + /// The locations where the error started and ended. + stack_symbol_type yyerror_range[3]; + + /// The return value of parse (). + int yyresult; + + /// Discard the LAC context in case there still is one left from a + /// previous invocation. + yy_lac_discard_ ("init"); + +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + YYCDEBUG << "Starting parse\n"; + + + /* Initialize the stack. The initial state will be set in + yynewstate, since the latter expects the semantical and the + location values to have been already stored, initialize these + stacks with a primary value. */ + yystack_.clear (); + yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); + + /*-----------------------------------------------. + | yynewstate -- push a new symbol on the stack. | + `-----------------------------------------------*/ + yynewstate: + YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; + YY_STACK_PRINT (); + + // Accept? + if (yystack_[0].state == yyfinal_) + YYACCEPT; + + goto yybackup; + + + /*-----------. + | yybackup. | + `-----------*/ + yybackup: + // Try to take a decision without lookahead. + yyn = yypact_[+yystack_[0].state]; + if (yy_pact_value_is_default_ (yyn)) + goto yydefault; + + // Read a lookahead token. + if (yyla.empty ()) + { + YYCDEBUG << "Reading a token\n"; +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + symbol_type yylookahead (yylex (yyscanner, loc)); + yyla.move (yylookahead); + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + goto yyerrlab1; + } +#endif // YY_EXCEPTIONS + } + YY_SYMBOL_PRINT ("Next token is", yyla); + + if (yyla.kind () == symbol_kind::S_YYerror) + { + // The scanner already issued an error message, process directly + // to error recovery. But do not keep the error token as + // lookahead, it is too special and may lead us to an endless + // loop in error recovery. */ + yyla.kind_ = symbol_kind::S_YYUNDEF; + goto yyerrlab1; + } + + /* If the proper action on seeing token YYLA.TYPE is to reduce or + to detect an error, take that action. */ + yyn += yyla.kind (); + if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) + { + if (!yy_lac_establish_ (yyla.kind ())) + goto yyerrlab; + goto yydefault; + } + + // Reduce or error. + yyn = yytable_[yyn]; + if (yyn <= 0) + { + if (yy_table_value_is_error_ (yyn)) + goto yyerrlab; + if (!yy_lac_establish_ (yyla.kind ())) + goto yyerrlab; + + yyn = -yyn; + goto yyreduce; + } + + // Count tokens shifted since error; after three, turn off error status. + if (yyerrstatus_) + --yyerrstatus_; + + // Shift the lookahead token. + yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); + yy_lac_discard_ ("shift"); + goto yynewstate; + + + /*-----------------------------------------------------------. + | yydefault -- do the default action for the current state. | + `-----------------------------------------------------------*/ + yydefault: + yyn = yydefact_[+yystack_[0].state]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + + /*-----------------------------. + | yyreduce -- do a reduction. | + `-----------------------------*/ + yyreduce: + yylen = yyr2_[yyn]; + { + stack_symbol_type yylhs; + yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); + /* Variants are always initialized to an empty instance of the + correct type. The default '$$ = $1' action is NOT applied + when using variants. */ + switch (yyr1_[yyn]) + { + case symbol_kind::S_anim: // anim + yylhs.value.emplace< anim_ptr > (); + break; + + case symbol_kind::S_animation: // animation + yylhs.value.emplace< animation_ptr > (); + break; + + case symbol_kind::S_animtree: // animtree + yylhs.value.emplace< animtree_ptr > (); + break; + + case symbol_kind::S_constant: // constant + yylhs.value.emplace< constant_ptr > (); + break; + + case symbol_kind::S_define: // define + yylhs.value.emplace< define_ptr > (); + break; + + case symbol_kind::S_empty_array: // empty_array + yylhs.value.emplace< empty_array_ptr > (); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + yylhs.value.emplace< expr_arguments_ptr > (); + break; + + case symbol_kind::S_expr_assign: // expr_assign + yylhs.value.emplace< expr_assign_ptr > (); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + yylhs.value.emplace< expr_call_ptr > (); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + yylhs.value.emplace< expr_call_type_ptr > (); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + yylhs.value.emplace< expr_ptr > (); + break; + + case symbol_kind::S_false: // false + yylhs.value.emplace< false_ptr > (); + break; + + case symbol_kind::S_file: // file + yylhs.value.emplace< file_ptr > (); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + yylhs.value.emplace< float_ptr > (); + break; + + case symbol_kind::S_game: // game + yylhs.value.emplace< game_ptr > (); + break; + + case symbol_kind::S_include: // include + yylhs.value.emplace< include_ptr > (); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + yylhs.value.emplace< integer_ptr > (); + break; + + case symbol_kind::S_istring: // istring + yylhs.value.emplace< istring_ptr > (); + break; + + case symbol_kind::S_level: // level + yylhs.value.emplace< level_ptr > (); + break; + + case symbol_kind::S_name: // name + yylhs.value.emplace< name_ptr > (); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + yylhs.value.emplace< node_ptr > (); + break; + + case symbol_kind::S_parameters: // parameters + yylhs.value.emplace< parameters_ptr > (); + break; + + case symbol_kind::S_program: // program + yylhs.value.emplace< program_ptr > (); + break; + + case symbol_kind::S_self: // self + yylhs.value.emplace< self_ptr > (); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + yylhs.value.emplace< std::string > (); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + yylhs.value.emplace< stmt_assign_ptr > (); + break; + + case symbol_kind::S_stmt_break: // stmt_break + yylhs.value.emplace< stmt_break_ptr > (); + break; + + case symbol_kind::S_stmt_call: // stmt_call + yylhs.value.emplace< stmt_call_ptr > (); + break; + + case symbol_kind::S_stmt_case: // stmt_case + yylhs.value.emplace< stmt_case_ptr > (); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + yylhs.value.emplace< stmt_continue_ptr > (); + break; + + case symbol_kind::S_stmt_default: // stmt_default + yylhs.value.emplace< stmt_default_ptr > (); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + yylhs.value.emplace< stmt_endon_ptr > (); + break; + + case symbol_kind::S_stmt_for: // stmt_for + yylhs.value.emplace< stmt_for_ptr > (); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + yylhs.value.emplace< stmt_foreach_ptr > (); + break; + + case symbol_kind::S_stmt_if: // stmt_if + yylhs.value.emplace< stmt_if_ptr > (); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + yylhs.value.emplace< stmt_ifelse_ptr > (); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + yylhs.value.emplace< stmt_list_ptr > (); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + yylhs.value.emplace< stmt_notify_ptr > (); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + yylhs.value.emplace< stmt_ptr > (); + break; + + case symbol_kind::S_stmt_return: // stmt_return + yylhs.value.emplace< stmt_return_ptr > (); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + yylhs.value.emplace< stmt_switch_ptr > (); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + yylhs.value.emplace< stmt_wait_ptr > (); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + yylhs.value.emplace< stmt_waitframe_ptr > (); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + yylhs.value.emplace< stmt_waittill_ptr > (); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + yylhs.value.emplace< stmt_waittillframeend_ptr > (); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + yylhs.value.emplace< stmt_waittillmatch_ptr > (); + break; + + case symbol_kind::S_stmt_while: // stmt_while + yylhs.value.emplace< stmt_while_ptr > (); + break; + + case symbol_kind::S_string: // string + yylhs.value.emplace< string_ptr > (); + break; + + case symbol_kind::S_thisthread: // thisthread + yylhs.value.emplace< thisthread_ptr > (); + break; + + case symbol_kind::S_thread: // thread + yylhs.value.emplace< thread_ptr > (); + break; + + case symbol_kind::S_true: // true + yylhs.value.emplace< true_ptr > (); + break; + + case symbol_kind::S_undefined: // undefined + yylhs.value.emplace< undefined_ptr > (); + break; + + case symbol_kind::S_usingtree: // usingtree + yylhs.value.emplace< usingtree_ptr > (); + break; + + case symbol_kind::S_vector: // vector + yylhs.value.emplace< vector_ptr > (); + break; + + default: + break; + } + + + // Default location. + { + stack_type::slice range (yystack_, yylen); + YYLLOC_DEFAULT (yylhs.location, range, yylen); + yyerror_range[1].location = yylhs.location; + } + + // Perform the reduction. + YY_REDUCE_PRINT (yyn); +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + switch (yyn) + { + case 2: // root: program +#line 233 "parser.ypp" + { ast = std::move(yystack_[0].value.as < program_ptr > ()); } +#line 1751 "parser.cpp" + break; + + case 3: // root: %empty +#line 234 "parser.ypp" + { ast = std::make_unique(yylhs.location); } +#line 1757 "parser.cpp" + break; + + case 4: // program: program include +#line 239 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::move(yystack_[1].value.as < program_ptr > ()); yylhs.value.as < program_ptr > ()->includes.push_back(std::move(yystack_[0].value.as < include_ptr > ())); } +#line 1763 "parser.cpp" + break; + + case 5: // program: program define +#line 241 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::move(yystack_[1].value.as < program_ptr > ()); yylhs.value.as < program_ptr > ()->definitions.push_back(std::move(yystack_[0].value.as < define_ptr > ())); } +#line 1769 "parser.cpp" + break; + + case 6: // program: include +#line 243 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < program_ptr > ()->includes.push_back(std::move(yystack_[0].value.as < include_ptr > ())); } +#line 1775 "parser.cpp" + break; + + case 7: // program: define +#line 245 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < program_ptr > ()->definitions.push_back(std::move(yystack_[0].value.as < define_ptr > ())); } +#line 1781 "parser.cpp" + break; + + case 8: // include: "#include" file ";" +#line 250 "parser.ypp" + { yylhs.value.as < include_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < file_ptr > ())); } +#line 1787 "parser.cpp" + break; + + case 9: // define: usingtree +#line 254 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_usingtree = std::move(yystack_[0].value.as < usingtree_ptr > ()); } +#line 1793 "parser.cpp" + break; + + case 10: // define: constant +#line 255 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_constant = std::move(yystack_[0].value.as < constant_ptr > ()); } +#line 1799 "parser.cpp" + break; + + case 11: // define: thread +#line 256 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_thread = std::move(yystack_[0].value.as < thread_ptr > ()); } +#line 1805 "parser.cpp" + break; + + case 12: // usingtree: "#using_animtree" "(" string ")" ";" +#line 261 "parser.ypp" + { yylhs.value.as < usingtree_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < string_ptr > ())); } +#line 1811 "parser.cpp" + break; + + case 13: // constant: name "=" expr ";" +#line 266 "parser.ypp" + { yylhs.value.as < constant_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 1817 "parser.cpp" + break; + + case 14: // thread: name "(" parameters ")" stmt_block +#line 271 "parser.ypp" + { yylhs.value.as < thread_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < name_ptr > ()), std::move(yystack_[2].value.as < parameters_ptr > ()), std::move(yystack_[0].value.as < stmt_list_ptr > ())); } +#line 1823 "parser.cpp" + break; + + case 15: // parameters: parameters "," name +#line 276 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::move(yystack_[2].value.as < parameters_ptr > ()); yylhs.value.as < parameters_ptr > ()->list.push_back(std::move(yystack_[0].value.as < name_ptr > ())); } +#line 1829 "parser.cpp" + break; + + case 16: // parameters: name +#line 278 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < parameters_ptr > ()->list.push_back(std::move(yystack_[0].value.as < name_ptr > ())); } +#line 1835 "parser.cpp" + break; + + case 17: // parameters: %empty +#line 280 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::make_unique(yylhs.location); } +#line 1841 "parser.cpp" + break; + + case 18: // stmt: stmt_block +#line 284 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_list = std::move(yystack_[0].value.as < stmt_list_ptr > ()); } +#line 1847 "parser.cpp" + break; + + case 19: // stmt: stmt_call +#line 285 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_call = std::move(yystack_[0].value.as < stmt_call_ptr > ()); } +#line 1853 "parser.cpp" + break; + + case 20: // stmt: stmt_assign +#line 286 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_assign = std::move(yystack_[0].value.as < stmt_assign_ptr > ()); } +#line 1859 "parser.cpp" + break; + + case 21: // stmt: stmt_endon +#line 287 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_endon = std::move(yystack_[0].value.as < stmt_endon_ptr > ()); } +#line 1865 "parser.cpp" + break; + + case 22: // stmt: stmt_notify +#line 288 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_notify = std::move(yystack_[0].value.as < stmt_notify_ptr > ()); } +#line 1871 "parser.cpp" + break; + + case 23: // stmt: stmt_wait +#line 289 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_wait = std::move(yystack_[0].value.as < stmt_wait_ptr > ()); } +#line 1877 "parser.cpp" + break; + + case 24: // stmt: stmt_waittill +#line 290 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittill = std::move(yystack_[0].value.as < stmt_waittill_ptr > ()); } +#line 1883 "parser.cpp" + break; + + case 25: // stmt: stmt_waittillmatch +#line 291 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittillmatch = std::move(yystack_[0].value.as < stmt_waittillmatch_ptr > ()); } +#line 1889 "parser.cpp" + break; + + case 26: // stmt: stmt_waittillframeend +#line 292 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittillframeend = std::move(yystack_[0].value.as < stmt_waittillframeend_ptr > ()); } +#line 1895 "parser.cpp" + break; + + case 27: // stmt: stmt_waitframe +#line 293 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waitframe = std::move(yystack_[0].value.as < stmt_waitframe_ptr > ()); } +#line 1901 "parser.cpp" + break; + + case 28: // stmt: stmt_if +#line 294 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_if = std::move(yystack_[0].value.as < stmt_if_ptr > ()); } +#line 1907 "parser.cpp" + break; + + case 29: // stmt: stmt_ifelse +#line 295 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_ifelse = std::move(yystack_[0].value.as < stmt_ifelse_ptr > ()); } +#line 1913 "parser.cpp" + break; + + case 30: // stmt: stmt_while +#line 296 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_while = std::move(yystack_[0].value.as < stmt_while_ptr > ()); } +#line 1919 "parser.cpp" + break; + + case 31: // stmt: stmt_for +#line 297 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_for = std::move(yystack_[0].value.as < stmt_for_ptr > ()); } +#line 1925 "parser.cpp" + break; + + case 32: // stmt: stmt_foreach +#line 298 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_foreach = std::move(yystack_[0].value.as < stmt_foreach_ptr > ()); } +#line 1931 "parser.cpp" + break; + + case 33: // stmt: stmt_switch +#line 299 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_switch = std::move(yystack_[0].value.as < stmt_switch_ptr > ()); } +#line 1937 "parser.cpp" + break; + + case 34: // stmt: stmt_case +#line 300 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_case = std::move(yystack_[0].value.as < stmt_case_ptr > ()); } +#line 1943 "parser.cpp" + break; + + case 35: // stmt: stmt_default +#line 301 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_default = std::move(yystack_[0].value.as < stmt_default_ptr > ()); } +#line 1949 "parser.cpp" + break; + + case 36: // stmt: stmt_break +#line 302 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_break = std::move(yystack_[0].value.as < stmt_break_ptr > ()); } +#line 1955 "parser.cpp" + break; + + case 37: // stmt: stmt_continue +#line 303 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_continue = std::move(yystack_[0].value.as < stmt_continue_ptr > ()); } +#line 1961 "parser.cpp" + break; + + case 38: // stmt: stmt_return +#line 304 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_return = std::move(yystack_[0].value.as < stmt_return_ptr > ()); } +#line 1967 "parser.cpp" + break; + + case 39: // stmt_block: "{" stmt_list "}" +#line 308 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::move(yystack_[1].value.as < stmt_list_ptr > ()); } +#line 1973 "parser.cpp" + break; + + case 40: // stmt_block: "{" "}" +#line 309 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::make_unique(yylhs.location); } +#line 1979 "parser.cpp" + break; + + case 41: // stmt_list: stmt_list stmt +#line 314 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::move(yystack_[1].value.as < stmt_list_ptr > ()); yylhs.value.as < stmt_list_ptr > ()->stmts.push_back(std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 1985 "parser.cpp" + break; + + case 42: // stmt_list: stmt +#line 316 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < stmt_list_ptr > ()->stmts.push_back(std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 1991 "parser.cpp" + break; + + case 43: // stmt_call: expr_call ";" +#line 321 "parser.ypp" + { yylhs.value.as < stmt_call_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_call_ptr > ())); } +#line 1997 "parser.cpp" + break; + + case 44: // stmt_call: expr_call_thread ";" +#line 323 "parser.ypp" + { yylhs.value.as < stmt_call_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_call_ptr > ())); } +#line 2003 "parser.cpp" + break; + + case 45: // stmt_assign: expr_assign ";" +#line 328 "parser.ypp" + { yylhs.value.as < stmt_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_assign_ptr > ())); } +#line 2009 "parser.cpp" + break; + + case 46: // stmt_endon: object "endon" "(" expr ")" ";" +#line 333 "parser.ypp" + { yylhs.value.as < stmt_endon_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ())); } +#line 2015 "parser.cpp" + break; + + case 47: // stmt_notify: object "notify" "(" expr "," expr_arguments ")" ";" +#line 338 "parser.ypp" + { yylhs.value.as < stmt_notify_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 2021 "parser.cpp" + break; + + case 48: // stmt_notify: object "notify" "(" expr ")" ";" +#line 340 "parser.ypp" + { yylhs.value.as < stmt_notify_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2027 "parser.cpp" + break; + + case 49: // stmt_wait: "wait" expr ";" +#line 345 "parser.ypp" + { yylhs.value.as < stmt_wait_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2033 "parser.cpp" + break; + + case 50: // stmt_waittill: object "waittill" "(" expr "," expr_arguments ")" ";" +#line 350 "parser.ypp" + { yylhs.value.as < stmt_waittill_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 2039 "parser.cpp" + break; + + case 51: // stmt_waittill: object "waittill" "(" expr ")" ";" +#line 352 "parser.ypp" + { yylhs.value.as < stmt_waittill_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2045 "parser.cpp" + break; + + case 52: // stmt_waittillmatch: object "waittillmatch" "(" expr "," expr_arguments ")" ";" +#line 357 "parser.ypp" + { yylhs.value.as < stmt_waittillmatch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 2051 "parser.cpp" + break; + + case 53: // stmt_waittillmatch: object "waittillmatch" "(" expr ")" ";" +#line 359 "parser.ypp" + { yylhs.value.as < stmt_waittillmatch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2057 "parser.cpp" + break; + + case 54: // stmt_waittillframeend: "waittillframeend" ";" +#line 364 "parser.ypp" + { yylhs.value.as < stmt_waittillframeend_ptr > () = std::make_unique(yylhs.location); } +#line 2063 "parser.cpp" + break; + + case 55: // stmt_waitframe: "waitframe" ";" +#line 369 "parser.ypp" + { yylhs.value.as < stmt_waitframe_ptr > () = std::make_unique(yylhs.location); } +#line 2069 "parser.cpp" + break; + + case 56: // stmt_waitframe: "waitframe" "(" ")" ";" +#line 371 "parser.ypp" + { yylhs.value.as < stmt_waitframe_ptr > () = std::make_unique(yylhs.location); } +#line 2075 "parser.cpp" + break; + + case 57: // stmt_if: "if" "(" expr ")" stmt +#line 376 "parser.ypp" + { yylhs.value.as < stmt_if_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2081 "parser.cpp" + break; + + case 58: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt +#line 381 "parser.ypp" + { yylhs.value.as < stmt_ifelse_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < stmt_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2087 "parser.cpp" + break; + + case 59: // stmt_while: "while" "(" expr ")" stmt +#line 386 "parser.ypp" + { yylhs.value.as < stmt_while_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2093 "parser.cpp" + break; + + case 60: // stmt_for: "for" "(" for_stmt ";" for_expr ";" for_stmt ")" stmt +#line 391 "parser.ypp" + { yylhs.value.as < stmt_for_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[6].value.as < stmt_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < stmt_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2099 "parser.cpp" + break; + + case 61: // stmt_foreach: "foreach" "(" name "in" expr ")" stmt +#line 396 "parser.ypp" + { yylhs.value.as < stmt_foreach_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[4].value.as < name_ptr > ())), std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2105 "parser.cpp" + break; + + case 62: // stmt_foreach: "foreach" "(" name "," name "in" expr ")" stmt +#line 398 "parser.ypp" + { yylhs.value.as < stmt_foreach_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[6].value.as < name_ptr > ())), expr_ptr(std::move(yystack_[4].value.as < name_ptr > ())), std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2111 "parser.cpp" + break; + + case 63: // stmt_switch: "switch" "(" expr ")" stmt_block +#line 403 "parser.ypp" + { yylhs.value.as < stmt_switch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_list_ptr > ())); } +#line 2117 "parser.cpp" + break; + + case 64: // stmt_case: "case" integer ":" +#line 408 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < integer_ptr > ())), std::make_unique(yylhs.location)); } +#line 2123 "parser.cpp" + break; + + case 65: // stmt_case: "case" neg_integer ":" +#line 410 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < integer_ptr > ())), std::make_unique(yylhs.location)); } +#line 2129 "parser.cpp" + break; + + case 66: // stmt_case: "case" string ":" +#line 412 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < string_ptr > ())), std::make_unique(yylhs.location)); } +#line 2135 "parser.cpp" + break; + + case 67: // stmt_default: "default" ":" +#line 417 "parser.ypp" + { yylhs.value.as < stmt_default_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } +#line 2141 "parser.cpp" + break; + + case 68: // stmt_break: "break" ";" +#line 422 "parser.ypp" + { yylhs.value.as < stmt_break_ptr > () = std::make_unique(yylhs.location); } +#line 2147 "parser.cpp" + break; + + case 69: // stmt_continue: "continue" ";" +#line 427 "parser.ypp" + { yylhs.value.as < stmt_continue_ptr > () = std::make_unique(yylhs.location); } +#line 2153 "parser.cpp" + break; + + case 70: // stmt_return: "return" expr ";" +#line 432 "parser.ypp" + { yylhs.value.as < stmt_return_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2159 "parser.cpp" + break; + + case 71: // stmt_return: "return" ";" +#line 434 "parser.ypp" + { yylhs.value.as < stmt_return_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } +#line 2165 "parser.cpp" + break; + + case 72: // for_stmt: expr_assign +#line 438 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_list = std::make_unique(yylhs.location); yylhs.value.as < stmt_ptr > ().as_list->stmts.push_back(stmt_ptr(std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_assign_ptr > ())))); } +#line 2171 "parser.cpp" + break; + + case 73: // for_stmt: %empty +#line 439 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_node = std::make_unique(yylhs.location); } +#line 2177 "parser.cpp" + break; + + case 74: // for_expr: expr +#line 443 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2183 "parser.cpp" + break; + + case 75: // for_expr: %empty +#line 444 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location); } +#line 2189 "parser.cpp" + break; + + case 76: // expr: expr_compare +#line 448 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2195 "parser.cpp" + break; + + case 77: // expr: expr_binary +#line 449 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2201 "parser.cpp" + break; + + case 78: // expr: expr_primitive +#line 450 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2207 "parser.cpp" + break; + + case 79: // expr_assign: "++" object +#line 454 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < node_ptr > ())); } +#line 2213 "parser.cpp" + break; + + case 80: // expr_assign: "--" object +#line 455 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < node_ptr > ())); } +#line 2219 "parser.cpp" + break; + + case 81: // expr_assign: object "++" +#line 456 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < node_ptr > ())); } +#line 2225 "parser.cpp" + break; + + case 82: // expr_assign: object "--" +#line 457 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < node_ptr > ())); } +#line 2231 "parser.cpp" + break; + + case 83: // expr_assign: object "=" expr +#line 458 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2237 "parser.cpp" + break; + + case 84: // expr_assign: object "|=" expr +#line 459 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2243 "parser.cpp" + break; + + case 85: // expr_assign: object "&=" expr +#line 460 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2249 "parser.cpp" + break; + + case 86: // expr_assign: object "^=" expr +#line 461 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2255 "parser.cpp" + break; + + case 87: // expr_assign: object "<<=" expr +#line 462 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()),std::move( yystack_[0].value.as < expr_ptr > ())); } +#line 2261 "parser.cpp" + break; + + case 88: // expr_assign: object ">>=" expr +#line 463 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2267 "parser.cpp" + break; + + case 89: // expr_assign: object "+=" expr +#line 464 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2273 "parser.cpp" + break; + + case 90: // expr_assign: object "-=" expr +#line 465 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2279 "parser.cpp" + break; + + case 91: // expr_assign: object "*=" expr +#line 466 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2285 "parser.cpp" + break; + + case 92: // expr_assign: object "/=" expr +#line 467 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2291 "parser.cpp" + break; + + case 93: // expr_assign: object "%=" expr +#line 468 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2297 "parser.cpp" + break; + + case 94: // expr_compare: expr "||" expr +#line 472 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2303 "parser.cpp" + break; + + case 95: // expr_compare: expr "&&" expr +#line 473 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2309 "parser.cpp" + break; + + case 96: // expr_compare: expr "==" expr +#line 474 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2315 "parser.cpp" + break; + + case 97: // expr_compare: expr "!=" expr +#line 475 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2321 "parser.cpp" + break; + + case 98: // expr_compare: expr "<=" expr +#line 476 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2327 "parser.cpp" + break; + + case 99: // expr_compare: expr ">=" expr +#line 477 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2333 "parser.cpp" + break; + + case 100: // expr_compare: expr "<" expr +#line 478 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2339 "parser.cpp" + break; + + case 101: // expr_compare: expr ">" expr +#line 479 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2345 "parser.cpp" + break; + + case 102: // expr_binary: expr "|" expr +#line 483 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2351 "parser.cpp" + break; + + case 103: // expr_binary: expr "&" expr +#line 484 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2357 "parser.cpp" + break; + + case 104: // expr_binary: expr "^" expr +#line 485 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2363 "parser.cpp" + break; + + case 105: // expr_binary: expr "<<" expr +#line 486 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2369 "parser.cpp" + break; + + case 106: // expr_binary: expr ">>" expr +#line 487 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2375 "parser.cpp" + break; + + case 107: // expr_binary: expr "+" expr +#line 488 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2381 "parser.cpp" + break; + + case 108: // expr_binary: expr "-" expr +#line 489 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2387 "parser.cpp" + break; + + case 109: // expr_binary: expr "*" expr +#line 490 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2393 "parser.cpp" + break; + + case 110: // expr_binary: expr "/" expr +#line 491 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2399 "parser.cpp" + break; + + case 111: // expr_binary: expr "%" expr +#line 492 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2405 "parser.cpp" + break; + + case 112: // expr_primitive: "(" expr ")" +#line 496 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[1].value.as < expr_ptr > ()); } +#line 2411 "parser.cpp" + break; + + case 113: // expr_primitive: "~" expr +#line 497 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2417 "parser.cpp" + break; + + case 114: // expr_primitive: "!" expr +#line 498 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2423 "parser.cpp" + break; + + case 115: // expr_primitive: expr_call +#line 499 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2429 "parser.cpp" + break; + + case 116: // expr_primitive: expr_call_thread +#line 500 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2435 "parser.cpp" + break; + + case 117: // expr_primitive: expr_call_childthread +#line 501 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2441 "parser.cpp" + break; + + case 118: // expr_primitive: expr_function +#line 502 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2447 "parser.cpp" + break; + + case 119: // expr_primitive: expr_add_array +#line 503 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2453 "parser.cpp" + break; + + case 120: // expr_primitive: expr_array +#line 504 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2459 "parser.cpp" + break; + + case 121: // expr_primitive: expr_field +#line 505 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2465 "parser.cpp" + break; + + case 122: // expr_primitive: expr_size +#line 506 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2471 "parser.cpp" + break; + + case 123: // expr_primitive: thisthread +#line 507 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < thisthread_ptr > ()); } +#line 2477 "parser.cpp" + break; + + case 124: // expr_primitive: empty_array +#line 508 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < empty_array_ptr > ()); } +#line 2483 "parser.cpp" + break; + + case 125: // expr_primitive: undefined +#line 509 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < undefined_ptr > ()); } +#line 2489 "parser.cpp" + break; + + case 126: // expr_primitive: game +#line 510 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < game_ptr > ()); } +#line 2495 "parser.cpp" + break; + + case 127: // expr_primitive: self +#line 511 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < self_ptr > ()); } +#line 2501 "parser.cpp" + break; + + case 128: // expr_primitive: anim +#line 512 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < anim_ptr > ()); } +#line 2507 "parser.cpp" + break; + + case 129: // expr_primitive: level +#line 513 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < level_ptr > ()); } +#line 2513 "parser.cpp" + break; + + case 130: // expr_primitive: animation +#line 514 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < animation_ptr > ()); } +#line 2519 "parser.cpp" + break; + + case 131: // expr_primitive: animtree +#line 515 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < animtree_ptr > ()); } +#line 2525 "parser.cpp" + break; + + case 132: // expr_primitive: name +#line 516 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < name_ptr > ()); } +#line 2531 "parser.cpp" + break; + + case 133: // expr_primitive: istring +#line 517 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < istring_ptr > ()); } +#line 2537 "parser.cpp" + break; + + case 134: // expr_primitive: string +#line 518 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < string_ptr > ()); } +#line 2543 "parser.cpp" + break; + + case 135: // expr_primitive: vector +#line 519 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < vector_ptr > ()); } +#line 2549 "parser.cpp" + break; + + case 136: // expr_primitive: neg_float +#line 520 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < float_ptr > ()); } +#line 2555 "parser.cpp" + break; + + case 137: // expr_primitive: neg_integer +#line 521 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < integer_ptr > ()); } +#line 2561 "parser.cpp" + break; + + case 138: // expr_primitive: float +#line 522 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < float_ptr > ()); } +#line 2567 "parser.cpp" + break; + + case 139: // expr_primitive: integer +#line 523 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < integer_ptr > ()); } +#line 2573 "parser.cpp" + break; + + case 140: // expr_primitive: false +#line 524 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < false_ptr > ()); } +#line 2579 "parser.cpp" + break; + + case 141: // expr_primitive: true +#line 525 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < true_ptr > ()); } +#line 2585 "parser.cpp" + break; + + case 142: // expr_call: expr_call_function +#line 529 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2591 "parser.cpp" + break; + + case 143: // expr_call: expr_call_pointer +#line 530 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2597 "parser.cpp" + break; + + case 144: // expr_call: object expr_call_function +#line 531 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::move(yystack_[1].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2603 "parser.cpp" + break; + + case 145: // expr_call: object expr_call_pointer +#line 532 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::move(yystack_[1].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2609 "parser.cpp" + break; + + case 146: // expr_call_thread: "thread" expr_call_function +#line 536 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2615 "parser.cpp" + break; + + case 147: // expr_call_thread: "thread" expr_call_pointer +#line 537 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2621 "parser.cpp" + break; + + case 148: // expr_call_thread: object "thread" expr_call_function +#line 538 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2627 "parser.cpp" + break; + + case 149: // expr_call_thread: object "thread" expr_call_pointer +#line 539 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2633 "parser.cpp" + break; + + case 150: // expr_call_childthread: "childthread" expr_call_function +#line 543 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2639 "parser.cpp" + break; + + case 151: // expr_call_childthread: "childthread" expr_call_pointer +#line 544 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2645 "parser.cpp" + break; + + case 152: // expr_call_childthread: object "childthread" expr_call_function +#line 545 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2651 "parser.cpp" + break; + + case 153: // expr_call_childthread: object "childthread" expr_call_pointer +#line 546 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2657 "parser.cpp" + break; + + case 154: // expr_call_function: name "(" expr_arguments ")" +#line 551 "parser.ypp" + {yylhs.value.as < expr_call_type_ptr > ().as_func = std::make_unique(yylhs.location, std::make_unique(), std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2663 "parser.cpp" + break; + + case 155: // expr_call_function: file "::" name "(" expr_arguments ")" +#line 553 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_func = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < file_ptr > ()), std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2669 "parser.cpp" + break; + + case 156: // expr_call_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 558 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_pointer = std::make_unique(yylhs.location, false, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2675 "parser.cpp" + break; + + case 157: // expr_call_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 560 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_pointer = std::make_unique(yylhs.location, true, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2681 "parser.cpp" + break; + + case 158: // expr_arguments: expr_arguments_filled +#line 564 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[0].value.as < expr_arguments_ptr > ()); } +#line 2687 "parser.cpp" + break; + + case 159: // expr_arguments: expr_arguments_empty +#line 565 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[0].value.as < expr_arguments_ptr > ()); } +#line 2693 "parser.cpp" + break; + + case 160: // expr_arguments_filled: expr_arguments "," expr +#line 570 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[2].value.as < expr_arguments_ptr > ()); yylhs.value.as < expr_arguments_ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2699 "parser.cpp" + break; + + case 161: // expr_arguments_filled: expr +#line 572 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < expr_arguments_ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2705 "parser.cpp" + break; + + case 162: // expr_arguments_empty: %empty +#line 577 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::make_unique(yylhs.location); } +#line 2711 "parser.cpp" + break; + + case 163: // expr_function: "::" name +#line 582 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2717 "parser.cpp" + break; + + case 164: // expr_function: file "::" name +#line 584 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < file_ptr > ()), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2723 "parser.cpp" + break; + + case 165: // expr_add_array: "[" expr_arguments_filled "]" +#line 589 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2729 "parser.cpp" + break; + + case 166: // expr_array: object "[" expr "]" +#line 594 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < node_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2735 "parser.cpp" + break; + + case 167: // expr_field: object "." name +#line 599 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2741 "parser.cpp" + break; + + case 168: // expr_size: object "." "size" +#line 604 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ())); } +#line 2747 "parser.cpp" + break; + + case 169: // object: expr_call +#line 608 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2753 "parser.cpp" + break; + + case 170: // object: expr_array +#line 609 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2759 "parser.cpp" + break; + + case 171: // object: expr_field +#line 610 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2765 "parser.cpp" + break; + + case 172: // object: game +#line 611 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < game_ptr > ()); } +#line 2771 "parser.cpp" + break; + + case 173: // object: self +#line 612 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < self_ptr > ()); } +#line 2777 "parser.cpp" + break; + + case 174: // object: anim +#line 613 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < anim_ptr > ()); } +#line 2783 "parser.cpp" + break; + + case 175: // object: level +#line 614 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < level_ptr > ()); } +#line 2789 "parser.cpp" + break; + + case 176: // object: name +#line 615 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < name_ptr > ()); } +#line 2795 "parser.cpp" + break; + + case 177: // thisthread: "thisthread" +#line 618 "parser.ypp" + { yylhs.value.as < thisthread_ptr > () = std::make_unique(yylhs.location); } +#line 2801 "parser.cpp" + break; + + case 178: // empty_array: "[" "]" +#line 619 "parser.ypp" + { yylhs.value.as < empty_array_ptr > () = std::make_unique(yylhs.location); } +#line 2807 "parser.cpp" + break; + + case 179: // undefined: "undefined" +#line 620 "parser.ypp" + { yylhs.value.as < undefined_ptr > () = std::make_unique(yylhs.location); } +#line 2813 "parser.cpp" + break; + + case 180: // game: "game" +#line 621 "parser.ypp" + { yylhs.value.as < game_ptr > () = std::make_unique(yylhs.location); } +#line 2819 "parser.cpp" + break; + + case 181: // self: "self" +#line 622 "parser.ypp" + { yylhs.value.as < self_ptr > () = std::make_unique(yylhs.location); } +#line 2825 "parser.cpp" + break; + + case 182: // anim: "anim" +#line 623 "parser.ypp" + { yylhs.value.as < anim_ptr > () = std::make_unique(yylhs.location); } +#line 2831 "parser.cpp" + break; + + case 183: // level: "level" +#line 624 "parser.ypp" + { yylhs.value.as < level_ptr > () = std::make_unique(yylhs.location); } +#line 2837 "parser.cpp" + break; + + case 184: // animation: "%" "identifier" +#line 625 "parser.ypp" + { yylhs.value.as < animation_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2843 "parser.cpp" + break; + + case 185: // animtree: "#animtree" +#line 626 "parser.ypp" + { yylhs.value.as < animtree_ptr > () = std::make_unique(yylhs.location); } +#line 2849 "parser.cpp" + break; + + case 186: // name: "identifier" +#line 627 "parser.ypp" + { yylhs.value.as < name_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2855 "parser.cpp" + break; + + case 187: // file: "file path" +#line 628 "parser.ypp" + { yylhs.value.as < file_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2861 "parser.cpp" + break; + + case 188: // istring: "localized string" +#line 629 "parser.ypp" + { yylhs.value.as < istring_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2867 "parser.cpp" + break; + + case 189: // string: "string literal" +#line 630 "parser.ypp" + { yylhs.value.as < string_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2873 "parser.cpp" + break; + + case 190: // vector: "(" expr "," expr "," expr ")" +#line 631 "parser.ypp" + { yylhs.value.as < vector_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[3].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2879 "parser.cpp" + break; + + case 191: // neg_float: "-" "float" +#line 632 "parser.ypp" + { yylhs.value.as < float_ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 2885 "parser.cpp" + break; + + case 192: // neg_integer: "-" "int" +#line 633 "parser.ypp" + { yylhs.value.as < integer_ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 2891 "parser.cpp" + break; + + case 193: // float: "float" +#line 634 "parser.ypp" + { yylhs.value.as < float_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2897 "parser.cpp" + break; + + case 194: // integer: "int" +#line 635 "parser.ypp" + { yylhs.value.as < integer_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2903 "parser.cpp" + break; + + case 195: // false: "false" +#line 636 "parser.ypp" + { yylhs.value.as < false_ptr > () = std::make_unique(yylhs.location); } +#line 2909 "parser.cpp" + break; + + case 196: // true: "true" +#line 637 "parser.ypp" + { yylhs.value.as < true_ptr > () = std::make_unique(yylhs.location); } +#line 2915 "parser.cpp" + break; + + +#line 2919 "parser.cpp" + + default: + break; + } + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + YYERROR; + } +#endif // YY_EXCEPTIONS + YY_SYMBOL_PRINT ("-> $$ =", yylhs); + yypop_ (yylen); + yylen = 0; + + // Shift the result of the reduction. + yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); + } + goto yynewstate; + + + /*--------------------------------------. + | yyerrlab -- here on detecting error. | + `--------------------------------------*/ + yyerrlab: + // If not already recovering from an error, report this error. + if (!yyerrstatus_) + { + ++yynerrs_; + context yyctx (*this, yyla); + std::string msg = yysyntax_error_ (yyctx); + error (yyla.location, YY_MOVE (msg)); + } + + + yyerror_range[1].location = yyla.location; + if (yyerrstatus_ == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + // Return failure if at end of input. + if (yyla.kind () == symbol_kind::S_YYEOF) + YYABORT; + else if (!yyla.empty ()) + { + yy_destroy_ ("Error: discarding", yyla); + yyla.clear (); + } + } + + // Else will try to reuse lookahead token after shifting the error token. + goto yyerrlab1; + + + /*---------------------------------------------------. + | yyerrorlab -- error raised explicitly by YYERROR. | + `---------------------------------------------------*/ + yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and + the label yyerrorlab therefore never appears in user code. */ + if (false) + YYERROR; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + yypop_ (yylen); + yylen = 0; + YY_STACK_PRINT (); + goto yyerrlab1; + + + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ + yyerrlab1: + yyerrstatus_ = 3; // Each real token shifted decrements this. + // Pop stack until we find a state that shifts the error token. + for (;;) + { + yyn = yypact_[+yystack_[0].state]; + if (!yy_pact_value_is_default_ (yyn)) + { + yyn += symbol_kind::S_YYerror; + if (0 <= yyn && yyn <= yylast_ + && yycheck_[yyn] == symbol_kind::S_YYerror) + { + yyn = yytable_[yyn]; + if (0 < yyn) + break; + } + } + + // Pop the current state because it cannot handle the error token. + if (yystack_.size () == 1) + YYABORT; + + yyerror_range[1].location = yystack_[0].location; + yy_destroy_ ("Error: popping", yystack_[0]); + yypop_ (); + YY_STACK_PRINT (); + } + { + stack_symbol_type error_token; + + yyerror_range[2].location = yyla.location; + YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); + + // Shift the error token. + yy_lac_discard_ ("error recovery"); + error_token.state = state_type (yyn); + yypush_ ("Shifting", YY_MOVE (error_token)); + } + goto yynewstate; + + + /*-------------------------------------. + | yyacceptlab -- YYACCEPT comes here. | + `-------------------------------------*/ + yyacceptlab: + yyresult = 0; + goto yyreturn; + + + /*-----------------------------------. + | yyabortlab -- YYABORT comes here. | + `-----------------------------------*/ + yyabortlab: + yyresult = 1; + goto yyreturn; + + + /*-----------------------------------------------------. + | yyreturn -- parsing is finished, return the result. | + `-----------------------------------------------------*/ + yyreturn: + if (!yyla.empty ()) + yy_destroy_ ("Cleanup: discarding lookahead", yyla); + + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + yypop_ (yylen); + YY_STACK_PRINT (); + while (1 < yystack_.size ()) + { + yy_destroy_ ("Cleanup: popping", yystack_[0]); + yypop_ (); + } + + return yyresult; + } +#if YY_EXCEPTIONS + catch (...) + { + YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; + // Do not try to display the values of the reclaimed symbols, + // as their printers might throw an exception. + if (!yyla.empty ()) + yy_destroy_ (YY_NULLPTR, yyla); + + while (1 < yystack_.size ()) + { + yy_destroy_ (YY_NULLPTR, yystack_[0]); + yypop_ (); + } + throw; + } +#endif // YY_EXCEPTIONS + } + + void + parser::error (const syntax_error& yyexc) + { + error (yyexc.location, yyexc.what ()); + } + + const char * + parser::symbol_name (symbol_kind_type yysymbol) + { + static const char *const yy_sname[] = + { + "end of file", "error", "invalid token", "#include", "#using_animtree", + "#animtree", "endon", "notify", "wait", "waittill", "waittillmatch", + "waittillframeend", "waitframe", "if", "else", "while", "for", "foreach", + "in", "switch", "case", "default", "break", "continue", "return", + "thread", "childthread", "thisthread", "call", "true", "false", + "undefined", "size", "game", "self", "anim", "level", "(", ")", "{", "}", + "[", "]", ",", ".", "::", ":", ";", "++", "--", "<<", ">>", "||", "&&", + "==", "!=", "<=", ">=", "<", ">", "!", "~", "=", "+=", "-=", "*=", "/=", + "%=", "|=", "&=", "^=", ">>=", "<<=", "|", "&", "^", "+", "-", "*", "/", + "%", "file path", "identifier", "string literal", "localized string", + "float", "int", "ADD_ARRAY", "THEN", "NEG", "ANIMREF", "PREINC", + "PREDEC", "POSTINC", "POSTDEC", "$accept", "root", "program", "include", + "define", "usingtree", "constant", "thread", "parameters", "stmt", + "stmt_block", "stmt_list", "stmt_call", "stmt_assign", "stmt_endon", + "stmt_notify", "stmt_wait", "stmt_waittill", "stmt_waittillmatch", + "stmt_waittillframeend", "stmt_waitframe", "stmt_if", "stmt_ifelse", + "stmt_while", "stmt_for", "stmt_foreach", "stmt_switch", "stmt_case", + "stmt_default", "stmt_break", "stmt_continue", "stmt_return", "for_stmt", + "for_expr", "expr", "expr_assign", "expr_compare", "expr_binary", + "expr_primitive", "expr_call", "expr_call_thread", + "expr_call_childthread", "expr_call_function", "expr_call_pointer", + "expr_arguments", "expr_arguments_filled", "expr_arguments_empty", + "expr_function", "expr_add_array", "expr_array", "expr_field", + "expr_size", "object", "thisthread", "empty_array", "undefined", "game", + "self", "anim", "level", "animation", "animtree", "name", "file", + "istring", "string", "vector", "neg_float", "neg_integer", "float", + "integer", "false", "true", YY_NULLPTR + }; + return yy_sname[yysymbol]; + } + + + + // parser::context. + parser::context::context (const parser& yyparser, const symbol_type& yyla) + : yyparser_ (yyparser) + , yyla_ (yyla) + {} + + int + parser::context::expected_tokens (symbol_kind_type yyarg[], int yyargn) const + { + // Actual number of expected tokens + int yycount = 0; + +#if S1DEBUG + // Execute LAC once. We don't care if it is successful, we + // only do it for the sake of debugging output. + if (!yyparser_.yy_lac_established_) + yyparser_.yy_lac_check_ (yyla_.kind ()); +#endif + + for (int yyx = 0; yyx < YYNTOKENS; ++yyx) + { + symbol_kind_type yysym = YY_CAST (symbol_kind_type, yyx); + if (yysym != symbol_kind::S_YYerror + && yysym != symbol_kind::S_YYUNDEF + && yyparser_.yy_lac_check_ (yysym)) + { + if (!yyarg) + ++yycount; + else if (yycount == yyargn) + return 0; + else + yyarg[yycount++] = yysym; + } + } + if (yyarg && yycount == 0 && 0 < yyargn) + yyarg[0] = symbol_kind::S_YYEMPTY; + return yycount; + } + + + bool + parser::yy_lac_check_ (symbol_kind_type yytoken) const + { + // Logically, the yylac_stack's lifetime is confined to this function. + // Clear it, to get rid of potential left-overs from previous call. + yylac_stack_.clear (); + // Reduce until we encounter a shift and thereby accept the token. +#if S1DEBUG + YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; +#endif + std::ptrdiff_t lac_top = 0; + while (true) + { + state_type top_state = (yylac_stack_.empty () + ? yystack_[lac_top].state + : yylac_stack_.back ()); + int yyrule = yypact_[+top_state]; + if (yy_pact_value_is_default_ (yyrule) + || (yyrule += yytoken) < 0 || yylast_ < yyrule + || yycheck_[yyrule] != yytoken) + { + // Use the default action. + yyrule = yydefact_[+top_state]; + if (yyrule == 0) + { + YYCDEBUG << " Err\n"; + return false; + } + } + else + { + // Use the action from yytable. + yyrule = yytable_[yyrule]; + if (yy_table_value_is_error_ (yyrule)) + { + YYCDEBUG << " Err\n"; + return false; + } + if (0 < yyrule) + { + YYCDEBUG << " S" << yyrule << '\n'; + return true; + } + yyrule = -yyrule; + } + // By now we know we have to simulate a reduce. + YYCDEBUG << " R" << yyrule - 1; + // Pop the corresponding number of values from the stack. + { + std::ptrdiff_t yylen = yyr2_[yyrule]; + // First pop from the LAC stack as many tokens as possible. + std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); + if (yylen < lac_size) + { + yylac_stack_.resize (std::size_t (lac_size - yylen)); + yylen = 0; + } + else if (lac_size) + { + yylac_stack_.clear (); + yylen -= lac_size; + } + // Only afterwards look at the main stack. + // We simulate popping elements by incrementing lac_top. + lac_top += yylen; + } + // Keep top_state in sync with the updated stack. + top_state = (yylac_stack_.empty () + ? yystack_[lac_top].state + : yylac_stack_.back ()); + // Push the resulting state of the reduction. + state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); + YYCDEBUG << " G" << int (state); + yylac_stack_.push_back (state); + } + } + + // Establish the initial context if no initial context currently exists. + bool + parser::yy_lac_establish_ (symbol_kind_type yytoken) + { + /* Establish the initial context for the current lookahead if no initial + context is currently established. + + We define a context as a snapshot of the parser stacks. We define + the initial context for a lookahead as the context in which the + parser initially examines that lookahead in order to select a + syntactic action. Thus, if the lookahead eventually proves + syntactically unacceptable (possibly in a later context reached via a + series of reductions), the initial context can be used to determine + the exact set of tokens that would be syntactically acceptable in the + lookahead's place. Moreover, it is the context after which any + further semantic actions would be erroneous because they would be + determined by a syntactically unacceptable token. + + yy_lac_establish_ should be invoked when a reduction is about to be + performed in an inconsistent state (which, for the purposes of LAC, + includes consistent states that don't know they're consistent because + their default reductions have been disabled). + + For parse.lac=full, the implementation of yy_lac_establish_ is as + follows. If no initial context is currently established for the + current lookahead, then check if that lookahead can eventually be + shifted if syntactic actions continue from the current context. */ + if (!yy_lac_established_) + { +#if S1DEBUG + YYCDEBUG << "LAC: initial context established for " + << symbol_name (yytoken) << '\n'; +#endif + yy_lac_established_ = true; + return yy_lac_check_ (yytoken); + } + return true; + } + + // Discard any previous initial lookahead context. + void + parser::yy_lac_discard_ (const char* evt) + { + /* Discard any previous initial lookahead context because of Event, + which may be a lookahead change or an invalidation of the currently + established initial context for the current lookahead. + + The most common example of a lookahead change is a shift. An example + of both cases is syntax error recovery. That is, a syntax error + occurs when the lookahead is syntactically erroneous for the + currently established initial context, so error recovery manipulates + the parser stacks to try to find a new initial context in which the + current lookahead is syntactically acceptable. If it fails to find + such a context, it discards the lookahead. */ + if (yy_lac_established_) + { + YYCDEBUG << "LAC: initial context discarded due to " + << evt << '\n'; + yy_lac_established_ = false; + } + } + + int + parser::yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const + { + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yyla) is + if this state is a consistent state with a default action. + Thus, detecting the absence of a lookahead is sufficient to + determine that there is no unexpected or expected token to + report. In that case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is + a consistent state with a default action. There might have + been a previous inconsistent state, consistent state with a + non-default action, or user semantic action that manipulated + yyla. (However, yyla is currently not documented for users.) + In the first two cases, it might appear that the current syntax + error should have been detected in the previous state when + yy_lac_check was invoked. However, at that time, there might + have been a different syntax error that discarded a different + initial context during error recovery, leaving behind the + current lookahead. + */ + + if (!yyctx.lookahead ().empty ()) + { + if (yyarg) + yyarg[0] = yyctx.token (); + int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); + return yyn + 1; + } + return 0; + } + + // Generate an error message. + std::string + parser::yysyntax_error_ (const context& yyctx) const + { + // Its maximum. + enum { YYARGS_MAX = 5 }; + // Arguments of yyformat. + symbol_kind_type yyarg[YYARGS_MAX]; + int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); + + char const* yyformat = YY_NULLPTR; + switch (yycount) + { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + default: // Avoid compiler warnings. + YYCASE_ (0, YY_("syntax error")); + YYCASE_ (1, YY_("syntax error, unexpected %s")); + YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +#undef YYCASE_ + } + + std::string yyres; + // Argument number. + std::ptrdiff_t yyi = 0; + for (char const* yyp = yyformat; *yyp; ++yyp) + if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) + { + yyres += symbol_name (yyarg[yyi++]); + ++yyp; + } + else + yyres += *yyp; + return yyres; + } + + + const short parser::yypact_ninf_ = -230; + + const short parser::yytable_ninf_ = -177; + + const short + parser::yypact_[] = + { + 7, -67, -20, -230, 53, 7, -230, -230, -230, -230, + -230, -21, -230, 13, -10, -230, -230, -230, -3, 607, + -230, -230, 25, -15, -230, -230, 41, 41, -230, 29, + -230, -230, -230, -230, -230, -230, -230, 607, 480, -3, + 607, 607, -50, -1, -230, -230, -230, 1341, -230, -230, + -230, 18, -230, -230, -230, -230, -230, -230, 23, 30, + -230, 332, -230, -230, -230, 446, 507, 569, 573, -230, + -230, -4, 38, -230, -230, -230, -230, -230, -230, -230, + -230, -230, 47, 85, -3, 56, -230, -230, 84, 64, + -230, -230, 86, 905, 480, -230, 1419, 90, 95, -230, + -230, -230, -230, -230, -230, -230, -230, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 41, 41, 669, -17, -230, + -230, 607, -3, -230, 787, -230, -230, 607, -3, 607, + -230, 607, 1212, 607, -230, 124, 124, 1429, 938, 1501, + 1501, 40, 40, 40, 40, 981, 1460, 1470, 101, 101, + -230, -230, -230, -230, -230, -230, -230, 1251, -230, -230, + -13, -230, 103, 607, 94, -18, 123, 126, 128, 130, + 131, 9, 125, 135, 138, 545, -230, 732, 732, -230, + -230, 826, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, 139, 143, 148, -230, -230, 715, -230, -230, + -230, -230, 84, 1212, 103, 1290, 1328, 133, 1419, -230, + -230, 607, 1375, -230, 132, -230, 607, 607, 630, -3, + 607, 91, 151, 159, 160, -230, -230, -230, -230, 1388, + -230, 6, 6, -230, -230, -230, -230, -230, 152, 172, + 173, 174, -3, -230, -230, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 170, 607, 176, 14, + -230, 177, 1044, 1077, 178, -230, 868, 2, 1087, -230, + -230, -230, -230, 607, 607, 607, 607, 1419, 1419, 1419, + 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 182, 1120, + 607, -230, -230, 865, 865, 607, 607, -3, 85, 1130, + 948, 991, 1034, 607, -230, 42, 207, -230, 187, 1419, + 1163, 205, -230, 188, 190, 607, 193, 607, 195, 607, + 55, -230, 865, 630, 865, 607, -230, -230, 58, -230, + 70, -230, 72, -230, -230, 206, -230, 1173, 198, 199, + 200, 865, 865, -230, -230, -230, -230, -230 + }; + + const unsigned char + parser::yydefact_[] = + { + 3, 0, 0, 186, 0, 2, 6, 7, 9, 10, + 11, 0, 187, 0, 0, 1, 4, 5, 17, 0, + 8, 189, 0, 0, 16, 185, 0, 0, 177, 0, + 196, 195, 179, 180, 181, 182, 183, 0, 162, 0, + 0, 0, 0, 0, 188, 193, 194, 0, 76, 77, + 78, 115, 116, 117, 142, 143, 118, 119, 120, 121, + 122, 0, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 0, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 0, 0, 0, 0, 146, 147, 0, 0, + 150, 151, 0, 0, 162, 178, 161, 0, 158, 159, + 163, 114, 113, 191, 192, 184, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, + 145, 162, 0, 12, 0, 14, 15, 0, 0, 0, + 112, 0, 161, 0, 165, 105, 106, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 107, 108, + 109, 110, 111, 148, 149, 152, 153, 0, 168, 167, + 0, 158, 164, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 40, 0, 0, 42, + 18, 0, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 0, 169, 0, 170, 171, 0, 172, 173, + 174, 175, 176, 0, 0, 0, 0, 0, 160, 166, + 154, 162, 0, 54, 0, 55, 0, 0, 73, 0, + 0, 0, 0, 0, 0, 67, 68, 69, 71, 0, + 169, 79, 80, 39, 41, 45, 43, 44, 0, 0, + 0, 0, 0, 81, 82, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 0, 72, 0, 0, 0, 66, + 65, 64, 70, 0, 0, 0, 0, 83, 89, 90, + 91, 92, 93, 84, 85, 86, 88, 87, 0, 0, + 162, 155, 56, 0, 0, 75, 0, 0, 0, 0, + 0, 0, 0, 162, 190, 0, 57, 59, 0, 74, + 0, 0, 63, 0, 0, 162, 0, 162, 0, 162, + 0, 156, 0, 73, 0, 0, 46, 48, 0, 51, + 0, 53, 0, 157, 58, 0, 61, 0, 0, 0, + 0, 0, 0, 47, 50, 52, 60, 62 + }; + + const short + parser::yypgoto_[] = + { + -230, -230, -230, 243, 244, -230, -230, -230, -230, -178, + -82, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -93, -230, 35, -229, -230, -230, -230, 27, + 142, -230, -23, -19, 68, -26, -230, -230, -230, 39, + 73, -230, 82, -230, -230, -230, 97, 107, 134, 241, + -230, -230, 0, 5, -230, -12, -230, -230, 74, -230, + 77, -230, -230 + }; + + const short + parser::yydefgoto_[] = + { + 0, 4, 5, 6, 7, 8, 9, 10, 23, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 284, 328, 96, 212, 48, 49, 50, 51, + 52, 53, 54, 55, 97, 171, 99, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81 + }; + + const short + parser::yytable_[] = + { + 11, 135, 22, 86, 90, 11, 13, 87, 91, 285, + 1, 2, 98, 254, 12, 168, 18, 14, 24, 234, + 316, -176, -176, 83, -176, 230, 88, 88, 84, 235, + 143, 89, 89, 131, 29, 103, 104, -176, 129, 100, + -176, 19, 130, -169, -169, 317, -169, 127, -170, -170, + 262, -170, 311, 15, 47, -171, -171, 143, -171, -169, + 20, 88, -169, 82, -170, 3, 89, -170, 98, 29, + 92, -171, 93, 21, -171, 101, 102, -176, -176, 3, + 341, 105, 85, 132, 136, 143, 241, 12, 3, 3, + 107, 108, 21, 353, 133, 46, 358, 137, 143, -169, + -169, 143, 163, 165, -170, -170, 164, 166, 359, 138, + 360, -171, -171, 143, 285, 143, 120, 121, 122, 123, + 124, 131, 12, 3, 134, 88, 88, 139, 169, 142, + 89, 89, 172, 143, 222, 326, 327, 144, 224, 89, + 231, 233, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 236, 213, 167, 237, 354, 238, 356, 239, 240, 242, + 281, 245, 223, 215, 225, 278, 226, 104, 228, 122, + 123, 124, 246, 366, 367, 247, 255, 222, 222, 293, + 256, 222, 89, 89, 129, 257, 89, 289, 130, 170, + 120, 121, 122, 123, 124, 290, 291, 216, 232, 294, + 295, 296, 308, 310, 250, 250, 217, 88, 213, 323, + 249, 342, 89, 345, 312, 315, 215, 215, 129, 129, + 215, 218, 130, 130, 343, 346, 332, 347, 222, 287, + 349, 219, 351, 89, 361, 363, 364, 365, 16, 17, + 355, 88, 88, 0, 0, 243, 89, 89, 244, 0, + 216, 216, 169, 129, 216, 250, 0, 130, 220, 251, + 252, 282, 283, 217, 0, 288, 214, 215, 0, 0, + 0, 0, 0, 0, 218, 218, 88, 0, 218, 0, + 0, 89, 0, 0, 219, 219, 0, 0, 219, 279, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 216, 309, 222, 222, 0, 0, 331, 89, 89, + 286, 220, 220, 0, 0, 220, 0, 0, 319, 320, + 321, 322, 0, 214, 0, 218, 0, 0, 0, 0, + 213, 213, 222, 222, 222, 219, 0, 89, 89, 89, + 329, 330, 215, 215, 0, 0, 0, 125, 126, 0, + 29, 222, 222, 0, 0, 0, 89, 89, 0, 213, + 250, 213, 220, 127, 0, 221, 128, 0, 325, 0, + 357, 215, 215, 215, 0, 0, 216, 216, 213, 213, + 0, 340, 0, 0, 0, 217, 217, 0, 0, 0, + 215, 215, 0, 348, 0, 350, 0, 352, 0, 0, + 218, 218, 0, 12, 3, 216, 216, 216, 0, 0, + 219, 219, 0, 0, 217, 286, 217, 0, 221, 221, + 0, 0, 221, 0, 216, 216, 0, 0, 0, 218, + 218, 218, 0, 217, 217, 0, 0, 220, 220, 219, + 219, 219, 0, 0, 0, 214, 214, 0, 218, 218, + 0, 0, 0, 0, 0, 0, 0, 0, 219, 219, + 0, -172, -172, 0, -172, 0, 220, 220, 220, 221, + 0, 0, 0, 0, 214, 25, 214, -172, 0, 0, + -172, 0, 0, 0, 0, 220, 220, 0, 0, 0, + 0, 0, 0, 214, 214, 26, 27, 28, 29, 30, + 31, 32, 0, 33, 34, 35, 36, 37, 0, 0, + 0, 94, 95, 0, 0, 39, 0, -172, -172, 0, + 0, 0, -173, -173, 0, -173, 0, 0, 0, 0, + 40, 41, 0, 0, 0, 0, 0, 0, -173, 0, + 25, -173, 0, 0, 221, 221, 0, 42, 0, 0, + 43, 12, 3, 21, 44, 45, 46, 0, 0, 0, + 26, 27, 28, 29, 30, 31, 32, 0, 33, 34, + 35, 36, 37, 221, 221, 221, 38, 0, -173, -173, + 39, 0, 248, 0, -174, -174, 0, -174, -175, -175, + 0, -175, 221, 221, 0, 40, 41, 0, 0, 0, + -174, 0, 25, -174, -175, 0, 0, -175, 0, 0, + 0, 0, 42, 0, 0, 43, 12, 3, 21, 44, + 45, 46, 26, 27, 28, 29, 30, 31, 32, 0, + 33, 34, 35, 36, 37, 0, 0, 0, 38, 0, + -174, -174, 39, 0, -175, -175, 0, 0, 29, 0, + 0, 0, 0, 33, 34, 35, 36, 40, 41, 0, + 0, 85, 0, 0, 25, 0, 0, 0, 187, 188, + 0, 0, 0, 0, 42, 0, 0, 43, 12, 3, + 21, 44, 45, 46, 26, 27, 28, 29, 30, 31, + 32, 0, 33, 34, 35, 36, 37, 0, 0, 0, + 94, 12, 3, 0, 39, 0, 0, 0, 0, 0, + 0, 258, 259, 0, 260, 261, 0, 0, 0, 40, + 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 29, 0, 0, 42, 0, 0, 43, + 12, 3, 21, 44, 45, 46, 127, 0, 0, 262, + 29, 0, 0, 263, 264, 33, 34, 35, 36, 0, + 0, 0, 0, 85, 0, 0, 0, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 0, 0, + 0, 0, 0, 0, 0, 173, 12, 3, 174, 175, + 176, 0, 177, 178, 179, 0, 180, 181, 182, 183, + 184, 185, 26, 12, 3, 29, 0, 0, 0, 0, + 33, 34, 35, 36, 0, 0, 134, 186, 85, 0, + 0, 0, 0, 0, 173, 187, 188, 174, 175, 176, + 0, 177, 178, 179, 0, 180, 181, 182, 183, 184, + 185, 26, 0, 0, 29, 0, 0, 0, 0, 33, + 34, 35, 36, 0, 0, 134, 253, 85, 12, 3, + 0, 0, 0, 173, 187, 188, 174, 175, 176, 0, + 177, 178, 179, 0, 180, 181, 182, 183, 184, 185, + 26, 0, 0, 29, 0, 0, 29, 0, 33, 34, + 35, 36, 0, 0, 134, 0, 85, 12, 3, 127, + 0, 0, 262, 187, 188, 0, 263, 264, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 0, 0, 140, 0, 0, 12, 3, 141, 12, + 3, 0, 0, 0, 0, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, + 119, 120, 121, 122, 123, 124, 334, 0, 107, 108, + 0, 335, 111, 112, 113, 114, 115, 116, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 0, 0, + 0, 117, 118, 119, 120, 121, 122, 123, 124, 0, + 0, 117, 118, 119, 120, 121, 122, 123, 124, 336, + 0, 107, 108, 0, 337, 111, 112, 113, 114, 115, + 116, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 0, 0, 117, 118, 119, 120, 121, 122, + 123, 124, 338, 0, 0, 0, 0, 339, 0, 0, + 0, 0, 313, 0, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 0, 0, 0, 117, 118, 119, + 120, 121, 122, 123, 124, 314, 0, 117, 118, 119, + 120, 121, 122, 123, 124, 318, 0, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 0, 0, 0, + 117, 118, 119, 120, 121, 122, 123, 124, 324, 0, + 117, 118, 119, 120, 121, 122, 123, 124, 333, 0, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, + 124, 344, 0, 117, 118, 119, 120, 121, 122, 123, + 124, 362, 0, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 0, 0, 0, 117, 118, 119, 120, + 121, 122, 123, 124, 0, 0, 117, 118, 119, 120, + 121, 122, 123, 124, 227, 0, 0, 0, 0, 0, + 0, 0, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 117, 118, 119, 120, 121, + 122, 123, 124, 229, 0, 0, 0, 0, 0, 0, + 0, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 117, 118, 119, 120, 121, 122, + 123, 124, 276, 0, 0, 0, 0, 0, 0, 0, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, + 124, 277, 0, 0, 0, 0, 0, 0, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 106, 0, + 0, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 0, + 0, 0, 0, 0, 117, 118, 119, 120, 121, 122, + 123, 124, 280, 0, 0, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 292, 0, 0, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 0, 0, 0, 0, + 0, 117, 118, 119, 120, 121, 122, 123, 124, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 107, + 108, 0, 110, 111, 112, 113, 114, 115, 116, 0, + 0, 0, 117, 118, 119, 120, 121, 122, 123, 124, + 0, 0, 117, 118, 119, 120, 121, 122, 123, 124, + 107, 108, 0, 0, 111, 112, 113, 114, 115, 116, + 107, 108, 0, 0, 111, 112, 113, 114, 115, 116, + 0, 0, 0, 0, 0, 119, 120, 121, 122, 123, + 124, 0, 0, 0, 0, 0, 120, 121, 122, 123, + 124, 107, 108, 0, 0, 0, 0, 113, 114, 115, + 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 120, 121, 122, + 123, 124 + }; + + const short + parser::yycheck_[] = + { + 0, 83, 14, 26, 27, 5, 1, 26, 27, 238, + 3, 4, 38, 191, 81, 32, 37, 37, 18, 37, + 18, 25, 26, 38, 28, 38, 26, 27, 43, 47, + 43, 26, 27, 37, 28, 85, 86, 41, 61, 39, + 44, 62, 61, 25, 26, 43, 28, 41, 25, 26, + 44, 28, 38, 0, 19, 25, 26, 43, 28, 41, + 47, 61, 44, 38, 41, 82, 61, 44, 94, 28, + 41, 41, 37, 83, 44, 40, 41, 81, 82, 82, + 38, 82, 41, 45, 84, 43, 77, 81, 82, 82, + 50, 51, 83, 38, 47, 86, 38, 41, 43, 81, + 82, 43, 125, 126, 81, 82, 125, 126, 38, 45, + 38, 81, 82, 43, 343, 43, 76, 77, 78, 79, + 80, 37, 81, 82, 39, 125, 126, 41, 128, 94, + 125, 126, 132, 43, 134, 313, 314, 42, 138, 134, + 37, 47, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 37, 134, 127, 37, 342, 37, 344, 37, 37, 181, + 38, 46, 137, 134, 139, 42, 141, 86, 143, 78, + 79, 80, 47, 361, 362, 47, 47, 187, 188, 37, + 47, 191, 187, 188, 217, 47, 191, 46, 217, 131, + 76, 77, 78, 79, 80, 46, 46, 134, 173, 37, + 37, 37, 42, 37, 187, 188, 134, 217, 191, 37, + 185, 14, 217, 18, 47, 47, 187, 188, 251, 252, + 191, 134, 251, 252, 47, 47, 318, 47, 238, 239, + 47, 134, 47, 238, 38, 47, 47, 47, 5, 5, + 343, 251, 252, -1, -1, 181, 251, 252, 181, -1, + 187, 188, 262, 286, 191, 238, -1, 286, 134, 187, + 188, 236, 237, 191, -1, 240, 134, 238, -1, -1, + -1, -1, -1, -1, 187, 188, 286, -1, 191, -1, + -1, 286, -1, -1, 187, 188, -1, -1, 191, 231, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 238, 277, 313, 314, -1, -1, 317, 313, 314, + 238, 187, 188, -1, -1, 191, -1, -1, 293, 294, + 295, 296, -1, 191, -1, 238, -1, -1, -1, -1, + 313, 314, 342, 343, 344, 238, -1, 342, 343, 344, + 315, 316, 313, 314, -1, -1, -1, 25, 26, -1, + 28, 361, 362, -1, -1, -1, 361, 362, -1, 342, + 343, 344, 238, 41, -1, 134, 44, -1, 310, -1, + 345, 342, 343, 344, -1, -1, 313, 314, 361, 362, + -1, 323, -1, -1, -1, 313, 314, -1, -1, -1, + 361, 362, -1, 335, -1, 337, -1, 339, -1, -1, + 313, 314, -1, 81, 82, 342, 343, 344, -1, -1, + 313, 314, -1, -1, 342, 343, 344, -1, 187, 188, + -1, -1, 191, -1, 361, 362, -1, -1, -1, 342, + 343, 344, -1, 361, 362, -1, -1, 313, 314, 342, + 343, 344, -1, -1, -1, 313, 314, -1, 361, 362, + -1, -1, -1, -1, -1, -1, -1, -1, 361, 362, + -1, 25, 26, -1, 28, -1, 342, 343, 344, 238, + -1, -1, -1, -1, 342, 5, 344, 41, -1, -1, + 44, -1, -1, -1, -1, 361, 362, -1, -1, -1, + -1, -1, -1, 361, 362, 25, 26, 27, 28, 29, + 30, 31, -1, 33, 34, 35, 36, 37, -1, -1, + -1, 41, 42, -1, -1, 45, -1, 81, 82, -1, + -1, -1, 25, 26, -1, 28, -1, -1, -1, -1, + 60, 61, -1, -1, -1, -1, -1, -1, 41, -1, + 5, 44, -1, -1, 313, 314, -1, 77, -1, -1, + 80, 81, 82, 83, 84, 85, 86, -1, -1, -1, + 25, 26, 27, 28, 29, 30, 31, -1, 33, 34, + 35, 36, 37, 342, 343, 344, 41, -1, 81, 82, + 45, -1, 47, -1, 25, 26, -1, 28, 25, 26, + -1, 28, 361, 362, -1, 60, 61, -1, -1, -1, + 41, -1, 5, 44, 41, -1, -1, 44, -1, -1, + -1, -1, 77, -1, -1, 80, 81, 82, 83, 84, + 85, 86, 25, 26, 27, 28, 29, 30, 31, -1, + 33, 34, 35, 36, 37, -1, -1, -1, 41, -1, + 81, 82, 45, -1, 81, 82, -1, -1, 28, -1, + -1, -1, -1, 33, 34, 35, 36, 60, 61, -1, + -1, 41, -1, -1, 5, -1, -1, -1, 48, 49, + -1, -1, -1, -1, 77, -1, -1, 80, 81, 82, + 83, 84, 85, 86, 25, 26, 27, 28, 29, 30, + 31, -1, 33, 34, 35, 36, 37, -1, -1, -1, + 41, 81, 82, -1, 45, -1, -1, -1, -1, -1, + -1, 6, 7, -1, 9, 10, -1, -1, -1, 60, + 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 25, -1, -1, 28, -1, -1, 77, -1, -1, 80, + 81, 82, 83, 84, 85, 86, 41, -1, -1, 44, + 28, -1, -1, 48, 49, 33, 34, 35, 36, -1, + -1, -1, -1, 41, -1, -1, -1, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, -1, -1, + -1, -1, -1, -1, -1, 8, 81, 82, 11, 12, + 13, -1, 15, 16, 17, -1, 19, 20, 21, 22, + 23, 24, 25, 81, 82, 28, -1, -1, -1, -1, + 33, 34, 35, 36, -1, -1, 39, 40, 41, -1, + -1, -1, -1, -1, 8, 48, 49, 11, 12, 13, + -1, 15, 16, 17, -1, 19, 20, 21, 22, 23, + 24, 25, -1, -1, 28, -1, -1, -1, -1, 33, + 34, 35, 36, -1, -1, 39, 40, 41, 81, 82, + -1, -1, -1, 8, 48, 49, 11, 12, 13, -1, + 15, 16, 17, -1, 19, 20, 21, 22, 23, 24, + 25, -1, -1, 28, -1, -1, 28, -1, 33, 34, + 35, 36, -1, -1, 39, -1, 41, 81, 82, 41, + -1, -1, 44, 48, 49, -1, 48, 49, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, -1, -1, 38, -1, -1, 81, 82, 43, 81, + 82, -1, -1, -1, -1, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 73, 74, + 75, 76, 77, 78, 79, 80, 38, -1, 50, 51, + -1, 43, 54, 55, 56, 57, 58, 59, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, -1, -1, + -1, 73, 74, 75, 76, 77, 78, 79, 80, -1, + -1, 73, 74, 75, 76, 77, 78, 79, 80, 38, + -1, 50, 51, -1, 43, 54, 55, 56, 57, 58, + 59, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, -1, -1, -1, -1, 74, 75, 76, 77, 78, + 79, 80, -1, -1, 73, 74, 75, 76, 77, 78, + 79, 80, 38, -1, -1, -1, -1, 43, -1, -1, + -1, -1, 38, -1, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, -1, -1, -1, 73, 74, 75, + 76, 77, 78, 79, 80, 38, -1, 73, 74, 75, + 76, 77, 78, 79, 80, 38, -1, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, -1, -1, -1, + 73, 74, 75, 76, 77, 78, 79, 80, 38, -1, + 73, 74, 75, 76, 77, 78, 79, 80, 38, -1, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + -1, -1, -1, 73, 74, 75, 76, 77, 78, 79, + 80, 38, -1, 73, 74, 75, 76, 77, 78, 79, + 80, 38, -1, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, -1, -1, -1, 73, 74, 75, 76, + 77, 78, 79, 80, -1, -1, 73, 74, 75, 76, + 77, 78, 79, 80, 42, -1, -1, -1, -1, -1, + -1, -1, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 73, 74, 75, 76, 77, + 78, 79, 80, 42, -1, -1, -1, -1, -1, -1, + -1, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 73, 74, 75, 76, 77, 78, + 79, 80, 42, -1, -1, -1, -1, -1, -1, -1, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 73, 74, 75, 76, 77, 78, 79, + 80, 43, -1, -1, -1, -1, -1, -1, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 47, -1, + -1, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 73, 74, 75, 76, 77, 78, 79, 80, -1, + -1, -1, -1, -1, 73, 74, 75, 76, 77, 78, + 79, 80, 47, -1, -1, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 47, -1, -1, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 73, 74, + 75, 76, 77, 78, 79, 80, -1, -1, -1, -1, + -1, 73, 74, 75, 76, 77, 78, 79, 80, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 50, + 51, -1, 53, 54, 55, 56, 57, 58, 59, -1, + -1, -1, 73, 74, 75, 76, 77, 78, 79, 80, + -1, -1, 73, 74, 75, 76, 77, 78, 79, 80, + 50, 51, -1, -1, 54, 55, 56, 57, 58, 59, + 50, 51, -1, -1, 54, 55, 56, 57, 58, 59, + -1, -1, -1, -1, -1, 75, 76, 77, 78, 79, + 80, -1, -1, -1, -1, -1, 76, 77, 78, 79, + 80, 50, 51, -1, -1, -1, -1, 56, 57, 58, + 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 76, 77, 78, + 79, 80 + }; + + const unsigned char + parser::yystos_[] = + { + 0, 3, 4, 82, 96, 97, 98, 99, 100, 101, + 102, 157, 81, 158, 37, 0, 98, 99, 37, 62, + 47, 83, 160, 103, 157, 5, 25, 26, 27, 28, + 29, 30, 31, 33, 34, 35, 36, 37, 41, 45, + 60, 61, 77, 80, 84, 85, 86, 129, 131, 132, + 133, 134, 135, 136, 137, 138, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 38, 38, 43, 41, 137, 138, 157, 158, + 137, 138, 41, 129, 41, 42, 129, 139, 140, 141, + 157, 129, 129, 85, 86, 82, 47, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 73, 74, 75, + 76, 77, 78, 79, 80, 25, 26, 41, 44, 137, + 138, 37, 45, 47, 39, 105, 157, 41, 45, 41, + 38, 43, 129, 43, 42, 129, 129, 129, 129, 129, + 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, + 129, 129, 129, 137, 138, 137, 138, 129, 32, 157, + 139, 140, 157, 8, 11, 12, 13, 15, 16, 17, + 19, 20, 21, 22, 23, 24, 40, 48, 49, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 130, 134, 135, 144, 145, 147, 151, 152, + 153, 154, 157, 129, 157, 129, 129, 42, 129, 42, + 38, 37, 129, 47, 37, 47, 37, 37, 37, 37, + 37, 77, 160, 163, 165, 46, 47, 47, 47, 129, + 134, 147, 147, 40, 104, 47, 47, 47, 6, 7, + 9, 10, 44, 48, 49, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 42, 43, 42, 139, + 47, 38, 129, 129, 127, 130, 147, 157, 129, 46, + 46, 46, 47, 37, 37, 37, 37, 129, 129, 129, + 129, 129, 129, 129, 129, 129, 129, 129, 42, 129, + 37, 38, 47, 38, 38, 47, 18, 43, 38, 129, + 129, 129, 129, 37, 38, 139, 104, 104, 128, 129, + 129, 157, 105, 38, 38, 43, 38, 43, 38, 43, + 139, 38, 14, 47, 38, 18, 47, 47, 139, 47, + 139, 47, 139, 38, 104, 127, 104, 129, 38, 38, + 38, 38, 38, 47, 47, 47, 104, 104 + }; + + const unsigned char + parser::yyr1_[] = + { + 0, 95, 96, 96, 97, 97, 97, 97, 98, 99, + 99, 99, 100, 101, 102, 103, 103, 103, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 105, + 105, 106, 106, 107, 107, 108, 109, 110, 110, 111, + 112, 112, 113, 113, 114, 115, 115, 116, 117, 118, + 119, 120, 120, 121, 122, 122, 122, 123, 124, 125, + 126, 126, 127, 127, 128, 128, 129, 129, 129, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 131, 131, 131, 131, 131, 131, + 131, 131, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 133, 133, 133, 133, 133, 133, 133, 133, + 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, + 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, + 133, 133, 134, 134, 134, 134, 135, 135, 135, 135, + 136, 136, 136, 136, 137, 137, 138, 138, 139, 139, + 140, 140, 141, 142, 142, 143, 144, 145, 146, 147, + 147, 147, 147, 147, 147, 147, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167 + }; + + const signed char + parser::yyr2_[] = + { + 0, 2, 1, 0, 2, 2, 1, 1, 3, 1, + 1, 1, 5, 4, 5, 3, 1, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 2, 2, 1, 2, 2, 2, 6, 8, 6, 3, + 8, 6, 8, 6, 2, 2, 4, 5, 7, 5, + 9, 7, 9, 5, 3, 3, 3, 2, 2, 2, + 3, 2, 1, 0, 1, 0, 1, 1, 1, 2, + 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 2, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, + 2, 2, 3, 3, 4, 6, 8, 9, 1, 1, + 3, 1, 0, 2, 3, 3, 4, 3, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, + 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, + 7, 2, 2, 1, 1, 1, 1 + }; + + + + +#if S1DEBUG + const short + parser::yyrline_[] = + { + 0, 233, 233, 234, 238, 240, 242, 244, 249, 254, + 255, 256, 260, 265, 270, 275, 277, 280, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 308, + 309, 313, 315, 320, 322, 327, 332, 337, 339, 344, + 349, 351, 356, 358, 363, 368, 370, 375, 380, 385, + 390, 395, 397, 402, 407, 409, 411, 416, 421, 426, + 431, 433, 438, 439, 443, 444, 448, 449, 450, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 472, 473, 474, 475, 476, 477, + 478, 479, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 496, 497, 498, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, + 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, + 524, 525, 529, 530, 531, 532, 536, 537, 538, 539, + 543, 544, 545, 546, 550, 552, 557, 559, 564, 565, + 569, 571, 577, 581, 583, 588, 593, 598, 603, 608, + 609, 610, 611, 612, 613, 614, 615, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637 + }; + + void + parser::yy_stack_print_ () const + { + *yycdebug_ << "Stack now"; + for (stack_type::const_iterator + i = yystack_.begin (), + i_end = yystack_.end (); + i != i_end; ++i) + *yycdebug_ << ' ' << int (i->state); + *yycdebug_ << '\n'; + } + + void + parser::yy_reduce_print_ (int yyrule) const + { + int yylno = yyrline_[yyrule]; + int yynrhs = yyr2_[yyrule]; + // Print the symbols being reduced, and their result. + *yycdebug_ << "Reducing stack by rule " << yyrule - 1 + << " (line " << yylno << "):\n"; + // The symbols being reduced. + for (int yyi = 0; yyi < yynrhs; yyi++) + YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", + yystack_[(yynrhs) - (yyi + 1)]); + } +#endif // S1DEBUG + + +#line 13 "parser.ypp" +} } } // xsk::gsc::s1 +#line 3987 "parser.cpp" + +#line 639 "parser.ypp" + + +void xsk::gsc::s1::parser::error(const xsk::gsc::location& loc, const std::string& msg) +{ + throw xsk::gsc::comp_error(loc, msg); +} diff --git a/src/s1/xsk/parser.hpp b/src/s1/xsk/parser.hpp new file mode 100644 index 00000000..a1028ddc --- /dev/null +++ b/src/s1/xsk/parser.hpp @@ -0,0 +1,4768 @@ +// A Bison parser, made by GNU Bison 3.7.5. + +// Skeleton interface for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. + +// 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 . + +// As a special exception, you may create a larger work that contains +// part or all of the Bison parser skeleton and distribute that work +// under terms of your choice, so long as that work isn't itself a +// parser generator using the skeleton or a modified version thereof +// as a parser skeleton. Alternatively, if you modify or redistribute +// the parser skeleton itself, you may (at your option) remove this +// special exception, which will cause the skeleton and the resulting +// Bison output files to be licensed under the GNU General Public +// License without this special exception. + +// This special exception was added by the Free Software Foundation in +// version 2.2 of Bison. + + +/** + ** \file parser.hpp + ** Define the xsk::gsc::s1::parser class. + */ + +// C++ LALR(1) parser skeleton written by Akim Demaille. + +// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, +// especially those whose name start with YY_ or yy_. They are +// private implementation details that can be changed or removed. + +#ifndef YY_S1_PARSER_HPP_INCLUDED +# define YY_S1_PARSER_HPP_INCLUDED +// "%code requires" blocks. +#line 33 "parser.ypp" + +#include "s1.hpp" +typedef void *yyscan_t; +#define YY_DECL xsk::gsc::s1::parser::symbol_type S1lex(yyscan_t yyscanner, xsk::gsc::location& loc) + +#line 55 "parser.hpp" + +# include +# include // std::abort +# include +# include +# include +# include + +#if defined __cplusplus +# define YY_CPLUSPLUS __cplusplus +#else +# define YY_CPLUSPLUS 199711L +#endif + +// Support move semantics when possible. +#if 201103L <= YY_CPLUSPLUS +# define YY_MOVE std::move +# define YY_MOVE_OR_COPY move +# define YY_MOVE_REF(Type) Type&& +# define YY_RVREF(Type) Type&& +# define YY_COPY(Type) Type +#else +# define YY_MOVE +# define YY_MOVE_OR_COPY copy +# define YY_MOVE_REF(Type) Type& +# define YY_RVREF(Type) const Type& +# define YY_COPY(Type) const Type& +#endif + +// Support noexcept when possible. +#if 201103L <= YY_CPLUSPLUS +# define YY_NOEXCEPT noexcept +# define YY_NOTHROW +#else +# define YY_NOEXCEPT +# define YY_NOTHROW throw () +#endif + +// Support constexpr when possible. +#if 201703 <= YY_CPLUSPLUS +# define YY_CONSTEXPR constexpr +#else +# define YY_CONSTEXPR +#endif + +#include +#ifndef S1_ASSERT +# include +# define S1_ASSERT assert +#endif + + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YY_USE(E) ((void) (E)) +#else +# define YY_USE(E) /* empty */ +#endif + +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +/* Debug traces. */ +#ifndef S1DEBUG +# if defined YYDEBUG +#if YYDEBUG +# define S1DEBUG 1 +# else +# define S1DEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define S1DEBUG 1 +# endif /* ! defined YYDEBUG */ +#endif /* ! defined S1DEBUG */ + +#line 13 "parser.ypp" +namespace xsk { namespace gsc { namespace s1 { +#line 198 "parser.hpp" + + + + + /// A Bison parser. + class parser + { + public: +#ifndef S1STYPE + /// A buffer to store and retrieve objects. + /// + /// Sort of a variant, but does not keep track of the nature + /// of the stored data, since that knowledge is available + /// via the current parser state. + class semantic_type + { + public: + /// Type of *this. + typedef semantic_type self_type; + + /// Empty construction. + semantic_type () YY_NOEXCEPT + : yybuffer_ () + , yytypeid_ (YY_NULLPTR) + {} + + /// Construct and fill. + template + semantic_type (YY_RVREF (T) t) + : yytypeid_ (&typeid (T)) + { + S1_ASSERT (sizeof (T) <= size); + new (yyas_ ()) T (YY_MOVE (t)); + } + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + semantic_type (const self_type&) = delete; + /// Non copyable. + self_type& operator= (const self_type&) = delete; +#endif + + /// Destruction, allowed only if empty. + ~semantic_type () YY_NOEXCEPT + { + S1_ASSERT (!yytypeid_); + } + +# if 201103L <= YY_CPLUSPLUS + /// Instantiate a \a T in here from \a t. + template + T& + emplace (U&&... u) + { + S1_ASSERT (!yytypeid_); + S1_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (std::forward (u)...); + } +# else + /// Instantiate an empty \a T in here. + template + T& + emplace () + { + S1_ASSERT (!yytypeid_); + S1_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (); + } + + /// Instantiate a \a T in here from \a t. + template + T& + emplace (const T& t) + { + S1_ASSERT (!yytypeid_); + S1_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (t); + } +# endif + + /// Instantiate an empty \a T in here. + /// Obsolete, use emplace. + template + T& + build () + { + return emplace (); + } + + /// Instantiate a \a T in here from \a t. + /// Obsolete, use emplace. + template + T& + build (const T& t) + { + return emplace (t); + } + + /// Accessor to a built \a T. + template + T& + as () YY_NOEXCEPT + { + S1_ASSERT (yytypeid_); + S1_ASSERT (*yytypeid_ == typeid (T)); + S1_ASSERT (sizeof (T) <= size); + return *yyas_ (); + } + + /// Const accessor to a built \a T (for %printer). + template + const T& + as () const YY_NOEXCEPT + { + S1_ASSERT (yytypeid_); + S1_ASSERT (*yytypeid_ == typeid (T)); + S1_ASSERT (sizeof (T) <= size); + return *yyas_ (); + } + + /// Swap the content with \a that, of same type. + /// + /// Both variants must be built beforehand, because swapping the actual + /// data requires reading it (with as()), and this is not possible on + /// unconstructed variants: it would require some dynamic testing, which + /// should not be the variant's responsibility. + /// Swapping between built and (possibly) non-built is done with + /// self_type::move (). + template + void + swap (self_type& that) YY_NOEXCEPT + { + S1_ASSERT (yytypeid_); + S1_ASSERT (*yytypeid_ == *that.yytypeid_); + std::swap (as (), that.as ()); + } + + /// Move the content of \a that to this. + /// + /// Destroys \a that. + template + void + move (self_type& that) + { +# if 201103L <= YY_CPLUSPLUS + emplace (std::move (that.as ())); +# else + emplace (); + swap (that); +# endif + that.destroy (); + } + +# if 201103L <= YY_CPLUSPLUS + /// Move the content of \a that to this. + template + void + move (self_type&& that) + { + emplace (std::move (that.as ())); + that.destroy (); + } +#endif + + /// Copy the content of \a that to this. + template + void + copy (const self_type& that) + { + emplace (that.as ()); + } + + /// Destroy the stored \a T. + template + void + destroy () + { + as ().~T (); + yytypeid_ = YY_NULLPTR; + } + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + semantic_type (const self_type&); + /// Non copyable. + self_type& operator= (const self_type&); +#endif + + /// Accessor to raw memory as \a T. + template + T* + yyas_ () YY_NOEXCEPT + { + void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + /// Const accessor to raw memory as \a T. + template + const T* + yyas_ () const YY_NOEXCEPT + { + const void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + /// An auxiliary type to compute the largest semantic type. + union union_type + { + // anim + char dummy1[sizeof (anim_ptr)]; + + // animation + char dummy2[sizeof (animation_ptr)]; + + // animtree + char dummy3[sizeof (animtree_ptr)]; + + // constant + char dummy4[sizeof (constant_ptr)]; + + // define + char dummy5[sizeof (define_ptr)]; + + // empty_array + char dummy6[sizeof (empty_array_ptr)]; + + // expr_arguments + // expr_arguments_filled + // expr_arguments_empty + char dummy7[sizeof (expr_arguments_ptr)]; + + // expr_assign + char dummy8[sizeof (expr_assign_ptr)]; + + // expr_call + // expr_call_thread + // expr_call_childthread + char dummy9[sizeof (expr_call_ptr)]; + + // expr_call_function + // expr_call_pointer + char dummy10[sizeof (expr_call_type_ptr)]; + + // for_expr + // expr + // expr_compare + // expr_binary + // expr_primitive + char dummy11[sizeof (expr_ptr)]; + + // false + char dummy12[sizeof (false_ptr)]; + + // file + char dummy13[sizeof (file_ptr)]; + + // neg_float + // float + char dummy14[sizeof (float_ptr)]; + + // game + char dummy15[sizeof (game_ptr)]; + + // include + char dummy16[sizeof (include_ptr)]; + + // neg_integer + // integer + char dummy17[sizeof (integer_ptr)]; + + // istring + char dummy18[sizeof (istring_ptr)]; + + // level + char dummy19[sizeof (level_ptr)]; + + // name + char dummy20[sizeof (name_ptr)]; + + // expr_function + // expr_add_array + // expr_array + // expr_field + // expr_size + // object + char dummy21[sizeof (node_ptr)]; + + // parameters + char dummy22[sizeof (parameters_ptr)]; + + // program + char dummy23[sizeof (program_ptr)]; + + // self + char dummy24[sizeof (self_ptr)]; + + // "file path" + // "identifier" + // "string literal" + // "localized string" + // "float" + // "int" + char dummy25[sizeof (std::string)]; + + // stmt_assign + char dummy26[sizeof (stmt_assign_ptr)]; + + // stmt_break + char dummy27[sizeof (stmt_break_ptr)]; + + // stmt_call + char dummy28[sizeof (stmt_call_ptr)]; + + // stmt_case + char dummy29[sizeof (stmt_case_ptr)]; + + // stmt_continue + char dummy30[sizeof (stmt_continue_ptr)]; + + // stmt_default + char dummy31[sizeof (stmt_default_ptr)]; + + // stmt_endon + char dummy32[sizeof (stmt_endon_ptr)]; + + // stmt_for + char dummy33[sizeof (stmt_for_ptr)]; + + // stmt_foreach + char dummy34[sizeof (stmt_foreach_ptr)]; + + // stmt_if + char dummy35[sizeof (stmt_if_ptr)]; + + // stmt_ifelse + char dummy36[sizeof (stmt_ifelse_ptr)]; + + // stmt_block + // stmt_list + char dummy37[sizeof (stmt_list_ptr)]; + + // stmt_notify + char dummy38[sizeof (stmt_notify_ptr)]; + + // stmt + // for_stmt + char dummy39[sizeof (stmt_ptr)]; + + // stmt_return + char dummy40[sizeof (stmt_return_ptr)]; + + // stmt_switch + char dummy41[sizeof (stmt_switch_ptr)]; + + // stmt_wait + char dummy42[sizeof (stmt_wait_ptr)]; + + // stmt_waitframe + char dummy43[sizeof (stmt_waitframe_ptr)]; + + // stmt_waittill + char dummy44[sizeof (stmt_waittill_ptr)]; + + // stmt_waittillframeend + char dummy45[sizeof (stmt_waittillframeend_ptr)]; + + // stmt_waittillmatch + char dummy46[sizeof (stmt_waittillmatch_ptr)]; + + // stmt_while + char dummy47[sizeof (stmt_while_ptr)]; + + // string + char dummy48[sizeof (string_ptr)]; + + // thisthread + char dummy49[sizeof (thisthread_ptr)]; + + // thread + char dummy50[sizeof (thread_ptr)]; + + // true + char dummy51[sizeof (true_ptr)]; + + // undefined + char dummy52[sizeof (undefined_ptr)]; + + // usingtree + char dummy53[sizeof (usingtree_ptr)]; + + // vector + char dummy54[sizeof (vector_ptr)]; + }; + + /// The size of the largest semantic type. + enum { size = sizeof (union_type) }; + + /// A buffer to store semantic values. + union + { + /// Strongest alignment constraints. + long double yyalign_me; + /// A buffer large enough to store any of the semantic values. + char yyraw[size]; + } yybuffer_; + + /// Whether the content is built: if defined, the name of the stored type. + const std::type_info *yytypeid_; + }; + +#else + typedef S1STYPE semantic_type; +#endif + /// Symbol locations. + typedef xsk::gsc::location location_type; + + /// Syntax errors thrown from user actions. + struct syntax_error : std::runtime_error + { + syntax_error (const location_type& l, const std::string& m) + : std::runtime_error (m) + , location (l) + {} + + syntax_error (const syntax_error& s) + : std::runtime_error (s.what ()) + , location (s.location) + {} + + ~syntax_error () YY_NOEXCEPT YY_NOTHROW; + + location_type location; + }; + + /// Token kinds. + struct token + { + enum token_kind_type + { + S1EMPTY = -2, + S1EOF = 0, // "end of file" + S1error = 1, // error + S1UNDEF = 2, // "invalid token" + INCLUDE = 3, // "#include" + USINGTREE = 4, // "#using_animtree" + ANIMTREE = 5, // "#animtree" + ENDON = 6, // "endon" + NOTIFY = 7, // "notify" + WAIT = 8, // "wait" + WAITTILL = 9, // "waittill" + WAITTILLMATCH = 10, // "waittillmatch" + WAITTILLFRAMEEND = 11, // "waittillframeend" + WAITFRAME = 12, // "waitframe" + IF = 13, // "if" + ELSE = 14, // "else" + WHILE = 15, // "while" + FOR = 16, // "for" + FOREACH = 17, // "foreach" + IN = 18, // "in" + SWITCH = 19, // "switch" + CASE = 20, // "case" + DEFAULT = 21, // "default" + BREAK = 22, // "break" + CONTINUE = 23, // "continue" + RETURN = 24, // "return" + THREAD = 25, // "thread" + CHILDTHREAD = 26, // "childthread" + THISTHREAD = 27, // "thisthread" + CALL = 28, // "call" + TRUE = 29, // "true" + FALSE = 30, // "false" + UNDEFINED = 31, // "undefined" + SIZE = 32, // "size" + GAME = 33, // "game" + SELF = 34, // "self" + ANIM = 35, // "anim" + LEVEL = 36, // "level" + LPAREN = 37, // "(" + RPAREN = 38, // ")" + LBRACE = 39, // "{" + RBRACE = 40, // "}" + LBRACKET = 41, // "[" + RBRACKET = 42, // "]" + COMMA = 43, // "," + DOT = 44, // "." + DOUBLECOLON = 45, // "::" + COLON = 46, // ":" + SEMICOLON = 47, // ";" + INCREMENT = 48, // "++" + DECREMENT = 49, // "--" + LSHIFT = 50, // "<<" + RSHIFT = 51, // ">>" + OR = 52, // "||" + AND = 53, // "&&" + EQUALITY = 54, // "==" + INEQUALITY = 55, // "!=" + LESS_EQUAL = 56, // "<=" + GREATER_EQUAL = 57, // ">=" + LESS = 58, // "<" + GREATER = 59, // ">" + NOT = 60, // "!" + COMPLEMENT = 61, // "~" + ASSIGN = 62, // "=" + ASSIGN_ADD = 63, // "+=" + ASSIGN_SUB = 64, // "-=" + ASSIGN_MULT = 65, // "*=" + ASSIGN_DIV = 66, // "/=" + ASSIGN_MOD = 67, // "%=" + ASSIGN_BITWISE_OR = 68, // "|=" + ASSIGN_BITWISE_AND = 69, // "&=" + ASSIGN_BITWISE_EXOR = 70, // "^=" + ASSIGN_RSHIFT = 71, // ">>=" + ASSIGN_LSHIFT = 72, // "<<=" + BITWISE_OR = 73, // "|" + BITWISE_AND = 74, // "&" + BITWISE_EXOR = 75, // "^" + ADD = 76, // "+" + SUB = 77, // "-" + MULT = 78, // "*" + DIV = 79, // "/" + MOD = 80, // "%" + FILE = 81, // "file path" + NAME = 82, // "identifier" + STRING = 83, // "string literal" + ISTRING = 84, // "localized string" + FLOAT = 85, // "float" + INTEGER = 86, // "int" + ADD_ARRAY = 87, // ADD_ARRAY + THEN = 88, // THEN + NEG = 89, // NEG + ANIMREF = 90, // ANIMREF + PREINC = 91, // PREINC + PREDEC = 92, // PREDEC + POSTINC = 93, // POSTINC + POSTDEC = 94 // POSTDEC + }; + /// Backward compatibility alias (Bison 3.6). + typedef token_kind_type yytokentype; + }; + + /// Token kind, as returned by yylex. + typedef token::yytokentype token_kind_type; + + /// Backward compatibility alias (Bison 3.6). + typedef token_kind_type token_type; + + /// Symbol kinds. + struct symbol_kind + { + enum symbol_kind_type + { + YYNTOKENS = 95, ///< Number of tokens. + S_YYEMPTY = -2, + S_YYEOF = 0, // "end of file" + S_YYerror = 1, // error + S_YYUNDEF = 2, // "invalid token" + S_INCLUDE = 3, // "#include" + S_USINGTREE = 4, // "#using_animtree" + S_ANIMTREE = 5, // "#animtree" + S_ENDON = 6, // "endon" + S_NOTIFY = 7, // "notify" + S_WAIT = 8, // "wait" + S_WAITTILL = 9, // "waittill" + S_WAITTILLMATCH = 10, // "waittillmatch" + S_WAITTILLFRAMEEND = 11, // "waittillframeend" + S_WAITFRAME = 12, // "waitframe" + S_IF = 13, // "if" + S_ELSE = 14, // "else" + S_WHILE = 15, // "while" + S_FOR = 16, // "for" + S_FOREACH = 17, // "foreach" + S_IN = 18, // "in" + S_SWITCH = 19, // "switch" + S_CASE = 20, // "case" + S_DEFAULT = 21, // "default" + S_BREAK = 22, // "break" + S_CONTINUE = 23, // "continue" + S_RETURN = 24, // "return" + S_THREAD = 25, // "thread" + S_CHILDTHREAD = 26, // "childthread" + S_THISTHREAD = 27, // "thisthread" + S_CALL = 28, // "call" + S_TRUE = 29, // "true" + S_FALSE = 30, // "false" + S_UNDEFINED = 31, // "undefined" + S_SIZE = 32, // "size" + S_GAME = 33, // "game" + S_SELF = 34, // "self" + S_ANIM = 35, // "anim" + S_LEVEL = 36, // "level" + S_LPAREN = 37, // "(" + S_RPAREN = 38, // ")" + S_LBRACE = 39, // "{" + S_RBRACE = 40, // "}" + S_LBRACKET = 41, // "[" + S_RBRACKET = 42, // "]" + S_COMMA = 43, // "," + S_DOT = 44, // "." + S_DOUBLECOLON = 45, // "::" + S_COLON = 46, // ":" + S_SEMICOLON = 47, // ";" + S_INCREMENT = 48, // "++" + S_DECREMENT = 49, // "--" + S_LSHIFT = 50, // "<<" + S_RSHIFT = 51, // ">>" + S_OR = 52, // "||" + S_AND = 53, // "&&" + S_EQUALITY = 54, // "==" + S_INEQUALITY = 55, // "!=" + S_LESS_EQUAL = 56, // "<=" + S_GREATER_EQUAL = 57, // ">=" + S_LESS = 58, // "<" + S_GREATER = 59, // ">" + S_NOT = 60, // "!" + S_COMPLEMENT = 61, // "~" + S_ASSIGN = 62, // "=" + S_ASSIGN_ADD = 63, // "+=" + S_ASSIGN_SUB = 64, // "-=" + S_ASSIGN_MULT = 65, // "*=" + S_ASSIGN_DIV = 66, // "/=" + S_ASSIGN_MOD = 67, // "%=" + S_ASSIGN_BITWISE_OR = 68, // "|=" + S_ASSIGN_BITWISE_AND = 69, // "&=" + S_ASSIGN_BITWISE_EXOR = 70, // "^=" + S_ASSIGN_RSHIFT = 71, // ">>=" + S_ASSIGN_LSHIFT = 72, // "<<=" + S_BITWISE_OR = 73, // "|" + S_BITWISE_AND = 74, // "&" + S_BITWISE_EXOR = 75, // "^" + S_ADD = 76, // "+" + S_SUB = 77, // "-" + S_MULT = 78, // "*" + S_DIV = 79, // "/" + S_MOD = 80, // "%" + S_FILE = 81, // "file path" + S_NAME = 82, // "identifier" + S_STRING = 83, // "string literal" + S_ISTRING = 84, // "localized string" + S_FLOAT = 85, // "float" + S_INTEGER = 86, // "int" + S_ADD_ARRAY = 87, // ADD_ARRAY + S_THEN = 88, // THEN + S_NEG = 89, // NEG + S_ANIMREF = 90, // ANIMREF + S_PREINC = 91, // PREINC + S_PREDEC = 92, // PREDEC + S_POSTINC = 93, // POSTINC + S_POSTDEC = 94, // POSTDEC + S_YYACCEPT = 95, // $accept + S_root = 96, // root + S_program = 97, // program + S_include = 98, // include + S_define = 99, // define + S_usingtree = 100, // usingtree + S_constant = 101, // constant + S_thread = 102, // thread + S_parameters = 103, // parameters + S_stmt = 104, // stmt + S_stmt_block = 105, // stmt_block + S_stmt_list = 106, // stmt_list + S_stmt_call = 107, // stmt_call + S_stmt_assign = 108, // stmt_assign + S_stmt_endon = 109, // stmt_endon + S_stmt_notify = 110, // stmt_notify + S_stmt_wait = 111, // stmt_wait + S_stmt_waittill = 112, // stmt_waittill + S_stmt_waittillmatch = 113, // stmt_waittillmatch + S_stmt_waittillframeend = 114, // stmt_waittillframeend + S_stmt_waitframe = 115, // stmt_waitframe + S_stmt_if = 116, // stmt_if + S_stmt_ifelse = 117, // stmt_ifelse + S_stmt_while = 118, // stmt_while + S_stmt_for = 119, // stmt_for + S_stmt_foreach = 120, // stmt_foreach + S_stmt_switch = 121, // stmt_switch + S_stmt_case = 122, // stmt_case + S_stmt_default = 123, // stmt_default + S_stmt_break = 124, // stmt_break + S_stmt_continue = 125, // stmt_continue + S_stmt_return = 126, // stmt_return + S_for_stmt = 127, // for_stmt + S_for_expr = 128, // for_expr + S_expr = 129, // expr + S_expr_assign = 130, // expr_assign + S_expr_compare = 131, // expr_compare + S_expr_binary = 132, // expr_binary + S_expr_primitive = 133, // expr_primitive + S_expr_call = 134, // expr_call + S_expr_call_thread = 135, // expr_call_thread + S_expr_call_childthread = 136, // expr_call_childthread + S_expr_call_function = 137, // expr_call_function + S_expr_call_pointer = 138, // expr_call_pointer + S_expr_arguments = 139, // expr_arguments + S_expr_arguments_filled = 140, // expr_arguments_filled + S_expr_arguments_empty = 141, // expr_arguments_empty + S_expr_function = 142, // expr_function + S_expr_add_array = 143, // expr_add_array + S_expr_array = 144, // expr_array + S_expr_field = 145, // expr_field + S_expr_size = 146, // expr_size + S_object = 147, // object + S_thisthread = 148, // thisthread + S_empty_array = 149, // empty_array + S_undefined = 150, // undefined + S_game = 151, // game + S_self = 152, // self + S_anim = 153, // anim + S_level = 154, // level + S_animation = 155, // animation + S_animtree = 156, // animtree + S_name = 157, // name + S_file = 158, // file + S_istring = 159, // istring + S_string = 160, // string + S_vector = 161, // vector + S_neg_float = 162, // neg_float + S_neg_integer = 163, // neg_integer + S_float = 164, // float + S_integer = 165, // integer + S_false = 166, // false + S_true = 167 // true + }; + }; + + /// (Internal) symbol kind. + typedef symbol_kind::symbol_kind_type symbol_kind_type; + + /// The number of tokens. + static const symbol_kind_type YYNTOKENS = symbol_kind::YYNTOKENS; + + /// A complete symbol. + /// + /// Expects its Base type to provide access to the symbol kind + /// via kind (). + /// + /// Provide access to semantic value and location. + template + struct basic_symbol : Base + { + /// Alias to Base. + typedef Base super_type; + + /// Default constructor. + basic_symbol () + : value () + , location () + {} + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + basic_symbol (basic_symbol&& that) + : Base (std::move (that)) + , value () + , location (std::move (that.location)) + { + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (std::move (that.value)); + break; + + default: + break; + } + + } +#endif + + /// Copy constructor. + basic_symbol (const basic_symbol& that); + + /// Constructors for typed symbols. +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, location_type&& l) + : Base (t) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const location_type& l) + : Base (t) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, anim_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const anim_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, animation_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const animation_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, animtree_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const animtree_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, constant_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const constant_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, define_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const define_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, empty_array_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const empty_array_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_arguments_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_arguments_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_assign_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_assign_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_call_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_call_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_call_type_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_call_type_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, false_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const false_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, file_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const file_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, float_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const float_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, game_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const game_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, include_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const include_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, integer_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const integer_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, istring_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const istring_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, level_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const level_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, name_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const name_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, node_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const node_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, parameters_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const parameters_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, program_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const program_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, self_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const self_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_assign_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_assign_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_break_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_break_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_call_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_call_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_case_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_case_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_continue_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_continue_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_default_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_default_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_endon_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_endon_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_for_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_for_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_foreach_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_foreach_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_if_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_if_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_ifelse_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_ifelse_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_list_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_list_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_notify_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_notify_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_return_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_return_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_switch_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_switch_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_wait_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_wait_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waitframe_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waitframe_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittill_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittill_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittillframeend_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittillframeend_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittillmatch_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittillmatch_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_while_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_while_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, string_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const string_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, thisthread_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const thisthread_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, thread_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const thread_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, true_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const true_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, undefined_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const undefined_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, usingtree_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const usingtree_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, vector_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const vector_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + + /// Destroy the symbol. + ~basic_symbol () + { + clear (); + } + + /// Destroy contents, and record that is empty. + void clear () YY_NOEXCEPT + { + // User destructor. + symbol_kind_type yykind = this->kind (); + basic_symbol& yysym = *this; + (void) yysym; + switch (yykind) + { + default: + break; + } + + // Value type destructor. +switch (yykind) + { + case symbol_kind::S_anim: // anim + value.template destroy< anim_ptr > (); + break; + + case symbol_kind::S_animation: // animation + value.template destroy< animation_ptr > (); + break; + + case symbol_kind::S_animtree: // animtree + value.template destroy< animtree_ptr > (); + break; + + case symbol_kind::S_constant: // constant + value.template destroy< constant_ptr > (); + break; + + case symbol_kind::S_define: // define + value.template destroy< define_ptr > (); + break; + + case symbol_kind::S_empty_array: // empty_array + value.template destroy< empty_array_ptr > (); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.template destroy< expr_arguments_ptr > (); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.template destroy< expr_assign_ptr > (); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.template destroy< expr_call_ptr > (); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.template destroy< expr_call_type_ptr > (); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.template destroy< expr_ptr > (); + break; + + case symbol_kind::S_false: // false + value.template destroy< false_ptr > (); + break; + + case symbol_kind::S_file: // file + value.template destroy< file_ptr > (); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.template destroy< float_ptr > (); + break; + + case symbol_kind::S_game: // game + value.template destroy< game_ptr > (); + break; + + case symbol_kind::S_include: // include + value.template destroy< include_ptr > (); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.template destroy< integer_ptr > (); + break; + + case symbol_kind::S_istring: // istring + value.template destroy< istring_ptr > (); + break; + + case symbol_kind::S_level: // level + value.template destroy< level_ptr > (); + break; + + case symbol_kind::S_name: // name + value.template destroy< name_ptr > (); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.template destroy< node_ptr > (); + break; + + case symbol_kind::S_parameters: // parameters + value.template destroy< parameters_ptr > (); + break; + + case symbol_kind::S_program: // program + value.template destroy< program_ptr > (); + break; + + case symbol_kind::S_self: // self + value.template destroy< self_ptr > (); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.template destroy< std::string > (); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.template destroy< stmt_assign_ptr > (); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.template destroy< stmt_break_ptr > (); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.template destroy< stmt_call_ptr > (); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.template destroy< stmt_case_ptr > (); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.template destroy< stmt_continue_ptr > (); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.template destroy< stmt_default_ptr > (); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.template destroy< stmt_endon_ptr > (); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.template destroy< stmt_for_ptr > (); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.template destroy< stmt_foreach_ptr > (); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.template destroy< stmt_if_ptr > (); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.template destroy< stmt_ifelse_ptr > (); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.template destroy< stmt_list_ptr > (); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.template destroy< stmt_notify_ptr > (); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.template destroy< stmt_ptr > (); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.template destroy< stmt_return_ptr > (); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.template destroy< stmt_switch_ptr > (); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.template destroy< stmt_wait_ptr > (); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.template destroy< stmt_waitframe_ptr > (); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.template destroy< stmt_waittill_ptr > (); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.template destroy< stmt_waittillframeend_ptr > (); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.template destroy< stmt_waittillmatch_ptr > (); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.template destroy< stmt_while_ptr > (); + break; + + case symbol_kind::S_string: // string + value.template destroy< string_ptr > (); + break; + + case symbol_kind::S_thisthread: // thisthread + value.template destroy< thisthread_ptr > (); + break; + + case symbol_kind::S_thread: // thread + value.template destroy< thread_ptr > (); + break; + + case symbol_kind::S_true: // true + value.template destroy< true_ptr > (); + break; + + case symbol_kind::S_undefined: // undefined + value.template destroy< undefined_ptr > (); + break; + + case symbol_kind::S_usingtree: // usingtree + value.template destroy< usingtree_ptr > (); + break; + + case symbol_kind::S_vector: // vector + value.template destroy< vector_ptr > (); + break; + + default: + break; + } + + Base::clear (); + } + + /// The user-facing name of this symbol. + const char *name () const YY_NOEXCEPT + { + return parser::symbol_name (this->kind ()); + } + + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; + + /// Whether empty. + bool empty () const YY_NOEXCEPT; + + /// Destructive move, \a s is emptied into this. + void move (basic_symbol& s); + + /// The semantic value. + semantic_type value; + + /// The location. + location_type location; + + private: +#if YY_CPLUSPLUS < 201103L + /// Assignment operator. + basic_symbol& operator= (const basic_symbol& that); +#endif + }; + + /// Type access provider for token (enum) based symbols. + struct by_kind + { + /// Default constructor. + by_kind (); + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + by_kind (by_kind&& that); +#endif + + /// Copy constructor. + by_kind (const by_kind& that); + + /// The symbol kind as needed by the constructor. + typedef token_kind_type kind_type; + + /// Constructor from (external) token numbers. + by_kind (kind_type t); + + /// Record that this symbol is empty. + void clear () YY_NOEXCEPT; + + /// Steal the symbol kind from \a that. + void move (by_kind& that); + + /// The (internal) type number (corresponding to \a type). + /// \a empty when empty. + symbol_kind_type kind () const YY_NOEXCEPT; + + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; + + /// The symbol kind. + /// \a S_YYEMPTY when empty. + symbol_kind_type kind_; + }; + + /// Backward compatibility for a private implementation detail (Bison 3.6). + typedef by_kind by_type; + + /// "External" symbols: returned by the scanner. + struct symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + + /// Empty symbol. + symbol_type () {} + + /// Constructor for valueless symbols, and symbols from each type. +#if 201103L <= YY_CPLUSPLUS + symbol_type (int tok, location_type l) + : super_type(token_type (tok), std::move (l)) +#else + symbol_type (int tok, const location_type& l) + : super_type(token_type (tok), l) +#endif + { + S1_ASSERT (tok == token::S1EOF + || (token::S1error <= tok && tok <= token::MOD) + || (token::ADD_ARRAY <= tok && tok <= token::POSTDEC)); + } +#if 201103L <= YY_CPLUSPLUS + symbol_type (int tok, std::string v, location_type l) + : super_type(token_type (tok), std::move (v), std::move (l)) +#else + symbol_type (int tok, const std::string& v, const location_type& l) + : super_type(token_type (tok), v, l) +#endif + { + S1_ASSERT ((token::FILE <= tok && tok <= token::INTEGER)); + } + }; + + /// Build a parser object. + parser (yyscan_t yyscanner_yyarg, xsk::gsc::location& loc_yyarg, xsk::gsc::program_ptr& ast_yyarg); + virtual ~parser (); + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + parser (const parser&) = delete; + /// Non copyable. + parser& operator= (const parser&) = delete; +#endif + + /// Parse. An alias for parse (). + /// \returns 0 iff parsing succeeded. + int operator() (); + + /// Parse. + /// \returns 0 iff parsing succeeded. + virtual int parse (); + +#if S1DEBUG + /// The current debugging stream. + std::ostream& debug_stream () const YY_ATTRIBUTE_PURE; + /// Set the current debugging stream. + void set_debug_stream (std::ostream &); + + /// Type for debugging levels. + typedef int debug_level_type; + /// The current debugging level. + debug_level_type debug_level () const YY_ATTRIBUTE_PURE; + /// Set the current debugging level. + void set_debug_level (debug_level_type l); +#endif + + /// Report a syntax error. + /// \param loc where the syntax error is found. + /// \param msg a description of the syntax error. + virtual void error (const location_type& loc, const std::string& msg); + + /// Report a syntax error. + void error (const syntax_error& err); + + /// The user-facing name of the symbol whose (internal) number is + /// YYSYMBOL. No bounds checking. + static const char *symbol_name (symbol_kind_type yysymbol); + + // Implementation of make_symbol for each symbol type. +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_S1EOF (location_type l) + { + return symbol_type (token::S1EOF, std::move (l)); + } +#else + static + symbol_type + make_S1EOF (const location_type& l) + { + return symbol_type (token::S1EOF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_S1error (location_type l) + { + return symbol_type (token::S1error, std::move (l)); + } +#else + static + symbol_type + make_S1error (const location_type& l) + { + return symbol_type (token::S1error, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_S1UNDEF (location_type l) + { + return symbol_type (token::S1UNDEF, std::move (l)); + } +#else + static + symbol_type + make_S1UNDEF (const location_type& l) + { + return symbol_type (token::S1UNDEF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INCLUDE (location_type l) + { + return symbol_type (token::INCLUDE, std::move (l)); + } +#else + static + symbol_type + make_INCLUDE (const location_type& l) + { + return symbol_type (token::INCLUDE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_USINGTREE (location_type l) + { + return symbol_type (token::USINGTREE, std::move (l)); + } +#else + static + symbol_type + make_USINGTREE (const location_type& l) + { + return symbol_type (token::USINGTREE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIMTREE (location_type l) + { + return symbol_type (token::ANIMTREE, std::move (l)); + } +#else + static + symbol_type + make_ANIMTREE (const location_type& l) + { + return symbol_type (token::ANIMTREE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ENDON (location_type l) + { + return symbol_type (token::ENDON, std::move (l)); + } +#else + static + symbol_type + make_ENDON (const location_type& l) + { + return symbol_type (token::ENDON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NOTIFY (location_type l) + { + return symbol_type (token::NOTIFY, std::move (l)); + } +#else + static + symbol_type + make_NOTIFY (const location_type& l) + { + return symbol_type (token::NOTIFY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAIT (location_type l) + { + return symbol_type (token::WAIT, std::move (l)); + } +#else + static + symbol_type + make_WAIT (const location_type& l) + { + return symbol_type (token::WAIT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILL (location_type l) + { + return symbol_type (token::WAITTILL, std::move (l)); + } +#else + static + symbol_type + make_WAITTILL (const location_type& l) + { + return symbol_type (token::WAITTILL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILLMATCH (location_type l) + { + return symbol_type (token::WAITTILLMATCH, std::move (l)); + } +#else + static + symbol_type + make_WAITTILLMATCH (const location_type& l) + { + return symbol_type (token::WAITTILLMATCH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILLFRAMEEND (location_type l) + { + return symbol_type (token::WAITTILLFRAMEEND, std::move (l)); + } +#else + static + symbol_type + make_WAITTILLFRAMEEND (const location_type& l) + { + return symbol_type (token::WAITTILLFRAMEEND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITFRAME (location_type l) + { + return symbol_type (token::WAITFRAME, std::move (l)); + } +#else + static + symbol_type + make_WAITFRAME (const location_type& l) + { + return symbol_type (token::WAITFRAME, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IF (location_type l) + { + return symbol_type (token::IF, std::move (l)); + } +#else + static + symbol_type + make_IF (const location_type& l) + { + return symbol_type (token::IF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ELSE (location_type l) + { + return symbol_type (token::ELSE, std::move (l)); + } +#else + static + symbol_type + make_ELSE (const location_type& l) + { + return symbol_type (token::ELSE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WHILE (location_type l) + { + return symbol_type (token::WHILE, std::move (l)); + } +#else + static + symbol_type + make_WHILE (const location_type& l) + { + return symbol_type (token::WHILE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FOR (location_type l) + { + return symbol_type (token::FOR, std::move (l)); + } +#else + static + symbol_type + make_FOR (const location_type& l) + { + return symbol_type (token::FOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FOREACH (location_type l) + { + return symbol_type (token::FOREACH, std::move (l)); + } +#else + static + symbol_type + make_FOREACH (const location_type& l) + { + return symbol_type (token::FOREACH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IN (location_type l) + { + return symbol_type (token::IN, std::move (l)); + } +#else + static + symbol_type + make_IN (const location_type& l) + { + return symbol_type (token::IN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SWITCH (location_type l) + { + return symbol_type (token::SWITCH, std::move (l)); + } +#else + static + symbol_type + make_SWITCH (const location_type& l) + { + return symbol_type (token::SWITCH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CASE (location_type l) + { + return symbol_type (token::CASE, std::move (l)); + } +#else + static + symbol_type + make_CASE (const location_type& l) + { + return symbol_type (token::CASE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DEFAULT (location_type l) + { + return symbol_type (token::DEFAULT, std::move (l)); + } +#else + static + symbol_type + make_DEFAULT (const location_type& l) + { + return symbol_type (token::DEFAULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BREAK (location_type l) + { + return symbol_type (token::BREAK, std::move (l)); + } +#else + static + symbol_type + make_BREAK (const location_type& l) + { + return symbol_type (token::BREAK, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CONTINUE (location_type l) + { + return symbol_type (token::CONTINUE, std::move (l)); + } +#else + static + symbol_type + make_CONTINUE (const location_type& l) + { + return symbol_type (token::CONTINUE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RETURN (location_type l) + { + return symbol_type (token::RETURN, std::move (l)); + } +#else + static + symbol_type + make_RETURN (const location_type& l) + { + return symbol_type (token::RETURN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THREAD (location_type l) + { + return symbol_type (token::THREAD, std::move (l)); + } +#else + static + symbol_type + make_THREAD (const location_type& l) + { + return symbol_type (token::THREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CHILDTHREAD (location_type l) + { + return symbol_type (token::CHILDTHREAD, std::move (l)); + } +#else + static + symbol_type + make_CHILDTHREAD (const location_type& l) + { + return symbol_type (token::CHILDTHREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THISTHREAD (location_type l) + { + return symbol_type (token::THISTHREAD, std::move (l)); + } +#else + static + symbol_type + make_THISTHREAD (const location_type& l) + { + return symbol_type (token::THISTHREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CALL (location_type l) + { + return symbol_type (token::CALL, std::move (l)); + } +#else + static + symbol_type + make_CALL (const location_type& l) + { + return symbol_type (token::CALL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_TRUE (location_type l) + { + return symbol_type (token::TRUE, std::move (l)); + } +#else + static + symbol_type + make_TRUE (const location_type& l) + { + return symbol_type (token::TRUE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FALSE (location_type l) + { + return symbol_type (token::FALSE, std::move (l)); + } +#else + static + symbol_type + make_FALSE (const location_type& l) + { + return symbol_type (token::FALSE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_UNDEFINED (location_type l) + { + return symbol_type (token::UNDEFINED, std::move (l)); + } +#else + static + symbol_type + make_UNDEFINED (const location_type& l) + { + return symbol_type (token::UNDEFINED, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SIZE (location_type l) + { + return symbol_type (token::SIZE, std::move (l)); + } +#else + static + symbol_type + make_SIZE (const location_type& l) + { + return symbol_type (token::SIZE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GAME (location_type l) + { + return symbol_type (token::GAME, std::move (l)); + } +#else + static + symbol_type + make_GAME (const location_type& l) + { + return symbol_type (token::GAME, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SELF (location_type l) + { + return symbol_type (token::SELF, std::move (l)); + } +#else + static + symbol_type + make_SELF (const location_type& l) + { + return symbol_type (token::SELF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIM (location_type l) + { + return symbol_type (token::ANIM, std::move (l)); + } +#else + static + symbol_type + make_ANIM (const location_type& l) + { + return symbol_type (token::ANIM, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LEVEL (location_type l) + { + return symbol_type (token::LEVEL, std::move (l)); + } +#else + static + symbol_type + make_LEVEL (const location_type& l) + { + return symbol_type (token::LEVEL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LPAREN (location_type l) + { + return symbol_type (token::LPAREN, std::move (l)); + } +#else + static + symbol_type + make_LPAREN (const location_type& l) + { + return symbol_type (token::LPAREN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RPAREN (location_type l) + { + return symbol_type (token::RPAREN, std::move (l)); + } +#else + static + symbol_type + make_RPAREN (const location_type& l) + { + return symbol_type (token::RPAREN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LBRACE (location_type l) + { + return symbol_type (token::LBRACE, std::move (l)); + } +#else + static + symbol_type + make_LBRACE (const location_type& l) + { + return symbol_type (token::LBRACE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RBRACE (location_type l) + { + return symbol_type (token::RBRACE, std::move (l)); + } +#else + static + symbol_type + make_RBRACE (const location_type& l) + { + return symbol_type (token::RBRACE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LBRACKET (location_type l) + { + return symbol_type (token::LBRACKET, std::move (l)); + } +#else + static + symbol_type + make_LBRACKET (const location_type& l) + { + return symbol_type (token::LBRACKET, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RBRACKET (location_type l) + { + return symbol_type (token::RBRACKET, std::move (l)); + } +#else + static + symbol_type + make_RBRACKET (const location_type& l) + { + return symbol_type (token::RBRACKET, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COMMA (location_type l) + { + return symbol_type (token::COMMA, std::move (l)); + } +#else + static + symbol_type + make_COMMA (const location_type& l) + { + return symbol_type (token::COMMA, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DOT (location_type l) + { + return symbol_type (token::DOT, std::move (l)); + } +#else + static + symbol_type + make_DOT (const location_type& l) + { + return symbol_type (token::DOT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DOUBLECOLON (location_type l) + { + return symbol_type (token::DOUBLECOLON, std::move (l)); + } +#else + static + symbol_type + make_DOUBLECOLON (const location_type& l) + { + return symbol_type (token::DOUBLECOLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COLON (location_type l) + { + return symbol_type (token::COLON, std::move (l)); + } +#else + static + symbol_type + make_COLON (const location_type& l) + { + return symbol_type (token::COLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SEMICOLON (location_type l) + { + return symbol_type (token::SEMICOLON, std::move (l)); + } +#else + static + symbol_type + make_SEMICOLON (const location_type& l) + { + return symbol_type (token::SEMICOLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INCREMENT (location_type l) + { + return symbol_type (token::INCREMENT, std::move (l)); + } +#else + static + symbol_type + make_INCREMENT (const location_type& l) + { + return symbol_type (token::INCREMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DECREMENT (location_type l) + { + return symbol_type (token::DECREMENT, std::move (l)); + } +#else + static + symbol_type + make_DECREMENT (const location_type& l) + { + return symbol_type (token::DECREMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LSHIFT (location_type l) + { + return symbol_type (token::LSHIFT, std::move (l)); + } +#else + static + symbol_type + make_LSHIFT (const location_type& l) + { + return symbol_type (token::LSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RSHIFT (location_type l) + { + return symbol_type (token::RSHIFT, std::move (l)); + } +#else + static + symbol_type + make_RSHIFT (const location_type& l) + { + return symbol_type (token::RSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_OR (location_type l) + { + return symbol_type (token::OR, std::move (l)); + } +#else + static + symbol_type + make_OR (const location_type& l) + { + return symbol_type (token::OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_AND (location_type l) + { + return symbol_type (token::AND, std::move (l)); + } +#else + static + symbol_type + make_AND (const location_type& l) + { + return symbol_type (token::AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_EQUALITY (location_type l) + { + return symbol_type (token::EQUALITY, std::move (l)); + } +#else + static + symbol_type + make_EQUALITY (const location_type& l) + { + return symbol_type (token::EQUALITY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INEQUALITY (location_type l) + { + return symbol_type (token::INEQUALITY, std::move (l)); + } +#else + static + symbol_type + make_INEQUALITY (const location_type& l) + { + return symbol_type (token::INEQUALITY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LESS_EQUAL (location_type l) + { + return symbol_type (token::LESS_EQUAL, std::move (l)); + } +#else + static + symbol_type + make_LESS_EQUAL (const location_type& l) + { + return symbol_type (token::LESS_EQUAL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GREATER_EQUAL (location_type l) + { + return symbol_type (token::GREATER_EQUAL, std::move (l)); + } +#else + static + symbol_type + make_GREATER_EQUAL (const location_type& l) + { + return symbol_type (token::GREATER_EQUAL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LESS (location_type l) + { + return symbol_type (token::LESS, std::move (l)); + } +#else + static + symbol_type + make_LESS (const location_type& l) + { + return symbol_type (token::LESS, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GREATER (location_type l) + { + return symbol_type (token::GREATER, std::move (l)); + } +#else + static + symbol_type + make_GREATER (const location_type& l) + { + return symbol_type (token::GREATER, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NOT (location_type l) + { + return symbol_type (token::NOT, std::move (l)); + } +#else + static + symbol_type + make_NOT (const location_type& l) + { + return symbol_type (token::NOT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COMPLEMENT (location_type l) + { + return symbol_type (token::COMPLEMENT, std::move (l)); + } +#else + static + symbol_type + make_COMPLEMENT (const location_type& l) + { + return symbol_type (token::COMPLEMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN (location_type l) + { + return symbol_type (token::ASSIGN, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN (const location_type& l) + { + return symbol_type (token::ASSIGN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_ADD (location_type l) + { + return symbol_type (token::ASSIGN_ADD, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_ADD (const location_type& l) + { + return symbol_type (token::ASSIGN_ADD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_SUB (location_type l) + { + return symbol_type (token::ASSIGN_SUB, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_SUB (const location_type& l) + { + return symbol_type (token::ASSIGN_SUB, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_MULT (location_type l) + { + return symbol_type (token::ASSIGN_MULT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_MULT (const location_type& l) + { + return symbol_type (token::ASSIGN_MULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_DIV (location_type l) + { + return symbol_type (token::ASSIGN_DIV, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_DIV (const location_type& l) + { + return symbol_type (token::ASSIGN_DIV, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_MOD (location_type l) + { + return symbol_type (token::ASSIGN_MOD, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_MOD (const location_type& l) + { + return symbol_type (token::ASSIGN_MOD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_OR (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_OR, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_OR (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_AND (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_AND, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_AND (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_EXOR (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_EXOR, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_EXOR (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_EXOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_RSHIFT (location_type l) + { + return symbol_type (token::ASSIGN_RSHIFT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_RSHIFT (const location_type& l) + { + return symbol_type (token::ASSIGN_RSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_LSHIFT (location_type l) + { + return symbol_type (token::ASSIGN_LSHIFT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_LSHIFT (const location_type& l) + { + return symbol_type (token::ASSIGN_LSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_OR (location_type l) + { + return symbol_type (token::BITWISE_OR, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_OR (const location_type& l) + { + return symbol_type (token::BITWISE_OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_AND (location_type l) + { + return symbol_type (token::BITWISE_AND, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_AND (const location_type& l) + { + return symbol_type (token::BITWISE_AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_EXOR (location_type l) + { + return symbol_type (token::BITWISE_EXOR, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_EXOR (const location_type& l) + { + return symbol_type (token::BITWISE_EXOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ADD (location_type l) + { + return symbol_type (token::ADD, std::move (l)); + } +#else + static + symbol_type + make_ADD (const location_type& l) + { + return symbol_type (token::ADD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SUB (location_type l) + { + return symbol_type (token::SUB, std::move (l)); + } +#else + static + symbol_type + make_SUB (const location_type& l) + { + return symbol_type (token::SUB, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_MULT (location_type l) + { + return symbol_type (token::MULT, std::move (l)); + } +#else + static + symbol_type + make_MULT (const location_type& l) + { + return symbol_type (token::MULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DIV (location_type l) + { + return symbol_type (token::DIV, std::move (l)); + } +#else + static + symbol_type + make_DIV (const location_type& l) + { + return symbol_type (token::DIV, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_MOD (location_type l) + { + return symbol_type (token::MOD, std::move (l)); + } +#else + static + symbol_type + make_MOD (const location_type& l) + { + return symbol_type (token::MOD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FILE (std::string v, location_type l) + { + return symbol_type (token::FILE, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_FILE (const std::string& v, const location_type& l) + { + return symbol_type (token::FILE, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NAME (std::string v, location_type l) + { + return symbol_type (token::NAME, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_NAME (const std::string& v, const location_type& l) + { + return symbol_type (token::NAME, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_STRING (std::string v, location_type l) + { + return symbol_type (token::STRING, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_STRING (const std::string& v, const location_type& l) + { + return symbol_type (token::STRING, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ISTRING (std::string v, location_type l) + { + return symbol_type (token::ISTRING, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_ISTRING (const std::string& v, const location_type& l) + { + return symbol_type (token::ISTRING, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FLOAT (std::string v, location_type l) + { + return symbol_type (token::FLOAT, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_FLOAT (const std::string& v, const location_type& l) + { + return symbol_type (token::FLOAT, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INTEGER (std::string v, location_type l) + { + return symbol_type (token::INTEGER, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_INTEGER (const std::string& v, const location_type& l) + { + return symbol_type (token::INTEGER, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ADD_ARRAY (location_type l) + { + return symbol_type (token::ADD_ARRAY, std::move (l)); + } +#else + static + symbol_type + make_ADD_ARRAY (const location_type& l) + { + return symbol_type (token::ADD_ARRAY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THEN (location_type l) + { + return symbol_type (token::THEN, std::move (l)); + } +#else + static + symbol_type + make_THEN (const location_type& l) + { + return symbol_type (token::THEN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NEG (location_type l) + { + return symbol_type (token::NEG, std::move (l)); + } +#else + static + symbol_type + make_NEG (const location_type& l) + { + return symbol_type (token::NEG, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIMREF (location_type l) + { + return symbol_type (token::ANIMREF, std::move (l)); + } +#else + static + symbol_type + make_ANIMREF (const location_type& l) + { + return symbol_type (token::ANIMREF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_PREINC (location_type l) + { + return symbol_type (token::PREINC, std::move (l)); + } +#else + static + symbol_type + make_PREINC (const location_type& l) + { + return symbol_type (token::PREINC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_PREDEC (location_type l) + { + return symbol_type (token::PREDEC, std::move (l)); + } +#else + static + symbol_type + make_PREDEC (const location_type& l) + { + return symbol_type (token::PREDEC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_POSTINC (location_type l) + { + return symbol_type (token::POSTINC, std::move (l)); + } +#else + static + symbol_type + make_POSTINC (const location_type& l) + { + return symbol_type (token::POSTINC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_POSTDEC (location_type l) + { + return symbol_type (token::POSTDEC, std::move (l)); + } +#else + static + symbol_type + make_POSTDEC (const location_type& l) + { + return symbol_type (token::POSTDEC, l); + } +#endif + + + class context + { + public: + context (const parser& yyparser, const symbol_type& yyla); + const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; } + symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); } + const location_type& location () const YY_NOEXCEPT { return yyla_.location; } + + /// Put in YYARG at most YYARGN of the expected tokens, and return the + /// number of tokens stored in YYARG. If YYARG is null, return the + /// number of expected tokens (guaranteed to be less than YYNTOKENS). + int expected_tokens (symbol_kind_type yyarg[], int yyargn) const; + + private: + const parser& yyparser_; + const symbol_type& yyla_; + }; + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + parser (const parser&); + /// Non copyable. + parser& operator= (const parser&); +#endif + + /// Check the lookahead yytoken. + /// \returns true iff the token will be eventually shifted. + bool yy_lac_check_ (symbol_kind_type yytoken) const; + /// Establish the initial context if no initial context currently exists. + /// \returns true iff the token will be eventually shifted. + bool yy_lac_establish_ (symbol_kind_type yytoken); + /// Discard any previous initial lookahead context because of event. + /// \param event the event which caused the lookahead to be discarded. + /// Only used for debbuging output. + void yy_lac_discard_ (const char* event); + + /// Stored state numbers (used for stacks). + typedef short state_type; + + /// The arguments of the error message. + int yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const; + + /// Generate an error message. + /// \param yyctx the context in which the error occurred. + virtual std::string yysyntax_error_ (const context& yyctx) const; + /// Compute post-reduction state. + /// \param yystate the current state + /// \param yysym the nonterminal to push on the stack + static state_type yy_lr_goto_state_ (state_type yystate, int yysym); + + /// Whether the given \c yypact_ value indicates a defaulted state. + /// \param yyvalue the value to check + static bool yy_pact_value_is_default_ (int yyvalue); + + /// Whether the given \c yytable_ value indicates a syntax error. + /// \param yyvalue the value to check + static bool yy_table_value_is_error_ (int yyvalue); + + static const short yypact_ninf_; + static const short yytable_ninf_; + + /// Convert a scanner token kind \a t to a symbol kind. + /// In theory \a t should be a token_kind_type, but character literals + /// are valid, yet not members of the token_type enum. + static symbol_kind_type yytranslate_ (int t); + + + + // Tables. + // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + // STATE-NUM. + static const short yypact_[]; + + // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + // Performed when YYTABLE does not specify something else to do. Zero + // means the default is an error. + static const unsigned char yydefact_[]; + + // YYPGOTO[NTERM-NUM]. + static const short yypgoto_[]; + + // YYDEFGOTO[NTERM-NUM]. + static const short yydefgoto_[]; + + // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + // positive, shift that token. If negative, reduce the rule whose + // number is the opposite. If YYTABLE_NINF, syntax error. + static const short yytable_[]; + + static const short yycheck_[]; + + // YYSTOS[STATE-NUM] -- The (internal number of the) accessing + // symbol of state STATE-NUM. + static const unsigned char yystos_[]; + + // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + static const unsigned char yyr1_[]; + + // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + static const signed char yyr2_[]; + + +#if S1DEBUG + // YYRLINE[YYN] -- Source line where rule number YYN was defined. + static const short yyrline_[]; + /// Report on the debug stream that the rule \a r is going to be reduced. + virtual void yy_reduce_print_ (int r) const; + /// Print the state stack on the debug stream. + virtual void yy_stack_print_ () const; + + /// Debugging level. + int yydebug_; + /// Debug stream. + std::ostream* yycdebug_; + + /// \brief Display a symbol kind, value and location. + /// \param yyo The output stream. + /// \param yysym The symbol. + template + void yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const; +#endif + + /// \brief Reclaim the memory associated to a symbol. + /// \param yymsg Why this token is reclaimed. + /// If null, print nothing. + /// \param yysym The symbol. + template + void yy_destroy_ (const char* yymsg, basic_symbol& yysym) const; + + private: + /// Type access provider for state based symbols. + struct by_state + { + /// Default constructor. + by_state () YY_NOEXCEPT; + + /// The symbol kind as needed by the constructor. + typedef state_type kind_type; + + /// Constructor. + by_state (kind_type s) YY_NOEXCEPT; + + /// Copy constructor. + by_state (const by_state& that) YY_NOEXCEPT; + + /// Record that this symbol is empty. + void clear () YY_NOEXCEPT; + + /// Steal the symbol kind from \a that. + void move (by_state& that); + + /// The symbol kind (corresponding to \a state). + /// \a symbol_kind::S_YYEMPTY when empty. + symbol_kind_type kind () const YY_NOEXCEPT; + + /// The state number used to denote an empty symbol. + /// We use the initial state, as it does not have a value. + enum { empty_state = 0 }; + + /// The state. + /// \a empty when empty. + state_type state; + }; + + /// "Internal" symbol: element of the stack. + struct stack_symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + /// Construct an empty symbol. + stack_symbol_type (); + /// Move or copy construction. + stack_symbol_type (YY_RVREF (stack_symbol_type) that); + /// Steal the contents from \a sym to build this. + stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym); +#if YY_CPLUSPLUS < 201103L + /// Assignment, needed by push_back by some old implementations. + /// Moves the contents of that. + stack_symbol_type& operator= (stack_symbol_type& that); + + /// Assignment, needed by push_back by other implementations. + /// Needed by some other old implementations. + stack_symbol_type& operator= (const stack_symbol_type& that); +#endif + }; + + /// A stack with random access from its top. + template > + class stack + { + public: + // Hide our reversed order. + typedef typename S::iterator iterator; + typedef typename S::const_iterator const_iterator; + typedef typename S::size_type size_type; + typedef typename std::ptrdiff_t index_type; + + stack (size_type n = 200) + : seq_ (n) + {} + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + stack (const stack&) = delete; + /// Non copyable. + stack& operator= (const stack&) = delete; +#endif + + /// Random access. + /// + /// Index 0 returns the topmost element. + const T& + operator[] (index_type i) const + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Random access. + /// + /// Index 0 returns the topmost element. + T& + operator[] (index_type i) + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Steal the contents of \a t. + /// + /// Close to move-semantics. + void + push (YY_MOVE_REF (T) t) + { + seq_.push_back (T ()); + operator[] (0).move (t); + } + + /// Pop elements from the stack. + void + pop (std::ptrdiff_t n = 1) YY_NOEXCEPT + { + for (; 0 < n; --n) + seq_.pop_back (); + } + + /// Pop all elements from the stack. + void + clear () YY_NOEXCEPT + { + seq_.clear (); + } + + /// Number of elements on the stack. + index_type + size () const YY_NOEXCEPT + { + return index_type (seq_.size ()); + } + + /// Iterator on top of the stack (going downwards). + const_iterator + begin () const YY_NOEXCEPT + { + return seq_.begin (); + } + + /// Bottom of the stack. + const_iterator + end () const YY_NOEXCEPT + { + return seq_.end (); + } + + /// Present a slice of the top of a stack. + class slice + { + public: + slice (const stack& stack, index_type range) + : stack_ (stack) + , range_ (range) + {} + + const T& + operator[] (index_type i) const + { + return stack_[range_ - i]; + } + + private: + const stack& stack_; + index_type range_; + }; + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + stack (const stack&); + /// Non copyable. + stack& operator= (const stack&); +#endif + /// The wrapped container. + S seq_; + }; + + + /// Stack type. + typedef stack stack_type; + + /// The stack. + stack_type yystack_; + /// The stack for LAC. + /// Logically, the yy_lac_stack's lifetime is confined to the function + /// yy_lac_check_. We just store it as a member of this class to hold + /// on to the memory and to avoid frequent reallocations. + /// Since yy_lac_check_ is const, this member must be mutable. + mutable std::vector yylac_stack_; + /// Whether an initial LAC context was established. + bool yy_lac_established_; + + + /// Push a new state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param sym the symbol + /// \warning the contents of \a s.value is stolen. + void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym); + + /// Push a new look ahead token on the state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param s the state + /// \param sym the symbol (for its value and location). + /// \warning the contents of \a sym.value is stolen. + void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); + + /// Pop \a n symbols from the stack. + void yypop_ (int n = 1); + + /// Constants. + enum + { + yylast_ = 1581, ///< Last index in yytable_. + yynnts_ = 73, ///< Number of nonterminal symbols. + yyfinal_ = 15 ///< Termination state number. + }; + + + // User arguments. + yyscan_t yyscanner; + xsk::gsc::location& loc; + xsk::gsc::program_ptr& ast; + + }; + + inline + parser::symbol_kind_type + parser::yytranslate_ (int t) + { + return static_cast (t); + } + + // basic_symbol. + template + parser::basic_symbol::basic_symbol (const basic_symbol& that) + : Base (that) + , value () + , location (that.location) + { + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.copy< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.copy< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.copy< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.copy< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.copy< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.copy< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.copy< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.copy< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.copy< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.copy< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.copy< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.copy< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.copy< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.copy< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.copy< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.copy< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.copy< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.copy< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.copy< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.copy< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.copy< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.copy< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.copy< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.copy< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.copy< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.copy< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.copy< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.copy< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.copy< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.copy< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.copy< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.copy< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.copy< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.copy< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.copy< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.copy< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.copy< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.copy< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.copy< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.copy< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.copy< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.copy< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.copy< stmt_waitframe_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.copy< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.copy< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.copy< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.copy< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.copy< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.copy< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.copy< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.copy< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.copy< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.copy< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.copy< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + + } + + + + template + parser::symbol_kind_type + parser::basic_symbol::type_get () const YY_NOEXCEPT + { + return this->kind (); + } + + template + bool + parser::basic_symbol::empty () const YY_NOEXCEPT + { + return this->kind () == symbol_kind::S_YYEMPTY; + } + + template + void + parser::basic_symbol::move (basic_symbol& s) + { + super_type::move (s); + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (YY_MOVE (s.value)); + break; + + default: + break; + } + + location = YY_MOVE (s.location); + } + + // by_kind. + inline + parser::by_kind::by_kind () + : kind_ (symbol_kind::S_YYEMPTY) + {} + +#if 201103L <= YY_CPLUSPLUS + inline + parser::by_kind::by_kind (by_kind&& that) + : kind_ (that.kind_) + { + that.clear (); + } +#endif + + inline + parser::by_kind::by_kind (const by_kind& that) + : kind_ (that.kind_) + {} + + inline + parser::by_kind::by_kind (token_kind_type t) + : kind_ (yytranslate_ (t)) + {} + + inline + void + parser::by_kind::clear () YY_NOEXCEPT + { + kind_ = symbol_kind::S_YYEMPTY; + } + + inline + void + parser::by_kind::move (by_kind& that) + { + kind_ = that.kind_; + that.clear (); + } + + inline + parser::symbol_kind_type + parser::by_kind::kind () const YY_NOEXCEPT + { + return kind_; + } + + inline + parser::symbol_kind_type + parser::by_kind::type_get () const YY_NOEXCEPT + { + return this->kind (); + } + +#line 13 "parser.ypp" +} } } // xsk::gsc::s1 +#line 4764 "parser.hpp" + + + + +#endif // !YY_S1_PARSER_HPP_INCLUDED diff --git a/src/s1/xsk/resolver.cpp b/src/s1/xsk/resolver.cpp new file mode 100644 index 00000000..26850e2c --- /dev/null +++ b/src/s1/xsk/resolver.cpp @@ -0,0 +1,2559 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "s1.hpp" + +namespace xsk::gsc::s1 +{ + +std::unordered_map opcode_map; +std::unordered_map function_map; +std::unordered_map method_map; +std::unordered_map file_map; +std::unordered_map token_map; +std::unordered_map opcode_map_rev; +std::unordered_map function_map_rev; +std::unordered_map method_map_rev; +std::unordered_map file_map_rev; +std::unordered_map token_map_rev; + +auto resolver::opcode_id(const std::string& name) -> std::uint8_t +{ + const auto itr = opcode_map_rev.find(name); + + if (itr != opcode_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve opcode id for name '%s'!", name.data())); +} + +auto resolver::opcode_name(std::uint8_t id) -> std::string +{ + const auto itr = opcode_map.find(id); + + if (itr != opcode_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve opcode name for id '0x%hhX'!", id)); +} + +auto resolver::function_id(const std::string& name) -> std::uint16_t +{ + const auto itr = function_map_rev.find(name); + + if (itr != function_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin function id for name '%s'!", name.data())); +} + +auto resolver::function_name(std::uint16_t id) -> std::string +{ + const auto itr = function_map.find(id); + + if (itr != function_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin function name for id '%i'!", id)); +} + +auto resolver::method_id(const std::string& name) -> std::uint16_t +{ + const auto itr = method_map_rev.find(name); + + if (itr != method_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin method id for name '%s'!", name.data())); +} + +auto resolver::method_name(std::uint16_t id) -> std::string +{ + const auto itr = method_map.find(id); + + if (itr != method_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin method name for id '%i'!", id)); +} + +auto resolver::file_id(const std::string& name) -> std::uint16_t +{ + const auto itr = file_map_rev.find(name); + + if (itr != file_map_rev.end()) + { + return itr->second; + } + + return 0; +} + +auto resolver::file_name(std::uint16_t id) -> std::string +{ + const auto itr = file_map.find(id); + + if (itr != file_map.end()) + { + return itr->second; + } + + return utils::string::va("_ID%i", id); +} + +auto resolver::token_id(const std::string& name) -> std::uint16_t +{ + const auto itr = token_map_rev.find(name); + + if (itr != token_map_rev.end()) + { + return itr->second; + } + + return 0; +} + +auto resolver::token_name(std::uint16_t id) -> std::string +{ + const auto itr = token_map.find(id); + + if (itr != token_map.end()) + { + return itr->second; + } + + return utils::string::va("_ID%i", id); +} + +auto resolver::find_function(const std::string& name) -> bool +{ + const auto itr = function_map_rev.find(name); + + if (itr != function_map_rev.end()) + { + return true; + } + + return false; +} + +auto resolver::find_method(const std::string& name) -> bool +{ + const auto itr = method_map_rev.find(name); + + if (itr != method_map_rev.end()) + { + return true; + } + + return false; +} + +const std::array opcode_list +{{ + { std::uint8_t(opcode::OP_End),"END" }, + { std::uint8_t(opcode::OP_Return),"RETN" }, + { std::uint8_t(opcode::OP_GetByte),"GET_BYTE" }, + { std::uint8_t(opcode::OP_GetNegByte),"GET_NBYTE" }, + { std::uint8_t(opcode::OP_GetUnsignedShort),"GET_USHORT" }, + { std::uint8_t(opcode::OP_GetNegUnsignedShort),"GET_NUSHORT" }, + { std::uint8_t(opcode::OP_GetInteger),"GET_INT" }, + { std::uint8_t(opcode::OP_GetBuiltinFunction),"GET_BUILTIN_FUNC" }, + { std::uint8_t(opcode::OP_GetBuiltinMethod),"GET_BUILTIN_METHOD" }, + { std::uint8_t(opcode::OP_GetFloat),"GET_FLOAT" }, + { std::uint8_t(opcode::OP_GetString),"GET_STRING" }, + { std::uint8_t(opcode::OP_GetUndefined),"GET_UNDEFINED" }, + { std::uint8_t(opcode::OP_GetZero),"GET_ZERO" }, + { std::uint8_t(opcode::OP_waittillFrameEnd),"WAITTILLFRAMEEND" }, + { std::uint8_t(opcode::OP_CreateLocalVariable),"CREATE_LOCAL_VARIABLE" }, + { std::uint8_t(opcode::OP_RemoveLocalVariables),"REMOVE_LOCAL_VARIABLES" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached0),"EVAL_LOCAL_VARIABLE_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached1),"EVAL_LOCAL_VARIABLE_CACHED1" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached2),"EVAL_LOCAL_VARIABLE_CACHED2" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached3),"EVAL_LOCAL_VARIABLE_CACHED3" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached4),"EVAL_LOCAL_VARIABLE_CACHED4" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached5),"EVAL_LOCAL_VARIABLE_CACHED5" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached),"EVAL_LOCAL_VARIABLE_CACHED" }, + { std::uint8_t(opcode::OP_EvalLocalArrayCached),"EVAL_LOCAL_ARRAY_CACHED" }, + { std::uint8_t(opcode::OP_EvalArray),"EVAL_ARRAY" }, + { std::uint8_t(opcode::OP_EvalNewLocalArrayRefCached0),"EVAL_NEW_LOCAL_ARRAY_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalArrayRefCached0),"EVAL_LOCAL_ARRAY_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalArrayRefCached),"EVAL_LOCAL_ARRAY_REF_CACHED" }, + { std::uint8_t(opcode::OP_EvalArrayRef),"EVAL_ARRAY_REF" }, + { std::uint8_t(opcode::OP_ClearArray),"CLEAR_ARRAY" }, + { std::uint8_t(opcode::OP_EmptyArray),"EMPTY_ARRAY" }, + { std::uint8_t(opcode::OP_AddArray),"ADD_ARRAY" }, + { std::uint8_t(opcode::OP_PreScriptCall),"PRE_CALL" }, + { std::uint8_t(opcode::OP_ScriptLocalFunctionCall2),"CALL_LOCAL_FUNC2" }, + { std::uint8_t(opcode::OP_ScriptLocalFunctionCall),"CALL_LOCAL_FUNC" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodCall),"CALL_LOCAL_METHOD" }, + { std::uint8_t(opcode::OP_ScriptLocalThreadCall),"CALL_LOCAL_FUNC_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalChildThreadCall),"CALL_LOCAL_FUNC_CHILD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodThreadCall),"CALL_LOCAL_METHOD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodChildThreadCall),"CALL_LOCAL_METHOD_CHILD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptFarFunctionCall2),"CALL_FAR_FUNC2" }, + { std::uint8_t(opcode::OP_ScriptFarFunctionCall),"CALL_FAR_FUNC" }, + { std::uint8_t(opcode::OP_ScriptFarMethodCall),"CALL_FAR_METHOD" }, + { std::uint8_t(opcode::OP_ScriptFarThreadCall),"CALL_FAR_FUNC_THREAD" }, + { std::uint8_t(opcode::OP_ScriptFarChildThreadCall),"CALL_FAR_FUNC_CHILD_THREAD"}, + { std::uint8_t(opcode::OP_ScriptFarMethodThreadCall),"CALL_FAR_METHOD_THEAD" }, + { std::uint8_t(opcode::OP_ScriptFarMethodChildThreadCall),"CALL_FAR_METHOD_CHILD_THEAD" }, + { std::uint8_t(opcode::OP_ScriptFunctionCallPointer),"CALL_FUNC_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodCallPointer),"CALL_METHOD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptThreadCallPointer),"CALL_FUNC_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptChildThreadCallPointer),"CALL_FUNC_CHILD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodThreadCallPointer),"CALL_METHOD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodChildThreadCallPointer),"CALL_METHOD_CHILD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_CallBuiltinPointer),"CALL_BUILTIN_FUNC_POINTER" }, + { std::uint8_t(opcode::OP_CallBuiltinMethodPointer),"CALL_BUILTIN_METHOD_POINTER" }, + { std::uint8_t(opcode::OP_GetIString),"GET_ISTRING" }, + { std::uint8_t(opcode::OP_GetVector),"GET_VECTOR" }, + { std::uint8_t(opcode::OP_GetLevelObject),"GET_LEVEL_OBJ" }, + { std::uint8_t(opcode::OP_GetAnimObject),"GET_ANIM_OBJ" }, + { std::uint8_t(opcode::OP_GetSelf),"GET_SELF" }, + { std::uint8_t(opcode::OP_GetThisthread),"GET_THISTHREAD" }, + { std::uint8_t(opcode::OP_GetLevel),"GET_LEVEL" }, + { std::uint8_t(opcode::OP_GetGame),"GET_GAME" }, + { std::uint8_t(opcode::OP_GetAnim),"GET_ANIM" }, + { std::uint8_t(opcode::OP_GetAnimation),"GET_ANIMATION" }, + { std::uint8_t(opcode::OP_GetGameRef),"GET_GAME_REF" }, + { std::uint8_t(opcode::OP_inc),"INC" }, + { std::uint8_t(opcode::OP_dec),"DEC" }, + { std::uint8_t(opcode::OP_bit_or),"BIT_OR" }, + { std::uint8_t(opcode::OP_JumpOnFalseExpr),"JMP_EXPR_FALSE" }, + { std::uint8_t(opcode::OP_bit_ex_or),"BIT_EXOR" }, + { std::uint8_t(opcode::OP_bit_and),"BIT_AND" }, + { std::uint8_t(opcode::OP_equality),"EQUALITY" }, + { std::uint8_t(opcode::OP_inequality),"INEQUALITY" }, + { std::uint8_t(opcode::OP_less),"LESS" }, + { std::uint8_t(opcode::OP_greater),"GREATER" }, + { std::uint8_t(opcode::OP_JumpOnTrueExpr),"JMP_EXPR_TRUE" }, + { std::uint8_t(opcode::OP_less_equal),"LESSEQUAL" }, + { std::uint8_t(opcode::OP_jumpback),"JMP_BACK" }, + { std::uint8_t(opcode::OP_waittillmatch2),"WAITTILLMATCH2" }, + { std::uint8_t(opcode::OP_waittill),"WAITTILL" }, + { std::uint8_t(opcode::OP_notify),"NOTIFY" }, + { std::uint8_t(opcode::OP_endon),"ENDON" }, + { std::uint8_t(opcode::OP_voidCodepos),"VOIDCODEPOS" }, + { std::uint8_t(opcode::OP_switch),"SWITCH" }, + { std::uint8_t(opcode::OP_endswitch),"ENDSWITCH" }, + { std::uint8_t(opcode::OP_vector),"VECTOR" }, + { std::uint8_t(opcode::OP_JumpOnFalse),"JMP_FALSE" }, + { std::uint8_t(opcode::OP_greater_equal),"GREATEREQUAL" }, + { std::uint8_t(opcode::OP_shift_left),"SHIFT_LEFT" }, + { std::uint8_t(opcode::OP_shift_right),"SHIFT_RIGHT" }, + { std::uint8_t(opcode::OP_plus),"PLUS" }, + { std::uint8_t(opcode::OP_jump),"JMP" }, + { std::uint8_t(opcode::OP_minus),"MINUS" }, + { std::uint8_t(opcode::OP_multiply),"MULT" }, + { std::uint8_t(opcode::OP_divide),"DIV" }, + { std::uint8_t(opcode::OP_mod),"MOD" }, + { std::uint8_t(opcode::OP_JumpOnTrue),"JMP_TRUE" }, + { std::uint8_t(opcode::OP_size),"SIZE" }, + { std::uint8_t(opcode::OP_waittillmatch),"WAITTILLMATCH" }, + { std::uint8_t(opcode::OP_GetLocalFunction),"GET_LOCAL_FUNC" }, + { std::uint8_t(opcode::OP_GetFarFunction),"GET_FAR_FUNC" }, + { std::uint8_t(opcode::OP_GetSelfObject),"GET_SELF_OBJ" }, + { std::uint8_t(opcode::OP_EvalLevelFieldVariable),"EVAL_LEVEL_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalAnimFieldVariable),"EVAL_ANIM_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalSelfFieldVariable),"EVAL_SELF_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalFieldVariable),"EVAL_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalLevelFieldVariableRef),"EVAL_LEVEL_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalAnimFieldVariableRef),"EVAL_ANIM_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalSelfFieldVariableRef),"EVAL_SELF_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalFieldVariableRef),"EVAL_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_ClearFieldVariable),"CLEAR_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_SafeCreateVariableFieldCached),"SAFE_CREATE_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_SafeSetVariableFieldCached0),"SAFE_SET_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SafeSetVariableFieldCached),"SAFE_SET_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_SafeSetWaittillVariableFieldCached),"SAFE_SET_WAITTILL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_GetAnimTree),"GET_ANIMTREE" }, + { std::uint8_t(opcode::OP_clearparams),"CLEAR_PARAMS" }, + { std::uint8_t(opcode::OP_checkclearparams),"CHECK_CLEAR_PARAMS" }, + { std::uint8_t(opcode::OP_EvalLocalVariableRefCached0),"EVAL_LOCAL_VARIABLE_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalNewLocalVariableRefCached0),"EVAL_NEW_LOCAL_VARIABLE_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalVariableRefCached),"EVAL_LOCAL_VARIABLE_REF_CACHED" }, + { std::uint8_t(opcode::OP_SetLevelFieldVariableField),"SET_LEVEL_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetVariableField),"SET_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_ClearVariableField),"CLEAR_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetAnimFieldVariableField),"SET_ANIM_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetSelfFieldVariableField),"SET_SELF_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetLocalVariableFieldCached0),"SET_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SetNewLocalVariableFieldCached0),"SET_NEW_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SetLocalVariableFieldCached),"SET_LOCAL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_ClearLocalVariableFieldCached),"CLEAR_LOCAL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_ClearLocalVariableFieldCached0),"CLEAR_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_CallBuiltin0),"CALL_BUILTIN_FUNC_0" }, + { std::uint8_t(opcode::OP_CallBuiltin1),"CALL_BUILTIN_FUNC_1" }, + { std::uint8_t(opcode::OP_CallBuiltin2),"CALL_BUILTIN_FUNC_2" }, + { std::uint8_t(opcode::OP_CallBuiltin3),"CALL_BUILTIN_FUNC_3" }, + { std::uint8_t(opcode::OP_CallBuiltin4),"CALL_BUILTIN_FUNC_4" }, + { std::uint8_t(opcode::OP_CallBuiltin5),"CALL_BUILTIN_FUNC_5" }, + { std::uint8_t(opcode::OP_CallBuiltin),"CALL_BUILTIN_FUNC" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod0),"CALL_BUILTIN_METHOD_0" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod1),"CALL_BUILTIN_METHOD_1" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod2),"CALL_BUILTIN_METHOD_2" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod3),"CALL_BUILTIN_METHOD_3" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod4),"CALL_BUILTIN_METHOD_4" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod5),"CALL_BUILTIN_METHOD_5" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod),"CALL_BUILTIN_METHOD" }, + { std::uint8_t(opcode::OP_wait),"WAIT" }, + { std::uint8_t(opcode::OP_DecTop),"DEC_TOP" }, + { std::uint8_t(opcode::OP_CastFieldObject),"CAST_FIELD_OBJ" }, + { std::uint8_t(opcode::OP_EvalLocalVariableObjectCached),"EVAL_LOCAL_VARIABLE_OBJECT_CACHED" }, + { std::uint8_t(opcode::OP_CastBool),"CAST_BOOL" }, + { std::uint8_t(opcode::OP_BoolNot),"BOOL_NOT" }, + { std::uint8_t(opcode::OP_BoolComplement),"BOOL_COMPLEMENT" }, + { std::uint8_t(opcode::OP_waitFrame), "WAITFRAME" }, +}}; + +const std::array function_list +{{ + { 0x001, "precacheturret" }, + { 0x002, "getweaponarray" }, + { 0x003, "createprintchannel" }, + { 0x004, "updategamerprofileall" }, + { 0x005, "clearlocalizedstrings" }, + { 0x006, "setphysicsgravitydir" }, + { 0x007, "gettimescale" }, + { 0x008, "settimescale" }, + { 0x009, "setslowmotionview" }, + { 0x00A, "teleportscene" }, + { 0x00B, "forcesharedammo" }, + { 0x00C, "refreshhudcompass" }, + { 0x00D, "refreshhudammocounter" }, + { 0x00E, "notifyoncommand" }, + { 0x00F, "setprintchannel" }, + { 0x010, "print" }, + { 0x011, "println" }, + { 0x012, "print3d" }, + { 0x013, "line" }, + { 0x014, "box" }, + { 0x015, "orientedbox" }, + { 0x016, "sphere" }, + { 0x017, "cylinder" }, + { 0x018, "spawnturret" }, + { 0x019, "canspawnturret" }, + { 0x01A, "assert" }, + { 0x01B, "pausecinematicingame" }, + { 0x01C, "drawcompassfriendlies" }, + { 0x01D, "bulletspread" }, + { 0x01E, "bullettracer" }, + { 0x01F, "badplace_delete" }, + { 0x020, "badplace_cylinder" }, + { 0x021, "badplace_arc" }, + { 0x022, "badplace_brush" }, + { 0x023, "_func_023" }, // SP 0x140261020 + { 0x024, "_func_024" }, // SP 0x14027EA80 + { 0x025, "_func_025" }, // SP 0x14027EB20 + { 0x026, "_func_026" }, // SP 0x14027E9B0 + { 0x027, "_func_027" }, // SP 0x14027E870 + { 0x028, "_func_028" }, // empty + { 0x029, "_func_029" }, // empty + { 0x02A, "_func_02A" }, // empty + { 0x02B, "_func_02B" }, // empty + { 0x02C, "updategamerprofile" }, + { 0x02D, "assertex" }, + { 0x02E, "assertmsg" }, + { 0x02F, "isdefined" }, + { 0x030, "isvalidmissile" }, + { 0x031, "isstring" }, + { 0x032, "setomnvar" }, + { 0x033, "getomnvar" }, + { 0x034, "setdvar" }, + { 0x035, "setdynamicdvar" }, + { 0x036, "setdvarifuninitialized" }, + { 0x037, "setdevdvar" }, + { 0x038, "setdevdvarifuninitialized" }, + { 0x039, "getdvar" }, + { 0x03A, "getdvarint" }, + { 0x03B, "getdvarfloat" }, + { 0x03C, "getdvarvector" }, + { 0x03D, "gettime" }, + { 0x03E, "gettimeutc" }, + { 0x03F, "_func_03F" }, // SP 0x14024B9C0, MP 0x1403156A0 + { 0x040, "getentbynum" }, + { 0x041, "getweaponmodel" }, + { 0x042, "getculldist" }, + { 0x043, "sethalfresparticles" }, + { 0x044, "getmapsunlight" }, + { 0x045, "setsunlight" }, + { 0x046, "resetsunlight" }, + { 0x047, "getmapsundirection" }, + { 0x048, "getmapsunangles" }, + { 0x049, "setsundirection" }, + { 0x04A, "lerpsundirection" }, + { 0x04B, "lerpsunangles" }, + { 0x04C, "resetsundirection" }, + { 0x04D, "enableforcedsunshadows" }, + { 0x04E, "enableforcednosunshadows" }, + { 0x04F, "disableforcedsunshadows" }, + { 0x050, "enableouterspacemodellighting" }, + { 0x051, "disableouterspacemodellighting" }, + { 0x052, "remapstage" }, + { 0x053, "_func_053" }, // SP 0x14025F6B0 + { 0x054, "_func_054" }, // SP 0x14025F800 + { 0x055, "_func_055" }, // SP 0x14025F830 + { 0x056, "_func_056" }, // SP 0x14025F850 + { 0x057, "_func_057" }, // SP 0x14025F920 + { 0x058, "_func_058" }, // SP 0x14025FA20 + { 0x059, "_func_059" }, // SP 0x14025FB80 + { 0x05A, "_func_05A" }, // SP 0x14025FC00 + { 0x05B, "_func_05B" }, // SP 0x14025FC80 + { 0x05C, "_func_05C" }, // SP 0x14025FE00 + { 0x05D, "getweapondisplayname" }, + { 0x05E, "getweaponbasename" }, + { 0x05F, "getweaponattachments" }, + { 0x060, "getweaponattachmentdisplaynames" }, + { 0x061, "getweaponcamoname" }, + { 0x062, "getweaponreticlename" }, + { 0x063, "getanimlength" }, + { 0x064, "animhasnotetrack" }, + { 0x065, "getnotetracktimes" }, + { 0x066, "spawn" }, + { 0x067, "spawnloopsound" }, + { 0x068, "spawnloopingsound" }, + { 0x069, "bullettrace" }, + { 0x06A, "target_setmaxsize" }, + { 0x06B, "target_setcolor" }, + { 0x06C, "target_setdelay" }, + { 0x06D, "getstartorigin" }, + { 0x06E, "getstartangles" }, + { 0x06F, "_func_06F" }, // SP 0x14020DCB0 + { 0x070, "_func_070" }, // SP 0x14025FCB0 + { 0x071, "_func_071" }, // SP 0x140243B90, MP 0x1403104D0 + { 0x072, "_func_072" }, // SP 0x14025BCC0 + { 0x073, "_func_073" }, // SP 0x14025BD60 + { 0x074, "_func_074" }, // SP 0x14025BFA0 + { 0x075, "_func_075" }, // SP 0x14025C150 + { 0x076, "_func_076" }, // SP 0x140246C90, MP 0x140311AD0 + { 0x077, "_func_077" }, // SP 0x140246D70, MP 0x140311D80 + { 0x078, "_func_078" }, // SP 0x140246DA0, MP 0x140311D90 + { 0x079, "_func_079" }, // SP 0x140246F10, MP 0x140311DF0 + { 0x07A, "_func_07A" }, // SP 0x140247010, MP 0x140311EF0 + { 0x07B, "_func_07B" }, // SP 0x140247060, MP 0x140311F50 + { 0x07C, "_func_07C" }, // SP 0x14025C320 + { 0x07D, "_func_07D" }, // SP 0x14025D3E0 + { 0x07E, "_func_07E" }, // SP 0x14025C220 + { 0x07F, "_func_07F" }, // SP 0x14025F620 + { 0x080, "_func_080" }, // SP 0x140241480, MP 0x14031FB60 + { 0x081, "_func_081" }, // SP 0x14025F640 + { 0x082, "_func_082" }, // SP 0x14025F690 + { 0x083, "_func_083" }, // SP 0x14025D480 + { 0x084, "_func_084" }, // SP 0x14025E160 + { 0x085, "_func_085" }, // SP 0x14025E180 + { 0x086, "_func_086" }, // SP 0x14025D8D0 + { 0x087, "_func_087" }, // SP 0x14025E1A0 + { 0x088, "_func_088" }, // SP 0x14025E270 + { 0x089, "_func_089" }, // SP 0x14025FE70 + { 0x08A, "_func_08A" }, // SP 0x140260370 + { 0x08B, "bullettracepassed" }, + { 0x08C, "sighttracepassed" }, + { 0x08D, "physicstrace" }, + { 0x08E, "playerphysicstrace" }, + { 0x08F, "getgroundposition" }, + { 0x090, "getmovedelta" }, + { 0x091, "getangledelta" }, + { 0x092, "getnorthyaw" }, + { 0x093, "_func_093" }, // SP 0x14025C1F0 + { 0x094, "_func_094" }, // SP 0x14025C2F0 + { 0x095, "_func_095" }, // SP 0x14025E330 + { 0x096, "_func_096" }, // SP 0x14025E380 + { 0x097, "_func_097" }, // SP 0x14025E2F0 + { 0x098, "_func_098" }, // SP 0x14026C770 + { 0x099, "_func_099" }, // SP 0x14026CB40 + { 0x09A, "_func_09A" }, // SP 0x14026CE30 + { 0x09B, "_func_09B" }, // SP 0x14026CDF0 + { 0x09C, "_func_09C" }, // SP 0x14026D9F0 + { 0x09D, "_func_09D" }, // SP 0x14026D670 + { 0x09E, "_func_09E" }, // SP 0x14026CCC0 + { 0x09F, "_func_09F" }, // SP 0x14026CC50 + { 0x0A0, "_func_0A0" }, // SP 0x14026DB20 + { 0x0A1, "_func_0A1" }, // SP 0x14026C790 + { 0x0A2, "_func_0A2" }, // SP 0x14026CBD0 + { 0x0A3, "_func_0A3" }, // SP 0x14026CD60 + { 0x0A4, "_func_0A4" }, // SP 0x14026CE50 + { 0x0A5, "_func_0A5" }, // SP 0x14026D2E0 + { 0x0A6, "_func_0A6" }, // SP 0x14026CC40 + { 0x0A7, "_func_0A7" }, // SP 0x14026DB10 + { 0x0A8, "_func_0A8" }, // SP 0x14026D8C0 + { 0x0A9, "_func_0A9" }, // SP 0x14026C7C0 + { 0x0AA, "_func_0AA" }, // SP 0x14026C9F0 + { 0x0AB, "_func_0AB" }, // SP 0x14026C8F0 + { 0x0AC, "_func_0AC" }, // SP 0x14026D520 + { 0x0AD, "setnorthyaw" }, + { 0x0AE, "setslowmotion" }, + { 0x0AF, "randomint" }, + { 0x0B0, "randomfloat" }, + { 0x0B1, "randomintrange" }, + { 0x0B2, "randomfloatrange" }, + { 0x0B3, "sin" }, + { 0x0B4, "cos" }, + { 0x0B5, "tan" }, + { 0x0B6, "asin" }, + { 0x0B7, "acos" }, + { 0x0B8, "atan" }, + { 0x0B9, "int" }, + { 0x0BA, "float" }, + { 0x0BB, "abs" }, + { 0x0BC, "min" }, // check! + { 0x0BD, "objective_additionalcurrent" }, + { 0x0BE, "objective_ring" }, + { 0x0BF, "objective_setpointertextoverride" }, + { 0x0C0, "getnode" }, + { 0x0C1, "getnodearray" }, + { 0x0C2, "getallnodes" }, + { 0x0C3, "getnodesinradius" }, + { 0x0C4, "getnodesinradiussorted" }, + { 0x0C5, "getclosestnodeinsight" }, + { 0x0C6, "getreflectionlocs" }, + { 0x0C7, "getreflectionreferencelocs" }, + { 0x0C8, "getvehicletracksegment" }, + { 0x0C9, "getvehicletracksegmentarray" }, + { 0x0CA, "getallvehicletracksegments" }, + { 0x0CB, "isarray" }, + { 0x0CC, "isai" }, + { 0x0CD, "getindexforluincstring" }, + { 0x0CE, "issentient" }, + { 0x0CF, "_func_0CF" }, // SP 0x140259F30 + { 0x0D0, "_func_0D0" }, // SP 0x14025A0E0 + { 0x0D1, "_func_0D1" }, // SP 0x14025A170 + { 0x0D2, "_func_0D2" }, // SP 0x14025A1F0 + { 0x0D3, "_func_0D3" }, // SP 0x14025A220 + { 0x0D4, "_func_0D4" }, // SP 0x14025A620 + { 0x0D5, "_func_0D5" }, // SP 0x14025B700 + { 0x0D6, "_func_0D6" }, // SP 0x14025B8F0 + { 0x0D7, "_func_0D7" }, // SP 0x14025BA10 + { 0x0D8, "_func_0D8" }, // SP 0x14025BC40 + { 0x0D9, "_func_0D9" }, // SP 0x14025BB90 + { 0x0DA, "_func_0DA" }, // SP 0x14025BE80 + { 0x0DB, "_func_0DB" }, // SP 0x14025BF20 + { 0x0DC, "_func_0DC" }, // empty + { 0x0DD, "_func_0DD" }, // SP 0x14025C0E0 + { 0x0DE, "max" }, // check! + { 0x0DF, "floor" }, + { 0x0E0, "ceil" }, + { 0x0E1, "exp" }, + { 0x0E2, "log" }, + { 0x0E3, "sqrt" }, + { 0x0E4, "squared" }, + { 0x0E5, "clamp" }, + { 0x0E6, "angleclamp" }, + { 0x0E7, "angleclamp180" }, + { 0x0E8, "vectorfromlinetopoint" }, + { 0x0E9, "pointonsegmentnearesttopoint" }, + { 0x0EA, "distance" }, + { 0x0EB, "distance2d" }, + { 0x0EC, "distancesquared" }, + { 0x0ED, "length" }, + { 0x0EE, "length2d" }, + { 0x0EF, "lengthsquared" }, + { 0x0F0, "length2dsquared" }, + { 0x0F1, "closer" }, + { 0x0F2, "vectordot" }, + { 0x0F3, "vectorcross" }, + { 0x0F4, "axistoangles" }, + { 0x0F5, "visionsetthermal" }, + { 0x0F6, "visionsetpain" }, + { 0x0F7, "endlobby" }, + { 0x0F8, "setac130ambience" }, + { 0x0F9, "getmapcustom" }, + { 0x0FA, "spawnsighttrace" }, + { 0x0FB, "incrementcounter" }, + { 0x0FC, "getcountertotal" }, + { 0x0FD, "getlevelticks" }, + { 0x0FE, "perlinnoise2d" }, + { 0x0FF, "calcrockingangles" }, + { 0x100, "reconevent" }, + { 0x101, "reconspatialevent" }, + { 0x102, "setsunflareposition" }, + { 0x103, "createthreatbiasgroup" }, + { 0x104, "threatbiasgroupexists" }, + { 0x105, "getthreatbias" }, + { 0x106, "setthreatbias" }, + { 0x107, "setthreatbiasagainstall" }, + { 0x108, "setignoremegroup" }, + { 0x109, "isenemyteam" }, + { 0x10A, "objective_additionalentity" }, + { 0x10B, "objective_state_nomessage" }, + { 0x10C, "objective_string" }, + { 0x10D, "objective_string_nomessage" }, + { 0x10E, "objective_additionalposition" }, + { 0x10F, "objective_current_nomessage" }, + { 0x110, "vectornormalize" }, + { 0x111, "vectortoangles" }, + { 0x112, "vectortoyaw" }, + { 0x113, "vectorlerp" }, + { 0x114, "anglestoup" }, + { 0x115, "anglestoright" }, + { 0x116, "anglestoforward" }, + { 0x117, "anglesdelta" }, + { 0x118, "combineangles" }, + { 0x119, "transformmove" }, + { 0x11A, "rotatevector" }, + { 0x11B, "rotatepointaroundvector" }, + { 0x11C, "issubstr" }, + { 0x11D, "isendstr" }, + { 0x11E, "getsubstr" }, + { 0x11F, "tolower" }, + { 0x120, "strtok" }, + { 0x121, "stricmp" }, + { 0x122, "ambientplay" }, + { 0x123, "getuavstrengthmax" }, + { 0x124, "getuavstrengthlevelneutral" }, + { 0x125, "getuavstrengthlevelshowenemyfastsweep" }, + { 0x126, "getuavstrengthlevelshowenemydirectional" }, + { 0x127, "blockteamradar" }, + { 0x128, "unblockteamradar" }, + { 0x129, "isteamradarblocked" }, + { 0x12A, "getassignedteam" }, + { 0x12B, "setmatchdata" }, + { 0x12C, "getmatchdata" }, + { 0x12D, "sendmatchdata" }, + { 0x12E, "clearmatchdata" }, + { 0x12F, "setmatchdatadef" }, + { 0x130, "setmatchclientip" }, + { 0x131, "setmatchdataid" }, + { 0x132, "setclientmatchdata" }, + { 0x133, "getclientmatchdata" }, + { 0x134, "setclientmatchdatadef" }, + { 0x135, "sendclientmatchdata" }, + { 0x136, "getbuildversion" }, + { 0x137, "getbuildnumber" }, + { 0x138, "getsystemtime" }, + { 0x139, "getmatchrulesdata" }, + { 0x13A, "isusingmatchrulesdata" }, + { 0x13B, "kick" }, + { 0x13C, "issplitscreen" }, + { 0x13D, "setmapcenter" }, + { 0x13E, "setgameendtime" }, + { 0x13F, "visionsetnaked" }, + { 0x140, "visionsetnight" }, + { 0x141, "visionsetmissilecam" }, + { 0x142, "ambientstop" }, + { 0x143, "precachemodel" }, + { 0x144, "precacheshellshock" }, + { 0x145, "precacheitem" }, + { 0x146, "precacheshader" }, + { 0x147, "precachestring" }, + { 0x148, "precachemenu" }, + { 0x149, "precacherumble" }, + { 0x14A, "precachelocationselector" }, + { 0x14B, "precacheleaderboards" }, + { 0x14C, "loadfx" }, + { 0x14D, "playfx" }, + { 0x14E, "playfxontag" }, + { 0x14F, "stopfxontag" }, + { 0x150, "killfxontag" }, + { 0x151, "playloopedfx" }, + { 0x152, "spawnfx" }, + { 0x153, "triggerfx" }, + { 0x154, "playfxontagforclients" }, + { 0x155, "setwinningteam" }, + { 0x156, "announcement" }, + { 0x157, "clientannouncement" }, + { 0x158, "setteammode" }, + { 0x159, "getteamscore" }, + { 0x15A, "setteamscore" }, + { 0x15B, "setclientnamemode" }, + { 0x15C, "updateclientnames" }, + { 0x15D, "getteamplayersalive" }, + { 0x15E, "logprint" }, + { 0x15F, "worldentnumber" }, + { 0x160, "obituary" }, + { 0x161, "positionwouldtelefrag" }, + { 0x162, "canspawn" }, + { 0x163, "getstarttime" }, + { 0x164, "precachestatusicon" }, + { 0x165, "precacheheadicon" }, + { 0x166, "precacheminimapicon" }, + { 0x167, "precachempanim" }, + { 0x168, "map_restart" }, + { 0x169, "_func_169" }, // MP 0x14032E320 + { 0x16A, "exitlevel" }, + { 0x16B, "_func_16B" }, // MP 0x14032E4E0 + { 0x16C, "_func_16C" }, // MP 0x14032EA90 + { 0x16D, "_func_16D" }, // MP 0x140328560 + { 0x16E, "_func_16E" }, // MP 0x14032EB80 + { 0x16F, "_func_16F" }, // MP 0x14032EEF0 + { 0x170, "_func_170" }, // MP 0x14032EBC0 + { 0x171, "_func_171" }, // MP 0x14032EC00 + { 0x172, "_func_172" }, // MP 0x140328580 + { 0x173, "_func_173" }, // MP 0x140328590 + { 0x174, "_func_174" }, // MP 0x140328700 + { 0x175, "_func_175" }, // MP 0x14032CBB0 + { 0x176, "_func_176" }, // MP 0x14032CC20 + { 0x177, "_func_177" }, // MP 0x14032CCE0 + { 0x178, "_func_178" }, // MP 0x14032CDC0 + { 0x179, "_func_179" }, // MP 0x14032CE20 + { 0x17A, "physicsexplosionsphere" }, + { 0x17B, "physicsexplosioncylinder" }, + { 0x17C, "physicsjolt" }, + { 0x17D, "physicsjitter" }, + { 0x17E, "setexpfog" }, + { 0x17F, "setexpfogext" }, + { 0x180, "setexpfogdvarsonly" }, + { 0x181, "setexpfogextdvarsonly" }, + { 0x182, "setatmosfog" }, + { 0x183, "setatmosfogdvarsonly" }, + { 0x184, "isexplosivedamagemod" }, + { 0x185, "radiusdamage" }, + { 0x186, "setplayerignoreradiusdamage" }, + { 0x187, "glassradiusdamage" }, + { 0x188, "earthquake" }, + { 0x189, "getnumparts" }, + { 0x18A, "objective_onentity" }, + { 0x18B, "objective_onentitywithrotation" }, + { 0x18C, "objective_team" }, + { 0x18D, "objective_player" }, + { 0x18E, "objective_playerteam" }, + { 0x18F, "objective_playerenemyteam" }, + { 0x190, "objective_playermask_hidefromall" }, + { 0x191, "objective_playermask_hidefrom" }, + { 0x192, "objective_playermask_showtoall" }, + { 0x193, "objective_playermask_showto" }, + { 0x194, "iprintln" }, + { 0x195, "iprintlnbold" }, + { 0x196, "logstring" }, + { 0x197, "getent" }, + { 0x198, "getentarray" }, + { 0x199, "getspawnarray" }, + { 0x19A, "spawnplane" }, + { 0x19B, "spawnstruct" }, + { 0x19C, "spawnhelicopter" }, + { 0x19D, "isalive" }, + { 0x19E, "isspawner" }, + { 0x19F, "missile_createattractorent" }, + { 0x1A0, "missile_createattractororigin" }, + { 0x1A1, "missile_createrepulsorent" }, + { 0x1A2, "missile_createrepulsororigin" }, + { 0x1A3, "missile_deleteattractor" }, + { 0x1A4, "playsoundatpos" }, + { 0x1A5, "newhudelem" }, + { 0x1A6, "newclienthudelem" }, + { 0x1A7, "_func_1A7" }, // MP 0x1402F05F0 + { 0x1A8, "_func_1A8" }, // SP 0x14031CC90, MP 0x1403F93E0 + { 0x1A9, "_func_1A9" }, // SP 0x140259DA0, MP 0x14032F850 + { 0x1AA, "_func_1AA" }, // MP 0x14032FAB0 + { 0x1AB, "_func_1AB" }, // SP 0x140243820, MP 0x14030C740 + { 0x1AC, "_func_1AC" }, // SP 0x140246030, MP 0x14030D4F0 + { 0x1AD, "_func_1AD" }, // SP 0x140242E20, MP 0x140321930 + { 0x1AE, "_func_1AE" }, // SP 0x140243EE0, MP 0x14030B270 + { 0x1AF, "_func_1AF" }, // SP 0x1402440F0, MP 0x14030B4B0 + { 0x1B0, "_func_1B0" }, // SP 0x140244650, MP 0x14030BC50 + { 0x1B1, "_func_1B1" }, // SP 0x140245010, MP 0x14030BFC0 + { 0x1B2, "_func_1B2" }, // SP 0x140244310, MP 0x14030B900 + { 0x1B3, "_func_1B3" }, // SP 0x1402451C0, MP 0x14030C220 + { 0x1B4, "_func_1B4" }, // SP 0x1402454B0, MP 0x14030C3F0 + { 0x1B5, "getnextarraykey" }, // SP 0x14024BD70, MP 0x1403148C0 + { 0x1B6, "_func_1B6" }, // SP 0x14024C730, MP 0x1403152C0 + { 0x1B7, "tablelookup" }, + { 0x1B8, "_func_1B8" }, // SP 0x140246A50, MP 0x14030FCE0 + { 0x1B9, "_func_1B9" }, // SP 0x140245E10, MP 0x14030F130 + { 0x1BA, "_func_1BA" }, // SP 0x140246C10, MP 0x14030FFB0 + { 0x1BB, "_func_1BB" }, // SP 0x140246130, MP 0x14030F490 + { 0x1BC, "_func_1BC" }, // SP 0x140246470, MP 0x14030F880 + { 0x1BD, "_func_1BD" }, // SP 0x1402444D0, MP 0x14030D5F0 + { 0x1BE, "_func_1BE" }, // SP 0x140254140, MP 0x14031F4A0 + { 0x1BF, "_func_1BF" }, // SP 0x14023EDB0, MP 0x1403207F0 + { 0x1C0, "_func_1C0" }, // SP 0x140243000, MP 0x14030D480 + { 0x1C1, "_func_1C1" }, // SP 0x140243130, MP 0x14030D6F0 + { 0x1C2, "_func_1C2" }, // SP 0x1404183C0, MP 0x14052CB00 + { 0x1C3, "_func_1C3" }, // SP 0x1402426B0, MP 0x1403212E0 + { 0x1C4, "_func_1C4" }, // SP 0x140242710, MP 0x140321420 + { 0x1C5, "_func_1C5" }, // SP 0x140242880, MP 0x140321480 + { 0x1C6, "_func_1C6" }, // SP 0x140250F70, MP 0x14031A340 + { 0x1C7, "_func_1C7" }, // MP 0x140313C30 + { 0x1C8, "_func_1C8" }, // MP 0x140313C40 + { 0x1C9, "_func_1C9" }, // MP 0x140313D00 + { 0x1CA, "_func_1CA" }, // MP 0x140313D10 + { 0x1CB, "_func_1CB" }, // MP 0x140313E50 + { 0x1CC, "_func_1CC" }, // MP 0x1403141A0 + { 0x1CD, "_func_1CD" }, // SP 0x14024AEF0, MP 0x1403141B0 + { 0x1CE, "_func_1CE" }, // SP 0x14024B370, MP 0x1403145A0 + { 0x1CF, "getarraykeys" }, // SP 0x14024BA30, MP 0x1403147E0 + { 0x1D0, "getfirstarraykey" }, // SP 0x14024BC20, MP 0x140314810 + { 0x1D1, "_func_1D1" }, // SP 0x140243340, MP 0x14030D890 + { 0x1D2, "_func_1D2" }, // SP 0x1402435C0, MP 0x14030DB50 + { 0x1D3, "_func_1D3" }, // SP 0x1402437D0, MP 0x14030E3B0 + { 0x1D4, "_func_1D4" }, // SP 0x1402439F0, MP 0x14030E6B0 + { 0x1D5, "_func_1D5" }, // SP 0x140243CA0, MP 0x14030E860 + { 0x1D6, "_func_1D6" }, // SP 0x1402440B0, MP 0x14030EB60 + { 0x1D7, "_func_1D7" }, // SP 0x140244EE0, MP 0x14030F410 + { 0x1D8, "_func_1D8" }, // SP 0x140244F60, MP 0x14030F440 + { 0x1D9, "_func_1D9" }, // SP 0x140268850, MP 0x140337220 + { 0x1DA, "_func_1DA" }, // SP 0x140268CD0, MP 0x140337350 + { 0x1DB, "_func_1DB" }, // SP 0x140268FA0, MP 0x1403373C0 + { 0x1DC, "_func_1DC" }, // SP 0x140268FE0, MP 0x140337460 + { 0x1DD, "_func_1DD" }, // SP 0x1402690C0, MP 0x1403374A0 + { 0x1DE, "_func_1DE" }, // SP 0x140269150, MP 0x140337600 + { 0x1DF, "_func_1DF" }, // SP 0x140245580, MP 0x14030C5F0 + { 0x1E0, "_func_1E0" }, // SP 0x140245870, MP 0x14030C960 + { 0x1E1, "_func_1E1" }, // SP 0x140245A90, MP 0x14030CAD0 + { 0x1E2, "_func_1E2" }, // SP 0x140245D00, MP 0x14030D110 + { 0x1E3, "_func_1E3" }, // SP 0x140246230, MP 0x14030D980 + { 0x1E4, "_func_1E4" }, // SP 0x1402464C0, MP 0x14030DFC0 + { 0x1E5, "_func_1E5" }, // SP 0x1402468A0, MP 0x14030E400 + { 0x1E6, "_func_1E6" }, // SP 0x140246E40, MP 0x14030E970 + { 0x1E7, "_func_1E7" }, // SP 0x14040ED30, MP 0x140523650 + { 0x1E8, "_func_1E8" }, // SP 0x14040EE20, MP 0x140523740 + { 0x1E9, "_func_1E9" }, // SP 0x14040ECD0, MP 0x1405235F0 + { 0x1EA, "_func_1EA" }, // SP 0x140418130, MP 0x14052C870 + { 0x1EB, "_func_1EB" }, // SP 0x140418440, MP 0x14052CBE0 + { 0x1EC, "_func_1EC" }, // SP 0x1404184A0, MP 0x14052CC40 + { 0x1ED, "_func_1ED" }, // SP 0x140418170, MP 0x14052C8B0 + { 0x1EE, "pow" }, + { 0x1EF, "angleclamp360" }, // SP 0x14024CB70, MP 0x140314390 + { 0x1F0, "_func_1F0" }, // MP 0x140432F70 + { 0x1F1, "_func_1F1" }, // MP 0x140432CB0 + { 0x1F2, "_func_1F2" }, // MP 0x1404335B0 + { 0x1F3, "_func_1F3" }, // MP 0x140433880 + { 0x1F4, "_func_1F4" }, // MP 0x1404336E0 + { 0x1F5, "_func_1F5" }, // MP 0x1404332A0 + { 0x1F6, "_func_1F6" }, // MP 0x140432CE0 + { 0x1F7, "_func_1F7" }, // MP 0x140433680 + { 0x1F8, "_func_1F8" }, // MP 0x1404332F0 + { 0x1F9, "isbot" }, + { 0x1FA, "_func_1FA" }, // MP 0x14032BE60 + { 0x1FB, "_func_1FB" }, // MP 0x140406E40 + { 0x1FC, "_func_1FC" }, // MP 0x140432CD0 + { 0x1FD, "_func_1FD" }, // MP 0x140432EE0 + { 0x1FE, "_func_1FE" }, // MP 0x1402D2430 + { 0x1FF, "_func_1FF" }, // SP 0x14027E8E0, MP 0x1402D3710 + { 0x200, "_func_200" }, // SP 0x14027E550, MP 0x1402D2530 + { 0x201, "_func_201" }, // MP 0x1402D28C0 + { 0x202, "_func_202" }, // MP 0x1402D28D0 + { 0x203, "_func_203" }, // MP 0x1402D2A40 + { 0x204, "_func_204" }, // MP 0x1402D30E0 + { 0x205, "_func_205" }, // MP 0x1402D3060 + { 0x206, "_func_206" }, // MP 0x1402D2370 + { 0x207, "_func_207" }, // MP 0x1402D2D20 + { 0x208, "_func_208" }, // MP 0x1402D29D0 + { 0x209, "_func_209" }, // SP 0x14025C070, MP 0x14032AF60 + { 0x20A, "_func_20A" }, // empty + { 0x20B, "_func_20B" }, // empty + { 0x20C, "_func_20C" }, // MP 0x1402D3310 + { 0x20D, "_func_20D" }, // MP 0x1402D1E20 + { 0x20E, "badplace_global" }, // MP 0x14031D9E0 + { 0x20F, "_func_20F" }, // MP 0x14032E640 + { 0x210, "_func_210" }, // SP 0x14027E220, MP 0x1402D2060 + { 0x211, "_func_211" }, // SP 0x140250D30, MP 0x14031B3C0 + { 0x212, "_func_212" }, // SP 0x140251190, MP 0x14031B850 + { 0x213, "_func_213" }, // SP 0x140259F80 + { 0x214, "_func_214" }, // empty + { 0x215, "_func_215" }, // empty + { 0x216, "_func_216" }, // MP 0x140330030 + { 0x217, "_func_217" }, // MP 0x14032E430 + { 0x218, "_func_218" }, // SP 0x140321E90 + { 0x219, "_func_219" }, // SP 0x1403220D0 + { 0x21A, "_func_21A" }, // SP 0x140322010 + { 0x21B, "_func_21B" }, // SP 0x140321FB0 + { 0x21C, "_func_21C" }, // SP 0x140321B90 + { 0x21D, "_func_21D" }, // SP 0x140321C10 + { 0x21E, "_func_21E" }, // SP 0x140321BC0 + { 0x21F, "_func_21F" }, // SP 0x140321C50 + { 0x220, "_func_220" }, // SP 0x1402509E0, MP 0x1403176D0 + { 0x221, "_func_221" }, // SP 0x14024FD80, MP 0x1403175D0 + { 0x222, "_func_222" }, // SP 0x140253430, MP 0x14031FB30 + { 0x223, "_func_223" }, // SP 0x1402538E0, MP 0x140320C40 + { 0x224, "_func_224" }, // SP 0x140253AE0, MP 0x140320E00 + { 0x225, "_func_225" }, // SP 0x140254010, MP 0x1403210C0 + { 0x226, "_func_226" }, // SP 0x140254670, MP 0x140321250 + { 0x227, "_func_227" }, // SP 0x14023DF60, MP 0x140321520 + { 0x228, "_func_228" }, // SP 0x14023E450, MP 0x1403217F0 + { 0x229, "_func_229" }, // MP 0x14030FA10 + { 0x22A, "_func_22A" }, // SP 0x140250490, MP 0x1403172F0 + { 0x22B, "_func_22B" }, // SP 0x14025FDE0 + { 0x22C, "_func_22C" }, // SP 0x14025FDC0 + { 0x22D, "_func_22D" }, // SP 0x14025FDA0 + { 0x22E, "_func_22E" }, // empty + { 0x22F, "_func_22F" }, // MP 0x14030B9E0 + { 0x230, "_func_230" }, // empty + { 0x231, "_func_231" }, // SP 0x1402403A0, MP 0x14030BB90 + { 0x232, "_func_232" }, // SP 0x140240810, MP 0x140320F60 + { 0x233, "_func_233" }, // SP 0x14025CF00, MP 0x14032BE10 + { 0x234, "_func_234" }, // SP 0x14025EA90 + { 0x235, "_func_235" }, // SP 0x14024CB60, MP 0x140321C30 + { 0x236, "_func_236" }, // MP 0x140321C40 + { 0x237, "_func_237" }, // empty + { 0x238, "_func_238" }, // SP 0x14024A020, MP 0x140311A40 + { 0x239, "_func_239" }, // SP 0x140247090, MP 0x14030EC50 + { 0x23A, "_func_23A" }, // SP 0x140247300, MP 0x14030F050 + { 0x23B, "_func_23B" }, // SP 0x1402474E0, MP 0x14030F340 + { 0x23C, "_func_23C" }, // SP 0x1402477E0, MP 0x14030F550 + { 0x23D, "_func_23D" }, // SP 0x140247A40, MP 0x14030F710 + { 0x23E, "_func_23E" }, // MP 0x1403295E0 + { 0x23F, "_func_23F" }, // SP 0x14023FCB0, MP 0x140322690 + { 0x240, "_func_240" }, // MP 0x140329600 + { 0x241, "_func_241" }, // MP 0x140329950 + { 0x242, "_func_242" }, // MP 0x1403299C0 + { 0x243, "_func_243" }, // MP 0x1403299D0 + { 0x244, "_func_244" }, // SP 0x14025D7C0 + { 0x245, "_func_245" }, // SP 0x140253C30, MP 0x14031A690 + { 0x246, "_func_246" }, // SP 0x14024F1E0, MP 0x1403163C0 + { 0x247, "_func_247" }, // SP 0x140252280, MP 0x140319020 + { 0x248, "_func_248" }, // SP 0x140260360 + { 0x249, "_func_249" }, // MP 0x14030B680 + { 0x24A, "_func_24A" }, // MP 0x14030B870 + { 0x24B, "_func_24B" }, // MP 0x14030B9D0 + { 0x24C, "_func_24C" }, // SP 0x1402531C0, MP 0x140319F60 + { 0x24D, "_func_24D" }, // SP 0x140253500, MP 0x140319FC0 + { 0x24E, "_func_24E" }, // SP 0x1402539F0, MP 0x14031A250 + { 0x24F, "_func_24F" }, // MP 0x140338900 + { 0x250, "_func_250" }, // SP 0x140259FA0 + { 0x251, "_func_251" }, // SP 0x140249700, MP 0x140310B20 + { 0x252, "_func_252" }, // SP 0x140240DE0, MP 0x14030CBF0 + { 0x253, "_func_253" }, // SP 0x140240E00, MP 0x14030CE90 + { 0x254, "_func_254" }, // SP 0x140241180, MP 0x14030D000 + { 0x255, "_func_255" }, // SP 0x140241330, MP 0x14030D2A0 + { 0x256, "_func_256" }, // SP 0x140241560, MP 0x14030D650 + { 0x257, "_func_257" }, // SP 0x140241970, MP 0x14030D8E0 + { 0x258, "_func_258" }, // SP 0x140241A70, MP 0x14030E070 + { 0x259, "_func_259" }, // SP 0x140241E30, MP 0x14030E4C0 + { 0x25A, "_func_25A" }, // SP 0x140241F40, MP 0x14030E7B0 + { 0x25B, "_func_25B" }, // SP 0x140242270, MP 0x14030EAC0 + { 0x25C, "_func_25C" }, // SP 0x1402425F0, MP 0x14030EED0 + { 0x25D, "_func_25D" }, // SP 0x140242960, MP 0x14030F280 + { 0x25E, "_func_25E" }, // SP 0x140242C80, MP 0x14030F640 + { 0x25F, "_func_25F" }, // SP 0x1402430E0, MP 0x14030F990 + { 0x260, "_func_260" }, // MP 0x14030FA20 + { 0x261, "_func_261" }, // MP 0x14032BC00 + { 0x262, "_func_262" }, // MP 0x14030FD60 + { 0x263, "_func_263" }, // MP 0x14030FDB0 + { 0x264, "_func_264" }, // MP 0x14030FF50 + { 0x265, "_func_265" }, // MP 0x140310030 + { 0x266, "_func_266" }, // MP 0x140310040 + { 0x267, "_func_267" }, // MP 0x1403101C0 + { 0x268, "_func_268" }, // MP 0x140328750 + { 0x269, "_func_269" }, // empty + { 0x26A, "_func_26A" }, // empty + { 0x26B, "_func_26B" }, // MP 0x140310250 + { 0x26C, "_func_26C" }, // MP 0x140310260 + { 0x26D, "_func_26D" }, // MP 0x140310360 + { 0x26E, "_func_26E" }, // MP 0x140310480 + { 0x26F, "_func_26F" }, // MP 0x14032C3B0 + { 0x270, "_func_270" }, // empty + { 0x271, "_func_271" }, // MP 0x140433260 + { 0x272, "_func_272" }, // MP 0x1403328E0 + { 0x273, "_func_273" }, // MP 0x140433220 + { 0x274, "_func_274" }, // MP 0x14030F630 + { 0x275, "_func_275" }, // MP 0x1402F05B0 + { 0x276, "_func_276" }, // MP 0x14030C470 + { 0x277, "_func_277" }, // MP 0x14030C480 + { 0x278, "_func_278" }, // MP 0x14030BA90 + { 0x279, "_func_279" }, // SP 0x1402476E0, MP 0x140310920 + { 0x27A, "_func_27A" }, // MP 0x14032C4A0 + { 0x27B, "_func_27B" }, // MP 0x14032C4B0 + { 0x27C, "_func_27C" }, // MP 0x14032C4D0 + { 0x27D, "_func_27D" }, // MP 0x14032C840 + { 0x27E, "_func_27E" }, // MP 0x14032CAB0 + { 0x27F, "_func_27F" }, // MP 0x14030BB00 + { 0x280, "_func_280" }, // MP 0x14032F7E0 + { 0x281, "_func_281" }, // MP 0x14032E600 + { 0x282, "_func_282" }, // MP 0x140310EC0 + { 0x283, "_func_283" }, // SP 0x14023EC00, MP 0x14031BAE0 + { 0x284, "_func_284" }, // SP 0x14023F300, MP 0x14031C2B0 + { 0x285, "_func_285" }, // MP 0x140043610 + { 0x286, "istestclient" }, + { 0x287, "_func_287" }, // MP 0x1402D2850 + { 0x288, "_func_288" }, // MP 0x14032F0C0 + { 0x289, "_func_289" }, // SP 0x1402471A0, MP 0x140311FF0 + { 0x28A, "_func_28A" }, // SP 0x1402471E0, MP 0x140312040 + { 0x28B, "_func_28B" }, // SP 0x140259CC0 + { 0x28C, "_func_28C" }, // SP 0x140244780, MP 0x140311100 + { 0x28D, "_func_28D" }, // SP 0x140247F80, MP 0x140314C70 + { 0x28E, "_func_28E" }, // SP 0x140244530, MP 0x14030D340 + { 0x28F, "_func_28F" }, // SP 0x1402453C0, MP 0x14030DA60 + { 0x290, "_func_290" }, // SP 0x140245780, MP 0x14030E5C0 + { 0x291, "_func_291" }, // SP 0x1402601E0 + { 0x292, "_func_292" }, // MP 0x14031FDA0 + { 0x293, "_func_293" }, // SP 0x1402503F0, MP 0x140317140 + { 0x294, "_func_294" }, // SP 0x140246AD0, MP 0x14030FD70 + { 0x295, "_func_295" }, // SP 0x140246F20, MP 0x140310210 + { 0x296, "_func_296" }, // SP 0x140247200, MP 0x140310370 + { 0x297, "_func_297" }, // MP 0x14032FBA0 + { 0x298, "_func_298" }, // MP 0x14032FCA0 + { 0x299, "_func_299" }, // SP 0x140246B10, MP 0x14030E700 + { 0x29A, "_func_29A" }, // SP 0x1402603C0 + { 0x29B, "_func_29B" }, // SP 0x14024CE40, MP 0x140316070 + { 0x29C, "_func_29C" }, // MP 0x14031FC20 + { 0x29D, "_func_29D" }, // SP 0x14024A520, MP 0x140318030 + { 0x29E, "_func_29E" }, // MP 0x140318A90 + { 0x29F, "_func_29F" }, // MP 0x140318560 + { 0x2A0, "_func_2A0" }, // MP 0x140328F10 + { 0x2A1, "_func_2A1" }, // SP 0x14025A630 + { 0x2A2, "_func_2A2" }, // SP 0x140243B50, MP 0x14030CA90 + { 0x2A3, "_func_2A3" }, // SP 0x14024B760, MP 0x1403199C0 + { 0x2A4, "_func_2A4" }, // SP 0x14024AB20, MP 0x140319680 + { 0x2A5, "_func_2A5" }, // SP 0x14024B670, MP 0x1403199A0 + { 0x2A6, "_func_2A6" }, // SP 0x14024B710, MP 0x1403199B0 + { 0x2A7, "_func_2A7" }, // SP 0x14024B850, MP 0x140319A20 + { 0x2A8, "_func_2A8" }, // MP 0x14032D2A0 + { 0x2A9, "_func_2A9" }, // MP 0x14032D300 + { 0x2AA, "_func_2AA" }, // MP 0x14032D340 + { 0x2AB, "_func_2AB" }, // MP 0x14032D780 + { 0x2AC, "_func_2AC" }, // MP 0x14031CA40 + { 0x2AD, "_func_2AD" }, // MP 0x14031E1F0 + { 0x2AE, "_func_2AE" }, // SP 0x14023E7F0, MP 0x140321880 + { 0x2AF, "_func_2AF" }, // SP 0x14025CCA0 + { 0x2B0, "_func_2B0" }, // MP 0x140329610 + { 0x2B1, "_func_2B1" }, // MP 0x1403297B0 + { 0x2B2, "_func_2B2" }, // MP 0x1403298D0 + { 0x2B3, "_func_2B3" }, // MP 0x14032ACF0 + { 0x2B4, "_func_2B4" }, // SP 0x14024EAD0, MP 0x140317DF0 + { 0x2B5, "_func_2B5" }, // SP 0x14025CCF0 + { 0x2B6, "_func_2B6" }, // SP 0x140245730, MP 0x14030E570 + { 0x2B7, "_func_2B7" }, // MP 0x140337920 + { 0x2B8, "_func_2B8" }, // SP 0x14024BB40, MP 0x140319B40 + { 0x2B9, "_func_2B9" }, // SP 0x14024BC90, MP 0x140319B50 + { 0x2BA, "_func_2BA" }, // SP 0x14023ED90, MP 0x140321AE0 + { 0x2BB, "_func_2BB" }, // SP 0x14024B7C0, MP 0x140314A40 + { 0x2BC, "_func_2BC" }, // MP 0x140314C30 + { 0x2BD, "_func_2BD" }, // SP 0x14025CF50 + { 0x2BE, "_func_2BE" }, // MP 0x14032AEA0 + { 0x2BF, "_func_2BF" }, // MP 0x1402D3540 + { 0x2C0, "_func_2C0" }, // MP 0x1402D35B0 + { 0x2C1, "_func_2C1" }, // MP 0x140332A70 + { 0x2C2, "_func_2C2" }, // MP 0x140332AE0 + { 0x2C3, "_func_2C3" }, // MP 0x14032C580 + { 0x2C4, "_func_2C4" }, // MP 0x14032C650 + { 0x2C5, "_func_2C5" }, // MP 0x14032C820 + { 0x2C6, "_func_2C6" }, // SP 0x14025C2C0 + { 0x2C7, "_func_2C7" }, // MP 0x14032C2A0 + { 0x2C8, "_func_2C8" }, // MP 0x1402D34D0 + { 0x2C9, "_func_2C9" }, // MP 0x1402D33F0 + { 0x2CA, "_func_2CA" }, // MP 0x14032DAD0 + { 0x2CB, "_func_2CB" }, // MP 0x14032DC40 + { 0x2CC, "_func_2CC" }, // SP 0x14025C4B0 + { 0x2CD, "_func_2CD" }, // SP 0x14024A6B0, MP 0x140318270 + { 0x2CE, "_func_2CE" }, // MP 0x14032C6B0 + { 0x2CF, "_func_2CF" }, // MP 0x140318AD0 + { 0x2D0, "_func_2D0" }, // SP 0x140260350 + { 0x2D1, "_func_2D1" }, // MP 0x1402D3460 + { 0x2D2, "_func_2D2" }, // SP 0x14025CFA0 + { 0x2D3, "_func_2D3" }, // MP 0x14032C2D0 + { 0x2D4, "_func_2D4" }, // MP 0x140332620 + { 0x2D5, "_func_2D5" }, // MP 0x140332610 + { 0x2D6, "_func_2D6" }, // MP 0x1402D3630 + { 0x2D7, "_func_2D7" }, // MP 0x14031AA80 + { 0x2D8, "_func_2D8" }, // SP 0x140240AD0, MP 0x14031EAD0 + { 0x2D9, "_func_2D9" }, // MP 0x140328010 + { 0x2DA, "_func_2DA" }, // MP 0x14031B670 + { 0x2DB, "_func_2DB" }, // MP 0x14031D3F0 + { 0x2DC, "_func_2DC" }, // MP 0x14031E670 + { 0x2DD, "_func_2DD" }, // MP 0x140339100 + { 0x2DE, "_func_2DE" }, // MP 0x140319200 + { 0x2DF, "_func_2DF" }, // MP 0x140331E00 +}}; + +const std::array method_list +{{ + { 0x8000, "_meth_8000" }, // SP 0x140243FC0, MP 0x140321BF0 + { 0x8001, "_meth_8001" }, // SP 0x14025D290 + { 0x8002, "_meth_8002" }, // MP 0x140522DA0 + { 0x8003, "_meth_8003" }, // MP 0x140327D90 + { 0x8004, "_meth_8004" }, // MP 0x140328150 + { 0x8005, "_meth_8005" }, // MP 0x14032AC70 + { 0x8006, "_meth_8006" }, // MP 0x14032ACB0 + { 0x8007, "_meth_8007" }, // MP 0x14032ADA0 + { 0x8008, "_meth_8008" }, // MP 0x14032AE00 + { 0x8009, "_meth_8009" }, // MP 0x14032AE60 + { 0x800A, "_meth_800A" }, // MP 0x14032CAF0 + { 0x800B, "_meth_800B" }, // MP 0x14032CB50 + { 0x800C, "_meth_800C" }, // MP 0x14032CD60 + { 0x800D, "_meth_800D" }, // MP 0x14032CC80 + { 0x800E, "_meth_800E" }, // MP 0x14032C2F0 + { 0x800F, "_meth_800F" }, // MP 0x14032C370 + { 0x8010, "_meth_8010" }, // MP 0x14032C350 + { 0x8011, "_meth_8011" }, // MP 0x14032C390 + { 0x8012, "_meth_8012" }, // MP 0x14032E080 + { 0x8013, "_meth_8013" }, // MP 0x14032C7A0 + { 0x8014, "_meth_8014" }, // MP 0x14032C870 + { 0x8015, "_meth_8015" }, // MP 0x14032C960 + { 0x8016, "_meth_8016" }, // MP 0x14032CA40 + { 0x8017, "_meth_8017" }, // MP 0x14032C310 + { 0x8018, "_meth_8018" }, // MP 0x14032C460 + { 0x8019, "_meth_8019" }, // MP 0x140328CD0 + { 0x801A, "_meth_801A" }, // SP 0x14024E140, MP 0x1403167C0 + { 0x801B, "_meth_801B" }, // MP 0x14032D4E0 + { 0x801C, "_meth_801C" }, // MP 0x14032DA10 + { 0x801D, "_meth_801D" }, // SP 0x140247610, MP 0x140311030 + { 0x801E, "_meth_801E" }, // SP 0x1402617C0 + { 0x801F, "_meth_801F" }, // SP 0x1402617F0 + { 0x8020, "_meth_8020" }, // SP 0x140261910 + { 0x8021, "_meth_8021" }, // SP 0x140259710 + { 0x8022, "_meth_8022" }, // SP 0x140259730 + { 0x8023, "_meth_8023" }, // SP 0x1402598B0, MP 0x14032D110 + { 0x8024, "_meth_8024" }, // SP 0x1402598D0 + { 0x8025, "_meth_8025" }, // SP 0x140243780, MP 0x14031D9D0 + { 0x8026, "_meth_8026" }, // MP 0x14032F8A0 + { 0x8027, "_meth_8027" }, // empty + { 0x8028, "_meth_8028" }, // SP 0x140259D50 + { 0x8029, "_meth_8029" }, // SP 0x140243D30, MP 0x140321AA0 + { 0x802A, "_meth_802A" }, // SP 0x140248580, MP 0x140311FB0 + { 0x802B, "_meth_802B" }, // SP 0x140248980, MP 0x140312130 + { 0x802C, "_meth_802C" }, // SP 0x14024A5E0, MP 0x1403144E0 + { 0x802D, "_meth_802D" }, // SP 0x14024A7F0, MP 0x1403146A0 + { 0x802E, "_meth_802E" }, // SP 0x14024AAB0, MP 0x140314840 + { 0x802F, "_meth_802F" }, // SP 0x14025A350 + { 0x8030, "_meth_8030" }, // SP 0x14025A3E0 + { 0x8031, "_meth_8031" }, // SP 0x14025A560 + { 0x8032, "_meth_8032" }, // SP 0x14025B7E0 + { 0x8033, "_meth_8033" }, // SP 0x14027DFE0 + { 0x8034, "_meth_8034" }, // SP 0x14027DF70, MP 0x1402D1D80 + { 0x8035, "_meth_8035" }, // SP 0x14027DED0, MP 0x1402D1CE0 + { 0x8036, "_meth_8036" }, // SP 0x14025F9C0 + { 0x8037, "_meth_8037" }, // SP 0x14025FA80 + { 0x8038, "_meth_8038" }, // SP 0x14025FEB0 + { 0x8039, "_meth_8039" }, // SP 0x140261030 + { 0x803A, "_meth_803A" }, // SP 0x140261050 + { 0x803B, "_meth_803B" }, // SP 0x140261170 + { 0x803C, "_meth_803C" }, // SP 0x14025B970 + { 0x803D, "_meth_803D" }, // SP 0x14025B9B0 + { 0x803E, "_meth_803E" }, // SP 0x14025BB00 + { 0x803F, "_meth_803F" }, // SP 0x14025BB40 + { 0x8040, "_meth_8040" }, // SP 0x14025BC00 + { 0x8041, "_meth_8041" }, // SP 0x14025D150 + { 0x8042, "_meth_8042" }, // SP 0x14025D240 + { 0x8043, "_meth_8043" }, // SP 0x14024D860, MP 0x140316310 + { 0x8044, "_meth_8044" }, // SP 0x14024DAA0, MP 0x140316590 + { 0x8045, "_meth_8045" }, // SP 0x140261430 + { 0x8046, "_meth_8046" }, // SP 0x140261450 + { 0x8047, "_meth_8047" }, // SP 0x14024ACA0, MP 0x140314A80 + { 0x8048, "_meth_8048" }, // SP 0x14024B060, MP 0x140315570 + { 0x8049, "_meth_8049" }, // SP 0x14024B570, MP 0x1403159E0 + { 0x804A, "_meth_804A" }, // SP 0x14024BAB0, MP 0x140315BE0 + { 0x804B, "_meth_804B" }, // SP 0x14024BE00, MP 0x140315F10 + { 0x804C, "_meth_804C" }, // SP 0x14024C3A0, MP 0x140316280 + { 0x804D, "_meth_804D" }, // SP 0x14024D310, MP 0x140317A90 + { 0x804E, "_meth_804E" }, // SP 0x14024D720, MP 0x140318250 + { 0x804F, "_meth_804F" }, // SP 0x14024D790, MP 0x140318390 + { 0x8050, "_meth_8050" }, // SP 0x140261820, MP 0x140329690 + { 0x8051, "_meth_8051" }, // SP 0x14024C410, MP 0x140313E60 + { 0x8052, "_meth_8052" }, // SP 0x1402594E0 + { 0x8053, "_meth_8053" }, // SP 0x140259840, MP 0x14032ABA0 + { 0x8054, "_meth_8054" }, // SP 0x140259860, MP 0x14032ABF0 + { 0x8055, "_meth_8055" }, // SP 0x140259880 + { 0x8056, "_meth_8056" }, // SP 0x140259960 + { 0x8057, "_meth_8057" }, // SP 0x140250700, MP 0x14031AD40 + { 0x8058, "_meth_8058" }, // SP 0x140250960, MP 0x14031B050 + { 0x8059, "_meth_8059" }, // SP 0x140250BD0, MP 0x14031B2C0 + { 0x805A, "_meth_805A" }, // SP 0x140250CD0, MP 0x14031B350 + { 0x805B, "_meth_805B" }, // SP 0x14025CC40 + { 0x805C, "_meth_805C" }, // SP 0x14025CC60 + { 0x805D, "_meth_805D" }, // SP 0x14025CC80 + { 0x805E, "_meth_805E" }, // SP 0x14025CCD0 + { 0x805F, "_meth_805F" }, // SP 0x14025DA20 + { 0x8060, "_meth_8060" }, // SP 0x14025DAA0 + { 0x8061, "_meth_8061" }, // SP 0x14025E3D0 + { 0x8062, "_meth_8062" }, // SP 0x14025F390 + { 0x8063, "_meth_8063" }, // SP 0x14025F400 + { 0x8064, "_meth_8064" }, // SP 0x140241600, MP 0x14031FC50 + { 0x8065, "_meth_8065" }, // SP 0x140259B30, MP 0x14032CE60 + { 0x8066, "_meth_8066" }, // SP 0x140259E80, MP 0x14032D070 + { 0x8067, "_meth_8067" }, // SP 0x14025A120 + { 0x8068, "_meth_8068" }, // SP 0x14024D9F0, MP 0x1403183D0 + { 0x8069, "_meth_8069" }, // SP 0x14024ED20, MP 0x1403198B0 + { 0x806A, "_meth_806A" }, // SP 0x140261290 + { 0x806B, "_meth_806B" }, // empty + { 0x806C, "_meth_806C" }, // SP 0x14024F1B0, MP 0x14031DEE0 + { 0x806D, "_meth_806D" }, // SP 0x14024F180, MP 0x14031D9A0 + { 0x806E, "_meth_806E" }, // SP 0x14024F580, MP 0x14031E390 + { 0x806F, "_meth_806F" }, // SP 0x14024F550, MP 0x14031E1C0 + { 0x8070, "_meth_8070" }, // SP 0x14023EE50 + { 0x8071, "_meth_8071" }, // empty + { 0x8072, "_meth_8072" }, // empty + { 0x8073, "_meth_8073" }, // empty + { 0x8074, "_meth_8074" }, // SP 0x140261310, MP 0x140329200 + { 0x8075, "_meth_8075" }, // SP 0x140261390, MP 0x1403292F0 + { 0x8076, "_meth_8076" }, // SP 0x140261400 + { 0x8077, "_meth_8077" }, // SP 0x140261500 + { 0x8078, "_meth_8078" }, // SP 0x140261530 + { 0x8079, "_meth_8079" }, // SP 0x1402615C0 + { 0x807A, "_meth_807A" }, // SP 0x1402615E0 + { 0x807B, "_meth_807B" }, // SP 0x140261740, MP 0x140329410 + { 0x807C, "_meth_807C" }, // SP 0x14024F8B0, MP 0x14031AA90 + { 0x807D, "_meth_807D" }, // SP 0x14024FA90, MP 0x14031AD20 + { 0x807E, "_meth_807E" }, // SP 0x14024FB10, MP 0x14031AED0 + { 0x807F, "_meth_807F" }, // SP 0x14024FC00, MP 0x14031AF00 + { 0x8080, "_meth_8080" }, // SP 0x1402535F0, MP 0x14031D010 + { 0x8081, "_meth_8081" }, // SP 0x140250380, MP 0x14031B520 + { 0x8082, "_meth_8082" }, // SP 0x14021EA10, MP 0x1402EF1F0 + { 0x8083, "_meth_8083" }, // SP 0x14021EA60, MP 0x1402EF240 + { 0x8084, "_meth_8084" }, // SP 0x14021EE30, MP 0x1402EF5E0 + { 0x8085, "_meth_8085" }, // SP 0x14021EF70, MP 0x1402EF720 + { 0x8086, "_meth_8086" }, // SP 0x14021F050, MP 0x1402EF800 + { 0x8087, "_meth_8087" }, // SP 0x14021F190, MP 0x1402EF8B0 + { 0x8088, "_meth_8088" }, // SP 0x14021F1D0, MP 0x1402EF980 + { 0x8089, "_meth_8089" }, // SP 0x14021F300, MP 0x1402EFA60 + { 0x808A, "_meth_808A" }, // SP 0x14021F240, MP 0x1402EF9D0 + { 0x808B, "_meth_808B" }, // SP 0x14021EED0, MP 0x1402EF680 + { 0x808C, "_meth_808C" }, // SP 0x14025CC00 + { 0x808D, "_meth_808D" }, // SP 0x14025CC20 + { 0x808E, "_meth_808E" }, // SP 0x14025D300 + { 0x808F, "_meth_808F" }, // SP 0x14025D340 + { 0x8090, "_meth_8090" }, // SP 0x1402599B0 + { 0x8091, "_meth_8091" }, // SP 0x14025D840, MP 0x14032E720 + { 0x8092, "_meth_8092" }, // SP 0x14024CFF0, MP 0x14031B370 + { 0x8093, "_meth_8093" }, // SP 0x14025F470 + { 0x8094, "_meth_8094" }, // SP 0x14025F510 + { 0x8095, "_meth_8095" }, // SP 0x14025F5B0, MP 0x14032F8B0 + { 0x8096, "_meth_8096" }, // SP 0x14025F660 + { 0x8097, "_meth_8097" }, // SP 0x14025F750 + { 0x8098, "_meth_8098" }, // SP 0x1402608B0 + { 0x8099, "_meth_8099" }, // SP 0x1402608F0, MP 0x14032FA40 + { 0x809A, "_meth_809A" }, // SP 0x140261150, MP 0x14032FDA0 + { 0x809B, "_meth_809B" }, // empty + { 0x809C, "_meth_809C" }, // empty + { 0x809D, "_meth_809D" }, // empty + { 0x809E, "_meth_809E" }, // empty + { 0x809F, "_meth_809F" }, // SP 0x140250780, MP 0x14031BA70 + { 0x80A0, "_meth_80A0" }, // SP 0x140250BF0, MP 0x14031C050 + { 0x80A1, "_meth_80A1" }, // SP 0x140251060, MP 0x14031C510 + { 0x80A2, "_meth_80A2" }, // SP 0x14023E070, MP 0x14031DF10 + { 0x80A3, "_meth_80A3" }, // SP 0x14023E810, MP 0x14031E4E0 + { 0x80A4, "_meth_80A4" }, // SP 0x14023EEC0 + { 0x80A5, "_meth_80A5" }, // SP 0x14023F740 + { 0x80A6, "_meth_80A6" }, // SP 0x1402404F0 + { 0x80A7, "_meth_80A7" }, // SP 0x140240D80 + { 0x80A8, "_meth_80A8" }, // SP 0x140247240, MP 0x14030ED30 + { 0x80A9, "_meth_80A9" }, // SP 0x1402505C0, MP 0x1403199D0 + { 0x80AA, "_meth_80AA" }, // SP 0x140250830, MP 0x140319CB0 + { 0x80AB, "_meth_80AB" }, // SP 0x140241D60, MP 0x1403209F0 + { 0x80AC, "_meth_80AC" }, // SP 0x140251210, MP 0x14031AA20 + { 0x80AD, "_meth_80AD" }, // SP 0x1402421E0, MP 0x140320FB0 + { 0x80AE, "_meth_80AE" }, // SP 0x140242250, MP 0x1403210A0 + { 0x80AF, "_meth_80AF" }, // SP 0x140242AE0, MP 0x1403216E0 + { 0x80B0, "delete" }, + { 0x80B1, "_meth_80B1" }, // SP 0x140245F70, MP 0x14030F8D0 + { 0x80B2, "_meth_80B2" }, // SP 0x140242F40, MP 0x140320CF0 + { 0x80B3, "_meth_80B3" }, // SP 0x140243250, MP 0x1403211B0 + { 0x80B4, "_meth_80B4" }, // empty + { 0x80B5, "_meth_80B5" }, // empty + { 0x80B6, "_meth_80B6" }, // SP 0x1402434E0, MP 0x1403213B0 + { 0x80B7, "_meth_80B7" }, // SP 0x140243990, MP 0x1403218A0 + { 0x80B8, "_meth_80B8" }, // SP 0x140245650, MP 0x14030C6E0 + { 0x80B9, "_meth_80B9" }, // SP 0x140245A30, MP 0x14030CA30 + { 0x80BA, "_meth_80BA" }, // MP 0x14030CE40 + { 0x80BB, "_meth_80BB" }, // MP 0x14030CFB0 + { 0x80BC, "_meth_80BC" }, // MP 0x14030D220 + { 0x80BD, "_meth_80BD" }, // empty + { 0x80BE, "_meth_80BE" }, // SP 0x140240E60, MP 0x14031E770 + { 0x80BF, "_meth_80BF" }, // SP 0x140240F70, MP 0x14031E9D0 + { 0x80C0, "_meth_80C0" }, // SP 0x140241270, MP 0x14031EBA0 + { 0x80C1, "_meth_80C1" }, // SP 0x14024E190, MP 0x14031C420 + { 0x80C2, "_meth_80C2" }, // SP 0x14024E8E0, MP 0x14031C9C0 + { 0x80C3, "_meth_80C3" }, // SP 0x140213270 + { 0x80C4, "_meth_80C4" }, // SP 0x140218180 + { 0x80C5, "_meth_80C5" }, // SP 0x140415BF0 + { 0x80C6, "_meth_80C6" }, // SP 0x140413E10 + { 0x80C7, "_meth_80C7" }, // SP 0x140415A50 + { 0x80C8, "_meth_80C8" }, // SP 0x140415AE0 + { 0x80C9, "_meth_80C9" }, // SP 0x140415390 + { 0x80CA, "_meth_80CA" }, // SP 0x14021DE70, MP 0x1402EE7C0 + { 0x80CB, "_meth_80CB" }, // MP 0x1402EE880 + { 0x80CC, "_meth_80CC" }, // SP 0x14021DF30, MP 0x1402EE890 + { 0x80CD, "_meth_80CD" }, // SP 0x14021E050, MP 0x1402EE990 + { 0x80CE, "_meth_80CE" }, // SP 0x14021E1D0, MP 0x1402EEB10 + { 0x80CF, "_meth_80CF" }, // SP 0x14021E2B0, MP 0x1402EEBE0 + { 0x80D0, "_meth_80D0" }, // SP 0x14021E380, MP 0x1402EEC90 + { 0x80D1, "_meth_80D1" }, // SP 0x14021E450, MP 0x1402EED30 + { 0x80D2, "_meth_80D2" }, // SP 0x14021E510, MP 0x1402EEDE0 + { 0x80D3, "_meth_80D3" }, // SP 0x14021E5E0, MP 0x1402EEE90 + { 0x80D4, "_meth_80D4" }, // SP 0x14021E6B0, MP 0x1402EEF30 + { 0x80D5, "_meth_80D5" }, // SP 0x14021E770, MP 0x1402EEFE0 + { 0x80D6, "_meth_80D6" }, // SP 0x14021E790, MP 0x1402EF000 + { 0x80D7, "_meth_80D7" }, // SP 0x14021E7B0, MP 0x1402EF020 + { 0x80D8, "_meth_80D8" }, // SP 0x14021E850, MP 0x1402EF0A0 + { 0x80D9, "_meth_80D9" }, // SP 0x14021E9C0, MP 0x1402EF1A0 + { 0x80DA, "_meth_80DA" }, // SP 0x140241840, MP 0x14031F3A0 + { 0x80DB, "_meth_80DB" }, // SP 0x140241FF0, MP 0x140320400 + { 0x80DC, "_meth_80DC" }, // MP 0x140328620 + { 0x80DD, "_meth_80DD" }, // SP 0x140242550, MP 0x140320750 + { 0x80DE, "_meth_80DE" }, // SP 0x1402428C0, MP 0x1403208F0 + { 0x80DF, "_meth_80DF" }, // SP 0x1402413D0, MP 0x14031ED80 + { 0x80E0, "_meth_80E0" }, // SP 0x1402414A0, MP 0x14031EE50 + { 0x80E1, "_meth_80E1" }, // MP 0x14031EFA0 + { 0x80E2, "_meth_80E2" }, // SP 0x140251410, MP 0x14031B620 + { 0x80E3, "_meth_80E3" }, // SP 0x1402514F0, MP 0x14031B800 + { 0x80E4, "_meth_80E4" }, // SP 0x1402517C0, MP 0x14031B980 + { 0x80E5, "_meth_80E5" }, // SP 0x140251950, MP 0x14031BC70 + { 0x80E6, "_meth_80E6" }, // SP 0x140251A60, MP 0x14031BDC0 + { 0x80E7, "_meth_80E7" }, // SP 0x140251C20, MP 0x14031C0E0 + { 0x80E8, "_meth_80E8" }, // MP 0x14031AAA0 + { 0x80E9, "_meth_80E9" }, // MP 0x14031B2E0 + { 0x80EA, "_meth_80EA" }, // SP 0x140253FC0, MP 0x14031D3A0 + { 0x80EB, "_meth_80EB" }, // SP 0x1402540B0, MP 0x14031D4F0 + { 0x80EC, "_meth_80EC" }, // SP 0x140219C40 + { 0x80ED, "_meth_80ED" }, // SP 0x140219CA0 + { 0x80EE, "_meth_80EE" }, // SP 0x140219CF0 + { 0x80EF, "_meth_80EF" }, // SP 0x140219D40 + { 0x80F0, "_meth_80F0" }, // SP 0x140219DA0 + { 0x80F1, "_meth_80F1" }, // SP 0x140219E00 + { 0x80F2, "_meth_80F2" }, // SP 0x140219E50 + { 0x80F3, "_meth_80F3" }, // SP 0x14021A1A0 + { 0x80F4, "_meth_80F4" }, // SP 0x14021A370 + { 0x80F5, "_meth_80F5" }, // SP 0x14021A3D0 + { 0x80F6, "_meth_80F6" }, // SP 0x14021A430 + { 0x80F7, "_meth_80F7" }, // SP 0x14021A4C0 + { 0x80F8, "_meth_80F8" }, // SP 0x14021A570 + { 0x80F9, "_meth_80F9" }, // SP 0x140217650, MP 0x1402DF4D0 + { 0x80FA, "_meth_80FA" }, // SP 0x140219F40 + { 0x80FB, "_meth_80FB" }, // SP 0x140219F90 + { 0x80FC, "_meth_80FC" }, // SP 0x14021A060 + { 0x80FD, "_meth_80FD" }, // SP 0x14021A0F0 + { 0x80FE, "_meth_80FE" }, // SP 0x140215C90, MP 0x1402DDB00 + { 0x80FF, "_meth_80FF" }, // SP 0x140215F00, MP 0x1402DDCC0 + { 0x8100, "_meth_8100" }, // SP 0x140219FE0 + { 0x8101, "_meth_8101" }, // SP 0x140215910 + { 0x8102, "_meth_8102" }, // SP 0x140212F60 + { 0x8103, "_meth_8103" }, // SP 0x140254700, MP 0x14031D800 + { 0x8104, "_meth_8104" }, // SP 0x14023DFE0, MP 0x14031DAD0 + { 0x8105, "_meth_8105" }, // SP 0x14023E530, MP 0x14031E310 + { 0x8106, "_meth_8106" }, // SP 0x14023E6A0, MP 0x14031E440 + { 0x8107, "_meth_8107" }, // SP 0x14023EAF0, MP 0x14031E4F0 + { 0x8108, "_meth_8108" }, // SP 0x14023EDF0, MP 0x14031EA50 + { 0x8109, "_meth_8109" }, // SP 0x14023F010, MP 0x14031EB10 + { 0x810A, "_meth_810A" }, // SP 0x14023FD90, MP 0x1403202F0 + { 0x810B, "_meth_810B" }, // SP 0x14023FF60, MP 0x140320350 + { 0x810C, "_meth_810C" }, // SP 0x14023FFC0, MP 0x1403204D0 + { 0x810D, "_meth_810D" }, // SP 0x14023B180 + { 0x810E, "_meth_810E" }, // SP 0x14023B1A0 + { 0x810F, "_meth_810F" }, // SP 0x14023B1C0 + { 0x8110, "_meth_8110" }, // SP 0x14023B1E0 + { 0x8111, "_meth_8111" }, // SP 0x14023B200 + { 0x8112, "_meth_8112" }, // SP 0x14023B220 + { 0x8113, "_meth_8113" }, // SP 0x14023B230 + { 0x8114, "_meth_8114" }, // SP 0x14023B250 + { 0x8115, "_meth_8115" }, // SP 0x14023B270 + { 0x8116, "_meth_8116" }, // SP 0x14023B340 + { 0x8117, "_meth_8117" }, // SP 0x14023B3C0 + { 0x8118, "_meth_8118" }, // SP 0x1402160E0, MP 0x1402DD450 + { 0x8119, "_meth_8119" }, // SP 0x1402161D0, MP 0x1402DD5C0 + { 0x811A, "_meth_811A" }, // SP 0x140216340, MP 0x1402DD8C0 + { 0x811B, "_meth_811B" }, // SP 0x1402163A0, MP 0x1402DD9E0 + { 0x811C, "_meth_811C" }, // SP 0x140219080 + { 0x811D, "_meth_811D" }, // SP 0x140219500 + { 0x811E, "_meth_811E" }, // empty + { 0x811F, "_meth_811F" }, // SP 0x1402192C0 + { 0x8120, "_meth_8120" }, // SP 0x140219340 + { 0x8121, "_meth_8121" }, // SP 0x140219670 + { 0x8122, "_meth_8122" }, // empty + { 0x8123, "_meth_8123" }, // empty + { 0x8124, "_meth_8124" }, // empty + { 0x8125, "_meth_8125" }, // empty + { 0x8126, "_meth_8126" }, // empty + { 0x8127, "_meth_8127" }, // SP 0x140219360 + { 0x8128, "_meth_8128" }, // SP 0x1402196C0 + { 0x8129, "_meth_8129" }, // SP 0x1402197F0 + { 0x812A, "_meth_812A" }, // SP 0x1402191E0 + { 0x812B, "_meth_812B" }, // SP 0x1402198A0 + { 0x812C, "_meth_812C" }, // SP 0x140213E10, MP 0x1402E3B60 + { 0x812D, "_meth_812D" }, // SP 0x1402140A0, MP 0x1402E3EE0 + { 0x812E, "_meth_812E" }, // SP 0x140217B90, MP 0x1402DFB80 + { 0x812F, "_meth_812F" }, // SP 0x140219B70 + { 0x8130, "_meth_8130" }, // SP 0x140215F20, MP 0x1402DD080 + { 0x8131, "_meth_8131" }, // SP 0x140216000, MP 0x1402DD240 + { 0x8132, "_meth_8132" }, // SP 0x140219BE0 + { 0x8133, "_meth_8133" }, // SP 0x140240030, MP 0x1403205E0 + { 0x8134, "_meth_8134" }, // SP 0x140240460, MP 0x140320960 + { 0x8135, "_meth_8135" }, // SP 0x1402406F0, MP 0x140320BB0 + { 0x8136, "_meth_8136" }, // SP 0x140240B10, MP 0x140320DB0 + { 0x8137, "_meth_8137" }, // SP 0x140240BE0, MP 0x140321050 + { 0x8138, "_meth_8138" }, // SP 0x140240C90, MP 0x140321160 + { 0x8139, "_meth_8139" }, // SP 0x14028A2E0, MP 0x140043790 + { 0x813A, "_meth_813A" }, // SP 0x14028A3F0, MP 0x1400438C0 + { 0x813B, "_meth_813B" }, // SP 0x14028A4F0 + { 0x813C, "_meth_813C" }, // SP 0x14028A550 + { 0x813D, "_meth_813D" }, // SP 0x14028A5F0 + { 0x813E, "_meth_813E" }, // SP 0x14023AE00 + { 0x813F, "_meth_813F" }, // empty + { 0x8140, "_meth_8140" }, // SP 0x14023AE40 + { 0x8141, "_meth_8141" }, // SP 0x14023ADE0 + { 0x8142, "_meth_8142" }, // SP 0x14023AE80 + { 0x8143, "_meth_8143" }, // SP 0x14023AF00 + { 0x8144, "_meth_8144" }, // SP 0x14023AF20 + { 0x8145, "_meth_8145" }, // SP 0x14023AF30 + { 0x8146, "_meth_8146" }, // SP 0x14023AF50 + { 0x8147, "_meth_8147" }, // SP 0x14023AF70 + { 0x8148, "_meth_8148" }, // SP 0x14023AF90 + { 0x8149, "_meth_8149" }, // SP 0x14023AFA0 + { 0x814A, "_meth_814A" }, // SP 0x14023AFC0 + { 0x814B, "_meth_814B" }, // SP 0x14023AFE0 + { 0x814C, "_meth_814C" }, // SP 0x14023B000 + { 0x814D, "_meth_814D" }, // SP 0x14023B010 + { 0x814E, "_meth_814E" }, // SP 0x14023B030 + { 0x814F, "_meth_814F" }, // SP 0x14023B050 + { 0x8150, "_meth_8150" }, // SP 0x14023B0C0 + { 0x8151, "_meth_8151" }, // SP 0x14023B100 + { 0x8152, "_meth_8152" }, // SP 0x14023B150 + { 0x8153, "_meth_8153" }, // SP 0x14023B170 + { 0x8154, "_meth_8154" }, // MP 0x140321240 + { 0x8155, "_meth_8155" }, // SP 0x140240EC0, MP 0x140321340 + { 0x8156, "_meth_8156" }, // SP 0x140241210, MP 0x1403214C0 + { 0x8157, "_meth_8157" }, // SP 0x1402414F0, MP 0x140321810 + { 0x8158, "_meth_8158" }, // SP 0x140241A10, MP 0x140321B90 + { 0x8159, "_meth_8159" }, // SP 0x140241B20, MP 0x140321D30 + { 0x815A, "_meth_815A" }, // SP 0x140241DB0, MP 0x140321F10 + { 0x815B, "_meth_815B" }, // SP 0x140241EE0, MP 0x140322220 + { 0x815C, "_meth_815C" }, // SP 0x140242100, MP 0x140322280 + { 0x815D, "_meth_815D" }, // SP 0x1401FA0E0 + { 0x815E, "_meth_815E" }, // SP 0x1401FA140 + { 0x815F, "_meth_815F" }, // SP 0x1401FA1D0 + { 0x8160, "_meth_8160" }, // SP 0x1401FA2C0 + { 0x8161, "_meth_8161" }, // SP 0x1401FA410 + { 0x8162, "_meth_8162" }, // SP 0x1401FA4E0 + { 0x8163, "_meth_8163" }, // SP 0x1401FA520 + { 0x8164, "_meth_8164" }, // SP 0x1401FA5E0 + { 0x8165, "_meth_8165" }, // SP 0x140216A60, MP 0x1402DE3C0 + { 0x8166, "_meth_8166" }, // SP 0x1401FA6B0 + { 0x8167, "_meth_8167" }, // SP 0x1401FA800 + { 0x8168, "_meth_8168" }, // SP 0x1401FAA20 + { 0x8169, "_meth_8169" }, // SP 0x1401FAB60 + { 0x816A, "_meth_816A" }, // SP 0x1401FAC30 + { 0x816B, "_meth_816B" }, // SP 0x1401FACF0 + { 0x816C, "_meth_816C" }, // SP 0x1401FADB0 + { 0x816D, "_meth_816D" }, // SP 0x1401FAE90 + { 0x816E, "_meth_816E" }, // SP 0x1401FAF60 + { 0x816F, "_meth_816F" }, // SP 0x1401FB040 + { 0x8170, "_meth_8170" }, // SP 0x1401FB1C0 + { 0x8171, "_meth_8171" }, // SP 0x1401FB3F0 + { 0x8172, "_meth_8172" }, // SP 0x1401FB450 + { 0x8173, "_meth_8173" }, // SP 0x1401FB4B0 + { 0x8174, "_meth_8174" }, // SP 0x1401FB6A0 + { 0x8175, "_meth_8175" }, // SP 0x140289C60, MP 0x140043A30 + { 0x8176, "_meth_8176" }, // SP 0x140289CA0, MP 0x140043A70 + { 0x8177, "_meth_8177" }, // SP 0x14028A070, MP 0x140043530 + { 0x8178, "_meth_8178" }, // SP 0x14028A0E0, MP 0x1400435A0 + { 0x8179, "_meth_8179" }, // SP 0x140242200, MP 0x1403223F0 + { 0x817A, "_meth_817A" }, // SP 0x140242770, MP 0x14030B350 + { 0x817B, "_meth_817B" }, // SP 0x140240C30, MP 0x14031ED20 + { 0x817C, "_meth_817C" }, // SP 0x1402463F0, MP 0x14030D7B0 + { 0x817D, "_meth_817D" }, // SP 0x140246590, MP 0x14030DBC0 + { 0x817E, "_meth_817E" }, // SP 0x140243390, MP 0x140321DC0 + { 0x817F, "_meth_817F" }, // SP 0x140243890, MP 0x1403222E0 + { 0x8180, "_meth_8180" }, // SP 0x140247970, MP 0x140310980 + { 0x8181, "_meth_8181" }, // SP 0x140247B80, MP 0x140310DF0 + { 0x8182, "_meth_8182" }, // SP 0x14024E6A0, MP 0x140315CD0 + { 0x8183, "_meth_8183" }, // SP 0x14024EC90, MP 0x1403166C0 + { 0x8184, "_meth_8184" }, // SP 0x1402456B0, MP 0x14030EA40 + { 0x8185, "_meth_8185" }, // SP 0x140245940, MP 0x14030EDE0 + { 0x8186, "_meth_8186" }, // SP 0x1402485C0, MP 0x140311860 + { 0x8187, "_meth_8187" }, // SP 0x140249170, MP 0x140312070 + { 0x8188, "_meth_8188" }, // SP 0x14024A6A0, MP 0x140313930 + { 0x8189, "_meth_8189" }, // SP 0x1401F88F0 + { 0x818A, "_meth_818A" }, // SP 0x1401F8940 + { 0x818B, "_meth_818B" }, // SP 0x1401F89B0 + { 0x818C, "_meth_818C" }, // SP 0x1401F89F0 + { 0x818D, "_meth_818D" }, // SP 0x1401F8A60 + { 0x818E, "_meth_818E" }, // SP 0x1401F8AF0 + { 0x818F, "_meth_818F" }, // SP 0x1401F8CC0 + { 0x8190, "_meth_8190" }, // SP 0x1401F9000 + { 0x8191, "_meth_8191" }, // SP 0x1401F90F0 + { 0x8192, "_meth_8192" }, // SP 0x1401F9140 + { 0x8193, "_meth_8193" }, // SP 0x1401F9190 + { 0x8194, "_meth_8194" }, // SP 0x1401F91F0 + { 0x8195, "_meth_8195" }, // SP 0x1401F9240 + { 0x8196, "_meth_8196" }, // empty + { 0x8197, "_meth_8197" }, // empty + { 0x8198, "_meth_8198" }, // empty + { 0x8199, "_meth_8199" }, // empty + { 0x819A, "_meth_819A" }, // SP 0x1401F93F0 + { 0x819B, "_meth_819B" }, // SP 0x1401F94A0 + { 0x819C, "_meth_819C" }, // SP 0x1401F94F0 + { 0x819D, "_meth_819D" }, // SP 0x1401F95A0, MP 0x140405900 + { 0x819E, "_meth_819E" }, // SP 0x1401F9610, MP 0x1404057C0 + { 0x819F, "_meth_819F" }, // SP 0x1401F9680, MP 0x140405860 + { 0x81A0, "_meth_81A0" }, // SP 0x1401F9700 + { 0x81A1, "_meth_81A1" }, // SP 0x1401F97A0 + { 0x81A2, "_meth_81A2" }, // SP 0x1401F9890 + { 0x81A3, "_meth_81A3" }, // SP 0x1401F99A0 + { 0x81A4, "_meth_81A4" }, // SP 0x1401F8320 + { 0x81A5, "_meth_81A5" }, // SP 0x1401F9A60 + { 0x81A6, "_meth_81A6" }, // SP 0x1401F9AD0 + { 0x81A7, "_meth_81A7" }, // SP 0x1401F9B30 + { 0x81A8, "_meth_81A8" }, // SP 0x1401F9BD0 + { 0x81A9, "_meth_81A9" }, // SP 0x1401F9CE0 + { 0x81AA, "_meth_81AA" }, // SP 0x1401F9E40 + { 0x81AB, "_meth_81AB" }, // SP 0x1401F9EF0 + { 0x81AC, "_meth_81AC" }, // SP 0x1401FA030 + { 0x81AD, "_meth_81AD" }, // MP 0x1403139F0 + { 0x81AE, "_meth_81AE" }, // MP 0x140313A00 + { 0x81AF, "_meth_81AF" }, // SP 0x14024A700, MP 0x140313A40 + { 0x81B0, "_meth_81B0" }, // SP 0x140245090, MP 0x14030DE80 + { 0x81B1, "_meth_81B1" }, // SP 0x140243090, MP 0x14030BDA0 + { 0x81B2, "_meth_81B2" }, // SP 0x1402431F0, MP 0x14030C0D0 + { 0x81B3, "_meth_81B3" }, // SP 0x140243540, MP 0x14030C490 + { 0x81B4, "_meth_81B4" }, // SP 0x140243630, MP 0x14030C690 + { 0x81B5, "_meth_81B5" }, // SP 0x140244720, MP 0x14030D830 + { 0x81B6, "_meth_81B6" }, // SP 0x1401FBB30 + { 0x81B7, "_meth_81B7" }, // SP 0x1401FBC20 + { 0x81B8, "_meth_81B8" }, // SP 0x1401FBDD0 + { 0x81B9, "_meth_81B9" }, // SP 0x1401FBE40 + { 0x81BA, "_meth_81BA" }, // SP 0x1401FBFA0 + { 0x81BB, "_meth_81BB" }, // SP 0x1401FC260 + { 0x81BC, "_meth_81BC" }, // SP 0x1401FC390 + { 0x81BD, "_meth_81BD" }, // SP 0x1401FC470 + { 0x81BE, "_meth_81BE" }, // SP 0x1401FC4E0 + { 0x81BF, "_meth_81BF" }, // SP 0x1401FC590 + { 0x81C0, "_meth_81C0" }, // SP 0x14028A440, MP 0x140043920 + { 0x81C1, "_meth_81C1" }, // SP 0x14028A4A0, MP 0x140043980 + { 0x81C2, "_meth_81C2" }, // SP 0x1401FC6E0 + { 0x81C3, "_meth_81C3" }, // SP 0x1401FC960 + { 0x81C4, "_meth_81C4" }, // SP 0x1401FCA70 + { 0x81C5, "_meth_81C5" }, // SP 0x1401F7D80 + { 0x81C6, "_meth_81C6" }, // SP 0x1401F7D90 + { 0x81C7, "_meth_81C7" }, // SP 0x1401F7DB0 + { 0x81C8, "_meth_81C8" }, // SP 0x1401F7DD0 + { 0x81C9, "_meth_81C9" }, // SP 0x1401F7E30 + { 0x81CA, "_meth_81CA" }, // SP 0x1401F7EA0 + { 0x81CB, "_meth_81CB" }, // SP 0x1401F7F70 + { 0x81CC, "_meth_81CC" }, // SP 0x1401F8060 + { 0x81CD, "_meth_81CD" }, // SP 0x1401F80A0 + { 0x81CE, "_meth_81CE" }, // SP 0x1401F80E0 + { 0x81CF, "_meth_81CF" }, // SP 0x1401F8120 + { 0x81D0, "_meth_81D0" }, // SP 0x1401F81B0 + { 0x81D1, "_meth_81D1" }, // SP 0x1401F8760 + { 0x81D2, "_meth_81D2" }, // SP 0x1401F8840 + { 0x81D3, "_meth_81D3" }, // SP 0x1401F84A0 + { 0x81D4, "_meth_81D4" }, // SP 0x140244FB0, MP 0x14030D9F0 + { 0x81D5, "_meth_81D5" }, // SP 0x14024D100, MP 0x140314A00 + { 0x81D6, "_meth_81D6" }, // SP 0x14024D910, MP 0x140315900 + { 0x81D7, "_meth_81D7" }, // SP 0x14024E310, MP 0x140315C70 + { 0x81D8, "_meth_81D8" }, // SP 0x14024E5F0, MP 0x140315CB0 + { 0x81D9, "_meth_81D9" }, // SP 0x140243A40, MP 0x14030CC10 + { 0x81DA, "_meth_81DA" }, // SP 0x140243D70, MP 0x14030CEF0 + { 0x81DB, "_meth_81DB" }, // SP 0x140244000, MP 0x14030D060 + { 0x81DC, "_meth_81DC" }, // SP 0x1402441D0, MP 0x14030D460 + { 0x81DD, "_meth_81DD" }, // SP 0x1402443E0, MP 0x14030D4E0 + { 0x81DE, "_meth_81DE" }, // SP 0x14024D440, MP 0x140316020 + { 0x81DF, "_meth_81DF" }, // SP 0x14024D640, MP 0x140316100 + { 0x81E0, "_meth_81E0" }, // SP 0x14024DFF0, MP 0x140316750 + { 0x81E1, "_meth_81E1" }, // SP 0x14024CA40, MP 0x140316610 + { 0x81E2, "_meth_81E2" }, // SP 0x14024EA40, MP 0x140317330 + { 0x81E3, "_meth_81E3" }, // SP 0x14024ED90, MP 0x140317710 + { 0x81E4, "_meth_81E4" }, // SP 0x1401F9DC0 + { 0x81E5, "_meth_81E5" }, // SP 0x1401F9E00 + { 0x81E6, "_meth_81E6" }, // SP 0x1401F9E90 + { 0x81E7, "_meth_81E7" }, // SP 0x1401F9F40 + { 0x81E8, "_meth_81E8" }, // SP 0x1401FA250 + { 0x81E9, "_meth_81E9" }, // SP 0x1401FA390 + { 0x81EA, "_meth_81EA" }, // SP 0x1401FA560 + { 0x81EB, "_meth_81EB" }, // SP 0x1401FA660 + { 0x81EC, "_meth_81EC" }, // SP 0x1401FA7A0 + { 0x81ED, "_meth_81ED" }, // SP 0x1401FA940 + { 0x81EE, "_meth_81EE" }, // SP 0x1401FA980 + { 0x81EF, "_meth_81EF" }, // SP 0x1401FA9D0 + { 0x81F0, "_meth_81F0" }, // SP 0x1401FAAD0 + { 0x81F1, "_meth_81F1" }, // SP 0x1401FABC0 + { 0x81F2, "_meth_81F2" }, // SP 0x1401FAC90 + { 0x81F3, "_meth_81F3" }, // SP 0x1401FAD40 + { 0x81F4, "_meth_81F4" }, // SP 0x1401FAF00 + { 0x81F5, "_meth_81F5" }, // SP 0x1401FAFE0 + { 0x81F6, "_meth_81F6" }, // SP 0x1401FAE20 + { 0x81F7, "_meth_81F7" }, // SP 0x1401FB0B0 + { 0x81F8, "_meth_81F8" }, // SP 0x1401FB0F0 + { 0x81F9, "_meth_81F9" }, // SP 0x1401FB290 + { 0x81FA, "_meth_81FA" }, // SP 0x1401FB2F0 + { 0x81FB, "_meth_81FB" }, // SP 0x1401FB520 + { 0x81FC, "_meth_81FC" }, // SP 0x1401FB800 + { 0x81FD, "_meth_81FD" }, // SP 0x1401FBA00 + { 0x81FE, "_meth_81FE" }, // SP 0x1401FBAA0 + { 0x81FF, "_meth_81FF" }, // SP 0x1401FBC90 + { 0x8200, "_meth_8200" }, // SP 0x14024F360, MP 0x140317BF0 + { 0x8201, "_meth_8201" }, // SP 0x14024F730, MP 0x1403180F0 + { 0x8202, "_meth_8202" }, // MP 0x140319E80 + { 0x8203, "_meth_8203" }, // SP 0x14025EDF0 + { 0x8204, "_meth_8204" }, // MP 0x14031A0D0 + { 0x8205, "_meth_8205" }, // empty + { 0x8206, "_meth_8206" }, // MP 0x14031A490 + { 0x8207, "_meth_8207" }, // MP 0x14031AB60 + { 0x8208, "_meth_8208" }, // MP 0x14031BCC0 + { 0x8209, "_meth_8209" }, // MP 0x14031B170 + { 0x820A, "_meth_820A" }, // MP 0x14031B590 + { 0x820B, "_meth_820B" }, // SP 0x140250DB0, MP 0x14031CEA0 + { 0x820C, "_meth_820C" }, // SP 0x140251290, MP 0x14031D310 + { 0x820D, "_meth_820D" }, // SP 0x1402516C0, MP 0x14031D770 + { 0x820E, "_meth_820E" }, // SP 0x140252870, MP 0x14031DD50 + { 0x820F, "_meth_820F" }, // SP 0x140253220, MP 0x14031E830 + { 0x8210, "_meth_8210" }, // SP 0x14023F0A0, MP 0x1403208A0 + { 0x8211, "_meth_8211" }, // SP 0x14023F1E0, MP 0x140320A40 + { 0x8212, "_meth_8212" }, // SP 0x14023F6D0, MP 0x140320CE0 + { 0x8213, "_meth_8213" }, // SP 0x14023F800, MP 0x140320DA0 + { 0x8214, "_meth_8214" }, // SP 0x1402416F0, MP 0x14030B690 + { 0x8215, "_meth_8215" }, // SP 0x140241BB0, MP 0x14030BDF0 + { 0x8216, "_meth_8216" }, // SP 0x140242150, MP 0x14030C520 + { 0x8217, "_meth_8217" }, // SP 0x140242810, MP 0x14030CD20 + { 0x8218, "_meth_8218" }, // SP 0x14024EDE0, MP 0x140317890 + { 0x8219, "_meth_8219" }, // SP 0x14024B390 + { 0x821A, "_meth_821A" }, // SP 0x14024B900 + { 0x821B, "_meth_821B" }, // SP 0x14023FA90, MP 0x140320E80 + { 0x821C, "_meth_821C" }, // SP 0x140240100, MP 0x1403215A0 + { 0x821D, "_meth_821D" }, // SP 0x140240590, MP 0x140321B00 + { 0x821E, "_meth_821E" }, // SP 0x140242D40, MP 0x14030BB10 + { 0x821F, "_meth_821F" }, // SP 0x140242B70, MP 0x14030B880 + { 0x8220, "_meth_8220" }, // SP 0x1402432C0, MP 0x14030C370 + { 0x8221, "_meth_8221" }, // SP 0x140247E60, MP 0x14030FA70 + { 0x8222, "_meth_8222" }, // SP 0x14024B550, MP 0x140315C90 + { 0x8223, "_meth_8223" }, // SP 0x14024B740, MP 0x140316000 + { 0x8224, "_meth_8224" }, // SP 0x14024BDE0, MP 0x1403166A0 + { 0x8225, "_meth_8225" }, // SP 0x14024C1B0, MP 0x140316920 + { 0x8226, "_meth_8226" }, // SP 0x14024CCD0, MP 0x140317120 + { 0x8227, "_meth_8227" }, // SP 0x1404146A0, MP 0x140528A90 + { 0x8228, "_meth_8228" }, // SP 0x140414780, MP 0x140528B10 + { 0x8229, "_meth_8229" }, // SP 0x1404149B0, MP 0x140528D80 + { 0x822A, "_meth_822A" }, // SP 0x140414B10, MP 0x140528EA0 + { 0x822B, "_meth_822B" }, // SP 0x140414BE0, MP 0x140528F90 + { 0x822C, "_meth_822C" }, // SP 0x140414C80, MP 0x140529090 + { 0x822D, "_meth_822D" }, // SP 0x140414DC0, MP 0x1405291B0 + { 0x822E, "_meth_822E" }, // SP 0x140414F60, MP 0x1405292C0 + { 0x822F, "_meth_822F" }, // SP 0x140414FF0, MP 0x1405293B0 + { 0x8230, "_meth_8230" }, // SP 0x1404150D0, MP 0x140529470 + { 0x8231, "_meth_8231" }, // SP 0x140415290, MP 0x1405296E0 + { 0x8232, "_meth_8232" }, // MP 0x14052B310 + { 0x8233, "_meth_8233" }, // SP 0x1402513B0 + { 0x8234, "_meth_8234" }, // SP 0x140251610 + { 0x8235, "_meth_8235" }, // SP 0x140252020 + { 0x8236, "_meth_8236" }, // SP 0x1402523C0 + { 0x8237, "_meth_8237" }, // SP 0x140252B10 + { 0x8238, "_meth_8238" }, // SP 0x140252DA0 + { 0x8239, "_meth_8239" }, // SP 0x140245BB0 + { 0x823A, "_meth_823A" }, // SP 0x140245CB0 + { 0x823B, "_meth_823B" }, // SP 0x140245F20 + { 0x823C, "_meth_823C" }, // SP 0x1402461E0 + { 0x823D, "_meth_823D" }, // SP 0x140252090 + { 0x823E, "_meth_823E" }, // SP 0x140252500 + { 0x823F, "_meth_823F" }, // empty + { 0x8240, "_meth_8240" }, // SP 0x14024F7E0 + { 0x8241, "_meth_8241" }, // SP 0x1401F9A00 + { 0x8242, "_meth_8242" }, // SP 0x1401F9C50 + { 0x8243, "_meth_8243" }, // SP 0x14024B6A0, MP 0x140315EF0 + { 0x8244, "_meth_8244" }, // SP 0x14024B980, MP 0x140316260 + { 0x8245, "_meth_8245" }, // SP 0x14024BFF0, MP 0x1403167A0 + { 0x8246, "_meth_8246" }, // SP 0x14024C710, MP 0x140316CC0 + { 0x8247, "_meth_8247" }, // SP 0x14024CE90, MP 0x140317520 + { 0x8248, "_meth_8248" }, // SP 0x14024DE10, MP 0x140318420 + { 0x8249, "_meth_8249" }, // SP 0x14024E3A0, MP 0x140318D50 + { 0x824A, "_meth_824A" }, // SP 0x1402501D0, MP 0x14031A3F0 + { 0x824B, "_meth_824B" }, // MP 0x1402E6DB0 + { 0x824C, "_meth_824C" }, // SP 0x140218FD0, MP 0x1402E6DA0 + { 0x824D, "_meth_824D" }, // MP 0x1402E84D0 + { 0x824E, "_meth_824E" }, // MP 0x1402E8560 + { 0x824F, "_meth_824F" }, // MP 0x1402E6E20 + { 0x8250, "_meth_8250" }, // SP 0x140211A10, MP 0x1402E1160 + { 0x8251, "_meth_8251" }, // MP 0x1402E7190 + { 0x8252, "_meth_8252" }, // SP 0x140416B50, MP 0x14052AFB0 + { 0x8253, "_meth_8253" }, // SP 0x140416C20, MP 0x14052B080 + { 0x8254, "_meth_8254" }, // SP 0x140416D40, MP 0x14052B120 + { 0x8255, "_meth_8255" }, // SP 0x140416F20 + { 0x8256, "_meth_8256" }, // SP 0x140416FD0, MP 0x14052B380 + { 0x8257, "_meth_8257" }, // SP 0x140417220, MP 0x14052B5D0 + { 0x8258, "_meth_8258" }, // SP 0x1404172A0, MP 0x14052B650 + { 0x8259, "_meth_8259" }, // SP 0x140417330, MP 0x14052B6E0 + { 0x825A, "_meth_825A" }, // SP 0x1404173B0, MP 0x14052B850 + { 0x825B, "_meth_825B" }, // SP 0x140417420, MP 0x14052B8C0 + { 0x825C, "_meth_825C" }, // SP 0x140417510, MP 0x14052B9C0 + { 0x825D, "_meth_825D" }, // SP 0x1404175A0, MP 0x14052BA50 + { 0x825E, "_meth_825E" }, // SP 0x140417620, MP 0x14052BAD0 + { 0x825F, "_meth_825F" }, // SP 0x1404176B0, MP 0x14052BB60 + { 0x8260, "_meth_8260" }, // SP 0x140417730, MP 0x14052BBE0 + { 0x8261, "_meth_8261" }, // SP 0x140413720, MP 0x140527C80 + { 0x8262, "_meth_8262" }, // SP 0x140413810, MP 0x140527D70 + { 0x8263, "_meth_8263" }, // SP 0x140413910, MP 0x140527E70 + { 0x8264, "_meth_8264" }, // SP 0x1404139A0, MP 0x140527F00 + { 0x8265, "_meth_8265" }, // SP 0x140413C80, MP 0x1405281E0 + { 0x8266, "_meth_8266" }, // SP 0x140413D30, MP 0x140528290 + { 0x8267, "_meth_8267" }, // SP 0x140413E90, MP 0x140528370 + { 0x8268, "_meth_8268" }, // SP 0x140413F00, MP 0x1405283E0 + { 0x8269, "_meth_8269" }, // SP 0x140414610, MP 0x140528A20 + { 0x826A, "_meth_826A" }, // MP 0x1402E7660 + { 0x826B, "_meth_826B" }, // MP 0x1402E7CC0 + { 0x826C, "_meth_826C" }, // MP 0x1402E7EB0 + { 0x826D, "_meth_826D" }, // MP 0x1402E7F20 + { 0x826E, "_meth_826E" }, // MP 0x1402E7F90 + { 0x826F, "_meth_826F" }, // MP 0x1402E8000 + { 0x8270, "_meth_8270" }, // MP 0x1402E8070 + { 0x8271, "_meth_8271" }, // MP 0x1402E80D0 + { 0x8272, "_meth_8272" }, // MP 0x1402E8450 + { 0x8273, "_meth_8273" }, // MP 0x1402E85F0 + { 0x8274, "_meth_8274" }, // MP 0x1402E86C0 + { 0x8275, "_meth_8275" }, // MP 0x1402E8860 + { 0x8276, "_meth_8276" }, // SP 0x140265280, MP 0x140333DC0 + { 0x8277, "_meth_8277" }, // SP 0x1402654A0, MP 0x140334000 + { 0x8278, "_meth_8278" }, // SP 0x140265AE0, MP 0x140334660 + { 0x8279, "_meth_8279" }, // MP 0x140334730 + { 0x827A, "_meth_827A" }, // MP 0x140334B20 + { 0x827B, "_meth_827B" }, // MP 0x140334960 + { 0x827C, "_meth_827C" }, // SP 0x1404154A0, MP 0x1405298C0 + { 0x827D, "_meth_827D" }, // SP 0x140415620, MP 0x140529A40 + { 0x827E, "_meth_827E" }, // SP 0x140415720, MP 0x140529B40 + { 0x827F, "_meth_827F" }, // SP 0x1404158C0, MP 0x140529CE0 + { 0x8280, "_meth_8280" }, // SP 0x140415B60, MP 0x140529E70 + { 0x8281, "_meth_8281" }, // SP 0x140415C60, MP 0x140529F00 + { 0x8282, "vehicle_finishdamage" }, + { 0x8283, "_meth_8283" }, // SP 0x140415CE0, MP 0x14052A1D0 + { 0x8284, "_meth_8284" }, // SP 0x140415D50, MP 0x14052A240 + { 0x8285, "_meth_8285" }, // SP 0x140415EE0, MP 0x14052A3D0 + { 0x8286, "_meth_8286" }, // SP 0x140416000, MP 0x14052A4F0 + { 0x8287, "_meth_8287" }, // SP 0x1404160F0, MP 0x14052A5E0 + { 0x8288, "_meth_8288" }, // SP 0x140416160, MP 0x14052A650 + { 0x8289, "_meth_8289" }, // SP 0x1404161D0, MP 0x14052A6C0 + { 0x828A, "_meth_828A" }, // SP 0x140416250, MP 0x14052A750 + { 0x828B, "_meth_828B" }, // SP 0x1404162C0, MP 0x14052A7C0 + { 0x828C, "_meth_828C" }, // SP 0x140416320, MP 0x14052A830 + { 0x828D, "_meth_828D" }, // SP 0x140416380 + { 0x828E, "_meth_828E" }, // SP 0x140416440, MP 0x14052A8A0 + { 0x828F, "_meth_828F" }, // SP 0x1404164B0, MP 0x14052A910 + { 0x8290, "_meth_8290" }, // SP 0x140416520, MP 0x14052A980 + { 0x8291, "_meth_8291" }, // SP 0x140416590, MP 0x14052A9F0 + { 0x8292, "_meth_8292" }, // SP 0x140416620, MP 0x14052AA80 + { 0x8293, "_meth_8293" }, // SP 0x140416780, MP 0x14052ABE0 + { 0x8294, "_meth_8294" }, // SP 0x140416990, MP 0x14052ADF0 + { 0x8295, "_meth_8295" }, // SP 0x140416A50, MP 0x14052AEB0 + { 0x8296, "_meth_8296" }, // SP 0x140416AE0, MP 0x14052AF40 + { 0x8297, "_meth_8297" }, // SP 0x140215990, MP 0x1402E88D0 + { 0x8298, "_meth_8298" }, // MP 0x1402E8AB0 + { 0x8299, "_meth_8299" }, // MP 0x1402E8B10 + { 0x829A, "_meth_829A" }, // MP 0x1402E8B70 + { 0x829B, "_meth_829B" }, // MP 0x1402E8BD0 + { 0x829C, "_meth_829C" }, // MP 0x1402E8C30 + { 0x829D, "_meth_829D" }, // MP 0x1402E8CC0 + { 0x829E, "_meth_829E" }, // MP 0x1402E8D40 + { 0x829F, "_meth_829F" }, // MP 0x1402E8E10 + { 0x82A0, "_meth_82A0" }, // MP 0x1402E8E20 + { 0x82A1, "_meth_82A1" }, // MP 0x1402E8E30 + { 0x82A2, "_meth_82A2" }, // MP 0x1402E8EC0 + { 0x82A3, "_meth_82A3" }, // SP 0x140215250, MP 0x1402DD010 + { 0x82A4, "_meth_82A4" }, // MP 0x1402DF3E0 + { 0x82A5, "_meth_82A5" }, // SP 0x140217F10, MP 0x1402DFF00 + { 0x82A6, "_meth_82A6" }, // SP 0x1402128A0, MP 0x1402E2220 + { 0x82A7, "_meth_82A7" }, // SP 0x140212E30, MP 0x1402E28A0 + { 0x82A8, "_meth_82A8" }, // SP 0x140213680, MP 0x1402E3160 + { 0x82A9, "_meth_82A9" }, // SP 0x140213140, MP 0x1402E2B50 + { 0x82AA, "_meth_82AA" }, // MP 0x1402E63D0 + { 0x82AB, "_meth_82AB" }, // MP 0x1402E64E0 + { 0x82AC, "_meth_82AC" }, // MP 0x1402E3540 + { 0x82AD, "_meth_82AD" }, // MP 0x1402E3550 + { 0x82AE, "_meth_82AE" }, // SP 0x140265FB0, MP 0x1403350C0 + { 0x82AF, "_meth_82AF" }, // SP 0x1402645A0, MP 0x140333110 + { 0x82B0, "_meth_82B0" }, // SP 0x1402645B0, MP 0x140333120 + { 0x82B1, "_meth_82B1" }, // SP 0x1402645D0, MP 0x140333140 + { 0x82B2, "_meth_82B2" }, // SP 0x1402661A0, MP 0x140332DA0 + { 0x82B3, "_meth_82B3" }, // SP 0x1402643B0, MP 0x140332F00 + { 0x82B4, "_meth_82B4" }, // SP 0x140264520, MP 0x140333080 + { 0x82B5, "_meth_82B5" }, // SP 0x1402645F0, MP 0x140333160 + { 0x82B6, "_meth_82B6" }, // SP 0x140264A20, MP 0x1403332B0 + { 0x82B7, "_meth_82B7" }, // SP 0x140264A30, MP 0x1403332C0 + { 0x82B8, "_meth_82B8" }, // SP 0x140264A50, MP 0x1403332E0 + { 0x82B9, "_meth_82B9" }, // SP 0x1402649D0, MP 0x140333260 + { 0x82BA, "_meth_82BA" }, // SP 0x1402649F0, MP 0x140333280 + { 0x82BB, "_meth_82BB" }, // SP 0x140264A10, MP 0x1403332A0 + { 0x82BC, "_meth_82BC" }, // SP 0x140264A70, MP 0x140333300 + { 0x82BD, "_meth_82BD" }, // SP 0x140264CC0, MP 0x1403337B0 + { 0x82BE, "_meth_82BE" }, // SP 0x140265BC0, MP 0x140334CD0 + { 0x82BF, "_meth_82BF" }, // SP 0x140265C70, MP 0x140334D80 + { 0x82C0, "_meth_82C0" }, // SP 0x140264E40, MP 0x140333970 + { 0x82C1, "_meth_82C1" }, // SP 0x140264EA0, MP 0x1403339D0 + { 0x82C2, "_meth_82C2" }, // SP 0x140264F20, MP 0x140333A50 + { 0x82C3, "_meth_82C3" }, // MP 0x1402E5980 + { 0x82C4, "_meth_82C4" }, // MP 0x1402E5990 + { 0x82C5, "_meth_82C5" }, // MP 0x1402E59A0 + { 0x82C6, "_meth_82C6" }, // MP 0x1402E5A60 + { 0x82C7, "_meth_82C7" }, // MP 0x1402E5AC0 + { 0x82C8, "_meth_82C8" }, // MP 0x1402E5B30 + { 0x82C9, "_meth_82C9" }, // MP 0x1402E5BA0 + { 0x82CA, "_meth_82CA" }, // MP 0x1402E5EF0 + { 0x82CB, "_meth_82CB" }, // SP 0x140217770, MP 0x1402DF6A0 + { 0x82CC, "_meth_82CC" }, // SP 0x1402177D0, MP 0x1402DF7C0 + { 0x82CD, "_meth_82CD" }, // MP 0x1402E5F60 + { 0x82CE, "_meth_82CE" }, // SP 0x140216D40, MP 0x1402DEC00 + { 0x82CF, "_meth_82CF" }, // SP 0x140216E90, MP 0x1402DED60 + { 0x82D0, "_meth_82D0" }, // SP 0x140216FE0, MP 0x1402DEEC0 + { 0x82D1, "_meth_82D1" }, // SP 0x140217130, MP 0x1402DF020 + { 0x82D2, "_meth_82D2" }, // SP 0x140212160, MP 0x1402E1A30 + { 0x82D3, "_meth_82D3" }, // SP 0x140212490, MP 0x1402E1DF0 + { 0x82D4, "_meth_82D4" }, // SP 0x140218160, MP 0x1402E0170 + { 0x82D5, "_meth_82D5" }, // SP 0x140210920, MP 0x1402E0180 + { 0x82D6, "_meth_82D6" }, // SP 0x1402109A0, MP 0x1402E0210 + { 0x82D7, "_meth_82D7" }, // SP 0x1402109C0, MP 0x1402E02B0 + { 0x82D8, "_meth_82D8" }, // SP 0x1402109E0, MP 0x1402E02D0 + { 0x82D9, "_meth_82D9" }, // SP 0x140211B40, MP 0x1402E12B0 + { 0x82DA, "_meth_82DA" }, // SP 0x14025D320, MP 0x1402E18D0 + { 0x82DB, "_meth_82DB" }, // MP 0x1402E18F0 + { 0x82DC, "_meth_82DC" }, // SP 0x1402605B0 + { 0x82DD, "_meth_82DD" }, // SP 0x1402138F0, MP 0x1402E3560 + { 0x82DE, "_meth_82DE" }, // SP 0x140213C10, MP 0x1402E3B30 + { 0x82DF, "_meth_82DF" }, // SP 0x140213EA0, MP 0x1402E3CD0 + { 0x82E0, "_meth_82E0" }, // SP 0x140213FD0, MP 0x1402E3E60 + { 0x82E1, "_meth_82E1" }, // SP 0x140214610, MP 0x1402E4770 + { 0x82E2, "_meth_82E2" }, // SP 0x140214830, MP 0x1402E49D0 + { 0x82E3, "_meth_82E3" }, // SP 0x1402149C0, MP 0x1402E4B20 + { 0x82E4, "_meth_82E4" }, // SP 0x140214B20, MP 0x1402E4D50 + { 0x82E5, "_meth_82E5" }, // SP 0x140214C80, MP 0x1402DC9C0 + { 0x82E6, "_meth_82E6" }, // SP 0x140214F70, MP 0x1402DCD00 + { 0x82E7, "_meth_82E7" }, // SP 0x1402150D0, MP 0x1402DCE80 + { 0x82E8, "_meth_82E8" }, // MP 0x1402E5FA0 + { 0x82E9, "_meth_82E9" }, // MP 0x1402E6020 + { 0x82EA, "_meth_82EA" }, // MP 0x1402E60A0 + { 0x82EB, "_meth_82EB" }, // MP 0x1402E6270 + { 0x82EC, "_meth_82EC" }, // MP 0x1402E6170 + { 0x82ED, "_meth_82ED" }, // SP 0x1402168F0, MP 0x1402DE5A0 + { 0x82EE, "_meth_82EE" }, // SP 0x140215E00, MP 0x1402DD3B0 + { 0x82EF, "_meth_82EF" }, // SP 0x140215E80, MP 0x1402DD4C0 + { 0x82F0, "_meth_82F0" }, // SP 0x140217FF0, MP 0x1402DFCA0 + { 0x82F1, "_meth_82F1" }, // SP 0x1402144C0, MP 0x1402E4330 + { 0x82F2, "_meth_82F2" }, // SP 0x140214C30, MP 0x1402E4AC0 + { 0x82F3, "_meth_82F3" }, // SP 0x140214FC0, MP 0x1402E4C80 + { 0x82F4, "_meth_82F4" }, // SP 0x140214080, MP 0x1402E3E40 + { 0x82F5, "_meth_82F5" }, // SP 0x140214150, MP 0x1402E3FD0 + { 0x82F6, "_meth_82F6" }, // SP 0x1402113C0, MP 0x1402E0FA0 + { 0x82F7, "_meth_82F7" }, // SP 0x1402117B0, MP 0x1402E1530 + { 0x82F8, "_meth_82F8" }, // SP 0x140211D60, MP 0x1402E1910 + { 0x82F9, "_meth_82F9" }, // SP 0x140211F00, MP 0x1402E1C10 + { 0x82FA, "_meth_82FA" }, // SP 0x1402122B0, MP 0x1402E2070 + { 0x82FB, "_meth_82FB" }, // SP 0x140212540, MP 0x1402E24C0 + { 0x82FC, "_meth_82FC" }, // SP 0x1402129E0, MP 0x1402E2CE0 + { 0x82FD, "_meth_82FD" }, // SP 0x140212BC0, MP 0x1402E3320 + { 0x82FE, "_meth_82FE" }, // MP 0x1402E30F0 + { 0x82FF, "_meth_82FF" }, // MP 0x1402E3230 + { 0x8300, "_meth_8300" }, // SP 0x1402151D0, MP 0x1402E48E0 + { 0x8301, "_meth_8301" }, // SP 0x140215440, MP 0x1402E4A50 + { 0x8302, "_meth_8302" }, // SP 0x140216460, MP 0x1402DDC20 + { 0x8303, "_meth_8303" }, // SP 0x140216530, MP 0x1402DDE30 + { 0x8304, "_meth_8304" }, // SP 0x140216600, MP 0x1402DE000 + { 0x8305, "_meth_8305" }, // SP 0x140216CB0, MP 0x1402DF1A0 + { 0x8306, "_meth_8306" }, // SP 0x1402172B0, MP 0x1402DF230 + { 0x8307, "_meth_8307" }, // SP 0x140217330, MP 0x1402DF2B0 + { 0x8308, "_meth_8308" }, // SP 0x140216710, MP 0x1402DE210 + { 0x8309, "_meth_8309" }, // SP 0x1402153C0, MP 0x1402DD1B0 + { 0x830A, "_meth_830A" }, // SP 0x140215500, MP 0x1402DD350 + { 0x830B, "_meth_830B" }, // SP 0x140216AE0, MP 0x1402DE9E0 + { 0x830C, "_meth_830C" }, // SP 0x140216B60, MP 0x1402DEA00 + { 0x830D, "_meth_830D" }, // SP 0x140215130, MP 0x1402DC8B0 + { 0x830E, "_meth_830E" }, // SP 0x1402173C0, MP 0x1402DE6A0 + { 0x830F, "_meth_830F" }, // SP 0x1402178D0, MP 0x1402DF340 + { 0x8310, "_meth_8310" }, // SP 0x140217A70, MP 0x1402DF610 + { 0x8311, "_meth_8311" }, // SP 0x140217BE0, MP 0x1402DF820 + { 0x8312, "_meth_8312" }, // SP 0x140217E30, MP 0x1402DF9B0 + { 0x8313, "_meth_8313" }, // SP 0x140218260, MP 0x1402DFE50 + { 0x8314, "_meth_8314" }, // SP 0x140210F70, MP 0x1402E07C0 + { 0x8315, "_meth_8315" }, // SP 0x1402116F0, MP 0x1402E0E00 + { 0x8316, "_meth_8316" }, // SP 0x140211750, MP 0x1402E0F30 + { 0x8317, "_meth_8317" }, // SP 0x140212410, MP 0x1402E1D60 + { 0x8318, "_meth_8318" }, // SP 0x1402125C0, MP 0x1402E1F60 + { 0x8319, "_meth_8319" }, // SP 0x140210C20, MP 0x1402E0450 + { 0x831A, "_meth_831A" }, // SP 0x140210DD0, MP 0x1402E0610 + { 0x831B, "_meth_831B" }, // SP 0x140214DA0, MP 0x1402E4470 + { 0x831C, "_meth_831C" }, // SP 0x140215060, MP 0x1402E4700 + { 0x831D, "_meth_831D" }, // SP 0x140210940, MP 0x1402E0520 + { 0x831E, "_meth_831E" }, // SP 0x140210A00, MP 0x1402E0680 + { 0x831F, "_meth_831F" }, // SP 0x140210BC0, MP 0x1402E08C0 + { 0x8320, "_meth_8320" }, // SP 0x140210CE0, MP 0x1402E0920 + { 0x8321, "_meth_8321" }, // SP 0x1402110C0, MP 0x1402E0C90 + { 0x8322, "_meth_8322" }, // SP 0x1402111D0, MP 0x1402E0DA0 + { 0x8323, "_meth_8323" }, // SP 0x1402176D0, MP 0x1402DF550 + { 0x8324, "_meth_8324" }, // SP 0x140217830, MP 0x1402DF700 + { 0x8325, "_meth_8325" }, // SP 0x1402179C0, MP 0x1402DF940 + { 0x8326, "_meth_8326" }, // SP 0x140217AF0, MP 0x1402DFAC0 + { 0x8327, "_meth_8327" }, // SP 0x140217D90, MP 0x1402DFBE0 + { 0x8328, "_meth_8328" }, // empty + { 0x8329, "_meth_8329" }, // SP 0x1402180F0, MP 0x1402E00C0 + { 0x832A, "_meth_832A" }, // SP 0x1402182E0, MP 0x1402E0230 + { 0x832B, "_meth_832B" }, // SP 0x140210810, MP 0x1402E0310 + { 0x832C, "_meth_832C" }, // SP 0x140213350, MP 0x1402E37B0 + { 0x832D, "_meth_832D" }, // SP 0x1402136E0, MP 0x1402E38A0 + { 0x832E, "_meth_832E" }, // SP 0x1402137B0, MP 0x1402E3A10 + { 0x832F, "_meth_832F" }, // SP 0x140213A50, MP 0x1402E3A20 + { 0x8330, "_meth_8330" }, // SP 0x140213C40, MP 0x1402E3A30 + { 0x8331, "_meth_8331" }, // SP 0x140212AD0, MP 0x1402E23C0 + { 0x8332, "_meth_8332" }, // SP 0x140212CA0, MP 0x1402E2570 + { 0x8333, "_meth_8333" }, // SP 0x140212FE0, MP 0x1402E29E0 + { 0x8334, "_meth_8334" }, // SP 0x140213440, MP 0x1402E2EA0 + { 0x8335, "_meth_8335" }, // SP 0x1402139C0, MP 0x1402E35E0 + { 0x8336, "_meth_8336" }, // SP 0x140213B20, MP 0x1402E36D0 + { 0x8337, "_meth_8337" }, // SP 0x140213B90, MP 0x1402E3980 + { 0x8338, "_meth_8338" }, // SP 0x140214250, MP 0x1402E4100 + { 0x8339, "_meth_8339" }, // SP 0x1402145A0, MP 0x1402E45C0 + { 0x833A, "_meth_833A" }, // SP 0x140214A20, MP 0x1402E4850 + { 0x833B, "_meth_833B" }, // SP 0x140214BE0, MP 0x1402E4970 + { 0x833C, "_meth_833C" }, // SP 0x140215610, MP 0x1402DCDE0 + { 0x833D, "_meth_833D" }, // SP 0x140215770, MP 0x1402DCF70 + { 0x833E, "_meth_833E" }, // SP 0x140215B00, MP 0x1402DD0F0 + { 0x833F, "_meth_833F" }, // SP 0x140215C10, MP 0x1402DD2B0 + { 0x8340, "_meth_8340" }, // SP 0x140216410, MP 0x1402DDD10 + { 0x8341, "_meth_8341" }, // SP 0x1402164C0, MP 0x1402DDED0 + { 0x8342, "_meth_8342" }, // SP 0x140216660, MP 0x1402DE1A0 + { 0x8343, "_meth_8343" }, // SP 0x140216870, MP 0x1402DE440 + { 0x8344, "_meth_8344" }, // SP 0x140210860, MP 0x1402DFFF0 + { 0x8345, "_meth_8345" }, // SP 0x140210A80, MP 0x1402E01A0 + { 0x8346, "_meth_8346" }, // SP 0x140214330 + { 0x8347, "_meth_8347" }, // SP 0x140214740 + { 0x8348, "_meth_8348" }, // SP 0x1402148A0 + { 0x8349, "_meth_8349" }, // SP 0x140214A80 + { 0x834A, "_meth_834A" }, // MP 0x14032DFF0 + { 0x834B, "_meth_834B" }, // MP 0x14032E040 + { 0x834C, "_meth_834C" }, // SP 0x140214EF0, MP 0x1402E4C70 + { 0x834D, "_meth_834D" }, // MP 0x14032BEB0 + { 0x834E, "_meth_834E" }, // SP 0x140216150, MP 0x1402DD960 + { 0x834F, "_meth_834F" }, // MP 0x14032DD30 + { 0x8350, "_meth_8350" }, // MP 0x14032DE40 + { 0x8351, "_meth_8351" }, // MP 0x140432330 + { 0x8352, "_meth_8352" }, // MP 0x140432AB0 + { 0x8353, "_meth_8353" }, // MP 0x140432930 + { 0x8354, "_meth_8354" }, // MP 0x140432610 + { 0x8355, "_meth_8355" }, // MP 0x1404327B0 + { 0x8356, "_meth_8356" }, // MP 0x1404308A0 + { 0x8357, "_meth_8357" }, // MP 0x140432550 + { 0x8358, "_meth_8358" }, // MP 0x140430820 + { 0x8359, "_meth_8359" }, // MP 0x1404320F0 + { 0x835A, "_meth_835A" }, // MP 0x140431010 + { 0x835B, "_meth_835B" }, // MP 0x140431140 + { 0x835C, "_meth_835C" }, // MP 0x140431240 + { 0x835D, "_meth_835D" }, // MP 0x1404311C0 + { 0x835E, "_meth_835E" }, // empty + { 0x835F, "_meth_835F" }, // MP 0x140431380 + { 0x8360, "_meth_8360" }, // MP 0x1404318D0 + { 0x8361, "_meth_8361" }, // MP 0x140430920 + { 0x8362, "_meth_8362" }, // MP 0x140431670 + { 0x8363, "_meth_8363" }, // empty + { 0x8364, "_meth_8364" }, // MP 0x140431970 + { 0x8365, "_meth_8365" }, // MP 0x1404313A0 + { 0x8366, "_meth_8366" }, // MP 0x140430F90 + { 0x8367, "_meth_8367" }, // MP 0x140432B80 + { 0x8368, "_meth_8368" }, // empty + { 0x8369, "_meth_8369" }, // MP 0x1404324C0 + { 0x836A, "_meth_836A" }, // MP 0x140432200 + { 0x836B, "_meth_836B" }, // MP 0x140430AB0 + { 0x836C, "_meth_836C" }, // MP 0x1404312C0 + { 0x836D, "_meth_836D" }, // MP 0x1404314A0 + { 0x836E, "_meth_836E" }, // MP 0x140431EA0 + { 0x836F, "_meth_836F" }, // MP 0x1404306B0 + { 0x8370, "_meth_8370" }, // MP 0x140430DA0 + { 0x8371, "_meth_8371" }, // MP 0x140431AC0 + { 0x8372, "_meth_8372" }, // empty + { 0x8373, "_meth_8373" }, // MP 0x140430BF0 + { 0x8374, "_meth_8374" }, // MP 0x140432170 + { 0x8375, "_meth_8375" }, // MP 0x140432060 + { 0x8376, "_meth_8376" }, // MP 0x1404310B0 + { 0x8377, "_meth_8377" }, // MP 0x140430C70 + { 0x8378, "_meth_8378" }, // empty + { 0x8379, "_meth_8379" }, // MP 0x1404323F0 + { 0x837A, "_meth_837A" }, // MP 0x140432290 + { 0x837B, "_meth_837B" }, // MP 0x140430B40 + { 0x837C, "_meth_837C" }, // MP 0x140430E60 + { 0x837D, "_meth_837D" }, // MP 0x140431420 + { 0x837E, "_meth_837E" }, // MP 0x140431F60 + { 0x837F, "_meth_837F" }, // MP 0x140430790 + { 0x8380, "_meth_8380" }, // MP 0x140431C70 + { 0x8381, "_meth_8381" }, // MP 0x1402DE550 + { 0x8382, "_meth_8382" }, // MP 0x14032AEF0 + { 0x8383, "_meth_8383" }, // MP 0x1403299E0 + { 0x8384, "_meth_8384" }, // MP 0x14031BD40 + { 0x8385, "_meth_8385" }, // MP 0x14032AB40 + { 0x8386, "_meth_8386" }, // MP 0x1402DE580 + { 0x8387, "_meth_8387" }, // SP 0x140216B00, MP 0x1402DE4F0 + { 0x8388, "_meth_8388" }, // MP 0x14032BDF0 + { 0x8389, "_meth_8389" }, // empty + { 0x838A, "_meth_838A" }, // MP 0x140404FA0 + { 0x838B, "_meth_838B" }, // MP 0x140404640 + { 0x838C, "_meth_838C" }, // MP 0x140404E80 + { 0x838D, "_meth_838D" }, // MP 0x140404040 + { 0x838E, "_meth_838E" }, // MP 0x140403E60 + { 0x838F, "_meth_838F" }, // MP 0x140406A80 + { 0x8390, "_meth_8390" }, // MP 0x140406090 + { 0x8391, "_meth_8391" }, // MP 0x140405610 + { 0x8392, "_meth_8392" }, // MP 0x140406000 + { 0x8393, "_meth_8393" }, // MP 0x140405F70 + { 0x8394, "_meth_8394" }, // MP 0x1404061B0 + { 0x8395, "_meth_8395" }, // MP 0x140405E10 + { 0x8396, "_meth_8396" }, // MP 0x140406490 + { 0x8397, "_meth_8397" }, // MP 0x140405CF0 + { 0x8398, "_meth_8398" }, // MP 0x1404066E0 + { 0x8399, "_meth_8399" }, // MP 0x140405ED0 + { 0x839A, "_meth_839A" }, // MP 0x1404062C0 + { 0x839B, "_meth_839B" }, // MP 0x140405730 + { 0x839C, "_meth_839C" }, // MP 0x140405290 + { 0x839D, "_meth_839D" }, // MP 0x1404067A0 + { 0x839E, "_meth_839E" }, // MP 0x140405580 + { 0x839F, "_meth_839F" }, // MP 0x140405470 + { 0x83A0, "_meth_83A0" }, // MP 0x140406A00 + { 0x83A1, "_meth_83A1" }, // MP 0x140405360 + { 0x83A2, "_meth_83A2" }, // MP 0x140405BE0 + { 0x83A3, "_meth_83A3" }, // SP 0x14021EB90, MP 0x1402EF370 + { 0x83A4, "_meth_83A4" }, // SP 0x14021EC40, MP 0x1402EF420 + { 0x83A5, "_meth_83A5" }, // SP 0x14021ECB0, MP 0x1402EF480 + { 0x83A6, "_meth_83A6" }, // SP 0x14021ED20, MP 0x1402EF4E0 + { 0x83A7, "_meth_83A7" }, // SP 0x14025CD90 + { 0x83A8, "_meth_83A8" }, // SP 0x1402156E0, MP 0x1402DD560 + { 0x83A9, "_meth_83A9" }, // SP 0x140215860, MP 0x1402DD590 + { 0x83AA, "_meth_83AA" }, // SP 0x140219A90 + { 0x83AB, "_meth_83AB" }, // SP 0x14025D090 + { 0x83AC, "_meth_83AC" }, // SP 0x14025D100 + { 0x83AD, "_meth_83AD" }, // SP 0x140219940 + { 0x83AE, "_meth_83AE" }, // SP 0x140219A20 + { 0x83AF, "_meth_83AF" }, // SP 0x1402199B0 + { 0x83B0, "_meth_83B0" }, // empty + { 0x83B1, "_meth_83B1" }, // empty + { 0x83B2, "_meth_83B2" }, // SP 0x140215550, MP 0x1402E4B80 + { 0x83B3, "_meth_83B3" }, // SP 0x140214020, MP 0x1402E4090 + { 0x83B4, "_meth_83B4" }, // SP 0x1402141E0, MP 0x1402E42B0 + { 0x83B5, "_meth_83B5" }, // SP 0x1404155F0, MP 0x140529A10 + { 0x83B6, "_meth_83B6" }, // SP 0x140415600, MP 0x140529A20 + { 0x83B7, "_meth_83B7" }, // MP 0x14032D4B0 + { 0x83B8, "_meth_83B8" }, // SP 0x140245EC0, MP 0x14030F7E0 + { 0x83B9, "_meth_83B9" }, // SP 0x140242A20, MP 0x14030B590 + { 0x83BA, "_meth_83BA" }, // SP 0x140242DC0, MP 0x14030BAA0 + { 0x83BB, "_meth_83BB" }, // SP 0x140216060, MP 0x1402DD820 + { 0x83BC, "_meth_83BC" }, // SP 0x140417980, MP 0x14052BE00 + { 0x83BD, "_meth_83BD" }, // SP 0x140417A30, MP 0x14052BEB0 + { 0x83BE, "_meth_83BE" }, // SP 0x140417AB0, MP 0x14052BF30 + { 0x83BF, "_meth_83BF" }, // SP 0x14023B560 + { 0x83C0, "_meth_83C0" }, // SP 0x140210D40, MP 0x1402E0580 + { 0x83C1, "_meth_83C1" }, // SP 0x140210E90, MP 0x1402E06E0 + { 0x83C2, "_meth_83C2" }, // SP 0x140211120, MP 0x1402E0980 + { 0x83C3, "_meth_83C3" }, // SP 0x1402650D0, MP 0x140333C10 + { 0x83C4, "_meth_83C4" }, // SP 0x14028A260, MP 0x140043710 + { 0x83C5, "_meth_83C5" }, // SP 0x140417070, MP 0x14052B420 + { 0x83C6, "_meth_83C6" }, // MP 0x1402DDD70 + { 0x83C7, "_meth_83C7" }, // SP 0x14023B4F0 + { 0x83C8, "_meth_83C8" }, // SP 0x1401FB770 + { 0x83C9, "_meth_83C9" }, // SP 0x1401FB8A0 + { 0x83CA, "_meth_83CA" }, // SP 0x1401FBBB0 + { 0x83CB, "_meth_83CB" }, // SP 0x1401FBD00 + { 0x83CC, "_meth_83CC" }, // SP 0x1401FBF30 + { 0x83CD, "_meth_83CD" }, // SP 0x1401FBEC0 + { 0x83CE, "_meth_83CE" }, // SP 0x1401FC090 + { 0x83CF, "_meth_83CF" }, // SP 0x1401FC0F0 + { 0x83D0, "_meth_83D0" }, // MP 0x140044400 + { 0x83D1, "_meth_83D1" }, // MP 0x140043EE0 + { 0x83D2, "_meth_83D2" }, // MP 0x140044470 + { 0x83D3, "_meth_83D3" }, // MP 0x140044010 + { 0x83D4, "_meth_83D4" }, // MP 0x1400441C0 + { 0x83D5, "_meth_83D5" }, // MP 0x1400440A0 + { 0x83D6, "_meth_83D6" }, // MP 0x140044100 + { 0x83D7, "_meth_83D7" }, // SP 0x14025A000 + { 0x83D8, "_meth_83D8" }, // SP 0x1402154A0, MP 0x1402DCC90 + { 0x83D9, "_meth_83D9" }, // SP 0x1402519A0 + { 0x83DA, "_meth_83DA" }, // SP 0x1401FA190 + { 0x83DB, "_meth_83DB" }, // MP 0x14031AEF0 + { 0x83DC, "_meth_83DC" }, // empty + { 0x83DD, "_meth_83DD" }, // empty + { 0x83DE, "_meth_83DE" }, // SP 0x140215F80, MP 0x1402DD780 + { 0x83DF, "_meth_83DF" }, // SP 0x1402647C0, MP 0x1403331E0 + { 0x83E0, "_meth_83E0" }, // MP 0x1404056A0 + { 0x83E1, "_meth_83E1" }, // MP 0x140405A50 + { 0x83E2, "_meth_83E2" }, // MP 0x140316940 + { 0x83E3, "_meth_83E3" }, // MP 0x14032D710 + { 0x83E4, "_meth_83E4" }, // SP 0x14024CD60, MP 0x14031B0D0 + { 0x83E5, "_meth_83E5" }, // SP 0x14024A200, MP 0x140311B20 + { 0x83E6, "_meth_83E6" }, // SP 0x14024AB80, MP 0x140312A70 + { 0x83E7, "_meth_83E7" }, // MP 0x1402EE870 + { 0x83E8, "_meth_83E8" }, // SP 0x14025C3C0 + { 0x83E9, "_meth_83E9" }, // SP 0x14025CBE0 + { 0x83EA, "_meth_83EA" }, // SP 0x140217CE0, MP 0x1402DFDA0 + { 0x83EB, "_meth_83EB" }, // SP 0x14021E100, MP 0x1402EEA40 + { 0x83EC, "_meth_83EC" }, // SP 0x14024DB10, MP 0x1403185B0 + { 0x83ED, "_meth_83ED" }, // SP 0x14024E830, MP 0x140319350 + { 0x83EE, "_meth_83EE" }, // MP 0x1402DD660 + { 0x83EF, "_meth_83EF" }, // SP 0x140259E40 + { 0x83F0, "_meth_83F0" }, // empty + { 0x83F1, "_meth_83F1" }, // SP 0x140249730, MP 0x140313D20 + { 0x83F2, "_meth_83F2" }, // SP 0x140247DC0, MP 0x1403131D0 + { 0x83F3, "_meth_83F3" }, // SP 0x1402504D0, MP 0x14031C1F0 + { 0x83F4, "_meth_83F4" }, // SP 0x140219120 + { 0x83F5, "_meth_83F5" }, // SP 0x140219180 + { 0x83F6, "_meth_83F6" }, // SP 0x14024D350, MP 0x14031B8D0 + { 0x83F7, "_meth_83F7" }, // SP 0x14024DA40, MP 0x14031BE10 + { 0x83F8, "_meth_83F8" }, // MP 0x140316A60 + { 0x83F9, "_meth_83F9" }, // SP 0x140415460, MP 0x14052B750 + { 0x83FA, "_meth_83FA" }, // SP 0x1402443F0, MP 0x14030B9F0 + { 0x83FB, "_meth_83FB" }, // SP 0x140244F00, MP 0x14030BD20 + { 0x83FC, "_meth_83FC" }, // SP 0x140245540, MP 0x14030C510 + { 0x83FD, "_meth_83FD" }, // SP 0x140245610, MP 0x14030C680 + { 0x83FE, "_meth_83FE" }, // SP 0x14025F060 + { 0x83FF, "_meth_83FF" }, // SP 0x1401FB850 + { 0x8400, "_meth_8400" }, // SP 0x1402408E0, MP 0x140321F90 + { 0x8401, "_meth_8401" }, // SP 0x140240620 + { 0x8402, "_meth_8402" }, // SP 0x1401FA470 + { 0x8403, "_meth_8403" }, // MP 0x1404309B0 + { 0x8404, "_meth_8404" }, // SP 0x140210AE0 + { 0x8405, "_meth_8405" }, // SP 0x14021A5C0 + { 0x8406, "_meth_8406" }, // SP 0x140240860 + { 0x8407, "_meth_8407" }, // SP 0x140240B60 + { 0x8408, "_meth_8408" }, // SP 0x140243680 + { 0x8409, "_meth_8409" }, // MP 0x140328200 + { 0x840A, "_meth_840A" }, // SP 0x140219EA0 + { 0x840B, "_meth_840B" }, // SP 0x140219EF0 + { 0x840C, "_meth_840C" }, // MP 0x1402E66D0 + { 0x840D, "_meth_840D" }, // MP 0x1402E66E0 + { 0x840E, "_meth_840E" }, // MP 0x1402E66F0 + { 0x840F, "_meth_840F" }, // SP 0x14025B8A0 + { 0x8410, "_meth_8410" }, // SP 0x14025A4D0 + { 0x8411, "_meth_8411" }, // SP 0x14025A510 + { 0x8412, "_meth_8412" }, // SP 0x1402655E0, MP 0x140334160 + { 0x8413, "_meth_8413" }, // SP 0x140265690, MP 0x140334210 + { 0x8414, "_meth_8414" }, // SP 0x140265740, MP 0x1403342C0 + { 0x8415, "_meth_8415" }, // SP 0x1402657D0, MP 0x140334350 + { 0x8416, "_meth_8416" }, // SP 0x140265890, MP 0x140334410 + { 0x8417, "_meth_8417" }, // SP 0x140265920, MP 0x1403344A0 + { 0x8418, "_meth_8418" }, // MP 0x140319270 + { 0x8419, "_meth_8419" }, // MP 0x1403193D0 + { 0x841A, "_meth_841A" }, // MP 0x14032E6E0 + { 0x841B, "_meth_841B" }, // MP 0x14032E700 + { 0x841C, "_meth_841C" }, // MP 0x1402E6700 + { 0x841D, "_meth_841D" }, // MP 0x140316950 + { 0x841E, "_meth_841E" }, // MP 0x140316D50 + { 0x841F, "_meth_841F" }, // MP 0x14032E7B0 + { 0x8420, "_meth_8420" }, // MP 0x140321C50 + { 0x8421, "_meth_8421" }, // MP 0x140322190 + { 0x8422, "_meth_8422" }, // MP 0x14030B3C0 + { 0x8423, "_meth_8423" }, // MP 0x14030B800 + { 0x8424, "_meth_8424" }, // SP 0x1402424C0, MP 0x140322600 + { 0x8425, "_meth_8425" }, // MP 0x1402E6900 + { 0x8426, "_meth_8426" }, // SP 0x140248A10, MP 0x140313420 + { 0x8427, "_meth_8427" }, // SP 0x140248EF0, MP 0x1403136F0 + { 0x8428, "_meth_8428" }, // MP 0x1404054F0 + { 0x8429, "_meth_8429" }, // SP 0x140264670 + { 0x842A, "_meth_842A" }, // SP 0x140264840 + { 0x842B, "_meth_842B" }, // SP 0x1402648E0 + { 0x842C, "_meth_842C" }, // MP 0x14032D980 + { 0x842D, "_meth_842D" }, // SP 0x140260510 + { 0x842E, "_meth_842E" }, // MP 0x14032A3B0 + { 0x842F, "_meth_842F" }, // MP 0x14032AFD0 + { 0x8430, "_meth_8430" }, // MP 0x1403283A0 + { 0x8431, "_meth_8431" }, // MP 0x1402E5E50 + { 0x8432, "_meth_8432" }, // MP 0x1402E87A0 + { 0x8433, "_meth_8433" }, // SP 0x140217960, MP 0x1402DF8E0 + { 0x8434, "_meth_8434" }, // SP 0x140217A10, MP 0x1402DFA60 + { 0x8435, "_meth_8435" }, // SP 0x140219B00 + { 0x8436, "_meth_8436" }, // SP 0x14024E610, MP 0x1403190C0 + { 0x8437, "_meth_8437" }, // MP 0x140431DA0 + { 0x8438, "_meth_8438" }, // MP 0x14032FE50 + { 0x8439, "_meth_8439" }, // SP 0x140213F30, MP 0x1402E3D80 + { 0x843A, "_meth_843A" }, // MP 0x1402E6BC0 + { 0x843B, "_meth_843B" }, // MP 0x1402E6BB0 + { 0x843C, "_meth_843C" }, // SP 0x14024D160, MP 0x14031B6F0 + { 0x843D, "_meth_843D" }, // MP 0x1403291E0 + { 0x843E, "_meth_843E" }, // SP 0x1401FC160 + { 0x843F, "_meth_843F" }, // SP 0x1401FC200 + { 0x8440, "_meth_8440" }, // SP 0x140212390, MP 0x1402E1B80 + { 0x8441, "_meth_8441" }, // SP 0x1401FC630 + { 0x8442, "_meth_8442" }, // SP 0x140247D40, MP 0x140310FB0 + { 0x8443, "_meth_8443" }, // MP 0x1402DDF40 + { 0x8444, "_meth_8444" }, // SP 0x140413DA0, MP 0x140528300 + { 0x8445, "_meth_8445" }, // SP 0x140417B70, MP 0x14052BFF0 + { 0x8446, "_meth_8446" }, // SP 0x14024D420, MP 0x140317AF0 + { 0x8447, "_meth_8447" }, // SP 0x1402126D0, MP 0x1402E2710 + { 0x8448, "_meth_8448" }, // SP 0x14025D360 + { 0x8449, "_meth_8449" }, // SP 0x14025D3A0 + { 0x844A, "_meth_844A" }, // SP 0x14024EF50, MP 0x140319B60 + { 0x844B, "_meth_844B" }, // MP 0x14030C040 + { 0x844C, "_meth_844C" }, // MP 0x14030C190 + { 0x844D, "_meth_844D" }, // SP 0x1402152B0, MP 0x1402DC8F0 + { 0x844E, "_meth_844E" }, // SP 0x14023F230, MP 0x14031EDF0 + { 0x844F, "_meth_844F" }, // SP 0x14023FC50, MP 0x14031FD30 + { 0x8450, "_meth_8450" }, // SP 0x140413420, MP 0x14052C170 + { 0x8451, "_meth_8451" }, // SP 0x140413440, MP 0x14052C190 + { 0x8452, "_meth_8452" }, // SP 0x140413460, MP 0x14052C1B0 + { 0x8453, "_meth_8453" }, // SP 0x140413480, MP 0x14052C1D0 + { 0x8454, "_meth_8454" }, // SP 0x140261210 + { 0x8455, "_meth_8455" }, // SP 0x140261250 + { 0x8456, "_meth_8456" }, // SP 0x140417C30, MP 0x14052C0B0 + { 0x8457, "_meth_8457" }, // SP 0x1402166C0, MP 0x1402DE140 + { 0x8458, "_meth_8458" }, // SP 0x1402152F0 + { 0x8459, "_meth_8459" }, // SP 0x1402616F0 + { 0x845A, "_meth_845A" }, // empty + { 0x845B, "_meth_845B" }, // empty + { 0x845C, "_meth_845C" }, // SP 0x140247440, MP 0x14030F1E0 + { 0x845D, "_meth_845D" }, // SP 0x1402127F0, MP 0x1402E2160 + { 0x845E, "_meth_845E" }, // MP 0x140318810 + { 0x845F, "_meth_845F" }, // MP 0x140318F70 + { 0x8460, "_meth_8460" }, // empty + { 0x8461, "_meth_8461" }, // SP 0x14024E9D0, MP 0x140319600 + { 0x8462, "_meth_8462" }, // MP 0x140328E70 + { 0x8463, "_meth_8463" }, // MP 0x140328EC0 + { 0x8464, "_meth_8464" }, // MP 0x1402FB470 + { 0x8465, "_meth_8465" }, // SP 0x140213F70, MP 0x1402E3DD0 + { 0x8466, "_meth_8466" }, // empty + { 0x8467, "_meth_8467" }, // SP 0x140250AC0, MP 0x14031C920 + { 0x8468, "_meth_8468" }, // SP 0x140216230 + { 0x8469, "_meth_8469" }, // MP 0x1402E02F0 + { 0x846A, "_meth_846A" }, // SP 0x140265D80, MP 0x140334E90 + { 0x846B, "_meth_846B" }, // SP 0x140265F30, MP 0x140335040 + { 0x846C, "_meth_846C" }, // SP 0x14024F690 + { 0x846D, "_meth_846D" }, // SP 0x14024FAB0 + { 0x846E, "_meth_846E" }, // SP 0x140250060 + { 0x846F, "_meth_846F" }, // SP 0x140250270 + { 0x8470, "_meth_8470" }, // SP 0x140250A20 + { 0x8471, "_meth_8471" }, // SP 0x1402155C0 + { 0x8472, "_meth_8472" }, // SP 0x14025CE20 + { 0x8473, "_meth_8473" }, // SP 0x140413500, MP 0x14052C250 + { 0x8474, "_meth_8474" }, // SP 0x140413540, MP 0x14052C290 + { 0x8475, "_meth_8475" }, // SP 0x1404135A0, MP 0x14052C2F0 + { 0x8476, "_meth_8476" }, // SP 0x1404135F0, MP 0x14052C340 + { 0x8477, "_meth_8477" }, // SP 0x140413610, MP 0x14052C360 + { 0x8478, "_meth_8478" }, // SP 0x140252200, MP 0x14031C170 + { 0x8479, "_meth_8479" }, // SP 0x140252430, MP 0x14031C590 + { 0x847A, "_meth_847A" }, // SP 0x140210B00, MP 0x1402E0390 + { 0x847B, "_meth_847B" }, // SP 0x14025CEA0 + { 0x847C, "_meth_847C" }, // SP 0x14025D040 + { 0x847D, "_meth_847D" }, // MP 0x1402E41C0 + { 0x847E, "_meth_847E" }, // MP 0x1402E43B0 + { 0x847F, "_meth_847F" }, // SP 0x140417120, MP 0x14052B4D0 + { 0x8480, "_meth_8480" }, // SP 0x1404171A0, MP 0x14052B550 + { 0x8481, "_meth_8481" }, // SP 0x140216950, MP 0x1402DE630 + { 0x8482, "_meth_8482" }, // SP 0x1402169A0, MP 0x1402DEB60 + { 0x8483, "_meth_8483" }, // SP 0x1402462A0, MP 0x14030FBD0 + { 0x8484, "_meth_8484" }, // SP 0x140252730 + { 0x8485, "_meth_8485" }, // SP 0x140215D90, MP 0x1402DCEF0 + { 0x8486, "_meth_8486" }, // SP 0x140215BA0, MP 0x1402DCD60 + { 0x8487, "_meth_8487" }, // MP 0x1404045E0 + { 0x8488, "_meth_8488" }, // SP 0x1404153F0, MP 0x1405297E0 + { 0x8489, "_meth_8489" }, // SP 0x1404134B0, MP 0x14052C200 + { 0x848A, "_meth_848A" }, // MP 0x140403EF0 + { 0x848B, "_meth_848B" }, // MP 0x140334A40 + { 0x848C, "_meth_848C" }, // SP 0x140264710 + { 0x848D, "_meth_848D" }, // SP 0x140215A90, MP 0x1402DCC10 + { 0x848E, "_meth_848E" }, // SP 0x140415470, MP 0x140529860 + { 0x848F, "_meth_848F" }, // MP 0x1405297F0 + { 0x8490, "_meth_8490" }, // SP 0x140211290, MP 0x1402E0A90 + { 0x8491, "_meth_8491" }, // SP 0x140211570, MP 0x1402E0BC0 + { 0x8492, "_meth_8492" }, // SP 0x140211640, MP 0x1402E0CF0 + { 0x8493, "_meth_8493" }, // SP 0x140219490 + { 0x8494, "_meth_8494" }, // SP 0x140252620, MP 0x14031C840 + { 0x8495, "_meth_8495" }, // MP 0x140329C80 + { 0x8496, "finishentitydamage" }, + { 0x8497, "_meth_8497" }, // SP 0x140261570 + { 0x8498, "_meth_8498" }, // SP 0x140261690 + { 0x8499, "_meth_8499" }, // SP 0x14021A310 + { 0x849A, "_meth_849A" }, // MP 0x14032E850 + { 0x849B, "_meth_849B" }, // MP 0x140328DD0 + { 0x849C, "_meth_849C" }, // SP 0x140213960, MP 0x1402E3680 + { 0x849D, "_meth_849D" }, // SP 0x140213D30, MP 0x1402E3BF0 + { 0x849E, "_meth_849E" }, // SP 0x1402157F0, MP 0x1402DCB40 + { 0x849F, "_meth_849F" }, // MP 0x14032E8C0 + { 0x84A0, "_meth_84A0" }, // MP 0x14032EAB0 + { 0x84A1, "_meth_84A1" }, // MP 0x14032EC40 + { 0x84A2, "_meth_84A2" }, // MP 0x14032EF70 + { 0x84A3, "_meth_84A3" }, // MP 0x14032F290 + { 0x84A4, "_meth_84A4" }, // MP 0x14032F960 + { 0x84A5, "_meth_84A5" }, // MP 0x14032F4C0 + { 0x84A6, "_meth_84A6" }, // MP 0x140327B20 + { 0x84A7, "_meth_84A7" }, // MP 0x140327F80 + { 0x84A8, "_meth_84A8" }, // MP 0x14032FEF0 + { 0x84A9, "_meth_84A9" }, // SP 0x140249520, MP 0x140312340 + { 0x84AA, "_meth_84AA" }, // SP 0x140249910, MP 0x140312C40 + { 0x84AB, "_meth_84AB" }, // SP 0x140249CE0, MP 0x140312E80 + { 0x84AC, "_meth_84AC" }, // SP 0x14024A4A0, MP 0x140313860 + { 0x84AD, "_meth_84AD" }, // SP 0x140416070, MP 0x14052A560 + { 0x84AE, "_meth_84AE" }, // SP 0x140241420, MP 0x140321790 + { 0x84AF, "_meth_84AF" }, // SP 0x140241920, MP 0x140321A50 + { 0x84B0, "_meth_84B0" }, // SP 0x1402162A0, MP 0x1402DDA50 + { 0x84B1, "_meth_84B1" }, // SP 0x1404167F0, MP 0x14052AC50 + { 0x84B2, "_meth_84B2" }, // SP 0x1404168F0, MP 0x14052AD50 + { 0x84B3, "_meth_84B3" }, // MP 0x1402E6C20 + { 0x84B4, "_meth_84B4" }, // MP 0x140310840 + { 0x84B5, "_meth_84B5" }, // SP 0x140252CA0, MP 0x14031CBF0 + { 0x84B6, "_meth_84B6" }, // SP 0x140252F80, MP 0x14031CF20 + { 0x84B7, "_meth_84B7" }, // SP 0x140253980, MP 0x14031D2F0 + { 0x84B8, "_meth_84B8" }, // SP 0x140253B60, MP 0x14031D300 + { 0x84B9, "_meth_84B9" }, // MP 0x1403104C0 + { 0x84BA, "_meth_84BA" }, // MP 0x140317430 + { 0x84BB, "_meth_84BB" }, // SP 0x1404159E0, MP 0x140529E00 + { 0x84BC, "_meth_84BC" }, // SP 0x14024A130, MP 0x140313510 + { 0x84BD, "_meth_84BD" }, // MP 0x140334BE0 + { 0x84BE, "_meth_84BE" }, // MP 0x1403204E0 + { 0x84BF, "_meth_84BF" }, // SP 0x140210E30, MP 0x1402E0A30 + { 0x84C0, "_meth_84C0" }, // SP 0x140211060, MP 0x1402E0B60 + { 0x84C1, "_meth_84C1" }, // MP 0x1402E6CA0 + { 0x84C2, "_meth_84C2" }, // MP 0x1402E7060 + { 0x84C3, "_meth_84C3" }, // SP 0x140211C20, MP 0x1402E13F0 + { 0x84C4, "_meth_84C4" }, // SP 0x140212040, MP 0x1402E17A0 + { 0x84C5, "_meth_84C5" }, // MP 0x1403290C0 + { 0x84C6, "_meth_84C6" }, // SP 0x140248BE0, MP 0x140312710 + { 0x84C7, "_meth_84C7" }, // SP 0x140413650, MP 0x14052C3A0 + { 0x84C8, "_meth_84C8" }, // MP 0x140406E30 + { 0x84C9, "_meth_84C9" }, // MP 0x140406A70 + { 0x84CA, "_meth_84CA" }, // SP 0x140214970, MP 0x1402E46B0 + { 0x84CB, "_meth_84CB" }, // SP 0x1402146F0 + { 0x84CC, "_meth_84CC" }, // SP 0x1402147E0 + { 0x84CD, "_meth_84CD" }, // SP 0x140415170, MP 0x140529560 + { 0x84CE, "_meth_84CE" }, // SP 0x140415200, MP 0x140529650 + { 0x84CF, "_meth_84CF" }, // SP 0x14024D040, MP 0x140317580 + { 0x84D0, "_meth_84D0" }, // SP 0x14024B7E0, MP 0x1403160C0 + { 0x84D1, "_meth_84D1" }, // SP 0x14024B9E0, MP 0x140316540 + { 0x84D2, "_meth_84D2" }, // SP 0x14024CE00, MP 0x1403172B0 + { 0x84D3, "_meth_84D3" }, // MP 0x1402E8A20 + { 0x84D4, "_meth_84D4" }, // SP 0x140413670, MP 0x14052C3C0 + { 0x84D5, "_meth_84D5" }, // SP 0x140249F30, MP 0x1403143D0 + { 0x84D6, "_meth_84D6" }, // SP 0x140249FC0, MP 0x1403145C0 + { 0x84D7, "_meth_84D7" }, // SP 0x140247490, MP 0x1403122F0 + { 0x84D8, "_meth_84D8" }, // SP 0x1402475C0, MP 0x1403123D0 + { 0x84D9, "_meth_84D9" }, // SP 0x140247740, MP 0x140312520 + { 0x84DA, "_meth_84DA" }, // SP 0x1402478B0, MP 0x140312BA0 + { 0x84DB, "_meth_84DB" }, // SP 0x140247900, MP 0x140312BF0 + { 0x84DC, "_meth_84DC" }, // SP 0x140247B10, MP 0x140312CB0 + { 0x84DD, "_meth_84DD" }, // SP 0x140247C60, MP 0x140312DF0 + { 0x84DE, "_meth_84DE" }, // SP 0x140247CE0, MP 0x140312FF0 + { 0x84DF, "_meth_84DF" }, // SP 0x14028A150 + { 0x84E0, "_meth_84E0" }, // SP 0x140213EE0, MP 0x1402E3D20 + { 0x84E1, "_meth_84E1" }, // SP 0x1402659E0, MP 0x140334560 + { 0x84E2, "_meth_84E2" }, // MP 0x14031B9E0 + { 0x84E3, "_meth_84E3" }, // SP 0x1401F92C0 + { 0x84E4, "_meth_84E4" }, // SP 0x140416CC0 + { 0x84E5, "_meth_84E5" }, // SP 0x1401F9310 + { 0x84E6, "_meth_84E6" }, // SP 0x1401F9380 + { 0x84E7, "_meth_84E7" }, // SP 0x140250FA0, MP 0x14031E3C0 + { 0x84E8, "_meth_84E8" }, // SP 0x14021F100, MP 0x1402EF8A0 + { 0x84E9, "_meth_84E9" }, // SP 0x1404136B0, MP 0x14052C400 + { 0x84EA, "_meth_84EA" }, // MP 0x14031A1A0 + { 0x84EB, "_meth_84EB" }, // SP 0x140211E70, MP 0x1402E1700 + { 0x84EC, "_meth_84EC" }, // SP 0x14023F470, MP 0x14031F000 + { 0x84ED, "_meth_84ED" }, // SP 0x14025D190 + { 0x84EE, "_meth_84EE" }, // MP 0x1400439D0 + { 0x84EF, "_meth_84EF" }, // MP 0x140317940 + { 0x84F0, "_meth_84F0" }, // empty + { 0x84F1, "_meth_84F1" }, // SP 0x140211230, MP 0x1402E0E70 + { 0x84F2, "_meth_84F2" }, // SP 0x140211360, MP 0x1402E0F20 + { 0x84F3, "_meth_84F3" }, // SP 0x14023B610 + { 0x84F4, "_meth_84F4" }, // SP 0x140243E30, MP 0x14030CD90 + { 0x84F5, "_meth_84F5" }, // SP 0x14024DF20, MP 0x14031C2A0 + { 0x84F6, "_meth_84F6" }, // SP 0x14023FDF0, MP 0x14030B1C0 + { 0x84F7, "_meth_84F7" }, // SP 0x140240FD0, MP 0x140322450 + { 0x84F8, "_meth_84F8" }, // SP 0x1402453B0, MP 0x14030C2F0 + { 0x84F9, "_meth_84F9" }, // SP 0x140414810, MP 0x140528BC0 + { 0x84FA, "_meth_84FA" }, // SP 0x140414920, MP 0x140528CF0 + { 0x84FB, "_meth_84FB" }, // SP 0x140251B50, MP 0x14031FB80 + { 0x84FC, "_meth_84FC" }, // SP 0x140252320, MP 0x140320180 + { 0x84FD, "_meth_84FD" }, // SP 0x140251270, MP 0x14031E7D0 + { 0x84FE, "_meth_84FE" }, // MP 0x14031EAB0 + { 0x84FF, "_meth_84FF" }, // MP 0x14031EBF0 + { 0x8500, "_meth_8500" }, // SP 0x1402516B0, MP 0x14031EDE0 + { 0x8501, "_meth_8501" }, // MP 0x14031EEB0 + { 0x8502, "_meth_8502" }, // MP 0x14031F190 + { 0x8503, "_meth_8503" }, // MP 0x14031F830 + { 0x8504, "_meth_8504" }, // SP 0x14024BF00, MP 0x140319DE0 + { 0x8505, "_meth_8505" }, // SP 0x14024FB30, MP 0x140319580 + { 0x8506, "_meth_8506" }, // MP 0x1402E8800 + { 0x8507, "_meth_8507" }, // MP 0x140329180 + { 0x8508, "_meth_8508" }, // MP 0x140329240 + { 0x8509, "_meth_8509" }, // SP 0x14024F410, MP 0x140318610 + { 0x850A, "_meth_850A" }, // SP 0x14024E920, MP 0x140317760 + { 0x850B, "_meth_850B" }, // MP 0x14032E9A0 + { 0x850C, "_meth_850C" }, // SP 0x140252E00, MP 0x140320830 + { 0x850D, "_meth_850D" }, // MP 0x140329BC0 + { 0x850E, "_meth_850E" }, // MP 0x14032E370 + { 0x850F, "_meth_850F" }, // MP 0x14032C510 + { 0x8510, "_meth_8510" }, // MP 0x14032AC40 + { 0x8511, "_meth_8511" }, // MP 0x1402E6A80 + { 0x8512, "_meth_8512" }, // SP 0x140261130 + { 0x8513, "_meth_8513" }, // SP 0x140211970, MP 0x1402E0E80 + { 0x8514, "_meth_8514" }, // SP 0x14021EAB0, MP 0x1402EF290 + { 0x8515, "_meth_8515" }, // MP 0x140328D20 + { 0x8516, "_meth_8516" }, // MP 0x14032DBF0 + { 0x8517, "_meth_8517" }, // MP 0x14032DCE0 + { 0x8518, "_meth_8518" }, // SP 0x1402472A0, MP 0x140312210 + { 0x8519, "_meth_8519" }, // SP 0x1402473E0, MP 0x140312280 + { 0x851A, "_meth_851A" }, // SP 0x140243700, MP 0x140321660 + { 0x851B, "_meth_851B" }, // SP 0x140214130, MP 0x1402E3EC0 + { 0x851C, "_meth_851C" }, // SP 0x140250160, MP 0x140319690 + { 0x851D, "_meth_851D" }, // SP 0x1404136E0, MP 0x140527C40 + { 0x851E, "_meth_851E" }, // SP 0x140413700, MP 0x140527C60 + { 0x851F, "_meth_851F" }, // SP 0x1402142D0, MP 0x1402E4400 + { 0x8520, "_meth_8520" }, // SP 0x140214540, MP 0x1402E4640 + { 0x8521, "_meth_8521" }, // SP 0x140242BF0, MP 0x140320AB0 + { 0x8522, "_meth_8522" }, // MP 0x14032C720 + { 0x8523, "_meth_8523" }, // SP 0x14021E220, MP 0x1402EEB60 + { 0x8524, "_meth_8524" }, // MP 0x140329390 + { 0x8525, "_meth_8525" }, // SP 0x14024CC20, MP 0x140317000 + { 0x8526, "_meth_8526" }, // SP 0x14024CC40, MP 0x140317020 + { 0x8527, "_meth_8527" }, // SP 0x140215370, MP 0x1402DCBC0 + { 0x8528, "_meth_8528" }, // SP 0x14024C260, MP 0x14031A0B0 + { 0x8529, "_meth_8529" }, // SP 0x14024AD20, MP 0x1403198A0 + { 0x852A, "_meth_852A" }, // SP 0x140265A60, MP 0x1403345E0 + { 0x852B, "_meth_852B" }, // SP 0x14023B310 + { 0x852C, "_meth_852C" }, // MP 0x1402E7D80 + { 0x852D, "_meth_852D" }, // MP 0x140404F00 + { 0x852E, "_meth_852E" }, // SP 0x140210A60 + { 0x852F, "_meth_852F" }, // MP 0x1402E5FE0 + { 0x8530, "_meth_8530" }, // MP 0x140317B50 + { 0x8531, "_meth_8531" }, // SP 0x14024E060, MP 0x140318C60 + { 0x8532, "_meth_8532" }, // MP 0x14032DE80 + { 0x8533, "_meth_8533" }, // MP 0x14032DFB0 + { 0x8534, "_meth_8534" }, // SP 0x14021EB20, MP 0x1402EF300 + { 0x8535, "_meth_8535" }, // MP 0x1402E6B00 + { 0x8536, "_meth_8536" }, // SP 0x140253150, MP 0x140320AA0 + { 0x8537, "_meth_8537" }, // SP 0x140240CE0, MP 0x14031EF00 + { 0x8538, "_meth_8538" }, // MP 0x1402E6A10 + { 0x8539, "_meth_8539" }, // MP 0x1402E5C10 + { 0x853A, "_meth_853A" }, // MP 0x14031F870 + { 0x853B, "_meth_853B" }, // MP 0x140329750 + { 0x853C, "_meth_853C" }, // MP 0x140406810 + { 0x853D, "_meth_853D" }, // MP 0x1404051D0 + { 0x853E, "_meth_853E" }, // MP 0x140406340 + { 0x853F, "_meth_853F" }, // MP 0x1402E72A0 + { 0x8540, "_meth_8540" }, // MP 0x140404C70 + { 0x8541, "_meth_8541" }, // MP 0x1404065C0 + { 0x8542, "_meth_8542" }, // MP 0x140405C60 + { 0x8543, "_meth_8543" }, // MP 0x140406400 + { 0x8544, "_meth_8544" }, // MP 0x140406230 + { 0x8545, "_meth_8545" }, // MP 0x140406650 + { 0x8546, "_meth_8546" }, // MP 0x1402E7DE0 + { 0x8547, "_meth_8547" }, // MP 0x140333550 + { 0x8548, "_meth_8548" }, // MP 0x140403FE0 + { 0x8549, "_meth_8549" }, // SP 0x1402527A0, MP 0x140320360 + { 0x854A, "_meth_854A" }, // SP 0x140215690, MP 0x1402DC850 + { 0x854B, "_meth_854B" }, // MP 0x140329830 + { 0x854C, "_meth_854C" }, // MP 0x140403F50 + { 0x854D, "_meth_854D" }, // SP 0x140242310, MP 0x14030C7B0 + { 0x854E, "_meth_854E" }, // SP 0x140252B90, MP 0x1403206B0 + { 0x854F, "_meth_854F" }, // MP 0x140329960 + { 0x8550, "_meth_8550" }, // MP 0x140328100 + { 0x8551, "_meth_8551" }, // MP 0x140405990 + { 0x8552, "_meth_8552" }, // MP 0x1402E70C0 + { 0x8553, "_meth_8553" }, // MP 0x1403335F0 + { 0x8554, "_meth_8554" }, // SP 0x14024C220, MP 0x140316A20 + { 0x8555, "_meth_8555" }, // SP 0x14024C9C0, MP 0x140316DB0 + { 0x8556, "_meth_8556" }, // MP 0x140406B50 + { 0x8557, "_meth_8557" }, // SP 0x140216590, MP 0x1402DE070 + { 0x8558, "_meth_8558" }, // MP 0x1402E7E40 + { 0x8559, "_meth_8559" }, // MP 0x140329BA0 + { 0x855A, "_meth_855A" }, // MP 0x140405AF0 + { 0x855B, "_meth_855B" }, // MP 0x1402E7240 + { 0x855C, "_meth_855C" }, // MP 0x14031A370 + { 0x855D, "_meth_855D" }, // MP 0x140406970 + { 0x855E, "_meth_855E" }, // MP 0x140405B60 + { 0x855F, "_meth_855F" }, // SP 0x140265D00, MP 0x140334E10 + { 0x8560, "_meth_8560" }, // MP 0x140320A90 + { 0x8561, "_meth_8561" }, // MP 0x140406C00 + { 0x8562, "_meth_8562" }, // MP 0x140328BF0 + { 0x8563, "_meth_8563" }, // MP 0x1404053E0 + { 0x8564, "_meth_8564" }, // MP 0x140406D20 + { 0x8565, "_meth_8565" }, // MP 0x14032C900 + { 0x8566, "_meth_8566" }, // MP 0x14032C9E0 + { 0x8567, "_meth_8567" }, // MP 0x140044360 + { 0x8568, "_meth_8568" }, // MP 0x140333680 + { 0x8569, "_meth_8569" }, // MP 0x1402E7130 + { 0x856A, "_meth_856A" }, // MP 0x1403294B0 + { 0x856B, "_meth_856B" }, // SP 0x14023F290, MP 0x140320B40 + { 0x856C, "_meth_856C" }, // MP 0x140333710 +}}; + +const std::array file_list +{{ + { 0x053D, "codescripts/delete" }, + { 0x053E, "codescripts/struct" }, + { 0x0540, "maps/mp/gametypes/_callbacksetup" }, + { 0xA4E5, "codescripts/character" }, + { 42214, "common_scripts/_artcommon" }, + { 42215, "common_scripts/_bcs_location_trigs" }, + { 42216, "common_scripts/_createfx" }, + { 42217, "common_scripts/_createfxmenu" }, + { 42218, "common_scripts/_destructible" }, + { 42219, "common_scripts/_dynamic_world" }, + { 42735, "maps/createart/mp_vlobby_room_art" }, + { 42736, "maps/createart/mp_vlobby_room_fog" }, + { 42737, "maps/createart/mp_vlobby_room_fog_hdr" }, + +}}; + +const std::array token_list +{{ + { 180, "CodeCallback_BulletHitEntity" }, + { 181, "CodeCallback_CodeEndGame" }, + { 182, "CodeCallback_EntityDamage" }, + { 183, "CodeCallback_EntityOutOfWorld" }, + { 185, "CodeCallback_HostMigration" }, + { 187, "CodeCallback_PartyMembers" }, + { 188, "CodeCallback_PlayerConnect" }, + { 189, "CodeCallback_PlayerDamage" }, + { 190, "CodeCallback_PlayerDisconnect" }, + { 191, "CodeCallback_PlayerGrenadeSuicide" }, + { 192, "CodeCallback_PlayerKilled" }, + { 193, "CodeCallback_PlayerLastStand" }, + { 194, "CodeCallback_PlayerMigrated" }, + { 195, "CodeCallback_StartGameType" }, + { 196, "CodeCallback_VehicleDamage" }, + { 221, "CreateStruct" }, + { 522, "InitStructs" }, + { 619, "main" }, + + { 1727, "AbortLevel" }, + { 6662, "callbackVoid" }, + + { 8192, "CodeCallback_GiveKillstreak" }, + { 32577, "SetDefaultCallbacks" }, + { 33531, "SetupCallbacks" }, + { 33542, "SetupDamageFlags" }, + { 36698, "struct" }, +}}; + +struct __init__ +{ + __init__() + { + static bool init = false; + if(init) return; + init = true; + + opcode_map.reserve(opcode_list.size()); + opcode_map_rev.reserve(opcode_list.size()); + function_map.reserve(function_list.size()); + function_map_rev.reserve(function_list.size()); + method_map.reserve(method_list.size()); + method_map_rev.reserve(method_list.size()); + file_map.reserve(file_list.size()); + file_map_rev.reserve(file_list.size()); + token_map.reserve(token_list.size()); + token_map_rev.reserve(token_list.size()); + + for(const auto& entry : opcode_list) + { + opcode_map.insert({ entry.key, entry.value }); + opcode_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : function_list) + { + function_map.insert({ entry.key, entry.value }); + function_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : method_list) + { + method_map.insert({ entry.key, entry.value }); + method_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : file_list) + { + file_map.insert({ entry.key, entry.value }); + file_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : token_list) + { + token_map.insert({ entry.key, entry.value }); + token_map_rev.insert({ utils::string::to_lower(entry.value), entry.key }); + } + } +}; + +__init__ _; + +} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/resolver.hpp b/src/s1/xsk/resolver.hpp new file mode 100644 index 00000000..54fb07f8 --- /dev/null +++ b/src/s1/xsk/resolver.hpp @@ -0,0 +1,33 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::s1 +{ + +class resolver +{ +public: + static auto opcode_id(const std::string& name) -> std::uint8_t; + static auto opcode_name(std::uint8_t id) -> std::string; + + static auto function_id(const std::string& name) -> std::uint16_t; + static auto function_name(std::uint16_t id) -> std::string; + + static auto method_id(const std::string& name) -> std::uint16_t; + static auto method_name(std::uint16_t id) -> std::string; + + static auto file_id(const std::string& name) -> std::uint16_t; + static auto file_name(std::uint16_t id) -> std::string; + + static auto token_id(const std::string& name) -> std::uint16_t; + static auto token_name(std::uint16_t id) -> std::string; + + static auto find_function(const std::string& name) -> bool; + static auto find_method(const std::string& name) -> bool; +}; + +} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/s1.cpp b/src/s1/xsk/s1.cpp new file mode 100644 index 00000000..e423d7c6 --- /dev/null +++ b/src/s1/xsk/s1.cpp @@ -0,0 +1,182 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "s1.hpp" + +namespace xsk::gsc::s1 +{ + +auto opcode_size(std::uint8_t id) -> std::uint32_t +{ + switch (opcode(id)) + { + case opcode::OP_Return: + case opcode::OP_BoolNot: + case opcode::OP_CastBool: + case opcode::OP_inequality: + case opcode::OP_GetThisthread: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_checkclearparams: + case opcode::OP_CastFieldObject: + case opcode::OP_End: + case opcode::OP_size: + case opcode::OP_EmptyArray: + case opcode::OP_bit_and: + case opcode::OP_less_equal: + case opcode::OP_voidCodepos: + case opcode::OP_ClearVariableField: + case opcode::OP_divide: + case opcode::OP_GetSelf: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_plus: + case opcode::OP_BoolComplement: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_inc: + case opcode::OP_clearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_endon: + case opcode::OP_greater_equal: + case opcode::OP_GetSelfObject: + case opcode::OP_SetVariableField: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_less: + case opcode::OP_GetGameRef: + case opcode::OP_waitFrame: + case opcode::OP_waittillFrameEnd: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_notify: + case opcode::OP_DecTop: + case opcode::OP_shift_left: + case opcode::OP_greater: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_minus: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_multiply: + case opcode::OP_mod: + case opcode::OP_GetGame: + case opcode::OP_waittill: + case opcode::OP_dec: + case opcode::OP_PreScriptCall: + case opcode::OP_GetAnim: + case opcode::OP_GetUndefined: + case opcode::OP_GetAnimObject: + case opcode::OP_GetLevelObject: + case opcode::OP_bit_ex_or: + case opcode::OP_equality: + case opcode::OP_ClearArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalArray: + case opcode::OP_vector: + case opcode::OP_bit_or: + case opcode::OP_AddArray: + case opcode::OP_waittillmatch2: + case opcode::OP_shift_right: + return 1; + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_CallBuiltinPointer: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_ScriptMethodChildThreadCallPointer: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_GetNegByte: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_EvalLocalArrayCached: + case opcode::OP_GetByte: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_GetAnimTree: + return 2; + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_GetUnsignedShort: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_GetBuiltinFunction: + case opcode::OP_jumpback: + case opcode::OP_GetBuiltinMethod: + case opcode::OP_waittillmatch: + case opcode::OP_GetNegUnsignedShort: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + case opcode::OP_JumpOnFalse: + case opcode::OP_endswitch: + return 3; + case opcode::OP_CallBuiltin: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_GetLocalFunction: + case opcode::OP_CallBuiltinMethod: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarMethodCall: + return 4; + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_GetFloat: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_switch: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + case opcode::OP_jump: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_GetInteger: + case opcode::OP_GetString: + case opcode::OP_GetIString: + return 5; + case opcode::OP_GetAnimation: + return 9; + case opcode::OP_GetVector: + return 13; + default: + throw std::runtime_error("Couldn't resolve instruction size for " + std::to_string(id)); + } +} + +} // namespace xsk::gsc::s1 diff --git a/src/s1/xsk/s1.hpp b/src/s1/xsk/s1.hpp new file mode 100644 index 00000000..2b7c1044 --- /dev/null +++ b/src/s1/xsk/s1.hpp @@ -0,0 +1,180 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "utils/xsk/utils.hpp" + +#include "assembler.hpp" +#include "disassembler.hpp" +#include "compiler.hpp" +#include "decompiler.hpp" +#include "resolver.hpp" + +namespace xsk::gsc::s1 +{ + +enum class opcode : std::uint8_t +{ + OP_SetNewLocalVariableFieldCached0 = 0x17, + OP_EvalSelfFieldVariable = 0x18, + OP_Return = 0x19, + OP_CallBuiltin0 = 0x1A, + OP_CallBuiltin1 = 0x1B, + OP_CallBuiltin2 = 0x1C, + OP_CallBuiltin3 = 0x1D, + OP_CallBuiltin4 = 0x1E, + OP_CallBuiltin5 = 0x1F, + OP_CallBuiltin = 0x20, + OP_BoolNot = 0x21, + OP_ScriptFarMethodThreadCall = 0x22, + OP_JumpOnTrueExpr = 0x23, + OP_SetLevelFieldVariableField = 0x24, + OP_CastBool = 0x25, + OP_EvalNewLocalArrayRefCached0 = 0x26, + OP_CallBuiltinPointer = 0x27, + OP_inequality = 0x28, + OP_GetThisthread = 0x29, + OP_ClearFieldVariable = 0x2A, + OP_GetFloat = 0x2B, + OP_SafeCreateVariableFieldCached = 0x2C, + OP_ScriptFarFunctionCall2 = 0x2D, + OP_ScriptFarFunctionCall = 0x2E, + OP_ScriptFarChildThreadCall = 0x2F, + OP_ClearLocalVariableFieldCached0 = 0x30, + OP_ClearLocalVariableFieldCached = 0x31, + OP_checkclearparams = 0x32, + OP_CastFieldObject = 0x33, + OP_End = 0x34, + OP_size = 0x35, + OP_EmptyArray = 0x36, + OP_bit_and = 0x37, + OP_less_equal = 0x38, + OP_voidCodepos = 0x39, + OP_ScriptMethodThreadCallPointer = 0x3A, + OP_endswitch = 0x3B, + OP_ClearVariableField = 0x3C, + OP_divide = 0x3D, + OP_ScriptFarMethodChildThreadCall = 0x3E, + OP_GetUnsignedShort = 0x3F, + OP_JumpOnTrue = 0x40, + OP_GetSelf = 0x41, + OP_ScriptFarThreadCall = 0x42, + OP_ScriptLocalThreadCall = 0x43, + OP_SetLocalVariableFieldCached0 = 0x44, + OP_SetLocalVariableFieldCached = 0x45, + OP_plus = 0x46, + OP_BoolComplement = 0x47, + OP_ScriptMethodCallPointer = 0x48, + OP_inc = 0x49, + OP_RemoveLocalVariables = 0x4A, + OP_JumpOnFalseExpr = 0x4B, + OP_switch = 0x4C, + OP_clearparams = 0x4D, + OP_EvalLocalVariableRefCached0 = 0x4E, + OP_EvalLocalVariableRefCached = 0x4F, + OP_ScriptLocalMethodCall = 0x50, + OP_EvalFieldVariable = 0x51, + OP_EvalFieldVariableRef = 0x52, + OP_GetString = 0x53, + OP_ScriptFunctionCallPointer = 0x54, + OP_EvalLevelFieldVariable = 0x55, + OP_GetVector = 0x56, + OP_endon = 0x57, + OP_greater_equal = 0x58, + OP_GetSelfObject = 0x59, + OP_SetAnimFieldVariableField = 0x5A, + OP_SetVariableField = 0x5B, + OP_ScriptLocalFunctionCall2 = 0x5C, + OP_ScriptLocalFunctionCall = 0x5D, + OP_EvalLocalArrayRefCached0 = 0x5E, + OP_EvalLocalArrayRefCached = 0x5F, + OP_GetFarFunction = 0x60, + OP_less = 0x61, + OP_GetGameRef = 0x62, + OP_waitFrame = 0x63, + OP_waittillFrameEnd = 0x64, + OP_SafeSetVariableFieldCached0 = 0x65, + OP_SafeSetVariableFieldCached = 0x66, + OP_ScriptMethodChildThreadCallPointer = 0x67, + OP_GetLevel = 0x68, + OP_notify = 0x69, + OP_DecTop = 0x6A, + OP_shift_left = 0x6B, + OP_ScriptLocalMethodThreadCall = 0x6C, + OP_ScriptLocalMethodChildThreadCall = 0x6D, + OP_greater = 0x6E, + OP_EvalLocalVariableCached0 = 0x6F, + OP_EvalLocalVariableCached1 = 0x70, + OP_EvalLocalVariableCached2 = 0x71, + OP_EvalLocalVariableCached3 = 0x72, + OP_EvalLocalVariableCached4 = 0x73, + OP_EvalLocalVariableCached5 = 0x74, + OP_EvalLocalVariableCached = 0x75, + OP_SafeSetWaittillVariableFieldCached = 0x76, + OP_jump = 0x77, + OP_ScriptThreadCallPointer = 0x78, + OP_GetZero = 0x79, + OP_wait = 0x7A, + OP_minus = 0x7B, + OP_SetSelfFieldVariableField = 0x7C, + OP_EvalNewLocalVariableRefCached0 = 0x7D, + OP_multiply = 0x7E, + OP_CreateLocalVariable = 0x7F, + OP_ScriptLocalChildThreadCall = 0x80, + OP_GetInteger = 0x81, + OP_mod = 0x82, + OP_EvalAnimFieldVariableRef = 0x83, + OP_GetBuiltinFunction = 0x84, + OP_GetGame = 0x85, + OP_waittill = 0x86, + OP_dec = 0x87, + OP_EvalLocalVariableObjectCached = 0x88, + OP_PreScriptCall = 0x89, + OP_GetAnim = 0x8A, + OP_GetUndefined = 0x8B, + OP_EvalLevelFieldVariableRef = 0x8C, + OP_GetAnimObject = 0x8D, + OP_GetLevelObject = 0x8E, + OP_bit_ex_or = 0x8F, + OP_equality = 0x90, + OP_ClearArray = 0x91, + OP_jumpback = 0x92, + OP_GetAnimation = 0x93, + OP_EvalAnimFieldVariable = 0x94, + OP_GetAnimTree = 0x95, + OP_GetIString = 0x96, + OP_EvalArrayRef = 0x97, + OP_EvalSelfFieldVariableRef = 0x98, + OP_GetNegByte = 0x99, + OP_GetBuiltinMethod = 0x9A, + OP_CallBuiltinMethodPointer = 0x9B, + OP_EvalArray = 0x9C, + OP_vector = 0x9D, + OP_ScriptFarMethodCall = 0x9E, + OP_EvalLocalArrayCached = 0x9F, + OP_GetByte = 0xA0, + OP_ScriptChildThreadCallPointer = 0xA1, + OP_bit_or = 0xA2, + OP_AddArray = 0xA3, + OP_waittillmatch2 = 0xA4, + OP_waittillmatch = 0xA5, + OP_GetLocalFunction = 0xA6, + OP_GetNegUnsignedShort = 0xA7, + OP_shift_right = 0xA8, + OP_CallBuiltinMethod0 = 0xA9, + OP_CallBuiltinMethod1 = 0xAA, + OP_CallBuiltinMethod2 = 0xAB, + OP_CallBuiltinMethod3 = 0xAC, + OP_CallBuiltinMethod4 = 0xAD, + OP_CallBuiltinMethod5 = 0xAE, + OP_CallBuiltinMethod = 0xAF, + OP_JumpOnFalse = 0xB0, + OP_Count = 0xB1, +}; + +auto opcode_size(std::uint8_t op) -> std::uint32_t; + +} // namespace xsk::gsc::s1 diff --git a/src/s2/stdafx.cpp b/src/s2/stdafx.cpp new file mode 100644 index 00000000..0f0f08c2 --- /dev/null +++ b/src/s2/stdafx.cpp @@ -0,0 +1,6 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" diff --git a/src/s2/stdafx.hpp b/src/s2/stdafx.hpp new file mode 100644 index 00000000..6a7958bc --- /dev/null +++ b/src/s2/stdafx.hpp @@ -0,0 +1,38 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +// Warnings +#ifdef _WIN32 +#pragma warning(disable:4244) +#pragma warning(disable:4267) +#pragma warning(disable:4005) +#pragma warning(disable:4065) +#define _CRT_SECURE_NO_WARNINGS +#endif + +// C/C++ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Ext +using namespace std::literals; + +#include "xsk/s2.hpp" diff --git a/src/s2/xsk/assembler.cpp b/src/s2/xsk/assembler.cpp new file mode 100644 index 00000000..f42f495d --- /dev/null +++ b/src/s2/xsk/assembler.cpp @@ -0,0 +1,605 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "s2.hpp" + +namespace xsk::gsc::s2 +{ + +auto assembler::output_script() -> std::vector +{ + std::vector script; + + if(script_ == nullptr) return script; + + script.resize(script_->pos()); + memcpy(script.data(), script_->buffer().data(), script.size()); + + return script; +} + +auto assembler::output_stack() -> std::vector +{ + std::vector stack; + + if(stack_ == nullptr) return stack; + + stack.resize(stack_->pos()); + memcpy(stack.data(), stack_->buffer().data(), stack.size()); + + return stack; +} + +void assembler::assemble(const std::string& file, std::vector& data) +{ + std::vector assembly = utils::string::clean_buffer_lines(data); + std::vector functions; + gsc::function_ptr func = nullptr; + std::uint32_t index = 1; + std::uint16_t switchnum = 0; + + for (auto& line : assembly) + { + if (line == "" || line.substr(0, 2) == "//") + { + continue; + } + else if (line.substr(0, 4) == "sub_") + { + func = std::make_unique(); + func->index = index; + func->name = line.substr(4); + } + else if (line.substr(0, 4) == "end_") + { + if (func != nullptr) + { + func->size = index - func->index; + functions.push_back(std::move(func)); + } + } + else if (line.substr(0, 4) == "loc_") + { + func->labels[index] = line; + } + else + { + auto data = utils::string::parse_code(line); + + if (switchnum) + { + if (data[0] == "case" || data[0] == "default") + { + for (auto& entry : data) + { + func->instructions.back()->data.push_back(entry); + } + switchnum--; + continue; + } + + throw gsc::asm_error("invalid instruction inside endswitch \""s + line + "\"!"); + } + else + { + auto inst = std::make_unique(); + inst->index = index; + inst->opcode = static_cast(resolver::opcode_id(data[0])); + inst->size = opcode_size(inst->opcode); + data.erase(data.begin()); + inst->data = std::move(data); + + if (opcode(inst->opcode) == opcode::OP_endswitch) + { + switchnum = static_cast(std::stoul(inst->data[0])); + inst->size += 7 * switchnum; + } + + index += inst->size; + func->instructions.push_back(std::move(inst)); + } + } + } + + this->assemble(file, functions); +} + +void assembler::assemble(const std::string& file, std::vector& functions) +{ + script_ = std::make_unique(0x100000); + stack_ = std::make_unique(0x100000); + filename_ = file; + functions_ = std::move(functions); + + script_->write(static_cast(opcode::OP_End)); + stack_->write(0x69773630); + + for (const auto& func : functions_) + { + this->assemble_function(func); + } +} + +void assembler::assemble_function(const gsc::function_ptr& func) +{ + labels_ = func->labels; + + stack_->write(func->size); + + func->id = func->name.substr(0, 3) == "_ID" ? std::stoul(func->name.substr(3)) : resolver::token_id(func->name); + stack_->write(func->id); + + if (func->id == 0) + { + stack_->write_c_string(func->name); + } + + for (const auto& inst : func->instructions) + { + this->assemble_instruction(inst); + } +} + +void assembler::assemble_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_Return: + case opcode::OP_BoolNot: + case opcode::OP_CastBool: + case opcode::OP_inequality: + case opcode::OP_GetThisthread: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_checkclearparams: + case opcode::OP_CastFieldObject: + case opcode::OP_End: + case opcode::OP_size: + case opcode::OP_EmptyArray: + case opcode::OP_bit_and: + case opcode::OP_less_equal: + case opcode::OP_voidCodepos: + case opcode::OP_ClearVariableField: + case opcode::OP_divide: + case opcode::OP_GetSelf: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_plus: + case opcode::OP_BoolComplement: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_inc: + case opcode::OP_clearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_endon: + case opcode::OP_greater_equal: + case opcode::OP_GetSelfObject: + case opcode::OP_SetVariableField: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_less: + case opcode::OP_GetGameRef: + case opcode::OP_waitFrame: + case opcode::OP_waittillFrameEnd: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_notify: + case opcode::OP_DecTop: + case opcode::OP_shift_left: + case opcode::OP_greater: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_minus: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_multiply: + case opcode::OP_mod: + case opcode::OP_GetGame: + case opcode::OP_waittill: + case opcode::OP_dec: + case opcode::OP_PreScriptCall: + case opcode::OP_GetAnim: + case opcode::OP_GetUndefined: + case opcode::OP_GetAnimObject: + case opcode::OP_GetLevelObject: + case opcode::OP_bit_ex_or: + case opcode::OP_equality: + case opcode::OP_ClearArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalArray: + case opcode::OP_vector: + case opcode::OP_bit_or: + case opcode::OP_AddArray: + case opcode::OP_waittillmatch2: + case opcode::OP_shift_right: + case opcode::OP_BoolNotAfterAnd: + script_->write(static_cast(inst->opcode)); + break; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetInteger: + script_->write(static_cast(inst->opcode)); + script_->write(std::stoi(inst->data[0])); + break; + case opcode::OP_GetFloat: + script_->write(static_cast(inst->opcode)); + script_->write(std::stof(inst->data[0])); + break; + case opcode::OP_GetVector: + script_->write(static_cast(inst->opcode)); + script_->write(std::stof(inst->data[0])); + script_->write(std::stof(inst->data[1])); + script_->write(std::stof(inst->data[2])); + break; + case opcode::OP_GetString: + case opcode::OP_GetIString: + script_->write(static_cast(inst->opcode)); + script_->write(0); + stack_->write_c_string(utils::string::to_code(inst->data[0])); + break; + case opcode::OP_GetAnimation: + script_->write(static_cast(inst->opcode)); + script_->write(0); + script_->write(0); + stack_->write_c_string(utils::string::unquote(inst->data[0])); + stack_->write_c_string(utils::string::unquote(inst->data[1])); + break; + case opcode::OP_GetAnimTree: + script_->write(static_cast(inst->opcode)); + script_->write(0); + stack_->write_c_string(utils::string::unquote(inst->data[0])); + break; + case opcode::OP_waittillmatch: + script_->write(static_cast(inst->opcode)); + script_->write(0); + break; + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_EvalLocalArrayCached: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + this->assemble_field_variable(inst); + break; + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + this->assemble_local_call(inst, false); + break; + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + this->assemble_local_call(inst, true); + break; + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + this->assemble_far_call(inst, false); + break; + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + this->assemble_far_call(inst, true); + break; + case opcode::OP_CallBuiltin: + this->assemble_builtin_call(inst, false, true); + break; + case opcode::OP_CallBuiltinMethod: + this->assemble_builtin_call(inst, true, true); + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + this->assemble_builtin_call(inst, false, false); + break; + case opcode::OP_GetBuiltinMethod: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + this->assemble_builtin_call(inst, true, false); + break; + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + this->assemble_jump(inst, true, false); + break; + case opcode::OP_jumpback: + this->assemble_jump(inst, false, true); + break; + case opcode::OP_jump: + this->assemble_jump(inst, false, false); + break; + case opcode::OP_switch: + this->assemble_switch(inst); + break; + case opcode::OP_endswitch: + this->assemble_end_switch(inst); + break; + default: + throw gsc::asm_error(utils::string::va("Unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); + } +} + +void assembler::assemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num) +{ + script_->write(static_cast(inst->opcode)); + + std::uint16_t id = 0; + + if (arg_num) + { + script_->write(static_cast(std::stol(inst->data[0]))); + + if (method) + id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::method_id(inst->data[1]); + else + id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::function_id(inst->data[1]); + } + else + { + if (method) + id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::method_id(inst->data[0]); + else + id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::function_id(inst->data[0]); + } + + script_->write(id); +} + +void assembler::assemble_local_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_function(inst->data[0]); + + std::int32_t offset = addr - inst->index - 1; + + this->assemble_offset(offset); + + if (thread) + { + script_->write(static_cast(std::stol(inst->data[1]))); + } +} + +void assembler::assemble_far_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->write(static_cast(inst->opcode)); + script_->write(0); + script_->write(0); + + std::uint16_t file_id = 0; + std::uint16_t func_id = 0; + + if (thread) + { + script_->write(static_cast(std::stol(inst->data[0]))); + + file_id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::file_id(inst->data[1]); + func_id = inst->data[2].substr(0, 3) == "_ID" ? std::stol(inst->data[2].substr(3)) : resolver::token_id(inst->data[2]); + } + else + { + file_id = inst->data[0].substr(0, 3) == "_ID" ? std::stol(inst->data[0].substr(3)) : resolver::file_id(inst->data[0]); + func_id = inst->data[1].substr(0, 3) == "_ID" ? std::stol(inst->data[1].substr(3)) : resolver::token_id(inst->data[1]); + } + + stack_->write(file_id); + if (file_id == 0) stack_->write_c_string(thread ? inst->data[1] : inst->data[0]); + stack_->write(func_id); + if (func_id == 0) stack_->write_c_string(thread ? inst->data[2] : inst->data[1]); +} + +void assembler::assemble_switch(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_label(inst->data[0]); + + script_->write(addr - inst->index - 4); +} + +void assembler::assemble_end_switch(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::uint16_t casenum = 0; + + if (utils::string::is_number(inst->data[0])) + { + casenum = std::stol(inst->data[0]); + } + else + { + throw gsc::asm_error("invalid endswitch number!"); + } + + script_->write(casenum); + + std::uint32_t internal_index = inst->index + 3; + + for (std::uint16_t i = 0; i < casenum; i++) + { + if (inst->data[1 + (3 * i)] == "case") + { + if (utils::string::is_number(inst->data[1 + (3 * i) + 1])) + { + script_->write((std::stol(inst->data[1 + (3 * i) + 1]) & 0xFFFFFF) + 0x800000); + } + else + { + script_->write(i + 1); + stack_->write_c_string(utils::string::unquote(inst->data[1 + (3 * i) + 1])); + } + + internal_index += 4; + + std::int32_t addr = this->resolve_label(inst->data[1 + (3 * i) + 2]); + + this->assemble_offset(addr - internal_index); + + internal_index += 3; + } + else if (inst->data[1 + (3 * i)] == "default") + { + script_->write(0); + stack_->write_c_string("\x01"); + + internal_index += 4; + std::int32_t addr = this->resolve_label(inst->data[1 + (3 * i) + 1]); + + this->assemble_offset(addr - internal_index); + + internal_index += 3; + } + } +} + +void assembler::assemble_field_variable(const gsc::instruction_ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + std::uint16_t field_id = 0; + + if (inst->data[0].substr(0, 3) == "_ID") + { + field_id = (std::uint16_t)std::stol(inst->data[0].substr(3)); + } + else + { + field_id = resolver::token_id(inst->data[0]); + + if (field_id == 0) + { + field_id = 0xFFFF; + } + } + + script_->write(field_id); + + if (field_id > 0xACEE) + { + stack_->write(0); + stack_->write_c_string(inst->data[0]); + } +} + +void assembler::assemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back) +{ + script_->write(static_cast(inst->opcode)); + + std::int32_t addr = this->resolve_label(inst->data[0]); + + if (expr) + { + script_->write(addr - inst->index - 3); + } + else if (back) + { + script_->write((inst->index + 3) - addr); + } + else + { + script_->write(addr - inst->index - 5); + } +} + +void assembler::assemble_offset(std::int32_t offset) +{ + std::array bytes = {}; + + offset = (offset << 8) >> 8; + + *reinterpret_cast(bytes.data()) = offset; + + script_->write(bytes[0]); + script_->write(bytes[1]); + script_->write(bytes[2]); +} + +auto assembler::resolve_function(const std::string& name) -> std::uint32_t +{ + auto temp = name.substr(0, 4) == "sub_" ? name.substr(4) : name; + + for (const auto& func : functions_) + { + if (func->name == temp) + { + return func->index; + } + } + + throw gsc::asm_error("Couldn't resolve local function address of '" + temp + "'!"); +} + +auto assembler::resolve_label(const std::string& name) -> std::uint32_t +{ + for (auto& func : labels_) + { + if (func.second == name) + { + return func.first; + } + } + + throw gsc::asm_error("Couldn't resolve label address of '" + name + "'!"); +} + +} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/assembler.hpp b/src/s2/xsk/assembler.hpp new file mode 100644 index 00000000..eb17cd18 --- /dev/null +++ b/src/s2/xsk/assembler.hpp @@ -0,0 +1,40 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::s2 +{ + +class assembler : public gsc::assembler +{ + std::string filename_; + utils::byte_buffer_ptr script_; + utils::byte_buffer_ptr stack_; + std::vector functions_; + std::unordered_map labels_; + +public: + auto output_script() -> std::vector; + auto output_stack() -> std::vector; + void assemble(const std::string& file, std::vector& data); + void assemble(const std::string& file, std::vector& functions); + +private: + void assemble_function(const gsc::function_ptr& func); + void assemble_instruction(const gsc::instruction_ptr& inst); + void assemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num); + void assemble_local_call(const gsc::instruction_ptr& inst, bool thread); + void assemble_far_call(const gsc::instruction_ptr& inst, bool thread); + void assemble_switch(const gsc::instruction_ptr& inst); + void assemble_end_switch(const gsc::instruction_ptr& inst); + void assemble_field_variable(const gsc::instruction_ptr& inst); + void assemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back); + void assemble_offset(std::int32_t offset); + auto resolve_function(const std::string& name) -> std::uint32_t; + auto resolve_label(const std::string& name) -> std::uint32_t; +}; + +} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/compiler.cpp b/src/s2/xsk/compiler.cpp new file mode 100644 index 00000000..4ac46583 --- /dev/null +++ b/src/s2/xsk/compiler.cpp @@ -0,0 +1,2295 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "s2.hpp" +#include "parser.hpp" +#include "lexer.hpp" + +namespace xsk::gsc::s2 +{ + +auto compiler::output() -> std::vector +{ + return std::move(assembly_); +} + +void compiler::compile(const std::string& file, std::vector& data) +{ + filename_ = file; + + auto result = parse_buffer(filename_, data); + + compile_program(result); +} + +void compiler::set_readf_callback(std::function(const std::string&)> func) +{ + callback_readf_ = func; +} + +auto compiler::parse_buffer(const std::string& file, std::vector& data) -> gsc::program_ptr +{ + yyscan_t scanner; + gsc::location loc; + gsc::program_ptr result(nullptr); + + loc.initialize(&file); + // Add the two NULL terminators, required by flex. + data.push_back(0); + data.push_back(0); + + if (s2_lex_init(&scanner)) + exit(1); + + YY_BUFFER_STATE yybuffer = s2__scan_buffer(reinterpret_cast(data.data()), data.size(), scanner); + + parser parser(scanner, loc, result); + + if(parser.parse() || result == nullptr) + { + throw gsc::comp_error(loc, "An unknown error ocurred while parsing gsc file."); + } + + s2__delete_buffer(yybuffer, scanner); + s2_lex_destroy(scanner); + + return result; +} + +auto compiler::parse_file(const std::string& file) -> gsc::program_ptr +{ + auto buffer = callback_readf_(file); + auto result = parse_buffer(file, buffer); + + return result; +} + +void compiler::compile_program(const gsc::program_ptr& program) +{ + assembly_.clear(); + includes_.clear(); + animtrees_.clear(); + constants_.clear(); + local_functions_.clear(); + index_ = 1; + + for(const auto& def : program->definitions) + { + if(def.as_node->type == gsc::node_t::thread) + { + local_functions_.push_back(def.as_thread->name->value); + } + } + + for(const auto& include : program->includes) + { + emit_include(include); + } + + for(const auto& def : program->definitions) + { + emit_define(def); + } + +#ifdef DEBUG_GSC_COMPILER + print_debug_info(); +#endif +} + +void compiler::emit_include(const gsc::include_ptr& include) +{ + const auto& path = include->file->value; + + for(const auto& inc : includes_) + { + if(inc.name == path) + { + throw gsc::comp_error(include->loc, "error duplicated include file '" + path + "'."); + } + } + + if(map_known_includes(path)) return; + + try + { + auto program = parse_file(path); + + std::vector funcs; + + for(const auto& def : program->definitions) + { + if(def.as_node->type == gsc::node_t::thread) + { + funcs.push_back(def.as_thread->name->value); + } + } + + if(funcs.size() == 0) + { + throw gsc::comp_error(include->loc, "error empty include file '" + path + "'."); + } + + includes_.push_back(include_t(path, funcs)); + } + catch(const std::exception& e) + { + throw gsc::comp_error(include->loc, "error parsing include file '" + path + "': " + e.what()); + } +} + +void compiler::emit_define(const gsc::define_ptr& define) +{ + switch(define.as_node->type) + { + case gsc::node_t::usingtree: emit_usingtree(define.as_usingtree); break; + case gsc::node_t::constant: emit_constant(define.as_constant); break; + case gsc::node_t::thread: emit_thread(define.as_thread); break; + default: break; + } +} + +void compiler::emit_usingtree(const gsc::usingtree_ptr& animtree) +{ + animtrees_.push_back({ animtree->animtree->value, false }); +} + +void compiler::emit_constant(const gsc::constant_ptr& constant) +{ + constants_.insert({ constant->name->value, std::move(constant->value) }); +} + +void compiler::emit_thread(const gsc::thread_ptr& thread) +{ + function_ = std::make_unique(); + function_->index = index_; + function_->name = thread->name->value; + + auto ctx = std::make_unique(); + stack_idx_ = 0; + label_idx_ = 0; + can_break_ = false; + can_continue_ = false; + local_stack_.clear(); + break_ctxs_.clear(); + continue_ctxs_.clear(); + + process_thread(ctx, thread); + + emit_parameters(ctx, thread->params); + emit_stmt_list(ctx, thread->block, true); + emit_opcode(ctx, opcode::OP_End); + + function_->size = index_ - function_->index; + assembly_.push_back(std::move(function_)); +} + +void compiler::emit_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + initialize_variable(ctx, param); + emit_opcode(ctx, opcode::OP_SafeCreateVariableFieldCached, variable_create_index(ctx, param)); + } + + emit_opcode(ctx, opcode::OP_checkclearparams); +} + +void compiler::emit_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt, bool last) +{ + switch(stmt.as_node->type) + { + case gsc::node_t::stmt_list: emit_stmt_list(ctx, stmt.as_list, last); break; + case gsc::node_t::stmt_call: emit_stmt_call(ctx, stmt.as_call); break; + case gsc::node_t::stmt_assign: emit_stmt_assign(ctx, stmt.as_assign); break; + case gsc::node_t::stmt_endon: emit_stmt_endon(ctx, stmt.as_endon); break; + case gsc::node_t::stmt_notify: emit_stmt_notify(ctx, stmt.as_notify); break; + case gsc::node_t::stmt_wait: emit_stmt_wait(ctx, stmt.as_wait); break; + case gsc::node_t::stmt_waittill: emit_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_waittillmatch: emit_stmt_waittillmatch(ctx, stmt.as_waittillmatch); break; + case gsc::node_t::stmt_waittillframeend: emit_stmt_waittillframeend(ctx, stmt.as_waittillframeend); break; + case gsc::node_t::stmt_waitframe: emit_stmt_waitframe(ctx, stmt.as_waitframe); break; + case gsc::node_t::stmt_if: emit_stmt_if(ctx, stmt.as_if, last); break; + case gsc::node_t::stmt_ifelse: emit_stmt_ifelse(ctx, stmt.as_ifelse, last); break; + case gsc::node_t::stmt_while: emit_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: emit_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: emit_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: emit_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_case: emit_stmt_case(ctx, stmt.as_case); break; + case gsc::node_t::stmt_default: emit_stmt_default(ctx, stmt.as_default); break; + case gsc::node_t::stmt_break: emit_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_continue: emit_stmt_continue(ctx, stmt.as_continue); break; + case gsc::node_t::stmt_return: emit_stmt_return(ctx, stmt.as_return); break; + default: break; + } +} + +void compiler::emit_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt, bool last) +{ + for (const auto& entry : stmt->stmts) + { + bool last_ = (&entry == &stmt->stmts.back() && last) ? true : false; + emit_stmt(ctx, entry, last_); + } +} + +void compiler::emit_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt) +{ + if(stmt->expr->func.as_node->type == gsc::node_t::expr_call_function) + { + const auto& name = stmt->expr->func.as_func->name->value; + + if(name == "assert" || name == "assertex" || name == "assertmsg") return; + } + + emit_expr_call(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_DecTop); +} + +void compiler::emit_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt) +{ + emit_expr_assign(ctx, stmt->expr); +} + +void compiler::emit_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_endon); +} + +void compiler::emit_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt) +{ + emit_opcode(ctx, opcode::OP_voidCodepos); + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + emit_expr(ctx, arg); + } + + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_notify); +} + +void compiler::emit_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_wait); +} + +void compiler::emit_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_waittill); + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + create_variable(ctx, arg.as_name); + emit_opcode(ctx, opcode::OP_SafeSetWaittillVariableFieldCached, variable_access_index(ctx, arg.as_name)); + } + + emit_opcode(ctx, opcode::OP_clearparams); +} + +void compiler::emit_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt) +{ + emit_expr_arguments(ctx, stmt->args); + emit_expr(ctx, stmt->expr); + emit_expr(ctx, stmt->obj); + emit_opcode(ctx, opcode::OP_waittillmatch); + emit_opcode(ctx, opcode::OP_clearparams); +} + +void compiler::emit_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt) +{ + emit_opcode(ctx, opcode::OP_waittillFrameEnd); +} + +void compiler::emit_stmt_waitframe(const gsc::context_ptr& ctx, const gsc::stmt_waitframe_ptr& stmt) +{ + emit_opcode(ctx, opcode::OP_waitFrame); +} + +void compiler::emit_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt, bool last) +{ + auto end_loc = create_label(); + + if(stmt->expr.as_node->type == gsc::node_t::expr_not) + { + emit_expr(ctx, stmt->expr.as_not->rvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrue, end_loc); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, end_loc); + } + + ctx->transfer(stmt->ctx); + stmt->ctx->is_last = last; + + emit_stmt(stmt->ctx, stmt->stmt, last); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_remove_local_vars(stmt->ctx); + + insert_label(end_loc); +} + +void compiler::emit_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt, bool last) +{ + std::vector childs; + auto else_loc = create_label(); + auto end_loc = create_label(); + + if(stmt->expr.as_node->type == gsc::node_t::expr_not) + { + emit_expr(ctx, stmt->expr.as_not->rvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrue, else_loc); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, else_loc); + } + + ctx->transfer(stmt->ctx_if); + stmt->ctx_if->is_last = last; + + emit_stmt(stmt->ctx_if, stmt->stmt_if, last); + + emit_remove_local_vars(stmt->ctx_if); + + if(stmt->ctx_if->abort == abort_t::abort_none) + childs.push_back(stmt->ctx_if.get()); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_opcode(ctx, opcode::OP_jump, end_loc); + + insert_label(else_loc); + + ctx->transfer(stmt->ctx_else); + stmt->ctx_else->is_last = last; + + emit_stmt(stmt->ctx_else, stmt->stmt_else, last); + + last ? emit_opcode(ctx, opcode::OP_End) : emit_remove_local_vars(stmt->ctx_else); + + if(stmt->ctx_else->abort == abort_t::abort_none) + childs.push_back(stmt->ctx_else.get()); + + insert_label(end_loc); + + ctx->init_from_child(childs); +} + +void compiler::emit_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = true; + can_continue_ = true; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + + auto begin_loc = insert_label(); + + bool const_cond = is_constant_condition(stmt->expr); + + if(!const_cond) + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + } + + emit_stmt(stmt->ctx, stmt->stmt, false); + + insert_label(continue_loc); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + + if(const_cond) + ctx->init_from_child(break_ctxs_); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = false; + can_continue_ = false; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + emit_stmt(ctx, stmt->pre_expr, false); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + ctx->transfer(stmt->ctx_post); + + auto begin_loc = insert_label(); + + bool const_cond = is_constant_condition(stmt->expr); + + if(!const_cond) + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + } + + can_break_ = true; + can_continue_ = true; + + emit_stmt(stmt->ctx, stmt->stmt, false); + + if(stmt->ctx->abort == abort_t::abort_none) + continue_ctxs_.push_back(stmt->ctx.get()); + + can_break_ = false; + can_continue_ = false; + + insert_label(continue_loc); + + stmt->ctx_post->init_from_child(continue_ctxs_); + + emit_stmt(stmt->ctx_post, stmt->post_expr, false); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + + if(const_cond) + ctx->init_from_child(break_ctxs_); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + auto old_break = can_break_; + auto old_continue = can_continue_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + can_break_ = false; + can_continue_ = false; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + emit_expr(ctx, stmt->array_expr); + emit_variable_ref(ctx, stmt->array, true); + emit_variable(ctx, stmt->array); + emit_opcode(ctx, opcode::OP_CallBuiltin1, "getfirstarraykey"); + emit_variable_ref(ctx, stmt->key_expr, true); + + ctx->transfer(stmt->ctx); + stmt->ctx->loc_break = break_loc; + stmt->ctx->loc_continue = continue_loc; + + emit_create_local_vars(stmt->ctx); + + ctx->local_vars_create_count = stmt->ctx->local_vars_create_count; + + ctx->transfer(stmt->ctx_post); + + auto begin_loc = insert_label(); + + emit_variable(ctx, stmt->key_expr); + emit_opcode(ctx, opcode::OP_CallBuiltin1, "isdefined"); + emit_opcode(ctx, opcode::OP_JumpOnFalse, break_loc); + + can_break_ = true; + can_continue_ = true; + + emit_variable(stmt->ctx, stmt->key_expr); + emit_opcode(stmt->ctx, opcode::OP_EvalLocalArrayCached, variable_access_index(stmt->ctx, stmt->array.as_name)); + emit_variable_ref(stmt->ctx, stmt->value_expr, true); + emit_stmt(stmt->ctx, stmt->stmt, false); + + if(stmt->ctx->abort == abort_t::abort_none) + continue_ctxs_.push_back(stmt->ctx.get()); + + can_break_ = false; + can_continue_ = false; + + insert_label(continue_loc); + + stmt->ctx_post->init_from_child(continue_ctxs_); + + emit_variable(stmt->ctx_post, stmt->key_expr); + emit_variable(stmt->ctx_post, stmt->array); + emit_opcode(stmt->ctx_post, opcode::OP_CallBuiltin2, "getnextarraykey"); + emit_variable_ref(stmt->ctx_post, stmt->key_expr, true); + emit_opcode(ctx, opcode::OP_jumpback, begin_loc); + + insert_label(break_loc); + emit_clear_local_variable(ctx, stmt->array.as_name); + if(!stmt->use_key) emit_clear_local_variable(ctx, stmt->key_expr.as_name); + + can_break_ = old_break; + can_continue_ = old_continue; + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::emit_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + auto old_breaks = break_ctxs_; + auto old_break = can_break_; + break_ctxs_.clear(); + can_break_ = false; + + auto jmptable_loc = create_label(); + auto break_loc = create_label(); + + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_switch, jmptable_loc); + + can_break_ = true; + + std::vector data; + data.push_back(utils::string::va("%d", stmt->stmt->stmts.size())); + + bool has_default = false; + gsc::context* default_ctx = nullptr; + + for(auto i = 0; i < stmt->stmt->stmts.size(); i++) + { + auto& entry = stmt->stmt->stmts[i]; + + if(entry.as_node->type == gsc::node_t::stmt_case) + { + auto& case_ = entry.as_case; + if(case_->value.as_node->type == gsc::node_t::data_integer) + { + auto loc = insert_label(); + data.push_back("case"); + data.push_back(case_->value.as_integer->value); + data.push_back(loc); + } + else if(case_->value.as_node->type == gsc::node_t::data_string) + { + auto loc = insert_label(); + data.push_back("case"); + data.push_back(case_->value.as_string->value); + data.push_back(loc); + } + else + { + throw gsc::comp_error(stmt->loc, "case type must be int or string"); + } + + ctx->transfer(case_->ctx); + case_->ctx->loc_break = break_loc; + emit_stmt_list(case_->ctx, case_->stmt, false); + if(case_->stmt->stmts.size() > 0) + emit_remove_local_vars(case_->ctx); + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + auto loc = insert_label(); + data.push_back("default"); + data.push_back(loc); + + has_default = true; + default_ctx = entry.as_default->ctx.get(); + + ctx->transfer(entry.as_default->ctx); + entry.as_default->ctx->loc_break = break_loc; + emit_stmt_list(entry.as_default->ctx, entry.as_default->stmt, false); + if(entry.as_default->stmt->stmts.size() > 0) + emit_remove_local_vars(entry.as_default->ctx); + } + else + { + throw gsc::comp_error(entry.as_node->loc, "missing case statement"); + } + } + + if(has_default) + { + if(default_ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(default_ctx); + } + ctx->init_from_child(break_ctxs_); + } + + insert_label(jmptable_loc); + + emit_opcode(ctx, opcode::OP_endswitch, data); + + auto offset = 7 * stmt->stmt->stmts.size(); + function_->instructions.back()->size += offset; + index_ += offset; + + insert_label(break_loc); + + can_break_ = old_break; + break_ctxs_ = old_breaks; +} + +void compiler::emit_stmt_case(const gsc::context_ptr& ctx, const gsc::stmt_case_ptr& stmt) +{ + throw gsc::comp_error(stmt->loc, "illegal case statement"); +} + +void compiler::emit_stmt_default(const gsc::context_ptr& ctx, const gsc::stmt_default_ptr& stmt) +{ + throw gsc::comp_error(stmt->loc, "illegal default statement"); +} + +void compiler::emit_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + if(can_break_ && ctx->abort == abort_t::abort_none && ctx->loc_break != "") + { + break_ctxs_.push_back(ctx.get()); + emit_remove_local_vars(ctx); + ctx->abort = abort_t::abort_break; + emit_opcode(ctx, opcode::OP_jump, ctx->loc_break); + } + else + { + throw gsc::comp_error(stmt->loc, "illegal break statement"); + } +} + +void compiler::emit_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt) +{ + if(can_break_ && ctx->abort == abort_t::abort_none && ctx->loc_continue != "") + { + continue_ctxs_.push_back(ctx.get()); + emit_remove_local_vars(ctx); + ctx->abort = abort_t::abort_continue; + emit_opcode(ctx, opcode::OP_jump, ctx->loc_continue); + } + else + { + throw gsc::comp_error(stmt->loc, "illegal continue statement"); + } +} + +void compiler::emit_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + ctx->abort = abort_t::abort_return; + } + + if(stmt->expr.as_node->type == gsc::node_t::null) + { + emit_opcode(ctx, opcode::OP_End); + } + else + { + emit_expr(ctx, stmt->expr); + emit_opcode(ctx, opcode::OP_Return); + } +} + +void compiler::emit_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_and: emit_expr_and(ctx, expr.as_and); break; + case gsc::node_t::expr_or: emit_expr_or(ctx, expr.as_or); break; + case gsc::node_t::expr_equality: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_inequality: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less_equal: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater_equal: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_or: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_and: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_exor: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_left: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_right: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_add: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_sub: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mult: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_div: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mod: emit_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_complement: emit_expr_complement(ctx, expr.as_complement); break; + case gsc::node_t::expr_not: emit_expr_not(ctx, expr.as_not); break; + case gsc::node_t::expr_call: emit_expr_call(ctx, expr.as_call); break; + case gsc::node_t::expr_function: emit_expr_function(ctx, expr.as_function); break; + case gsc::node_t::expr_add_array: emit_expr_add_array(ctx, expr.as_add_array); break; + case gsc::node_t::expr_array: emit_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: emit_field_variable(ctx, expr.as_field); break; + case gsc::node_t::expr_size: emit_expr_size(ctx, expr.as_size); break; + case gsc::node_t::data_thisthread: emit_opcode(ctx, opcode::OP_GetThisthread); break; + case gsc::node_t::data_empty_array: emit_opcode(ctx, opcode::OP_EmptyArray); break; + case gsc::node_t::data_undefined: emit_opcode(ctx, opcode::OP_GetUndefined); break; + case gsc::node_t::data_game: emit_opcode(ctx, opcode::OP_GetGame); break; + case gsc::node_t::data_self: emit_opcode(ctx, opcode::OP_GetSelf); break; + case gsc::node_t::data_anim: emit_opcode(ctx, opcode::OP_GetAnim); break; + case gsc::node_t::data_level: emit_opcode(ctx, opcode::OP_GetLevel); break; + case gsc::node_t::data_animation: emit_animation(ctx, expr.as_animation); break; + case gsc::node_t::data_animtree: emit_animtree(ctx, expr.as_animtree); break; + case gsc::node_t::data_name: emit_local_variable(ctx, expr.as_name); break; + case gsc::node_t::data_istring: emit_istring(ctx, expr.as_istring); break; + case gsc::node_t::data_string: emit_string(ctx, expr.as_string); break; + case gsc::node_t::data_vector: emit_vector(ctx, expr.as_vector); break; + case gsc::node_t::data_float: emit_float(ctx, expr.as_float); break; + case gsc::node_t::data_integer: emit_integer(ctx, expr.as_integer); break; + case gsc::node_t::data_false: emit_false(ctx, expr.as_false); break; + case gsc::node_t::data_true: emit_true(ctx, expr.as_true); break; + default: throw gsc::comp_error(expr.as_node->loc, "unknown expression"); break; + } +} + +void compiler::emit_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr) +{ + if(expr->type == gsc::node_t::expr_increment) + { + emit_variable_ref(ctx, expr->lvalue, false); + emit_opcode(ctx, opcode::OP_inc); + emit_opcode(ctx, opcode::OP_SetVariableField); + } + else if(expr->type == gsc::node_t::expr_decrement) + { + emit_variable_ref(ctx, expr->lvalue, false); + emit_opcode(ctx, opcode::OP_dec); + emit_opcode(ctx, opcode::OP_SetVariableField); + } + else if(expr->type == gsc::node_t::expr_assign_equal) + { + if(expr->rvalue.as_node->type == gsc::node_t::data_undefined) + { + emit_expr_clear_variable(ctx, expr->lvalue); + } + else + { + emit_expr(ctx, expr->rvalue); + emit_variable_ref(ctx, expr->lvalue, true); + } + } + else + { + emit_expr(ctx, expr->lvalue); + emit_expr(ctx, expr->rvalue); + + switch(expr->type) + { + case gsc::node_t::expr_assign_add: emit_opcode(ctx, opcode::OP_plus); break; + case gsc::node_t::expr_assign_sub: emit_opcode(ctx, opcode::OP_minus); break; + case gsc::node_t::expr_assign_mult: emit_opcode(ctx, opcode::OP_multiply); break; + case gsc::node_t::expr_assign_div: emit_opcode(ctx, opcode::OP_divide); break; + case gsc::node_t::expr_assign_mod: emit_opcode(ctx, opcode::OP_mod); break; + case gsc::node_t::expr_assign_shift_left: emit_opcode(ctx, opcode::OP_shift_left); break; + case gsc::node_t::expr_assign_shift_right: emit_opcode(ctx, opcode::OP_shift_right); break; + case gsc::node_t::expr_assign_bitwise_or: emit_opcode(ctx, opcode::OP_bit_or); break; + case gsc::node_t::expr_assign_bitwise_and: emit_opcode(ctx, opcode::OP_bit_and); break; + case gsc::node_t::expr_assign_bitwise_exor: emit_opcode(ctx, opcode::OP_bit_ex_or); break; + default: throw gsc::comp_error(expr->loc, "unknown assign operation"); break; + } + + emit_variable_ref(ctx, expr->lvalue, true); + } +} + +void compiler::emit_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr) +{ + emit_expr(ctx, expr->lvalue); + emit_expr(ctx, expr->rvalue); + + switch(expr->type) + { + case gsc::node_t::expr_equality: emit_opcode(ctx, opcode::OP_equality); break; + case gsc::node_t::expr_inequality: emit_opcode(ctx, opcode::OP_inequality); break; + case gsc::node_t::expr_less: emit_opcode(ctx, opcode::OP_less); break; + case gsc::node_t::expr_greater: emit_opcode(ctx, opcode::OP_greater); break; + case gsc::node_t::expr_less_equal: emit_opcode(ctx, opcode::OP_less_equal); break; + case gsc::node_t::expr_greater_equal: emit_opcode(ctx, opcode::OP_greater_equal); break; + case gsc::node_t::expr_bitwise_or: emit_opcode(ctx, opcode::OP_bit_or); break; + case gsc::node_t::expr_bitwise_and: emit_opcode(ctx, opcode::OP_bit_and); break; + case gsc::node_t::expr_bitwise_exor: emit_opcode(ctx, opcode::OP_bit_ex_or); break; + case gsc::node_t::expr_shift_left: emit_opcode(ctx, opcode::OP_shift_left); break; + case gsc::node_t::expr_shift_right: emit_opcode(ctx, opcode::OP_shift_right); break; + case gsc::node_t::expr_add: emit_opcode(ctx, opcode::OP_plus); break; + case gsc::node_t::expr_sub: emit_opcode(ctx, opcode::OP_minus); break; + case gsc::node_t::expr_mult: emit_opcode(ctx, opcode::OP_multiply); break; + case gsc::node_t::expr_div: emit_opcode(ctx, opcode::OP_divide); break; + case gsc::node_t::expr_mod: emit_opcode(ctx, opcode::OP_mod); break; + default: throw gsc::comp_error(expr->loc, "unknown binary expression"); break; + } +} + +void compiler::emit_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr) +{ + auto label = create_label(); + + emit_expr(ctx, expr->lvalue); + emit_opcode(ctx, opcode::OP_JumpOnFalseExpr, label); + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_CastBool); + + insert_label(label); +} + +void compiler::emit_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr) +{ + auto label = create_label(); + + emit_expr(ctx, expr->lvalue); + emit_opcode(ctx, opcode::OP_JumpOnTrueExpr, label); + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_CastBool); + + insert_label(label); +} + +void compiler::emit_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr) +{ + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_BoolComplement); +} + +void compiler::emit_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr) +{ + emit_expr(ctx, expr->rvalue); + emit_opcode(ctx, opcode::OP_BoolNot); +} + +void compiler::emit_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + if(expr->func.as_node->type == gsc::node_t::expr_call_pointer) + { + emit_expr_call_pointer(ctx, expr); + } + else + { + emit_expr_call_function(ctx, expr); + } +} + +void compiler::emit_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + bool thread = expr->thread; + bool child = expr->child; + bool method = expr->obj.as_node->type != gsc::node_t::null ? true : false; + bool builtin = builtin = expr->func.as_pointer->builtin; + std::uint32_t args = expr->func.as_pointer->args->list.size(); + + if(thread && child || thread && builtin || child && builtin) + throw gsc::comp_error(expr->loc, "function call have more than 1 type (thread, childthread, builtin)"); + + if(!thread && !child && !builtin) emit_opcode(ctx, opcode::OP_PreScriptCall); + + emit_expr_arguments(ctx, expr->func.as_pointer->args); + + if(method) emit_expr(ctx, expr->obj); + + emit_expr(ctx, expr->func.as_pointer->expr); + emit_expr_call_pointer_type(ctx, args, builtin, method, thread, child); +} + +void compiler::emit_expr_call_pointer_type(const gsc::context_ptr& ctx, int args, bool builtin, bool method, bool thread, bool child) +{ + if(builtin && !method) + { + emit_opcode(ctx, opcode::OP_CallBuiltinPointer, utils::string::va("%d", args)); + } + else if(builtin && method) + { + emit_opcode(ctx, opcode::OP_CallBuiltinMethodPointer, utils::string::va("%d", args)); + } + else if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptThreadCallPointer, utils::string::va("%d", args)); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptMethodThreadCallPointer, utils::string::va("%d", args)); + } + else if (child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptChildThreadCallPointer, utils::string::va("%d", args)); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptMethodChildThreadCallPointer, utils::string::va("%d", args)); + } + else + { + method ? emit_opcode(ctx, opcode::OP_ScriptMethodCallPointer) : emit_opcode(ctx, opcode::OP_ScriptFunctionCallPointer); + } +} + +void compiler::emit_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + bool thread = expr->thread; + bool child = expr->child; + bool method = expr->obj.as_node->type != gsc::node_t::null ? true : false; + std::uint32_t args = expr->func.as_func->args->list.size(); + auto name = expr->func.as_func->name->value; + auto file = expr->func.as_func->file->value; + + bool builtin = false, far = false, local = false; + + if(file != "") far = true; + else + { + if(is_local_call(name)) local = true; + else if(method && is_builtin_method(name)) builtin = true; + else if(!method && is_builtin_func(name)) builtin = true; + else + { + for(const auto& inc : includes_) + { + for(const auto& fun : inc.funcs) + { + if(name == fun) + { + far = true; + file = inc.name; + break; + } + } + } + + if(!builtin && !far && !local) + throw gsc::comp_error(expr->loc, "unknown function call " + name); + } + } + + if(thread && child || thread && builtin || child && builtin) + throw gsc::comp_error(expr->loc, "function call have more than 1 type (thread, childthread, builtin)"); + + if(!thread && !child && !builtin && !(!method && args == 0)) + emit_opcode(ctx, opcode::OP_PreScriptCall); + + emit_expr_arguments(ctx, expr->func.as_func->args); + + if(method) emit_expr(ctx, expr->obj); + + if(builtin) emit_expr_call_function_builtin(ctx, name, args, method); + else if(local) emit_expr_call_function_local(ctx, name, args, method, thread, child); + else if(far) emit_expr_call_function_far(ctx, file, name, args, method, thread, child); +} + +void compiler::emit_expr_call_function_builtin(const gsc::context_ptr& ctx, const std::string& func, int args, bool method) +{ + if(method) + { + switch(args) + { + case 0: emit_opcode(ctx, opcode::OP_CallBuiltinMethod0, func); break; + case 1: emit_opcode(ctx, opcode::OP_CallBuiltinMethod1, func); break; + case 2: emit_opcode(ctx, opcode::OP_CallBuiltinMethod2, func); break; + case 3: emit_opcode(ctx, opcode::OP_CallBuiltinMethod3, func); break; + case 4: emit_opcode(ctx, opcode::OP_CallBuiltinMethod4, func); break; + case 5: emit_opcode(ctx, opcode::OP_CallBuiltinMethod5, func); break; + default: emit_opcode(ctx, opcode::OP_CallBuiltinMethod, { utils::string::va("%d", args), func }); break; + } + } + else + { + switch(args) + { + case 0: emit_opcode(ctx, opcode::OP_CallBuiltin0, func); break; + case 1: emit_opcode(ctx, opcode::OP_CallBuiltin1, func); break; + case 2: emit_opcode(ctx, opcode::OP_CallBuiltin2, func); break; + case 3: emit_opcode(ctx, opcode::OP_CallBuiltin3, func); break; + case 4: emit_opcode(ctx, opcode::OP_CallBuiltin4, func); break; + case 5: emit_opcode(ctx, opcode::OP_CallBuiltin5, func); break; + default: emit_opcode(ctx, opcode::OP_CallBuiltin, { utils::string::va("%d", args), func }); break; + } + } +} + +void compiler::emit_expr_call_function_local(const gsc::context_ptr& ctx, const std::string& func, int args, bool method, bool thread, bool child) +{ + if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalThreadCall, { func, utils::string::va("%d", args) }); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodThreadCall, { func, utils::string::va("%d", args) }); + } + else if(child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptLocalChildThreadCall, { func, utils::string::va("%d", args) }); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodChildThreadCall, { func, utils::string::va("%d", args) }); + } + else if(method && !thread && !child) + { + emit_opcode(ctx, opcode::OP_ScriptLocalMethodCall, func); + } + else if(!thread && !child && !method && args == 0) + { + emit_opcode(ctx, opcode::OP_ScriptLocalFunctionCall2, func); + } + else if(!thread && !child && !method && args != 0) + { + emit_opcode(ctx, opcode::OP_ScriptLocalFunctionCall, func); + } +} + +void compiler::emit_expr_call_function_far(const gsc::context_ptr& ctx, const std::string& file, const std::string& func, int args, bool method, bool thread, bool child) +{ + if(thread && !method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptFarThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(thread && method && !child) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(child && !method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptFarChildThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(child && method && !thread) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodChildThreadCall, { utils::string::va("%d", args), file, func }); + } + else if(!thread && !child && method) + { + emit_opcode(ctx, opcode::OP_ScriptFarMethodCall, { file, func }); + } + else if(!thread && !child && !method && args == 0) + { + emit_opcode(ctx, opcode::OP_ScriptFarFunctionCall2, { file, func }); + } + else if(!thread && !child && !method && args != 0) + { + emit_opcode(ctx, opcode::OP_ScriptFarFunctionCall, { file, func }); + } +} + +void compiler::emit_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& args) +{ + std::reverse(args->list.begin(), args->list.end()); + + for(auto& arg : args->list) + { + emit_expr(ctx, arg); + } +} + +void compiler::emit_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& expr) +{ + bool far = false, local = false, builtin = false, method = false; + auto name = expr->name->value; + auto file = expr->file->value; + + if(file != "") + { + far = true; + } + else if(is_builtin_method(name)) + { + builtin = true; + method = true; + } + else if(is_builtin_func(name)) + { + builtin = true; + } + else if(is_local_call(name)) + { + local = true; + } + + if(local) + { + emit_opcode(ctx, opcode::OP_GetLocalFunction, name); + } + else if(far) + { + emit_opcode(ctx, opcode::OP_GetFarFunction, { file, name } ); + } + else if(builtin && method) + { + emit_opcode(ctx, opcode::OP_GetBuiltinMethod, name); + } + else if(builtin && !method) + { + emit_opcode(ctx, opcode::OP_GetBuiltinFunction, name); + } +} + +void compiler::emit_expr_clear_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& lvalue) +{ + switch(lvalue.as_node->type) + { + case gsc::node_t::expr_array: + emit_expr(ctx, lvalue.as_array->key); + lvalue.as_array->obj.as_node->type == gsc::node_t::data_game ? emit_opcode(ctx, opcode::OP_GetGameRef) : emit_variable_ref(ctx, lvalue.as_array->obj, false); + emit_opcode(ctx, opcode::OP_ClearArray); + break; + case gsc::node_t::expr_field: + emit_object(ctx, lvalue.as_field->obj); + emit_opcode(ctx, opcode::OP_ClearFieldVariable,lvalue.as_field->field->value); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_GetUndefined); + emit_local_variable_ref(ctx, lvalue.as_name, true); + break; + default: + throw gsc::comp_error(lvalue.as_node->loc, "unknown clear variable lvalue"); + break; + } +} + +void compiler::emit_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr) +{ + if(expr->args->list.size() <= 0) + { + throw gsc::comp_error(expr->loc, "invalid empty add array. did u mean '[]' ?"); + } + + emit_opcode(ctx, opcode::OP_EmptyArray); + + for(const auto& arg : expr->args->list) + { + emit_expr(ctx, arg); + emit_opcode(ctx, opcode::OP_AddArray); + } +} + +void compiler::emit_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr) +{ + emit_variable(ctx, expr->obj); + emit_opcode(ctx, opcode::OP_size); +} + +void compiler::emit_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr, bool set) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_array: emit_array_variable_ref(ctx, expr.as_array, set); break; + case gsc::node_t::expr_field: emit_field_variable_ref(ctx, expr.as_field, set); break; + case gsc::node_t::data_name: emit_local_variable_ref(ctx, expr.as_name, set); break; + default: throw gsc::comp_error(expr.as_node->loc, "invalid variable reference type."); break; + } +} + +void compiler::emit_array_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr, bool set) +{ + emit_expr(ctx, expr->key); + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_game: + emit_opcode(ctx, opcode::OP_GetGameRef); + emit_opcode(ctx, opcode::OP_EvalArrayRef); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_array: + case gsc::node_t::expr_field: + emit_variable_ref(ctx, expr->obj, false); + emit_opcode(ctx, opcode::OP_EvalArrayRef); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::data_name: + { + if(!variable_initialized(ctx, expr->obj.as_name)) + { + initialize_variable(ctx, expr->obj.as_name); + emit_opcode(ctx, opcode::OP_EvalNewLocalArrayRefCached0, variable_create_index(ctx, expr->obj.as_name)); + + if(!set) + { + throw gsc::comp_error(expr->loc, "INTERNAL: VAR CREATED BUT NOT SET!"); + } + } + else if(variable_stack_index(ctx, expr->obj.as_name) == 0) + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayRefCached0); + } + else + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayRefCached, variable_access_index(ctx, expr->obj.as_name)); + } + + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + } + break; + case gsc::node_t::expr_call: + throw gsc::comp_error(expr->loc, "call result can't be referenced."); + break; + default: + throw gsc::comp_error(expr->loc, "unknown array object type"); + break; + } +} + +void compiler::emit_field_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr, bool set) +{ + const auto& field = expr->field->value; + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_level: + set ? emit_opcode(ctx, opcode::OP_SetLevelFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalLevelFieldVariableRef, field); + break; + case gsc::node_t::data_anim: + set ? emit_opcode(ctx, opcode::OP_SetAnimFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalAnimFieldVariableRef, field); + break; + case gsc::node_t::data_self: + set ? emit_opcode(ctx, opcode::OP_SetSelfFieldVariableField, field) : emit_opcode(ctx, opcode::OP_EvalSelfFieldVariableRef, field); + break; + case gsc::node_t::expr_array: + emit_array_variable(ctx, expr->obj.as_array); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_field: + emit_field_variable(ctx, expr->obj.as_field); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr->obj.as_name)); + emit_opcode(ctx, opcode::OP_EvalFieldVariableRef, field); + if(set) emit_opcode(ctx, opcode::OP_SetVariableField); + break; + case gsc::node_t::expr_call: + throw gsc::comp_error(expr->loc, "function call result can't be referenced"); + break; + default: + throw gsc::comp_error(expr->loc, "unknown field variable object type"); + break; + } +} + +void compiler::emit_local_variable_ref(const gsc::context_ptr& ctx, const gsc::name_ptr& expr, bool set) +{ + const auto itr = constants_.find(expr->value); + + if (itr != constants_.end()) + { + throw gsc::comp_error(expr->loc, "variable name already defined as constant " + expr->value); + } + + if(set) + { + if(!variable_initialized(ctx, expr)) + { + initialize_variable(ctx, expr); + emit_opcode(ctx, opcode::OP_SetNewLocalVariableFieldCached0, variable_create_index(ctx, expr)); + } + else if(variable_stack_index(ctx, expr) == 0) + { + emit_opcode(ctx, opcode::OP_SetLocalVariableFieldCached0); + } + else + { + emit_opcode(ctx, opcode::OP_SetLocalVariableFieldCached, variable_access_index(ctx, expr)); + } + } + else + { + auto index = variable_stack_index(ctx, expr); + + if(index == 0) + emit_opcode(ctx, opcode::OP_EvalLocalVariableRefCached0); + else + emit_opcode(ctx, opcode::OP_EvalLocalVariableRefCached, variable_access_index(ctx, expr)); + } +} + +void compiler::emit_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + // for obj.size + switch(expr.as_node->type) + { + case gsc::node_t::expr_array: emit_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: emit_field_variable(ctx, expr.as_field); break; + case gsc::node_t::data_name: emit_local_variable(ctx, expr.as_name); break; + case gsc::node_t::expr_call: emit_expr_call(ctx, expr.as_call); break; + default: throw gsc::comp_error(expr.as_node->loc, "invalid variable type."); break; + } +} + +void compiler::emit_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr) +{ + emit_expr(ctx, expr->key); + + if(expr->obj.as_node->type == gsc::node_t::data_name) + { + emit_opcode(ctx, opcode::OP_EvalLocalArrayCached, variable_access_index(ctx, expr->obj.as_name)); + } + else + { + emit_expr(ctx, expr->obj); + emit_opcode(ctx, opcode::OP_EvalArray); + } +} + +void compiler::emit_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr) +{ + const auto& field = expr->field->value; + + switch(expr->obj.as_node->type) + { + case gsc::node_t::data_level: + emit_opcode(ctx, opcode::OP_EvalLevelFieldVariable, field); + break; + case gsc::node_t::data_anim: + emit_opcode(ctx, opcode::OP_EvalAnimFieldVariable, field); + break; + case gsc::node_t::data_self: + emit_opcode(ctx, opcode::OP_EvalSelfFieldVariable, field); + break; + case gsc::node_t::expr_array: + emit_array_variable(ctx, expr->obj.as_array); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::expr_field: + emit_field_variable(ctx, expr->obj.as_field); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::expr_call: + emit_expr_call(ctx, expr->obj.as_call); + emit_opcode(ctx, opcode::OP_CastFieldObject); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr->obj.as_name)); + emit_opcode(ctx, opcode::OP_EvalFieldVariable, field); + break; + default: + throw gsc::comp_error(expr->loc, "unknown field variable object type"); + break; + } +} + +void compiler::emit_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + // is constant ( should only allow: string, loc string, number, vector) + const auto itr = constants_.find(expr->value); + + if (itr != constants_.end()) + { + const auto& value = itr->second; + emit_expr(ctx, value); + return; + } + + // is local var + auto index = variable_stack_index(ctx, expr); + + switch(index) + { + case 0: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached0); break; + case 1: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached1); break; + case 2: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached2); break; + case 3: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached3); break; + case 4: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached4); break; + case 5: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached5); break; + default: emit_opcode(ctx, opcode::OP_EvalLocalVariableCached, variable_access_index(ctx, expr)); break; + } +} + +void compiler::emit_clear_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + auto index = variable_stack_index(ctx, expr); + + if(index == 0) + { + emit_opcode(ctx, opcode::OP_ClearLocalVariableFieldCached0); + } + else + { + emit_opcode(ctx, opcode::OP_ClearLocalVariableFieldCached, variable_access_index(ctx, expr)); + } +} + +void compiler::emit_create_local_vars(const gsc::context_ptr& ctx) +{ + if ( ctx->local_vars_create_count != ctx->local_vars_public_count ) + { + for(auto i = ctx->local_vars_create_count; i < ctx->local_vars_public_count; i++) + { + auto data = utils::string::va("%d", ctx->local_vars.at(i).create); + emit_opcode(ctx, opcode::OP_CreateLocalVariable, data); + ctx->local_vars.at(i).init = true; + } + ctx->local_vars_create_count = ctx->local_vars_public_count; + } +} + +void compiler::emit_remove_local_vars(const gsc::context_ptr& ctx) +{ + if(ctx->abort == abort_t::abort_none) + { + auto count = ctx->local_vars_create_count - ctx->local_vars_public_count; + + if(count > 0) + { + auto data = utils::string::va("%d", count); + emit_opcode(ctx, opcode::OP_RemoveLocalVariables, data); + } + } +} + +void compiler::emit_object(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + // need revision used for clear variable + switch(expr.as_node->type) + { + case gsc::node_t::data_level: + emit_opcode(ctx, opcode::OP_GetLevelObject); + break; + case gsc::node_t::data_anim: + emit_opcode(ctx, opcode::OP_GetAnimObject); + break; + case gsc::node_t::data_self: + emit_opcode(ctx, opcode::OP_GetSelfObject); + break; + case gsc::node_t::data_name: + emit_opcode(ctx, opcode::OP_EvalLocalVariableObjectCached, variable_access_index(ctx, expr.as_name)); + break; + case gsc::node_t::expr_call: + emit_expr_call(ctx, expr.as_call); + emit_opcode(ctx, opcode::OP_CastFieldObject); + break; + // array ? + // field ? + default: + throw gsc::comp_error(expr.as_node->loc, "unknown object type"); + break; + } +} + +void compiler::emit_animtree(const gsc::context_ptr& ctx, const gsc::animtree_ptr& animtree) +{ + if(animtrees_.size() == 0) + { + throw gsc::comp_error( animtree->loc, "trying to use animtree without specified using animtree"); + } + + auto& tree = animtrees_.back(); + + if(tree.loaded) + { + emit_opcode(ctx, opcode::OP_GetAnimTree, "''"); + } + else + { + emit_opcode(ctx, opcode::OP_GetAnimTree, tree.name); + tree.loaded = true; + } +} + +void compiler::emit_animation(const gsc::context_ptr& ctx, const gsc::animation_ptr& animation) +{ + if(animtrees_.size() == 0) + { + throw gsc::comp_error(animation->loc, "trying to use animation without specified using animtree"); + } + + auto& tree = animtrees_.back(); + + if(tree.loaded) + { + emit_opcode(ctx, opcode::OP_GetAnimation, { "''", animation->value }); + } + else + { + emit_opcode(ctx, opcode::OP_GetAnimation, { tree.name, animation->value }); + tree.loaded = true; + } +} + +void compiler::emit_istring(const gsc::context_ptr& ctx, const gsc::istring_ptr& str) +{ + emit_opcode(ctx, opcode::OP_GetIString, str->value); +} + +void compiler::emit_string(const gsc::context_ptr& ctx, const gsc::string_ptr& str) +{ + emit_opcode(ctx, opcode::OP_GetString, str->value); +} + +void compiler::emit_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec) +{ + std::vector data; + + bool expr = false; + + if(vec->x.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->x.as_integer->value); + else if(vec->x.as_node->type == gsc::node_t::data_float) + data.push_back(vec->x.as_float->value); + else expr = true; + + if(vec->y.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->y.as_integer->value); + else if(vec->y.as_node->type == gsc::node_t::data_float) + data.push_back(vec->y.as_float->value); + else expr = true; + + if(vec->z.as_node->type == gsc::node_t::data_integer) + data.push_back(vec->z.as_integer->value); + else if(vec->z.as_node->type == gsc::node_t::data_float) + data.push_back(vec->z.as_float->value); + else expr = true; + + if(!expr) + { + emit_opcode(ctx, opcode::OP_GetVector, data); + } + else + { + emit_expr(ctx, vec->z); + emit_expr(ctx, vec->y); + emit_expr(ctx, vec->x); + emit_opcode(ctx, opcode::OP_vector); + } +} + +void compiler::emit_float(const gsc::context_ptr& ctx, const gsc::float_ptr& num) +{ + emit_opcode(ctx, opcode::OP_GetFloat, num->value); +} + +void compiler::emit_integer(const gsc::context_ptr& ctx, const gsc::integer_ptr& num) +{ + auto value = std::atoi(num->value.data()); + + if(value == 0) + { + emit_opcode(ctx, opcode::OP_GetZero); + } + else if(value > 0 && value < 256) + { + emit_opcode(ctx, opcode::OP_GetByte, num->value); + } + else if(value < 0 && value > -256) + { + emit_opcode(ctx, opcode::OP_GetNegByte, num->value.substr(1)); + } + else if(value < 65536) + { + emit_opcode(ctx, opcode::OP_GetUnsignedShort, num->value); + } + else if(value < 0 && value > -65536) + { + emit_opcode(ctx, opcode::OP_GetNegUnsignedShort, num->value.substr(1)); + } + else + { + emit_opcode(ctx, opcode::OP_GetInteger, num->value); + } +} + +void compiler::emit_false(const gsc::context_ptr& ctx, const gsc::false_ptr& expr) +{ + emit_opcode(ctx, opcode::OP_GetZero); +} + +void compiler::emit_true(const gsc::context_ptr& ctx, const gsc::true_ptr& expr) +{ + emit_opcode(ctx, opcode::OP_GetByte, "1"); +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + + index_ += inst->size; +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::string& data) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + inst->data.push_back(data); + + index_ += inst->size; +} + +void compiler::emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::vector& data) +{ + function_->instructions.push_back(std::make_unique()); + + auto& inst = function_->instructions.back(); + inst->opcode = static_cast(op); + inst->size = opcode_size(std::uint8_t(op)); + inst->index = index_; + inst->data = data; + + index_ += inst->size; +} + +void compiler::process_thread(const gsc::context_ptr& ctx, const gsc::thread_ptr& thread) +{ + process_parameters(ctx, thread->params); + process_stmt_list(ctx, thread->block); +} + +void compiler::process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + register_variable(ctx, param->value); + } +} + +void compiler::process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt) +{ + switch (stmt.as_node->type) + { + case gsc::node_t::stmt_list: process_stmt_list(ctx, stmt.as_list); break; + case gsc::node_t::stmt_assign: process_expr(ctx, stmt.as_assign->expr->lvalue); break; + case gsc::node_t::stmt_waittill: process_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_if: process_stmt_if(ctx, stmt.as_if); break; + case gsc::node_t::stmt_ifelse: process_stmt_ifelse(ctx, stmt.as_ifelse); break; + case gsc::node_t::stmt_while: process_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: process_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: process_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: process_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_break: process_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_continue: process_stmt_continue(ctx, stmt.as_continue); break; + case gsc::node_t::stmt_return: process_stmt_return(ctx, stmt.as_return); break; + default: break; + } +} + +void compiler::process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + for (const auto& entry : stmt->stmts) + { + process_stmt(ctx, entry); + } +} + +void compiler::process_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr) +{ + if(expr.as_node->type == gsc::node_t::data_name) + { + register_variable(ctx, expr.as_name->value); + } + else if(expr.as_node->type == gsc::node_t::expr_array) + { + process_expr(ctx, expr.as_array->obj); + } +} + +void compiler::process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); + + for(const auto& arg : stmt->args->list) + { + register_variable(ctx, arg.as_name->value); + } + + std::reverse(stmt->args->list.begin(), stmt->args->list.end()); +} + +void compiler::process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt) +{ + stmt->ctx = std::make_unique(); + + ctx->copy(stmt->ctx); + process_stmt(stmt->ctx, stmt->stmt); + + std::vector childs({ stmt->ctx.get() }); + ctx->merge(childs); +} + +void compiler::process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt) +{ + std::vector childs; + auto abort = abort_t::abort_return; + + stmt->ctx_if = std::make_unique(); + stmt->ctx_else = std::make_unique(); + + ctx->copy(stmt->ctx_if); + process_stmt(stmt->ctx_if, stmt->stmt_if); + + if(stmt->ctx_if->abort <= abort_t::abort_return) + { + abort = stmt->ctx_if->abort; + if(abort == abort_t::abort_none) + childs.push_back(stmt->ctx_if.get()); + } + + ctx->copy(stmt->ctx_else); + process_stmt(stmt->ctx_else, stmt->stmt_else); + + if(stmt->ctx_else->abort <= abort) + { + abort = stmt->ctx_else->abort; + if(abort == abort_t::abort_none) + childs.push_back(stmt->ctx_else.get()); + } + + if(ctx->abort == abort_t::abort_none) + ctx->abort = abort; + + ctx->append(childs); + ctx->merge(childs); +} + +void compiler::process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + bool const_cond = is_constant_condition(stmt->expr); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + stmt->ctx = std::make_unique(); + + ctx->copy(stmt->ctx); + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + if(const_cond) ctx->append(break_ctxs_); + + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + bool const_cond = is_constant_condition(stmt->expr); + + stmt->ctx = std::make_unique(); + stmt->ctx_post = std::make_unique(); + + process_stmt(ctx, stmt->pre_expr); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + ctx->copy(stmt->ctx); + ctx->copy(stmt->ctx_post); + + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + process_stmt(stmt->ctx_post, stmt->post_expr); + + ctx->append({ stmt->ctx_post.get() }); + ctx->merge({ stmt->ctx_post.get() }); + + if(const_cond) ctx->append(break_ctxs_); + + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + auto array_name = utils::string::va("temp_%d", ++label_idx_); + auto key_name = utils::string::va("temp_%d", ++label_idx_); + + stmt->array = expr_ptr(std::make_unique(stmt->loc, array_name)); + + if(!stmt->use_key) + stmt->key_expr = expr_ptr(std::make_unique(stmt->loc, key_name)); + + key_name = stmt->key_expr.as_name->value; + + // calculate variables + + stmt->ctx = std::make_unique(); + stmt->ctx_post = std::make_unique(); + + // calculate pre_expr variables + process_expr(ctx, stmt->array); + + auto old_breaks = break_ctxs_; + auto old_continues = continue_ctxs_; + break_ctxs_.clear(); + continue_ctxs_.clear(); + + ctx->copy(stmt->ctx); + ctx->copy(stmt->ctx_post); + + // calculate stmt variables & add missing array access as first stmt + process_expr(stmt->ctx, stmt->value_expr); + process_stmt(stmt->ctx, stmt->stmt); + + continue_ctxs_.push_back(stmt->ctx.get()); + + for(auto i = 0; i < continue_ctxs_.size(); i++) + ctx->append({continue_ctxs_.at(i)}); + + process_expr(stmt->ctx_post, stmt->key_expr); + + ctx->append({ stmt->ctx_post.get() }); + ctx->merge({ stmt->ctx_post.get() }); + ctx->merge({stmt->ctx.get()}); + + break_ctxs_ = old_breaks; + continue_ctxs_ = old_continues; +} + +void compiler::process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + auto stmt_list = std::make_unique(stmt->stmt->loc); + auto current_case = gsc::stmt_ptr(std::make_unique()); + + auto num = stmt->stmt->stmts.size(); + + for(auto i = 0; i < num; i++) + { + auto& entry = stmt->stmt->stmts[0]; + + if(entry.as_node->type == gsc::node_t::stmt_case || entry.as_node->type == gsc::node_t::stmt_default) + { + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + current_case = std::move(stmt->stmt->stmts[0]); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + else + { + if(current_case.as_node->type != gsc::node_t::null) + { + if(current_case.as_node->type == gsc::node_t::stmt_case) + { + current_case.as_case->stmt->stmts.push_back(std::move(entry)); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + else + { + current_case.as_default->stmt->stmts.push_back(std::move(entry)); + stmt->stmt->stmts.erase(stmt->stmt->stmts.begin()); + } + } + else + { + gsc::comp_error(entry.as_node->loc, "missing case statement"); + } + } + } + + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + // calculate variables + stmt->ctx = std::make_unique(); + std::vector childs; + auto abort = abort_t::abort_return; + bool has_default = false; + gsc::context* default_ctx = nullptr; + auto old_breaks = break_ctxs_; + break_ctxs_.clear(); + + for(auto i = 0; i < stmt_list->stmts.size(); i++) + { + auto& entry = stmt_list->stmts[i]; + + if(entry.as_node->type == gsc::node_t::stmt_case) + { + entry.as_case->ctx = std::make_unique(); + ctx->copy(entry.as_case->ctx); + process_stmt_list(entry.as_case->ctx, entry.as_case->stmt); + + if (entry.as_case->ctx->abort != abort_t::abort_none) + { + if (entry.as_case->ctx->abort == abort_t::abort_break ) + { + entry.as_case->ctx->abort = abort_t::abort_none; + abort = abort_t::abort_none; + childs.push_back(entry.as_case->ctx.get()); + } + else if (entry.as_case->ctx->abort <= abort ) + { + abort = entry.as_case->ctx->abort; + } + } + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + entry.as_default->ctx = std::make_unique(); + ctx->copy(entry.as_default->ctx); + process_stmt_list(entry.as_default->ctx, entry.as_default->stmt); + has_default = true; + default_ctx = entry.as_default->ctx.get(); + + if (entry.as_default->ctx->abort != abort_t::abort_none) + { + if (entry.as_default->ctx->abort == abort_t::abort_break ) + { + entry.as_default->ctx->abort = abort_t::abort_none; + abort = abort_t::abort_none; + childs.push_back(entry.as_default->ctx.get()); + } + else if (entry.as_default->ctx->abort <= abort ) + { + abort = entry.as_default->ctx->abort; + } + } + } + } + + stmt->stmt =std::move(stmt_list); + + if(has_default) + { + if(default_ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(default_ctx); + + if(ctx->abort == abort_t::abort_none) + ctx->abort = abort; + } + + ctx->append(break_ctxs_); + ctx->merge(childs); + } + + break_ctxs_ = old_breaks; +} + +void compiler::process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + break_ctxs_.push_back(ctx.get()); + ctx->abort = abort_t::abort_break; + } +} + +void compiler::process_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + continue_ctxs_.push_back(ctx.get()); + ctx->abort = abort_t::abort_continue; + } +} + +void compiler::process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(ctx->abort == abort_t::abort_none) + { + ctx->abort = abort_t::abort_return; + } +} + +void compiler::register_variable(const gsc::context_ptr& ctx, const std::string& name) +{ + auto it = std::find_if(ctx->local_vars.begin(), ctx->local_vars.end(), + [&](const gsc::local_var& v) { return v.name == name; }); + + if(it == ctx->local_vars.end()) + { + auto found = false; + for(std::size_t i = 0; i < local_stack_.size(); i++) + { + if(local_stack_[i] == name) + { + ctx->local_vars.push_back({ name, static_cast(i), false }); + found = true; + break; + } + } + + if(!found) + { + ctx->local_vars.push_back({ name, stack_idx_, false }); + local_stack_.push_back(name); + stack_idx_++; + } + } +} + +void compiler::initialize_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name) +{ + for(std::uint32_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(!ctx->local_vars[i].init) + { + for(std::uint32_t j = 0; j < i; j++) + { + if(!ctx->local_vars[j].init) + { + emit_opcode(ctx, opcode::OP_CreateLocalVariable, utils::string::va("%d", ctx->local_vars[j].create)); + ctx->local_vars[j].init = true; + //ctx->local_vars_create_count++; + } + } + ctx->local_vars[i].init = true; + ctx->local_vars_create_count = i + 1; + return; + } + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +void compiler::create_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name) +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + auto& var = ctx->local_vars.at(i); + if(var.name == name->value) + { + if(!var.init) + { + emit_opcode(ctx, opcode::OP_CreateLocalVariable, utils::string::va("%d", var.create)); + var.init = true; + ctx->local_vars_create_count++; + } + return; + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_stack_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::uint8_t +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(ctx->local_vars.at(i).init) + { + return ctx->local_vars_create_count - 1 - i; + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not initialized."); + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_create_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + return utils::string::va("%d", ctx->local_vars[i].create); + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_access_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + if(ctx->local_vars.at(i).init) + { + return utils::string::va("%d", ctx->local_vars_create_count - 1 - i); + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not initialized."); + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::variable_initialized(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> bool +{ + for(std::size_t i = 0; i < ctx->local_vars.size(); i++) + { + if(ctx->local_vars[i].name == name->value) + { + return ctx->local_vars.at(i).init; + } + } + + throw gsc::comp_error(name->loc, "local variable '" + name->value + "' not found."); +} + +auto compiler::is_local_call(const std::string& name) -> bool +{ + for(const auto& f : local_functions_) + { + if(f == name) return true; + } + + return false; +} + +auto compiler::is_builtin_call(const std::string& name) -> bool +{ + if(is_builtin_func(name)) return true; + + if(is_builtin_method(name)) return true; + + return false; +} + +auto compiler::is_builtin_func(const std::string& name) -> bool +{ + return resolver::find_function(name); +} +auto compiler::is_builtin_method(const std::string& name) -> bool +{ + return resolver::find_method(name); +} + +auto compiler::is_constant_condition(const gsc::expr_ptr& expr) -> bool +{ + switch(expr.as_node->type) + { + case gsc::node_t::null: + case gsc::node_t::data_true: + return true; + case gsc::node_t::data_false: + throw gsc::comp_error(expr.as_node->loc, "condition can't be always false!"); + case gsc::node_t::data_integer: + { + auto num = std::stoi(expr.as_integer->value); + if(num != 0) + return true; + else + throw gsc::comp_error(expr.as_node->loc, "condition can't be always false!"); + } + default: + break; + } + + return false; +} + +auto compiler::create_label() -> std::string +{ + label_idx_++; + auto name = utils::string::va("loc_%d", label_idx_); + return name; +} + +auto compiler::insert_label() -> std::string +{ + const auto itr = function_->labels.find(index_); + + if (itr != function_->labels.end()) + { + return itr->second; + } + else + { + label_idx_++; + auto name = utils::string::va("loc_%d", label_idx_); + function_->labels.insert({index_, name}); + return name; + } +} + +void compiler::insert_label(const std::string& name) +{ + const auto itr = function_->labels.find(index_); + + if (itr != function_->labels.end()) + { + for(auto& inst : function_->instructions) + { + switch (opcode(inst->opcode)) + { + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_jump: + case opcode::OP_jumpback: + case opcode::OP_switch: + if(inst->data[0] == name) + inst->data[0] = itr->second; + break; + case opcode::OP_endswitch: + default: + break; + } + } + } + else + { + function_->labels.insert({index_, name}); + } +} + +auto compiler::map_known_includes(const std::string& include) -> bool +{ + return false; +} + +} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/compiler.hpp b/src/s2/xsk/compiler.hpp new file mode 100644 index 00000000..0c94c58c --- /dev/null +++ b/src/s2/xsk/compiler.hpp @@ -0,0 +1,146 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::s2 +{ + +enum class opcode : std::uint8_t; + +class compiler : public gsc::compiler +{ + std::string filename_; + std::vector assembly_; + gsc::function_ptr function_; + std::uint32_t index_; + std::uint32_t label_idx_; + std::uint8_t stack_idx_; + std::vector local_stack_; + std::vector local_functions_; + std::vector includes_; + std::vector animtrees_; + std::unordered_map constants_; + std::function(const std::string&)> callback_readf_; + std::vector break_ctxs_; + std::vector continue_ctxs_; + bool can_break_; + bool can_continue_; + +public: + auto output() -> std::vector; + void compile(const std::string& file, std::vector& data); + void set_readf_callback(std::function(const std::string&)> func); + +private: + auto parse_buffer(const std::string& file, std::vector& data) -> gsc::program_ptr; + auto parse_file(const std::string& file) -> gsc::program_ptr; + void compile_program(const gsc::program_ptr& program); + void emit_include(const gsc::include_ptr& include); + void emit_define(const gsc::define_ptr& define); + void emit_usingtree(const gsc::usingtree_ptr& animtree); + void emit_constant(const gsc::constant_ptr& constant); + void emit_thread(const gsc::thread_ptr& thread); + void emit_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void emit_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt, bool last); + void emit_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt, bool last); + void emit_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt); + void emit_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt); + void emit_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt); + void emit_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt); + void emit_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt); + void emit_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void emit_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt); + void emit_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt); + void emit_stmt_waitframe(const gsc::context_ptr& ctx, const gsc::stmt_waitframe_ptr& stmt); + void emit_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt, bool last); + void emit_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt, bool last); + void emit_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void emit_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void emit_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void emit_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void emit_stmt_case(const gsc::context_ptr& ctx, const gsc::stmt_case_ptr& stmt); + void emit_stmt_default(const gsc::context_ptr& ctx, const gsc::stmt_default_ptr& stmt); + void emit_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void emit_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt); + void emit_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void emit_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr); + void emit_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr); + void emit_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr); + void emit_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr); + void emit_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr); + void emit_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr); + void emit_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_pointer_type(const gsc::context_ptr& ctx, int args, bool builtin, bool method, bool thread, bool child); + void emit_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void emit_expr_call_function_builtin(const gsc::context_ptr& ctx, const std::string& func, int args, bool method); + void emit_expr_call_function_local(const gsc::context_ptr& ctx, const std::string& func, int args, bool method, bool thread, bool child); + void emit_expr_call_function_far(const gsc::context_ptr& ctx, const std::string& file, const std::string& func, int args, bool method, bool thread, bool child); + void emit_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& arg_list); + void emit_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& node); + void emit_expr_clear_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& lvalue); + void emit_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr); + void emit_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr); + void emit_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr, bool set); + void emit_array_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr, bool set); + void emit_field_variable_ref(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr, bool set); + void emit_local_variable_ref(const gsc::context_ptr& ctx, const gsc::name_ptr& expr, bool set); + void emit_variable(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr); + void emit_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr); + void emit_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void emit_clear_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void emit_create_local_vars(const gsc::context_ptr& ctx); + void emit_remove_local_vars(const gsc::context_ptr& ctx); + void emit_object(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void emit_animtree(const gsc::context_ptr& ctx, const gsc::animtree_ptr& animtree); + void emit_animation(const gsc::context_ptr& ctx, const gsc::animation_ptr& animation); + void emit_istring(const gsc::context_ptr& ctx, const gsc::istring_ptr& str); + void emit_string(const gsc::context_ptr& ctx, const gsc::string_ptr& str); + void emit_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec); + void emit_float(const gsc::context_ptr& ctx, const gsc::float_ptr& num); + void emit_integer(const gsc::context_ptr& ctx, const gsc::integer_ptr& num); + void emit_false(const gsc::context_ptr& ctx, const gsc::false_ptr& expr); + void emit_true(const gsc::context_ptr& ctx, const gsc::true_ptr& expr); + void emit_opcode(const gsc::context_ptr& ctx, opcode op); + void emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::string& data); + void emit_opcode(const gsc::context_ptr& ctx, opcode op, const std::vector& data); + void process_thread(const gsc::context_ptr& ctx, const gsc::thread_ptr& thread); + void process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt); + void process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_expr(const gsc::context_ptr& ctx, const gsc::expr_ptr& expr); + void process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt); + void process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt); + void process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void process_stmt_continue(const gsc::context_ptr& ctx, const gsc::stmt_continue_ptr& stmt); + void process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void register_variable(const gsc::context_ptr& ctx, const std::string& name); + void initialize_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name); + void create_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& name); + auto variable_stack_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::uint8_t; + auto variable_create_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string; + auto variable_access_index(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> std::string; + auto variable_initialized(const gsc::context_ptr& ctx, const gsc::name_ptr& name) -> bool; + auto is_local_call(const std::string& name) -> bool; + auto is_builtin_call(const std::string& name) -> bool; + auto is_builtin_func(const std::string& name) -> bool; + auto is_builtin_method(const std::string& name) -> bool; + auto is_constant_condition(const gsc::expr_ptr& expr) -> bool; + auto create_label() -> std::string; + auto insert_label() -> std::string; + void insert_label(const std::string& label); + + auto map_known_includes(const std::string& include) -> bool; +}; + +} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/decompiler.cpp b/src/s2/xsk/decompiler.cpp new file mode 100644 index 00000000..3944b2c8 --- /dev/null +++ b/src/s2/xsk/decompiler.cpp @@ -0,0 +1,3169 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "s2.hpp" + +namespace xsk::gsc::s2 +{ + +auto decompiler::output() -> std::vector +{ + std::vector output; + + auto data = std::make_unique(0x100000); + data->write_string("// S2 PC GSC\n// Decompiled by https://github.com/xensik/gsc-tool\n"); + data->write_string(program_->print()); + + output.resize(data->pos()); + std::memcpy(output.data(), data->buffer().data(), output.size()); + + return output; +} + +void decompiler::decompile(const std::string& file, std::vector& functions) +{ + filename_ = file; + program_ = std::make_unique(); + + for (auto& func : functions) + { + auto name = std::make_unique(func->name.substr(4)); + auto params = std::make_unique(); + auto block = std::make_unique(); + func_ = std::make_unique(std::move(name),std::move(params),std::move(block)); + + labels_ = func->labels; + expr_labels_.clear(); + stack_ = std::stack(); + + this->decompile_function(func); + + this->process_stack(func_); + + program_->definitions.push_back(gsc::define_ptr(std::move(func_))); + } +} + +void decompiler::decompile_function(const gsc::function_ptr& func) +{ + this->decompile_statements(func); + + if(stack_.size() > 0) + { + throw gsc::decomp_error("stack not emty at function end"); + } + + auto& block = func_->block; + + gsc::context ctx; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.back().as_node->loc.begin.line); + + // remove last return + block->stmts.pop_back(); + + // hotfix empty else block at func end + if(block->stmts.size() > 0 && block->stmts.back().as_node->type == gsc::node_t::asm_jump) + { + if(block->stmts.back().as_jump->value == ctx.loc_end) + block->stmts.pop_back(); + } + + blocks_.push_back(ctx); + this->decompile_block(block); + blocks_.pop_back(); +} + +void decompiler::decompile_statements(const gsc::function_ptr& func) +{ + std::uint32_t last_null_loc = 0; + + for (auto& inst : func->instructions) + { + auto loc = gsc::location(&filename_, inst->index); + + const auto itr = func->labels.find(inst->index); + + if (itr != func->labels.end()) + { + for(auto& entry : expr_labels_) + { + if(entry == itr->second) + { + decompile_expr(); + } + } + } + + switch (opcode(inst->opcode)) + { + case opcode::OP_End: + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::make_unique())); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_Return: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + auto stmt = gsc::stmt_ptr(std::make_unique(expr->loc, std::move(expr))); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_GetZero: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetByte: + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetInteger: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetNegByte: + case opcode::OP_GetNegUnsignedShort: + { + auto node = std::make_unique(loc, "-" + inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetFloat: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetVector: + { + auto x = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto y = gsc::expr_ptr(std::make_unique(loc, inst->data[1])); + auto z = gsc::expr_ptr(std::make_unique(loc, inst->data[2])); + auto node = std::make_unique(loc, std::move(x), std::move(y), std::move(z)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetString: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetIString: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetUndefined: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EmptyArray: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetLevel: + case opcode::OP_GetLevelObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnim: + case opcode::OP_GetAnimObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetSelf: + case opcode::OP_GetSelfObject: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetGame: + case opcode::OP_GetGameRef: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnimation: + { + auto tree = utils::string::unquote(inst->data[0]); + + if(tree != "") + { + auto treename = std::make_unique(loc, inst->data[0]); + auto animtree = std::make_unique(loc, std::move(treename)); + program_->definitions.push_back(gsc::define_ptr(std::move(animtree))); + } + + auto node = std::make_unique(loc, utils::string::unquote(inst->data[1])); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetAnimTree: + { + auto tree = utils::string::unquote(inst->data[0]); + + if(tree != "") + { + auto treename = std::make_unique(loc, inst->data[0]); + auto animtree = std::make_unique(loc, std::move(treename)); + program_->definitions.push_back(gsc::define_ptr(std::move(animtree))); + } + + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetThisthread: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_GetBuiltinMethod: + { + auto file = std::make_unique(loc); + auto func = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_GetLocalFunction: + { + auto file = std::make_unique(loc); + auto func = std::make_unique(loc, inst->data[0].substr(4)); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_GetFarFunction: + { + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + auto func = std::make_unique(loc, inst->data[1]); + auto stmt = std::make_unique(loc, std::move(file), std::move(func)); + stack_.push(std::move(stmt)); + }; + break; + case opcode::OP_CreateLocalVariable: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_RemoveLocalVariables: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_EvalLocalVariableCached0: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached1: + { + auto node = std::make_unique(loc, "1"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached2: + { + auto node = std::make_unique(loc, "2"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached3: + { + auto node = std::make_unique(loc, "3"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached4: + { + auto node = std::make_unique(loc, "4"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached5: + { + auto node = std::make_unique(loc, "5"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayCached: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalArray: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalNewLocalArrayRefCached0: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayRefCached0: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, "0")); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalArrayRefCached: + { + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto obj = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalArrayRef: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto node = std::make_unique(key.as_node->loc, std::move(obj), std::move(key)); + stack_.push(std::move(node)); + } + break; + case opcode::OP_ClearArray: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto key = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = key.as_node->loc; + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(key))); + auto rvalue = gsc::expr_ptr(std::make_unique(loc)); + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr))); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_AddArray: + { + auto var = std::move(stack_.top()); + stack_.pop(); + auto array = std::move(stack_.top()); + stack_.pop(); + + if (array->type == gsc::node_t::data_empty_array) + { + auto args = std::make_unique(loc); + args->list.push_back(std::move(var)); + auto expr = std::make_unique(array->loc, std::move(args)); + stack_.push(std::move(expr)); + } + else if (array->type == gsc::node_t::expr_add_array) + { + (*(gsc::expr_add_array_ptr*)&array)->args->list.push_back(std::move(var)); + stack_.push(std::move(array)); + } + else + { + throw gsc::decomp_error("unknown add array type (could be an array variable name?)"); + } + } + break; + case opcode::OP_PreScriptCall: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_ScriptLocalFunctionCall2: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalFunctionCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalChildThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodThreadCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptLocalMethodChildThreadCall: + { + // TODO: child things... + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0].substr(4)); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[1]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarFunctionCall2: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarFunctionCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarMethodCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[0])); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarThreadCall: + { + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[2]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[1])); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFarMethodThreadCall: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[2]); + auto file = std::make_unique(loc, utils::string::backslash(inst->data[1])); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptFunctionCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodCallPointer: + { + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_prescriptcall) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptChildThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto obj = gsc::expr_ptr(std::make_unique()); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, true, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_ScriptMethodChildThreadCallPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, false, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, true, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = exprf.as_node->loc; + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto obj = gsc::expr_ptr(std::make_unique()); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, true, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethodPointer: + { + auto args = std::make_unique(loc); + auto exprf = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, true, std::move(exprf), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin0: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin1: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 1; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin2: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 2; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin3: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 3; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin4: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 4; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin5: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 5; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltin: + { + auto obj = gsc::expr_ptr(std::make_unique()); + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod0: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod1: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 1; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod2: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 2; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod3: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 3; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod4: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 4; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod5: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto file = std::make_unique(loc); + + for (size_t i = 5; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_CallBuiltinMethod: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto args = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[1]); + auto file = std::make_unique(loc); + + auto argnum = std::stoul(inst->data[0]); + + for (size_t i = argnum; i > 0; i--) + { + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + args->list.push_back(std::move(var)); + } + + auto func = gsc::expr_call_type_ptr(std::make_unique(loc, std::move(file), std::move(name), std::move(args))); + auto expr = std::make_unique(loc, false, false, std::move(obj) ,std::move(func)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_DecTop: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + loc = expr->loc; + auto stmt = std::make_unique(loc, std::move(*(gsc::expr_call_ptr*)&expr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_inc: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_dec: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_or: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_ex_or: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_bit_and: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_equality: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_inequality: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_less: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_greater: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_less_equal: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_greater_equal: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_shift_left: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_shift_right: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_plus: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_minus: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_multiply: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_divide: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_mod: + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_wait: + { + auto expr = std::move(stack_.top()); + stack_.pop(); + loc = expr->loc; + auto stmt = std::make_unique(loc, std::move(expr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_waittillFrameEnd: + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_waitFrame: + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + func_->block->stmts.push_back(std::move(stmt)); + } + break; + case opcode::OP_waittill: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = nstr.as_node->loc; + auto args = std::make_unique(loc); + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr), std::move(args)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_waittillmatch: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto expr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = expr.as_node->loc; + + gsc::expr_arguments_ptr args = std::make_unique(); + args->loc = loc; + + while(stack_.size() > 0) + { + auto node = std::move(stack_.top()); + stack_.pop(); + args->loc = node->loc; + args->list.push_back(std::move(node)); + + } + loc = args->loc; + + auto stmt = std::make_unique(loc, std::move(obj), std::move(expr), std::move(args)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_clearparams: + { + auto args = std::make_unique(loc); + auto var = std::move(stack_.top()); + stack_.pop(); + + while(var->type != gsc::node_t::stmt_waittill && var->type != gsc::node_t::stmt_waittillmatch) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + } + + if(var->type == gsc::node_t::stmt_waittill) + { + (*(gsc::stmt_waittill_ptr*)&var)->args = std::move(args); + } + + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(var))); + } + break; + case opcode::OP_checkclearparams: + { + // no needed + } + break; + case opcode::OP_notify: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + + auto args = std::make_unique(loc); + + auto var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + while(var->type != gsc::node_t::asm_voidcodepos) + { + args->list.push_back(std::move(var)); + var = std::move(stack_.top()); + stack_.pop(); + loc = var->loc; + } + + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr), std::move(args)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_endon: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto nstr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = nstr.as_node->loc; + auto stmt = std::make_unique(loc, std::move(obj) , std::move(nstr)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_voidCodepos: + { + auto node = std::make_unique(loc); + stack_.push(std::move(node)); + } + break; + case opcode::OP_vector: + { + auto x = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto y = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + auto z = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = z.as_node->loc; + auto expr = std::make_unique(loc, std::move(x), std::move(y), std::move(z)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_size: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_EvalLevelFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalAnimFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalSelfFieldVariable: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalFieldVariable: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalLevelFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalAnimFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalSelfFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_EvalFieldVariableRef: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); + stack_.push(std::move(stmt)); + } + break; + case opcode::OP_ClearFieldVariable: + { + auto obj = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = obj.as_node->loc; + auto field = std::make_unique(loc, inst->data[0]); + auto expr = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto undef = gsc::expr_ptr(std::make_unique(loc)); + auto e = std::make_unique(loc, std::move(expr), std::move(undef)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::make_unique(loc, std::move(e)))); + } + break; + case opcode::OP_SafeCreateVariableFieldCached: + { + func_->params->list.push_back(std::make_unique(loc, "var_" + inst->data[0])); + } + break; + case opcode::OP_SafeSetWaittillVariableFieldCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableRefCached0: + { + auto node = std::make_unique(loc, "0"); + stack_.push(std::move(node)); + } + break; + case opcode::OP_EvalLocalVariableRefCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_SetLevelFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc,std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetVariableField: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + + if(lvalue.as_node->type == gsc::node_t::expr_increment) + { + auto stmt = std::make_unique(loc, std::move(lvalue.as_increment)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + else if(lvalue.as_node->type == gsc::node_t::expr_decrement) + { + auto stmt = std::make_unique(loc, std::move(lvalue.as_decrement)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + else + { + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + } + break; + case opcode::OP_SetAnimFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetSelfFieldVariableField: + { + auto obj = gsc::expr_ptr(std::make_unique(loc)); + auto field = std::make_unique(loc, inst->data[0]); + auto lvalue = gsc::expr_ptr(std::make_unique(loc, std::move(obj), std::move(field))); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetLocalVariableFieldCached0: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, "0")); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetNewLocalVariableFieldCached0: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + + if(func_->block->stmts.size() > 0) + { + std::vector creates; + + while(func_->block->stmts.back().as_node->type == gsc::node_t::asm_create) + { + auto& entry = func_->block->stmts.back(); + if(loc.begin.line < entry.as_node->loc.begin.line) + { + creates.push_back(entry.as_asm_create->index); + func_->block->stmts.pop_back(); + continue; + } + break; + } + + std::reverse(creates.begin(), creates.end()); + lvalue.as_asm_create->vars = creates; + } + + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_SetLocalVariableFieldCached: + { + auto lvalue = gsc::expr_ptr(std::make_unique(loc, inst->data[0])); + auto rvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = rvalue.as_node->loc; + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + auto stmt = std::make_unique(loc, std::move(e)); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_ClearLocalVariableFieldCached: + { + auto stmt = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_ClearLocalVariableFieldCached0: + { + auto stmt = std::make_unique(loc,"0"); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(stmt))); + } + break; + case opcode::OP_EvalLocalVariableObjectCached: + { + auto node = std::make_unique(loc, inst->data[0]); + stack_.push(std::move(node)); + } + break; + case opcode::OP_CastFieldObject: + case opcode::OP_CastBool: + { + //continue; + } + break; + case opcode::OP_BoolNot: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_BoolComplement: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + case opcode::OP_switch: + { + auto expr = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = expr.as_node->loc; + auto sw = std::make_unique(loc, std::move(expr), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(sw))); + } + break; + case opcode::OP_endswitch: + { + auto count = inst->data[0]; + inst->data.erase(inst->data.begin()); + auto data = inst->data; + auto end = std::make_unique(loc, data, count); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(end))); + } + break; + case opcode::OP_jump: + { + auto expr = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + + } + break; + case opcode::OP_jumpback: + { + auto expr = std::make_unique(loc, inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnTrue: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto e_not = gsc::expr_ptr(std::make_unique(loc, std::move(lvalue))); + auto expr = std::make_unique(loc, std::move(e_not), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnFalse: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + func_->block->stmts.push_back(gsc::stmt_ptr(std::move(expr))); + } + break; + case opcode::OP_JumpOnTrueExpr: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + stack_.push(std::move(expr)); + expr_labels_.push_back(inst->data[0]); + } + break; + case opcode::OP_JumpOnFalseExpr: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); + stack_.push(std::move(expr)); + expr_labels_.push_back(inst->data[0]); + } + break; + case opcode::OP_BoolNotAfterAnd: + { + auto lvalue = gsc::expr_ptr(std::move(stack_.top())); + stack_.pop(); + loc = lvalue.as_node->loc; + auto expr = std::make_unique(loc, std::move(lvalue)); + stack_.push(std::move(expr)); + } + break; + default: + throw gsc::decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); + break; + } + } +} + +void decompiler::decompile_expr() +{ + auto expr = std::move(stack_.top()); + stack_.pop(); + + auto jump_expr = std::move(stack_.top()); + stack_.pop(); + auto loc = jump_expr->loc; + + if(jump_expr->type == gsc::node_t::asm_jump_true_expr) + { + auto lvalue = std::move((*(gsc::asm_jump_true_expr_ptr*)&jump_expr)->expr); + auto rvalue = gsc::expr_ptr(std::move(expr)); + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(e)); + } + else if(jump_expr->type == gsc::node_t::asm_jump_false_expr) + { + auto lvalue = std::move((*(gsc::asm_jump_false_expr_ptr*)&jump_expr)->expr); + auto rvalue = gsc::expr_ptr(std::move(expr)); + auto e = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); + stack_.push(std::move(e)); + } + else + { + throw gsc::decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); + } +} + +void decompiler::decompile_block(const gsc::stmt_list_ptr& block) +{ + this->decompile_search_infinite(block); + this->decompile_search_loop(block); + this->decompile_search_switch(block); + this->decompile_search_ifelse(block); + this->decompile_break_continue(block); + this->decompile_nulls(block); +} + +void decompiler::decompile_nulls(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::null) + { + block->stmts.erase(block->stmts.begin() + index); + } + else index++; + } +} + +void decompiler::decompile_search_infinite(const gsc::stmt_list_ptr& block) +{ + std::int32_t index = block->stmts.size() - 1; + + while(index >= 0) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_jump_back) + { + auto break_loc = last_location_index(block, index) ? blocks_.back().loc_end : utils::string::va("loc_%X", block->stmts.at(index+1).as_node->loc.begin.line); + auto begin_loc = block->stmts.at(index).as_jump_back->value; + auto start = find_location_index(block, begin_loc); + + if(block->stmts.at(start).as_node->type != gsc::node_t::asm_jump_cond) + { + decompile_infinite(block, start, index); + index = start; + } + else if (block->stmts.at(start).as_cond->value != break_loc) + { + decompile_infinite(block, start, index); + index = start; + } + } + + index--; + } +} + +void decompiler::decompile_search_loop(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + auto& stmt = block->stmts.at(index); + + if(stmt.as_node->type == gsc::node_t::asm_jump_cond) + { + std::uint32_t end; + if(stmt.as_cond->value == blocks_.back().loc_end) + { + end = block->stmts.size() - 1; + } + else + { + end = find_location_index(block, stmt.as_cond->value) - 1; + } + + if(block->stmts.at(end).as_node->type == gsc::node_t::asm_jump_back + && utils::string::va("loc_%X", block->stmts.at(index).as_node->loc.begin.line) == block->stmts.at(end).as_jump_back->value) + { + decompile_loop(block, index, end); + index = 0; + } + } + index++; + } +} + +void decompiler::decompile_search_switch(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_switch) + { + decompile_switch(block, index); + } + + index++; + } +} + +void decompiler::decompile_search_ifelse(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + auto& stmt = block->stmts.at(index); + + if(stmt.as_node->type == gsc::node_t::asm_jump_cond) + { + std::uint32_t end; + if(stmt.as_cond->value == blocks_.back().loc_end) + { + end = block->stmts.size() - 1; + } + else + { + end = find_location_index(block, stmt.as_cond->value) - 1; + } + + auto last_loc = blocks_.back().loc_end; + + if(block->stmts.at(end).as_node->type == gsc::node_t::asm_jump) + { + // if block is a loop check break, continue + if(block->stmts.at(end).as_jump->value == blocks_.back().loc_continue) + { + // last if/else inside a loop still trigger this :( + decompile_if(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == blocks_.back().loc_break) + { + decompile_if(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == blocks_.back().loc_end) + { + decompile_ifelse(block, index, end); + } + else if(block->stmts.at(end).as_jump->value == stmt.as_cond->value) + { + decompile_if(block, index, end); // if block, have a last empty else inside + } + else + { + decompile_ifelse(block, index, end); // TODO: if else block is empty, convert it to only if! + } + } + else if(block->stmts.at(end).as_node->type == gsc::node_t::stmt_return + && block->stmts.at(end).as_return->expr.as_node->type == gsc::node_t::null) + { + if(blocks_.back().loc_break != "" || blocks_.back().loc_continue != "") + { + decompile_if(block, index, end); // inside a loop cant be last + } + else if(end - index == 1) + { + decompile_if(block, index, end); // only one explicit return + } + else if(block->stmts.back().as_node->type != gsc::node_t::stmt_return) + { + decompile_if(block, index, end); // block end is not a last return + } + else if(blocks_.back().is_last && block->stmts.back().as_node->type != gsc::node_t::stmt_return) + { + decompile_if(block, index, end); // inside a last block but is not and inner last + } + else if(find_location_reference(block, end, block->stmts.size(), last_loc)) + { + decompile_if(block, index, end); // reference to func end after the if + } + else if(blocks_.size() > 1 && !blocks_.back().is_last) + { + decompile_if(block, index, end); // fake last ifelse + } + else + { + decompile_last_ifelse(block, index, end); // special case + } + } + else + { + decompile_if(block, index, end); + } + } + index++; + } +} + +void decompiler::decompile_break_continue(const gsc::stmt_list_ptr& block) +{ + auto index = 0; + + while(index < block->stmts.size()) + { + if(block->stmts.at(index).as_node->type == gsc::node_t::asm_jump) + { + auto loc = block->stmts.at(index).as_node->loc; + auto jump_loc = block->stmts.at(index).as_jump->value; + + if(jump_loc == blocks_.back().loc_continue) + { + block->stmts.erase(block->stmts.begin() + index); + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + block->stmts.insert(block->stmts.begin() + index, std::move(stmt)); + } + else if(jump_loc == blocks_.back().loc_break) + { + block->stmts.erase(block->stmts.begin() + index); + auto stmt = gsc::stmt_ptr(std::make_unique(loc)); + block->stmts.insert(block->stmts.begin() + index, std::move(stmt)); + } + } + + index++; + } +} + +void decompiler::decompile_if(const gsc::stmt_list_ptr& block, std::uint32_t begin, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_end = block->stmts.at(begin).as_cond->value; + ctx.loc_break = blocks_.back().loc_break; + ctx.loc_continue = blocks_.back().loc_continue; + + auto loc = block->stmts.at(begin).as_node->loc; + auto expr = std::move(block->stmts.at(begin).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + begin); // remove condition + + auto if_block = std::make_unique(loc); + + for(auto i = begin; i < end; i++) + { + if_block->stmts.push_back(std::move(block->stmts[begin])); + block->stmts.erase(block->stmts.begin() + begin); + } + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)))); + block->stmts.insert(block->stmts.begin() + begin, std::move(stmt)); +} + +void decompiler::decompile_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_break = blocks_.back().loc_break; + ctx.loc_continue = blocks_.back().loc_continue; + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto if_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) // skip the jump + { + if_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + auto end_loc = block->stmts.at(start).as_jump->value; + + block->stmts.erase(block->stmts.begin() + start); // remove jump + + std::uint32_t end_index; + + if(end_loc == blocks_.back().loc_end) + { + end_index = block->stmts.size(); + } + else + { + end_index = find_location_index(block, end_loc); + } + + gsc::context ctx2; + ctx2.loc_end = end_loc; + ctx2.loc_break = blocks_.back().loc_break; + ctx2.loc_continue = blocks_.back().loc_continue; + + auto else_block = std::make_unique(loc); + + for(auto i = start; i < end_index; i++) + { + else_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx2); + decompile_block(else_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)), gsc::stmt_ptr(std::move(else_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_last_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.is_last = true; + + auto inner_end = find_location_index(block, block->stmts.at(start).as_cond->value) - 1; + ctx.loc_end = utils::string::va("loc_%X",block->stmts.at(inner_end).as_node->loc.begin.line); + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto if_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + if_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + block->stmts.erase(block->stmts.begin() + start); // remove if block return; + + blocks_.push_back(ctx); + decompile_block(if_block); + blocks_.pop_back(); + + if(start == block->stmts.size()) + { + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); + } + else + { + gsc::context ctx2; + ctx2.is_last = true; + + auto else_block = std::make_unique(loc); + + end = block->stmts.size(); + ctx2.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); // return is the block end + + for(auto i = start; i < end; i++) + { + else_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + else_block->stmts.pop_back(); // remove else return; + + blocks_.push_back(ctx2); + decompile_block(else_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(if_block)), gsc::stmt_ptr(std::move(else_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); + } +} + +void decompiler::decompile_infinite(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = last_location_index(block, end) ? blocks_.back().loc_end : utils::string::va("loc_%X", block->stmts.at(end+1).as_node->loc.begin.line); + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + + auto loc = block->stmts.at(start).as_node->loc; + + block->stmts.erase(block->stmts.begin() + end); // remove jump back + + auto for_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + for_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(for_block); + blocks_.pop_back(); + + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + auto expr = gsc::expr_ptr(std::make_unique()); + auto post_expr = gsc::stmt_ptr(std::make_unique()); + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(pre_expr), std::move(expr), std::move(post_expr), gsc::stmt_ptr(std::move(for_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + auto& last_stmt = block->stmts.at(end-1); + if(last_stmt.as_node->type == gsc::node_t::stmt_assign) + { + if(last_stmt.as_assign->expr->type == gsc::node_t::expr_assign_equal) + { + auto& rval = last_stmt.as_assign->expr->rvalue; + if(rval.as_node->type == gsc::node_t::expr_call) + { + if(rval.as_call->func.as_node->type == gsc::node_t::expr_call_function) + { + if(utils::string::to_lower(rval.as_call->func.as_func->name->value) == "getnextarraykey") + { + auto ref2 = utils::string::va("loc_%X", block->stmts.at(start).as_node->loc.begin.line); + if(find_location_reference(block, 0, start, ref2)) + { + // begin is at condition, not pre-expr + //decompile_while(block, start, end); + //return; + } + else + { + decompile_foreach(block, start, end); + return; + } + } + } + } + } + + if(start > 0) // while at func start + { + auto index = 1; + while(block->stmts.at(start - index).as_node->type == gsc::node_t::asm_create) + { + if(start - index > 0) + index++; + } + + if(block->stmts.at(start - index).as_node->type == gsc::node_t::stmt_assign) + { + auto ref = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + auto ref2 = utils::string::va("loc_%X", block->stmts.at(start).as_node->loc.begin.line); + + if(find_location_reference(block, start, end, ref)) + { + // continue is at jumpback, not post-expr + decompile_while(block, start, end); + return; + } + else if(find_location_reference(block, 0, start, ref2)) + { + // begin is at condition, not pre-expr + decompile_while(block, start, end); + return; + } + else + { + decompile_for(block, start, end); + return; + } + } + } + } + + decompile_while(block, start, end); +} + +void decompiler::decompile_while(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(start).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X",block->stmts.at(end).as_node->loc.begin.line); + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + + block->stmts.erase(block->stmts.begin() + end); // remove jump back + block->stmts.erase(block->stmts.begin() + start); // remove condition + end = end - 1; + + auto while_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + while_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(while_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), gsc::stmt_ptr(std::move(while_block)))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_for(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(start).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + + // remove emit local var_creates + std::vector creates; + while(block->stmts.at(start - 1).as_node->type == gsc::node_t::asm_create) + { + creates.push_back(block->stmts.at(start - 1).as_asm_create->index); + block->stmts.erase(block->stmts.begin() + start - 1); + start--; + end--; + } + + std::reverse(creates.begin(), creates.end()); + + auto loc = block->stmts.at(start - 1).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_cond->expr); + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + pre_expr.as_list->stmts.push_back(std::move(block->stmts.at(start - 1))); + pre_expr.as_list->is_expr = true; + auto post_expr = gsc::stmt_ptr(std::make_unique()); + post_expr.as_list->stmts.push_back(std::move(block->stmts.at(end - 1))); + post_expr.as_list->is_expr = true; + + start = start - 1; + end = end - 2; + for(auto i = start; i < start + 2; i++) // remove prologue (pre-expr, condition) + { + block->stmts.erase(block->stmts.begin() + start); + } + + end = end - 1; // set end in post-expr + for(auto i = end; i < end + 2; i++) // remove epilogue (post-expr, jump back) + { + block->stmts.erase(block->stmts.begin() + end); + } + + auto for_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + for_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(for_block); + blocks_.pop_back(); + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(pre_expr), std::move(expr), std::move(post_expr), gsc::stmt_ptr(std::move(for_block)))); + stmt.as_for->vars = creates; + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +void decompiler::decompile_foreach(const gsc::stmt_list_ptr& block, std::uint32_t begin, std::uint32_t end) +{ + gsc::context ctx; + ctx.loc_break = block->stmts.at(begin).as_cond->value; + ctx.loc_end = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + ctx.loc_continue = utils::string::va("loc_%X", block->stmts.at(end - 1).as_node->loc.begin.line); + + // remove local var_creates + std::vector creates; + while(block->stmts.at(begin - 1).as_node->type == gsc::node_t::asm_create) + { + creates.push_back(block->stmts.at(begin - 1).as_asm_create->index); + block->stmts.erase(block->stmts.begin() + begin - 1); + begin--; + end--; + } + + std::reverse(creates.begin(), creates.end()); + + auto loc = block->stmts.at(begin - 2).as_node->loc; + + auto pre_expr = gsc::stmt_ptr(std::make_unique()); + pre_expr.as_list->stmts.push_back(std::move(block->stmts[begin-2])); + pre_expr.as_list->stmts.push_back(std::move(block->stmts[begin-1])); + auto stmt0 = std::move(block->stmts[begin+1]); + + begin = begin - 2; + end = end - 4; + for(auto i = begin; i < begin + 4; i++) // remove prologue ( array, elem, cond, elemRef) + { + block->stmts.erase(block->stmts.begin() + begin); + } + + end = end - 1; // set end to post-expr + + for(auto i = end; i < end + 2; i++) // remove epilogue ( post-expr, jump back) + { + block->stmts.erase(block->stmts.begin() + end); + } + + if(block->stmts.size() > end && block->stmts.at(end).as_node->type == gsc::node_t::asm_clear) + { + block->stmts.erase(block->stmts.begin() + end); + } + + auto use_key = true; + + if(block->stmts.size() > end && block->stmts.at(end).as_node->type == gsc::node_t::asm_clear) + { + block->stmts.erase(block->stmts.begin() + end); + use_key = false; + } + + auto foreach_block = std::make_unique(loc); + + for(auto i = begin; i < end; i++) + { + foreach_block->stmts.push_back(std::move(block->stmts[begin])); + block->stmts.erase(block->stmts.begin() + begin); + } + + blocks_.push_back(ctx); + decompile_block(foreach_block); + blocks_.pop_back(); + + auto foreach_stmt = gsc::stmt_ptr(std::make_unique(loc, gsc::stmt_ptr(std::move(foreach_block)), use_key)); + foreach_stmt.as_foreach->vars = creates; + foreach_stmt.as_foreach->pre_expr = std::move(pre_expr); + foreach_stmt.as_foreach->stmt0 = std::move(stmt0); + + block->stmts.insert(block->stmts.begin() + begin, std::move(foreach_stmt)); +} + +void decompiler::decompile_switch(const gsc::stmt_list_ptr& block, std::uint32_t start) +{ + gsc::context ctx; + ctx.loc_continue = blocks_.back().loc_continue; + ctx.loc_end = block->stmts.at(start).as_asm_switch->value; + + auto loc = block->stmts.at(start).as_node->loc; + auto expr = std::move(block->stmts.at(start).as_asm_switch->expr); + auto end_loc = block->stmts.at(start).as_asm_switch->value; + auto end = find_location_index(block, end_loc); + + if(end == block->stmts.size() - 1) + { + ctx.loc_break = blocks_.back().loc_end; + } + else + { + ctx.loc_break = utils::string::va("loc_%X", block->stmts.at(end + 1).as_node->loc.begin.line); + } + + // collect cases + auto casenum = std::atol(block->stmts.at(end).as_asm_endswitch->count.data()); + auto data = block->stmts.at(end).as_asm_endswitch->data; + auto idx = 0; + + for(auto i = 0; i < casenum; i++) + { + if(data.at(idx) == "case") + { + auto loc_str = data.at(idx+2); + auto loc_idx = find_location_index(block, loc_str); + auto loc_pos = gsc::location(&filename_, std::stol(loc_str.substr(4), 0, 16)); + auto value = gsc::expr_ptr(std::make_unique(loc_pos, data.at(idx+1))); + auto list = std::make_unique(loc); + list->is_case = true; + auto stmt = gsc::stmt_ptr(std::make_unique(loc_pos, std::move(value), std::move(list))); + block->stmts.insert(block->stmts.begin() + loc_idx, std::move(stmt)); + idx += 3; + } + else if(data.at(idx) == "default") + { + auto loc_str = data.at(idx+1); + auto loc_idx = find_location_index(block, loc_str); + auto loc_pos = gsc::location(&filename_, std::stol(loc_str.substr(4), 0, 16)); + auto list = std::make_unique(loc); + list->is_case = true; + auto stmt = gsc::stmt_ptr(std::make_unique(loc_pos, std::move(list))); + block->stmts.insert(block->stmts.begin() + loc_idx, std::move(stmt)); + idx += 2; + } + } + + end = find_location_index(block, end_loc) - 1; // update end; + block->stmts.erase(block->stmts.begin() + start); // remove switch + block->stmts.erase(block->stmts.begin() + end); // remove endswitch + + //decompile block + auto sw_block = std::make_unique(loc); + + for(auto i = start; i < end; i++) + { + sw_block->stmts.push_back(std::move(block->stmts[start])); + block->stmts.erase(block->stmts.begin() + start); + } + + blocks_.push_back(ctx); + decompile_block(sw_block); + blocks_.pop_back(); + + auto stmt_list = std::make_unique(loc); + gsc::stmt_ptr current_case = gsc::stmt_ptr(std::make_unique()); + + auto num = sw_block->stmts.size(); + for(auto i = 0; i < num; i++) + { + auto& entry = sw_block->stmts[0]; + + if(entry.as_node->type == gsc::node_t::stmt_case || entry.as_node->type == gsc::node_t::stmt_default) + { + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + current_case = std::move(sw_block->stmts[0]); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + else + { + if(current_case.as_node->type != gsc::node_t::null) + { + if(current_case.as_node->type == gsc::node_t::stmt_case) + { + current_case.as_case->stmt->stmts.push_back(std::move(sw_block->stmts[0])); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + else + { + current_case.as_default->stmt->stmts.push_back(std::move(sw_block->stmts[0])); + sw_block->stmts.erase(sw_block->stmts.begin()); + } + } + else + { + gsc::decomp_error("missing case before stmt inside switch!"); + } + } + } + + if(current_case.as_node->type != gsc::node_t::null) + { + stmt_list->stmts.push_back(std::move(current_case)); + } + + auto stmt = gsc::stmt_ptr(std::make_unique(loc, std::move(expr), std::move(stmt_list))); + block->stmts.insert(block->stmts.begin() + start, std::move(stmt)); +} + +auto decompiler::find_location_reference(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end, const std::string& location) -> bool +{ + for(auto i = start; i < end; i++) + { + if(block->stmts.at(i).as_node->type == gsc::node_t::asm_jump_cond) + { + if(block->stmts.at(i).as_cond->value == location) + return true; + } + else if(block->stmts.at(i).as_node->type == gsc::node_t::asm_jump) + { + if(block->stmts.at(i).as_jump->value == location) + return true; + } + } + + return false; +} + +auto decompiler::find_location_index(const gsc::stmt_list_ptr& block, const std::string& location) -> std::uint32_t +{ + auto index = 0; + + if(location == blocks_.back().loc_end) + return block->stmts.size(); + + for(auto& stmt : block->stmts) + { + if(stmt.as_node->loc.begin.line == std::stol(location.substr(4), 0, 16)) + return index; + + index++; + } + + throw gsc::decomp_error("LOCATION NOT FOUND! (" + location + ")"); +} + +auto decompiler::last_location_index(const gsc::stmt_list_ptr& block, std::uint32_t index) -> bool +{ + if(index == block->stmts.size() - 1) + return true; + + return false; +} + +void decompiler::process_stack(const gsc::thread_ptr& thread) +{ + auto ctx = std::make_unique(); + + process_parameters(ctx, thread->params); + process_stmt_list(ctx, thread->block); + +} + +void decompiler::process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params) +{ + for(const auto& param : params->list) + { + ctx->local_vars.push_back({ param->value, static_cast(std::stoi(param->value.substr(4))), true }); + ctx->local_vars_create_count++; + } +} + +void decompiler::process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt) +{ + switch(stmt.as_node->type) + { + case gsc::node_t::stmt_list: process_stmt_list(ctx, stmt.as_list); break; + case gsc::node_t::stmt_call: process_stmt_call(ctx, stmt.as_call); break; + case gsc::node_t::stmt_assign: process_stmt_assign(ctx, stmt.as_assign); break; + case gsc::node_t::stmt_endon: process_stmt_endon(ctx, stmt.as_endon); break; + case gsc::node_t::stmt_notify: process_stmt_notify(ctx, stmt.as_notify); break; + case gsc::node_t::stmt_wait: process_stmt_wait(ctx, stmt.as_wait); break; + case gsc::node_t::stmt_waittill: process_stmt_waittill(ctx, stmt.as_waittill); break; + case gsc::node_t::stmt_waittillmatch: process_stmt_waittillmatch(ctx, stmt.as_waittillmatch); break; + case gsc::node_t::stmt_if: process_stmt_if(ctx, stmt.as_if); break; + case gsc::node_t::stmt_ifelse: process_stmt_ifelse(ctx, stmt.as_ifelse); break; + case gsc::node_t::stmt_while: process_stmt_while(ctx, stmt.as_while); break; + case gsc::node_t::stmt_for: process_stmt_for(ctx, stmt.as_for); break; + case gsc::node_t::stmt_foreach: process_stmt_foreach(ctx, stmt.as_foreach); break; + case gsc::node_t::stmt_switch: process_stmt_switch(ctx, stmt.as_switch); break; + case gsc::node_t::stmt_break: process_stmt_break(ctx, stmt.as_break); break; + case gsc::node_t::stmt_return: process_stmt_return(ctx, stmt.as_return); break; + case gsc::node_t::asm_remove: process_var_remove(ctx, stmt.as_asm_remove); break; + case gsc::node_t::asm_create: + { + auto expr = gsc::expr_ptr(std::make_unique(stmt.as_asm_create->index)); + process_var_create(ctx, expr, true); + } + break; + default: break; + } +} + +void decompiler::process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + for (const auto& entry : stmt->stmts) + { + process_stmt(ctx, entry); + } + + for(auto i = 0; i < stmt->stmts.size(); i++) + { + auto type = stmt->stmts.at(i).as_node->type; + + if(type == gsc::node_t::asm_create || type == gsc::node_t::asm_remove) + { + stmt->stmts.erase(stmt->stmts.begin() + i); + i--; + } + } +} + +void decompiler::process_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt) +{ + process_expr_call(ctx, stmt->expr); +} + +void decompiler::process_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt) +{ + process_expr_assign(ctx, stmt->expr); +} + +void decompiler::process_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt) +{ + process_expr_arguments(ctx, stmt->args); + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt) +{ + process_expr(ctx, stmt->expr); +} + +void decompiler::process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); + process_expr_arguments(ctx, stmt->args); +} + +void decompiler::process_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt) +{ + process_expr_arguments(ctx, stmt->args); + process_expr(ctx, stmt->expr); + process_expr(ctx, stmt->obj); +} + +void decompiler::process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx_if = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx_if); + + process_stmt(stmt->ctx_if, stmt->stmt_if); + + stmt->ctx_else = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx_else); + + process_stmt(stmt->ctx_else, stmt->stmt_else); + + std::vector childs({stmt->ctx_if.get(), stmt->ctx_else.get()}); + ctx->append(childs); + + if(stmt->stmt_if.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt_if.as_list->stmts.at(0))) + { + stmt->stmt_if = std::move(stmt->stmt_if.as_list->stmts.back()); + } + + if(stmt->stmt_else.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt_noif(stmt->stmt_else.as_list->stmts.at(0))) + { + stmt->stmt_else = std::move(stmt->stmt_else.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt); + + std::vector childs({ stmt->ctx.get() }); + + if(stmt->expr.as_node->type == gsc::node_t::null) + ctx->append_decompiler(stmt->ctx); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt) +{ + process_stmt(ctx, stmt->pre_expr); + + for(auto& index : stmt->vars) + { + auto var = utils::string::va("var_%d", std::stoi(index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(index)), true }); + ctx->local_vars_create_count++; + } + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_expr(ctx, stmt->expr); + + process_stmt(stmt->ctx, stmt->stmt); + + process_stmt(ctx, stmt->post_expr); + + if(stmt->expr.as_node->type == gsc::node_t::null) + ctx->append_decompiler(stmt->ctx); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } +} + +void decompiler::process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt) +{ + process_stmt(ctx, stmt->pre_expr); + + for(auto& index : stmt->vars) + { + auto var1 = utils::string::va("var_%d", std::stoi(index)); + ctx->local_vars.push_back({ var1, static_cast(std::stoi(index)), true }); + ctx->local_vars_create_count++; + } + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt(stmt->ctx, stmt->stmt0); + process_stmt(stmt->ctx, stmt->stmt); + + if(stmt->stmt.as_list->stmts.size() == 1 && !gsc::node::is_special_stmt(stmt->stmt.as_list->stmts.at(0))) + { + stmt->stmt = std::move(stmt->stmt.as_list->stmts.back()); + } + + stmt->array_expr = std::move(stmt->pre_expr.as_list->stmts[0].as_assign->expr->rvalue); + stmt->value_expr = std::move(stmt->stmt0.as_assign->expr->lvalue); + stmt->key_expr = std::move(stmt->pre_expr.as_list->stmts[1].as_assign->expr->lvalue); +} + +void decompiler::process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt) +{ + process_expr(ctx, stmt->expr); + + stmt->ctx = std::make_unique(); + ctx->transfer_decompiler(stmt->ctx); + + process_stmt_cases(stmt->ctx, stmt->stmt); + + ctx->append_decompiler(stmt->ctx, true); +} + +void decompiler::process_stmt_cases(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt) +{ + std::vector childs; + + for(auto& entry : stmt->stmts) + { + if(entry.as_node->type == gsc::node_t::stmt_case) + { + entry.as_case->ctx = std::make_unique(); + ctx->transfer_decompiler(entry.as_case->ctx); + + process_stmt_list(entry.as_case->ctx, entry.as_case->stmt); + + if(entry.as_case->ctx->abort == gsc::abort_t::abort_break) + { + childs.push_back(entry.as_case->ctx.get()); + } + } + else if(entry.as_node->type == gsc::node_t::stmt_default) + { + entry.as_default->ctx = std::make_unique(); + ctx->transfer_decompiler(entry.as_default->ctx); + + process_stmt_list(entry.as_default->ctx, entry.as_default->stmt); + + if(entry.as_default->ctx->abort == gsc::abort_t::abort_break) + { + childs.push_back(entry.as_default->ctx.get()); + } + } + } + + ctx->append(childs); +} + +void decompiler::process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt) +{ + ctx->abort = gsc::abort_t::abort_break; +} + +void decompiler::process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt) +{ + if(stmt->expr.as_node->type == gsc::node_t::null) + { + return; + } + + process_expr(ctx, stmt->expr); +} + +void decompiler::process_expr(const gsc::context_ptr& ctx, gsc::expr_ptr& expr) +{ + switch(expr.as_node->type) + { + case gsc::node_t::expr_increment: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_decrement: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_equal: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_add: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_sub: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_mult: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_div: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_mod: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_shift_left: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_shift_right: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_or: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_and: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_assign_bitwise_exor: process_expr_assign(ctx, expr.as_assign); break; + case gsc::node_t::expr_and: process_expr_and(ctx, expr.as_and); break; + case gsc::node_t::expr_or: process_expr_or(ctx, expr.as_or); break; + case gsc::node_t::expr_equality: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_inequality: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_less_equal: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_greater_equal: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_or: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_and: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_bitwise_exor: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_left: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_shift_right: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_add: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_sub: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mult: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_div: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_mod: process_expr_binary(ctx, expr.as_binary); break; + case gsc::node_t::expr_complement: process_expr_complement(ctx, expr.as_complement); break; + case gsc::node_t::expr_not: process_expr_not(ctx, expr.as_not); break; + case gsc::node_t::expr_call: process_expr_call(ctx, expr.as_call); break; + case gsc::node_t::expr_function: process_expr_function(ctx, expr.as_function); break; + case gsc::node_t::expr_add_array: process_expr_add_array(ctx, expr.as_add_array); break; + case gsc::node_t::expr_array: process_array_variable(ctx, expr.as_array); break; + case gsc::node_t::expr_field: process_field_variable(ctx, expr.as_field); break; + case gsc::node_t::expr_size: process_expr_size(ctx, expr.as_size); break; + case gsc::node_t::data_name: process_local_variable(ctx, expr.as_name); break; + case gsc::node_t::data_vector: process_vector(ctx, expr.as_vector); break; + case gsc::node_t::asm_create: process_var_create(ctx, expr); break; + case gsc::node_t::asm_access: process_var_access(ctx, expr); break; + default: break; + } +} + +void decompiler::process_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr) +{ + if(expr->type == gsc::node_t::expr_increment) + { + process_expr(ctx, expr->lvalue); + } + else if(expr->type == gsc::node_t::expr_decrement) + { + process_expr(ctx, expr->lvalue); + } + else + { + process_expr(ctx, expr->rvalue); + process_expr(ctx, expr->lvalue); + } +} + +void decompiler::process_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr) +{ + process_expr(ctx, expr->lvalue); + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr) +{ + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr) +{ + process_expr(ctx, expr->rvalue); +} + +void decompiler::process_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + if(expr->func.as_node->type == gsc::node_t::expr_call_pointer) + { + process_expr_call_pointer(ctx, expr); + } + else + { + process_expr_call_function(ctx, expr); + } +} + +void decompiler::process_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + process_expr_arguments(ctx, expr->func.as_pointer->args); + + if(expr->obj.as_node->type != gsc::node_t::null) + process_expr(ctx, expr->obj); + + process_expr(ctx, expr->func.as_pointer->expr); +} + +void decompiler::process_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr) +{ + process_expr_arguments(ctx, expr->func.as_func->args); + + if(expr->obj.as_node->type != gsc::node_t::null) + process_expr(ctx, expr->obj); +} + +void decompiler::process_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& args) +{ + for(auto i = args->list.size(); i > 0; i--) + { + process_expr(ctx, args->list.at(i - 1)); + } +} + +void decompiler::process_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& expr) +{ + return; +} + +void decompiler::process_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr) +{ + for(auto& arg : expr->args->list) + { + process_expr(ctx, arg); + } +} + +void decompiler::process_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr) +{ + process_expr(ctx, expr->obj); +} + +void decompiler::process_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr) +{ + process_expr(ctx, expr->key); + process_expr(ctx, expr->obj); +} + +void decompiler::process_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr) +{ + process_expr(ctx, expr->obj); +} + +void decompiler::process_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr) +{ + return; +} + +void decompiler::process_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec) +{ + process_expr(ctx, vec->z); + process_expr(ctx, vec->y); + process_expr(ctx, vec->x); +} + +void decompiler::process_var_create(const gsc::context_ptr& ctx, gsc::expr_ptr& expr, bool fromstmt) +{ + if(fromstmt) + { + auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); + ctx->local_vars_create_count++; + } + else + { + for(auto& entry : expr.as_asm_create->vars) + { + ctx->local_vars.push_back({ utils::string::va("var_%d", std::stoi(entry)), static_cast(std::stoi(entry)), true }); + ctx->local_vars_create_count++; + } + + auto var = utils::string::va("var_%d", std::stoi(expr.as_asm_create->index)); + ctx->local_vars.push_back({ var, static_cast(std::stoi(expr.as_asm_create->index)), true }); + ctx->local_vars_create_count++; + + expr = gsc::expr_ptr(std::make_unique(var)); + } +} + +void decompiler::process_var_access(const gsc::context_ptr& ctx, gsc::expr_ptr& expr) +{ + if(ctx->local_vars.size() <= std::stoi(expr.as_asm_access->index)) + { + printf("WARNING: bad local var access\n"); + } + else + { + auto var = ctx->local_vars.at(ctx->local_vars.size() - 1 - std::stoi(expr.as_asm_access->index)).name; + expr = gsc::expr_ptr(std::make_unique(var)); + } +} + +void decompiler::process_var_remove(const gsc::context_ptr& ctx, const gsc::asm_remove_ptr& expr) +{ + ctx->local_vars_public_count = ctx->local_vars.size() - std::stoi(expr->index); +} + +} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/decompiler.hpp b/src/s2/xsk/decompiler.hpp new file mode 100644 index 00000000..f90bd96f --- /dev/null +++ b/src/s2/xsk/decompiler.hpp @@ -0,0 +1,93 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::s2 +{ + +class decompiler : public gsc::decompiler +{ + std::string filename_; + std::unique_ptr output_; + gsc::program_ptr program_; + gsc::thread_ptr func_; + std::unordered_map labels_; + std::vector expr_labels_; + std::stack stack_; + std::vector blocks_; + +public: + auto output() -> std::vector; + void decompile(const std::string& file, std::vector& functions); + +private: + void decompile_function(const gsc::function_ptr& func); + void decompile_statements(const gsc::function_ptr& func); + void decompile_expr(); + void decompile_block(const gsc::stmt_list_ptr& block); + void decompile_nulls(const gsc::stmt_list_ptr& block); + void decompile_search_infinite(const gsc::stmt_list_ptr& block); + void decompile_search_loop(const gsc::stmt_list_ptr& block); + void decompile_search_switch(const gsc::stmt_list_ptr& block); + void decompile_search_ifelse(const gsc::stmt_list_ptr& block); + void decompile_break_continue(const gsc::stmt_list_ptr& block); + void decompile_if(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_last_ifelse(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_infinite(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_loop(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_while(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_for(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_foreach(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end); + void decompile_switch(const gsc::stmt_list_ptr& block, std::uint32_t start); + auto find_location_reference(const gsc::stmt_list_ptr& block, std::uint32_t start, std::uint32_t end, const std::string& location) -> bool; + auto find_location_index(const gsc::stmt_list_ptr& block, const std::string& location) -> std::uint32_t; + auto last_location_index(const gsc::stmt_list_ptr& block, std::uint32_t index) -> bool; + void process_stack(const gsc::thread_ptr& thread); + void process_parameters(const gsc::context_ptr& ctx, const gsc::parameters_ptr& params); + void process_stmt(const gsc::context_ptr& ctx, const gsc::stmt_ptr& stmt); + void process_stmt_list(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_stmt_call(const gsc::context_ptr& ctx, const gsc::stmt_call_ptr& stmt); + void process_stmt_assign(const gsc::context_ptr& ctx, const gsc::stmt_assign_ptr& stmt); + void process_stmt_endon(const gsc::context_ptr& ctx, const gsc::stmt_endon_ptr& stmt); + void process_stmt_notify(const gsc::context_ptr& ctx, const gsc::stmt_notify_ptr& stmt); + void process_stmt_wait(const gsc::context_ptr& ctx, const gsc::stmt_wait_ptr& stmt); + void process_stmt_waittill(const gsc::context_ptr& ctx, const gsc::stmt_waittill_ptr& stmt); + void process_stmt_waittillmatch(const gsc::context_ptr& ctx, const gsc::stmt_waittillmatch_ptr& stmt); + void process_stmt_waittillframeend(const gsc::context_ptr& ctx, const gsc::stmt_waittillframeend_ptr& stmt); + void process_stmt_if(const gsc::context_ptr& ctx, const gsc::stmt_if_ptr& stmt); + void process_stmt_ifelse(const gsc::context_ptr& ctx, const gsc::stmt_ifelse_ptr& stmt); + void process_stmt_while(const gsc::context_ptr& ctx, const gsc::stmt_while_ptr& stmt); + void process_stmt_for(const gsc::context_ptr& ctx, const gsc::stmt_for_ptr& stmt); + void process_stmt_foreach(const gsc::context_ptr& ctx, const gsc::stmt_foreach_ptr& stmt); + void process_stmt_switch(const gsc::context_ptr& ctx, const gsc::stmt_switch_ptr& stmt); + void process_stmt_cases(const gsc::context_ptr& ctx, const gsc::stmt_list_ptr& stmt); + void process_stmt_break(const gsc::context_ptr& ctx, const gsc::stmt_break_ptr& stmt); + void process_stmt_return(const gsc::context_ptr& ctx, const gsc::stmt_return_ptr& stmt); + void process_expr(const gsc::context_ptr& ctx, gsc::expr_ptr& expr); + void process_expr_assign(const gsc::context_ptr& ctx, const gsc::expr_assign_ptr& expr); + void process_expr_binary(const gsc::context_ptr& ctx, const gsc::expr_binary_ptr& expr); + void process_expr_and(const gsc::context_ptr& ctx, const gsc::expr_and_ptr& expr); + void process_expr_or(const gsc::context_ptr& ctx, const gsc::expr_or_ptr& expr); + void process_expr_complement(const gsc::context_ptr& ctx, const gsc::expr_complement_ptr& expr); + void process_expr_not(const gsc::context_ptr& ctx, const gsc::expr_not_ptr& expr); + void process_expr_call(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_call_pointer(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_call_function(const gsc::context_ptr& ctx, const gsc::expr_call_ptr& expr); + void process_expr_arguments(const gsc::context_ptr& ctx, const gsc::expr_arguments_ptr& arg_list); + void process_expr_function(const gsc::context_ptr& ctx, const gsc::expr_function_ptr& node); + void process_expr_add_array(const gsc::context_ptr& ctx, const gsc::expr_add_array_ptr& expr); + void process_expr_size(const gsc::context_ptr& ctx, const gsc::expr_size_ptr& expr); + void process_array_variable(const gsc::context_ptr& ctx, const gsc::expr_array_ptr& expr); + void process_field_variable(const gsc::context_ptr& ctx, const gsc::expr_field_ptr& expr); + void process_local_variable(const gsc::context_ptr& ctx, const gsc::name_ptr& expr); + void process_vector(const gsc::context_ptr& ctx, const gsc::vector_ptr& vec); + void process_var_create(const gsc::context_ptr& ctx, gsc::expr_ptr& expr, bool fromstmt = false); + void process_var_access(const gsc::context_ptr& ctx, gsc::expr_ptr& expr); + void process_var_remove(const gsc::context_ptr& ctx, const gsc::asm_remove_ptr& expr); +}; + +} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/disassembler.cpp b/src/s2/xsk/disassembler.cpp new file mode 100644 index 00000000..5ef31a6c --- /dev/null +++ b/src/s2/xsk/disassembler.cpp @@ -0,0 +1,573 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "s2.hpp" + +namespace xsk::gsc::s2 +{ + +auto disassembler::output() -> std::vector +{ + return std::move(functions_); +} + +auto disassembler::output_data() -> std::vector +{ + output_ = std::make_unique(0x100000); + + output_->write_string("// S2 PC GSCASM\n"); + output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); + + for (auto& func : functions_) + { + this->print_function(func); + } + + std::vector output; + + output.resize(output_->pos()); + memcpy(output.data(), output_->buffer().data(), output.size()); + + return output; +} + +void disassembler::disassemble(const std::string& file, std::vector& script, std::vector& stack) +{ + filename_ = file; + script_ = std::make_unique(script); + stack_ = std::make_unique(stack); + functions_.clear(); + + script_->seek(1); + + while (stack_->is_avail() && script_->is_avail()) + { + functions_.push_back(std::make_unique()); + auto& func = functions_.back(); + + func->index = static_cast(script_->pos()); + func->size = stack_->read(); + func->id = stack_->read(); + func->name = "sub_"s + (func->id == 0 ? stack_->read_c_string() : resolver::token_name(func->id)); + + this->dissasemble_function(func); + + func->labels = labels_; + labels_.clear(); + } + + this->resolve_local_functions(); +} + +void disassembler::dissasemble_function(const gsc::function_ptr& func) +{ + auto size = func->size; + + while (size > 0) + { + func->instructions.push_back(std::make_unique()); + + auto& inst = func->instructions.back(); + inst->index = static_cast(script_->pos()); + inst->opcode = script_->read(); + inst->size = opcode_size(inst->opcode); + + this->dissasemble_instruction(inst); + + size -= inst->size; + } +} + +void disassembler::dissasemble_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_Return: + case opcode::OP_BoolNot: + case opcode::OP_CastBool: + case opcode::OP_inequality: + case opcode::OP_GetThisthread: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_checkclearparams: + case opcode::OP_CastFieldObject: + case opcode::OP_End: + case opcode::OP_size: + case opcode::OP_EmptyArray: + case opcode::OP_bit_and: + case opcode::OP_less_equal: + case opcode::OP_voidCodepos: + case opcode::OP_ClearVariableField: + case opcode::OP_divide: + case opcode::OP_GetSelf: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_plus: + case opcode::OP_BoolComplement: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_inc: + case opcode::OP_clearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_endon: + case opcode::OP_greater_equal: + case opcode::OP_GetSelfObject: + case opcode::OP_SetVariableField: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_less: + case opcode::OP_GetGameRef: + case opcode::OP_waitFrame: + case opcode::OP_waittillFrameEnd: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_notify: + case opcode::OP_DecTop: + case opcode::OP_shift_left: + case opcode::OP_greater: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_minus: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_multiply: + case opcode::OP_mod: + case opcode::OP_GetGame: + case opcode::OP_waittill: + case opcode::OP_dec: + case opcode::OP_PreScriptCall: + case opcode::OP_GetAnim: + case opcode::OP_GetUndefined: + case opcode::OP_GetAnimObject: + case opcode::OP_GetLevelObject: + case opcode::OP_bit_ex_or: + case opcode::OP_equality: + case opcode::OP_ClearArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalArray: + case opcode::OP_vector: + case opcode::OP_bit_or: + case opcode::OP_AddArray: + case opcode::OP_waittillmatch2: + case opcode::OP_shift_right: + case opcode::OP_BoolNotAfterAnd: + break; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetInteger: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetFloat: + inst->data.push_back(utils::string::va("%g", script_->read())); + break; + case opcode::OP_GetVector: + inst->data.push_back(utils::string::va("%g", script_->read())); + inst->data.push_back(utils::string::va("%g", script_->read())); + inst->data.push_back(utils::string::va("%g", script_->read())); + break; + case opcode::OP_GetString: + case opcode::OP_GetIString: + script_->seek(4); + inst->data.push_back(utils::string::to_literal(stack_->read_c_string())); + break; + case opcode::OP_GetAnimation: + script_->seek(8); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + break; + case opcode::OP_GetAnimTree: + script_->seek(1); + inst->data.push_back(utils::string::quote(stack_->read_c_string().data(), false)); + break; + case opcode::OP_waittillmatch: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_EvalLocalArrayCached: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + this->disassemble_field_variable(inst); + break; + case opcode::OP_CallBuiltinPointer: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_ScriptMethodChildThreadCallPointer: + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalMethodCall: + this->disassemble_local_call(inst, false); + break; + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + this->disassemble_local_call(inst, true); + break; + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_ScriptFarMethodCall: + this->disassemble_far_call(inst, false); + break; + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + this->disassemble_far_call(inst, true); + break; + case opcode::OP_CallBuiltin: + this->disassemble_builtin_call(inst, false, true); + break; + case opcode::OP_CallBuiltinMethod: + this->disassemble_builtin_call(inst, true, true); + break; + case opcode::OP_GetBuiltinFunction: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + this->disassemble_builtin_call(inst, false, false); + break; + case opcode::OP_GetBuiltinMethod: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + this->disassemble_builtin_call(inst, true, false); + break; + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + this->disassemble_jump(inst, true, false); + break; + case opcode::OP_jumpback: + this->disassemble_jump(inst, false, true); + break; + case opcode::OP_jump: + this->disassemble_jump(inst, false, false); + break; + case opcode::OP_switch: + this->disassemble_switch(inst); + break; + case opcode::OP_endswitch: + this->disassemble_end_switch(inst); + break; + default: + throw gsc::disasm_error(utils::string::va("Unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); + } +} + +void disassembler::disassemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num) +{ + if (arg_num) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } + + if (method) + { + inst->data.push_back(resolver::method_name(script_->read())); + } + else + { + inst->data.push_back(resolver::function_name(script_->read())); + } +} + +void disassembler::disassemble_local_call(const gsc::instruction_ptr& inst, bool thread) +{ + std::int32_t offset = this->disassemble_offset(); + + inst->data.push_back(utils::string::va("%X", offset + inst->index + 1)); + + if (thread) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } +} + +void disassembler::disassemble_far_call(const gsc::instruction_ptr& inst, bool thread) +{ + script_->seek(3); + + if (thread) + { + inst->data.push_back(utils::string::va("%i", script_->read())); + } + + auto file_id = stack_->read(); + auto file_name = file_id == 0 ? stack_->read_c_string() : resolver::file_name(file_id); + auto func_id = stack_->read(); + auto func_name = func_id == 0 ? stack_->read_c_string() : resolver::token_name(func_id); + + inst->data.push_back(file_name != "" ? file_name : utils::string::va("_ID%i", file_id)); + inst->data.push_back(func_name != "" ? func_name : utils::string::va("_ID%i", func_id)); +} + +void disassembler::disassemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back) +{ + std::int32_t addr; + std::string label; + + if (expr) + { + addr = inst->index + 3 + script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + else if (back) + { + addr = inst->index + 3 - script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + else + { + addr = inst->index + 5 + script_->read(); + label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + } + + labels_.insert({addr, label}); +} + +void disassembler::disassemble_field_variable(const gsc::instruction_ptr& inst) +{ + std::uint16_t field_id = script_->read(); + std::string field_name; + + if(field_id > 0xACEE) + { + auto temp = stack_->read(); + field_name = temp == 0 ? stack_->read_c_string() : std::to_string(temp); + } + else + { + field_name = resolver::token_name(field_id); + } + + inst->data.push_back(field_name != "" ? field_name : utils::string::va("_ID%i", field_id)); +} + +void disassembler::disassemble_switch(const gsc::instruction_ptr& inst) +{ + std::int32_t addr = inst->index + 4 + script_->read(); + std::string label = utils::string::va("loc_%X", addr); + + inst->data.push_back(label); + labels_.insert({addr, label}); +} + +void disassembler::disassemble_end_switch(const gsc::instruction_ptr& inst) +{ + std::uint16_t case_num = script_->read(); + inst->data.push_back(utils::string::va("%i", case_num)); + + std::uint32_t internal_index = inst->index + 3; + + if (case_num) + { + for (auto i = case_num; i > 0; i--) + { + std::uint32_t case_label = script_->read(); + + if (case_label < 0x40000 && case_label > 0) + { + inst->data.push_back("case"); + inst->data.push_back(utils::string::quote(stack_->read_c_string(), false)); + } + else if (case_label == 0) + { + inst->data.push_back("default"); + stack_->read(); + } + else + { + inst->data.push_back("case"); + inst->data.push_back(utils::string::va("%i", (case_label - 0x800000) & 0xFFFFFF)); + } + + inst->size += 4; + internal_index += 4; + + auto addr = this->disassemble_offset() + internal_index; + std::string label = utils::string::va("loc_%X", addr); + inst->data.push_back(label); + + labels_.insert({addr, label}); + + inst->size += 3; + internal_index += 3; + } + } +} + +auto disassembler::disassemble_offset() -> std::int32_t +{ + std::array bytes = {}; + + for (auto i = 0; i < 3; i++) + { + bytes[i] = script_->read(); + } + + std::int32_t offset = *reinterpret_cast(bytes.data()); + + offset = (offset << 8) >> 8; + + return offset; +} + +void disassembler::resolve_local_functions() +{ + for (auto& func : functions_) + { + for (auto& inst : func->instructions) + { + switch (opcode(inst->opcode)) + { + case opcode::OP_GetLocalFunction: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + inst->data.at(0) = this->resolve_function(inst->data[0]); + break; + default: + break; + } + } + } +} + +auto disassembler::resolve_function(const std::string& index) -> std::string +{ + if (utils::string::is_hex_number(index)) + { + std::uint32_t idx = std::stoul(index, nullptr, 16); + + for (auto& func : functions_) + { + if (func->index == idx) + { + return func->name; + } + } + + throw gsc::disasm_error(utils::string::va("Couldn't resolve function name at index '0x%04X'!", idx)); + } + + throw gsc::disasm_error(utils::string::va("\"%s\" is not valid function address!", index.data())); +} + +void disassembler::print_function(const gsc::function_ptr& func) +{ + output_->write_string("\n"); + output_->write_string(utils::string::va("%s\n", func->name.data())); + + for (auto& inst : func->instructions) + { + const auto itr = func->labels.find(inst->index); + + if (itr != func->labels.end()) + { + output_->write_string(utils::string::va("\t%s\n", itr->second.data())); + } + + this->print_instruction(inst); + } + + output_->write_string("\n"); + output_->write_string(utils::string::va("end_%s\n", func->name.substr(4).data())); +} + +void disassembler::print_instruction(const gsc::instruction_ptr& inst) +{ + switch (opcode(inst->opcode)) + { + case opcode::OP_endswitch: + output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); + output_->write_string(utils::string::va(" %s\n", inst->data[0].data())); + { + std::uint32_t totalcase = std::stoul(inst->data[0]); + auto index = 0; + for (auto casenum = 0u; casenum < totalcase; casenum++) + { + if (inst->data[1 + index] == "case") + { + output_->write_string(utils::string::va("\t\t\t%s %s %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data(), inst->data[1 + index + 2].data())); + index += 3; + } + else if (inst->data[1 + index] == "default") + { + output_->write_string(utils::string::va("\t\t\t%s %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data())); + index += 2; + } + if (casenum != totalcase - 1) + { + output_->write_string("\n"); + } + } + } + break; + default: + output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); + for (auto& d : inst->data) + { + output_->write_string(utils::string::va(" %s", d.data())); + } + break; + } + + output_->write_string("\n"); +} + +} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/disassembler.hpp b/src/s2/xsk/disassembler.hpp new file mode 100644 index 00000000..ae3707d6 --- /dev/null +++ b/src/s2/xsk/disassembler.hpp @@ -0,0 +1,42 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::s2 +{ + +class disassembler : public gsc::disassembler +{ + std::string filename_; + utils::byte_buffer_ptr script_; + utils::byte_buffer_ptr stack_; + utils::byte_buffer_ptr output_; + std::vector functions_; + std::unordered_map labels_; + +public: + auto output() -> std::vector; + auto output_data() -> std::vector; + void disassemble(const std::string& file, std::vector& script, std::vector& stack); + +private: + void dissasemble_function(const gsc::function_ptr& func); + void dissasemble_instruction(const gsc::instruction_ptr& inst); + void disassemble_builtin_call(const gsc::instruction_ptr& inst, bool method, bool arg_num); + void disassemble_local_call(const gsc::instruction_ptr& inst, bool thread); + void disassemble_far_call(const gsc::instruction_ptr& inst, bool thread); + void disassemble_jump(const gsc::instruction_ptr& inst, bool expr, bool back); + void disassemble_field_variable(const gsc::instruction_ptr& inst); + void disassemble_switch(const gsc::instruction_ptr& inst); + void disassemble_end_switch(const gsc::instruction_ptr& inst); + auto disassemble_offset() -> std::int32_t; + void resolve_local_functions(); + auto resolve_function(const std::string& index) -> std::string; + void print_function(const gsc::function_ptr& func); + void print_instruction(const gsc::instruction_ptr& inst); +}; + +} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/lexer.cpp b/src/s2/xsk/lexer.cpp new file mode 100644 index 00000000..32c82aaa --- /dev/null +++ b/src/s2/xsk/lexer.cpp @@ -0,0 +1,2826 @@ +#line 1 "lexer.cpp" +#include "stdafx.hpp" +#include "s2.hpp" +#include "parser.hpp" +using namespace xsk::gsc; + +#line 7 "lexer.cpp" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define s2__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer s2__create_buffer +#endif + +#ifdef yy_delete_buffer +#define s2__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer s2__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define s2__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer s2__scan_buffer +#endif + +#ifdef yy_scan_string +#define s2__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string s2__scan_string +#endif + +#ifdef yy_scan_bytes +#define s2__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes s2__scan_bytes +#endif + +#ifdef yy_init_buffer +#define s2__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer s2__init_buffer +#endif + +#ifdef yy_flush_buffer +#define s2__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer s2__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define s2__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state s2__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define s2__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer s2__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define s2_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state s2_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define s2_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state s2_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define s2_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack s2_ensure_buffer_stack +#endif + +#ifdef yylex +#define s2_lex_ALREADY_DEFINED +#else +#define yylex s2_lex +#endif + +#ifdef yyrestart +#define s2_restart_ALREADY_DEFINED +#else +#define yyrestart s2_restart +#endif + +#ifdef yylex_init +#define s2_lex_init_ALREADY_DEFINED +#else +#define yylex_init s2_lex_init +#endif + +#ifdef yylex_init_extra +#define s2_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra s2_lex_init_extra +#endif + +#ifdef yylex_destroy +#define s2_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy s2_lex_destroy +#endif + +#ifdef yyget_debug +#define s2_get_debug_ALREADY_DEFINED +#else +#define yyget_debug s2_get_debug +#endif + +#ifdef yyset_debug +#define s2_set_debug_ALREADY_DEFINED +#else +#define yyset_debug s2_set_debug +#endif + +#ifdef yyget_extra +#define s2_get_extra_ALREADY_DEFINED +#else +#define yyget_extra s2_get_extra +#endif + +#ifdef yyset_extra +#define s2_set_extra_ALREADY_DEFINED +#else +#define yyset_extra s2_set_extra +#endif + +#ifdef yyget_in +#define s2_get_in_ALREADY_DEFINED +#else +#define yyget_in s2_get_in +#endif + +#ifdef yyset_in +#define s2_set_in_ALREADY_DEFINED +#else +#define yyset_in s2_set_in +#endif + +#ifdef yyget_out +#define s2_get_out_ALREADY_DEFINED +#else +#define yyget_out s2_get_out +#endif + +#ifdef yyset_out +#define s2_set_out_ALREADY_DEFINED +#else +#define yyset_out s2_set_out +#endif + +#ifdef yyget_leng +#define s2_get_leng_ALREADY_DEFINED +#else +#define yyget_leng s2_get_leng +#endif + +#ifdef yyget_text +#define s2_get_text_ALREADY_DEFINED +#else +#define yyget_text s2_get_text +#endif + +#ifdef yyget_lineno +#define s2_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno s2_get_lineno +#endif + +#ifdef yyset_lineno +#define s2_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno s2_set_lineno +#endif + +#ifdef yyget_column +#define s2_get_column_ALREADY_DEFINED +#else +#define yyget_column s2_get_column +#endif + +#ifdef yyset_column +#define s2_set_column_ALREADY_DEFINED +#else +#define yyset_column s2_set_column +#endif + +#ifdef yywrap +#define s2_wrap_ALREADY_DEFINED +#else +#define yywrap s2_wrap +#endif + +#ifdef yyalloc +#define s2_alloc_ALREADY_DEFINED +#else +#define yyalloc s2_alloc +#endif + +#ifdef yyrealloc +#define s2_realloc_ALREADY_DEFINED +#else +#define yyrealloc s2_realloc +#endif + +#ifdef yyfree +#define s2_free_ALREADY_DEFINED +#else +#define yyfree s2_free +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. + */ +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yyg->yy_start = 1 + 2 * +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yyg->yy_start - 1) / 2) +#define YYSTATE YY_START +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +#define yy_new_buffer yy_create_buffer +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define s2_wrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP +typedef flex_uint8_t YY_CHAR; + +typedef int yy_state_type; + +#define yytext_ptr yytext_r + +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yyg->yy_c_buf_p = yy_cp; +#define YY_NUM_RULES 97 +#define YY_END_OF_BUFFER 98 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[286] = + { 0, + 0, 0, 0, 0, 0, 0, 98, 96, 1, 2, + 85, 96, 96, 84, 88, 96, 46, 47, 82, 80, + 52, 81, 53, 83, 95, 55, 56, 69, 79, 70, + 91, 50, 51, 89, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 48, + 87, 49, 86, 5, 6, 5, 9, 10, 9, 66, + 0, 93, 0, 0, 0, 0, 75, 0, 64, 0, + 77, 0, 0, 73, 57, 71, 58, 72, 94, 8, + 4, 3, 74, 94, 95, 0, 0, 54, 61, 67, + 65, 68, 62, 91, 78, 91, 91, 91, 91, 91, + + 91, 91, 91, 91, 91, 91, 22, 27, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 91, 76, + 63, 7, 11, 0, 93, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 0, 93, 0, 94, 3, 94, + 94, 90, 59, 60, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 25, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 91, 0, 0, + 0, 0, 92, 0, 0, 92, 0, 44, 91, 37, + 29, 91, 91, 91, 23, 91, 91, 91, 42, 91, + 91, 91, 43, 41, 91, 91, 91, 38, 91, 17, + + 91, 0, 0, 0, 31, 91, 91, 91, 15, 39, + 91, 45, 91, 91, 91, 91, 91, 91, 91, 91, + 24, 0, 0, 0, 91, 91, 91, 91, 16, 33, + 28, 91, 34, 91, 91, 91, 0, 0, 0, 91, + 91, 30, 26, 91, 91, 91, 91, 0, 12, 0, + 91, 32, 91, 91, 91, 18, 14, 0, 91, 91, + 40, 21, 91, 91, 0, 91, 36, 91, 91, 0, + 35, 91, 91, 0, 91, 91, 0, 91, 19, 0, + 91, 13, 91, 20, 0 + } ; + +static const YY_CHAR yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 5, 6, 1, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, + 22, 23, 1, 1, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 25, 26, 27, 28, 29, 1, 30, 31, 32, 33, + + 34, 35, 36, 37, 38, 24, 39, 40, 41, 42, + 43, 24, 24, 44, 45, 46, 47, 48, 49, 24, + 50, 51, 52, 53, 54, 55, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static const YY_CHAR yy_meta[56] = + { 0, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 1, 4, 1, 1, + 1, 1, 1, 4, 1, 5, 1, 1, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 1, 1, 1, 1 + } ; + +static const flex_int16_t yy_base[300] = + { 0, + 0, 0, 53, 54, 55, 56, 540, 541, 541, 541, + 517, 55, 33, 516, 64, 58, 541, 541, 515, 55, + 541, 60, 518, 73, 71, 516, 541, 70, 512, 71, + 507, 541, 541, 510, 57, 44, 70, 72, 75, 78, + 48, 76, 86, 79, 90, 93, 88, 84, 103, 541, + 81, 541, 541, 541, 541, 514, 541, 541, 513, 541, + 104, 541, 132, 487, 486, 482, 541, 118, 541, 119, + 541, 127, 138, 541, 541, 541, 541, 541, 120, 541, + 541, 0, 541, 121, 133, 134, 0, 541, 504, 541, + 541, 541, 503, 498, 541, 38, 120, 117, 135, 126, + + 137, 122, 143, 139, 140, 144, 497, 496, 145, 148, + 149, 151, 152, 154, 160, 155, 156, 161, 162, 541, + 541, 541, 541, 185, 191, 202, 483, 488, 481, 192, + 541, 203, 200, 207, 204, 205, 212, 541, 0, 201, + 541, 492, 541, 541, 186, 194, 197, 206, 199, 196, + 215, 209, 208, 218, 220, 221, 222, 223, 224, 227, + 226, 231, 233, 232, 238, 239, 241, 242, 476, 476, + 473, 264, 265, 271, 266, 270, 277, 488, 255, 487, + 486, 262, 263, 257, 485, 258, 259, 272, 484, 273, + 279, 157, 483, 482, 280, 281, 285, 481, 282, 283, + + 290, 460, 458, 468, 477, 284, 293, 294, 476, 475, + 296, 474, 295, 297, 299, 300, 305, 306, 307, 314, + 473, 454, 464, 467, 316, 315, 317, 320, 469, 468, + 467, 321, 466, 322, 324, 329, 457, 456, 459, 323, + 332, 462, 461, 334, 344, 330, 333, 452, 541, 443, + 346, 458, 349, 348, 350, 351, 541, 445, 357, 356, + 456, 455, 359, 364, 426, 362, 393, 367, 365, 372, + 391, 372, 370, 371, 373, 375, 380, 374, 384, 372, + 378, 541, 383, 379, 541, 420, 425, 430, 435, 438, + 440, 445, 450, 455, 460, 465, 357, 470, 475 + + } ; + +static const flex_int16_t yy_def[300] = + { 0, + 285, 1, 286, 286, 287, 287, 285, 285, 285, 285, + 285, 288, 285, 285, 285, 289, 285, 285, 285, 285, + 285, 285, 285, 285, 290, 285, 285, 285, 285, 285, + 291, 285, 285, 285, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 288, 285, 292, 285, 285, 285, 285, 293, 285, 294, + 285, 289, 295, 285, 285, 285, 285, 285, 285, 285, + 285, 296, 285, 285, 290, 290, 297, 285, 285, 285, + 285, 285, 285, 291, 285, 291, 291, 291, 291, 291, + + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 285, + 285, 285, 285, 288, 288, 292, 285, 285, 285, 293, + 285, 298, 294, 299, 289, 289, 295, 285, 296, 285, + 285, 297, 285, 285, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 285, 285, + 285, 293, 293, 298, 294, 294, 299, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + + 291, 285, 285, 285, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 285, 285, 285, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 285, 285, 285, 291, + 291, 291, 291, 291, 291, 291, 291, 285, 285, 285, + 291, 291, 291, 291, 291, 291, 285, 285, 291, 291, + 291, 291, 291, 291, 285, 291, 291, 291, 291, 285, + 291, 291, 291, 285, 291, 291, 285, 291, 291, 285, + 291, 285, 291, 291, 0, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285 + + } ; + +static const flex_int16_t yy_nxt[597] = + { 0, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 8, 33, 34, 31, 35, + 36, 37, 38, 39, 40, 41, 31, 42, 31, 43, + 31, 44, 31, 45, 46, 47, 48, 31, 49, 31, + 31, 50, 51, 52, 53, 55, 55, 58, 58, 62, + 59, 59, 64, 87, 56, 56, 62, 75, 68, 87, + 65, 69, 70, 87, 77, 145, 76, 106, 80, 66, + 63, 78, 87, 73, 81, 71, 84, 97, 85, 82, + 89, 90, 92, 93, 83, 87, 87, 87, 96, 98, + + 87, 87, 120, 87, 87, 101, 99, 104, 62, 87, + 107, 87, 100, 87, 102, 87, 103, 108, 87, 109, + 105, 110, 131, 111, 115, 117, 112, 131, 87, 63, + 113, 116, 118, 121, 61, 62, 125, 79, 140, 119, + 72, 114, 87, 132, 134, 87, 136, 87, 84, 285, + 85, 87, 73, 146, 138, 141, 147, 126, 87, 87, + 87, 148, 87, 137, 87, 87, 152, 150, 87, 87, + 87, 151, 149, 87, 87, 153, 87, 87, 154, 87, + 87, 87, 87, 155, 156, 87, 87, 87, 166, 62, + 160, 162, 157, 158, 159, 62, 131, 163, 167, 168, + + 214, 165, 161, 164, 61, 130, 125, 173, 131, 133, + 63, 87, 62, 62, 72, 176, 63, 132, 140, 87, + 136, 87, 87, 179, 87, 134, 178, 126, 174, 73, + 73, 87, 177, 87, 87, 141, 180, 137, 182, 181, + 87, 183, 185, 87, 184, 87, 87, 87, 87, 87, + 186, 87, 87, 188, 189, 190, 87, 87, 87, 194, + 191, 193, 187, 87, 87, 197, 87, 87, 131, 131, + 192, 198, 199, 130, 131, 173, 195, 196, 131, 133, + 87, 201, 87, 87, 87, 176, 200, 87, 87, 132, + 132, 134, 210, 205, 206, 134, 174, 87, 87, 209, + + 207, 211, 177, 208, 87, 87, 87, 87, 87, 87, + 87, 215, 212, 213, 217, 87, 218, 219, 87, 87, + 87, 87, 87, 221, 87, 87, 216, 228, 220, 225, + 87, 87, 87, 227, 226, 231, 232, 233, 230, 87, + 87, 87, 87, 234, 229, 87, 87, 87, 87, 87, + 235, 236, 240, 246, 87, 87, 243, 87, 87, 87, + 142, 241, 242, 245, 244, 252, 251, 253, 247, 87, + 255, 87, 256, 87, 87, 87, 87, 254, 260, 259, + 261, 87, 87, 262, 87, 263, 266, 87, 267, 87, + 87, 264, 87, 269, 271, 87, 272, 87, 87, 87, + + 87, 276, 268, 87, 87, 282, 278, 281, 87, 87, + 273, 279, 275, 280, 277, 284, 87, 274, 87, 283, + 54, 54, 54, 54, 54, 57, 57, 57, 57, 57, + 61, 61, 61, 61, 61, 72, 72, 72, 72, 72, + 86, 86, 86, 94, 94, 124, 124, 124, 124, 124, + 130, 130, 130, 130, 130, 133, 133, 133, 133, 133, + 135, 135, 135, 135, 135, 139, 270, 139, 139, 139, + 172, 172, 172, 172, 172, 175, 175, 175, 175, 175, + 87, 87, 265, 87, 258, 257, 87, 87, 250, 249, + 248, 87, 87, 87, 87, 239, 238, 237, 87, 87, + + 87, 87, 87, 224, 223, 222, 87, 87, 87, 87, + 87, 87, 87, 87, 204, 203, 202, 87, 171, 170, + 169, 87, 87, 87, 144, 143, 129, 128, 127, 123, + 122, 95, 87, 91, 88, 79, 74, 67, 60, 285, + 7, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285 + + } ; + +static const flex_int16_t yy_chk[597] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 4, 5, 6, 12, + 5, 6, 13, 96, 3, 4, 16, 20, 15, 36, + 13, 15, 15, 41, 22, 96, 20, 41, 24, 13, + 12, 22, 35, 16, 24, 15, 25, 36, 25, 24, + 28, 28, 30, 30, 24, 37, 25, 38, 35, 37, + + 39, 42, 51, 40, 44, 38, 37, 40, 61, 48, + 42, 43, 37, 47, 39, 45, 39, 42, 46, 43, + 40, 44, 68, 45, 47, 48, 46, 70, 49, 61, + 46, 47, 49, 51, 63, 72, 63, 79, 84, 49, + 73, 46, 98, 68, 70, 97, 73, 102, 85, 86, + 85, 100, 72, 97, 79, 84, 98, 63, 85, 86, + 99, 98, 101, 73, 104, 105, 102, 100, 103, 106, + 109, 101, 99, 110, 111, 103, 112, 113, 104, 114, + 116, 117, 192, 105, 106, 115, 118, 119, 117, 124, + 112, 114, 109, 110, 111, 125, 130, 115, 118, 119, + + 192, 116, 113, 115, 126, 132, 126, 132, 133, 134, + 124, 145, 135, 136, 137, 134, 125, 130, 140, 146, + 137, 150, 147, 146, 149, 133, 145, 126, 132, 135, + 136, 148, 134, 153, 152, 140, 147, 137, 149, 148, + 151, 150, 152, 154, 151, 155, 156, 157, 158, 159, + 153, 161, 160, 155, 156, 157, 162, 164, 163, 161, + 158, 160, 154, 165, 166, 164, 167, 168, 172, 173, + 159, 165, 166, 174, 175, 174, 162, 163, 176, 177, + 179, 168, 184, 186, 187, 177, 167, 182, 183, 172, + 173, 175, 187, 179, 182, 176, 174, 188, 190, 186, + + 183, 188, 177, 184, 191, 195, 196, 199, 200, 206, + 197, 195, 190, 191, 197, 201, 199, 200, 207, 208, + 213, 211, 214, 201, 215, 216, 196, 211, 200, 206, + 217, 218, 219, 208, 207, 215, 216, 217, 214, 220, + 226, 225, 227, 218, 213, 228, 232, 234, 240, 235, + 219, 220, 225, 235, 236, 246, 228, 241, 247, 244, + 297, 226, 227, 234, 232, 241, 240, 244, 236, 245, + 246, 251, 247, 254, 253, 255, 256, 245, 253, 251, + 254, 260, 259, 255, 263, 256, 259, 266, 260, 264, + 269, 256, 268, 264, 266, 273, 268, 272, 275, 278, + + 276, 273, 263, 281, 284, 280, 275, 278, 283, 279, + 269, 276, 272, 277, 274, 283, 271, 270, 267, 281, + 286, 286, 286, 286, 286, 287, 287, 287, 287, 287, + 288, 288, 288, 288, 288, 289, 289, 289, 289, 289, + 290, 290, 290, 291, 291, 292, 292, 292, 292, 292, + 293, 293, 293, 293, 293, 294, 294, 294, 294, 294, + 295, 295, 295, 295, 295, 296, 265, 296, 296, 296, + 298, 298, 298, 298, 298, 299, 299, 299, 299, 299, + 262, 261, 258, 252, 250, 248, 243, 242, 239, 238, + 237, 233, 231, 230, 229, 224, 223, 222, 221, 212, + + 210, 209, 205, 204, 203, 202, 198, 194, 193, 189, + 185, 181, 180, 178, 171, 170, 169, 142, 129, 128, + 127, 108, 107, 94, 93, 89, 66, 65, 64, 59, + 56, 34, 31, 29, 26, 23, 19, 14, 11, 7, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285 + + } ; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +#line 1 "lexer.lpp" +/* Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ +#define YY_NO_INPUT 1 +#define YY_NO_UNISTD_H 1 + +#line 23 "lexer.lpp" +#define YY_USER_ACTION loc.columns(yyleng); +#line 874 "lexer.cpp" + +#line 876 "lexer.cpp" + +#define INITIAL 0 +#define COMMENT_BLOCK_STATE 1 +#define DEVELOPER_BLOCK_STATE 2 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +/* Holds the entire state of the reentrant scanner. */ +struct yyguts_t + { + + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; + + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + int yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + int yylineno_r; + int yy_flex_debug_r; + + char *yytext_r; + int yy_more_flag; + int yy_more_len; + + }; /* end struct yyguts_t */ + +static int yy_init_globals ( yyscan_t yyscanner ); + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput ( yyscan_t yyscanner ); +#else +static int input ( yyscan_t yyscanner ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + int n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK /*LINTED*/break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_load_buffer_state( yyscanner ); + } + + { +#line 36 "lexer.lpp" + + + +#line 40 "lexer.lpp" + loc.step(); + + +#line 1144 "lexer.cpp" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yyg->yy_start; +yy_match: + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 286 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + ++yy_cp; + } + while ( yy_current_state != 285 ); + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 43 "lexer.lpp" +{ loc.step(); } + YY_BREAK +case 2: +/* rule 2 can match eol */ +YY_RULE_SETUP +#line 45 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 47 "lexer.lpp" + + YY_BREAK +case 4: +YY_RULE_SETUP +#line 49 "lexer.lpp" +{ BEGIN(COMMENT_BLOCK_STATE); } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 50 "lexer.lpp" + + YY_BREAK +case 6: +/* rule 6 can match eol */ +YY_RULE_SETUP +#line 51 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 52 "lexer.lpp" +{ BEGIN(INITIAL); } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 54 "lexer.lpp" +{ BEGIN(DEVELOPER_BLOCK_STATE); } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 55 "lexer.lpp" + + YY_BREAK +case 10: +/* rule 10 can match eol */ +YY_RULE_SETUP +#line 56 "lexer.lpp" +{ loc.lines(yyleng); loc.step(); } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 57 "lexer.lpp" +{ BEGIN(INITIAL); } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 59 "lexer.lpp" +{ return s2::parser::make_INCLUDE(loc); } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 60 "lexer.lpp" +{ return s2::parser::make_USINGTREE(loc); } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 61 "lexer.lpp" +{ return s2::parser::make_ANIMTREE(loc); } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 62 "lexer.lpp" +{ return s2::parser::make_ENDON(loc); } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 63 "lexer.lpp" +{ return s2::parser::make_NOTIFY(loc); } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 64 "lexer.lpp" +{ return s2::parser::make_WAIT(loc); } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 65 "lexer.lpp" +{ return s2::parser::make_WAITTILL(loc); } + YY_BREAK +case 19: +YY_RULE_SETUP +#line 66 "lexer.lpp" +{ return s2::parser::make_WAITTILLMATCH(loc); } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 67 "lexer.lpp" +{ return s2::parser::make_WAITTILLFRAMEEND(loc); } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 68 "lexer.lpp" +{ return s2::parser::make_WAITFRAME(loc); } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 69 "lexer.lpp" +{ return s2::parser::make_IF(loc); } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 70 "lexer.lpp" +{ return s2::parser::make_ELSE(loc); } + YY_BREAK +case 24: +YY_RULE_SETUP +#line 71 "lexer.lpp" +{ return s2::parser::make_WHILE(loc); } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 72 "lexer.lpp" +{ return s2::parser::make_FOR(loc); } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 73 "lexer.lpp" +{ return s2::parser::make_FOREACH(loc); } + YY_BREAK +case 27: +YY_RULE_SETUP +#line 74 "lexer.lpp" +{ return s2::parser::make_IN(loc); } + YY_BREAK +case 28: +YY_RULE_SETUP +#line 75 "lexer.lpp" +{ return s2::parser::make_SWITCH(loc); } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 76 "lexer.lpp" +{ return s2::parser::make_CASE(loc); } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 77 "lexer.lpp" +{ return s2::parser::make_DEFAULT(loc); } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 78 "lexer.lpp" +{ return s2::parser::make_BREAK(loc); } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 79 "lexer.lpp" +{ return s2::parser::make_CONTINUE(loc); } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 80 "lexer.lpp" +{ return s2::parser::make_RETURN(loc); } + YY_BREAK +case 34: +YY_RULE_SETUP +#line 81 "lexer.lpp" +{ return s2::parser::make_THREAD(loc); } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 82 "lexer.lpp" +{ return s2::parser::make_CHILDTHREAD(loc); } + YY_BREAK +case 36: +YY_RULE_SETUP +#line 83 "lexer.lpp" +{ return s2::parser::make_THISTHREAD(loc); } + YY_BREAK +case 37: +YY_RULE_SETUP +#line 84 "lexer.lpp" +{ return s2::parser::make_CALL(loc); } + YY_BREAK +case 38: +YY_RULE_SETUP +#line 85 "lexer.lpp" +{ return s2::parser::make_TRUE(loc); } + YY_BREAK +case 39: +YY_RULE_SETUP +#line 86 "lexer.lpp" +{ return s2::parser::make_FALSE(loc); } + YY_BREAK +case 40: +YY_RULE_SETUP +#line 87 "lexer.lpp" +{ return s2::parser::make_UNDEFINED(loc); } + YY_BREAK +case 41: +YY_RULE_SETUP +#line 88 "lexer.lpp" +{ return s2::parser::make_SIZE(loc); } + YY_BREAK +case 42: +YY_RULE_SETUP +#line 89 "lexer.lpp" +{ return s2::parser::make_GAME(loc); } + YY_BREAK +case 43: +YY_RULE_SETUP +#line 90 "lexer.lpp" +{ return s2::parser::make_SELF(loc); } + YY_BREAK +case 44: +YY_RULE_SETUP +#line 91 "lexer.lpp" +{ return s2::parser::make_ANIM(loc); } + YY_BREAK +case 45: +YY_RULE_SETUP +#line 92 "lexer.lpp" +{ return s2::parser::make_LEVEL(loc); } + YY_BREAK +case 46: +YY_RULE_SETUP +#line 93 "lexer.lpp" +{ return s2::parser::make_LPAREN(loc); } + YY_BREAK +case 47: +YY_RULE_SETUP +#line 94 "lexer.lpp" +{ return s2::parser::make_RPAREN(loc); } + YY_BREAK +case 48: +YY_RULE_SETUP +#line 95 "lexer.lpp" +{ return s2::parser::make_LBRACE(loc); } + YY_BREAK +case 49: +YY_RULE_SETUP +#line 96 "lexer.lpp" +{ return s2::parser::make_RBRACE(loc); } + YY_BREAK +case 50: +YY_RULE_SETUP +#line 97 "lexer.lpp" +{ return s2::parser::make_LBRACKET(loc); } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 98 "lexer.lpp" +{ return s2::parser::make_RBRACKET(loc); } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 99 "lexer.lpp" +{ return s2::parser::make_COMMA(loc); } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 100 "lexer.lpp" +{ return s2::parser::make_DOT(loc); } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 101 "lexer.lpp" +{ return s2::parser::make_DOUBLECOLON(loc); } + YY_BREAK +case 55: +YY_RULE_SETUP +#line 102 "lexer.lpp" +{ return s2::parser::make_COLON(loc); } + YY_BREAK +case 56: +YY_RULE_SETUP +#line 103 "lexer.lpp" +{ return s2::parser::make_SEMICOLON(loc); } + YY_BREAK +case 57: +YY_RULE_SETUP +#line 104 "lexer.lpp" +{ return s2::parser::make_INCREMENT(loc); } + YY_BREAK +case 58: +YY_RULE_SETUP +#line 105 "lexer.lpp" +{ return s2::parser::make_DECREMENT(loc); } + YY_BREAK +case 59: +YY_RULE_SETUP +#line 106 "lexer.lpp" +{ return s2::parser::make_ASSIGN_LSHIFT(loc); } + YY_BREAK +case 60: +YY_RULE_SETUP +#line 107 "lexer.lpp" +{ return s2::parser::make_ASSIGN_RSHIFT(loc); } + YY_BREAK +case 61: +YY_RULE_SETUP +#line 108 "lexer.lpp" +{ return s2::parser::make_LSHIFT(loc); } + YY_BREAK +case 62: +YY_RULE_SETUP +#line 109 "lexer.lpp" +{ return s2::parser::make_RSHIFT(loc); } + YY_BREAK +case 63: +YY_RULE_SETUP +#line 110 "lexer.lpp" +{ return s2::parser::make_OR(loc); } + YY_BREAK +case 64: +YY_RULE_SETUP +#line 111 "lexer.lpp" +{ return s2::parser::make_AND(loc); } + YY_BREAK +case 65: +YY_RULE_SETUP +#line 112 "lexer.lpp" +{ return s2::parser::make_EQUALITY(loc); } + YY_BREAK +case 66: +YY_RULE_SETUP +#line 113 "lexer.lpp" +{ return s2::parser::make_INEQUALITY(loc); } + YY_BREAK +case 67: +YY_RULE_SETUP +#line 114 "lexer.lpp" +{ return s2::parser::make_LESS_EQUAL(loc); } + YY_BREAK +case 68: +YY_RULE_SETUP +#line 115 "lexer.lpp" +{ return s2::parser::make_GREATER_EQUAL(loc); } + YY_BREAK +case 69: +YY_RULE_SETUP +#line 116 "lexer.lpp" +{ return s2::parser::make_LESS(loc); } + YY_BREAK +case 70: +YY_RULE_SETUP +#line 117 "lexer.lpp" +{ return s2::parser::make_GREATER(loc); } + YY_BREAK +case 71: +YY_RULE_SETUP +#line 118 "lexer.lpp" +{ return s2::parser::make_ASSIGN_ADD(loc); } + YY_BREAK +case 72: +YY_RULE_SETUP +#line 119 "lexer.lpp" +{ return s2::parser::make_ASSIGN_SUB(loc); } + YY_BREAK +case 73: +YY_RULE_SETUP +#line 120 "lexer.lpp" +{ return s2::parser::make_ASSIGN_MULT(loc); } + YY_BREAK +case 74: +YY_RULE_SETUP +#line 121 "lexer.lpp" +{ return s2::parser::make_ASSIGN_DIV(loc); } + YY_BREAK +case 75: +YY_RULE_SETUP +#line 122 "lexer.lpp" +{ return s2::parser::make_ASSIGN_MOD(loc); } + YY_BREAK +case 76: +YY_RULE_SETUP +#line 123 "lexer.lpp" +{ return s2::parser::make_ASSIGN_BITWISE_OR(loc); } + YY_BREAK +case 77: +YY_RULE_SETUP +#line 124 "lexer.lpp" +{ return s2::parser::make_ASSIGN_BITWISE_AND(loc); } + YY_BREAK +case 78: +YY_RULE_SETUP +#line 125 "lexer.lpp" +{ return s2::parser::make_ASSIGN_BITWISE_EXOR(loc); } + YY_BREAK +case 79: +YY_RULE_SETUP +#line 126 "lexer.lpp" +{ return s2::parser::make_ASSIGN(loc); } + YY_BREAK +case 80: +YY_RULE_SETUP +#line 127 "lexer.lpp" +{ return s2::parser::make_ADD(loc); } + YY_BREAK +case 81: +YY_RULE_SETUP +#line 128 "lexer.lpp" +{ return s2::parser::make_SUB(loc); } + YY_BREAK +case 82: +YY_RULE_SETUP +#line 129 "lexer.lpp" +{ return s2::parser::make_MULT(loc); } + YY_BREAK +case 83: +YY_RULE_SETUP +#line 130 "lexer.lpp" +{ return s2::parser::make_DIV(loc); } + YY_BREAK +case 84: +YY_RULE_SETUP +#line 131 "lexer.lpp" +{ return s2::parser::make_MOD(loc); } + YY_BREAK +case 85: +YY_RULE_SETUP +#line 132 "lexer.lpp" +{ return s2::parser::make_NOT(loc); } + YY_BREAK +case 86: +YY_RULE_SETUP +#line 133 "lexer.lpp" +{ return s2::parser::make_COMPLEMENT(loc); } + YY_BREAK +case 87: +YY_RULE_SETUP +#line 134 "lexer.lpp" +{ return s2::parser::make_BITWISE_OR(loc); } + YY_BREAK +case 88: +YY_RULE_SETUP +#line 135 "lexer.lpp" +{ return s2::parser::make_BITWISE_AND(loc); } + YY_BREAK +case 89: +YY_RULE_SETUP +#line 136 "lexer.lpp" +{ return s2::parser::make_BITWISE_EXOR(loc); } + YY_BREAK +case 90: +YY_RULE_SETUP +#line 137 "lexer.lpp" +{ return s2::parser::make_FILE(utils::string::fordslash(yytext), loc); } + YY_BREAK +case 91: +YY_RULE_SETUP +#line 138 "lexer.lpp" +{ return s2::parser::make_NAME((std::string(yytext, 3) == "_ID") ? std::string(yytext) : utils::string::to_lower(yytext), loc); } + YY_BREAK +case 92: +/* rule 92 can match eol */ +YY_RULE_SETUP +#line 139 "lexer.lpp" +{ return s2::parser::make_ISTRING(std::string(yytext).substr(1), loc); } + YY_BREAK +case 93: +/* rule 93 can match eol */ +YY_RULE_SETUP +#line 140 "lexer.lpp" +{ return s2::parser::make_STRING(std::string(yytext), loc); } + YY_BREAK +case 94: +YY_RULE_SETUP +#line 141 "lexer.lpp" +{ return s2::parser::make_FLOAT(std::string(yytext), loc); } + YY_BREAK +case 95: +YY_RULE_SETUP +#line 142 "lexer.lpp" +{ return s2::parser::make_INTEGER(std::string(yytext), loc); } + YY_BREAK +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(COMMENT_BLOCK_STATE): +case YY_STATE_EOF(DEVELOPER_BLOCK_STATE): +#line 143 "lexer.lpp" +{ return s2::parser::make_S2EOF(loc); } + YY_BREAK +case 96: +/* rule 96 can match eol */ +YY_RULE_SETUP +#line 144 "lexer.lpp" +{ throw s2::parser::syntax_error(loc, "bad token: \'" + std::string(yytext) + "\'"); } + YY_BREAK +case 97: +YY_RULE_SETUP +#line 146 "lexer.lpp" +ECHO; + YY_BREAK +#line 1694 "lexer.cpp" + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( yywrap( yyscanner ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + yyg->yy_n_chars, num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin , yyscanner); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) +{ + yy_state_type yy_current_state; + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_current_state = yyg->yy_start; + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 286 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) +{ + int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + char *yy_cp = yyg->yy_c_buf_p; + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 286 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 285); + + (void)yyg; + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (yyscan_t yyscanner) +#else + static int input (yyscan_t yyscanner) +#endif + +{ + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin , yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( yyscanner ) ) + return 0; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(yyscanner); +#else + return input(yyscanner); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * @param yyscanner The scanner object. + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * @param yyscanner The scanner object. + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( yyscanner ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yyg->yy_did_buffer_switch_on_eof = 1; +} + +static void yy_load_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyg->yy_hold_char = *yyg->yy_c_buf_p; +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * @param yyscanner The scanner object. + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file , yyscanner); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * @param yyscanner The scanner object. + */ + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf , yyscanner ); + + yyfree( (void *) b , yyscanner ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + +{ + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_flush_buffer( b , yyscanner); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param yyscanner The scanner object. + */ + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( yyscanner ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * @param yyscanner The scanner object. + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(yyscanner); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * @param yyscanner The scanner object. + */ +void yypop_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (yyscan_t yyscanner) +{ + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (!yyg->yy_buffer_stack) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->yy_buffer_stack_max = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b , yyscanner ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n , yyscanner); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the user-defined data for this scanner. + * @param yyscanner The scanner object. + */ +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; +} + +/** Get the current line number. + * @param yyscanner The scanner object. + */ +int yyget_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; +} + +/** Get the current column number. + * @param yyscanner The scanner object. + */ +int yyget_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; +} + +/** Get the input stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; +} + +/** Get the output stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; +} + +/** Get the length of the current token. + * @param yyscanner The scanner object. + */ +int yyget_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; +} + +/** Get the current token. + * @param yyscanner The scanner object. + */ + +char *yyget_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; +} + +/** Set the user-defined data. This data is never touched by the scanner. + * @param user_defined The data to be associated with this scanner. + * @param yyscanner The scanner object. + */ +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; +} + +/** Set the current line number. + * @param _line_number line number + * @param yyscanner The scanner object. + */ +void yyset_lineno (int _line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + + yylineno = _line_number; +} + +/** Set the current column. + * @param _column_no column number + * @param yyscanner The scanner object. + */ +void yyset_column (int _column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + + yycolumn = _column_no; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * @param yyscanner The scanner object. + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * _in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; +} + +void yyset_out (FILE * _out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; +} + +int yyget_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; +} + +void yyset_debug (int _bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; +} + +/* Accessor methods for yylval and yylloc */ + +/* User-visible API */ + +/* yylex_init is special because it creates the scanner itself, so it is + * the ONLY reentrant function that doesn't take the scanner as the last argument. + * That's why we explicitly handle the declaration, instead of using our macros. + */ +int yylex_init(yyscan_t* ptr_yy_globals) +{ + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + return yy_init_globals ( *ptr_yy_globals ); +} + +/* yylex_init_extra has the same functionality as yylex_init, but follows the + * convention of taking the scanner as the last argument. Note however, that + * this is a *pointer* to a scanner, as it will be allocated by this call (and + * is the reason, too, why this function also must handle its own declaration). + * The user defined value in the first argument will be available to yyalloc in + * the yyextra field. + */ +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) +{ + struct yyguts_t dummy_yyguts; + + yyset_extra (yy_user_defined, &dummy_yyguts); + + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + yyset_extra (yy_user_defined, *ptr_yy_globals); + + return yy_init_globals ( *ptr_yy_globals ); +} + +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + yyg->yy_buffer_stack = NULL; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = NULL; + yyg->yy_init = 0; + yyg->yy_start = 0; + + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = NULL; + yyout = NULL; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(yyscanner); + } + + /* Destroy the stack itself. */ + yyfree(yyg->yy_buffer_stack , yyscanner); + yyg->yy_buffer_stack = NULL; + + /* Destroy the start condition stack. */ + yyfree( yyg->yy_start_stack , yyscanner ); + yyg->yy_start_stack = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( yyscanner); + + /* Destroy the main struct (reentrant only). */ + yyfree ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); +} + +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); +} + +void yyfree (void * ptr , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 146 "lexer.lpp" + + diff --git a/src/s2/xsk/lexer.hpp b/src/s2/xsk/lexer.hpp new file mode 100644 index 00000000..a9440c1f --- /dev/null +++ b/src/s2/xsk/lexer.hpp @@ -0,0 +1,708 @@ +#ifndef s2_HEADER_H +#define s2_HEADER_H 1 +#define s2_IN_HEADER 1 + +#line 5 "lexer.hpp" +#include "stdafx.hpp" +#include "s2.hpp" +#include "parser.hpp" +using namespace xsk::gsc; + +#line 11 "lexer.hpp" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define s2__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer s2__create_buffer +#endif + +#ifdef yy_delete_buffer +#define s2__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer s2__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define s2__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer s2__scan_buffer +#endif + +#ifdef yy_scan_string +#define s2__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string s2__scan_string +#endif + +#ifdef yy_scan_bytes +#define s2__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes s2__scan_bytes +#endif + +#ifdef yy_init_buffer +#define s2__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer s2__init_buffer +#endif + +#ifdef yy_flush_buffer +#define s2__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer s2__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define s2__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state s2__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define s2__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer s2__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define s2_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state s2_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define s2_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state s2_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define s2_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack s2_ensure_buffer_stack +#endif + +#ifdef yylex +#define s2_lex_ALREADY_DEFINED +#else +#define yylex s2_lex +#endif + +#ifdef yyrestart +#define s2_restart_ALREADY_DEFINED +#else +#define yyrestart s2_restart +#endif + +#ifdef yylex_init +#define s2_lex_init_ALREADY_DEFINED +#else +#define yylex_init s2_lex_init +#endif + +#ifdef yylex_init_extra +#define s2_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra s2_lex_init_extra +#endif + +#ifdef yylex_destroy +#define s2_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy s2_lex_destroy +#endif + +#ifdef yyget_debug +#define s2_get_debug_ALREADY_DEFINED +#else +#define yyget_debug s2_get_debug +#endif + +#ifdef yyset_debug +#define s2_set_debug_ALREADY_DEFINED +#else +#define yyset_debug s2_set_debug +#endif + +#ifdef yyget_extra +#define s2_get_extra_ALREADY_DEFINED +#else +#define yyget_extra s2_get_extra +#endif + +#ifdef yyset_extra +#define s2_set_extra_ALREADY_DEFINED +#else +#define yyset_extra s2_set_extra +#endif + +#ifdef yyget_in +#define s2_get_in_ALREADY_DEFINED +#else +#define yyget_in s2_get_in +#endif + +#ifdef yyset_in +#define s2_set_in_ALREADY_DEFINED +#else +#define yyset_in s2_set_in +#endif + +#ifdef yyget_out +#define s2_get_out_ALREADY_DEFINED +#else +#define yyget_out s2_get_out +#endif + +#ifdef yyset_out +#define s2_set_out_ALREADY_DEFINED +#else +#define yyset_out s2_set_out +#endif + +#ifdef yyget_leng +#define s2_get_leng_ALREADY_DEFINED +#else +#define yyget_leng s2_get_leng +#endif + +#ifdef yyget_text +#define s2_get_text_ALREADY_DEFINED +#else +#define yyget_text s2_get_text +#endif + +#ifdef yyget_lineno +#define s2_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno s2_get_lineno +#endif + +#ifdef yyset_lineno +#define s2_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno s2_set_lineno +#endif + +#ifdef yyget_column +#define s2_get_column_ALREADY_DEFINED +#else +#define yyget_column s2_get_column +#endif + +#ifdef yyset_column +#define s2_set_column_ALREADY_DEFINED +#else +#define yyset_column s2_set_column +#endif + +#ifdef yywrap +#define s2_wrap_ALREADY_DEFINED +#else +#define yywrap s2_wrap +#endif + +#ifdef yyalloc +#define s2_alloc_ALREADY_DEFINED +#else +#define yyalloc s2_alloc +#endif + +#ifdef yyrealloc +#define s2_realloc_ALREADY_DEFINED +#else +#define yyrealloc s2_realloc +#endif + +#ifdef yyfree +#define s2_free_ALREADY_DEFINED +#else +#define yyfree s2_free +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +/* Begin user sect3 */ + +#define s2_wrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP + +#define yytext_ptr yytext_r + +#ifdef YY_HEADER_EXPORT_START_CONDITIONS +#define INITIAL 0 +#define COMMENT_BLOCK_STATE 1 +#define DEVELOPER_BLOCK_STATE 2 + +#endif + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (yyscan_t yyscanner); + +#define YY_DECL int yylex (yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +#undef YY_NEW_FILE +#undef YY_FLUSH_BUFFER +#undef yy_set_bol +#undef yy_new_buffer +#undef yy_set_interactive +#undef YY_DO_BEFORE_ACTION + +#ifdef YY_DECL_IS_OURS +#undef YY_DECL_IS_OURS +#undef YY_DECL +#endif + +#ifndef s2__create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef s2__delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef s2__scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef s2__scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef s2__scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef s2__init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef s2__flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef s2__load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef s2__switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef s2_push_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef s2_pop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef s2_ensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef s2_lex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef s2_restart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef s2_lex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef s2_lex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef s2_lex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef s2_get_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef s2_set_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef s2_get_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef s2_set_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef s2_get_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef s2_set_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef s2_get_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef s2_set_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef s2_get_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef s2_get_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef s2_get_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef s2_set_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef s2_get_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef s2_set_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef s2_wrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef s2_get_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef s2_set_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef s2_get_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef s2_set_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef s2_alloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef s2_realloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef s2_free_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef s2_text_ALREADY_DEFINED +#undef yytext +#endif +#ifndef s2_leng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef s2_in_ALREADY_DEFINED +#undef yyin +#endif +#ifndef s2_out_ALREADY_DEFINED +#undef yyout +#endif +#ifndef s2__flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef s2_lineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef s2_tables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef s2_tables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef s2_TABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + +#line 146 "lexer.lpp" + + +#line 706 "lexer.hpp" +#undef s2_IN_HEADER +#endif /* s2_HEADER_H */ diff --git a/src/s2/xsk/parser.cpp b/src/s2/xsk/parser.cpp new file mode 100644 index 00000000..470d160c --- /dev/null +++ b/src/s2/xsk/parser.cpp @@ -0,0 +1,3994 @@ +// A Bison parser, made by GNU Bison 3.7.5. + +// Skeleton implementation for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. + +// 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 . + +// As a special exception, you may create a larger work that contains +// part or all of the Bison parser skeleton and distribute that work +// under terms of your choice, so long as that work isn't itself a +// parser generator using the skeleton or a modified version thereof +// as a parser skeleton. Alternatively, if you modify or redistribute +// the parser skeleton itself, you may (at your option) remove this +// special exception, which will cause the skeleton and the resulting +// Bison output files to be licensed under the GNU General Public +// License without this special exception. + +// This special exception was added by the Free Software Foundation in +// version 2.2 of Bison. + +// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, +// especially those whose name start with YY_ or yy_. They are +// private implementation details that can be changed or removed. + +// "%code top" blocks. +#line 40 "parser.ypp" + +#include "stdafx.hpp" +#include "parser.hpp" +#include "lexer.hpp" +using namespace xsk::gsc; +xsk::gsc::s2::parser::symbol_type S2lex(yyscan_t yyscanner, xsk::gsc::location& loc); + +#line 47 "parser.cpp" + +// Take the name prefix into account. +#define yylex S2lex + + + +#include "parser.hpp" + + + + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include // FIXME: INFRINGES ON USER NAME SPACE. +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + + +// Whether we are compiled with exception support. +#ifndef YY_EXCEPTIONS +# if defined __GNUC__ && !defined __EXCEPTIONS +# define YY_EXCEPTIONS 0 +# else +# define YY_EXCEPTIONS 1 +# endif +#endif + +#define YYRHSLOC(Rhs, K) ((Rhs)[K].location) +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +# ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).begin = YYRHSLOC (Rhs, 1).begin; \ + (Current).end = YYRHSLOC (Rhs, N).end; \ + } \ + else \ + { \ + (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ + } \ + while (false) +# endif + + +// Enable debugging if requested. +#if S2DEBUG + +// A pseudo ostream that takes yydebug_ into account. +# define YYCDEBUG if (yydebug_) (*yycdebug_) + +# define YY_SYMBOL_PRINT(Title, Symbol) \ + do { \ + if (yydebug_) \ + { \ + *yycdebug_ << Title << ' '; \ + yy_print_ (*yycdebug_, Symbol); \ + *yycdebug_ << '\n'; \ + } \ + } while (false) + +# define YY_REDUCE_PRINT(Rule) \ + do { \ + if (yydebug_) \ + yy_reduce_print_ (Rule); \ + } while (false) + +# define YY_STACK_PRINT() \ + do { \ + if (yydebug_) \ + yy_stack_print_ (); \ + } while (false) + +#else // !S2DEBUG + +# define YYCDEBUG if (false) std::cerr +# define YY_SYMBOL_PRINT(Title, Symbol) YY_USE (Symbol) +# define YY_REDUCE_PRINT(Rule) static_cast (0) +# define YY_STACK_PRINT() static_cast (0) + +#endif // !S2DEBUG + +#define yyerrok (yyerrstatus_ = 0) +#define yyclearin (yyla.clear ()) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYRECOVERING() (!!yyerrstatus_) + +#line 13 "parser.ypp" +namespace xsk { namespace gsc { namespace s2 { +#line 149 "parser.cpp" + + /// Build a parser object. + parser::parser (yyscan_t yyscanner_yyarg, xsk::gsc::location& loc_yyarg, xsk::gsc::program_ptr& ast_yyarg) +#if S2DEBUG + : yydebug_ (false), + yycdebug_ (&std::cerr), +#else + : +#endif + yy_lac_established_ (false), + yyscanner (yyscanner_yyarg), + loc (loc_yyarg), + ast (ast_yyarg) + {} + + parser::~parser () + {} + + parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW + {} + + /*---------------. + | symbol kinds. | + `---------------*/ + + + + // by_state. + parser::by_state::by_state () YY_NOEXCEPT + : state (empty_state) + {} + + parser::by_state::by_state (const by_state& that) YY_NOEXCEPT + : state (that.state) + {} + + void + parser::by_state::clear () YY_NOEXCEPT + { + state = empty_state; + } + + void + parser::by_state::move (by_state& that) + { + state = that.state; + that.clear (); + } + + parser::by_state::by_state (state_type s) YY_NOEXCEPT + : state (s) + {} + + parser::symbol_kind_type + parser::by_state::kind () const YY_NOEXCEPT + { + if (state == empty_state) + return symbol_kind::S_YYEMPTY; + else + return YY_CAST (symbol_kind_type, yystos_[+state]); + } + + parser::stack_symbol_type::stack_symbol_type () + {} + + parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) + : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.YY_MOVE_OR_COPY< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.YY_MOVE_OR_COPY< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.YY_MOVE_OR_COPY< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.YY_MOVE_OR_COPY< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.YY_MOVE_OR_COPY< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.YY_MOVE_OR_COPY< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.YY_MOVE_OR_COPY< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.YY_MOVE_OR_COPY< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.YY_MOVE_OR_COPY< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.YY_MOVE_OR_COPY< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.YY_MOVE_OR_COPY< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.YY_MOVE_OR_COPY< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.YY_MOVE_OR_COPY< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.YY_MOVE_OR_COPY< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.YY_MOVE_OR_COPY< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.YY_MOVE_OR_COPY< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.YY_MOVE_OR_COPY< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.YY_MOVE_OR_COPY< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.YY_MOVE_OR_COPY< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.YY_MOVE_OR_COPY< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.YY_MOVE_OR_COPY< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.YY_MOVE_OR_COPY< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.YY_MOVE_OR_COPY< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.YY_MOVE_OR_COPY< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.YY_MOVE_OR_COPY< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.YY_MOVE_OR_COPY< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.YY_MOVE_OR_COPY< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.YY_MOVE_OR_COPY< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.YY_MOVE_OR_COPY< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.YY_MOVE_OR_COPY< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.YY_MOVE_OR_COPY< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.YY_MOVE_OR_COPY< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.YY_MOVE_OR_COPY< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.YY_MOVE_OR_COPY< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.YY_MOVE_OR_COPY< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.YY_MOVE_OR_COPY< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.YY_MOVE_OR_COPY< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.YY_MOVE_OR_COPY< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.YY_MOVE_OR_COPY< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.YY_MOVE_OR_COPY< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.YY_MOVE_OR_COPY< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.YY_MOVE_OR_COPY< stmt_waitframe_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.YY_MOVE_OR_COPY< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.YY_MOVE_OR_COPY< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.YY_MOVE_OR_COPY< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.YY_MOVE_OR_COPY< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.YY_MOVE_OR_COPY< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.YY_MOVE_OR_COPY< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.YY_MOVE_OR_COPY< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.YY_MOVE_OR_COPY< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.YY_MOVE_OR_COPY< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.YY_MOVE_OR_COPY< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.YY_MOVE_OR_COPY< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + +#if 201103L <= YY_CPLUSPLUS + // that is emptied. + that.state = empty_state; +#endif + } + + parser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that) + : super_type (s, YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + + // that is emptied. + that.kind_ = symbol_kind::S_YYEMPTY; + } + +#if YY_CPLUSPLUS < 201103L + parser::stack_symbol_type& + parser::stack_symbol_type::operator= (const stack_symbol_type& that) + { + state = that.state; + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.copy< anim_ptr > (that.value); + break; + + case symbol_kind::S_animation: // animation + value.copy< animation_ptr > (that.value); + break; + + case symbol_kind::S_animtree: // animtree + value.copy< animtree_ptr > (that.value); + break; + + case symbol_kind::S_constant: // constant + value.copy< constant_ptr > (that.value); + break; + + case symbol_kind::S_define: // define + value.copy< define_ptr > (that.value); + break; + + case symbol_kind::S_empty_array: // empty_array + value.copy< empty_array_ptr > (that.value); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.copy< expr_arguments_ptr > (that.value); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.copy< expr_assign_ptr > (that.value); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.copy< expr_call_ptr > (that.value); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.copy< expr_call_type_ptr > (that.value); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.copy< expr_ptr > (that.value); + break; + + case symbol_kind::S_false: // false + value.copy< false_ptr > (that.value); + break; + + case symbol_kind::S_file: // file + value.copy< file_ptr > (that.value); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.copy< float_ptr > (that.value); + break; + + case symbol_kind::S_game: // game + value.copy< game_ptr > (that.value); + break; + + case symbol_kind::S_include: // include + value.copy< include_ptr > (that.value); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.copy< integer_ptr > (that.value); + break; + + case symbol_kind::S_istring: // istring + value.copy< istring_ptr > (that.value); + break; + + case symbol_kind::S_level: // level + value.copy< level_ptr > (that.value); + break; + + case symbol_kind::S_name: // name + value.copy< name_ptr > (that.value); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.copy< node_ptr > (that.value); + break; + + case symbol_kind::S_parameters: // parameters + value.copy< parameters_ptr > (that.value); + break; + + case symbol_kind::S_program: // program + value.copy< program_ptr > (that.value); + break; + + case symbol_kind::S_self: // self + value.copy< self_ptr > (that.value); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.copy< std::string > (that.value); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.copy< stmt_assign_ptr > (that.value); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.copy< stmt_break_ptr > (that.value); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.copy< stmt_call_ptr > (that.value); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.copy< stmt_case_ptr > (that.value); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.copy< stmt_continue_ptr > (that.value); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.copy< stmt_default_ptr > (that.value); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.copy< stmt_endon_ptr > (that.value); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.copy< stmt_for_ptr > (that.value); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.copy< stmt_foreach_ptr > (that.value); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.copy< stmt_if_ptr > (that.value); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.copy< stmt_ifelse_ptr > (that.value); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.copy< stmt_list_ptr > (that.value); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.copy< stmt_notify_ptr > (that.value); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.copy< stmt_ptr > (that.value); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.copy< stmt_return_ptr > (that.value); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.copy< stmt_switch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.copy< stmt_wait_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.copy< stmt_waitframe_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.copy< stmt_waittill_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.copy< stmt_waittillframeend_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.copy< stmt_waittillmatch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.copy< stmt_while_ptr > (that.value); + break; + + case symbol_kind::S_string: // string + value.copy< string_ptr > (that.value); + break; + + case symbol_kind::S_thisthread: // thisthread + value.copy< thisthread_ptr > (that.value); + break; + + case symbol_kind::S_thread: // thread + value.copy< thread_ptr > (that.value); + break; + + case symbol_kind::S_true: // true + value.copy< true_ptr > (that.value); + break; + + case symbol_kind::S_undefined: // undefined + value.copy< undefined_ptr > (that.value); + break; + + case symbol_kind::S_usingtree: // usingtree + value.copy< usingtree_ptr > (that.value); + break; + + case symbol_kind::S_vector: // vector + value.copy< vector_ptr > (that.value); + break; + + default: + break; + } + + location = that.location; + return *this; + } + + parser::stack_symbol_type& + parser::stack_symbol_type::operator= (stack_symbol_type& that) + { + state = that.state; + switch (that.kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (that.value); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (that.value); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (that.value); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (that.value); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (that.value); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (that.value); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (that.value); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (that.value); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (that.value); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (that.value); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (that.value); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (that.value); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (that.value); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (that.value); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (that.value); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (that.value); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (that.value); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (that.value); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (that.value); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (that.value); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (that.value); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (that.value); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (that.value); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (that.value); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (that.value); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (that.value); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (that.value); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (that.value); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (that.value); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (that.value); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (that.value); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (that.value); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (that.value); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (that.value); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (that.value); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (that.value); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (that.value); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (that.value); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (that.value); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (that.value); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (that.value); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (that.value); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (that.value); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (that.value); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (that.value); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (that.value); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (that.value); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (that.value); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (that.value); + break; + + default: + break; + } + + location = that.location; + // that is emptied. + that.state = empty_state; + return *this; + } +#endif + + template + void + parser::yy_destroy_ (const char* yymsg, basic_symbol& yysym) const + { + if (yymsg) + YY_SYMBOL_PRINT (yymsg, yysym); + } + +#if S2DEBUG + template + void + parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const + { + std::ostream& yyoutput = yyo; + YY_USE (yyoutput); + if (yysym.empty ()) + yyo << "empty symbol"; + else + { + symbol_kind_type yykind = yysym.kind (); + yyo << (yykind < YYNTOKENS ? "token" : "nterm") + << ' ' << yysym.name () << " (" + << yysym.location << ": "; + YY_USE (yykind); + yyo << ')'; + } + } +#endif + + void + parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) + { + if (m) + YY_SYMBOL_PRINT (m, sym); + yystack_.push (YY_MOVE (sym)); + } + + void + parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) + { +#if 201103L <= YY_CPLUSPLUS + yypush_ (m, stack_symbol_type (s, std::move (sym))); +#else + stack_symbol_type ss (s, sym); + yypush_ (m, ss); +#endif + } + + void + parser::yypop_ (int n) + { + yystack_.pop (n); + } + +#if S2DEBUG + std::ostream& + parser::debug_stream () const + { + return *yycdebug_; + } + + void + parser::set_debug_stream (std::ostream& o) + { + yycdebug_ = &o; + } + + + parser::debug_level_type + parser::debug_level () const + { + return yydebug_; + } + + void + parser::set_debug_level (debug_level_type l) + { + yydebug_ = l; + } +#endif // S2DEBUG + + parser::state_type + parser::yy_lr_goto_state_ (state_type yystate, int yysym) + { + int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; + if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) + return yytable_[yyr]; + else + return yydefgoto_[yysym - YYNTOKENS]; + } + + bool + parser::yy_pact_value_is_default_ (int yyvalue) + { + return yyvalue == yypact_ninf_; + } + + bool + parser::yy_table_value_is_error_ (int yyvalue) + { + return yyvalue == yytable_ninf_; + } + + int + parser::operator() () + { + return parse (); + } + + int + parser::parse () + { + int yyn; + /// Length of the RHS of the rule being reduced. + int yylen = 0; + + // Error handling. + int yynerrs_ = 0; + int yyerrstatus_ = 0; + + /// The lookahead symbol. + symbol_type yyla; + + /// The locations where the error started and ended. + stack_symbol_type yyerror_range[3]; + + /// The return value of parse (). + int yyresult; + + /// Discard the LAC context in case there still is one left from a + /// previous invocation. + yy_lac_discard_ ("init"); + +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + YYCDEBUG << "Starting parse\n"; + + + /* Initialize the stack. The initial state will be set in + yynewstate, since the latter expects the semantical and the + location values to have been already stored, initialize these + stacks with a primary value. */ + yystack_.clear (); + yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); + + /*-----------------------------------------------. + | yynewstate -- push a new symbol on the stack. | + `-----------------------------------------------*/ + yynewstate: + YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; + YY_STACK_PRINT (); + + // Accept? + if (yystack_[0].state == yyfinal_) + YYACCEPT; + + goto yybackup; + + + /*-----------. + | yybackup. | + `-----------*/ + yybackup: + // Try to take a decision without lookahead. + yyn = yypact_[+yystack_[0].state]; + if (yy_pact_value_is_default_ (yyn)) + goto yydefault; + + // Read a lookahead token. + if (yyla.empty ()) + { + YYCDEBUG << "Reading a token\n"; +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + symbol_type yylookahead (yylex (yyscanner, loc)); + yyla.move (yylookahead); + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + goto yyerrlab1; + } +#endif // YY_EXCEPTIONS + } + YY_SYMBOL_PRINT ("Next token is", yyla); + + if (yyla.kind () == symbol_kind::S_YYerror) + { + // The scanner already issued an error message, process directly + // to error recovery. But do not keep the error token as + // lookahead, it is too special and may lead us to an endless + // loop in error recovery. */ + yyla.kind_ = symbol_kind::S_YYUNDEF; + goto yyerrlab1; + } + + /* If the proper action on seeing token YYLA.TYPE is to reduce or + to detect an error, take that action. */ + yyn += yyla.kind (); + if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) + { + if (!yy_lac_establish_ (yyla.kind ())) + goto yyerrlab; + goto yydefault; + } + + // Reduce or error. + yyn = yytable_[yyn]; + if (yyn <= 0) + { + if (yy_table_value_is_error_ (yyn)) + goto yyerrlab; + if (!yy_lac_establish_ (yyla.kind ())) + goto yyerrlab; + + yyn = -yyn; + goto yyreduce; + } + + // Count tokens shifted since error; after three, turn off error status. + if (yyerrstatus_) + --yyerrstatus_; + + // Shift the lookahead token. + yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); + yy_lac_discard_ ("shift"); + goto yynewstate; + + + /*-----------------------------------------------------------. + | yydefault -- do the default action for the current state. | + `-----------------------------------------------------------*/ + yydefault: + yyn = yydefact_[+yystack_[0].state]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + + /*-----------------------------. + | yyreduce -- do a reduction. | + `-----------------------------*/ + yyreduce: + yylen = yyr2_[yyn]; + { + stack_symbol_type yylhs; + yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); + /* Variants are always initialized to an empty instance of the + correct type. The default '$$ = $1' action is NOT applied + when using variants. */ + switch (yyr1_[yyn]) + { + case symbol_kind::S_anim: // anim + yylhs.value.emplace< anim_ptr > (); + break; + + case symbol_kind::S_animation: // animation + yylhs.value.emplace< animation_ptr > (); + break; + + case symbol_kind::S_animtree: // animtree + yylhs.value.emplace< animtree_ptr > (); + break; + + case symbol_kind::S_constant: // constant + yylhs.value.emplace< constant_ptr > (); + break; + + case symbol_kind::S_define: // define + yylhs.value.emplace< define_ptr > (); + break; + + case symbol_kind::S_empty_array: // empty_array + yylhs.value.emplace< empty_array_ptr > (); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + yylhs.value.emplace< expr_arguments_ptr > (); + break; + + case symbol_kind::S_expr_assign: // expr_assign + yylhs.value.emplace< expr_assign_ptr > (); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + yylhs.value.emplace< expr_call_ptr > (); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + yylhs.value.emplace< expr_call_type_ptr > (); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + yylhs.value.emplace< expr_ptr > (); + break; + + case symbol_kind::S_false: // false + yylhs.value.emplace< false_ptr > (); + break; + + case symbol_kind::S_file: // file + yylhs.value.emplace< file_ptr > (); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + yylhs.value.emplace< float_ptr > (); + break; + + case symbol_kind::S_game: // game + yylhs.value.emplace< game_ptr > (); + break; + + case symbol_kind::S_include: // include + yylhs.value.emplace< include_ptr > (); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + yylhs.value.emplace< integer_ptr > (); + break; + + case symbol_kind::S_istring: // istring + yylhs.value.emplace< istring_ptr > (); + break; + + case symbol_kind::S_level: // level + yylhs.value.emplace< level_ptr > (); + break; + + case symbol_kind::S_name: // name + yylhs.value.emplace< name_ptr > (); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + yylhs.value.emplace< node_ptr > (); + break; + + case symbol_kind::S_parameters: // parameters + yylhs.value.emplace< parameters_ptr > (); + break; + + case symbol_kind::S_program: // program + yylhs.value.emplace< program_ptr > (); + break; + + case symbol_kind::S_self: // self + yylhs.value.emplace< self_ptr > (); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + yylhs.value.emplace< std::string > (); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + yylhs.value.emplace< stmt_assign_ptr > (); + break; + + case symbol_kind::S_stmt_break: // stmt_break + yylhs.value.emplace< stmt_break_ptr > (); + break; + + case symbol_kind::S_stmt_call: // stmt_call + yylhs.value.emplace< stmt_call_ptr > (); + break; + + case symbol_kind::S_stmt_case: // stmt_case + yylhs.value.emplace< stmt_case_ptr > (); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + yylhs.value.emplace< stmt_continue_ptr > (); + break; + + case symbol_kind::S_stmt_default: // stmt_default + yylhs.value.emplace< stmt_default_ptr > (); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + yylhs.value.emplace< stmt_endon_ptr > (); + break; + + case symbol_kind::S_stmt_for: // stmt_for + yylhs.value.emplace< stmt_for_ptr > (); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + yylhs.value.emplace< stmt_foreach_ptr > (); + break; + + case symbol_kind::S_stmt_if: // stmt_if + yylhs.value.emplace< stmt_if_ptr > (); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + yylhs.value.emplace< stmt_ifelse_ptr > (); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + yylhs.value.emplace< stmt_list_ptr > (); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + yylhs.value.emplace< stmt_notify_ptr > (); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + yylhs.value.emplace< stmt_ptr > (); + break; + + case symbol_kind::S_stmt_return: // stmt_return + yylhs.value.emplace< stmt_return_ptr > (); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + yylhs.value.emplace< stmt_switch_ptr > (); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + yylhs.value.emplace< stmt_wait_ptr > (); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + yylhs.value.emplace< stmt_waitframe_ptr > (); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + yylhs.value.emplace< stmt_waittill_ptr > (); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + yylhs.value.emplace< stmt_waittillframeend_ptr > (); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + yylhs.value.emplace< stmt_waittillmatch_ptr > (); + break; + + case symbol_kind::S_stmt_while: // stmt_while + yylhs.value.emplace< stmt_while_ptr > (); + break; + + case symbol_kind::S_string: // string + yylhs.value.emplace< string_ptr > (); + break; + + case symbol_kind::S_thisthread: // thisthread + yylhs.value.emplace< thisthread_ptr > (); + break; + + case symbol_kind::S_thread: // thread + yylhs.value.emplace< thread_ptr > (); + break; + + case symbol_kind::S_true: // true + yylhs.value.emplace< true_ptr > (); + break; + + case symbol_kind::S_undefined: // undefined + yylhs.value.emplace< undefined_ptr > (); + break; + + case symbol_kind::S_usingtree: // usingtree + yylhs.value.emplace< usingtree_ptr > (); + break; + + case symbol_kind::S_vector: // vector + yylhs.value.emplace< vector_ptr > (); + break; + + default: + break; + } + + + // Default location. + { + stack_type::slice range (yystack_, yylen); + YYLLOC_DEFAULT (yylhs.location, range, yylen); + yyerror_range[1].location = yylhs.location; + } + + // Perform the reduction. + YY_REDUCE_PRINT (yyn); +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + switch (yyn) + { + case 2: // root: program +#line 233 "parser.ypp" + { ast = std::move(yystack_[0].value.as < program_ptr > ()); } +#line 1751 "parser.cpp" + break; + + case 3: // root: %empty +#line 234 "parser.ypp" + { ast = std::make_unique(yylhs.location); } +#line 1757 "parser.cpp" + break; + + case 4: // program: program include +#line 239 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::move(yystack_[1].value.as < program_ptr > ()); yylhs.value.as < program_ptr > ()->includes.push_back(std::move(yystack_[0].value.as < include_ptr > ())); } +#line 1763 "parser.cpp" + break; + + case 5: // program: program define +#line 241 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::move(yystack_[1].value.as < program_ptr > ()); yylhs.value.as < program_ptr > ()->definitions.push_back(std::move(yystack_[0].value.as < define_ptr > ())); } +#line 1769 "parser.cpp" + break; + + case 6: // program: include +#line 243 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < program_ptr > ()->includes.push_back(std::move(yystack_[0].value.as < include_ptr > ())); } +#line 1775 "parser.cpp" + break; + + case 7: // program: define +#line 245 "parser.ypp" + { yylhs.value.as < program_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < program_ptr > ()->definitions.push_back(std::move(yystack_[0].value.as < define_ptr > ())); } +#line 1781 "parser.cpp" + break; + + case 8: // include: "#include" file ";" +#line 250 "parser.ypp" + { yylhs.value.as < include_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < file_ptr > ())); } +#line 1787 "parser.cpp" + break; + + case 9: // define: usingtree +#line 254 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_usingtree = std::move(yystack_[0].value.as < usingtree_ptr > ()); } +#line 1793 "parser.cpp" + break; + + case 10: // define: constant +#line 255 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_constant = std::move(yystack_[0].value.as < constant_ptr > ()); } +#line 1799 "parser.cpp" + break; + + case 11: // define: thread +#line 256 "parser.ypp" + { yylhs.value.as < define_ptr > ().as_thread = std::move(yystack_[0].value.as < thread_ptr > ()); } +#line 1805 "parser.cpp" + break; + + case 12: // usingtree: "#using_animtree" "(" string ")" ";" +#line 261 "parser.ypp" + { yylhs.value.as < usingtree_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < string_ptr > ())); } +#line 1811 "parser.cpp" + break; + + case 13: // constant: name "=" expr ";" +#line 266 "parser.ypp" + { yylhs.value.as < constant_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 1817 "parser.cpp" + break; + + case 14: // thread: name "(" parameters ")" stmt_block +#line 271 "parser.ypp" + { yylhs.value.as < thread_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < name_ptr > ()), std::move(yystack_[2].value.as < parameters_ptr > ()), std::move(yystack_[0].value.as < stmt_list_ptr > ())); } +#line 1823 "parser.cpp" + break; + + case 15: // parameters: parameters "," name +#line 276 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::move(yystack_[2].value.as < parameters_ptr > ()); yylhs.value.as < parameters_ptr > ()->list.push_back(std::move(yystack_[0].value.as < name_ptr > ())); } +#line 1829 "parser.cpp" + break; + + case 16: // parameters: name +#line 278 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < parameters_ptr > ()->list.push_back(std::move(yystack_[0].value.as < name_ptr > ())); } +#line 1835 "parser.cpp" + break; + + case 17: // parameters: %empty +#line 280 "parser.ypp" + { yylhs.value.as < parameters_ptr > () = std::make_unique(yylhs.location); } +#line 1841 "parser.cpp" + break; + + case 18: // stmt: stmt_block +#line 284 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_list = std::move(yystack_[0].value.as < stmt_list_ptr > ()); } +#line 1847 "parser.cpp" + break; + + case 19: // stmt: stmt_call +#line 285 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_call = std::move(yystack_[0].value.as < stmt_call_ptr > ()); } +#line 1853 "parser.cpp" + break; + + case 20: // stmt: stmt_assign +#line 286 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_assign = std::move(yystack_[0].value.as < stmt_assign_ptr > ()); } +#line 1859 "parser.cpp" + break; + + case 21: // stmt: stmt_endon +#line 287 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_endon = std::move(yystack_[0].value.as < stmt_endon_ptr > ()); } +#line 1865 "parser.cpp" + break; + + case 22: // stmt: stmt_notify +#line 288 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_notify = std::move(yystack_[0].value.as < stmt_notify_ptr > ()); } +#line 1871 "parser.cpp" + break; + + case 23: // stmt: stmt_wait +#line 289 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_wait = std::move(yystack_[0].value.as < stmt_wait_ptr > ()); } +#line 1877 "parser.cpp" + break; + + case 24: // stmt: stmt_waittill +#line 290 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittill = std::move(yystack_[0].value.as < stmt_waittill_ptr > ()); } +#line 1883 "parser.cpp" + break; + + case 25: // stmt: stmt_waittillmatch +#line 291 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittillmatch = std::move(yystack_[0].value.as < stmt_waittillmatch_ptr > ()); } +#line 1889 "parser.cpp" + break; + + case 26: // stmt: stmt_waittillframeend +#line 292 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waittillframeend = std::move(yystack_[0].value.as < stmt_waittillframeend_ptr > ()); } +#line 1895 "parser.cpp" + break; + + case 27: // stmt: stmt_waitframe +#line 293 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_waitframe = std::move(yystack_[0].value.as < stmt_waitframe_ptr > ()); } +#line 1901 "parser.cpp" + break; + + case 28: // stmt: stmt_if +#line 294 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_if = std::move(yystack_[0].value.as < stmt_if_ptr > ()); } +#line 1907 "parser.cpp" + break; + + case 29: // stmt: stmt_ifelse +#line 295 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_ifelse = std::move(yystack_[0].value.as < stmt_ifelse_ptr > ()); } +#line 1913 "parser.cpp" + break; + + case 30: // stmt: stmt_while +#line 296 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_while = std::move(yystack_[0].value.as < stmt_while_ptr > ()); } +#line 1919 "parser.cpp" + break; + + case 31: // stmt: stmt_for +#line 297 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_for = std::move(yystack_[0].value.as < stmt_for_ptr > ()); } +#line 1925 "parser.cpp" + break; + + case 32: // stmt: stmt_foreach +#line 298 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_foreach = std::move(yystack_[0].value.as < stmt_foreach_ptr > ()); } +#line 1931 "parser.cpp" + break; + + case 33: // stmt: stmt_switch +#line 299 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_switch = std::move(yystack_[0].value.as < stmt_switch_ptr > ()); } +#line 1937 "parser.cpp" + break; + + case 34: // stmt: stmt_case +#line 300 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_case = std::move(yystack_[0].value.as < stmt_case_ptr > ()); } +#line 1943 "parser.cpp" + break; + + case 35: // stmt: stmt_default +#line 301 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_default = std::move(yystack_[0].value.as < stmt_default_ptr > ()); } +#line 1949 "parser.cpp" + break; + + case 36: // stmt: stmt_break +#line 302 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_break = std::move(yystack_[0].value.as < stmt_break_ptr > ()); } +#line 1955 "parser.cpp" + break; + + case 37: // stmt: stmt_continue +#line 303 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_continue = std::move(yystack_[0].value.as < stmt_continue_ptr > ()); } +#line 1961 "parser.cpp" + break; + + case 38: // stmt: stmt_return +#line 304 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_return = std::move(yystack_[0].value.as < stmt_return_ptr > ()); } +#line 1967 "parser.cpp" + break; + + case 39: // stmt_block: "{" stmt_list "}" +#line 308 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::move(yystack_[1].value.as < stmt_list_ptr > ()); } +#line 1973 "parser.cpp" + break; + + case 40: // stmt_block: "{" "}" +#line 309 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::make_unique(yylhs.location); } +#line 1979 "parser.cpp" + break; + + case 41: // stmt_list: stmt_list stmt +#line 314 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::move(yystack_[1].value.as < stmt_list_ptr > ()); yylhs.value.as < stmt_list_ptr > ()->stmts.push_back(std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 1985 "parser.cpp" + break; + + case 42: // stmt_list: stmt +#line 316 "parser.ypp" + { yylhs.value.as < stmt_list_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < stmt_list_ptr > ()->stmts.push_back(std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 1991 "parser.cpp" + break; + + case 43: // stmt_call: expr_call ";" +#line 321 "parser.ypp" + { yylhs.value.as < stmt_call_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_call_ptr > ())); } +#line 1997 "parser.cpp" + break; + + case 44: // stmt_call: expr_call_thread ";" +#line 323 "parser.ypp" + { yylhs.value.as < stmt_call_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_call_ptr > ())); } +#line 2003 "parser.cpp" + break; + + case 45: // stmt_assign: expr_assign ";" +#line 328 "parser.ypp" + { yylhs.value.as < stmt_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_assign_ptr > ())); } +#line 2009 "parser.cpp" + break; + + case 46: // stmt_endon: object "endon" "(" expr ")" ";" +#line 333 "parser.ypp" + { yylhs.value.as < stmt_endon_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ())); } +#line 2015 "parser.cpp" + break; + + case 47: // stmt_notify: object "notify" "(" expr "," expr_arguments ")" ";" +#line 338 "parser.ypp" + { yylhs.value.as < stmt_notify_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 2021 "parser.cpp" + break; + + case 48: // stmt_notify: object "notify" "(" expr ")" ";" +#line 340 "parser.ypp" + { yylhs.value.as < stmt_notify_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2027 "parser.cpp" + break; + + case 49: // stmt_wait: "wait" expr ";" +#line 345 "parser.ypp" + { yylhs.value.as < stmt_wait_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2033 "parser.cpp" + break; + + case 50: // stmt_waittill: object "waittill" "(" expr "," expr_arguments ")" ";" +#line 350 "parser.ypp" + { yylhs.value.as < stmt_waittill_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 2039 "parser.cpp" + break; + + case 51: // stmt_waittill: object "waittill" "(" expr ")" ";" +#line 352 "parser.ypp" + { yylhs.value.as < stmt_waittill_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2045 "parser.cpp" + break; + + case 52: // stmt_waittillmatch: object "waittillmatch" "(" expr "," expr_arguments ")" ";" +#line 357 "parser.ypp" + { yylhs.value.as < stmt_waittillmatch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < node_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < expr_arguments_ptr > ())); } +#line 2051 "parser.cpp" + break; + + case 53: // stmt_waittillmatch: object "waittillmatch" "(" expr ")" ";" +#line 359 "parser.ypp" + { yylhs.value.as < stmt_waittillmatch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < node_ptr > ()), std::move(yystack_[2].value.as < expr_ptr > ()), std::make_unique(yylhs.location)); } +#line 2057 "parser.cpp" + break; + + case 54: // stmt_waittillframeend: "waittillframeend" ";" +#line 364 "parser.ypp" + { yylhs.value.as < stmt_waittillframeend_ptr > () = std::make_unique(yylhs.location); } +#line 2063 "parser.cpp" + break; + + case 55: // stmt_waitframe: "waitframe" ";" +#line 369 "parser.ypp" + { yylhs.value.as < stmt_waitframe_ptr > () = std::make_unique(yylhs.location); } +#line 2069 "parser.cpp" + break; + + case 56: // stmt_waitframe: "waitframe" "(" ")" ";" +#line 371 "parser.ypp" + { yylhs.value.as < stmt_waitframe_ptr > () = std::make_unique(yylhs.location); } +#line 2075 "parser.cpp" + break; + + case 57: // stmt_if: "if" "(" expr ")" stmt +#line 376 "parser.ypp" + { yylhs.value.as < stmt_if_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2081 "parser.cpp" + break; + + case 58: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt +#line 381 "parser.ypp" + { yylhs.value.as < stmt_ifelse_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < stmt_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2087 "parser.cpp" + break; + + case 59: // stmt_while: "while" "(" expr ")" stmt +#line 386 "parser.ypp" + { yylhs.value.as < stmt_while_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2093 "parser.cpp" + break; + + case 60: // stmt_for: "for" "(" for_stmt ";" for_expr ";" for_stmt ")" stmt +#line 391 "parser.ypp" + { yylhs.value.as < stmt_for_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[6].value.as < stmt_ptr > ()), std::move(yystack_[4].value.as < expr_ptr > ()), std::move(yystack_[2].value.as < stmt_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2099 "parser.cpp" + break; + + case 61: // stmt_foreach: "foreach" "(" name "in" expr ")" stmt +#line 396 "parser.ypp" + { yylhs.value.as < stmt_foreach_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[4].value.as < name_ptr > ())), std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2105 "parser.cpp" + break; + + case 62: // stmt_foreach: "foreach" "(" name "," name "in" expr ")" stmt +#line 398 "parser.ypp" + { yylhs.value.as < stmt_foreach_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[6].value.as < name_ptr > ())), expr_ptr(std::move(yystack_[4].value.as < name_ptr > ())), std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_ptr > ())); } +#line 2111 "parser.cpp" + break; + + case 63: // stmt_switch: "switch" "(" expr ")" stmt_block +#line 403 "parser.ypp" + { yylhs.value.as < stmt_switch_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < stmt_list_ptr > ())); } +#line 2117 "parser.cpp" + break; + + case 64: // stmt_case: "case" integer ":" +#line 408 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < integer_ptr > ())), std::make_unique(yylhs.location)); } +#line 2123 "parser.cpp" + break; + + case 65: // stmt_case: "case" neg_integer ":" +#line 410 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < integer_ptr > ())), std::make_unique(yylhs.location)); } +#line 2129 "parser.cpp" + break; + + case 66: // stmt_case: "case" string ":" +#line 412 "parser.ypp" + { yylhs.value.as < stmt_case_ptr > () = std::make_unique(yylhs.location, expr_ptr(std::move(yystack_[1].value.as < string_ptr > ())), std::make_unique(yylhs.location)); } +#line 2135 "parser.cpp" + break; + + case 67: // stmt_default: "default" ":" +#line 417 "parser.ypp" + { yylhs.value.as < stmt_default_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } +#line 2141 "parser.cpp" + break; + + case 68: // stmt_break: "break" ";" +#line 422 "parser.ypp" + { yylhs.value.as < stmt_break_ptr > () = std::make_unique(yylhs.location); } +#line 2147 "parser.cpp" + break; + + case 69: // stmt_continue: "continue" ";" +#line 427 "parser.ypp" + { yylhs.value.as < stmt_continue_ptr > () = std::make_unique(yylhs.location); } +#line 2153 "parser.cpp" + break; + + case 70: // stmt_return: "return" expr ";" +#line 432 "parser.ypp" + { yylhs.value.as < stmt_return_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2159 "parser.cpp" + break; + + case 71: // stmt_return: "return" ";" +#line 434 "parser.ypp" + { yylhs.value.as < stmt_return_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } +#line 2165 "parser.cpp" + break; + + case 72: // for_stmt: expr_assign +#line 438 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_list = std::make_unique(yylhs.location); yylhs.value.as < stmt_ptr > ().as_list->stmts.push_back(stmt_ptr(std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_assign_ptr > ())))); } +#line 2171 "parser.cpp" + break; + + case 73: // for_stmt: %empty +#line 439 "parser.ypp" + { yylhs.value.as < stmt_ptr > ().as_node = std::make_unique(yylhs.location); } +#line 2177 "parser.cpp" + break; + + case 74: // for_expr: expr +#line 443 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2183 "parser.cpp" + break; + + case 75: // for_expr: %empty +#line 444 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location); } +#line 2189 "parser.cpp" + break; + + case 76: // expr: expr_compare +#line 448 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2195 "parser.cpp" + break; + + case 77: // expr: expr_binary +#line 449 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2201 "parser.cpp" + break; + + case 78: // expr: expr_primitive +#line 450 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[0].value.as < expr_ptr > ()); } +#line 2207 "parser.cpp" + break; + + case 79: // expr_assign: "++" object +#line 454 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < node_ptr > ())); } +#line 2213 "parser.cpp" + break; + + case 80: // expr_assign: "--" object +#line 455 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < node_ptr > ())); } +#line 2219 "parser.cpp" + break; + + case 81: // expr_assign: object "++" +#line 456 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < node_ptr > ())); } +#line 2225 "parser.cpp" + break; + + case 82: // expr_assign: object "--" +#line 457 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < node_ptr > ())); } +#line 2231 "parser.cpp" + break; + + case 83: // expr_assign: object "=" expr +#line 458 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2237 "parser.cpp" + break; + + case 84: // expr_assign: object "|=" expr +#line 459 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2243 "parser.cpp" + break; + + case 85: // expr_assign: object "&=" expr +#line 460 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2249 "parser.cpp" + break; + + case 86: // expr_assign: object "^=" expr +#line 461 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2255 "parser.cpp" + break; + + case 87: // expr_assign: object "<<=" expr +#line 462 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()),std::move( yystack_[0].value.as < expr_ptr > ())); } +#line 2261 "parser.cpp" + break; + + case 88: // expr_assign: object ">>=" expr +#line 463 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2267 "parser.cpp" + break; + + case 89: // expr_assign: object "+=" expr +#line 464 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2273 "parser.cpp" + break; + + case 90: // expr_assign: object "-=" expr +#line 465 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2279 "parser.cpp" + break; + + case 91: // expr_assign: object "*=" expr +#line 466 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2285 "parser.cpp" + break; + + case 92: // expr_assign: object "/=" expr +#line 467 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2291 "parser.cpp" + break; + + case 93: // expr_assign: object "%=" expr +#line 468 "parser.ypp" + { yylhs.value.as < expr_assign_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2297 "parser.cpp" + break; + + case 94: // expr_compare: expr "||" expr +#line 472 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2303 "parser.cpp" + break; + + case 95: // expr_compare: expr "&&" expr +#line 473 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2309 "parser.cpp" + break; + + case 96: // expr_compare: expr "==" expr +#line 474 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2315 "parser.cpp" + break; + + case 97: // expr_compare: expr "!=" expr +#line 475 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2321 "parser.cpp" + break; + + case 98: // expr_compare: expr "<=" expr +#line 476 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2327 "parser.cpp" + break; + + case 99: // expr_compare: expr ">=" expr +#line 477 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2333 "parser.cpp" + break; + + case 100: // expr_compare: expr "<" expr +#line 478 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2339 "parser.cpp" + break; + + case 101: // expr_compare: expr ">" expr +#line 479 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2345 "parser.cpp" + break; + + case 102: // expr_binary: expr "|" expr +#line 483 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2351 "parser.cpp" + break; + + case 103: // expr_binary: expr "&" expr +#line 484 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2357 "parser.cpp" + break; + + case 104: // expr_binary: expr "^" expr +#line 485 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2363 "parser.cpp" + break; + + case 105: // expr_binary: expr "<<" expr +#line 486 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2369 "parser.cpp" + break; + + case 106: // expr_binary: expr ">>" expr +#line 487 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2375 "parser.cpp" + break; + + case 107: // expr_binary: expr "+" expr +#line 488 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2381 "parser.cpp" + break; + + case 108: // expr_binary: expr "-" expr +#line 489 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2387 "parser.cpp" + break; + + case 109: // expr_binary: expr "*" expr +#line 490 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2393 "parser.cpp" + break; + + case 110: // expr_binary: expr "/" expr +#line 491 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2399 "parser.cpp" + break; + + case 111: // expr_binary: expr "%" expr +#line 492 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < expr_ptr > ()), std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2405 "parser.cpp" + break; + + case 112: // expr_primitive: "(" expr ")" +#line 496 "parser.ypp" + { yylhs.value.as < expr_ptr > () = std::move(yystack_[1].value.as < expr_ptr > ()); } +#line 2411 "parser.cpp" + break; + + case 113: // expr_primitive: "~" expr +#line 497 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2417 "parser.cpp" + break; + + case 114: // expr_primitive: "!" expr +#line 498 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2423 "parser.cpp" + break; + + case 115: // expr_primitive: expr_call +#line 499 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2429 "parser.cpp" + break; + + case 116: // expr_primitive: expr_call_thread +#line 500 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2435 "parser.cpp" + break; + + case 117: // expr_primitive: expr_call_childthread +#line 501 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2441 "parser.cpp" + break; + + case 118: // expr_primitive: expr_function +#line 502 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2447 "parser.cpp" + break; + + case 119: // expr_primitive: expr_add_array +#line 503 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2453 "parser.cpp" + break; + + case 120: // expr_primitive: expr_array +#line 504 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2459 "parser.cpp" + break; + + case 121: // expr_primitive: expr_field +#line 505 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2465 "parser.cpp" + break; + + case 122: // expr_primitive: expr_size +#line 506 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2471 "parser.cpp" + break; + + case 123: // expr_primitive: thisthread +#line 507 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < thisthread_ptr > ()); } +#line 2477 "parser.cpp" + break; + + case 124: // expr_primitive: empty_array +#line 508 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < empty_array_ptr > ()); } +#line 2483 "parser.cpp" + break; + + case 125: // expr_primitive: undefined +#line 509 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < undefined_ptr > ()); } +#line 2489 "parser.cpp" + break; + + case 126: // expr_primitive: game +#line 510 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < game_ptr > ()); } +#line 2495 "parser.cpp" + break; + + case 127: // expr_primitive: self +#line 511 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < self_ptr > ()); } +#line 2501 "parser.cpp" + break; + + case 128: // expr_primitive: anim +#line 512 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < anim_ptr > ()); } +#line 2507 "parser.cpp" + break; + + case 129: // expr_primitive: level +#line 513 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < level_ptr > ()); } +#line 2513 "parser.cpp" + break; + + case 130: // expr_primitive: animation +#line 514 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < animation_ptr > ()); } +#line 2519 "parser.cpp" + break; + + case 131: // expr_primitive: animtree +#line 515 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < animtree_ptr > ()); } +#line 2525 "parser.cpp" + break; + + case 132: // expr_primitive: name +#line 516 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < name_ptr > ()); } +#line 2531 "parser.cpp" + break; + + case 133: // expr_primitive: istring +#line 517 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < istring_ptr > ()); } +#line 2537 "parser.cpp" + break; + + case 134: // expr_primitive: string +#line 518 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < string_ptr > ()); } +#line 2543 "parser.cpp" + break; + + case 135: // expr_primitive: vector +#line 519 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < vector_ptr > ()); } +#line 2549 "parser.cpp" + break; + + case 136: // expr_primitive: neg_float +#line 520 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < float_ptr > ()); } +#line 2555 "parser.cpp" + break; + + case 137: // expr_primitive: neg_integer +#line 521 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < integer_ptr > ()); } +#line 2561 "parser.cpp" + break; + + case 138: // expr_primitive: float +#line 522 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < float_ptr > ()); } +#line 2567 "parser.cpp" + break; + + case 139: // expr_primitive: integer +#line 523 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < integer_ptr > ()); } +#line 2573 "parser.cpp" + break; + + case 140: // expr_primitive: false +#line 524 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < false_ptr > ()); } +#line 2579 "parser.cpp" + break; + + case 141: // expr_primitive: true +#line 525 "parser.ypp" + { yylhs.value.as < expr_ptr > ().as_node = std::move(yystack_[0].value.as < true_ptr > ()); } +#line 2585 "parser.cpp" + break; + + case 142: // expr_call: expr_call_function +#line 529 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2591 "parser.cpp" + break; + + case 143: // expr_call: expr_call_pointer +#line 530 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2597 "parser.cpp" + break; + + case 144: // expr_call: object expr_call_function +#line 531 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::move(yystack_[1].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2603 "parser.cpp" + break; + + case 145: // expr_call: object expr_call_pointer +#line 532 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, false, std::move(yystack_[1].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2609 "parser.cpp" + break; + + case 146: // expr_call_thread: "thread" expr_call_function +#line 536 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2615 "parser.cpp" + break; + + case 147: // expr_call_thread: "thread" expr_call_pointer +#line 537 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2621 "parser.cpp" + break; + + case 148: // expr_call_thread: object "thread" expr_call_function +#line 538 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2627 "parser.cpp" + break; + + case 149: // expr_call_thread: object "thread" expr_call_pointer +#line 539 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, true, false, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2633 "parser.cpp" + break; + + case 150: // expr_call_childthread: "childthread" expr_call_function +#line 543 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2639 "parser.cpp" + break; + + case 151: // expr_call_childthread: "childthread" expr_call_pointer +#line 544 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2645 "parser.cpp" + break; + + case 152: // expr_call_childthread: object "childthread" expr_call_function +#line 545 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2651 "parser.cpp" + break; + + case 153: // expr_call_childthread: object "childthread" expr_call_pointer +#line 546 "parser.ypp" + { yylhs.value.as < expr_call_ptr > () = std::make_unique(yylhs.location, false, true, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < expr_call_type_ptr > ())); } +#line 2657 "parser.cpp" + break; + + case 154: // expr_call_function: name "(" expr_arguments ")" +#line 551 "parser.ypp" + {yylhs.value.as < expr_call_type_ptr > ().as_func = std::make_unique(yylhs.location, std::make_unique(), std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2663 "parser.cpp" + break; + + case 155: // expr_call_function: file "::" name "(" expr_arguments ")" +#line 553 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_func = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < file_ptr > ()), std::move(yystack_[3].value.as < name_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2669 "parser.cpp" + break; + + case 156: // expr_call_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 558 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_pointer = std::make_unique(yylhs.location, false, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2675 "parser.cpp" + break; + + case 157: // expr_call_pointer: "call" "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 560 "parser.ypp" + { yylhs.value.as < expr_call_type_ptr > ().as_pointer = std::make_unique(yylhs.location, true, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2681 "parser.cpp" + break; + + case 158: // expr_arguments: expr_arguments_filled +#line 564 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[0].value.as < expr_arguments_ptr > ()); } +#line 2687 "parser.cpp" + break; + + case 159: // expr_arguments: expr_arguments_empty +#line 565 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[0].value.as < expr_arguments_ptr > ()); } +#line 2693 "parser.cpp" + break; + + case 160: // expr_arguments_filled: expr_arguments "," expr +#line 570 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::move(yystack_[2].value.as < expr_arguments_ptr > ()); yylhs.value.as < expr_arguments_ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2699 "parser.cpp" + break; + + case 161: // expr_arguments_filled: expr +#line 572 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::make_unique(yylhs.location); yylhs.value.as < expr_arguments_ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr_ptr > ())); } +#line 2705 "parser.cpp" + break; + + case 162: // expr_arguments_empty: %empty +#line 577 "parser.ypp" + { yylhs.value.as < expr_arguments_ptr > () = std::make_unique(yylhs.location); } +#line 2711 "parser.cpp" + break; + + case 163: // expr_function: "::" name +#line 582 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2717 "parser.cpp" + break; + + case 164: // expr_function: file "::" name +#line 584 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < file_ptr > ()), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2723 "parser.cpp" + break; + + case 165: // expr_add_array: "[" expr_arguments_filled "]" +#line 589 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < expr_arguments_ptr > ())); } +#line 2729 "parser.cpp" + break; + + case 166: // expr_array: object "[" expr "]" +#line 594 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < node_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2735 "parser.cpp" + break; + + case 167: // expr_field: object "." name +#line 599 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ()), std::move(yystack_[0].value.as < name_ptr > ())); } +#line 2741 "parser.cpp" + break; + + case 168: // expr_size: object "." "size" +#line 604 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < node_ptr > ())); } +#line 2747 "parser.cpp" + break; + + case 169: // object: expr_call +#line 608 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < expr_call_ptr > ()); } +#line 2753 "parser.cpp" + break; + + case 170: // object: expr_array +#line 609 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2759 "parser.cpp" + break; + + case 171: // object: expr_field +#line 610 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < node_ptr > ()); } +#line 2765 "parser.cpp" + break; + + case 172: // object: game +#line 611 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < game_ptr > ()); } +#line 2771 "parser.cpp" + break; + + case 173: // object: self +#line 612 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < self_ptr > ()); } +#line 2777 "parser.cpp" + break; + + case 174: // object: anim +#line 613 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < anim_ptr > ()); } +#line 2783 "parser.cpp" + break; + + case 175: // object: level +#line 614 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < level_ptr > ()); } +#line 2789 "parser.cpp" + break; + + case 176: // object: name +#line 615 "parser.ypp" + { yylhs.value.as < node_ptr > () = std::move(yystack_[0].value.as < name_ptr > ()); } +#line 2795 "parser.cpp" + break; + + case 177: // thisthread: "thisthread" +#line 618 "parser.ypp" + { yylhs.value.as < thisthread_ptr > () = std::make_unique(yylhs.location); } +#line 2801 "parser.cpp" + break; + + case 178: // empty_array: "[" "]" +#line 619 "parser.ypp" + { yylhs.value.as < empty_array_ptr > () = std::make_unique(yylhs.location); } +#line 2807 "parser.cpp" + break; + + case 179: // undefined: "undefined" +#line 620 "parser.ypp" + { yylhs.value.as < undefined_ptr > () = std::make_unique(yylhs.location); } +#line 2813 "parser.cpp" + break; + + case 180: // game: "game" +#line 621 "parser.ypp" + { yylhs.value.as < game_ptr > () = std::make_unique(yylhs.location); } +#line 2819 "parser.cpp" + break; + + case 181: // self: "self" +#line 622 "parser.ypp" + { yylhs.value.as < self_ptr > () = std::make_unique(yylhs.location); } +#line 2825 "parser.cpp" + break; + + case 182: // anim: "anim" +#line 623 "parser.ypp" + { yylhs.value.as < anim_ptr > () = std::make_unique(yylhs.location); } +#line 2831 "parser.cpp" + break; + + case 183: // level: "level" +#line 624 "parser.ypp" + { yylhs.value.as < level_ptr > () = std::make_unique(yylhs.location); } +#line 2837 "parser.cpp" + break; + + case 184: // animation: "%" "identifier" +#line 625 "parser.ypp" + { yylhs.value.as < animation_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2843 "parser.cpp" + break; + + case 185: // animtree: "#animtree" +#line 626 "parser.ypp" + { yylhs.value.as < animtree_ptr > () = std::make_unique(yylhs.location); } +#line 2849 "parser.cpp" + break; + + case 186: // name: "identifier" +#line 627 "parser.ypp" + { yylhs.value.as < name_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2855 "parser.cpp" + break; + + case 187: // file: "file path" +#line 628 "parser.ypp" + { yylhs.value.as < file_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2861 "parser.cpp" + break; + + case 188: // istring: "localized string" +#line 629 "parser.ypp" + { yylhs.value.as < istring_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2867 "parser.cpp" + break; + + case 189: // string: "string literal" +#line 630 "parser.ypp" + { yylhs.value.as < string_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2873 "parser.cpp" + break; + + case 190: // vector: "(" expr "," expr "," expr ")" +#line 631 "parser.ypp" + { yylhs.value.as < vector_ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < expr_ptr > ()), std::move(yystack_[3].value.as < expr_ptr > ()), std::move(yystack_[1].value.as < expr_ptr > ())); } +#line 2879 "parser.cpp" + break; + + case 191: // neg_float: "-" "float" +#line 632 "parser.ypp" + { yylhs.value.as < float_ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 2885 "parser.cpp" + break; + + case 192: // neg_integer: "-" "int" +#line 633 "parser.ypp" + { yylhs.value.as < integer_ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 2891 "parser.cpp" + break; + + case 193: // float: "float" +#line 634 "parser.ypp" + { yylhs.value.as < float_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2897 "parser.cpp" + break; + + case 194: // integer: "int" +#line 635 "parser.ypp" + { yylhs.value.as < integer_ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 2903 "parser.cpp" + break; + + case 195: // false: "false" +#line 636 "parser.ypp" + { yylhs.value.as < false_ptr > () = std::make_unique(yylhs.location); } +#line 2909 "parser.cpp" + break; + + case 196: // true: "true" +#line 637 "parser.ypp" + { yylhs.value.as < true_ptr > () = std::make_unique(yylhs.location); } +#line 2915 "parser.cpp" + break; + + +#line 2919 "parser.cpp" + + default: + break; + } + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + YYERROR; + } +#endif // YY_EXCEPTIONS + YY_SYMBOL_PRINT ("-> $$ =", yylhs); + yypop_ (yylen); + yylen = 0; + + // Shift the result of the reduction. + yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); + } + goto yynewstate; + + + /*--------------------------------------. + | yyerrlab -- here on detecting error. | + `--------------------------------------*/ + yyerrlab: + // If not already recovering from an error, report this error. + if (!yyerrstatus_) + { + ++yynerrs_; + context yyctx (*this, yyla); + std::string msg = yysyntax_error_ (yyctx); + error (yyla.location, YY_MOVE (msg)); + } + + + yyerror_range[1].location = yyla.location; + if (yyerrstatus_ == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + // Return failure if at end of input. + if (yyla.kind () == symbol_kind::S_YYEOF) + YYABORT; + else if (!yyla.empty ()) + { + yy_destroy_ ("Error: discarding", yyla); + yyla.clear (); + } + } + + // Else will try to reuse lookahead token after shifting the error token. + goto yyerrlab1; + + + /*---------------------------------------------------. + | yyerrorlab -- error raised explicitly by YYERROR. | + `---------------------------------------------------*/ + yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and + the label yyerrorlab therefore never appears in user code. */ + if (false) + YYERROR; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + yypop_ (yylen); + yylen = 0; + YY_STACK_PRINT (); + goto yyerrlab1; + + + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ + yyerrlab1: + yyerrstatus_ = 3; // Each real token shifted decrements this. + // Pop stack until we find a state that shifts the error token. + for (;;) + { + yyn = yypact_[+yystack_[0].state]; + if (!yy_pact_value_is_default_ (yyn)) + { + yyn += symbol_kind::S_YYerror; + if (0 <= yyn && yyn <= yylast_ + && yycheck_[yyn] == symbol_kind::S_YYerror) + { + yyn = yytable_[yyn]; + if (0 < yyn) + break; + } + } + + // Pop the current state because it cannot handle the error token. + if (yystack_.size () == 1) + YYABORT; + + yyerror_range[1].location = yystack_[0].location; + yy_destroy_ ("Error: popping", yystack_[0]); + yypop_ (); + YY_STACK_PRINT (); + } + { + stack_symbol_type error_token; + + yyerror_range[2].location = yyla.location; + YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); + + // Shift the error token. + yy_lac_discard_ ("error recovery"); + error_token.state = state_type (yyn); + yypush_ ("Shifting", YY_MOVE (error_token)); + } + goto yynewstate; + + + /*-------------------------------------. + | yyacceptlab -- YYACCEPT comes here. | + `-------------------------------------*/ + yyacceptlab: + yyresult = 0; + goto yyreturn; + + + /*-----------------------------------. + | yyabortlab -- YYABORT comes here. | + `-----------------------------------*/ + yyabortlab: + yyresult = 1; + goto yyreturn; + + + /*-----------------------------------------------------. + | yyreturn -- parsing is finished, return the result. | + `-----------------------------------------------------*/ + yyreturn: + if (!yyla.empty ()) + yy_destroy_ ("Cleanup: discarding lookahead", yyla); + + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + yypop_ (yylen); + YY_STACK_PRINT (); + while (1 < yystack_.size ()) + { + yy_destroy_ ("Cleanup: popping", yystack_[0]); + yypop_ (); + } + + return yyresult; + } +#if YY_EXCEPTIONS + catch (...) + { + YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; + // Do not try to display the values of the reclaimed symbols, + // as their printers might throw an exception. + if (!yyla.empty ()) + yy_destroy_ (YY_NULLPTR, yyla); + + while (1 < yystack_.size ()) + { + yy_destroy_ (YY_NULLPTR, yystack_[0]); + yypop_ (); + } + throw; + } +#endif // YY_EXCEPTIONS + } + + void + parser::error (const syntax_error& yyexc) + { + error (yyexc.location, yyexc.what ()); + } + + const char * + parser::symbol_name (symbol_kind_type yysymbol) + { + static const char *const yy_sname[] = + { + "end of file", "error", "invalid token", "#include", "#using_animtree", + "#animtree", "endon", "notify", "wait", "waittill", "waittillmatch", + "waittillframeend", "waitframe", "if", "else", "while", "for", "foreach", + "in", "switch", "case", "default", "break", "continue", "return", + "thread", "childthread", "thisthread", "call", "true", "false", + "undefined", "size", "game", "self", "anim", "level", "(", ")", "{", "}", + "[", "]", ",", ".", "::", ":", ";", "++", "--", "<<", ">>", "||", "&&", + "==", "!=", "<=", ">=", "<", ">", "!", "~", "=", "+=", "-=", "*=", "/=", + "%=", "|=", "&=", "^=", ">>=", "<<=", "|", "&", "^", "+", "-", "*", "/", + "%", "file path", "identifier", "string literal", "localized string", + "float", "int", "ADD_ARRAY", "THEN", "NEG", "ANIMREF", "PREINC", + "PREDEC", "POSTINC", "POSTDEC", "$accept", "root", "program", "include", + "define", "usingtree", "constant", "thread", "parameters", "stmt", + "stmt_block", "stmt_list", "stmt_call", "stmt_assign", "stmt_endon", + "stmt_notify", "stmt_wait", "stmt_waittill", "stmt_waittillmatch", + "stmt_waittillframeend", "stmt_waitframe", "stmt_if", "stmt_ifelse", + "stmt_while", "stmt_for", "stmt_foreach", "stmt_switch", "stmt_case", + "stmt_default", "stmt_break", "stmt_continue", "stmt_return", "for_stmt", + "for_expr", "expr", "expr_assign", "expr_compare", "expr_binary", + "expr_primitive", "expr_call", "expr_call_thread", + "expr_call_childthread", "expr_call_function", "expr_call_pointer", + "expr_arguments", "expr_arguments_filled", "expr_arguments_empty", + "expr_function", "expr_add_array", "expr_array", "expr_field", + "expr_size", "object", "thisthread", "empty_array", "undefined", "game", + "self", "anim", "level", "animation", "animtree", "name", "file", + "istring", "string", "vector", "neg_float", "neg_integer", "float", + "integer", "false", "true", YY_NULLPTR + }; + return yy_sname[yysymbol]; + } + + + + // parser::context. + parser::context::context (const parser& yyparser, const symbol_type& yyla) + : yyparser_ (yyparser) + , yyla_ (yyla) + {} + + int + parser::context::expected_tokens (symbol_kind_type yyarg[], int yyargn) const + { + // Actual number of expected tokens + int yycount = 0; + +#if S2DEBUG + // Execute LAC once. We don't care if it is successful, we + // only do it for the sake of debugging output. + if (!yyparser_.yy_lac_established_) + yyparser_.yy_lac_check_ (yyla_.kind ()); +#endif + + for (int yyx = 0; yyx < YYNTOKENS; ++yyx) + { + symbol_kind_type yysym = YY_CAST (symbol_kind_type, yyx); + if (yysym != symbol_kind::S_YYerror + && yysym != symbol_kind::S_YYUNDEF + && yyparser_.yy_lac_check_ (yysym)) + { + if (!yyarg) + ++yycount; + else if (yycount == yyargn) + return 0; + else + yyarg[yycount++] = yysym; + } + } + if (yyarg && yycount == 0 && 0 < yyargn) + yyarg[0] = symbol_kind::S_YYEMPTY; + return yycount; + } + + + bool + parser::yy_lac_check_ (symbol_kind_type yytoken) const + { + // Logically, the yylac_stack's lifetime is confined to this function. + // Clear it, to get rid of potential left-overs from previous call. + yylac_stack_.clear (); + // Reduce until we encounter a shift and thereby accept the token. +#if S2DEBUG + YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; +#endif + std::ptrdiff_t lac_top = 0; + while (true) + { + state_type top_state = (yylac_stack_.empty () + ? yystack_[lac_top].state + : yylac_stack_.back ()); + int yyrule = yypact_[+top_state]; + if (yy_pact_value_is_default_ (yyrule) + || (yyrule += yytoken) < 0 || yylast_ < yyrule + || yycheck_[yyrule] != yytoken) + { + // Use the default action. + yyrule = yydefact_[+top_state]; + if (yyrule == 0) + { + YYCDEBUG << " Err\n"; + return false; + } + } + else + { + // Use the action from yytable. + yyrule = yytable_[yyrule]; + if (yy_table_value_is_error_ (yyrule)) + { + YYCDEBUG << " Err\n"; + return false; + } + if (0 < yyrule) + { + YYCDEBUG << " S" << yyrule << '\n'; + return true; + } + yyrule = -yyrule; + } + // By now we know we have to simulate a reduce. + YYCDEBUG << " R" << yyrule - 1; + // Pop the corresponding number of values from the stack. + { + std::ptrdiff_t yylen = yyr2_[yyrule]; + // First pop from the LAC stack as many tokens as possible. + std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); + if (yylen < lac_size) + { + yylac_stack_.resize (std::size_t (lac_size - yylen)); + yylen = 0; + } + else if (lac_size) + { + yylac_stack_.clear (); + yylen -= lac_size; + } + // Only afterwards look at the main stack. + // We simulate popping elements by incrementing lac_top. + lac_top += yylen; + } + // Keep top_state in sync with the updated stack. + top_state = (yylac_stack_.empty () + ? yystack_[lac_top].state + : yylac_stack_.back ()); + // Push the resulting state of the reduction. + state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); + YYCDEBUG << " G" << int (state); + yylac_stack_.push_back (state); + } + } + + // Establish the initial context if no initial context currently exists. + bool + parser::yy_lac_establish_ (symbol_kind_type yytoken) + { + /* Establish the initial context for the current lookahead if no initial + context is currently established. + + We define a context as a snapshot of the parser stacks. We define + the initial context for a lookahead as the context in which the + parser initially examines that lookahead in order to select a + syntactic action. Thus, if the lookahead eventually proves + syntactically unacceptable (possibly in a later context reached via a + series of reductions), the initial context can be used to determine + the exact set of tokens that would be syntactically acceptable in the + lookahead's place. Moreover, it is the context after which any + further semantic actions would be erroneous because they would be + determined by a syntactically unacceptable token. + + yy_lac_establish_ should be invoked when a reduction is about to be + performed in an inconsistent state (which, for the purposes of LAC, + includes consistent states that don't know they're consistent because + their default reductions have been disabled). + + For parse.lac=full, the implementation of yy_lac_establish_ is as + follows. If no initial context is currently established for the + current lookahead, then check if that lookahead can eventually be + shifted if syntactic actions continue from the current context. */ + if (!yy_lac_established_) + { +#if S2DEBUG + YYCDEBUG << "LAC: initial context established for " + << symbol_name (yytoken) << '\n'; +#endif + yy_lac_established_ = true; + return yy_lac_check_ (yytoken); + } + return true; + } + + // Discard any previous initial lookahead context. + void + parser::yy_lac_discard_ (const char* evt) + { + /* Discard any previous initial lookahead context because of Event, + which may be a lookahead change or an invalidation of the currently + established initial context for the current lookahead. + + The most common example of a lookahead change is a shift. An example + of both cases is syntax error recovery. That is, a syntax error + occurs when the lookahead is syntactically erroneous for the + currently established initial context, so error recovery manipulates + the parser stacks to try to find a new initial context in which the + current lookahead is syntactically acceptable. If it fails to find + such a context, it discards the lookahead. */ + if (yy_lac_established_) + { + YYCDEBUG << "LAC: initial context discarded due to " + << evt << '\n'; + yy_lac_established_ = false; + } + } + + int + parser::yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const + { + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yyla) is + if this state is a consistent state with a default action. + Thus, detecting the absence of a lookahead is sufficient to + determine that there is no unexpected or expected token to + report. In that case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is + a consistent state with a default action. There might have + been a previous inconsistent state, consistent state with a + non-default action, or user semantic action that manipulated + yyla. (However, yyla is currently not documented for users.) + In the first two cases, it might appear that the current syntax + error should have been detected in the previous state when + yy_lac_check was invoked. However, at that time, there might + have been a different syntax error that discarded a different + initial context during error recovery, leaving behind the + current lookahead. + */ + + if (!yyctx.lookahead ().empty ()) + { + if (yyarg) + yyarg[0] = yyctx.token (); + int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); + return yyn + 1; + } + return 0; + } + + // Generate an error message. + std::string + parser::yysyntax_error_ (const context& yyctx) const + { + // Its maximum. + enum { YYARGS_MAX = 5 }; + // Arguments of yyformat. + symbol_kind_type yyarg[YYARGS_MAX]; + int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); + + char const* yyformat = YY_NULLPTR; + switch (yycount) + { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + default: // Avoid compiler warnings. + YYCASE_ (0, YY_("syntax error")); + YYCASE_ (1, YY_("syntax error, unexpected %s")); + YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +#undef YYCASE_ + } + + std::string yyres; + // Argument number. + std::ptrdiff_t yyi = 0; + for (char const* yyp = yyformat; *yyp; ++yyp) + if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) + { + yyres += symbol_name (yyarg[yyi++]); + ++yyp; + } + else + yyres += *yyp; + return yyres; + } + + + const short parser::yypact_ninf_ = -230; + + const short parser::yytable_ninf_ = -177; + + const short + parser::yypact_[] = + { + 7, -67, -20, -230, 53, 7, -230, -230, -230, -230, + -230, -21, -230, 13, -10, -230, -230, -230, -3, 607, + -230, -230, 25, -15, -230, -230, 41, 41, -230, 29, + -230, -230, -230, -230, -230, -230, -230, 607, 480, -3, + 607, 607, -50, -1, -230, -230, -230, 1341, -230, -230, + -230, 18, -230, -230, -230, -230, -230, -230, 23, 30, + -230, 332, -230, -230, -230, 446, 507, 569, 573, -230, + -230, -4, 38, -230, -230, -230, -230, -230, -230, -230, + -230, -230, 47, 85, -3, 56, -230, -230, 84, 64, + -230, -230, 86, 905, 480, -230, 1419, 90, 95, -230, + -230, -230, -230, -230, -230, -230, -230, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 41, 41, 669, -17, -230, + -230, 607, -3, -230, 787, -230, -230, 607, -3, 607, + -230, 607, 1212, 607, -230, 124, 124, 1429, 938, 1501, + 1501, 40, 40, 40, 40, 981, 1460, 1470, 101, 101, + -230, -230, -230, -230, -230, -230, -230, 1251, -230, -230, + -13, -230, 103, 607, 94, -18, 123, 126, 128, 130, + 131, 9, 125, 135, 138, 545, -230, 732, 732, -230, + -230, 826, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, 139, 143, 148, -230, -230, 715, -230, -230, + -230, -230, 84, 1212, 103, 1290, 1328, 133, 1419, -230, + -230, 607, 1375, -230, 132, -230, 607, 607, 630, -3, + 607, 91, 151, 159, 160, -230, -230, -230, -230, 1388, + -230, 6, 6, -230, -230, -230, -230, -230, 152, 172, + 173, 174, -3, -230, -230, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 170, 607, 176, 14, + -230, 177, 1044, 1077, 178, -230, 868, 2, 1087, -230, + -230, -230, -230, 607, 607, 607, 607, 1419, 1419, 1419, + 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 182, 1120, + 607, -230, -230, 865, 865, 607, 607, -3, 85, 1130, + 948, 991, 1034, 607, -230, 42, 207, -230, 187, 1419, + 1163, 205, -230, 188, 190, 607, 193, 607, 195, 607, + 55, -230, 865, 630, 865, 607, -230, -230, 58, -230, + 70, -230, 72, -230, -230, 206, -230, 1173, 198, 199, + 200, 865, 865, -230, -230, -230, -230, -230 + }; + + const unsigned char + parser::yydefact_[] = + { + 3, 0, 0, 186, 0, 2, 6, 7, 9, 10, + 11, 0, 187, 0, 0, 1, 4, 5, 17, 0, + 8, 189, 0, 0, 16, 185, 0, 0, 177, 0, + 196, 195, 179, 180, 181, 182, 183, 0, 162, 0, + 0, 0, 0, 0, 188, 193, 194, 0, 76, 77, + 78, 115, 116, 117, 142, 143, 118, 119, 120, 121, + 122, 0, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 0, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 0, 0, 0, 0, 146, 147, 0, 0, + 150, 151, 0, 0, 162, 178, 161, 0, 158, 159, + 163, 114, 113, 191, 192, 184, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, + 145, 162, 0, 12, 0, 14, 15, 0, 0, 0, + 112, 0, 161, 0, 165, 105, 106, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 107, 108, + 109, 110, 111, 148, 149, 152, 153, 0, 168, 167, + 0, 158, 164, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 40, 0, 0, 42, + 18, 0, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 0, 169, 0, 170, 171, 0, 172, 173, + 174, 175, 176, 0, 0, 0, 0, 0, 160, 166, + 154, 162, 0, 54, 0, 55, 0, 0, 73, 0, + 0, 0, 0, 0, 0, 67, 68, 69, 71, 0, + 169, 79, 80, 39, 41, 45, 43, 44, 0, 0, + 0, 0, 0, 81, 82, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 49, 0, 0, 0, 0, 72, 0, 0, 0, 66, + 65, 64, 70, 0, 0, 0, 0, 83, 89, 90, + 91, 92, 93, 84, 85, 86, 88, 87, 0, 0, + 162, 155, 56, 0, 0, 75, 0, 0, 0, 0, + 0, 0, 0, 162, 190, 0, 57, 59, 0, 74, + 0, 0, 63, 0, 0, 162, 0, 162, 0, 162, + 0, 156, 0, 73, 0, 0, 46, 48, 0, 51, + 0, 53, 0, 157, 58, 0, 61, 0, 0, 0, + 0, 0, 0, 47, 50, 52, 60, 62 + }; + + const short + parser::yypgoto_[] = + { + -230, -230, -230, 243, 244, -230, -230, -230, -230, -178, + -82, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -230, -230, -230, -230, -230, -230, -230, -230, + -230, -230, -93, -230, 35, -229, -230, -230, -230, 27, + 142, -230, -23, -19, 68, -26, -230, -230, -230, 39, + 73, -230, 82, -230, -230, -230, 97, 107, 134, 241, + -230, -230, 0, 5, -230, -12, -230, -230, 74, -230, + 77, -230, -230 + }; + + const short + parser::yydefgoto_[] = + { + 0, 4, 5, 6, 7, 8, 9, 10, 23, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 284, 328, 96, 212, 48, 49, 50, 51, + 52, 53, 54, 55, 97, 171, 99, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81 + }; + + const short + parser::yytable_[] = + { + 11, 135, 22, 86, 90, 11, 13, 87, 91, 285, + 1, 2, 98, 254, 12, 168, 18, 14, 24, 234, + 316, -176, -176, 83, -176, 230, 88, 88, 84, 235, + 143, 89, 89, 131, 29, 103, 104, -176, 129, 100, + -176, 19, 130, -169, -169, 317, -169, 127, -170, -170, + 262, -170, 311, 15, 47, -171, -171, 143, -171, -169, + 20, 88, -169, 82, -170, 3, 89, -170, 98, 29, + 92, -171, 93, 21, -171, 101, 102, -176, -176, 3, + 341, 105, 85, 132, 136, 143, 241, 12, 3, 3, + 107, 108, 21, 353, 133, 46, 358, 137, 143, -169, + -169, 143, 163, 165, -170, -170, 164, 166, 359, 138, + 360, -171, -171, 143, 285, 143, 120, 121, 122, 123, + 124, 131, 12, 3, 134, 88, 88, 139, 169, 142, + 89, 89, 172, 143, 222, 326, 327, 144, 224, 89, + 231, 233, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 236, 213, 167, 237, 354, 238, 356, 239, 240, 242, + 281, 245, 223, 215, 225, 278, 226, 104, 228, 122, + 123, 124, 246, 366, 367, 247, 255, 222, 222, 293, + 256, 222, 89, 89, 129, 257, 89, 289, 130, 170, + 120, 121, 122, 123, 124, 290, 291, 216, 232, 294, + 295, 296, 308, 310, 250, 250, 217, 88, 213, 323, + 249, 342, 89, 345, 312, 315, 215, 215, 129, 129, + 215, 218, 130, 130, 343, 346, 332, 347, 222, 287, + 349, 219, 351, 89, 361, 363, 364, 365, 16, 17, + 355, 88, 88, 0, 0, 243, 89, 89, 244, 0, + 216, 216, 169, 129, 216, 250, 0, 130, 220, 251, + 252, 282, 283, 217, 0, 288, 214, 215, 0, 0, + 0, 0, 0, 0, 218, 218, 88, 0, 218, 0, + 0, 89, 0, 0, 219, 219, 0, 0, 219, 279, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 216, 309, 222, 222, 0, 0, 331, 89, 89, + 286, 220, 220, 0, 0, 220, 0, 0, 319, 320, + 321, 322, 0, 214, 0, 218, 0, 0, 0, 0, + 213, 213, 222, 222, 222, 219, 0, 89, 89, 89, + 329, 330, 215, 215, 0, 0, 0, 125, 126, 0, + 29, 222, 222, 0, 0, 0, 89, 89, 0, 213, + 250, 213, 220, 127, 0, 221, 128, 0, 325, 0, + 357, 215, 215, 215, 0, 0, 216, 216, 213, 213, + 0, 340, 0, 0, 0, 217, 217, 0, 0, 0, + 215, 215, 0, 348, 0, 350, 0, 352, 0, 0, + 218, 218, 0, 12, 3, 216, 216, 216, 0, 0, + 219, 219, 0, 0, 217, 286, 217, 0, 221, 221, + 0, 0, 221, 0, 216, 216, 0, 0, 0, 218, + 218, 218, 0, 217, 217, 0, 0, 220, 220, 219, + 219, 219, 0, 0, 0, 214, 214, 0, 218, 218, + 0, 0, 0, 0, 0, 0, 0, 0, 219, 219, + 0, -172, -172, 0, -172, 0, 220, 220, 220, 221, + 0, 0, 0, 0, 214, 25, 214, -172, 0, 0, + -172, 0, 0, 0, 0, 220, 220, 0, 0, 0, + 0, 0, 0, 214, 214, 26, 27, 28, 29, 30, + 31, 32, 0, 33, 34, 35, 36, 37, 0, 0, + 0, 94, 95, 0, 0, 39, 0, -172, -172, 0, + 0, 0, -173, -173, 0, -173, 0, 0, 0, 0, + 40, 41, 0, 0, 0, 0, 0, 0, -173, 0, + 25, -173, 0, 0, 221, 221, 0, 42, 0, 0, + 43, 12, 3, 21, 44, 45, 46, 0, 0, 0, + 26, 27, 28, 29, 30, 31, 32, 0, 33, 34, + 35, 36, 37, 221, 221, 221, 38, 0, -173, -173, + 39, 0, 248, 0, -174, -174, 0, -174, -175, -175, + 0, -175, 221, 221, 0, 40, 41, 0, 0, 0, + -174, 0, 25, -174, -175, 0, 0, -175, 0, 0, + 0, 0, 42, 0, 0, 43, 12, 3, 21, 44, + 45, 46, 26, 27, 28, 29, 30, 31, 32, 0, + 33, 34, 35, 36, 37, 0, 0, 0, 38, 0, + -174, -174, 39, 0, -175, -175, 0, 0, 29, 0, + 0, 0, 0, 33, 34, 35, 36, 40, 41, 0, + 0, 85, 0, 0, 25, 0, 0, 0, 187, 188, + 0, 0, 0, 0, 42, 0, 0, 43, 12, 3, + 21, 44, 45, 46, 26, 27, 28, 29, 30, 31, + 32, 0, 33, 34, 35, 36, 37, 0, 0, 0, + 94, 12, 3, 0, 39, 0, 0, 0, 0, 0, + 0, 258, 259, 0, 260, 261, 0, 0, 0, 40, + 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 29, 0, 0, 42, 0, 0, 43, + 12, 3, 21, 44, 45, 46, 127, 0, 0, 262, + 29, 0, 0, 263, 264, 33, 34, 35, 36, 0, + 0, 0, 0, 85, 0, 0, 0, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 0, 0, + 0, 0, 0, 0, 0, 173, 12, 3, 174, 175, + 176, 0, 177, 178, 179, 0, 180, 181, 182, 183, + 184, 185, 26, 12, 3, 29, 0, 0, 0, 0, + 33, 34, 35, 36, 0, 0, 134, 186, 85, 0, + 0, 0, 0, 0, 173, 187, 188, 174, 175, 176, + 0, 177, 178, 179, 0, 180, 181, 182, 183, 184, + 185, 26, 0, 0, 29, 0, 0, 0, 0, 33, + 34, 35, 36, 0, 0, 134, 253, 85, 12, 3, + 0, 0, 0, 173, 187, 188, 174, 175, 176, 0, + 177, 178, 179, 0, 180, 181, 182, 183, 184, 185, + 26, 0, 0, 29, 0, 0, 29, 0, 33, 34, + 35, 36, 0, 0, 134, 0, 85, 12, 3, 127, + 0, 0, 262, 187, 188, 0, 263, 264, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 0, 0, 140, 0, 0, 12, 3, 141, 12, + 3, 0, 0, 0, 0, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 117, 118, + 119, 120, 121, 122, 123, 124, 334, 0, 107, 108, + 0, 335, 111, 112, 113, 114, 115, 116, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 0, 0, + 0, 117, 118, 119, 120, 121, 122, 123, 124, 0, + 0, 117, 118, 119, 120, 121, 122, 123, 124, 336, + 0, 107, 108, 0, 337, 111, 112, 113, 114, 115, + 116, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 0, 0, 0, 0, 118, 119, 120, 121, 122, + 123, 124, 0, 0, 117, 118, 119, 120, 121, 122, + 123, 124, 338, 0, 0, 0, 0, 339, 0, 0, + 0, 0, 313, 0, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 0, 0, 0, 117, 118, 119, + 120, 121, 122, 123, 124, 314, 0, 117, 118, 119, + 120, 121, 122, 123, 124, 318, 0, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 0, 0, 0, + 117, 118, 119, 120, 121, 122, 123, 124, 324, 0, + 117, 118, 119, 120, 121, 122, 123, 124, 333, 0, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, + 124, 344, 0, 117, 118, 119, 120, 121, 122, 123, + 124, 362, 0, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 0, 0, 0, 117, 118, 119, 120, + 121, 122, 123, 124, 0, 0, 117, 118, 119, 120, + 121, 122, 123, 124, 227, 0, 0, 0, 0, 0, + 0, 0, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 117, 118, 119, 120, 121, + 122, 123, 124, 229, 0, 0, 0, 0, 0, 0, + 0, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 117, 118, 119, 120, 121, 122, + 123, 124, 276, 0, 0, 0, 0, 0, 0, 0, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 117, 118, 119, 120, 121, 122, 123, + 124, 277, 0, 0, 0, 0, 0, 0, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 106, 0, + 0, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 0, + 0, 0, 0, 0, 117, 118, 119, 120, 121, 122, + 123, 124, 280, 0, 0, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 292, 0, 0, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 0, 0, 0, 0, + 0, 117, 118, 119, 120, 121, 122, 123, 124, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 107, + 108, 0, 110, 111, 112, 113, 114, 115, 116, 0, + 0, 0, 117, 118, 119, 120, 121, 122, 123, 124, + 0, 0, 117, 118, 119, 120, 121, 122, 123, 124, + 107, 108, 0, 0, 111, 112, 113, 114, 115, 116, + 107, 108, 0, 0, 111, 112, 113, 114, 115, 116, + 0, 0, 0, 0, 0, 119, 120, 121, 122, 123, + 124, 0, 0, 0, 0, 0, 120, 121, 122, 123, + 124, 107, 108, 0, 0, 0, 0, 113, 114, 115, + 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 120, 121, 122, + 123, 124 + }; + + const short + parser::yycheck_[] = + { + 0, 83, 14, 26, 27, 5, 1, 26, 27, 238, + 3, 4, 38, 191, 81, 32, 37, 37, 18, 37, + 18, 25, 26, 38, 28, 38, 26, 27, 43, 47, + 43, 26, 27, 37, 28, 85, 86, 41, 61, 39, + 44, 62, 61, 25, 26, 43, 28, 41, 25, 26, + 44, 28, 38, 0, 19, 25, 26, 43, 28, 41, + 47, 61, 44, 38, 41, 82, 61, 44, 94, 28, + 41, 41, 37, 83, 44, 40, 41, 81, 82, 82, + 38, 82, 41, 45, 84, 43, 77, 81, 82, 82, + 50, 51, 83, 38, 47, 86, 38, 41, 43, 81, + 82, 43, 125, 126, 81, 82, 125, 126, 38, 45, + 38, 81, 82, 43, 343, 43, 76, 77, 78, 79, + 80, 37, 81, 82, 39, 125, 126, 41, 128, 94, + 125, 126, 132, 43, 134, 313, 314, 42, 138, 134, + 37, 47, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 37, 134, 127, 37, 342, 37, 344, 37, 37, 181, + 38, 46, 137, 134, 139, 42, 141, 86, 143, 78, + 79, 80, 47, 361, 362, 47, 47, 187, 188, 37, + 47, 191, 187, 188, 217, 47, 191, 46, 217, 131, + 76, 77, 78, 79, 80, 46, 46, 134, 173, 37, + 37, 37, 42, 37, 187, 188, 134, 217, 191, 37, + 185, 14, 217, 18, 47, 47, 187, 188, 251, 252, + 191, 134, 251, 252, 47, 47, 318, 47, 238, 239, + 47, 134, 47, 238, 38, 47, 47, 47, 5, 5, + 343, 251, 252, -1, -1, 181, 251, 252, 181, -1, + 187, 188, 262, 286, 191, 238, -1, 286, 134, 187, + 188, 236, 237, 191, -1, 240, 134, 238, -1, -1, + -1, -1, -1, -1, 187, 188, 286, -1, 191, -1, + -1, 286, -1, -1, 187, 188, -1, -1, 191, 231, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 238, 277, 313, 314, -1, -1, 317, 313, 314, + 238, 187, 188, -1, -1, 191, -1, -1, 293, 294, + 295, 296, -1, 191, -1, 238, -1, -1, -1, -1, + 313, 314, 342, 343, 344, 238, -1, 342, 343, 344, + 315, 316, 313, 314, -1, -1, -1, 25, 26, -1, + 28, 361, 362, -1, -1, -1, 361, 362, -1, 342, + 343, 344, 238, 41, -1, 134, 44, -1, 310, -1, + 345, 342, 343, 344, -1, -1, 313, 314, 361, 362, + -1, 323, -1, -1, -1, 313, 314, -1, -1, -1, + 361, 362, -1, 335, -1, 337, -1, 339, -1, -1, + 313, 314, -1, 81, 82, 342, 343, 344, -1, -1, + 313, 314, -1, -1, 342, 343, 344, -1, 187, 188, + -1, -1, 191, -1, 361, 362, -1, -1, -1, 342, + 343, 344, -1, 361, 362, -1, -1, 313, 314, 342, + 343, 344, -1, -1, -1, 313, 314, -1, 361, 362, + -1, -1, -1, -1, -1, -1, -1, -1, 361, 362, + -1, 25, 26, -1, 28, -1, 342, 343, 344, 238, + -1, -1, -1, -1, 342, 5, 344, 41, -1, -1, + 44, -1, -1, -1, -1, 361, 362, -1, -1, -1, + -1, -1, -1, 361, 362, 25, 26, 27, 28, 29, + 30, 31, -1, 33, 34, 35, 36, 37, -1, -1, + -1, 41, 42, -1, -1, 45, -1, 81, 82, -1, + -1, -1, 25, 26, -1, 28, -1, -1, -1, -1, + 60, 61, -1, -1, -1, -1, -1, -1, 41, -1, + 5, 44, -1, -1, 313, 314, -1, 77, -1, -1, + 80, 81, 82, 83, 84, 85, 86, -1, -1, -1, + 25, 26, 27, 28, 29, 30, 31, -1, 33, 34, + 35, 36, 37, 342, 343, 344, 41, -1, 81, 82, + 45, -1, 47, -1, 25, 26, -1, 28, 25, 26, + -1, 28, 361, 362, -1, 60, 61, -1, -1, -1, + 41, -1, 5, 44, 41, -1, -1, 44, -1, -1, + -1, -1, 77, -1, -1, 80, 81, 82, 83, 84, + 85, 86, 25, 26, 27, 28, 29, 30, 31, -1, + 33, 34, 35, 36, 37, -1, -1, -1, 41, -1, + 81, 82, 45, -1, 81, 82, -1, -1, 28, -1, + -1, -1, -1, 33, 34, 35, 36, 60, 61, -1, + -1, 41, -1, -1, 5, -1, -1, -1, 48, 49, + -1, -1, -1, -1, 77, -1, -1, 80, 81, 82, + 83, 84, 85, 86, 25, 26, 27, 28, 29, 30, + 31, -1, 33, 34, 35, 36, 37, -1, -1, -1, + 41, 81, 82, -1, 45, -1, -1, -1, -1, -1, + -1, 6, 7, -1, 9, 10, -1, -1, -1, 60, + 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 25, -1, -1, 28, -1, -1, 77, -1, -1, 80, + 81, 82, 83, 84, 85, 86, 41, -1, -1, 44, + 28, -1, -1, 48, 49, 33, 34, 35, 36, -1, + -1, -1, -1, 41, -1, -1, -1, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, -1, -1, + -1, -1, -1, -1, -1, 8, 81, 82, 11, 12, + 13, -1, 15, 16, 17, -1, 19, 20, 21, 22, + 23, 24, 25, 81, 82, 28, -1, -1, -1, -1, + 33, 34, 35, 36, -1, -1, 39, 40, 41, -1, + -1, -1, -1, -1, 8, 48, 49, 11, 12, 13, + -1, 15, 16, 17, -1, 19, 20, 21, 22, 23, + 24, 25, -1, -1, 28, -1, -1, -1, -1, 33, + 34, 35, 36, -1, -1, 39, 40, 41, 81, 82, + -1, -1, -1, 8, 48, 49, 11, 12, 13, -1, + 15, 16, 17, -1, 19, 20, 21, 22, 23, 24, + 25, -1, -1, 28, -1, -1, 28, -1, 33, 34, + 35, 36, -1, -1, 39, -1, 41, 81, 82, 41, + -1, -1, 44, 48, 49, -1, 48, 49, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, -1, -1, 38, -1, -1, 81, 82, 43, 81, + 82, -1, -1, -1, -1, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 73, 74, + 75, 76, 77, 78, 79, 80, 38, -1, 50, 51, + -1, 43, 54, 55, 56, 57, 58, 59, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, -1, -1, + -1, 73, 74, 75, 76, 77, 78, 79, 80, -1, + -1, 73, 74, 75, 76, 77, 78, 79, 80, 38, + -1, 50, 51, -1, 43, 54, 55, 56, 57, 58, + 59, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, -1, -1, -1, -1, 74, 75, 76, 77, 78, + 79, 80, -1, -1, 73, 74, 75, 76, 77, 78, + 79, 80, 38, -1, -1, -1, -1, 43, -1, -1, + -1, -1, 38, -1, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, -1, -1, -1, 73, 74, 75, + 76, 77, 78, 79, 80, 38, -1, 73, 74, 75, + 76, 77, 78, 79, 80, 38, -1, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, -1, -1, -1, + 73, 74, 75, 76, 77, 78, 79, 80, 38, -1, + 73, 74, 75, 76, 77, 78, 79, 80, 38, -1, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + -1, -1, -1, 73, 74, 75, 76, 77, 78, 79, + 80, 38, -1, 73, 74, 75, 76, 77, 78, 79, + 80, 38, -1, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, -1, -1, -1, 73, 74, 75, 76, + 77, 78, 79, 80, -1, -1, 73, 74, 75, 76, + 77, 78, 79, 80, 42, -1, -1, -1, -1, -1, + -1, -1, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 73, 74, 75, 76, 77, + 78, 79, 80, 42, -1, -1, -1, -1, -1, -1, + -1, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 73, 74, 75, 76, 77, 78, + 79, 80, 42, -1, -1, -1, -1, -1, -1, -1, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 73, 74, 75, 76, 77, 78, 79, + 80, 43, -1, -1, -1, -1, -1, -1, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 47, -1, + -1, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 73, 74, 75, 76, 77, 78, 79, 80, -1, + -1, -1, -1, -1, 73, 74, 75, 76, 77, 78, + 79, 80, 47, -1, -1, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 47, -1, -1, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 73, 74, + 75, 76, 77, 78, 79, 80, -1, -1, -1, -1, + -1, 73, 74, 75, 76, 77, 78, 79, 80, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 50, + 51, -1, 53, 54, 55, 56, 57, 58, 59, -1, + -1, -1, 73, 74, 75, 76, 77, 78, 79, 80, + -1, -1, 73, 74, 75, 76, 77, 78, 79, 80, + 50, 51, -1, -1, 54, 55, 56, 57, 58, 59, + 50, 51, -1, -1, 54, 55, 56, 57, 58, 59, + -1, -1, -1, -1, -1, 75, 76, 77, 78, 79, + 80, -1, -1, -1, -1, -1, 76, 77, 78, 79, + 80, 50, 51, -1, -1, -1, -1, 56, 57, 58, + 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 76, 77, 78, + 79, 80 + }; + + const unsigned char + parser::yystos_[] = + { + 0, 3, 4, 82, 96, 97, 98, 99, 100, 101, + 102, 157, 81, 158, 37, 0, 98, 99, 37, 62, + 47, 83, 160, 103, 157, 5, 25, 26, 27, 28, + 29, 30, 31, 33, 34, 35, 36, 37, 41, 45, + 60, 61, 77, 80, 84, 85, 86, 129, 131, 132, + 133, 134, 135, 136, 137, 138, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 38, 38, 43, 41, 137, 138, 157, 158, + 137, 138, 41, 129, 41, 42, 129, 139, 140, 141, + 157, 129, 129, 85, 86, 82, 47, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 73, 74, 75, + 76, 77, 78, 79, 80, 25, 26, 41, 44, 137, + 138, 37, 45, 47, 39, 105, 157, 41, 45, 41, + 38, 43, 129, 43, 42, 129, 129, 129, 129, 129, + 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, + 129, 129, 129, 137, 138, 137, 138, 129, 32, 157, + 139, 140, 157, 8, 11, 12, 13, 15, 16, 17, + 19, 20, 21, 22, 23, 24, 40, 48, 49, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 130, 134, 135, 144, 145, 147, 151, 152, + 153, 154, 157, 129, 157, 129, 129, 42, 129, 42, + 38, 37, 129, 47, 37, 47, 37, 37, 37, 37, + 37, 77, 160, 163, 165, 46, 47, 47, 47, 129, + 134, 147, 147, 40, 104, 47, 47, 47, 6, 7, + 9, 10, 44, 48, 49, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 42, 43, 42, 139, + 47, 38, 129, 129, 127, 130, 147, 157, 129, 46, + 46, 46, 47, 37, 37, 37, 37, 129, 129, 129, + 129, 129, 129, 129, 129, 129, 129, 129, 42, 129, + 37, 38, 47, 38, 38, 47, 18, 43, 38, 129, + 129, 129, 129, 37, 38, 139, 104, 104, 128, 129, + 129, 157, 105, 38, 38, 43, 38, 43, 38, 43, + 139, 38, 14, 47, 38, 18, 47, 47, 139, 47, + 139, 47, 139, 38, 104, 127, 104, 129, 38, 38, + 38, 38, 38, 47, 47, 47, 104, 104 + }; + + const unsigned char + parser::yyr1_[] = + { + 0, 95, 96, 96, 97, 97, 97, 97, 98, 99, + 99, 99, 100, 101, 102, 103, 103, 103, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 105, + 105, 106, 106, 107, 107, 108, 109, 110, 110, 111, + 112, 112, 113, 113, 114, 115, 115, 116, 117, 118, + 119, 120, 120, 121, 122, 122, 122, 123, 124, 125, + 126, 126, 127, 127, 128, 128, 129, 129, 129, 130, + 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, + 130, 130, 130, 130, 131, 131, 131, 131, 131, 131, + 131, 131, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 133, 133, 133, 133, 133, 133, 133, 133, + 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, + 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, + 133, 133, 134, 134, 134, 134, 135, 135, 135, 135, + 136, 136, 136, 136, 137, 137, 138, 138, 139, 139, + 140, 140, 141, 142, 142, 143, 144, 145, 146, 147, + 147, 147, 147, 147, 147, 147, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167 + }; + + const signed char + parser::yyr2_[] = + { + 0, 2, 1, 0, 2, 2, 1, 1, 3, 1, + 1, 1, 5, 4, 5, 3, 1, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 2, 2, 1, 2, 2, 2, 6, 8, 6, 3, + 8, 6, 8, 6, 2, 2, 4, 5, 7, 5, + 9, 7, 9, 5, 3, 3, 3, 2, 2, 2, + 3, 2, 1, 0, 1, 0, 1, 1, 1, 2, + 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 2, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, + 2, 2, 3, 3, 4, 6, 8, 9, 1, 1, + 3, 1, 0, 2, 3, 3, 4, 3, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, + 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, + 7, 2, 2, 1, 1, 1, 1 + }; + + + + +#if S2DEBUG + const short + parser::yyrline_[] = + { + 0, 233, 233, 234, 238, 240, 242, 244, 249, 254, + 255, 256, 260, 265, 270, 275, 277, 280, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 308, + 309, 313, 315, 320, 322, 327, 332, 337, 339, 344, + 349, 351, 356, 358, 363, 368, 370, 375, 380, 385, + 390, 395, 397, 402, 407, 409, 411, 416, 421, 426, + 431, 433, 438, 439, 443, 444, 448, 449, 450, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 472, 473, 474, 475, 476, 477, + 478, 479, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 496, 497, 498, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, + 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, + 524, 525, 529, 530, 531, 532, 536, 537, 538, 539, + 543, 544, 545, 546, 550, 552, 557, 559, 564, 565, + 569, 571, 577, 581, 583, 588, 593, 598, 603, 608, + 609, 610, 611, 612, 613, 614, 615, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637 + }; + + void + parser::yy_stack_print_ () const + { + *yycdebug_ << "Stack now"; + for (stack_type::const_iterator + i = yystack_.begin (), + i_end = yystack_.end (); + i != i_end; ++i) + *yycdebug_ << ' ' << int (i->state); + *yycdebug_ << '\n'; + } + + void + parser::yy_reduce_print_ (int yyrule) const + { + int yylno = yyrline_[yyrule]; + int yynrhs = yyr2_[yyrule]; + // Print the symbols being reduced, and their result. + *yycdebug_ << "Reducing stack by rule " << yyrule - 1 + << " (line " << yylno << "):\n"; + // The symbols being reduced. + for (int yyi = 0; yyi < yynrhs; yyi++) + YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", + yystack_[(yynrhs) - (yyi + 1)]); + } +#endif // S2DEBUG + + +#line 13 "parser.ypp" +} } } // xsk::gsc::s2 +#line 3987 "parser.cpp" + +#line 639 "parser.ypp" + + +void xsk::gsc::s2::parser::error(const xsk::gsc::location& loc, const std::string& msg) +{ + throw xsk::gsc::comp_error(loc, msg); +} diff --git a/src/s2/xsk/parser.hpp b/src/s2/xsk/parser.hpp new file mode 100644 index 00000000..782ef27b --- /dev/null +++ b/src/s2/xsk/parser.hpp @@ -0,0 +1,4768 @@ +// A Bison parser, made by GNU Bison 3.7.5. + +// Skeleton interface for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018-2021 Free Software Foundation, Inc. + +// 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 . + +// As a special exception, you may create a larger work that contains +// part or all of the Bison parser skeleton and distribute that work +// under terms of your choice, so long as that work isn't itself a +// parser generator using the skeleton or a modified version thereof +// as a parser skeleton. Alternatively, if you modify or redistribute +// the parser skeleton itself, you may (at your option) remove this +// special exception, which will cause the skeleton and the resulting +// Bison output files to be licensed under the GNU General Public +// License without this special exception. + +// This special exception was added by the Free Software Foundation in +// version 2.2 of Bison. + + +/** + ** \file parser.hpp + ** Define the xsk::gsc::s2::parser class. + */ + +// C++ LALR(1) parser skeleton written by Akim Demaille. + +// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, +// especially those whose name start with YY_ or yy_. They are +// private implementation details that can be changed or removed. + +#ifndef YY_S2_PARSER_HPP_INCLUDED +# define YY_S2_PARSER_HPP_INCLUDED +// "%code requires" blocks. +#line 33 "parser.ypp" + +#include "s2.hpp" +typedef void *yyscan_t; +#define YY_DECL xsk::gsc::s2::parser::symbol_type S2lex(yyscan_t yyscanner, xsk::gsc::location& loc) + +#line 55 "parser.hpp" + +# include +# include // std::abort +# include +# include +# include +# include + +#if defined __cplusplus +# define YY_CPLUSPLUS __cplusplus +#else +# define YY_CPLUSPLUS 199711L +#endif + +// Support move semantics when possible. +#if 201103L <= YY_CPLUSPLUS +# define YY_MOVE std::move +# define YY_MOVE_OR_COPY move +# define YY_MOVE_REF(Type) Type&& +# define YY_RVREF(Type) Type&& +# define YY_COPY(Type) Type +#else +# define YY_MOVE +# define YY_MOVE_OR_COPY copy +# define YY_MOVE_REF(Type) Type& +# define YY_RVREF(Type) const Type& +# define YY_COPY(Type) const Type& +#endif + +// Support noexcept when possible. +#if 201103L <= YY_CPLUSPLUS +# define YY_NOEXCEPT noexcept +# define YY_NOTHROW +#else +# define YY_NOEXCEPT +# define YY_NOTHROW throw () +#endif + +// Support constexpr when possible. +#if 201703 <= YY_CPLUSPLUS +# define YY_CONSTEXPR constexpr +#else +# define YY_CONSTEXPR +#endif + +#include +#ifndef S2_ASSERT +# include +# define S2_ASSERT assert +#endif + + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YY_USE(E) ((void) (E)) +#else +# define YY_USE(E) /* empty */ +#endif + +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +/* Debug traces. */ +#ifndef S2DEBUG +# if defined YYDEBUG +#if YYDEBUG +# define S2DEBUG 1 +# else +# define S2DEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define S2DEBUG 1 +# endif /* ! defined YYDEBUG */ +#endif /* ! defined S2DEBUG */ + +#line 13 "parser.ypp" +namespace xsk { namespace gsc { namespace s2 { +#line 198 "parser.hpp" + + + + + /// A Bison parser. + class parser + { + public: +#ifndef S2STYPE + /// A buffer to store and retrieve objects. + /// + /// Sort of a variant, but does not keep track of the nature + /// of the stored data, since that knowledge is available + /// via the current parser state. + class semantic_type + { + public: + /// Type of *this. + typedef semantic_type self_type; + + /// Empty construction. + semantic_type () YY_NOEXCEPT + : yybuffer_ () + , yytypeid_ (YY_NULLPTR) + {} + + /// Construct and fill. + template + semantic_type (YY_RVREF (T) t) + : yytypeid_ (&typeid (T)) + { + S2_ASSERT (sizeof (T) <= size); + new (yyas_ ()) T (YY_MOVE (t)); + } + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + semantic_type (const self_type&) = delete; + /// Non copyable. + self_type& operator= (const self_type&) = delete; +#endif + + /// Destruction, allowed only if empty. + ~semantic_type () YY_NOEXCEPT + { + S2_ASSERT (!yytypeid_); + } + +# if 201103L <= YY_CPLUSPLUS + /// Instantiate a \a T in here from \a t. + template + T& + emplace (U&&... u) + { + S2_ASSERT (!yytypeid_); + S2_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (std::forward (u)...); + } +# else + /// Instantiate an empty \a T in here. + template + T& + emplace () + { + S2_ASSERT (!yytypeid_); + S2_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (); + } + + /// Instantiate a \a T in here from \a t. + template + T& + emplace (const T& t) + { + S2_ASSERT (!yytypeid_); + S2_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (t); + } +# endif + + /// Instantiate an empty \a T in here. + /// Obsolete, use emplace. + template + T& + build () + { + return emplace (); + } + + /// Instantiate a \a T in here from \a t. + /// Obsolete, use emplace. + template + T& + build (const T& t) + { + return emplace (t); + } + + /// Accessor to a built \a T. + template + T& + as () YY_NOEXCEPT + { + S2_ASSERT (yytypeid_); + S2_ASSERT (*yytypeid_ == typeid (T)); + S2_ASSERT (sizeof (T) <= size); + return *yyas_ (); + } + + /// Const accessor to a built \a T (for %printer). + template + const T& + as () const YY_NOEXCEPT + { + S2_ASSERT (yytypeid_); + S2_ASSERT (*yytypeid_ == typeid (T)); + S2_ASSERT (sizeof (T) <= size); + return *yyas_ (); + } + + /// Swap the content with \a that, of same type. + /// + /// Both variants must be built beforehand, because swapping the actual + /// data requires reading it (with as()), and this is not possible on + /// unconstructed variants: it would require some dynamic testing, which + /// should not be the variant's responsibility. + /// Swapping between built and (possibly) non-built is done with + /// self_type::move (). + template + void + swap (self_type& that) YY_NOEXCEPT + { + S2_ASSERT (yytypeid_); + S2_ASSERT (*yytypeid_ == *that.yytypeid_); + std::swap (as (), that.as ()); + } + + /// Move the content of \a that to this. + /// + /// Destroys \a that. + template + void + move (self_type& that) + { +# if 201103L <= YY_CPLUSPLUS + emplace (std::move (that.as ())); +# else + emplace (); + swap (that); +# endif + that.destroy (); + } + +# if 201103L <= YY_CPLUSPLUS + /// Move the content of \a that to this. + template + void + move (self_type&& that) + { + emplace (std::move (that.as ())); + that.destroy (); + } +#endif + + /// Copy the content of \a that to this. + template + void + copy (const self_type& that) + { + emplace (that.as ()); + } + + /// Destroy the stored \a T. + template + void + destroy () + { + as ().~T (); + yytypeid_ = YY_NULLPTR; + } + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + semantic_type (const self_type&); + /// Non copyable. + self_type& operator= (const self_type&); +#endif + + /// Accessor to raw memory as \a T. + template + T* + yyas_ () YY_NOEXCEPT + { + void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + /// Const accessor to raw memory as \a T. + template + const T* + yyas_ () const YY_NOEXCEPT + { + const void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + /// An auxiliary type to compute the largest semantic type. + union union_type + { + // anim + char dummy1[sizeof (anim_ptr)]; + + // animation + char dummy2[sizeof (animation_ptr)]; + + // animtree + char dummy3[sizeof (animtree_ptr)]; + + // constant + char dummy4[sizeof (constant_ptr)]; + + // define + char dummy5[sizeof (define_ptr)]; + + // empty_array + char dummy6[sizeof (empty_array_ptr)]; + + // expr_arguments + // expr_arguments_filled + // expr_arguments_empty + char dummy7[sizeof (expr_arguments_ptr)]; + + // expr_assign + char dummy8[sizeof (expr_assign_ptr)]; + + // expr_call + // expr_call_thread + // expr_call_childthread + char dummy9[sizeof (expr_call_ptr)]; + + // expr_call_function + // expr_call_pointer + char dummy10[sizeof (expr_call_type_ptr)]; + + // for_expr + // expr + // expr_compare + // expr_binary + // expr_primitive + char dummy11[sizeof (expr_ptr)]; + + // false + char dummy12[sizeof (false_ptr)]; + + // file + char dummy13[sizeof (file_ptr)]; + + // neg_float + // float + char dummy14[sizeof (float_ptr)]; + + // game + char dummy15[sizeof (game_ptr)]; + + // include + char dummy16[sizeof (include_ptr)]; + + // neg_integer + // integer + char dummy17[sizeof (integer_ptr)]; + + // istring + char dummy18[sizeof (istring_ptr)]; + + // level + char dummy19[sizeof (level_ptr)]; + + // name + char dummy20[sizeof (name_ptr)]; + + // expr_function + // expr_add_array + // expr_array + // expr_field + // expr_size + // object + char dummy21[sizeof (node_ptr)]; + + // parameters + char dummy22[sizeof (parameters_ptr)]; + + // program + char dummy23[sizeof (program_ptr)]; + + // self + char dummy24[sizeof (self_ptr)]; + + // "file path" + // "identifier" + // "string literal" + // "localized string" + // "float" + // "int" + char dummy25[sizeof (std::string)]; + + // stmt_assign + char dummy26[sizeof (stmt_assign_ptr)]; + + // stmt_break + char dummy27[sizeof (stmt_break_ptr)]; + + // stmt_call + char dummy28[sizeof (stmt_call_ptr)]; + + // stmt_case + char dummy29[sizeof (stmt_case_ptr)]; + + // stmt_continue + char dummy30[sizeof (stmt_continue_ptr)]; + + // stmt_default + char dummy31[sizeof (stmt_default_ptr)]; + + // stmt_endon + char dummy32[sizeof (stmt_endon_ptr)]; + + // stmt_for + char dummy33[sizeof (stmt_for_ptr)]; + + // stmt_foreach + char dummy34[sizeof (stmt_foreach_ptr)]; + + // stmt_if + char dummy35[sizeof (stmt_if_ptr)]; + + // stmt_ifelse + char dummy36[sizeof (stmt_ifelse_ptr)]; + + // stmt_block + // stmt_list + char dummy37[sizeof (stmt_list_ptr)]; + + // stmt_notify + char dummy38[sizeof (stmt_notify_ptr)]; + + // stmt + // for_stmt + char dummy39[sizeof (stmt_ptr)]; + + // stmt_return + char dummy40[sizeof (stmt_return_ptr)]; + + // stmt_switch + char dummy41[sizeof (stmt_switch_ptr)]; + + // stmt_wait + char dummy42[sizeof (stmt_wait_ptr)]; + + // stmt_waitframe + char dummy43[sizeof (stmt_waitframe_ptr)]; + + // stmt_waittill + char dummy44[sizeof (stmt_waittill_ptr)]; + + // stmt_waittillframeend + char dummy45[sizeof (stmt_waittillframeend_ptr)]; + + // stmt_waittillmatch + char dummy46[sizeof (stmt_waittillmatch_ptr)]; + + // stmt_while + char dummy47[sizeof (stmt_while_ptr)]; + + // string + char dummy48[sizeof (string_ptr)]; + + // thisthread + char dummy49[sizeof (thisthread_ptr)]; + + // thread + char dummy50[sizeof (thread_ptr)]; + + // true + char dummy51[sizeof (true_ptr)]; + + // undefined + char dummy52[sizeof (undefined_ptr)]; + + // usingtree + char dummy53[sizeof (usingtree_ptr)]; + + // vector + char dummy54[sizeof (vector_ptr)]; + }; + + /// The size of the largest semantic type. + enum { size = sizeof (union_type) }; + + /// A buffer to store semantic values. + union + { + /// Strongest alignment constraints. + long double yyalign_me; + /// A buffer large enough to store any of the semantic values. + char yyraw[size]; + } yybuffer_; + + /// Whether the content is built: if defined, the name of the stored type. + const std::type_info *yytypeid_; + }; + +#else + typedef S2STYPE semantic_type; +#endif + /// Symbol locations. + typedef xsk::gsc::location location_type; + + /// Syntax errors thrown from user actions. + struct syntax_error : std::runtime_error + { + syntax_error (const location_type& l, const std::string& m) + : std::runtime_error (m) + , location (l) + {} + + syntax_error (const syntax_error& s) + : std::runtime_error (s.what ()) + , location (s.location) + {} + + ~syntax_error () YY_NOEXCEPT YY_NOTHROW; + + location_type location; + }; + + /// Token kinds. + struct token + { + enum token_kind_type + { + S2EMPTY = -2, + S2EOF = 0, // "end of file" + S2error = 1, // error + S2UNDEF = 2, // "invalid token" + INCLUDE = 3, // "#include" + USINGTREE = 4, // "#using_animtree" + ANIMTREE = 5, // "#animtree" + ENDON = 6, // "endon" + NOTIFY = 7, // "notify" + WAIT = 8, // "wait" + WAITTILL = 9, // "waittill" + WAITTILLMATCH = 10, // "waittillmatch" + WAITTILLFRAMEEND = 11, // "waittillframeend" + WAITFRAME = 12, // "waitframe" + IF = 13, // "if" + ELSE = 14, // "else" + WHILE = 15, // "while" + FOR = 16, // "for" + FOREACH = 17, // "foreach" + IN = 18, // "in" + SWITCH = 19, // "switch" + CASE = 20, // "case" + DEFAULT = 21, // "default" + BREAK = 22, // "break" + CONTINUE = 23, // "continue" + RETURN = 24, // "return" + THREAD = 25, // "thread" + CHILDTHREAD = 26, // "childthread" + THISTHREAD = 27, // "thisthread" + CALL = 28, // "call" + TRUE = 29, // "true" + FALSE = 30, // "false" + UNDEFINED = 31, // "undefined" + SIZE = 32, // "size" + GAME = 33, // "game" + SELF = 34, // "self" + ANIM = 35, // "anim" + LEVEL = 36, // "level" + LPAREN = 37, // "(" + RPAREN = 38, // ")" + LBRACE = 39, // "{" + RBRACE = 40, // "}" + LBRACKET = 41, // "[" + RBRACKET = 42, // "]" + COMMA = 43, // "," + DOT = 44, // "." + DOUBLECOLON = 45, // "::" + COLON = 46, // ":" + SEMICOLON = 47, // ";" + INCREMENT = 48, // "++" + DECREMENT = 49, // "--" + LSHIFT = 50, // "<<" + RSHIFT = 51, // ">>" + OR = 52, // "||" + AND = 53, // "&&" + EQUALITY = 54, // "==" + INEQUALITY = 55, // "!=" + LESS_EQUAL = 56, // "<=" + GREATER_EQUAL = 57, // ">=" + LESS = 58, // "<" + GREATER = 59, // ">" + NOT = 60, // "!" + COMPLEMENT = 61, // "~" + ASSIGN = 62, // "=" + ASSIGN_ADD = 63, // "+=" + ASSIGN_SUB = 64, // "-=" + ASSIGN_MULT = 65, // "*=" + ASSIGN_DIV = 66, // "/=" + ASSIGN_MOD = 67, // "%=" + ASSIGN_BITWISE_OR = 68, // "|=" + ASSIGN_BITWISE_AND = 69, // "&=" + ASSIGN_BITWISE_EXOR = 70, // "^=" + ASSIGN_RSHIFT = 71, // ">>=" + ASSIGN_LSHIFT = 72, // "<<=" + BITWISE_OR = 73, // "|" + BITWISE_AND = 74, // "&" + BITWISE_EXOR = 75, // "^" + ADD = 76, // "+" + SUB = 77, // "-" + MULT = 78, // "*" + DIV = 79, // "/" + MOD = 80, // "%" + FILE = 81, // "file path" + NAME = 82, // "identifier" + STRING = 83, // "string literal" + ISTRING = 84, // "localized string" + FLOAT = 85, // "float" + INTEGER = 86, // "int" + ADD_ARRAY = 87, // ADD_ARRAY + THEN = 88, // THEN + NEG = 89, // NEG + ANIMREF = 90, // ANIMREF + PREINC = 91, // PREINC + PREDEC = 92, // PREDEC + POSTINC = 93, // POSTINC + POSTDEC = 94 // POSTDEC + }; + /// Backward compatibility alias (Bison 3.6). + typedef token_kind_type yytokentype; + }; + + /// Token kind, as returned by yylex. + typedef token::yytokentype token_kind_type; + + /// Backward compatibility alias (Bison 3.6). + typedef token_kind_type token_type; + + /// Symbol kinds. + struct symbol_kind + { + enum symbol_kind_type + { + YYNTOKENS = 95, ///< Number of tokens. + S_YYEMPTY = -2, + S_YYEOF = 0, // "end of file" + S_YYerror = 1, // error + S_YYUNDEF = 2, // "invalid token" + S_INCLUDE = 3, // "#include" + S_USINGTREE = 4, // "#using_animtree" + S_ANIMTREE = 5, // "#animtree" + S_ENDON = 6, // "endon" + S_NOTIFY = 7, // "notify" + S_WAIT = 8, // "wait" + S_WAITTILL = 9, // "waittill" + S_WAITTILLMATCH = 10, // "waittillmatch" + S_WAITTILLFRAMEEND = 11, // "waittillframeend" + S_WAITFRAME = 12, // "waitframe" + S_IF = 13, // "if" + S_ELSE = 14, // "else" + S_WHILE = 15, // "while" + S_FOR = 16, // "for" + S_FOREACH = 17, // "foreach" + S_IN = 18, // "in" + S_SWITCH = 19, // "switch" + S_CASE = 20, // "case" + S_DEFAULT = 21, // "default" + S_BREAK = 22, // "break" + S_CONTINUE = 23, // "continue" + S_RETURN = 24, // "return" + S_THREAD = 25, // "thread" + S_CHILDTHREAD = 26, // "childthread" + S_THISTHREAD = 27, // "thisthread" + S_CALL = 28, // "call" + S_TRUE = 29, // "true" + S_FALSE = 30, // "false" + S_UNDEFINED = 31, // "undefined" + S_SIZE = 32, // "size" + S_GAME = 33, // "game" + S_SELF = 34, // "self" + S_ANIM = 35, // "anim" + S_LEVEL = 36, // "level" + S_LPAREN = 37, // "(" + S_RPAREN = 38, // ")" + S_LBRACE = 39, // "{" + S_RBRACE = 40, // "}" + S_LBRACKET = 41, // "[" + S_RBRACKET = 42, // "]" + S_COMMA = 43, // "," + S_DOT = 44, // "." + S_DOUBLECOLON = 45, // "::" + S_COLON = 46, // ":" + S_SEMICOLON = 47, // ";" + S_INCREMENT = 48, // "++" + S_DECREMENT = 49, // "--" + S_LSHIFT = 50, // "<<" + S_RSHIFT = 51, // ">>" + S_OR = 52, // "||" + S_AND = 53, // "&&" + S_EQUALITY = 54, // "==" + S_INEQUALITY = 55, // "!=" + S_LESS_EQUAL = 56, // "<=" + S_GREATER_EQUAL = 57, // ">=" + S_LESS = 58, // "<" + S_GREATER = 59, // ">" + S_NOT = 60, // "!" + S_COMPLEMENT = 61, // "~" + S_ASSIGN = 62, // "=" + S_ASSIGN_ADD = 63, // "+=" + S_ASSIGN_SUB = 64, // "-=" + S_ASSIGN_MULT = 65, // "*=" + S_ASSIGN_DIV = 66, // "/=" + S_ASSIGN_MOD = 67, // "%=" + S_ASSIGN_BITWISE_OR = 68, // "|=" + S_ASSIGN_BITWISE_AND = 69, // "&=" + S_ASSIGN_BITWISE_EXOR = 70, // "^=" + S_ASSIGN_RSHIFT = 71, // ">>=" + S_ASSIGN_LSHIFT = 72, // "<<=" + S_BITWISE_OR = 73, // "|" + S_BITWISE_AND = 74, // "&" + S_BITWISE_EXOR = 75, // "^" + S_ADD = 76, // "+" + S_SUB = 77, // "-" + S_MULT = 78, // "*" + S_DIV = 79, // "/" + S_MOD = 80, // "%" + S_FILE = 81, // "file path" + S_NAME = 82, // "identifier" + S_STRING = 83, // "string literal" + S_ISTRING = 84, // "localized string" + S_FLOAT = 85, // "float" + S_INTEGER = 86, // "int" + S_ADD_ARRAY = 87, // ADD_ARRAY + S_THEN = 88, // THEN + S_NEG = 89, // NEG + S_ANIMREF = 90, // ANIMREF + S_PREINC = 91, // PREINC + S_PREDEC = 92, // PREDEC + S_POSTINC = 93, // POSTINC + S_POSTDEC = 94, // POSTDEC + S_YYACCEPT = 95, // $accept + S_root = 96, // root + S_program = 97, // program + S_include = 98, // include + S_define = 99, // define + S_usingtree = 100, // usingtree + S_constant = 101, // constant + S_thread = 102, // thread + S_parameters = 103, // parameters + S_stmt = 104, // stmt + S_stmt_block = 105, // stmt_block + S_stmt_list = 106, // stmt_list + S_stmt_call = 107, // stmt_call + S_stmt_assign = 108, // stmt_assign + S_stmt_endon = 109, // stmt_endon + S_stmt_notify = 110, // stmt_notify + S_stmt_wait = 111, // stmt_wait + S_stmt_waittill = 112, // stmt_waittill + S_stmt_waittillmatch = 113, // stmt_waittillmatch + S_stmt_waittillframeend = 114, // stmt_waittillframeend + S_stmt_waitframe = 115, // stmt_waitframe + S_stmt_if = 116, // stmt_if + S_stmt_ifelse = 117, // stmt_ifelse + S_stmt_while = 118, // stmt_while + S_stmt_for = 119, // stmt_for + S_stmt_foreach = 120, // stmt_foreach + S_stmt_switch = 121, // stmt_switch + S_stmt_case = 122, // stmt_case + S_stmt_default = 123, // stmt_default + S_stmt_break = 124, // stmt_break + S_stmt_continue = 125, // stmt_continue + S_stmt_return = 126, // stmt_return + S_for_stmt = 127, // for_stmt + S_for_expr = 128, // for_expr + S_expr = 129, // expr + S_expr_assign = 130, // expr_assign + S_expr_compare = 131, // expr_compare + S_expr_binary = 132, // expr_binary + S_expr_primitive = 133, // expr_primitive + S_expr_call = 134, // expr_call + S_expr_call_thread = 135, // expr_call_thread + S_expr_call_childthread = 136, // expr_call_childthread + S_expr_call_function = 137, // expr_call_function + S_expr_call_pointer = 138, // expr_call_pointer + S_expr_arguments = 139, // expr_arguments + S_expr_arguments_filled = 140, // expr_arguments_filled + S_expr_arguments_empty = 141, // expr_arguments_empty + S_expr_function = 142, // expr_function + S_expr_add_array = 143, // expr_add_array + S_expr_array = 144, // expr_array + S_expr_field = 145, // expr_field + S_expr_size = 146, // expr_size + S_object = 147, // object + S_thisthread = 148, // thisthread + S_empty_array = 149, // empty_array + S_undefined = 150, // undefined + S_game = 151, // game + S_self = 152, // self + S_anim = 153, // anim + S_level = 154, // level + S_animation = 155, // animation + S_animtree = 156, // animtree + S_name = 157, // name + S_file = 158, // file + S_istring = 159, // istring + S_string = 160, // string + S_vector = 161, // vector + S_neg_float = 162, // neg_float + S_neg_integer = 163, // neg_integer + S_float = 164, // float + S_integer = 165, // integer + S_false = 166, // false + S_true = 167 // true + }; + }; + + /// (Internal) symbol kind. + typedef symbol_kind::symbol_kind_type symbol_kind_type; + + /// The number of tokens. + static const symbol_kind_type YYNTOKENS = symbol_kind::YYNTOKENS; + + /// A complete symbol. + /// + /// Expects its Base type to provide access to the symbol kind + /// via kind (). + /// + /// Provide access to semantic value and location. + template + struct basic_symbol : Base + { + /// Alias to Base. + typedef Base super_type; + + /// Default constructor. + basic_symbol () + : value () + , location () + {} + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + basic_symbol (basic_symbol&& that) + : Base (std::move (that)) + , value () + , location (std::move (that.location)) + { + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (std::move (that.value)); + break; + + default: + break; + } + + } +#endif + + /// Copy constructor. + basic_symbol (const basic_symbol& that); + + /// Constructors for typed symbols. +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, location_type&& l) + : Base (t) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const location_type& l) + : Base (t) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, anim_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const anim_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, animation_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const animation_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, animtree_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const animtree_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, constant_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const constant_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, define_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const define_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, empty_array_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const empty_array_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_arguments_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_arguments_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_assign_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_assign_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_call_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_call_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_call_type_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_call_type_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, expr_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const expr_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, false_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const false_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, file_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const file_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, float_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const float_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, game_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const game_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, include_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const include_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, integer_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const integer_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, istring_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const istring_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, level_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const level_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, name_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const name_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, node_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const node_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, parameters_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const parameters_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, program_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const program_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, self_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const self_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_assign_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_assign_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_break_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_break_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_call_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_call_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_case_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_case_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_continue_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_continue_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_default_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_default_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_endon_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_endon_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_for_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_for_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_foreach_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_foreach_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_if_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_if_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_ifelse_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_ifelse_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_list_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_list_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_notify_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_notify_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_return_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_return_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_switch_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_switch_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_wait_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_wait_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waitframe_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waitframe_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittill_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittill_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittillframeend_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittillframeend_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittillmatch_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittillmatch_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_while_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_while_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, string_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const string_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, thisthread_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const thisthread_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, thread_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const thread_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, true_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const true_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, undefined_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const undefined_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, usingtree_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const usingtree_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, vector_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const vector_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + + /// Destroy the symbol. + ~basic_symbol () + { + clear (); + } + + /// Destroy contents, and record that is empty. + void clear () YY_NOEXCEPT + { + // User destructor. + symbol_kind_type yykind = this->kind (); + basic_symbol& yysym = *this; + (void) yysym; + switch (yykind) + { + default: + break; + } + + // Value type destructor. +switch (yykind) + { + case symbol_kind::S_anim: // anim + value.template destroy< anim_ptr > (); + break; + + case symbol_kind::S_animation: // animation + value.template destroy< animation_ptr > (); + break; + + case symbol_kind::S_animtree: // animtree + value.template destroy< animtree_ptr > (); + break; + + case symbol_kind::S_constant: // constant + value.template destroy< constant_ptr > (); + break; + + case symbol_kind::S_define: // define + value.template destroy< define_ptr > (); + break; + + case symbol_kind::S_empty_array: // empty_array + value.template destroy< empty_array_ptr > (); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.template destroy< expr_arguments_ptr > (); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.template destroy< expr_assign_ptr > (); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.template destroy< expr_call_ptr > (); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.template destroy< expr_call_type_ptr > (); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.template destroy< expr_ptr > (); + break; + + case symbol_kind::S_false: // false + value.template destroy< false_ptr > (); + break; + + case symbol_kind::S_file: // file + value.template destroy< file_ptr > (); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.template destroy< float_ptr > (); + break; + + case symbol_kind::S_game: // game + value.template destroy< game_ptr > (); + break; + + case symbol_kind::S_include: // include + value.template destroy< include_ptr > (); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.template destroy< integer_ptr > (); + break; + + case symbol_kind::S_istring: // istring + value.template destroy< istring_ptr > (); + break; + + case symbol_kind::S_level: // level + value.template destroy< level_ptr > (); + break; + + case symbol_kind::S_name: // name + value.template destroy< name_ptr > (); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.template destroy< node_ptr > (); + break; + + case symbol_kind::S_parameters: // parameters + value.template destroy< parameters_ptr > (); + break; + + case symbol_kind::S_program: // program + value.template destroy< program_ptr > (); + break; + + case symbol_kind::S_self: // self + value.template destroy< self_ptr > (); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.template destroy< std::string > (); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.template destroy< stmt_assign_ptr > (); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.template destroy< stmt_break_ptr > (); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.template destroy< stmt_call_ptr > (); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.template destroy< stmt_case_ptr > (); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.template destroy< stmt_continue_ptr > (); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.template destroy< stmt_default_ptr > (); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.template destroy< stmt_endon_ptr > (); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.template destroy< stmt_for_ptr > (); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.template destroy< stmt_foreach_ptr > (); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.template destroy< stmt_if_ptr > (); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.template destroy< stmt_ifelse_ptr > (); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.template destroy< stmt_list_ptr > (); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.template destroy< stmt_notify_ptr > (); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.template destroy< stmt_ptr > (); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.template destroy< stmt_return_ptr > (); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.template destroy< stmt_switch_ptr > (); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.template destroy< stmt_wait_ptr > (); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.template destroy< stmt_waitframe_ptr > (); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.template destroy< stmt_waittill_ptr > (); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.template destroy< stmt_waittillframeend_ptr > (); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.template destroy< stmt_waittillmatch_ptr > (); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.template destroy< stmt_while_ptr > (); + break; + + case symbol_kind::S_string: // string + value.template destroy< string_ptr > (); + break; + + case symbol_kind::S_thisthread: // thisthread + value.template destroy< thisthread_ptr > (); + break; + + case symbol_kind::S_thread: // thread + value.template destroy< thread_ptr > (); + break; + + case symbol_kind::S_true: // true + value.template destroy< true_ptr > (); + break; + + case symbol_kind::S_undefined: // undefined + value.template destroy< undefined_ptr > (); + break; + + case symbol_kind::S_usingtree: // usingtree + value.template destroy< usingtree_ptr > (); + break; + + case symbol_kind::S_vector: // vector + value.template destroy< vector_ptr > (); + break; + + default: + break; + } + + Base::clear (); + } + + /// The user-facing name of this symbol. + const char *name () const YY_NOEXCEPT + { + return parser::symbol_name (this->kind ()); + } + + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; + + /// Whether empty. + bool empty () const YY_NOEXCEPT; + + /// Destructive move, \a s is emptied into this. + void move (basic_symbol& s); + + /// The semantic value. + semantic_type value; + + /// The location. + location_type location; + + private: +#if YY_CPLUSPLUS < 201103L + /// Assignment operator. + basic_symbol& operator= (const basic_symbol& that); +#endif + }; + + /// Type access provider for token (enum) based symbols. + struct by_kind + { + /// Default constructor. + by_kind (); + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + by_kind (by_kind&& that); +#endif + + /// Copy constructor. + by_kind (const by_kind& that); + + /// The symbol kind as needed by the constructor. + typedef token_kind_type kind_type; + + /// Constructor from (external) token numbers. + by_kind (kind_type t); + + /// Record that this symbol is empty. + void clear () YY_NOEXCEPT; + + /// Steal the symbol kind from \a that. + void move (by_kind& that); + + /// The (internal) type number (corresponding to \a type). + /// \a empty when empty. + symbol_kind_type kind () const YY_NOEXCEPT; + + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; + + /// The symbol kind. + /// \a S_YYEMPTY when empty. + symbol_kind_type kind_; + }; + + /// Backward compatibility for a private implementation detail (Bison 3.6). + typedef by_kind by_type; + + /// "External" symbols: returned by the scanner. + struct symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + + /// Empty symbol. + symbol_type () {} + + /// Constructor for valueless symbols, and symbols from each type. +#if 201103L <= YY_CPLUSPLUS + symbol_type (int tok, location_type l) + : super_type(token_type (tok), std::move (l)) +#else + symbol_type (int tok, const location_type& l) + : super_type(token_type (tok), l) +#endif + { + S2_ASSERT (tok == token::S2EOF + || (token::S2error <= tok && tok <= token::MOD) + || (token::ADD_ARRAY <= tok && tok <= token::POSTDEC)); + } +#if 201103L <= YY_CPLUSPLUS + symbol_type (int tok, std::string v, location_type l) + : super_type(token_type (tok), std::move (v), std::move (l)) +#else + symbol_type (int tok, const std::string& v, const location_type& l) + : super_type(token_type (tok), v, l) +#endif + { + S2_ASSERT ((token::FILE <= tok && tok <= token::INTEGER)); + } + }; + + /// Build a parser object. + parser (yyscan_t yyscanner_yyarg, xsk::gsc::location& loc_yyarg, xsk::gsc::program_ptr& ast_yyarg); + virtual ~parser (); + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + parser (const parser&) = delete; + /// Non copyable. + parser& operator= (const parser&) = delete; +#endif + + /// Parse. An alias for parse (). + /// \returns 0 iff parsing succeeded. + int operator() (); + + /// Parse. + /// \returns 0 iff parsing succeeded. + virtual int parse (); + +#if S2DEBUG + /// The current debugging stream. + std::ostream& debug_stream () const YY_ATTRIBUTE_PURE; + /// Set the current debugging stream. + void set_debug_stream (std::ostream &); + + /// Type for debugging levels. + typedef int debug_level_type; + /// The current debugging level. + debug_level_type debug_level () const YY_ATTRIBUTE_PURE; + /// Set the current debugging level. + void set_debug_level (debug_level_type l); +#endif + + /// Report a syntax error. + /// \param loc where the syntax error is found. + /// \param msg a description of the syntax error. + virtual void error (const location_type& loc, const std::string& msg); + + /// Report a syntax error. + void error (const syntax_error& err); + + /// The user-facing name of the symbol whose (internal) number is + /// YYSYMBOL. No bounds checking. + static const char *symbol_name (symbol_kind_type yysymbol); + + // Implementation of make_symbol for each symbol type. +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_S2EOF (location_type l) + { + return symbol_type (token::S2EOF, std::move (l)); + } +#else + static + symbol_type + make_S2EOF (const location_type& l) + { + return symbol_type (token::S2EOF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_S2error (location_type l) + { + return symbol_type (token::S2error, std::move (l)); + } +#else + static + symbol_type + make_S2error (const location_type& l) + { + return symbol_type (token::S2error, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_S2UNDEF (location_type l) + { + return symbol_type (token::S2UNDEF, std::move (l)); + } +#else + static + symbol_type + make_S2UNDEF (const location_type& l) + { + return symbol_type (token::S2UNDEF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INCLUDE (location_type l) + { + return symbol_type (token::INCLUDE, std::move (l)); + } +#else + static + symbol_type + make_INCLUDE (const location_type& l) + { + return symbol_type (token::INCLUDE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_USINGTREE (location_type l) + { + return symbol_type (token::USINGTREE, std::move (l)); + } +#else + static + symbol_type + make_USINGTREE (const location_type& l) + { + return symbol_type (token::USINGTREE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIMTREE (location_type l) + { + return symbol_type (token::ANIMTREE, std::move (l)); + } +#else + static + symbol_type + make_ANIMTREE (const location_type& l) + { + return symbol_type (token::ANIMTREE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ENDON (location_type l) + { + return symbol_type (token::ENDON, std::move (l)); + } +#else + static + symbol_type + make_ENDON (const location_type& l) + { + return symbol_type (token::ENDON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NOTIFY (location_type l) + { + return symbol_type (token::NOTIFY, std::move (l)); + } +#else + static + symbol_type + make_NOTIFY (const location_type& l) + { + return symbol_type (token::NOTIFY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAIT (location_type l) + { + return symbol_type (token::WAIT, std::move (l)); + } +#else + static + symbol_type + make_WAIT (const location_type& l) + { + return symbol_type (token::WAIT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILL (location_type l) + { + return symbol_type (token::WAITTILL, std::move (l)); + } +#else + static + symbol_type + make_WAITTILL (const location_type& l) + { + return symbol_type (token::WAITTILL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILLMATCH (location_type l) + { + return symbol_type (token::WAITTILLMATCH, std::move (l)); + } +#else + static + symbol_type + make_WAITTILLMATCH (const location_type& l) + { + return symbol_type (token::WAITTILLMATCH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILLFRAMEEND (location_type l) + { + return symbol_type (token::WAITTILLFRAMEEND, std::move (l)); + } +#else + static + symbol_type + make_WAITTILLFRAMEEND (const location_type& l) + { + return symbol_type (token::WAITTILLFRAMEEND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITFRAME (location_type l) + { + return symbol_type (token::WAITFRAME, std::move (l)); + } +#else + static + symbol_type + make_WAITFRAME (const location_type& l) + { + return symbol_type (token::WAITFRAME, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IF (location_type l) + { + return symbol_type (token::IF, std::move (l)); + } +#else + static + symbol_type + make_IF (const location_type& l) + { + return symbol_type (token::IF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ELSE (location_type l) + { + return symbol_type (token::ELSE, std::move (l)); + } +#else + static + symbol_type + make_ELSE (const location_type& l) + { + return symbol_type (token::ELSE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WHILE (location_type l) + { + return symbol_type (token::WHILE, std::move (l)); + } +#else + static + symbol_type + make_WHILE (const location_type& l) + { + return symbol_type (token::WHILE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FOR (location_type l) + { + return symbol_type (token::FOR, std::move (l)); + } +#else + static + symbol_type + make_FOR (const location_type& l) + { + return symbol_type (token::FOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FOREACH (location_type l) + { + return symbol_type (token::FOREACH, std::move (l)); + } +#else + static + symbol_type + make_FOREACH (const location_type& l) + { + return symbol_type (token::FOREACH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IN (location_type l) + { + return symbol_type (token::IN, std::move (l)); + } +#else + static + symbol_type + make_IN (const location_type& l) + { + return symbol_type (token::IN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SWITCH (location_type l) + { + return symbol_type (token::SWITCH, std::move (l)); + } +#else + static + symbol_type + make_SWITCH (const location_type& l) + { + return symbol_type (token::SWITCH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CASE (location_type l) + { + return symbol_type (token::CASE, std::move (l)); + } +#else + static + symbol_type + make_CASE (const location_type& l) + { + return symbol_type (token::CASE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DEFAULT (location_type l) + { + return symbol_type (token::DEFAULT, std::move (l)); + } +#else + static + symbol_type + make_DEFAULT (const location_type& l) + { + return symbol_type (token::DEFAULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BREAK (location_type l) + { + return symbol_type (token::BREAK, std::move (l)); + } +#else + static + symbol_type + make_BREAK (const location_type& l) + { + return symbol_type (token::BREAK, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CONTINUE (location_type l) + { + return symbol_type (token::CONTINUE, std::move (l)); + } +#else + static + symbol_type + make_CONTINUE (const location_type& l) + { + return symbol_type (token::CONTINUE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RETURN (location_type l) + { + return symbol_type (token::RETURN, std::move (l)); + } +#else + static + symbol_type + make_RETURN (const location_type& l) + { + return symbol_type (token::RETURN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THREAD (location_type l) + { + return symbol_type (token::THREAD, std::move (l)); + } +#else + static + symbol_type + make_THREAD (const location_type& l) + { + return symbol_type (token::THREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CHILDTHREAD (location_type l) + { + return symbol_type (token::CHILDTHREAD, std::move (l)); + } +#else + static + symbol_type + make_CHILDTHREAD (const location_type& l) + { + return symbol_type (token::CHILDTHREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THISTHREAD (location_type l) + { + return symbol_type (token::THISTHREAD, std::move (l)); + } +#else + static + symbol_type + make_THISTHREAD (const location_type& l) + { + return symbol_type (token::THISTHREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CALL (location_type l) + { + return symbol_type (token::CALL, std::move (l)); + } +#else + static + symbol_type + make_CALL (const location_type& l) + { + return symbol_type (token::CALL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_TRUE (location_type l) + { + return symbol_type (token::TRUE, std::move (l)); + } +#else + static + symbol_type + make_TRUE (const location_type& l) + { + return symbol_type (token::TRUE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FALSE (location_type l) + { + return symbol_type (token::FALSE, std::move (l)); + } +#else + static + symbol_type + make_FALSE (const location_type& l) + { + return symbol_type (token::FALSE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_UNDEFINED (location_type l) + { + return symbol_type (token::UNDEFINED, std::move (l)); + } +#else + static + symbol_type + make_UNDEFINED (const location_type& l) + { + return symbol_type (token::UNDEFINED, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SIZE (location_type l) + { + return symbol_type (token::SIZE, std::move (l)); + } +#else + static + symbol_type + make_SIZE (const location_type& l) + { + return symbol_type (token::SIZE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GAME (location_type l) + { + return symbol_type (token::GAME, std::move (l)); + } +#else + static + symbol_type + make_GAME (const location_type& l) + { + return symbol_type (token::GAME, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SELF (location_type l) + { + return symbol_type (token::SELF, std::move (l)); + } +#else + static + symbol_type + make_SELF (const location_type& l) + { + return symbol_type (token::SELF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIM (location_type l) + { + return symbol_type (token::ANIM, std::move (l)); + } +#else + static + symbol_type + make_ANIM (const location_type& l) + { + return symbol_type (token::ANIM, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LEVEL (location_type l) + { + return symbol_type (token::LEVEL, std::move (l)); + } +#else + static + symbol_type + make_LEVEL (const location_type& l) + { + return symbol_type (token::LEVEL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LPAREN (location_type l) + { + return symbol_type (token::LPAREN, std::move (l)); + } +#else + static + symbol_type + make_LPAREN (const location_type& l) + { + return symbol_type (token::LPAREN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RPAREN (location_type l) + { + return symbol_type (token::RPAREN, std::move (l)); + } +#else + static + symbol_type + make_RPAREN (const location_type& l) + { + return symbol_type (token::RPAREN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LBRACE (location_type l) + { + return symbol_type (token::LBRACE, std::move (l)); + } +#else + static + symbol_type + make_LBRACE (const location_type& l) + { + return symbol_type (token::LBRACE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RBRACE (location_type l) + { + return symbol_type (token::RBRACE, std::move (l)); + } +#else + static + symbol_type + make_RBRACE (const location_type& l) + { + return symbol_type (token::RBRACE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LBRACKET (location_type l) + { + return symbol_type (token::LBRACKET, std::move (l)); + } +#else + static + symbol_type + make_LBRACKET (const location_type& l) + { + return symbol_type (token::LBRACKET, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RBRACKET (location_type l) + { + return symbol_type (token::RBRACKET, std::move (l)); + } +#else + static + symbol_type + make_RBRACKET (const location_type& l) + { + return symbol_type (token::RBRACKET, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COMMA (location_type l) + { + return symbol_type (token::COMMA, std::move (l)); + } +#else + static + symbol_type + make_COMMA (const location_type& l) + { + return symbol_type (token::COMMA, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DOT (location_type l) + { + return symbol_type (token::DOT, std::move (l)); + } +#else + static + symbol_type + make_DOT (const location_type& l) + { + return symbol_type (token::DOT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DOUBLECOLON (location_type l) + { + return symbol_type (token::DOUBLECOLON, std::move (l)); + } +#else + static + symbol_type + make_DOUBLECOLON (const location_type& l) + { + return symbol_type (token::DOUBLECOLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COLON (location_type l) + { + return symbol_type (token::COLON, std::move (l)); + } +#else + static + symbol_type + make_COLON (const location_type& l) + { + return symbol_type (token::COLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SEMICOLON (location_type l) + { + return symbol_type (token::SEMICOLON, std::move (l)); + } +#else + static + symbol_type + make_SEMICOLON (const location_type& l) + { + return symbol_type (token::SEMICOLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INCREMENT (location_type l) + { + return symbol_type (token::INCREMENT, std::move (l)); + } +#else + static + symbol_type + make_INCREMENT (const location_type& l) + { + return symbol_type (token::INCREMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DECREMENT (location_type l) + { + return symbol_type (token::DECREMENT, std::move (l)); + } +#else + static + symbol_type + make_DECREMENT (const location_type& l) + { + return symbol_type (token::DECREMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LSHIFT (location_type l) + { + return symbol_type (token::LSHIFT, std::move (l)); + } +#else + static + symbol_type + make_LSHIFT (const location_type& l) + { + return symbol_type (token::LSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RSHIFT (location_type l) + { + return symbol_type (token::RSHIFT, std::move (l)); + } +#else + static + symbol_type + make_RSHIFT (const location_type& l) + { + return symbol_type (token::RSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_OR (location_type l) + { + return symbol_type (token::OR, std::move (l)); + } +#else + static + symbol_type + make_OR (const location_type& l) + { + return symbol_type (token::OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_AND (location_type l) + { + return symbol_type (token::AND, std::move (l)); + } +#else + static + symbol_type + make_AND (const location_type& l) + { + return symbol_type (token::AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_EQUALITY (location_type l) + { + return symbol_type (token::EQUALITY, std::move (l)); + } +#else + static + symbol_type + make_EQUALITY (const location_type& l) + { + return symbol_type (token::EQUALITY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INEQUALITY (location_type l) + { + return symbol_type (token::INEQUALITY, std::move (l)); + } +#else + static + symbol_type + make_INEQUALITY (const location_type& l) + { + return symbol_type (token::INEQUALITY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LESS_EQUAL (location_type l) + { + return symbol_type (token::LESS_EQUAL, std::move (l)); + } +#else + static + symbol_type + make_LESS_EQUAL (const location_type& l) + { + return symbol_type (token::LESS_EQUAL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GREATER_EQUAL (location_type l) + { + return symbol_type (token::GREATER_EQUAL, std::move (l)); + } +#else + static + symbol_type + make_GREATER_EQUAL (const location_type& l) + { + return symbol_type (token::GREATER_EQUAL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LESS (location_type l) + { + return symbol_type (token::LESS, std::move (l)); + } +#else + static + symbol_type + make_LESS (const location_type& l) + { + return symbol_type (token::LESS, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GREATER (location_type l) + { + return symbol_type (token::GREATER, std::move (l)); + } +#else + static + symbol_type + make_GREATER (const location_type& l) + { + return symbol_type (token::GREATER, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NOT (location_type l) + { + return symbol_type (token::NOT, std::move (l)); + } +#else + static + symbol_type + make_NOT (const location_type& l) + { + return symbol_type (token::NOT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COMPLEMENT (location_type l) + { + return symbol_type (token::COMPLEMENT, std::move (l)); + } +#else + static + symbol_type + make_COMPLEMENT (const location_type& l) + { + return symbol_type (token::COMPLEMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN (location_type l) + { + return symbol_type (token::ASSIGN, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN (const location_type& l) + { + return symbol_type (token::ASSIGN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_ADD (location_type l) + { + return symbol_type (token::ASSIGN_ADD, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_ADD (const location_type& l) + { + return symbol_type (token::ASSIGN_ADD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_SUB (location_type l) + { + return symbol_type (token::ASSIGN_SUB, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_SUB (const location_type& l) + { + return symbol_type (token::ASSIGN_SUB, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_MULT (location_type l) + { + return symbol_type (token::ASSIGN_MULT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_MULT (const location_type& l) + { + return symbol_type (token::ASSIGN_MULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_DIV (location_type l) + { + return symbol_type (token::ASSIGN_DIV, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_DIV (const location_type& l) + { + return symbol_type (token::ASSIGN_DIV, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_MOD (location_type l) + { + return symbol_type (token::ASSIGN_MOD, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_MOD (const location_type& l) + { + return symbol_type (token::ASSIGN_MOD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_OR (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_OR, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_OR (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_AND (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_AND, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_AND (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BITWISE_EXOR (location_type l) + { + return symbol_type (token::ASSIGN_BITWISE_EXOR, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BITWISE_EXOR (const location_type& l) + { + return symbol_type (token::ASSIGN_BITWISE_EXOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_RSHIFT (location_type l) + { + return symbol_type (token::ASSIGN_RSHIFT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_RSHIFT (const location_type& l) + { + return symbol_type (token::ASSIGN_RSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_LSHIFT (location_type l) + { + return symbol_type (token::ASSIGN_LSHIFT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_LSHIFT (const location_type& l) + { + return symbol_type (token::ASSIGN_LSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_OR (location_type l) + { + return symbol_type (token::BITWISE_OR, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_OR (const location_type& l) + { + return symbol_type (token::BITWISE_OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_AND (location_type l) + { + return symbol_type (token::BITWISE_AND, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_AND (const location_type& l) + { + return symbol_type (token::BITWISE_AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_EXOR (location_type l) + { + return symbol_type (token::BITWISE_EXOR, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_EXOR (const location_type& l) + { + return symbol_type (token::BITWISE_EXOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ADD (location_type l) + { + return symbol_type (token::ADD, std::move (l)); + } +#else + static + symbol_type + make_ADD (const location_type& l) + { + return symbol_type (token::ADD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SUB (location_type l) + { + return symbol_type (token::SUB, std::move (l)); + } +#else + static + symbol_type + make_SUB (const location_type& l) + { + return symbol_type (token::SUB, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_MULT (location_type l) + { + return symbol_type (token::MULT, std::move (l)); + } +#else + static + symbol_type + make_MULT (const location_type& l) + { + return symbol_type (token::MULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DIV (location_type l) + { + return symbol_type (token::DIV, std::move (l)); + } +#else + static + symbol_type + make_DIV (const location_type& l) + { + return symbol_type (token::DIV, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_MOD (location_type l) + { + return symbol_type (token::MOD, std::move (l)); + } +#else + static + symbol_type + make_MOD (const location_type& l) + { + return symbol_type (token::MOD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FILE (std::string v, location_type l) + { + return symbol_type (token::FILE, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_FILE (const std::string& v, const location_type& l) + { + return symbol_type (token::FILE, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NAME (std::string v, location_type l) + { + return symbol_type (token::NAME, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_NAME (const std::string& v, const location_type& l) + { + return symbol_type (token::NAME, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_STRING (std::string v, location_type l) + { + return symbol_type (token::STRING, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_STRING (const std::string& v, const location_type& l) + { + return symbol_type (token::STRING, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ISTRING (std::string v, location_type l) + { + return symbol_type (token::ISTRING, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_ISTRING (const std::string& v, const location_type& l) + { + return symbol_type (token::ISTRING, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FLOAT (std::string v, location_type l) + { + return symbol_type (token::FLOAT, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_FLOAT (const std::string& v, const location_type& l) + { + return symbol_type (token::FLOAT, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INTEGER (std::string v, location_type l) + { + return symbol_type (token::INTEGER, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_INTEGER (const std::string& v, const location_type& l) + { + return symbol_type (token::INTEGER, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ADD_ARRAY (location_type l) + { + return symbol_type (token::ADD_ARRAY, std::move (l)); + } +#else + static + symbol_type + make_ADD_ARRAY (const location_type& l) + { + return symbol_type (token::ADD_ARRAY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THEN (location_type l) + { + return symbol_type (token::THEN, std::move (l)); + } +#else + static + symbol_type + make_THEN (const location_type& l) + { + return symbol_type (token::THEN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NEG (location_type l) + { + return symbol_type (token::NEG, std::move (l)); + } +#else + static + symbol_type + make_NEG (const location_type& l) + { + return symbol_type (token::NEG, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIMREF (location_type l) + { + return symbol_type (token::ANIMREF, std::move (l)); + } +#else + static + symbol_type + make_ANIMREF (const location_type& l) + { + return symbol_type (token::ANIMREF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_PREINC (location_type l) + { + return symbol_type (token::PREINC, std::move (l)); + } +#else + static + symbol_type + make_PREINC (const location_type& l) + { + return symbol_type (token::PREINC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_PREDEC (location_type l) + { + return symbol_type (token::PREDEC, std::move (l)); + } +#else + static + symbol_type + make_PREDEC (const location_type& l) + { + return symbol_type (token::PREDEC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_POSTINC (location_type l) + { + return symbol_type (token::POSTINC, std::move (l)); + } +#else + static + symbol_type + make_POSTINC (const location_type& l) + { + return symbol_type (token::POSTINC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_POSTDEC (location_type l) + { + return symbol_type (token::POSTDEC, std::move (l)); + } +#else + static + symbol_type + make_POSTDEC (const location_type& l) + { + return symbol_type (token::POSTDEC, l); + } +#endif + + + class context + { + public: + context (const parser& yyparser, const symbol_type& yyla); + const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; } + symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); } + const location_type& location () const YY_NOEXCEPT { return yyla_.location; } + + /// Put in YYARG at most YYARGN of the expected tokens, and return the + /// number of tokens stored in YYARG. If YYARG is null, return the + /// number of expected tokens (guaranteed to be less than YYNTOKENS). + int expected_tokens (symbol_kind_type yyarg[], int yyargn) const; + + private: + const parser& yyparser_; + const symbol_type& yyla_; + }; + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + parser (const parser&); + /// Non copyable. + parser& operator= (const parser&); +#endif + + /// Check the lookahead yytoken. + /// \returns true iff the token will be eventually shifted. + bool yy_lac_check_ (symbol_kind_type yytoken) const; + /// Establish the initial context if no initial context currently exists. + /// \returns true iff the token will be eventually shifted. + bool yy_lac_establish_ (symbol_kind_type yytoken); + /// Discard any previous initial lookahead context because of event. + /// \param event the event which caused the lookahead to be discarded. + /// Only used for debbuging output. + void yy_lac_discard_ (const char* event); + + /// Stored state numbers (used for stacks). + typedef short state_type; + + /// The arguments of the error message. + int yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const; + + /// Generate an error message. + /// \param yyctx the context in which the error occurred. + virtual std::string yysyntax_error_ (const context& yyctx) const; + /// Compute post-reduction state. + /// \param yystate the current state + /// \param yysym the nonterminal to push on the stack + static state_type yy_lr_goto_state_ (state_type yystate, int yysym); + + /// Whether the given \c yypact_ value indicates a defaulted state. + /// \param yyvalue the value to check + static bool yy_pact_value_is_default_ (int yyvalue); + + /// Whether the given \c yytable_ value indicates a syntax error. + /// \param yyvalue the value to check + static bool yy_table_value_is_error_ (int yyvalue); + + static const short yypact_ninf_; + static const short yytable_ninf_; + + /// Convert a scanner token kind \a t to a symbol kind. + /// In theory \a t should be a token_kind_type, but character literals + /// are valid, yet not members of the token_type enum. + static symbol_kind_type yytranslate_ (int t); + + + + // Tables. + // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + // STATE-NUM. + static const short yypact_[]; + + // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + // Performed when YYTABLE does not specify something else to do. Zero + // means the default is an error. + static const unsigned char yydefact_[]; + + // YYPGOTO[NTERM-NUM]. + static const short yypgoto_[]; + + // YYDEFGOTO[NTERM-NUM]. + static const short yydefgoto_[]; + + // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + // positive, shift that token. If negative, reduce the rule whose + // number is the opposite. If YYTABLE_NINF, syntax error. + static const short yytable_[]; + + static const short yycheck_[]; + + // YYSTOS[STATE-NUM] -- The (internal number of the) accessing + // symbol of state STATE-NUM. + static const unsigned char yystos_[]; + + // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + static const unsigned char yyr1_[]; + + // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + static const signed char yyr2_[]; + + +#if S2DEBUG + // YYRLINE[YYN] -- Source line where rule number YYN was defined. + static const short yyrline_[]; + /// Report on the debug stream that the rule \a r is going to be reduced. + virtual void yy_reduce_print_ (int r) const; + /// Print the state stack on the debug stream. + virtual void yy_stack_print_ () const; + + /// Debugging level. + int yydebug_; + /// Debug stream. + std::ostream* yycdebug_; + + /// \brief Display a symbol kind, value and location. + /// \param yyo The output stream. + /// \param yysym The symbol. + template + void yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const; +#endif + + /// \brief Reclaim the memory associated to a symbol. + /// \param yymsg Why this token is reclaimed. + /// If null, print nothing. + /// \param yysym The symbol. + template + void yy_destroy_ (const char* yymsg, basic_symbol& yysym) const; + + private: + /// Type access provider for state based symbols. + struct by_state + { + /// Default constructor. + by_state () YY_NOEXCEPT; + + /// The symbol kind as needed by the constructor. + typedef state_type kind_type; + + /// Constructor. + by_state (kind_type s) YY_NOEXCEPT; + + /// Copy constructor. + by_state (const by_state& that) YY_NOEXCEPT; + + /// Record that this symbol is empty. + void clear () YY_NOEXCEPT; + + /// Steal the symbol kind from \a that. + void move (by_state& that); + + /// The symbol kind (corresponding to \a state). + /// \a symbol_kind::S_YYEMPTY when empty. + symbol_kind_type kind () const YY_NOEXCEPT; + + /// The state number used to denote an empty symbol. + /// We use the initial state, as it does not have a value. + enum { empty_state = 0 }; + + /// The state. + /// \a empty when empty. + state_type state; + }; + + /// "Internal" symbol: element of the stack. + struct stack_symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + /// Construct an empty symbol. + stack_symbol_type (); + /// Move or copy construction. + stack_symbol_type (YY_RVREF (stack_symbol_type) that); + /// Steal the contents from \a sym to build this. + stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym); +#if YY_CPLUSPLUS < 201103L + /// Assignment, needed by push_back by some old implementations. + /// Moves the contents of that. + stack_symbol_type& operator= (stack_symbol_type& that); + + /// Assignment, needed by push_back by other implementations. + /// Needed by some other old implementations. + stack_symbol_type& operator= (const stack_symbol_type& that); +#endif + }; + + /// A stack with random access from its top. + template > + class stack + { + public: + // Hide our reversed order. + typedef typename S::iterator iterator; + typedef typename S::const_iterator const_iterator; + typedef typename S::size_type size_type; + typedef typename std::ptrdiff_t index_type; + + stack (size_type n = 200) + : seq_ (n) + {} + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + stack (const stack&) = delete; + /// Non copyable. + stack& operator= (const stack&) = delete; +#endif + + /// Random access. + /// + /// Index 0 returns the topmost element. + const T& + operator[] (index_type i) const + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Random access. + /// + /// Index 0 returns the topmost element. + T& + operator[] (index_type i) + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Steal the contents of \a t. + /// + /// Close to move-semantics. + void + push (YY_MOVE_REF (T) t) + { + seq_.push_back (T ()); + operator[] (0).move (t); + } + + /// Pop elements from the stack. + void + pop (std::ptrdiff_t n = 1) YY_NOEXCEPT + { + for (; 0 < n; --n) + seq_.pop_back (); + } + + /// Pop all elements from the stack. + void + clear () YY_NOEXCEPT + { + seq_.clear (); + } + + /// Number of elements on the stack. + index_type + size () const YY_NOEXCEPT + { + return index_type (seq_.size ()); + } + + /// Iterator on top of the stack (going downwards). + const_iterator + begin () const YY_NOEXCEPT + { + return seq_.begin (); + } + + /// Bottom of the stack. + const_iterator + end () const YY_NOEXCEPT + { + return seq_.end (); + } + + /// Present a slice of the top of a stack. + class slice + { + public: + slice (const stack& stack, index_type range) + : stack_ (stack) + , range_ (range) + {} + + const T& + operator[] (index_type i) const + { + return stack_[range_ - i]; + } + + private: + const stack& stack_; + index_type range_; + }; + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + stack (const stack&); + /// Non copyable. + stack& operator= (const stack&); +#endif + /// The wrapped container. + S seq_; + }; + + + /// Stack type. + typedef stack stack_type; + + /// The stack. + stack_type yystack_; + /// The stack for LAC. + /// Logically, the yy_lac_stack's lifetime is confined to the function + /// yy_lac_check_. We just store it as a member of this class to hold + /// on to the memory and to avoid frequent reallocations. + /// Since yy_lac_check_ is const, this member must be mutable. + mutable std::vector yylac_stack_; + /// Whether an initial LAC context was established. + bool yy_lac_established_; + + + /// Push a new state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param sym the symbol + /// \warning the contents of \a s.value is stolen. + void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym); + + /// Push a new look ahead token on the state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param s the state + /// \param sym the symbol (for its value and location). + /// \warning the contents of \a sym.value is stolen. + void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); + + /// Pop \a n symbols from the stack. + void yypop_ (int n = 1); + + /// Constants. + enum + { + yylast_ = 1581, ///< Last index in yytable_. + yynnts_ = 73, ///< Number of nonterminal symbols. + yyfinal_ = 15 ///< Termination state number. + }; + + + // User arguments. + yyscan_t yyscanner; + xsk::gsc::location& loc; + xsk::gsc::program_ptr& ast; + + }; + + inline + parser::symbol_kind_type + parser::yytranslate_ (int t) + { + return static_cast (t); + } + + // basic_symbol. + template + parser::basic_symbol::basic_symbol (const basic_symbol& that) + : Base (that) + , value () + , location (that.location) + { + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.copy< anim_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animation: // animation + value.copy< animation_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.copy< animtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_constant: // constant + value.copy< constant_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_define: // define + value.copy< define_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.copy< empty_array_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.copy< expr_arguments_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.copy< expr_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.copy< expr_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.copy< expr_call_type_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.copy< expr_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_false: // false + value.copy< false_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_file: // file + value.copy< file_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.copy< float_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_game: // game + value.copy< game_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.copy< include_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.copy< integer_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_istring: // istring + value.copy< istring_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_level: // level + value.copy< level_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_name: // name + value.copy< name_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.copy< node_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.copy< parameters_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.copy< program_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_self: // self + value.copy< self_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.copy< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.copy< stmt_assign_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.copy< stmt_break_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.copy< stmt_call_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.copy< stmt_case_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.copy< stmt_continue_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.copy< stmt_default_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.copy< stmt_endon_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.copy< stmt_for_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.copy< stmt_foreach_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.copy< stmt_if_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.copy< stmt_ifelse_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.copy< stmt_list_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.copy< stmt_notify_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.copy< stmt_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.copy< stmt_return_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.copy< stmt_switch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.copy< stmt_wait_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.copy< stmt_waitframe_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.copy< stmt_waittill_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.copy< stmt_waittillframeend_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.copy< stmt_waittillmatch_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.copy< stmt_while_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_string: // string + value.copy< string_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.copy< thisthread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_thread: // thread + value.copy< thread_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_true: // true + value.copy< true_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.copy< undefined_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.copy< usingtree_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_vector: // vector + value.copy< vector_ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + + } + + + + template + parser::symbol_kind_type + parser::basic_symbol::type_get () const YY_NOEXCEPT + { + return this->kind (); + } + + template + bool + parser::basic_symbol::empty () const YY_NOEXCEPT + { + return this->kind () == symbol_kind::S_YYEMPTY; + } + + template + void + parser::basic_symbol::move (basic_symbol& s) + { + super_type::move (s); + switch (this->kind ()) + { + case symbol_kind::S_anim: // anim + value.move< anim_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_animation: // animation + value.move< animation_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_animtree: // animtree + value.move< animtree_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_constant: // constant + value.move< constant_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_define: // define + value.move< define_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_empty_array: // empty_array + value.move< empty_array_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_filled: // expr_arguments_filled + case symbol_kind::S_expr_arguments_empty: // expr_arguments_empty + value.move< expr_arguments_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_assign: // expr_assign + value.move< expr_assign_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + case symbol_kind::S_expr_call_thread: // expr_call_thread + case symbol_kind::S_expr_call_childthread: // expr_call_childthread + value.move< expr_call_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_call_function: // expr_call_function + case symbol_kind::S_expr_call_pointer: // expr_call_pointer + value.move< expr_call_type_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_for_expr: // for_expr + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_compare: // expr_compare + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + value.move< expr_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_false: // false + value.move< false_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_file: // file + value.move< file_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_neg_float: // neg_float + case symbol_kind::S_float: // float + value.move< float_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_game: // game + value.move< game_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_include: // include + value.move< include_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_neg_integer: // neg_integer + case symbol_kind::S_integer: // integer + value.move< integer_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_istring: // istring + value.move< istring_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_level: // level + value.move< level_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_name: // name + value.move< name_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_add_array: // expr_add_array + case symbol_kind::S_expr_array: // expr_array + case symbol_kind::S_expr_field: // expr_field + case symbol_kind::S_expr_size: // expr_size + case symbol_kind::S_object: // object + value.move< node_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_parameters: // parameters + value.move< parameters_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_program: // program + value.move< program_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_self: // self + value.move< self_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_FILE: // "file path" + case symbol_kind::S_NAME: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "int" + value.move< std::string > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_assign_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_call: // stmt_call + value.move< stmt_call_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_block: // stmt_block + case symbol_kind::S_stmt_list: // stmt_list + value.move< stmt_list_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_for_stmt: // for_stmt + value.move< stmt_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waitframe: // stmt_waitframe + value.move< stmt_waitframe_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_string: // string + value.move< string_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_thisthread: // thisthread + value.move< thisthread_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_thread: // thread + value.move< thread_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_true: // true + value.move< true_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_undefined: // undefined + value.move< undefined_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_usingtree: // usingtree + value.move< usingtree_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_vector: // vector + value.move< vector_ptr > (YY_MOVE (s.value)); + break; + + default: + break; + } + + location = YY_MOVE (s.location); + } + + // by_kind. + inline + parser::by_kind::by_kind () + : kind_ (symbol_kind::S_YYEMPTY) + {} + +#if 201103L <= YY_CPLUSPLUS + inline + parser::by_kind::by_kind (by_kind&& that) + : kind_ (that.kind_) + { + that.clear (); + } +#endif + + inline + parser::by_kind::by_kind (const by_kind& that) + : kind_ (that.kind_) + {} + + inline + parser::by_kind::by_kind (token_kind_type t) + : kind_ (yytranslate_ (t)) + {} + + inline + void + parser::by_kind::clear () YY_NOEXCEPT + { + kind_ = symbol_kind::S_YYEMPTY; + } + + inline + void + parser::by_kind::move (by_kind& that) + { + kind_ = that.kind_; + that.clear (); + } + + inline + parser::symbol_kind_type + parser::by_kind::kind () const YY_NOEXCEPT + { + return kind_; + } + + inline + parser::symbol_kind_type + parser::by_kind::type_get () const YY_NOEXCEPT + { + return this->kind (); + } + +#line 13 "parser.ypp" +} } } // xsk::gsc::s2 +#line 4764 "parser.hpp" + + + + +#endif // !YY_S2_PARSER_HPP_INCLUDED diff --git a/src/s2/xsk/resolver.cpp b/src/s2/xsk/resolver.cpp new file mode 100644 index 00000000..e0b71d65 --- /dev/null +++ b/src/s2/xsk/resolver.cpp @@ -0,0 +1,3086 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "s2.hpp" + +namespace xsk::gsc::s2 +{ + +std::unordered_map opcode_map; +std::unordered_map function_map; +std::unordered_map method_map; +std::unordered_map file_map; +std::unordered_map token_map; +std::unordered_map opcode_map_rev; +std::unordered_map function_map_rev; +std::unordered_map method_map_rev; +std::unordered_map file_map_rev; +std::unordered_map token_map_rev; + +auto resolver::opcode_id(const std::string& name) -> std::uint8_t +{ + const auto itr = opcode_map_rev.find(name); + + if (itr != opcode_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve opcode id for name '%s'!", name.data())); +} + +auto resolver::opcode_name(std::uint8_t id) -> std::string +{ + const auto itr = opcode_map.find(id); + + if (itr != opcode_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve opcode name for id '0x%hhX'!", id)); +} + +auto resolver::function_id(const std::string& name) -> std::uint16_t +{ + const auto itr = function_map_rev.find(name); + + if (itr != function_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin function id for name '%s'!", name.data())); +} + +auto resolver::function_name(std::uint16_t id) -> std::string +{ + const auto itr = function_map.find(id); + + if (itr != function_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin function name for id '%i'!", id)); +} + +auto resolver::method_id(const std::string& name) -> std::uint16_t +{ + const auto itr = method_map_rev.find(name); + + if (itr != method_map_rev.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin method id for name '%s'!", name.data())); +} + +auto resolver::method_name(std::uint16_t id) -> std::string +{ + const auto itr = method_map.find(id); + + if (itr != method_map.end()) + { + return itr->second; + } + + throw gsc::error(utils::string::va("Couldn't resolve builtin method name for id '%i'!", id)); +} + +auto resolver::file_id(const std::string& name) -> std::uint16_t +{ + const auto itr = file_map_rev.find(name); + + if (itr != file_map_rev.end()) + { + return itr->second; + } + + return 0; +} + +auto resolver::file_name(std::uint16_t id) -> std::string +{ + const auto itr = file_map.find(id); + + if (itr != file_map.end()) + { + return itr->second; + } + + return utils::string::va("_ID%i", id); +} + +auto resolver::token_id(const std::string& name) -> std::uint16_t +{ + const auto itr = token_map_rev.find(name); + + if (itr != token_map_rev.end()) + { + return itr->second; + } + + return 0; +} + +auto resolver::token_name(std::uint16_t id) -> std::string +{ + const auto itr = token_map.find(id); + + if (itr != token_map.end()) + { + return itr->second; + } + + return utils::string::va("_ID%i", id); +} + +auto resolver::find_function(const std::string& name) -> bool +{ + const auto itr = function_map_rev.find(name); + + if (itr != function_map_rev.end()) + { + return true; + } + + return false; +} + +auto resolver::find_method(const std::string& name) -> bool +{ + const auto itr = method_map_rev.find(name); + + if (itr != method_map_rev.end()) + { + return true; + } + + return false; +} + +const std::array opcode_list +{{ + { std::uint8_t(opcode::OP_End),"END" }, + { std::uint8_t(opcode::OP_Return),"RETN" }, + { std::uint8_t(opcode::OP_GetByte),"GET_BYTE" }, + { std::uint8_t(opcode::OP_GetNegByte),"GET_NBYTE" }, + { std::uint8_t(opcode::OP_GetUnsignedShort),"GET_USHORT" }, + { std::uint8_t(opcode::OP_GetNegUnsignedShort),"GET_NUSHORT" }, + { std::uint8_t(opcode::OP_GetInteger),"GET_INT" }, + { std::uint8_t(opcode::OP_GetBuiltinFunction),"GET_BUILTIN_FUNC" }, + { std::uint8_t(opcode::OP_GetBuiltinMethod),"GET_BUILTIN_METHOD" }, + { std::uint8_t(opcode::OP_GetFloat),"GET_FLOAT" }, + { std::uint8_t(opcode::OP_GetString),"GET_STRING" }, + { std::uint8_t(opcode::OP_GetUndefined),"GET_UNDEFINED" }, + { std::uint8_t(opcode::OP_GetZero),"GET_ZERO" }, + { std::uint8_t(opcode::OP_waittillFrameEnd),"WAITTILLFRAMEEND" }, + { std::uint8_t(opcode::OP_CreateLocalVariable),"CREATE_LOCAL_VARIABLE" }, + { std::uint8_t(opcode::OP_RemoveLocalVariables),"REMOVE_LOCAL_VARIABLES" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached0),"EVAL_LOCAL_VARIABLE_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached1),"EVAL_LOCAL_VARIABLE_CACHED1" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached2),"EVAL_LOCAL_VARIABLE_CACHED2" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached3),"EVAL_LOCAL_VARIABLE_CACHED3" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached4),"EVAL_LOCAL_VARIABLE_CACHED4" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached5),"EVAL_LOCAL_VARIABLE_CACHED5" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached),"EVAL_LOCAL_VARIABLE_CACHED" }, + { std::uint8_t(opcode::OP_EvalLocalArrayCached),"EVAL_LOCAL_ARRAY_CACHED" }, + { std::uint8_t(opcode::OP_EvalArray),"EVAL_ARRAY" }, + { std::uint8_t(opcode::OP_EvalNewLocalArrayRefCached0),"EVAL_NEW_LOCAL_ARRAY_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalArrayRefCached0),"EVAL_LOCAL_ARRAY_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalArrayRefCached),"EVAL_LOCAL_ARRAY_REF_CACHED" }, + { std::uint8_t(opcode::OP_EvalArrayRef),"EVAL_ARRAY_REF" }, + { std::uint8_t(opcode::OP_ClearArray),"CLEAR_ARRAY" }, + { std::uint8_t(opcode::OP_EmptyArray),"EMPTY_ARRAY" }, + { std::uint8_t(opcode::OP_AddArray),"ADD_ARRAY" }, + { std::uint8_t(opcode::OP_PreScriptCall),"PRE_CALL" }, + { std::uint8_t(opcode::OP_ScriptLocalFunctionCall2),"CALL_LOCAL_FUNC2" }, + { std::uint8_t(opcode::OP_ScriptLocalFunctionCall),"CALL_LOCAL_FUNC" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodCall),"CALL_LOCAL_METHOD" }, + { std::uint8_t(opcode::OP_ScriptLocalThreadCall),"CALL_LOCAL_FUNC_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalChildThreadCall),"CALL_LOCAL_FUNC_CHILD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodThreadCall),"CALL_LOCAL_METHOD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptLocalMethodChildThreadCall),"CALL_LOCAL_METHOD_CHILD_THREAD" }, + { std::uint8_t(opcode::OP_ScriptFarFunctionCall2),"CALL_FAR_FUNC2" }, + { std::uint8_t(opcode::OP_ScriptFarFunctionCall),"CALL_FAR_FUNC" }, + { std::uint8_t(opcode::OP_ScriptFarMethodCall),"CALL_FAR_METHOD" }, + { std::uint8_t(opcode::OP_ScriptFarThreadCall),"CALL_FAR_FUNC_THREAD" }, + { std::uint8_t(opcode::OP_ScriptFarChildThreadCall),"CALL_FAR_FUNC_CHILD_THREAD"}, + { std::uint8_t(opcode::OP_ScriptFarMethodThreadCall),"CALL_FAR_METHOD_THEAD" }, + { std::uint8_t(opcode::OP_ScriptFarMethodChildThreadCall),"CALL_FAR_METHOD_CHILD_THEAD" }, + { std::uint8_t(opcode::OP_ScriptFunctionCallPointer),"CALL_FUNC_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodCallPointer),"CALL_METHOD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptThreadCallPointer),"CALL_FUNC_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptChildThreadCallPointer),"CALL_FUNC_CHILD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodThreadCallPointer),"CALL_METHOD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodChildThreadCallPointer),"CALL_METHOD_CHILD_THREAD_POINTER" }, + { std::uint8_t(opcode::OP_CallBuiltinPointer),"CALL_BUILTIN_FUNC_POINTER" }, + { std::uint8_t(opcode::OP_CallBuiltinMethodPointer),"CALL_BUILTIN_METHOD_POINTER" }, + { std::uint8_t(opcode::OP_GetIString),"GET_ISTRING" }, + { std::uint8_t(opcode::OP_GetVector),"GET_VECTOR" }, + { std::uint8_t(opcode::OP_GetLevelObject),"GET_LEVEL_OBJ" }, + { std::uint8_t(opcode::OP_GetAnimObject),"GET_ANIM_OBJ" }, + { std::uint8_t(opcode::OP_GetSelf),"GET_SELF" }, + { std::uint8_t(opcode::OP_GetThisthread),"GET_THISTHREAD" }, + { std::uint8_t(opcode::OP_GetLevel),"GET_LEVEL" }, + { std::uint8_t(opcode::OP_GetGame),"GET_GAME" }, + { std::uint8_t(opcode::OP_GetAnim),"GET_ANIM" }, + { std::uint8_t(opcode::OP_GetAnimation),"GET_ANIMATION" }, + { std::uint8_t(opcode::OP_GetGameRef),"GET_GAME_REF" }, + { std::uint8_t(opcode::OP_inc),"INC" }, + { std::uint8_t(opcode::OP_dec),"DEC" }, + { std::uint8_t(opcode::OP_bit_or),"BIT_OR" }, + { std::uint8_t(opcode::OP_JumpOnFalseExpr),"JMP_EXPR_FALSE" }, + { std::uint8_t(opcode::OP_bit_ex_or),"BIT_EXOR" }, + { std::uint8_t(opcode::OP_bit_and),"BIT_AND" }, + { std::uint8_t(opcode::OP_equality),"EQUALITY" }, + { std::uint8_t(opcode::OP_inequality),"INEQUALITY" }, + { std::uint8_t(opcode::OP_less),"LESS" }, + { std::uint8_t(opcode::OP_greater),"GREATER" }, + { std::uint8_t(opcode::OP_JumpOnTrueExpr),"JMP_EXPR_TRUE" }, + { std::uint8_t(opcode::OP_less_equal),"LESSEQUAL" }, + { std::uint8_t(opcode::OP_jumpback),"JMP_BACK" }, + { std::uint8_t(opcode::OP_waittillmatch2),"WAITTILLMATCH2" }, + { std::uint8_t(opcode::OP_waittill),"WAITTILL" }, + { std::uint8_t(opcode::OP_notify),"NOTIFY" }, + { std::uint8_t(opcode::OP_endon),"ENDON" }, + { std::uint8_t(opcode::OP_voidCodepos),"VOIDCODEPOS" }, + { std::uint8_t(opcode::OP_switch),"SWITCH" }, + { std::uint8_t(opcode::OP_endswitch),"ENDSWITCH" }, + { std::uint8_t(opcode::OP_vector),"VECTOR" }, + { std::uint8_t(opcode::OP_JumpOnFalse),"JMP_FALSE" }, + { std::uint8_t(opcode::OP_greater_equal),"GREATEREQUAL" }, + { std::uint8_t(opcode::OP_shift_left),"SHIFT_LEFT" }, + { std::uint8_t(opcode::OP_shift_right),"SHIFT_RIGHT" }, + { std::uint8_t(opcode::OP_plus),"PLUS" }, + { std::uint8_t(opcode::OP_jump),"JMP" }, + { std::uint8_t(opcode::OP_minus),"MINUS" }, + { std::uint8_t(opcode::OP_multiply),"MULT" }, + { std::uint8_t(opcode::OP_divide),"DIV" }, + { std::uint8_t(opcode::OP_mod),"MOD" }, + { std::uint8_t(opcode::OP_JumpOnTrue),"JMP_TRUE" }, + { std::uint8_t(opcode::OP_size),"SIZE" }, + { std::uint8_t(opcode::OP_waittillmatch),"WAITTILLMATCH" }, + { std::uint8_t(opcode::OP_GetLocalFunction),"GET_LOCAL_FUNC" }, + { std::uint8_t(opcode::OP_GetFarFunction),"GET_FAR_FUNC" }, + { std::uint8_t(opcode::OP_GetSelfObject),"GET_SELF_OBJ" }, + { std::uint8_t(opcode::OP_EvalLevelFieldVariable),"EVAL_LEVEL_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalAnimFieldVariable),"EVAL_ANIM_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalSelfFieldVariable),"EVAL_SELF_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalFieldVariable),"EVAL_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalLevelFieldVariableRef),"EVAL_LEVEL_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalAnimFieldVariableRef),"EVAL_ANIM_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalSelfFieldVariableRef),"EVAL_SELF_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_EvalFieldVariableRef),"EVAL_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_ClearFieldVariable),"CLEAR_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_SafeCreateVariableFieldCached),"SAFE_CREATE_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_SafeSetVariableFieldCached0),"SAFE_SET_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SafeSetVariableFieldCached),"SAFE_SET_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_SafeSetWaittillVariableFieldCached),"SAFE_SET_WAITTILL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_GetAnimTree),"GET_ANIMTREE" }, + { std::uint8_t(opcode::OP_clearparams),"CLEAR_PARAMS" }, + { std::uint8_t(opcode::OP_checkclearparams),"CHECK_CLEAR_PARAMS" }, + { std::uint8_t(opcode::OP_EvalLocalVariableRefCached0),"EVAL_LOCAL_VARIABLE_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalNewLocalVariableRefCached0),"EVAL_NEW_LOCAL_VARIABLE_REF_CACHED0" }, + { std::uint8_t(opcode::OP_EvalLocalVariableRefCached),"EVAL_LOCAL_VARIABLE_REF_CACHED" }, + { std::uint8_t(opcode::OP_SetLevelFieldVariableField),"SET_LEVEL_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetVariableField),"SET_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_ClearVariableField),"CLEAR_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetAnimFieldVariableField),"SET_ANIM_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetSelfFieldVariableField),"SET_SELF_FIELD_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_SetLocalVariableFieldCached0),"SET_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SetNewLocalVariableFieldCached0),"SET_NEW_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_SetLocalVariableFieldCached),"SET_LOCAL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_ClearLocalVariableFieldCached),"CLEAR_LOCAL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_ClearLocalVariableFieldCached0),"CLEAR_LOCAL_VARIABLE_FIELD_CACHED0" }, + { std::uint8_t(opcode::OP_CallBuiltin0),"CALL_BUILTIN_FUNC_0" }, + { std::uint8_t(opcode::OP_CallBuiltin1),"CALL_BUILTIN_FUNC_1" }, + { std::uint8_t(opcode::OP_CallBuiltin2),"CALL_BUILTIN_FUNC_2" }, + { std::uint8_t(opcode::OP_CallBuiltin3),"CALL_BUILTIN_FUNC_3" }, + { std::uint8_t(opcode::OP_CallBuiltin4),"CALL_BUILTIN_FUNC_4" }, + { std::uint8_t(opcode::OP_CallBuiltin5),"CALL_BUILTIN_FUNC_5" }, + { std::uint8_t(opcode::OP_CallBuiltin),"CALL_BUILTIN_FUNC" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod0),"CALL_BUILTIN_METHOD_0" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod1),"CALL_BUILTIN_METHOD_1" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod2),"CALL_BUILTIN_METHOD_2" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod3),"CALL_BUILTIN_METHOD_3" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod4),"CALL_BUILTIN_METHOD_4" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod5),"CALL_BUILTIN_METHOD_5" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod),"CALL_BUILTIN_METHOD" }, + { std::uint8_t(opcode::OP_wait),"WAIT" }, + { std::uint8_t(opcode::OP_DecTop),"DEC_TOP" }, + { std::uint8_t(opcode::OP_CastFieldObject),"CAST_FIELD_OBJ" }, + { std::uint8_t(opcode::OP_EvalLocalVariableObjectCached),"EVAL_LOCAL_VARIABLE_OBJECT_CACHED" }, + { std::uint8_t(opcode::OP_CastBool),"CAST_BOOL" }, + { std::uint8_t(opcode::OP_BoolNot),"BOOL_NOT" }, + { std::uint8_t(opcode::OP_BoolComplement),"BOOL_COMPLEMENT" }, + { std::uint8_t(opcode::OP_waitFrame), "WAITFRAME" }, + { std::uint8_t(opcode::OP_BoolNotAfterAnd), "BOOL_NOT_AFTER_AND" }, +}}; + +const std::array function_list +{{ + { 0x001, "_func_001" }, + { 0x002, "_func_002" }, + { 0x003, "_func_003" }, + { 0x004, "_func_004" }, + { 0x005, "_func_005" }, + { 0x006, "_func_006" }, + { 0x007, "_func_007" }, + { 0x008, "_func_008" }, + { 0x009, "_func_009" }, + { 0x00A, "_func_00A" }, + { 0x00B, "_func_00B" }, + { 0x00C, "_func_00C" }, + { 0x00D, "_func_00D" }, + { 0x00E, "_func_00E" }, + { 0x00F, "_func_00F" }, + { 0x010, "_func_010" }, + { 0x011, "_func_011" }, + { 0x012, "_func_012" }, + { 0x013, "_func_013" }, + { 0x014, "_func_014" }, + { 0x015, "_func_015" }, + { 0x016, "_func_016" }, + { 0x017, "_func_017" }, + { 0x018, "_func_018" }, + { 0x019, "_func_019" }, + { 0x01A, "_func_01A" }, + { 0x01B, "_func_01B" }, + { 0x01C, "_func_01C" }, + { 0x01D, "_func_01D" }, + { 0x01E, "_func_01E" }, + { 0x01F, "_func_01F" }, + { 0x020, "_func_020" }, + { 0x021, "_func_021" }, + { 0x022, "_func_022" }, + { 0x023, "_func_023" }, + { 0x024, "_func_024" }, + { 0x025, "_func_025" }, + { 0x026, "_func_026" }, + { 0x027, "_func_027" }, + { 0x028, "_func_028" }, + { 0x029, "_func_029" }, + { 0x02A, "_func_02A" }, + { 0x02B, "_func_02B" }, + { 0x02C, "_func_02C" }, + { 0x02D, "_func_02D" }, + { 0x02E, "isdefined" }, + { 0x02F, "_func_02F" }, + { 0x030, "_func_030" }, + { 0x031, "_func_031" }, + { 0x032, "_func_032" }, + { 0x033, "_func_033" }, + { 0x034, "_func_034" }, + { 0x035, "_func_035" }, + { 0x036, "_func_036" }, + { 0x037, "_func_037" }, + { 0x038, "_func_038" }, + { 0x039, "_func_039" }, + { 0x03A, "_func_03A" }, + { 0x03B, "_func_03B" }, + { 0x03C, "_func_03C" }, + { 0x03D, "_func_03D" }, + { 0x03E, "_func_03E" }, + { 0x03F, "_func_03F" }, + { 0x040, "_func_040" }, + { 0x041, "_func_041" }, + { 0x042, "_func_042" }, + { 0x043, "_func_043" }, + { 0x044, "_func_044" }, + { 0x045, "_func_045" }, + { 0x046, "_func_046" }, + { 0x047, "_func_047" }, + { 0x048, "_func_048" }, + { 0x049, "_func_049" }, + { 0x04A, "_func_04A" }, + { 0x04B, "_func_04B" }, + { 0x04C, "_func_04C" }, + { 0x04D, "_func_04D" }, + { 0x04E, "_func_04E" }, + { 0x04F, "_func_04F" }, + { 0x050, "_func_050" }, + { 0x051, "_func_051" }, + { 0x052, "_func_052" }, + { 0x053, "_func_053" }, + { 0x054, "_func_054" }, + { 0x055, "_func_055" }, + { 0x056, "_func_056" }, + { 0x057, "_func_057" }, + { 0x058, "_func_058" }, + { 0x059, "_func_059" }, + { 0x05A, "_func_05A" }, + { 0x05B, "_func_05B" }, + { 0x05C, "_func_05C" }, + { 0x05D, "_func_05D" }, + { 0x05E, "_func_05E" }, + { 0x05F, "_func_05F" }, + { 0x060, "_func_060" }, + { 0x061, "_func_061" }, + { 0x062, "_func_062" }, + { 0x063, "_func_063" }, + { 0x064, "_func_064" }, + { 0x065, "_func_065" }, + { 0x066, "_func_066" }, + { 0x067, "_func_067" }, + { 0x068, "_func_068" }, + { 0x069, "_func_069" }, + { 0x06A, "_func_06A" }, + { 0x06B, "_func_06B" }, + { 0x06C, "_func_06C" }, + { 0x06D, "_func_06D" }, + { 0x06E, "_func_06E" }, + { 0x06F, "_func_06F" }, + { 0x070, "_func_070" }, + { 0x071, "_func_071" }, + { 0x072, "_func_072" }, + { 0x073, "_func_073" }, + { 0x074, "_func_074" }, + { 0x075, "_func_075" }, + { 0x076, "_func_076" }, + { 0x077, "_func_077" }, + { 0x078, "_func_078" }, + { 0x079, "_func_079" }, + { 0x07A, "_func_07A" }, + { 0x07B, "_func_07B" }, + { 0x07C, "_func_07C" }, + { 0x07D, "_func_07D" }, + { 0x07E, "_func_07E" }, + { 0x07F, "_func_07F" }, + { 0x080, "_func_080" }, + { 0x081, "_func_081" }, + { 0x082, "_func_082" }, + { 0x083, "_func_083" }, + { 0x084, "_func_084" }, + { 0x085, "_func_085" }, + { 0x086, "_func_086" }, + { 0x087, "_func_087" }, + { 0x088, "_func_088" }, + { 0x089, "_func_089" }, + { 0x08A, "_func_08A" }, + { 0x08B, "_func_08B" }, + { 0x08C, "_func_08C" }, + { 0x08D, "_func_08D" }, + { 0x08E, "_func_08E" }, + { 0x08F, "_func_08F" }, + { 0x090, "_func_090" }, + { 0x091, "_func_091" }, + { 0x092, "_func_092" }, + { 0x093, "_func_093" }, + { 0x094, "_func_094" }, + { 0x095, "_func_095" }, + { 0x096, "_func_096" }, + { 0x097, "_func_097" }, + { 0x098, "_func_098" }, + { 0x099, "_func_099" }, + { 0x09A, "_func_09A" }, + { 0x09B, "_func_09B" }, + { 0x09C, "_func_09C" }, + { 0x09D, "_func_09D" }, + { 0x09E, "_func_09E" }, + { 0x09F, "_func_09F" }, + { 0x0A0, "_func_0A0" }, + { 0x0A1, "_func_0A1" }, + { 0x0A2, "_func_0A2" }, + { 0x0A3, "_func_0A3" }, + { 0x0A4, "_func_0A4" }, + { 0x0A5, "_func_0A5" }, + { 0x0A6, "_func_0A6" }, + { 0x0A7, "_func_0A7" }, + { 0x0A8, "_func_0A8" }, + { 0x0A9, "_func_0A9" }, + { 0x0AA, "_func_0AA" }, + { 0x0AB, "_func_0AB" }, + { 0x0AC, "_func_0AC" }, + { 0x0AD, "_func_0AD" }, + { 0x0AE, "_func_0AE" }, + { 0x0AF, "_func_0AF" }, + { 0x0B0, "_func_0B0" }, + { 0x0B1, "_func_0B1" }, + { 0x0B2, "_func_0B2" }, + { 0x0B3, "_func_0B3" }, + { 0x0B4, "_func_0B4" }, + { 0x0B5, "_func_0B5" }, + { 0x0B6, "_func_0B6" }, + { 0x0B7, "_func_0B7" }, + { 0x0B8, "_func_0B8" }, + { 0x0B9, "_func_0B9" }, + { 0x0BA, "_func_0BA" }, + { 0x0BB, "_func_0BB" }, + { 0x0BC, "_func_0BC" }, + { 0x0BD, "_func_0BD" }, + { 0x0BE, "_func_0BE" }, + { 0x0BF, "_func_0BF" }, + { 0x0C0, "_func_0C0" }, + { 0x0C1, "_func_0C1" }, + { 0x0C2, "_func_0C2" }, + { 0x0C3, "_func_0C3" }, + { 0x0C4, "_func_0C4" }, + { 0x0C5, "_func_0C5" }, + { 0x0C6, "_func_0C6" }, + { 0x0C7, "_func_0C7" }, + { 0x0C8, "_func_0C8" }, + { 0x0C9, "_func_0C9" }, + { 0x0CA, "_func_0CA" }, + { 0x0CB, "_func_0CB" }, + { 0x0CC, "_func_0CC" }, + { 0x0CD, "_func_0CD" }, + { 0x0CE, "_func_0CE" }, + { 0x0CF, "_func_0CF" }, + { 0x0D0, "_func_0D0" }, + { 0x0D1, "_func_0D1" }, + { 0x0D2, "_func_0D2" }, + { 0x0D3, "_func_0D3" }, + { 0x0D4, "_func_0D4" }, + { 0x0D5, "_func_0D5" }, + { 0x0D6, "_func_0D6" }, + { 0x0D7, "_func_0D7" }, + { 0x0D8, "_func_0D8" }, + { 0x0D9, "_func_0D9" }, + { 0x0DA, "_func_0DA" }, + { 0x0DB, "_func_0DB" }, + { 0x0DC, "_func_0DC" }, + { 0x0DD, "_func_0DD" }, + { 0x0DE, "_func_0DE" }, + { 0x0DF, "_func_0DF" }, + { 0x0E0, "_func_0E0" }, + { 0x0E1, "_func_0E1" }, + { 0x0E2, "_func_0E2" }, + { 0x0E3, "_func_0E3" }, + { 0x0E4, "_func_0E4" }, + { 0x0E5, "_func_0E5" }, + { 0x0E6, "_func_0E6" }, + { 0x0E7, "_func_0E7" }, + { 0x0E8, "_func_0E8" }, + { 0x0E9, "_func_0E9" }, + { 0x0EA, "_func_0EA" }, + { 0x0EB, "_func_0EB" }, + { 0x0EC, "_func_0EC" }, + { 0x0ED, "_func_0ED" }, + { 0x0EE, "_func_0EE" }, + { 0x0EF, "_func_0EF" }, + { 0x0F0, "_func_0F0" }, + { 0x0F1, "_func_0F1" }, + { 0x0F2, "_func_0F2" }, + { 0x0F3, "_func_0F3" }, + { 0x0F4, "_func_0F4" }, + { 0x0F5, "_func_0F5" }, + { 0x0F6, "_func_0F6" }, + { 0x0F7, "_func_0F7" }, + { 0x0F8, "_func_0F8" }, + { 0x0F9, "_func_0F9" }, + { 0x0FA, "_func_0FA" }, + { 0x0FB, "_func_0FB" }, + { 0x0FC, "_func_0FC" }, + { 0x0FD, "_func_0FD" }, + { 0x0FE, "_func_0FE" }, + { 0x0FF, "_func_0FF" }, + { 0x100, "_func_100" }, + { 0x101, "_func_101" }, + { 0x102, "_func_102" }, + { 0x103, "_func_103" }, + { 0x104, "_func_104" }, + { 0x105, "_func_105" }, + { 0x106, "_func_106" }, + { 0x107, "_func_107" }, + { 0x108, "_func_108" }, + { 0x109, "_func_109" }, + { 0x10A, "_func_10A" }, + { 0x10B, "_func_10B" }, + { 0x10C, "_func_10C" }, + { 0x10D, "_func_10D" }, + { 0x10E, "_func_10E" }, + { 0x10F, "_func_10F" }, + { 0x110, "_func_110" }, + { 0x111, "_func_111" }, + { 0x112, "_func_112" }, + { 0x113, "_func_113" }, + { 0x114, "_func_114" }, + { 0x115, "_func_115" }, + { 0x116, "_func_116" }, + { 0x117, "_func_117" }, + { 0x118, "_func_118" }, + { 0x119, "_func_119" }, + { 0x11A, "_func_11A" }, + { 0x11B, "_func_11B" }, + { 0x11C, "_func_11C" }, + { 0x11D, "_func_11D" }, + { 0x11E, "_func_11E" }, + { 0x11F, "_func_11F" }, + { 0x120, "_func_120" }, + { 0x121, "_func_121" }, + { 0x122, "_func_122" }, + { 0x123, "_func_123" }, + { 0x124, "_func_124" }, + { 0x125, "_func_125" }, + { 0x126, "_func_126" }, + { 0x127, "_func_127" }, + { 0x128, "_func_128" }, + { 0x129, "_func_129" }, + { 0x12A, "_func_12A" }, + { 0x12B, "_func_12B" }, + { 0x12C, "_func_12C" }, + { 0x12D, "_func_12D" }, + { 0x12E, "_func_12E" }, + { 0x12F, "_func_12F" }, + { 0x130, "_func_130" }, + { 0x131, "_func_131" }, + { 0x132, "_func_132" }, + { 0x133, "_func_133" }, + { 0x134, "_func_134" }, + { 0x135, "_func_135" }, + { 0x136, "_func_136" }, + { 0x137, "_func_137" }, + { 0x138, "_func_138" }, + { 0x139, "_func_139" }, + { 0x13A, "_func_13A" }, + { 0x13B, "_func_13B" }, + { 0x13C, "_func_13C" }, + { 0x13D, "_func_13D" }, + { 0x13E, "_func_13E" }, + { 0x13F, "_func_13F" }, + { 0x140, "_func_140" }, + { 0x141, "_func_141" }, + { 0x142, "_func_142" }, + { 0x143, "_func_143" }, + { 0x144, "_func_144" }, + { 0x145, "_func_145" }, + { 0x146, "_func_146" }, + { 0x147, "_func_147" }, + { 0x148, "_func_148" }, + { 0x149, "_func_149" }, + { 0x14A, "_func_14A" }, + { 0x14B, "_func_14B" }, + { 0x14C, "_func_14C" }, + { 0x14D, "_func_14D" }, + { 0x14E, "_func_14E" }, + { 0x14F, "_func_14F" }, + { 0x150, "_func_150" }, + { 0x151, "_func_151" }, + { 0x152, "_func_152" }, + { 0x153, "_func_153" }, + { 0x154, "_func_154" }, + { 0x155, "_func_155" }, + { 0x156, "_func_156" }, + { 0x157, "_func_157" }, + { 0x158, "_func_158" }, + { 0x159, "_func_159" }, + { 0x15A, "_func_15A" }, + { 0x15B, "_func_15B" }, + { 0x15C, "_func_15C" }, + { 0x15D, "_func_15D" }, + { 0x15E, "_func_15E" }, + { 0x15F, "_func_15F" }, + { 0x160, "_func_160" }, + { 0x161, "_func_161" }, + { 0x162, "_func_162" }, + { 0x163, "_func_163" }, + { 0x164, "_func_164" }, + { 0x165, "_func_165" }, + { 0x166, "_func_166" }, + { 0x167, "_func_167" }, + { 0x168, "_func_168" }, + { 0x169, "_func_169" }, + { 0x16A, "_func_16A" }, + { 0x16B, "_func_16B" }, + { 0x16C, "_func_16C" }, + { 0x16D, "_func_16D" }, + { 0x16E, "_func_16E" }, + { 0x16F, "_func_16F" }, + { 0x170, "_func_170" }, + { 0x171, "_func_171" }, + { 0x172, "_func_172" }, + { 0x173, "_func_173" }, + { 0x174, "_func_174" }, + { 0x175, "_func_175" }, + { 0x176, "_func_176" }, + { 0x177, "_func_177" }, + { 0x178, "_func_178" }, + { 0x179, "_func_179" }, + { 0x17A, "_func_17A" }, + { 0x17B, "_func_17B" }, + { 0x17C, "_func_17C" }, + { 0x17D, "_func_17D" }, + { 0x17E, "_func_17E" }, + { 0x17F, "_func_17F" }, + { 0x180, "_func_180" }, + { 0x181, "_func_181" }, + { 0x182, "_func_182" }, + { 0x183, "_func_183" }, + { 0x184, "_func_184" }, + { 0x185, "_func_185" }, + { 0x186, "_func_186" }, + { 0x187, "_func_187" }, + { 0x188, "_func_188" }, + { 0x189, "_func_189" }, + { 0x18A, "_func_18A" }, + { 0x18B, "_func_18B" }, + { 0x18C, "_func_18C" }, + { 0x18D, "_func_18D" }, + { 0x18E, "_func_18E" }, + { 0x18F, "_func_18F" }, + { 0x190, "_func_190" }, + { 0x191, "_func_191" }, + { 0x192, "_func_192" }, + { 0x193, "_func_193" }, + { 0x194, "_func_194" }, + { 0x195, "_func_195" }, + { 0x196, "_func_196" }, + { 0x197, "_func_197" }, + { 0x198, "_func_198" }, + { 0x199, "_func_199" }, + { 0x19A, "_func_19A" }, + { 0x19B, "_func_19B" }, + { 0x19C, "_func_19C" }, + { 0x19D, "_func_19D" }, + { 0x19E, "_func_19E" }, + { 0x19F, "_func_19F" }, + { 0x1A0, "_func_1A0" }, + { 0x1A1, "_func_1A1" }, + { 0x1A2, "_func_1A2" }, + { 0x1A3, "_func_1A3" }, + { 0x1A4, "_func_1A4" }, + { 0x1A5, "_func_1A5" }, + { 0x1A6, "_func_1A6" }, + { 0x1A7, "_func_1A7" }, + { 0x1A8, "_func_1A8" }, + { 0x1A9, "_func_1A9" }, + { 0x1AA, "_func_1AA" }, + { 0x1AB, "getnextarraykey" }, + { 0x1AC, "_func_1AC" }, + { 0x1AD, "_func_1AD" }, + { 0x1AE, "_func_1AE" }, + { 0x1AF, "_func_1AF" }, + { 0x1B0, "_func_1B0" }, + { 0x1B1, "_func_1B1" }, + { 0x1B2, "_func_1B2" }, + { 0x1B3, "_func_1B3" }, + { 0x1B4, "_func_1B4" }, + { 0x1B5, "_func_1B5" }, + { 0x1B6, "_func_1B6" }, + { 0x1B7, "_func_1B7" }, + { 0x1B8, "_func_1B8" }, + { 0x1B9, "_func_1B9" }, + { 0x1BA, "_func_1BA" }, + { 0x1BB, "_func_1BB" }, + { 0x1BC, "_func_1BC" }, + { 0x1BD, "_func_1BD" }, + { 0x1BE, "_func_1BE" }, + { 0x1BF, "_func_1BF" }, + { 0x1C0, "_func_1C0" }, + { 0x1C1, "_func_1C1" }, + { 0x1C2, "_func_1C2" }, + { 0x1C3, "_func_1C3" }, + { 0x1C4, "_func_1C4" }, + { 0x1C5, "_func_1C5" }, + { 0x1C6, "_func_1C6" }, + { 0x1C7, "getfirstarraykey" }, + { 0x1C8, "_func_1C8" }, + { 0x1C9, "_func_1C9" }, + { 0x1CA, "_func_1CA" }, + { 0x1CB, "_func_1CB" }, + { 0x1CC, "_func_1CC" }, + { 0x1CD, "_func_1CD" }, + { 0x1CE, "_func_1CE" }, + { 0x1CF, "_func_1CF" }, + { 0x1D0, "_func_1D0" }, + { 0x1D1, "_func_1D1" }, + { 0x1D2, "_func_1D2" }, + { 0x1D3, "_func_1D3" }, + { 0x1D4, "_func_1D4" }, + { 0x1D5, "_func_1D5" }, + { 0x1D6, "_func_1D6" }, + { 0x1D7, "_func_1D7" }, + { 0x1D8, "_func_1D8" }, + { 0x1D9, "_func_1D9" }, + { 0x1DA, "_func_1DA" }, + { 0x1DB, "_func_1DB" }, + { 0x1DC, "_func_1DC" }, + { 0x1DD, "_func_1DD" }, + { 0x1DE, "_func_1DE" }, + { 0x1DF, "_func_1DF" }, + { 0x1E0, "_func_1E0" }, + { 0x1E1, "_func_1E1" }, + { 0x1E2, "_func_1E2" }, + { 0x1E3, "_func_1E3" }, + { 0x1E4, "_func_1E4" }, + { 0x1E5, "_func_1E5" }, + { 0x1E6, "_func_1E6" }, + { 0x1E7, "_func_1E7" }, + { 0x1E8, "_func_1E8" }, + { 0x1E9, "_func_1E9" }, + { 0x1EA, "_func_1EA" }, + { 0x1EB, "_func_1EB" }, + { 0x1EC, "_func_1EC" }, + { 0x1ED, "_func_1ED" }, + { 0x1EE, "_func_1EE" }, + { 0x1EF, "_func_1EF" }, + { 0x1F0, "_func_1F0" }, + { 0x1F1, "_func_1F1" }, + { 0x1F2, "_func_1F2" }, + { 0x1F3, "_func_1F3" }, + { 0x1F4, "_func_1F4" }, + { 0x1F5, "_func_1F5" }, + { 0x1F6, "_func_1F6" }, + { 0x1F7, "_func_1F7" }, + { 0x1F8, "_func_1F8" }, + { 0x1F9, "_func_1F9" }, + { 0x1FA, "_func_1FA" }, + { 0x1FB, "_func_1FB" }, + { 0x1FC, "_func_1FC" }, + { 0x1FD, "_func_1FD" }, + { 0x1FE, "_func_1FE" }, + { 0x1FF, "_func_1FF" }, + { 0x200, "_func_200" }, + { 0x201, "_func_201" }, + { 0x202, "_func_202" }, + { 0x203, "_func_203" }, + { 0x204, "_func_204" }, + { 0x205, "_func_205" }, + { 0x206, "_func_206" }, + { 0x207, "_func_207" }, + { 0x208, "_func_208" }, + { 0x209, "_func_209" }, + { 0x20A, "_func_20A" }, + { 0x20B, "_func_20B" }, + { 0x20C, "_func_20C" }, + { 0x20D, "_func_20D" }, + { 0x20E, "_func_20E" }, + { 0x20F, "_func_20F" }, + { 0x210, "_func_210" }, + { 0x211, "_func_211" }, + { 0x212, "_func_212" }, + { 0x213, "_func_213" }, + { 0x214, "_func_214" }, + { 0x215, "_func_215" }, + { 0x216, "_func_216" }, + { 0x217, "_func_217" }, + { 0x218, "_func_218" }, + { 0x219, "_func_219" }, + { 0x21A, "_func_21A" }, + { 0x21B, "_func_21B" }, + { 0x21C, "_func_21C" }, + { 0x21D, "_func_21D" }, + { 0x21E, "_func_21E" }, + { 0x21F, "_func_21F" }, + { 0x220, "_func_220" }, + { 0x221, "_func_221" }, + { 0x222, "_func_222" }, + { 0x223, "_func_223" }, + { 0x224, "_func_224" }, + { 0x225, "_func_225" }, + { 0x226, "_func_226" }, + { 0x227, "_func_227" }, + { 0x228, "_func_228" }, + { 0x229, "_func_229" }, + { 0x22A, "_func_22A" }, + { 0x22B, "_func_22B" }, + { 0x22C, "_func_22C" }, + { 0x22D, "_func_22D" }, + { 0x22E, "_func_22E" }, + { 0x22F, "_func_22F" }, + { 0x230, "_func_230" }, + { 0x231, "_func_231" }, + { 0x232, "_func_232" }, + { 0x233, "_func_233" }, + { 0x234, "_func_234" }, + { 0x235, "_func_235" }, + { 0x236, "_func_236" }, + { 0x237, "_func_237" }, + { 0x238, "_func_238" }, + { 0x239, "_func_239" }, + { 0x23A, "_func_23A" }, + { 0x23B, "_func_23B" }, + { 0x23C, "_func_23C" }, + { 0x23D, "_func_23D" }, + { 0x23E, "_func_23E" }, + { 0x23F, "_func_23F" }, + { 0x240, "_func_240" }, + { 0x241, "_func_241" }, + { 0x242, "_func_242" }, + { 0x243, "_func_243" }, + { 0x244, "_func_244" }, + { 0x245, "_func_245" }, + { 0x246, "_func_246" }, + { 0x247, "_func_247" }, + { 0x248, "_func_248" }, + { 0x249, "_func_249" }, + { 0x24A, "_func_24A" }, + { 0x24B, "_func_24B" }, + { 0x24C, "_func_24C" }, + { 0x24D, "_func_24D" }, + { 0x24E, "_func_24E" }, + { 0x24F, "_func_24F" }, + { 0x250, "_func_250" }, + { 0x251, "_func_251" }, + { 0x252, "_func_252" }, + { 0x253, "_func_253" }, + { 0x254, "_func_254" }, + { 0x255, "_func_255" }, + { 0x256, "_func_256" }, + { 0x257, "_func_257" }, + { 0x258, "_func_258" }, + { 0x259, "_func_259" }, + { 0x25A, "_func_25A" }, + { 0x25B, "_func_25B" }, + { 0x25C, "_func_25C" }, + { 0x25D, "_func_25D" }, + { 0x25E, "_func_25E" }, + { 0x25F, "_func_25F" }, + { 0x260, "_func_260" }, + { 0x261, "_func_261" }, + { 0x262, "_func_262" }, + { 0x263, "_func_263" }, + { 0x264, "_func_264" }, + { 0x265, "_func_265" }, + { 0x266, "_func_266" }, + { 0x267, "_func_267" }, + { 0x268, "_func_268" }, + { 0x269, "_func_269" }, + { 0x26A, "_func_26A" }, + { 0x26B, "_func_26B" }, + { 0x26C, "_func_26C" }, + { 0x26D, "_func_26D" }, + { 0x26E, "_func_26E" }, + { 0x26F, "_func_26F" }, + { 0x270, "_func_270" }, + { 0x271, "_func_271" }, + { 0x272, "_func_272" }, + { 0x273, "_func_273" }, + { 0x274, "_func_274" }, + { 0x275, "_func_275" }, + { 0x276, "_func_276" }, + { 0x277, "_func_277" }, + { 0x278, "_func_278" }, + { 0x279, "_func_279" }, + { 0x27A, "_func_27A" }, + { 0x27B, "_func_27B" }, + { 0x27C, "_func_27C" }, + { 0x27D, "_func_27D" }, + { 0x27E, "_func_27E" }, + { 0x27F, "_func_27F" }, + { 0x280, "_func_280" }, + { 0x281, "_func_281" }, + { 0x282, "_func_282" }, + { 0x283, "_func_283" }, + { 0x284, "_func_284" }, + { 0x285, "_func_285" }, + { 0x286, "_func_286" }, + { 0x287, "_func_287" }, + { 0x288, "_func_288" }, + { 0x289, "_func_289" }, + { 0x28A, "_func_28A" }, + { 0x28B, "_func_28B" }, + { 0x28C, "_func_28C" }, + { 0x28D, "_func_28D" }, + { 0x28E, "_func_28E" }, + { 0x28F, "_func_28F" }, + { 0x290, "_func_290" }, + { 0x291, "_func_291" }, + { 0x292, "_func_292" }, + { 0x293, "_func_293" }, + { 0x294, "_func_294" }, + { 0x295, "_func_295" }, + { 0x296, "_func_296" }, + { 0x297, "_func_297" }, + { 0x298, "_func_298" }, + { 0x299, "_func_299" }, + { 0x29A, "_func_29A" }, + { 0x29B, "_func_29B" }, + { 0x29C, "_func_29C" }, + { 0x29D, "_func_29D" }, + { 0x29E, "_func_29E" }, + { 0x29F, "_func_29F" }, + { 0x2A0, "_func_2A0" }, + { 0x2A1, "_func_2A1" }, + { 0x2A2, "_func_2A2" }, + { 0x2A3, "_func_2A3" }, + { 0x2A4, "_func_2A4" }, + { 0x2A5, "_func_2A5" }, + { 0x2A6, "_func_2A6" }, + { 0x2A7, "_func_2A7" }, + { 0x2A8, "_func_2A8" }, + { 0x2A9, "_func_2A9" }, + { 0x2AA, "_func_2AA" }, + { 0x2AB, "_func_2AB" }, + { 0x2AC, "_func_2AC" }, + { 0x2AD, "_func_2AD" }, + { 0x2AE, "_func_2AE" }, + { 0x2AF, "_func_2AF" }, + { 0x2B0, "_func_2B0" }, + { 0x2B1, "_func_2B1" }, + { 0x2B2, "_func_2B2" }, + { 0x2B3, "_func_2B3" }, + { 0x2B4, "_func_2B4" }, + { 0x2B5, "_func_2B5" }, + { 0x2B6, "_func_2B6" }, + { 0x2B7, "_func_2B7" }, + { 0x2B8, "_func_2B8" }, + { 0x2B9, "_func_2B9" }, + { 0x2BA, "_func_2BA" }, + { 0x2BB, "_func_2BB" }, + { 0x2BC, "_func_2BC" }, + { 0x2BD, "_func_2BD" }, + { 0x2BE, "_func_2BE" }, + { 0x2BF, "_func_2BF" }, + { 0x2C0, "_func_2C0" }, + { 0x2C1, "_func_2C1" }, + { 0x2C2, "_func_2C2" }, + { 0x2C3, "_func_2C3" }, + { 0x2C4, "_func_2C4" }, + { 0x2C5, "_func_2C5" }, + { 0x2C6, "_func_2C6" }, + { 0x2C7, "_func_2C7" }, + { 0x2C8, "_func_2C8" }, + { 0x2C9, "_func_2C9" }, + { 0x2CA, "_func_2CA" }, + { 0x2CB, "_func_2CB" }, + { 0x2CC, "_func_2CC" }, + { 0x2CD, "_func_2CD" }, + { 0x2CE, "_func_2CE" }, + { 0x2CF, "_func_2CF" }, + { 0x2D0, "_func_2D0" }, + { 0x2D1, "_func_2D1" }, + { 0x2D2, "_func_2D2" }, + { 0x2D3, "_func_2D3" }, + { 0x2D4, "_func_2D4" }, + { 0x2D5, "_func_2D5" }, + { 0x2D6, "_func_2D6" }, + { 0x2D7, "_func_2D7" }, + { 0x2D8, "_func_2D8" }, + { 0x2D9, "_func_2D9" }, + { 0x2DA, "_func_2DA" }, + { 0x2DB, "_func_2DB" }, + { 0x2DC, "_func_2DC" }, + { 0x2DD, "_func_2DD" }, + { 0x2DE, "_func_2DE" }, + { 0x2DF, "_func_2DF" }, + { 0x2E0, "_func_2E0" }, + { 0x2E1, "_func_2E1" }, + { 0x2E2, "_func_2E2" }, + { 0x2E3, "_func_2E3" }, + { 0x2E4, "_func_2E4" }, + { 0x2E5, "_func_2E5" }, + { 0x2E6, "_func_2E6" }, + { 0x2E7, "_func_2E7" }, + { 0x2E8, "_func_2E8" }, + { 0x2E9, "_func_2E9" }, + { 0x2EA, "_func_2EA" }, + { 0x2EB, "_func_2EB" }, + { 0x2EC, "_func_2EC" }, + { 0x2ED, "_func_2ED" }, + { 0x2EE, "_func_2EE" }, + { 0x2EF, "_func_2EF" }, + { 0x2F0, "_func_2F0" }, + { 0x2F1, "_func_2F1" }, + { 0x2F2, "_func_2F2" }, + { 0x2F3, "_func_2F3" }, + { 0x2F4, "_func_2F4" }, + { 0x2F5, "_func_2F5" }, + { 0x2F6, "_func_2F6" }, + { 0x2F7, "_func_2F7" }, + { 0x2F8, "_func_2F8" }, + { 0x2F9, "_func_2F9" }, + { 0x2FA, "_func_2FA" }, + { 0x2FB, "_func_2FB" }, + { 0x2FC, "_func_2FC" }, + { 0x2FD, "_func_2FD" }, + { 0x2FE, "_func_2FE" }, + { 0x2FF, "_func_2FF" }, + { 0x300, "_func_300" }, + { 0x301, "_func_301" }, + { 0x302, "_func_302" }, + { 0x303, "_func_303" }, + { 0x304, "_func_304" }, + { 0x305, "_func_305" }, + { 0x306, "_func_306" }, + { 0x307, "_func_307" }, + { 0x308, "_func_308" }, + { 0x309, "_func_309" }, + { 0x30A, "_func_30A" }, + { 0x30B, "_func_30B" }, + { 0x30C, "_func_30C" }, + { 0x30D, "_func_30D" }, + { 0x30E, "_func_30E" }, + { 0x30F, "_func_30F" }, + { 0x310, "_func_310" }, + { 0x311, "_func_311" }, + { 0x312, "_func_312" }, + { 0x313, "_func_313" }, + { 0x314, "_func_314" }, + { 0x315, "_func_315" }, + { 0x316, "_func_316" }, + { 0x317, "_func_317" }, + { 0x318, "_func_318" }, + { 0x319, "_func_319" }, + { 0x31A, "_func_31A" }, + { 0x31B, "_func_31B" }, + { 0x31C, "_func_31C" }, + { 0x31D, "_func_31D" }, + { 0x31E, "_func_31E" }, + { 0x31F, "_func_31F" }, + { 0x320, "_func_320" }, + { 0x321, "_func_321" }, + { 0x322, "_func_322" }, + { 0x323, "_func_323" }, + { 0x324, "_func_324" }, + { 0x325, "_func_325" }, + { 0x326, "_func_326" }, + { 0x327, "_func_327" }, + { 0x328, "_func_328" }, + { 0x329, "_func_329" }, + { 0x32A, "_func_32A" }, + { 0x32B, "_func_32B" }, + { 0x32C, "_func_32C" }, + { 0x32D, "_func_32D" }, + { 0x32E, "_func_32E" }, + { 0x32F, "_func_32F" }, + { 0x330, "_func_330" }, + { 0x331, "_func_331" }, + { 0x332, "_func_332" }, + { 0x333, "_func_333" }, + { 0x334, "_func_334" }, + { 0x335, "_func_335" }, + { 0x336, "_func_336" }, + { 0x337, "_func_337" }, + { 0x338, "_func_338" }, + { 0x339, "_func_339" }, + { 0x33A, "_func_33A" }, + { 0x33B, "_func_33B" }, + { 0x33C, "_func_33C" }, + { 0x33D, "_func_33D" }, + { 0x33E, "_func_33E" }, + { 0x33F, "_func_33F" }, + { 0x340, "_func_340" }, + { 0x341, "_func_341" }, + { 0x342, "_func_342" }, + { 0x343, "_func_343" }, + { 0x344, "_func_344" }, + { 0x345, "_func_345" }, + { 0x346, "_func_346" }, + { 0x347, "_func_347" }, + { 0x348, "_func_348" }, + { 0x349, "_func_349" }, + { 0x34A, "_func_34A" }, + { 0x34B, "_func_34B" }, + { 0x34C, "_func_34C" }, + { 0x34D, "_func_34D" }, + { 0x34E, "_func_34E" }, + { 0x34F, "_func_34F" }, + { 0x350, "_func_350" }, + { 0x351, "_func_351" }, + { 0x352, "_func_352" }, + { 0x353, "_func_353" }, + { 0x354, "_func_354" }, + { 0x355, "_func_355" }, + { 0x356, "_func_356" }, + { 0x357, "_func_357" }, + { 0x358, "_func_358" }, + { 0x359, "_func_359" }, + { 0x35A, "_func_35A" }, + { 0x35B, "_func_35B" }, + { 0x35C, "_func_35C" }, + { 0x35D, "_func_35D" }, + { 0x35E, "_func_35E" }, + { 0x35F, "_func_35F" }, + { 0x360, "_func_360" }, + { 0x361, "_func_361" }, + { 0x362, "_func_362" }, + { 0x363, "_func_363" }, + { 0x364, "_func_364" }, + { 0x365, "_func_365" }, + { 0x366, "_func_366" }, + { 0x367, "_func_367" }, + { 0x368, "_func_368" }, + { 0x369, "_func_369" }, + { 0x36A, "_func_36A" }, + { 0x36B, "_func_36B" }, + { 0x36C, "_func_36C" }, + { 0x36D, "_func_36D" }, + { 0x36E, "_func_36E" }, + { 0x36F, "_func_36F" }, + { 0x370, "_func_370" }, + { 0x371, "_func_371" }, + { 0x372, "_func_372" }, + { 0x373, "_func_373" }, + { 0x374, "_func_374" }, + { 0x375, "_func_375" }, + { 0x376, "_func_376" }, + { 0x377, "_func_377" }, + { 0x378, "_func_378" }, + { 0x379, "_func_379" }, + { 0x37A, "_func_37A" }, + { 0x37B, "_func_37B" }, + { 0x37C, "_func_37C" }, + { 0x37D, "_func_37D" }, + { 0x37E, "_func_37E" }, + { 0x37F, "_func_37F" }, + { 0x380, "_func_380" }, + { 0x381, "_func_381" }, + { 0x382, "_func_382" }, + { 0x383, "_func_383" }, + { 0x384, "_func_384" }, + { 0x385, "_func_385" }, + { 0x386, "_func_386" }, + { 0x387, "_func_387" }, + { 0x388, "_func_388" }, + { 0x389, "_func_389" }, + { 0x38A, "_func_38A" }, + { 0x38B, "_func_38B" }, + { 0x38C, "_func_38C" }, + { 0x38D, "_func_38D" }, + { 0x38E, "_func_38E" }, + { 0x38F, "_func_38F" }, + { 0x390, "_func_390" }, + { 0x391, "_func_391" }, + { 0x392, "_func_392" }, + { 0x393, "_func_393" }, + { 0x394, "_func_394" }, + { 0x395, "_func_395" }, + { 0x396, "_func_396" }, + { 0x397, "_func_397" }, + { 0x398, "_func_398" }, + { 0x399, "_func_399" }, + { 0x39A, "_func_39A" }, + { 0x39B, "_func_39B" }, + { 0x39C, "_func_39C" }, + { 0x39D, "_func_39D" }, + { 0x39E, "_func_39E" }, + { 0x39F, "_func_39F" }, + { 0x3A0, "_func_3A0" }, + { 0x3A1, "_func_3A1" }, + { 0x3A2, "_func_3A2" }, + { 0x3A3, "_func_3A3" }, + { 0x3A4, "_func_3A4" }, + { 0x3A5, "_func_3A5" }, + { 0x3A6, "_func_3A6" }, + { 0x3A7, "_func_3A7" }, + { 0x3A8, "_func_3A8" }, + { 0x3A9, "_func_3A9" }, + { 0x3AA, "_func_3AA" }, + { 0x3AB, "_func_3AB" }, + { 0x3AC, "_func_3AC" }, + { 0x3AD, "_func_3AD" }, + { 0x3AE, "_func_3AE" }, + { 0x3AF, "_func_3AF" }, + { 0x3B0, "_func_3B0" }, + { 0x3B1, "_func_3B1" }, + { 0x3B2, "_func_3B2" }, + { 0x3B3, "_func_3B3" }, + { 0x3B4, "_func_3B4" }, + { 0x3B5, "_func_3B5" }, + { 0x3B6, "_func_3B6" }, + { 0x3B7, "_func_3B7" }, + { 0x3B8, "_func_3B8" }, + { 0x3B9, "_func_3B9" }, + { 0x3BA, "_func_3BA" }, + { 0x3BB, "_func_3BB" }, + { 0x3BC, "_func_3BC" }, + { 0x3BD, "_func_3BD" }, + { 0x3BE, "_func_3BE" }, + { 0x3BF, "_func_3BF" }, + { 0x3C0, "_func_3C0" }, + { 0x3C1, "_func_3C1" }, + { 0x3C2, "_func_3C2" }, + { 0x3C3, "_func_3C3" }, + { 0x3C4, "_func_3C4" }, + { 0x3C5, "_func_3C5" }, + { 0x3C6, "_func_3C6" }, + { 0x3C7, "_func_3C7" }, + { 0x3C8, "_func_3C8" }, + { 0x3C9, "_func_3C9" }, + { 0x3CA, "_func_3CA" }, + { 0x3CB, "_func_3CB" }, + { 0x3CC, "_func_3CC" }, + { 0x3CD, "_func_3CD" }, + { 0x3CE, "_func_3CE" }, + { 0x3CF, "_func_3CF" }, + { 0x3D0, "_func_3D0" }, + { 0x3D1, "_func_3D1" }, + { 0x3D2, "_func_3D2" }, + { 0x3D3, "_func_3D3" }, + { 0x3D4, "_func_3D4" }, + { 0x3D5, "_func_3D5" }, + { 0x3D6, "_func_3D6" }, + { 0x3D7, "_func_3D7" }, + { 0x3D8, "_func_3D8" }, + { 0x3D9, "_func_3D9" }, + { 0x3DA, "_func_3DA" }, + { 0x3DB, "_func_3DB" }, + { 0x3DC, "_func_3DC" }, + { 0x3DD, "_func_3DD" }, + { 0x3DE, "_func_3DE" }, + { 0x3DF, "_func_3DF" }, + { 0x3E0, "_func_3E0" }, + { 0x3E1, "_func_3E1" }, + { 0x3E2, "_func_3E2" }, + { 0x3E3, "_func_3E3" }, + { 0x3E4, "_func_3E4" }, + { 0x3E5, "_func_3E5" }, + { 0x3E6, "_func_3E6" }, + { 0x3E7, "_func_3E7" }, + { 0x3E8, "_func_3E8" }, +}}; + +const std::array method_list +{{ + { 0x8000, "_meth_8000" }, + { 0x8001, "_meth_8001" }, + { 0x8002, "_meth_8002" }, + { 0x8003, "_meth_8003" }, + { 0x8004, "_meth_8004" }, + { 0x8005, "_meth_8005" }, + { 0x8006, "_meth_8006" }, + { 0x8007, "_meth_8007" }, + { 0x8008, "_meth_8008" }, + { 0x8009, "_meth_8009" }, + { 0x800A, "_meth_800A" }, + { 0x800B, "_meth_800B" }, + { 0x800C, "_meth_800C" }, + { 0x800D, "_meth_800D" }, + { 0x800E, "_meth_800E" }, + { 0x800F, "_meth_800F" }, + { 0x8010, "_meth_8010" }, + { 0x8011, "_meth_8011" }, + { 0x8012, "_meth_8012" }, + { 0x8013, "_meth_8013" }, + { 0x8014, "_meth_8014" }, + { 0x8015, "_meth_8015" }, + { 0x8016, "_meth_8016" }, + { 0x8017, "_meth_8017" }, + { 0x8018, "_meth_8018" }, + { 0x8019, "_meth_8019" }, + { 0x801A, "_meth_801A" }, + { 0x801B, "_meth_801B" }, + { 0x801C, "_meth_801C" }, + { 0x801D, "_meth_801D" }, + { 0x801E, "_meth_801E" }, + { 0x801F, "_meth_801F" }, + { 0x8020, "_meth_8020" }, + { 0x8021, "_meth_8021" }, + { 0x8022, "_meth_8022" }, + { 0x8023, "_meth_8023" }, + { 0x8024, "_meth_8024" }, + { 0x8025, "_meth_8025" }, + { 0x8026, "_meth_8026" }, + { 0x8027, "_meth_8027" }, + { 0x8028, "_meth_8028" }, + { 0x8029, "_meth_8029" }, + { 0x802A, "_meth_802A" }, + { 0x802B, "_meth_802B" }, + { 0x802C, "_meth_802C" }, + { 0x802D, "_meth_802D" }, + { 0x802E, "_meth_802E" }, + { 0x802F, "_meth_802F" }, + { 0x8030, "_meth_8030" }, + { 0x8031, "_meth_8031" }, + { 0x8032, "_meth_8032" }, + { 0x8033, "_meth_8033" }, + { 0x8034, "_meth_8034" }, + { 0x8035, "_meth_8035" }, + { 0x8036, "_meth_8036" }, + { 0x8037, "_meth_8037" }, + { 0x8038, "_meth_8038" }, + { 0x8039, "_meth_8039" }, + { 0x803A, "_meth_803A" }, + { 0x803B, "_meth_803B" }, + { 0x803C, "_meth_803C" }, + { 0x803D, "_meth_803D" }, + { 0x803E, "_meth_803E" }, + { 0x803F, "_meth_803F" }, + { 0x8040, "_meth_8040" }, + { 0x8041, "_meth_8041" }, + { 0x8042, "_meth_8042" }, + { 0x8043, "_meth_8043" }, + { 0x8044, "_meth_8044" }, + { 0x8045, "_meth_8045" }, + { 0x8046, "_meth_8046" }, + { 0x8047, "_meth_8047" }, + { 0x8048, "_meth_8048" }, + { 0x8049, "_meth_8049" }, + { 0x804A, "_meth_804A" }, + { 0x804B, "_meth_804B" }, + { 0x804C, "_meth_804C" }, + { 0x804D, "_meth_804D" }, + { 0x804E, "_meth_804E" }, + { 0x804F, "_meth_804F" }, + { 0x8050, "_meth_8050" }, + { 0x8051, "_meth_8051" }, + { 0x8052, "_meth_8052" }, + { 0x8053, "_meth_8053" }, + { 0x8054, "_meth_8054" }, + { 0x8055, "_meth_8055" }, + { 0x8056, "_meth_8056" }, + { 0x8057, "_meth_8057" }, + { 0x8058, "_meth_8058" }, + { 0x8059, "_meth_8059" }, + { 0x805A, "_meth_805A" }, + { 0x805B, "_meth_805B" }, + { 0x805C, "_meth_805C" }, + { 0x805D, "_meth_805D" }, + { 0x805E, "_meth_805E" }, + { 0x805F, "_meth_805F" }, + { 0x8060, "_meth_8060" }, + { 0x8061, "_meth_8061" }, + { 0x8062, "_meth_8062" }, + { 0x8063, "_meth_8063" }, + { 0x8064, "_meth_8064" }, + { 0x8065, "_meth_8065" }, + { 0x8066, "_meth_8066" }, + { 0x8067, "_meth_8067" }, + { 0x8068, "_meth_8068" }, + { 0x8069, "_meth_8069" }, + { 0x806A, "_meth_806A" }, + { 0x806B, "_meth_806B" }, + { 0x806C, "_meth_806C" }, + { 0x806D, "_meth_806D" }, + { 0x806E, "_meth_806E" }, + { 0x806F, "_meth_806F" }, + { 0x8070, "_meth_8070" }, + { 0x8071, "_meth_8071" }, + { 0x8072, "_meth_8072" }, + { 0x8073, "_meth_8073" }, + { 0x8074, "_meth_8074" }, + { 0x8075, "_meth_8075" }, + { 0x8076, "_meth_8076" }, + { 0x8077, "_meth_8077" }, + { 0x8078, "_meth_8078" }, + { 0x8079, "_meth_8079" }, + { 0x807A, "_meth_807A" }, + { 0x807B, "_meth_807B" }, + { 0x807C, "_meth_807C" }, + { 0x807D, "_meth_807D" }, + { 0x807E, "_meth_807E" }, + { 0x807F, "_meth_807F" }, + { 0x8080, "_meth_8080" }, + { 0x8081, "_meth_8081" }, + { 0x8082, "_meth_8082" }, + { 0x8083, "_meth_8083" }, + { 0x8084, "_meth_8084" }, + { 0x8085, "_meth_8085" }, + { 0x8086, "_meth_8086" }, + { 0x8087, "_meth_8087" }, + { 0x8088, "_meth_8088" }, + { 0x8089, "_meth_8089" }, + { 0x808A, "_meth_808A" }, + { 0x808B, "_meth_808B" }, + { 0x808C, "_meth_808C" }, + { 0x808D, "_meth_808D" }, + { 0x808E, "_meth_808E" }, + { 0x808F, "_meth_808F" }, + { 0x8090, "_meth_8090" }, + { 0x8091, "_meth_8091" }, + { 0x8092, "_meth_8092" }, + { 0x8093, "_meth_8093" }, + { 0x8094, "_meth_8094" }, + { 0x8095, "_meth_8095" }, + { 0x8096, "_meth_8096" }, + { 0x8097, "_meth_8097" }, + { 0x8098, "_meth_8098" }, + { 0x8099, "_meth_8099" }, + { 0x809A, "_meth_809A" }, + { 0x809B, "_meth_809B" }, + { 0x809C, "_meth_809C" }, + { 0x809D, "_meth_809D" }, + { 0x809E, "_meth_809E" }, + { 0x809F, "_meth_809F" }, + { 0x80A0, "_meth_80A0" }, + { 0x80A1, "_meth_80A1" }, + { 0x80A2, "_meth_80A2" }, + { 0x80A3, "_meth_80A3" }, + { 0x80A4, "_meth_80A4" }, + { 0x80A5, "_meth_80A5" }, + { 0x80A6, "_meth_80A6" }, + { 0x80A7, "_meth_80A7" }, + { 0x80A8, "_meth_80A8" }, + { 0x80A9, "_meth_80A9" }, + { 0x80AA, "_meth_80AA" }, + { 0x80AB, "_meth_80AB" }, + { 0x80AC, "_meth_80AC" }, + { 0x80AD, "_meth_80AD" }, + { 0x80AE, "_meth_80AE" }, + { 0x80AF, "_meth_80AF" }, + { 0x80B0, "_meth_80B0" }, + { 0x80B1, "_meth_80B1" }, + { 0x80B2, "_meth_80B2" }, + { 0x80B3, "_meth_80B3" }, + { 0x80B4, "_meth_80B4" }, + { 0x80B5, "_meth_80B5" }, + { 0x80B6, "_meth_80B6" }, + { 0x80B7, "_meth_80B7" }, + { 0x80B8, "_meth_80B8" }, + { 0x80B9, "_meth_80B9" }, + { 0x80BA, "_meth_80BA" }, + { 0x80BB, "_meth_80BB" }, + { 0x80BC, "_meth_80BC" }, + { 0x80BD, "_meth_80BD" }, + { 0x80BE, "_meth_80BE" }, + { 0x80BF, "_meth_80BF" }, + { 0x80C0, "_meth_80C0" }, + { 0x80C1, "_meth_80C1" }, + { 0x80C2, "_meth_80C2" }, + { 0x80C3, "_meth_80C3" }, + { 0x80C4, "_meth_80C4" }, + { 0x80C5, "_meth_80C5" }, + { 0x80C6, "_meth_80C6" }, + { 0x80C7, "_meth_80C7" }, + { 0x80C8, "_meth_80C8" }, + { 0x80C9, "_meth_80C9" }, + { 0x80CA, "_meth_80CA" }, + { 0x80CB, "_meth_80CB" }, + { 0x80CC, "_meth_80CC" }, + { 0x80CD, "_meth_80CD" }, + { 0x80CE, "_meth_80CE" }, + { 0x80CF, "_meth_80CF" }, + { 0x80D0, "_meth_80D0" }, + { 0x80D1, "_meth_80D1" }, + { 0x80D2, "_meth_80D2" }, + { 0x80D3, "_meth_80D3" }, + { 0x80D4, "_meth_80D4" }, + { 0x80D5, "_meth_80D5" }, + { 0x80D6, "_meth_80D6" }, + { 0x80D7, "_meth_80D7" }, + { 0x80D8, "_meth_80D8" }, + { 0x80D9, "_meth_80D9" }, + { 0x80DA, "_meth_80DA" }, + { 0x80DB, "_meth_80DB" }, + { 0x80DC, "_meth_80DC" }, + { 0x80DD, "_meth_80DD" }, + { 0x80DE, "_meth_80DE" }, + { 0x80DF, "_meth_80DF" }, + { 0x80E0, "_meth_80E0" }, + { 0x80E1, "_meth_80E1" }, + { 0x80E2, "_meth_80E2" }, + { 0x80E3, "_meth_80E3" }, + { 0x80E4, "_meth_80E4" }, + { 0x80E5, "_meth_80E5" }, + { 0x80E6, "_meth_80E6" }, + { 0x80E7, "_meth_80E7" }, + { 0x80E8, "_meth_80E8" }, + { 0x80E9, "_meth_80E9" }, + { 0x80EA, "_meth_80EA" }, + { 0x80EB, "_meth_80EB" }, + { 0x80EC, "_meth_80EC" }, + { 0x80ED, "_meth_80ED" }, + { 0x80EE, "_meth_80EE" }, + { 0x80EF, "_meth_80EF" }, + { 0x80F0, "_meth_80F0" }, + { 0x80F1, "_meth_80F1" }, + { 0x80F2, "_meth_80F2" }, + { 0x80F3, "_meth_80F3" }, + { 0x80F4, "_meth_80F4" }, + { 0x80F5, "_meth_80F5" }, + { 0x80F6, "_meth_80F6" }, + { 0x80F7, "_meth_80F7" }, + { 0x80F8, "_meth_80F8" }, + { 0x80F9, "_meth_80F9" }, + { 0x80FA, "_meth_80FA" }, + { 0x80FB, "_meth_80FB" }, + { 0x80FC, "_meth_80FC" }, + { 0x80FD, "_meth_80FD" }, + { 0x80FE, "_meth_80FE" }, + { 0x80FF, "_meth_80FF" }, + { 0x8100, "_meth_8100" }, + { 0x8101, "_meth_8101" }, + { 0x8102, "_meth_8102" }, + { 0x8103, "_meth_8103" }, + { 0x8104, "_meth_8104" }, + { 0x8105, "_meth_8105" }, + { 0x8106, "_meth_8106" }, + { 0x8107, "_meth_8107" }, + { 0x8108, "_meth_8108" }, + { 0x8109, "_meth_8109" }, + { 0x810A, "_meth_810A" }, + { 0x810B, "_meth_810B" }, + { 0x810C, "_meth_810C" }, + { 0x810D, "_meth_810D" }, + { 0x810E, "_meth_810E" }, + { 0x810F, "_meth_810F" }, + { 0x8110, "_meth_8110" }, + { 0x8111, "_meth_8111" }, + { 0x8112, "_meth_8112" }, + { 0x8113, "_meth_8113" }, + { 0x8114, "_meth_8114" }, + { 0x8115, "_meth_8115" }, + { 0x8116, "_meth_8116" }, + { 0x8117, "_meth_8117" }, + { 0x8118, "_meth_8118" }, + { 0x8119, "_meth_8119" }, + { 0x811A, "_meth_811A" }, + { 0x811B, "_meth_811B" }, + { 0x811C, "_meth_811C" }, + { 0x811D, "_meth_811D" }, + { 0x811E, "_meth_811E" }, + { 0x811F, "_meth_811F" }, + { 0x8120, "_meth_8120" }, + { 0x8121, "_meth_8121" }, + { 0x8122, "_meth_8122" }, + { 0x8123, "_meth_8123" }, + { 0x8124, "_meth_8124" }, + { 0x8125, "_meth_8125" }, + { 0x8126, "_meth_8126" }, + { 0x8127, "_meth_8127" }, + { 0x8128, "_meth_8128" }, + { 0x8129, "_meth_8129" }, + { 0x812A, "_meth_812A" }, + { 0x812B, "_meth_812B" }, + { 0x812C, "_meth_812C" }, + { 0x812D, "_meth_812D" }, + { 0x812E, "_meth_812E" }, + { 0x812F, "_meth_812F" }, + { 0x8130, "_meth_8130" }, + { 0x8131, "_meth_8131" }, + { 0x8132, "_meth_8132" }, + { 0x8133, "_meth_8133" }, + { 0x8134, "_meth_8134" }, + { 0x8135, "_meth_8135" }, + { 0x8136, "_meth_8136" }, + { 0x8137, "_meth_8137" }, + { 0x8138, "_meth_8138" }, + { 0x8139, "_meth_8139" }, + { 0x813A, "_meth_813A" }, + { 0x813B, "_meth_813B" }, + { 0x813C, "_meth_813C" }, + { 0x813D, "_meth_813D" }, + { 0x813E, "_meth_813E" }, + { 0x813F, "_meth_813F" }, + { 0x8140, "_meth_8140" }, + { 0x8141, "_meth_8141" }, + { 0x8142, "_meth_8142" }, + { 0x8143, "_meth_8143" }, + { 0x8144, "_meth_8144" }, + { 0x8145, "_meth_8145" }, + { 0x8146, "_meth_8146" }, + { 0x8147, "_meth_8147" }, + { 0x8148, "_meth_8148" }, + { 0x8149, "_meth_8149" }, + { 0x814A, "_meth_814A" }, + { 0x814B, "_meth_814B" }, + { 0x814C, "_meth_814C" }, + { 0x814D, "_meth_814D" }, + { 0x814E, "_meth_814E" }, + { 0x814F, "_meth_814F" }, + { 0x8150, "_meth_8150" }, + { 0x8151, "_meth_8151" }, + { 0x8152, "_meth_8152" }, + { 0x8153, "_meth_8153" }, + { 0x8154, "_meth_8154" }, + { 0x8155, "_meth_8155" }, + { 0x8156, "_meth_8156" }, + { 0x8157, "_meth_8157" }, + { 0x8158, "_meth_8158" }, + { 0x8159, "_meth_8159" }, + { 0x815A, "_meth_815A" }, + { 0x815B, "_meth_815B" }, + { 0x815C, "_meth_815C" }, + { 0x815D, "_meth_815D" }, + { 0x815E, "_meth_815E" }, + { 0x815F, "_meth_815F" }, + { 0x8160, "_meth_8160" }, + { 0x8161, "_meth_8161" }, + { 0x8162, "_meth_8162" }, + { 0x8163, "_meth_8163" }, + { 0x8164, "_meth_8164" }, + { 0x8165, "_meth_8165" }, + { 0x8166, "_meth_8166" }, + { 0x8167, "_meth_8167" }, + { 0x8168, "_meth_8168" }, + { 0x8169, "_meth_8169" }, + { 0x816A, "_meth_816A" }, + { 0x816B, "_meth_816B" }, + { 0x816C, "_meth_816C" }, + { 0x816D, "_meth_816D" }, + { 0x816E, "_meth_816E" }, + { 0x816F, "_meth_816F" }, + { 0x8170, "_meth_8170" }, + { 0x8171, "_meth_8171" }, + { 0x8172, "_meth_8172" }, + { 0x8173, "_meth_8173" }, + { 0x8174, "_meth_8174" }, + { 0x8175, "_meth_8175" }, + { 0x8176, "_meth_8176" }, + { 0x8177, "_meth_8177" }, + { 0x8178, "_meth_8178" }, + { 0x8179, "_meth_8179" }, + { 0x817A, "_meth_817A" }, + { 0x817B, "_meth_817B" }, + { 0x817C, "_meth_817C" }, + { 0x817D, "_meth_817D" }, + { 0x817E, "_meth_817E" }, + { 0x817F, "_meth_817F" }, + { 0x8180, "_meth_8180" }, + { 0x8181, "_meth_8181" }, + { 0x8182, "_meth_8182" }, + { 0x8183, "_meth_8183" }, + { 0x8184, "_meth_8184" }, + { 0x8185, "_meth_8185" }, + { 0x8186, "_meth_8186" }, + { 0x8187, "_meth_8187" }, + { 0x8188, "_meth_8188" }, + { 0x8189, "_meth_8189" }, + { 0x818A, "_meth_818A" }, + { 0x818B, "_meth_818B" }, + { 0x818C, "_meth_818C" }, + { 0x818D, "_meth_818D" }, + { 0x818E, "_meth_818E" }, + { 0x818F, "_meth_818F" }, + { 0x8190, "_meth_8190" }, + { 0x8191, "_meth_8191" }, + { 0x8192, "_meth_8192" }, + { 0x8193, "_meth_8193" }, + { 0x8194, "_meth_8194" }, + { 0x8195, "_meth_8195" }, + { 0x8196, "_meth_8196" }, + { 0x8197, "_meth_8197" }, + { 0x8198, "_meth_8198" }, + { 0x8199, "_meth_8199" }, + { 0x819A, "_meth_819A" }, + { 0x819B, "_meth_819B" }, + { 0x819C, "_meth_819C" }, + { 0x819D, "_meth_819D" }, + { 0x819E, "_meth_819E" }, + { 0x819F, "_meth_819F" }, + { 0x81A0, "_meth_81A0" }, + { 0x81A1, "_meth_81A1" }, + { 0x81A2, "_meth_81A2" }, + { 0x81A3, "_meth_81A3" }, + { 0x81A4, "_meth_81A4" }, + { 0x81A5, "_meth_81A5" }, + { 0x81A6, "_meth_81A6" }, + { 0x81A7, "_meth_81A7" }, + { 0x81A8, "_meth_81A8" }, + { 0x81A9, "_meth_81A9" }, + { 0x81AA, "_meth_81AA" }, + { 0x81AB, "_meth_81AB" }, + { 0x81AC, "_meth_81AC" }, + { 0x81AD, "_meth_81AD" }, + { 0x81AE, "_meth_81AE" }, + { 0x81AF, "_meth_81AF" }, + { 0x81B0, "_meth_81B0" }, + { 0x81B1, "_meth_81B1" }, + { 0x81B2, "_meth_81B2" }, + { 0x81B3, "_meth_81B3" }, + { 0x81B4, "_meth_81B4" }, + { 0x81B5, "_meth_81B5" }, + { 0x81B6, "_meth_81B6" }, + { 0x81B7, "_meth_81B7" }, + { 0x81B8, "_meth_81B8" }, + { 0x81B9, "_meth_81B9" }, + { 0x81BA, "_meth_81BA" }, + { 0x81BB, "_meth_81BB" }, + { 0x81BC, "_meth_81BC" }, + { 0x81BD, "_meth_81BD" }, + { 0x81BE, "_meth_81BE" }, + { 0x81BF, "_meth_81BF" }, + { 0x81C0, "_meth_81C0" }, + { 0x81C1, "_meth_81C1" }, + { 0x81C2, "_meth_81C2" }, + { 0x81C3, "_meth_81C3" }, + { 0x81C4, "_meth_81C4" }, + { 0x81C5, "_meth_81C5" }, + { 0x81C6, "_meth_81C6" }, + { 0x81C7, "_meth_81C7" }, + { 0x81C8, "_meth_81C8" }, + { 0x81C9, "_meth_81C9" }, + { 0x81CA, "_meth_81CA" }, + { 0x81CB, "_meth_81CB" }, + { 0x81CC, "_meth_81CC" }, + { 0x81CD, "_meth_81CD" }, + { 0x81CE, "_meth_81CE" }, + { 0x81CF, "_meth_81CF" }, + { 0x81D0, "_meth_81D0" }, + { 0x81D1, "_meth_81D1" }, + { 0x81D2, "_meth_81D2" }, + { 0x81D3, "_meth_81D3" }, + { 0x81D4, "_meth_81D4" }, + { 0x81D5, "_meth_81D5" }, + { 0x81D6, "_meth_81D6" }, + { 0x81D7, "_meth_81D7" }, + { 0x81D8, "_meth_81D8" }, + { 0x81D9, "_meth_81D9" }, + { 0x81DA, "_meth_81DA" }, + { 0x81DB, "_meth_81DB" }, + { 0x81DC, "_meth_81DC" }, + { 0x81DD, "_meth_81DD" }, + { 0x81DE, "_meth_81DE" }, + { 0x81DF, "_meth_81DF" }, + { 0x81E0, "_meth_81E0" }, + { 0x81E1, "_meth_81E1" }, + { 0x81E2, "_meth_81E2" }, + { 0x81E3, "_meth_81E3" }, + { 0x81E4, "_meth_81E4" }, + { 0x81E5, "_meth_81E5" }, + { 0x81E6, "_meth_81E6" }, + { 0x81E7, "_meth_81E7" }, + { 0x81E8, "_meth_81E8" }, + { 0x81E9, "_meth_81E9" }, + { 0x81EA, "_meth_81EA" }, + { 0x81EB, "_meth_81EB" }, + { 0x81EC, "_meth_81EC" }, + { 0x81ED, "_meth_81ED" }, + { 0x81EE, "_meth_81EE" }, + { 0x81EF, "_meth_81EF" }, + { 0x81F0, "_meth_81F0" }, + { 0x81F1, "_meth_81F1" }, + { 0x81F2, "_meth_81F2" }, + { 0x81F3, "_meth_81F3" }, + { 0x81F4, "_meth_81F4" }, + { 0x81F5, "_meth_81F5" }, + { 0x81F6, "_meth_81F6" }, + { 0x81F7, "_meth_81F7" }, + { 0x81F8, "_meth_81F8" }, + { 0x81F9, "_meth_81F9" }, + { 0x81FA, "_meth_81FA" }, + { 0x81FB, "_meth_81FB" }, + { 0x81FC, "_meth_81FC" }, + { 0x81FD, "_meth_81FD" }, + { 0x81FE, "_meth_81FE" }, + { 0x81FF, "_meth_81FF" }, + { 0x8200, "_meth_8200" }, + { 0x8201, "_meth_8201" }, + { 0x8202, "_meth_8202" }, + { 0x8203, "_meth_8203" }, + { 0x8204, "_meth_8204" }, + { 0x8205, "_meth_8205" }, + { 0x8206, "_meth_8206" }, + { 0x8207, "_meth_8207" }, + { 0x8208, "_meth_8208" }, + { 0x8209, "_meth_8209" }, + { 0x820A, "_meth_820A" }, + { 0x820B, "_meth_820B" }, + { 0x820C, "_meth_820C" }, + { 0x820D, "_meth_820D" }, + { 0x820E, "_meth_820E" }, + { 0x820F, "_meth_820F" }, + { 0x8210, "_meth_8210" }, + { 0x8211, "_meth_8211" }, + { 0x8212, "_meth_8212" }, + { 0x8213, "_meth_8213" }, + { 0x8214, "_meth_8214" }, + { 0x8215, "_meth_8215" }, + { 0x8216, "_meth_8216" }, + { 0x8217, "_meth_8217" }, + { 0x8218, "_meth_8218" }, + { 0x8219, "_meth_8219" }, + { 0x821A, "_meth_821A" }, + { 0x821B, "_meth_821B" }, + { 0x821C, "_meth_821C" }, + { 0x821D, "_meth_821D" }, + { 0x821E, "_meth_821E" }, + { 0x821F, "_meth_821F" }, + { 0x8220, "_meth_8220" }, + { 0x8221, "_meth_8221" }, + { 0x8222, "_meth_8222" }, + { 0x8223, "_meth_8223" }, + { 0x8224, "_meth_8224" }, + { 0x8225, "_meth_8225" }, + { 0x8226, "_meth_8226" }, + { 0x8227, "_meth_8227" }, + { 0x8228, "_meth_8228" }, + { 0x8229, "_meth_8229" }, + { 0x822A, "_meth_822A" }, + { 0x822B, "_meth_822B" }, + { 0x822C, "_meth_822C" }, + { 0x822D, "_meth_822D" }, + { 0x822E, "_meth_822E" }, + { 0x822F, "_meth_822F" }, + { 0x8230, "_meth_8230" }, + { 0x8231, "_meth_8231" }, + { 0x8232, "_meth_8232" }, + { 0x8233, "_meth_8233" }, + { 0x8234, "_meth_8234" }, + { 0x8235, "_meth_8235" }, + { 0x8236, "_meth_8236" }, + { 0x8237, "_meth_8237" }, + { 0x8238, "_meth_8238" }, + { 0x8239, "_meth_8239" }, + { 0x823A, "_meth_823A" }, + { 0x823B, "_meth_823B" }, + { 0x823C, "_meth_823C" }, + { 0x823D, "_meth_823D" }, + { 0x823E, "_meth_823E" }, + { 0x823F, "_meth_823F" }, + { 0x8240, "_meth_8240" }, + { 0x8241, "_meth_8241" }, + { 0x8242, "_meth_8242" }, + { 0x8243, "_meth_8243" }, + { 0x8244, "_meth_8244" }, + { 0x8245, "_meth_8245" }, + { 0x8246, "_meth_8246" }, + { 0x8247, "_meth_8247" }, + { 0x8248, "_meth_8248" }, + { 0x8249, "_meth_8249" }, + { 0x824A, "_meth_824A" }, + { 0x824B, "_meth_824B" }, + { 0x824C, "_meth_824C" }, + { 0x824D, "_meth_824D" }, + { 0x824E, "_meth_824E" }, + { 0x824F, "_meth_824F" }, + { 0x8250, "_meth_8250" }, + { 0x8251, "_meth_8251" }, + { 0x8252, "_meth_8252" }, + { 0x8253, "_meth_8253" }, + { 0x8254, "_meth_8254" }, + { 0x8255, "_meth_8255" }, + { 0x8256, "_meth_8256" }, + { 0x8257, "_meth_8257" }, + { 0x8258, "_meth_8258" }, + { 0x8259, "_meth_8259" }, + { 0x825A, "_meth_825A" }, + { 0x825B, "_meth_825B" }, + { 0x825C, "_meth_825C" }, + { 0x825D, "_meth_825D" }, + { 0x825E, "_meth_825E" }, + { 0x825F, "_meth_825F" }, + { 0x8260, "_meth_8260" }, + { 0x8261, "_meth_8261" }, + { 0x8262, "_meth_8262" }, + { 0x8263, "_meth_8263" }, + { 0x8264, "_meth_8264" }, + { 0x8265, "_meth_8265" }, + { 0x8266, "_meth_8266" }, + { 0x8267, "_meth_8267" }, + { 0x8268, "_meth_8268" }, + { 0x8269, "_meth_8269" }, + { 0x826A, "_meth_826A" }, + { 0x826B, "_meth_826B" }, + { 0x826C, "_meth_826C" }, + { 0x826D, "_meth_826D" }, + { 0x826E, "_meth_826E" }, + { 0x826F, "_meth_826F" }, + { 0x8270, "_meth_8270" }, + { 0x8271, "_meth_8271" }, + { 0x8272, "_meth_8272" }, + { 0x8273, "_meth_8273" }, + { 0x8274, "_meth_8274" }, + { 0x8275, "_meth_8275" }, + { 0x8276, "_meth_8276" }, + { 0x8277, "_meth_8277" }, + { 0x8278, "_meth_8278" }, + { 0x8279, "_meth_8279" }, + { 0x827A, "_meth_827A" }, + { 0x827B, "_meth_827B" }, + { 0x827C, "_meth_827C" }, + { 0x827D, "_meth_827D" }, + { 0x827E, "_meth_827E" }, + { 0x827F, "_meth_827F" }, + { 0x8280, "_meth_8280" }, + { 0x8281, "_meth_8281" }, + { 0x8282, "_meth_8282" }, + { 0x8283, "_meth_8283" }, + { 0x8284, "_meth_8284" }, + { 0x8285, "_meth_8285" }, + { 0x8286, "_meth_8286" }, + { 0x8287, "_meth_8287" }, + { 0x8288, "_meth_8288" }, + { 0x8289, "_meth_8289" }, + { 0x828A, "_meth_828A" }, + { 0x828B, "_meth_828B" }, + { 0x828C, "_meth_828C" }, + { 0x828D, "_meth_828D" }, + { 0x828E, "_meth_828E" }, + { 0x828F, "_meth_828F" }, + { 0x8290, "_meth_8290" }, + { 0x8291, "_meth_8291" }, + { 0x8292, "_meth_8292" }, + { 0x8293, "_meth_8293" }, + { 0x8294, "_meth_8294" }, + { 0x8295, "_meth_8295" }, + { 0x8296, "_meth_8296" }, + { 0x8297, "_meth_8297" }, + { 0x8298, "_meth_8298" }, + { 0x8299, "_meth_8299" }, + { 0x829A, "_meth_829A" }, + { 0x829B, "_meth_829B" }, + { 0x829C, "_meth_829C" }, + { 0x829D, "_meth_829D" }, + { 0x829E, "_meth_829E" }, + { 0x829F, "_meth_829F" }, + { 0x82A0, "_meth_82A0" }, + { 0x82A1, "_meth_82A1" }, + { 0x82A2, "_meth_82A2" }, + { 0x82A3, "_meth_82A3" }, + { 0x82A4, "_meth_82A4" }, + { 0x82A5, "_meth_82A5" }, + { 0x82A6, "_meth_82A6" }, + { 0x82A7, "_meth_82A7" }, + { 0x82A8, "_meth_82A8" }, + { 0x82A9, "_meth_82A9" }, + { 0x82AA, "_meth_82AA" }, + { 0x82AB, "_meth_82AB" }, + { 0x82AC, "_meth_82AC" }, + { 0x82AD, "_meth_82AD" }, + { 0x82AE, "_meth_82AE" }, + { 0x82AF, "_meth_82AF" }, + { 0x82B0, "_meth_82B0" }, + { 0x82B1, "_meth_82B1" }, + { 0x82B2, "_meth_82B2" }, + { 0x82B3, "_meth_82B3" }, + { 0x82B4, "_meth_82B4" }, + { 0x82B5, "_meth_82B5" }, + { 0x82B6, "_meth_82B6" }, + { 0x82B7, "_meth_82B7" }, + { 0x82B8, "_meth_82B8" }, + { 0x82B9, "_meth_82B9" }, + { 0x82BA, "_meth_82BA" }, + { 0x82BB, "_meth_82BB" }, + { 0x82BC, "_meth_82BC" }, + { 0x82BD, "_meth_82BD" }, + { 0x82BE, "_meth_82BE" }, + { 0x82BF, "_meth_82BF" }, + { 0x82C0, "_meth_82C0" }, + { 0x82C1, "_meth_82C1" }, + { 0x82C2, "_meth_82C2" }, + { 0x82C3, "_meth_82C3" }, + { 0x82C4, "_meth_82C4" }, + { 0x82C5, "_meth_82C5" }, + { 0x82C6, "_meth_82C6" }, + { 0x82C7, "_meth_82C7" }, + { 0x82C8, "_meth_82C8" }, + { 0x82C9, "_meth_82C9" }, + { 0x82CA, "_meth_82CA" }, + { 0x82CB, "_meth_82CB" }, + { 0x82CC, "_meth_82CC" }, + { 0x82CD, "_meth_82CD" }, + { 0x82CE, "_meth_82CE" }, + { 0x82CF, "_meth_82CF" }, + { 0x82D0, "_meth_82D0" }, + { 0x82D1, "_meth_82D1" }, + { 0x82D2, "_meth_82D2" }, + { 0x82D3, "_meth_82D3" }, + { 0x82D4, "_meth_82D4" }, + { 0x82D5, "_meth_82D5" }, + { 0x82D6, "_meth_82D6" }, + { 0x82D7, "_meth_82D7" }, + { 0x82D8, "_meth_82D8" }, + { 0x82D9, "_meth_82D9" }, + { 0x82DA, "_meth_82DA" }, + { 0x82DB, "_meth_82DB" }, + { 0x82DC, "_meth_82DC" }, + { 0x82DD, "_meth_82DD" }, + { 0x82DE, "_meth_82DE" }, + { 0x82DF, "_meth_82DF" }, + { 0x82E0, "_meth_82E0" }, + { 0x82E1, "_meth_82E1" }, + { 0x82E2, "_meth_82E2" }, + { 0x82E3, "_meth_82E3" }, + { 0x82E4, "_meth_82E4" }, + { 0x82E5, "_meth_82E5" }, + { 0x82E6, "_meth_82E6" }, + { 0x82E7, "_meth_82E7" }, + { 0x82E8, "_meth_82E8" }, + { 0x82E9, "_meth_82E9" }, + { 0x82EA, "_meth_82EA" }, + { 0x82EB, "_meth_82EB" }, + { 0x82EC, "_meth_82EC" }, + { 0x82ED, "_meth_82ED" }, + { 0x82EE, "_meth_82EE" }, + { 0x82EF, "_meth_82EF" }, + { 0x82F0, "_meth_82F0" }, + { 0x82F1, "_meth_82F1" }, + { 0x82F2, "_meth_82F2" }, + { 0x82F3, "_meth_82F3" }, + { 0x82F4, "_meth_82F4" }, + { 0x82F5, "_meth_82F5" }, + { 0x82F6, "_meth_82F6" }, + { 0x82F7, "_meth_82F7" }, + { 0x82F8, "_meth_82F8" }, + { 0x82F9, "_meth_82F9" }, + { 0x82FA, "_meth_82FA" }, + { 0x82FB, "_meth_82FB" }, + { 0x82FC, "_meth_82FC" }, + { 0x82FD, "_meth_82FD" }, + { 0x82FE, "_meth_82FE" }, + { 0x82FF, "_meth_82FF" }, + { 0x8300, "_meth_8300" }, + { 0x8301, "_meth_8301" }, + { 0x8302, "_meth_8302" }, + { 0x8303, "_meth_8303" }, + { 0x8304, "_meth_8304" }, + { 0x8305, "_meth_8305" }, + { 0x8306, "_meth_8306" }, + { 0x8307, "_meth_8307" }, + { 0x8308, "_meth_8308" }, + { 0x8309, "_meth_8309" }, + { 0x830A, "_meth_830A" }, + { 0x830B, "_meth_830B" }, + { 0x830C, "_meth_830C" }, + { 0x830D, "_meth_830D" }, + { 0x830E, "_meth_830E" }, + { 0x830F, "_meth_830F" }, + { 0x8310, "_meth_8310" }, + { 0x8311, "_meth_8311" }, + { 0x8312, "_meth_8312" }, + { 0x8313, "_meth_8313" }, + { 0x8314, "_meth_8314" }, + { 0x8315, "_meth_8315" }, + { 0x8316, "_meth_8316" }, + { 0x8317, "_meth_8317" }, + { 0x8318, "_meth_8318" }, + { 0x8319, "_meth_8319" }, + { 0x831A, "_meth_831A" }, + { 0x831B, "_meth_831B" }, + { 0x831C, "_meth_831C" }, + { 0x831D, "_meth_831D" }, + { 0x831E, "_meth_831E" }, + { 0x831F, "_meth_831F" }, + { 0x8320, "_meth_8320" }, + { 0x8321, "_meth_8321" }, + { 0x8322, "_meth_8322" }, + { 0x8323, "_meth_8323" }, + { 0x8324, "_meth_8324" }, + { 0x8325, "_meth_8325" }, + { 0x8326, "_meth_8326" }, + { 0x8327, "_meth_8327" }, + { 0x8328, "_meth_8328" }, + { 0x8329, "_meth_8329" }, + { 0x832A, "_meth_832A" }, + { 0x832B, "_meth_832B" }, + { 0x832C, "_meth_832C" }, + { 0x832D, "_meth_832D" }, + { 0x832E, "_meth_832E" }, + { 0x832F, "_meth_832F" }, + { 0x8330, "_meth_8330" }, + { 0x8331, "_meth_8331" }, + { 0x8332, "_meth_8332" }, + { 0x8333, "_meth_8333" }, + { 0x8334, "_meth_8334" }, + { 0x8335, "_meth_8335" }, + { 0x8336, "_meth_8336" }, + { 0x8337, "_meth_8337" }, + { 0x8338, "_meth_8338" }, + { 0x8339, "_meth_8339" }, + { 0x833A, "_meth_833A" }, + { 0x833B, "_meth_833B" }, + { 0x833C, "_meth_833C" }, + { 0x833D, "_meth_833D" }, + { 0x833E, "_meth_833E" }, + { 0x833F, "_meth_833F" }, + { 0x8340, "_meth_8340" }, + { 0x8341, "_meth_8341" }, + { 0x8342, "_meth_8342" }, + { 0x8343, "_meth_8343" }, + { 0x8344, "_meth_8344" }, + { 0x8345, "_meth_8345" }, + { 0x8346, "_meth_8346" }, + { 0x8347, "_meth_8347" }, + { 0x8348, "_meth_8348" }, + { 0x8349, "_meth_8349" }, + { 0x834A, "_meth_834A" }, + { 0x834B, "_meth_834B" }, + { 0x834C, "_meth_834C" }, + { 0x834D, "_meth_834D" }, + { 0x834E, "_meth_834E" }, + { 0x834F, "_meth_834F" }, + { 0x8350, "_meth_8350" }, + { 0x8351, "_meth_8351" }, + { 0x8352, "_meth_8352" }, + { 0x8353, "_meth_8353" }, + { 0x8354, "_meth_8354" }, + { 0x8355, "_meth_8355" }, + { 0x8356, "_meth_8356" }, + { 0x8357, "_meth_8357" }, + { 0x8358, "_meth_8358" }, + { 0x8359, "_meth_8359" }, + { 0x835A, "_meth_835A" }, + { 0x835B, "_meth_835B" }, + { 0x835C, "_meth_835C" }, + { 0x835D, "_meth_835D" }, + { 0x835E, "_meth_835E" }, + { 0x835F, "_meth_835F" }, + { 0x8360, "_meth_8360" }, + { 0x8361, "_meth_8361" }, + { 0x8362, "_meth_8362" }, + { 0x8363, "_meth_8363" }, + { 0x8364, "_meth_8364" }, + { 0x8365, "_meth_8365" }, + { 0x8366, "_meth_8366" }, + { 0x8367, "_meth_8367" }, + { 0x8368, "_meth_8368" }, + { 0x8369, "_meth_8369" }, + { 0x836A, "_meth_836A" }, + { 0x836B, "_meth_836B" }, + { 0x836C, "_meth_836C" }, + { 0x836D, "_meth_836D" }, + { 0x836E, "_meth_836E" }, + { 0x836F, "_meth_836F" }, + { 0x8370, "_meth_8370" }, + { 0x8371, "_meth_8371" }, + { 0x8372, "_meth_8372" }, + { 0x8373, "_meth_8373" }, + { 0x8374, "_meth_8374" }, + { 0x8375, "_meth_8375" }, + { 0x8376, "_meth_8376" }, + { 0x8377, "_meth_8377" }, + { 0x8378, "_meth_8378" }, + { 0x8379, "_meth_8379" }, + { 0x837A, "_meth_837A" }, + { 0x837B, "_meth_837B" }, + { 0x837C, "_meth_837C" }, + { 0x837D, "_meth_837D" }, + { 0x837E, "_meth_837E" }, + { 0x837F, "_meth_837F" }, + { 0x8380, "_meth_8380" }, + { 0x8381, "_meth_8381" }, + { 0x8382, "_meth_8382" }, + { 0x8383, "_meth_8383" }, + { 0x8384, "_meth_8384" }, + { 0x8385, "_meth_8385" }, + { 0x8386, "_meth_8386" }, + { 0x8387, "_meth_8387" }, + { 0x8388, "_meth_8388" }, + { 0x8389, "_meth_8389" }, + { 0x838A, "_meth_838A" }, + { 0x838B, "_meth_838B" }, + { 0x838C, "_meth_838C" }, + { 0x838D, "_meth_838D" }, + { 0x838E, "_meth_838E" }, + { 0x838F, "_meth_838F" }, + { 0x8390, "_meth_8390" }, + { 0x8391, "_meth_8391" }, + { 0x8392, "_meth_8392" }, + { 0x8393, "_meth_8393" }, + { 0x8394, "_meth_8394" }, + { 0x8395, "_meth_8395" }, + { 0x8396, "_meth_8396" }, + { 0x8397, "_meth_8397" }, + { 0x8398, "_meth_8398" }, + { 0x8399, "_meth_8399" }, + { 0x839A, "_meth_839A" }, + { 0x839B, "_meth_839B" }, + { 0x839C, "_meth_839C" }, + { 0x839D, "_meth_839D" }, + { 0x839E, "_meth_839E" }, + { 0x839F, "_meth_839F" }, + { 0x83A0, "_meth_83A0" }, + { 0x83A1, "_meth_83A1" }, + { 0x83A2, "_meth_83A2" }, + { 0x83A3, "_meth_83A3" }, + { 0x83A4, "_meth_83A4" }, + { 0x83A5, "_meth_83A5" }, + { 0x83A6, "_meth_83A6" }, + { 0x83A7, "_meth_83A7" }, + { 0x83A8, "_meth_83A8" }, + { 0x83A9, "_meth_83A9" }, + { 0x83AA, "_meth_83AA" }, + { 0x83AB, "_meth_83AB" }, + { 0x83AC, "_meth_83AC" }, + { 0x83AD, "_meth_83AD" }, + { 0x83AE, "_meth_83AE" }, + { 0x83AF, "_meth_83AF" }, + { 0x83B0, "_meth_83B0" }, + { 0x83B1, "_meth_83B1" }, + { 0x83B2, "_meth_83B2" }, + { 0x83B3, "_meth_83B3" }, + { 0x83B4, "_meth_83B4" }, + { 0x83B5, "_meth_83B5" }, + { 0x83B6, "_meth_83B6" }, + { 0x83B7, "_meth_83B7" }, + { 0x83B8, "_meth_83B8" }, + { 0x83B9, "_meth_83B9" }, + { 0x83BA, "_meth_83BA" }, + { 0x83BB, "_meth_83BB" }, + { 0x83BC, "_meth_83BC" }, + { 0x83BD, "_meth_83BD" }, + { 0x83BE, "_meth_83BE" }, + { 0x83BF, "_meth_83BF" }, + { 0x83C0, "_meth_83C0" }, + { 0x83C1, "_meth_83C1" }, + { 0x83C2, "_meth_83C2" }, + { 0x83C3, "_meth_83C3" }, + { 0x83C4, "_meth_83C4" }, + { 0x83C5, "_meth_83C5" }, + { 0x83C6, "_meth_83C6" }, + { 0x83C7, "_meth_83C7" }, + { 0x83C8, "_meth_83C8" }, + { 0x83C9, "_meth_83C9" }, + { 0x83CA, "_meth_83CA" }, + { 0x83CB, "_meth_83CB" }, + { 0x83CC, "_meth_83CC" }, + { 0x83CD, "_meth_83CD" }, + { 0x83CE, "_meth_83CE" }, + { 0x83CF, "_meth_83CF" }, + { 0x83D0, "_meth_83D0" }, + { 0x83D1, "_meth_83D1" }, + { 0x83D2, "_meth_83D2" }, + { 0x83D3, "_meth_83D3" }, + { 0x83D4, "_meth_83D4" }, + { 0x83D5, "_meth_83D5" }, + { 0x83D6, "_meth_83D6" }, + { 0x83D7, "_meth_83D7" }, + { 0x83D8, "_meth_83D8" }, + { 0x83D9, "_meth_83D9" }, + { 0x83DA, "_meth_83DA" }, + { 0x83DB, "_meth_83DB" }, + { 0x83DC, "_meth_83DC" }, + { 0x83DD, "_meth_83DD" }, + { 0x83DE, "_meth_83DE" }, + { 0x83DF, "_meth_83DF" }, + { 0x83E0, "_meth_83E0" }, + { 0x83E1, "_meth_83E1" }, + { 0x83E2, "_meth_83E2" }, + { 0x83E3, "_meth_83E3" }, + { 0x83E4, "_meth_83E4" }, + { 0x83E5, "_meth_83E5" }, + { 0x83E6, "_meth_83E6" }, + { 0x83E7, "_meth_83E7" }, + { 0x83E8, "_meth_83E8" }, + { 0x83E9, "_meth_83E9" }, + { 0x83EA, "_meth_83EA" }, + { 0x83EB, "_meth_83EB" }, + { 0x83EC, "_meth_83EC" }, + { 0x83ED, "_meth_83ED" }, + { 0x83EE, "_meth_83EE" }, + { 0x83EF, "_meth_83EF" }, + { 0x83F0, "_meth_83F0" }, + { 0x83F1, "_meth_83F1" }, + { 0x83F2, "_meth_83F2" }, + { 0x83F3, "_meth_83F3" }, + { 0x83F4, "_meth_83F4" }, + { 0x83F5, "_meth_83F5" }, + { 0x83F6, "_meth_83F6" }, + { 0x83F7, "_meth_83F7" }, + { 0x83F8, "_meth_83F8" }, + { 0x83F9, "_meth_83F9" }, + { 0x83FA, "_meth_83FA" }, + { 0x83FB, "_meth_83FB" }, + { 0x83FC, "_meth_83FC" }, + { 0x83FD, "_meth_83FD" }, + { 0x83FE, "_meth_83FE" }, + { 0x83FF, "_meth_83FF" }, + { 0x8400, "_meth_8400" }, + { 0x8401, "_meth_8401" }, + { 0x8402, "_meth_8402" }, + { 0x8403, "_meth_8403" }, + { 0x8404, "_meth_8404" }, + { 0x8405, "_meth_8405" }, + { 0x8406, "_meth_8406" }, + { 0x8407, "_meth_8407" }, + { 0x8408, "_meth_8408" }, + { 0x8409, "_meth_8409" }, + { 0x840A, "_meth_840A" }, + { 0x840B, "_meth_840B" }, + { 0x840C, "_meth_840C" }, + { 0x840D, "_meth_840D" }, + { 0x840E, "_meth_840E" }, + { 0x840F, "_meth_840F" }, + { 0x8410, "_meth_8410" }, + { 0x8411, "_meth_8411" }, + { 0x8412, "_meth_8412" }, + { 0x8413, "_meth_8413" }, + { 0x8414, "_meth_8414" }, + { 0x8415, "_meth_8415" }, + { 0x8416, "_meth_8416" }, + { 0x8417, "_meth_8417" }, + { 0x8418, "_meth_8418" }, + { 0x8419, "_meth_8419" }, + { 0x841A, "_meth_841A" }, + { 0x841B, "_meth_841B" }, + { 0x841C, "_meth_841C" }, + { 0x841D, "_meth_841D" }, + { 0x841E, "_meth_841E" }, + { 0x841F, "_meth_841F" }, + { 0x8420, "_meth_8420" }, + { 0x8421, "_meth_8421" }, + { 0x8422, "_meth_8422" }, + { 0x8423, "_meth_8423" }, + { 0x8424, "_meth_8424" }, + { 0x8425, "_meth_8425" }, + { 0x8426, "_meth_8426" }, + { 0x8427, "_meth_8427" }, + { 0x8428, "_meth_8428" }, + { 0x8429, "_meth_8429" }, + { 0x842A, "_meth_842A" }, + { 0x842B, "_meth_842B" }, + { 0x842C, "_meth_842C" }, + { 0x842D, "_meth_842D" }, + { 0x842E, "_meth_842E" }, + { 0x842F, "_meth_842F" }, + { 0x8430, "_meth_8430" }, + { 0x8431, "_meth_8431" }, + { 0x8432, "_meth_8432" }, + { 0x8433, "_meth_8433" }, + { 0x8434, "_meth_8434" }, + { 0x8435, "_meth_8435" }, + { 0x8436, "_meth_8436" }, + { 0x8437, "_meth_8437" }, + { 0x8438, "_meth_8438" }, + { 0x8439, "_meth_8439" }, + { 0x843A, "_meth_843A" }, + { 0x843B, "_meth_843B" }, + { 0x843C, "_meth_843C" }, + { 0x843D, "_meth_843D" }, + { 0x843E, "_meth_843E" }, + { 0x843F, "_meth_843F" }, + { 0x8440, "_meth_8440" }, + { 0x8441, "_meth_8441" }, + { 0x8442, "_meth_8442" }, + { 0x8443, "_meth_8443" }, + { 0x8444, "_meth_8444" }, + { 0x8445, "_meth_8445" }, + { 0x8446, "_meth_8446" }, + { 0x8447, "_meth_8447" }, + { 0x8448, "_meth_8448" }, + { 0x8449, "_meth_8449" }, + { 0x844A, "_meth_844A" }, + { 0x844B, "_meth_844B" }, + { 0x844C, "_meth_844C" }, + { 0x844D, "_meth_844D" }, + { 0x844E, "_meth_844E" }, + { 0x844F, "_meth_844F" }, + { 0x8450, "_meth_8450" }, + { 0x8451, "_meth_8451" }, + { 0x8452, "_meth_8452" }, + { 0x8453, "_meth_8453" }, + { 0x8454, "_meth_8454" }, + { 0x8455, "_meth_8455" }, + { 0x8456, "_meth_8456" }, + { 0x8457, "_meth_8457" }, + { 0x8458, "_meth_8458" }, + { 0x8459, "_meth_8459" }, + { 0x845A, "_meth_845A" }, + { 0x845B, "_meth_845B" }, + { 0x845C, "_meth_845C" }, + { 0x845D, "_meth_845D" }, + { 0x845E, "_meth_845E" }, + { 0x845F, "_meth_845F" }, + { 0x8460, "_meth_8460" }, + { 0x8461, "_meth_8461" }, + { 0x8462, "_meth_8462" }, + { 0x8463, "_meth_8463" }, + { 0x8464, "_meth_8464" }, + { 0x8465, "_meth_8465" }, + { 0x8466, "_meth_8466" }, + { 0x8467, "_meth_8467" }, + { 0x8468, "_meth_8468" }, + { 0x8469, "_meth_8469" }, + { 0x846A, "_meth_846A" }, + { 0x846B, "_meth_846B" }, + { 0x846C, "_meth_846C" }, + { 0x846D, "_meth_846D" }, + { 0x846E, "_meth_846E" }, + { 0x846F, "_meth_846F" }, + { 0x8470, "_meth_8470" }, + { 0x8471, "_meth_8471" }, + { 0x8472, "_meth_8472" }, + { 0x8473, "_meth_8473" }, + { 0x8474, "_meth_8474" }, + { 0x8475, "_meth_8475" }, + { 0x8476, "_meth_8476" }, + { 0x8477, "_meth_8477" }, + { 0x8478, "_meth_8478" }, + { 0x8479, "_meth_8479" }, + { 0x847A, "_meth_847A" }, + { 0x847B, "_meth_847B" }, + { 0x847C, "_meth_847C" }, + { 0x847D, "_meth_847D" }, + { 0x847E, "_meth_847E" }, + { 0x847F, "_meth_847F" }, + { 0x8480, "_meth_8480" }, + { 0x8481, "_meth_8481" }, + { 0x8482, "_meth_8482" }, + { 0x8483, "_meth_8483" }, + { 0x8484, "_meth_8484" }, + { 0x8485, "_meth_8485" }, + { 0x8486, "_meth_8486" }, + { 0x8487, "_meth_8487" }, + { 0x8488, "_meth_8488" }, + { 0x8489, "_meth_8489" }, + { 0x848A, "_meth_848A" }, + { 0x848B, "_meth_848B" }, + { 0x848C, "_meth_848C" }, + { 0x848D, "_meth_848D" }, + { 0x848E, "_meth_848E" }, + { 0x848F, "_meth_848F" }, + { 0x8490, "_meth_8490" }, + { 0x8491, "_meth_8491" }, + { 0x8492, "_meth_8492" }, + { 0x8493, "_meth_8493" }, + { 0x8494, "_meth_8494" }, + { 0x8495, "_meth_8495" }, + { 0x8496, "_meth_8496" }, + { 0x8497, "_meth_8497" }, + { 0x8498, "_meth_8498" }, + { 0x8499, "_meth_8499" }, + { 0x849A, "_meth_849A" }, + { 0x849B, "_meth_849B" }, + { 0x849C, "_meth_849C" }, + { 0x849D, "_meth_849D" }, + { 0x849E, "_meth_849E" }, + { 0x849F, "_meth_849F" }, + { 0x84A0, "_meth_84A0" }, + { 0x84A1, "_meth_84A1" }, + { 0x84A2, "_meth_84A2" }, + { 0x84A3, "_meth_84A3" }, + { 0x84A4, "_meth_84A4" }, + { 0x84A5, "_meth_84A5" }, + { 0x84A6, "_meth_84A6" }, + { 0x84A7, "_meth_84A7" }, + { 0x84A8, "_meth_84A8" }, + { 0x84A9, "_meth_84A9" }, + { 0x84AA, "_meth_84AA" }, + { 0x84AB, "_meth_84AB" }, + { 0x84AC, "_meth_84AC" }, + { 0x84AD, "_meth_84AD" }, + { 0x84AE, "_meth_84AE" }, + { 0x84AF, "_meth_84AF" }, + { 0x84B0, "_meth_84B0" }, + { 0x84B1, "_meth_84B1" }, + { 0x84B2, "_meth_84B2" }, + { 0x84B3, "_meth_84B3" }, + { 0x84B4, "_meth_84B4" }, + { 0x84B5, "_meth_84B5" }, + { 0x84B6, "_meth_84B6" }, + { 0x84B7, "_meth_84B7" }, + { 0x84B8, "_meth_84B8" }, + { 0x84B9, "_meth_84B9" }, + { 0x84BA, "_meth_84BA" }, + { 0x84BB, "_meth_84BB" }, + { 0x84BC, "_meth_84BC" }, + { 0x84BD, "_meth_84BD" }, + { 0x84BE, "_meth_84BE" }, + { 0x84BF, "_meth_84BF" }, + { 0x84C0, "_meth_84C0" }, + { 0x84C1, "_meth_84C1" }, + { 0x84C2, "_meth_84C2" }, + { 0x84C3, "_meth_84C3" }, + { 0x84C4, "_meth_84C4" }, + { 0x84C5, "_meth_84C5" }, + { 0x84C6, "_meth_84C6" }, + { 0x84C7, "_meth_84C7" }, + { 0x84C8, "_meth_84C8" }, + { 0x84C9, "_meth_84C9" }, + { 0x84CA, "_meth_84CA" }, + { 0x84CB, "_meth_84CB" }, + { 0x84CC, "_meth_84CC" }, + { 0x84CD, "_meth_84CD" }, + { 0x84CE, "_meth_84CE" }, + { 0x84CF, "_meth_84CF" }, + { 0x84D0, "_meth_84D0" }, + { 0x84D1, "_meth_84D1" }, + { 0x84D2, "_meth_84D2" }, + { 0x84D3, "_meth_84D3" }, + { 0x84D4, "_meth_84D4" }, + { 0x84D5, "_meth_84D5" }, + { 0x84D6, "_meth_84D6" }, + { 0x84D7, "_meth_84D7" }, + { 0x84D8, "_meth_84D8" }, + { 0x84D9, "_meth_84D9" }, + { 0x84DA, "_meth_84DA" }, + { 0x84DB, "_meth_84DB" }, + { 0x84DC, "_meth_84DC" }, + { 0x84DD, "_meth_84DD" }, + { 0x84DE, "_meth_84DE" }, + { 0x84DF, "_meth_84DF" }, + { 0x84E0, "_meth_84E0" }, + { 0x84E1, "_meth_84E1" }, + { 0x84E2, "_meth_84E2" }, + { 0x84E3, "_meth_84E3" }, + { 0x84E4, "_meth_84E4" }, + { 0x84E5, "_meth_84E5" }, + { 0x84E6, "_meth_84E6" }, + { 0x84E7, "_meth_84E7" }, + { 0x84E8, "_meth_84E8" }, + { 0x84E9, "_meth_84E9" }, + { 0x84EA, "_meth_84EA" }, + { 0x84EB, "_meth_84EB" }, + { 0x84EC, "_meth_84EC" }, + { 0x84ED, "_meth_84ED" }, + { 0x84EE, "_meth_84EE" }, + { 0x84EF, "_meth_84EF" }, + { 0x84F0, "_meth_84F0" }, + { 0x84F1, "_meth_84F1" }, + { 0x84F2, "_meth_84F2" }, + { 0x84F3, "_meth_84F3" }, + { 0x84F4, "_meth_84F4" }, + { 0x84F5, "_meth_84F5" }, + { 0x84F6, "_meth_84F6" }, + { 0x84F7, "_meth_84F7" }, + { 0x84F8, "_meth_84F8" }, + { 0x84F9, "_meth_84F9" }, + { 0x84FA, "_meth_84FA" }, + { 0x84FB, "_meth_84FB" }, + { 0x84FC, "_meth_84FC" }, + { 0x84FD, "_meth_84FD" }, + { 0x84FE, "_meth_84FE" }, + { 0x84FF, "_meth_84FF" }, + { 0x8500, "_meth_8500" }, + { 0x8501, "_meth_8501" }, + { 0x8502, "_meth_8502" }, + { 0x8503, "_meth_8503" }, + { 0x8504, "_meth_8504" }, + { 0x8505, "_meth_8505" }, + { 0x8506, "_meth_8506" }, + { 0x8507, "_meth_8507" }, + { 0x8508, "_meth_8508" }, + { 0x8509, "_meth_8509" }, + { 0x850A, "_meth_850A" }, + { 0x850B, "_meth_850B" }, + { 0x850C, "_meth_850C" }, + { 0x850D, "_meth_850D" }, + { 0x850E, "_meth_850E" }, + { 0x850F, "_meth_850F" }, + { 0x8510, "_meth_8510" }, + { 0x8511, "_meth_8511" }, + { 0x8512, "_meth_8512" }, + { 0x8513, "_meth_8513" }, + { 0x8514, "_meth_8514" }, + { 0x8515, "_meth_8515" }, + { 0x8516, "_meth_8516" }, + { 0x8517, "_meth_8517" }, + { 0x8518, "_meth_8518" }, + { 0x8519, "_meth_8519" }, + { 0x851A, "_meth_851A" }, + { 0x851B, "_meth_851B" }, + { 0x851C, "_meth_851C" }, + { 0x851D, "_meth_851D" }, + { 0x851E, "_meth_851E" }, + { 0x851F, "_meth_851F" }, + { 0x8520, "_meth_8520" }, + { 0x8521, "_meth_8521" }, + { 0x8522, "_meth_8522" }, + { 0x8523, "_meth_8523" }, + { 0x8524, "_meth_8524" }, + { 0x8525, "_meth_8525" }, + { 0x8526, "_meth_8526" }, + { 0x8527, "_meth_8527" }, + { 0x8528, "_meth_8528" }, + { 0x8529, "_meth_8529" }, + { 0x852A, "_meth_852A" }, + { 0x852B, "_meth_852B" }, + { 0x852C, "_meth_852C" }, + { 0x852D, "_meth_852D" }, + { 0x852E, "_meth_852E" }, + { 0x852F, "_meth_852F" }, + { 0x8530, "_meth_8530" }, + { 0x8531, "_meth_8531" }, + { 0x8532, "_meth_8532" }, + { 0x8533, "_meth_8533" }, + { 0x8534, "_meth_8534" }, + { 0x8535, "_meth_8535" }, + { 0x8536, "_meth_8536" }, + { 0x8537, "_meth_8537" }, + { 0x8538, "_meth_8538" }, + { 0x8539, "_meth_8539" }, + { 0x853A, "_meth_853A" }, + { 0x853B, "_meth_853B" }, + { 0x853C, "_meth_853C" }, + { 0x853D, "_meth_853D" }, + { 0x853E, "_meth_853E" }, + { 0x853F, "_meth_853F" }, + { 0x8540, "_meth_8540" }, + { 0x8541, "_meth_8541" }, + { 0x8542, "_meth_8542" }, + { 0x8543, "_meth_8543" }, + { 0x8544, "_meth_8544" }, + { 0x8545, "_meth_8545" }, + { 0x8546, "_meth_8546" }, + { 0x8547, "_meth_8547" }, + { 0x8548, "_meth_8548" }, + { 0x8549, "_meth_8549" }, + { 0x854A, "_meth_854A" }, + { 0x854B, "_meth_854B" }, + { 0x854C, "_meth_854C" }, + { 0x854D, "_meth_854D" }, + { 0x854E, "_meth_854E" }, + { 0x854F, "_meth_854F" }, + { 0x8550, "_meth_8550" }, + { 0x8551, "_meth_8551" }, + { 0x8552, "_meth_8552" }, + { 0x8553, "_meth_8553" }, + { 0x8554, "_meth_8554" }, + { 0x8555, "_meth_8555" }, + { 0x8556, "_meth_8556" }, + { 0x8557, "_meth_8557" }, + { 0x8558, "_meth_8558" }, + { 0x8559, "_meth_8559" }, + { 0x855A, "_meth_855A" }, + { 0x855B, "_meth_855B" }, + { 0x855C, "_meth_855C" }, + { 0x855D, "_meth_855D" }, + { 0x855E, "_meth_855E" }, + { 0x855F, "_meth_855F" }, + { 0x8560, "_meth_8560" }, + { 0x8561, "_meth_8561" }, + { 0x8562, "_meth_8562" }, + { 0x8563, "_meth_8563" }, + { 0x8564, "_meth_8564" }, + { 0x8565, "_meth_8565" }, + { 0x8566, "_meth_8566" }, + { 0x8567, "_meth_8567" }, + { 0x8568, "_meth_8568" }, + { 0x8569, "_meth_8569" }, + { 0x856A, "_meth_856A" }, + { 0x856B, "_meth_856B" }, + { 0x856C, "_meth_856C" }, + { 0x856D, "_meth_856D" }, + { 0x856E, "_meth_856E" }, + { 0x856F, "_meth_856F" }, + { 0x8570, "_meth_8570" }, + { 0x8571, "_meth_8571" }, + { 0x8572, "_meth_8572" }, + { 0x8573, "_meth_8573" }, + { 0x8574, "_meth_8574" }, + { 0x8575, "_meth_8575" }, + { 0x8576, "_meth_8576" }, + { 0x8577, "_meth_8577" }, + { 0x8578, "_meth_8578" }, + { 0x8579, "_meth_8579" }, + { 0x857A, "_meth_857A" }, + { 0x857B, "_meth_857B" }, + { 0x857C, "_meth_857C" }, + { 0x857D, "_meth_857D" }, + { 0x857E, "_meth_857E" }, + { 0x857F, "_meth_857F" }, + { 0x8580, "_meth_8580" }, + { 0x8581, "_meth_8581" }, + { 0x8582, "_meth_8582" }, + { 0x8583, "_meth_8583" }, + { 0x8584, "_meth_8584" }, + { 0x8585, "_meth_8585" }, + { 0x8586, "_meth_8586" }, + { 0x8587, "_meth_8587" }, + { 0x8588, "_meth_8588" }, + { 0x8589, "_meth_8589" }, + { 0x858A, "_meth_858A" }, + { 0x858B, "_meth_858B" }, + { 0x858C, "_meth_858C" }, + { 0x858D, "_meth_858D" }, + { 0x858E, "_meth_858E" }, + { 0x858F, "_meth_858F" }, + { 0x8590, "_meth_8590" }, + { 0x8591, "_meth_8591" }, + { 0x8592, "_meth_8592" }, + { 0x8593, "_meth_8593" }, + { 0x8594, "_meth_8594" }, + { 0x8595, "_meth_8595" }, + { 0x8596, "_meth_8596" }, + { 0x8597, "_meth_8597" }, + { 0x8598, "_meth_8598" }, + { 0x8599, "_meth_8599" }, + { 0x859A, "_meth_859A" }, + { 0x859B, "_meth_859B" }, + { 0x859C, "_meth_859C" }, + { 0x859D, "_meth_859D" }, + { 0x859E, "_meth_859E" }, + { 0x859F, "_meth_859F" }, + { 0x85A0, "_meth_85A0" }, + { 0x85A1, "_meth_85A1" }, + { 0x85A2, "_meth_85A2" }, + { 0x85A3, "_meth_85A3" }, + { 0x85A4, "_meth_85A4" }, + { 0x85A5, "_meth_85A5" }, + { 0x85A6, "_meth_85A6" }, + { 0x85A7, "_meth_85A7" }, + { 0x85A8, "_meth_85A8" }, + { 0x85A9, "_meth_85A9" }, + { 0x85AA, "_meth_85AA" }, + { 0x85AB, "_meth_85AB" }, + { 0x85AC, "_meth_85AC" }, + { 0x85AD, "_meth_85AD" }, + { 0x85AE, "_meth_85AE" }, + { 0x85AF, "_meth_85AF" }, + { 0x85B0, "_meth_85B0" }, + { 0x85B1, "_meth_85B1" }, + { 0x85B2, "_meth_85B2" }, + { 0x85B3, "_meth_85B3" }, + { 0x85B4, "_meth_85B4" }, + { 0x85B5, "_meth_85B5" }, + { 0x85B6, "_meth_85B6" }, + { 0x85B7, "_meth_85B7" }, + { 0x85B8, "_meth_85B8" }, + { 0x85B9, "_meth_85B9" }, + { 0x85BA, "_meth_85BA" }, + { 0x85BB, "_meth_85BB" }, + { 0x85BC, "_meth_85BC" }, + { 0x85BD, "_meth_85BD" }, + { 0x85BE, "_meth_85BE" }, + { 0x85BF, "_meth_85BF" }, + { 0x85C0, "_meth_85C0" }, + { 0x85C1, "_meth_85C1" }, + { 0x85C2, "_meth_85C2" }, + { 0x85C3, "_meth_85C3" }, + { 0x85C4, "_meth_85C4" }, + { 0x85C5, "_meth_85C5" }, + { 0x85C6, "_meth_85C6" }, + { 0x85C7, "_meth_85C7" }, + { 0x85C8, "_meth_85C8" }, + { 0x85C9, "_meth_85C9" }, + { 0x85CA, "_meth_85CA" }, + { 0x85CB, "_meth_85CB" }, + { 0x85CC, "_meth_85CC" }, + { 0x85CD, "_meth_85CD" }, + { 0x85CE, "_meth_85CE" }, + { 0x85CF, "_meth_85CF" }, + { 0x85D0, "_meth_85D0" }, + { 0x85D1, "_meth_85D1" }, + { 0x85D2, "_meth_85D2" }, + { 0x85D3, "_meth_85D3" }, + { 0x85D4, "_meth_85D4" }, + { 0x85D5, "_meth_85D5" }, + { 0x85D6, "_meth_85D6" }, + { 0x85D7, "_meth_85D7" }, + { 0x85D8, "_meth_85D8" }, + { 0x85D9, "_meth_85D9" }, + { 0x85DA, "_meth_85DA" }, + { 0x85DB, "_meth_85DB" }, + { 0x85DC, "_meth_85DC" }, + { 0x85DD, "_meth_85DD" }, + { 0x85DE, "_meth_85DE" }, + { 0x85DF, "_meth_85DF" }, + { 0x85E0, "_meth_85E0" }, + { 0x85E1, "_meth_85E1" }, + { 0x85E2, "_meth_85E2" }, + { 0x85E3, "_meth_85E3" }, + { 0x85E4, "_meth_85E4" }, + { 0x85E5, "_meth_85E5" }, + { 0x85E6, "_meth_85E6" }, + { 0x85E7, "_meth_85E7" }, + { 0x85E8, "_meth_85E8" }, + { 0x85E9, "_meth_85E9" }, + { 0x85EA, "_meth_85EA" }, + { 0x85EB, "_meth_85EB" }, + { 0x85EC, "_meth_85EC" }, + { 0x85ED, "_meth_85ED" }, + { 0x85EE, "_meth_85EE" }, + { 0x85EF, "_meth_85EF" }, + { 0x85F0, "_meth_85F0" }, + { 0x85F1, "_meth_85F1" }, + { 0x85F2, "_meth_85F2" }, + { 0x85F3, "_meth_85F3" }, + { 0x85F4, "_meth_85F4" }, + { 0x85F5, "_meth_85F5" }, + { 0x85F6, "_meth_85F6" }, + { 0x85F7, "_meth_85F7" }, + { 0x85F8, "_meth_85F8" }, + { 0x85F9, "_meth_85F9" }, + { 0x85FA, "_meth_85FA" }, + { 0x85FB, "_meth_85FB" }, + { 0x85FC, "_meth_85FC" }, + { 0x85FD, "_meth_85FD" }, + { 0x85FE, "_meth_85FE" }, + { 0x85FF, "_meth_85FF" }, + { 0x8600, "_meth_8600" }, + { 0x8601, "_meth_8601" }, + { 0x8602, "_meth_8602" }, + { 0x8603, "_meth_8603" }, + { 0x8604, "_meth_8604" }, + { 0x8605, "_meth_8605" }, + { 0x8606, "_meth_8606" }, + { 0x8607, "_meth_8607" }, + { 0x8608, "_meth_8608" }, + { 0x8609, "_meth_8609" }, + { 0x860A, "_meth_860A" }, + { 0x860B, "_meth_860B" }, + { 0x860C, "_meth_860C" }, + { 0x860D, "_meth_860D" }, + { 0x860E, "_meth_860E" }, + { 0x860F, "_meth_860F" }, + { 0x8610, "_meth_8610" }, + { 0x8611, "_meth_8611" }, + { 0x8612, "_meth_8612" }, + { 0x8613, "_meth_8613" }, + { 0x8614, "_meth_8614" }, + { 0x8615, "_meth_8615" }, + { 0x8616, "_meth_8616" }, + { 0x8617, "_meth_8617" }, + { 0x8618, "_meth_8618" }, + { 0x8619, "_meth_8619" }, + { 0x861A, "_meth_861A" }, + { 0x861B, "_meth_861B" }, + { 0x861C, "_meth_861C" }, + { 0x861D, "_meth_861D" }, + { 0x861E, "_meth_861E" }, + { 0x861F, "_meth_861F" }, + { 0x8620, "_meth_8620" }, + { 0x8621, "_meth_8621" }, + { 0x8622, "_meth_8622" }, + { 0x8623, "_meth_8623" }, + { 0x8624, "_meth_8624" }, + { 0x8625, "_meth_8625" }, + { 0x8626, "_meth_8626" }, + { 0x8627, "_meth_8627" }, + { 0x8628, "_meth_8628" }, + { 0x8629, "_meth_8629" }, + { 0x862A, "_meth_862A" }, + { 0x862B, "_meth_862B" }, + { 0x862C, "_meth_862C" }, + { 0x862D, "_meth_862D" }, + { 0x862E, "_meth_862E" }, + { 0x862F, "_meth_862F" }, + { 0x8630, "_meth_8630" }, + { 0x8631, "_meth_8631" }, + { 0x8632, "_meth_8632" }, + { 0x8633, "_meth_8633" }, + { 0x8634, "_meth_8634" }, + { 0x8635, "_meth_8635" }, + { 0x8636, "_meth_8636" }, + { 0x8637, "_meth_8637" }, + { 0x8638, "_meth_8638" }, + { 0x8639, "_meth_8639" }, + { 0x863A, "_meth_863A" }, + { 0x863B, "_meth_863B" }, + { 0x863C, "_meth_863C" }, + { 0x863D, "_meth_863D" }, + { 0x863E, "_meth_863E" }, + { 0x863F, "_meth_863F" }, + { 0x8640, "_meth_8640" }, + { 0x8641, "_meth_8641" }, + { 0x8642, "_meth_8642" }, + { 0x8643, "_meth_8643" }, + { 0x8644, "_meth_8644" }, + { 0x8645, "_meth_8645" }, + { 0x8646, "_meth_8646" }, + { 0x8647, "_meth_8647" }, + { 0x8648, "_meth_8648" }, + { 0x8649, "_meth_8649" }, + { 0x864A, "_meth_864A" }, + { 0x864B, "_meth_864B" }, + { 0x864C, "_meth_864C" }, + { 0x864D, "_meth_864D" }, + { 0x864E, "_meth_864E" }, + { 0x864F, "_meth_864F" }, + { 0x8650, "_meth_8650" }, + { 0x8651, "_meth_8651" }, + { 0x8652, "_meth_8652" }, + { 0x8653, "_meth_8653" }, + { 0x8654, "_meth_8654" }, + { 0x8655, "_meth_8655" }, + { 0x8656, "_meth_8656" }, + { 0x8657, "_meth_8657" }, + { 0x8658, "_meth_8658" }, + { 0x8659, "_meth_8659" }, + { 0x865A, "_meth_865A" }, + { 0x865B, "_meth_865B" }, + { 0x865C, "_meth_865C" }, + { 0x865D, "_meth_865D" }, + { 0x865E, "_meth_865E" }, + { 0x865F, "_meth_865F" }, + { 0x8660, "_meth_8660" }, + { 0x8661, "_meth_8661" }, + { 0x8662, "_meth_8662" }, + { 0x8663, "_meth_8663" }, + { 0x8664, "_meth_8664" }, + { 0x8665, "_meth_8665" }, + { 0x8666, "_meth_8666" }, + { 0x8667, "_meth_8667" }, + { 0x8668, "_meth_8668" }, + { 0x8669, "_meth_8669" }, + { 0x866A, "_meth_866A" }, + { 0x866B, "_meth_866B" }, + { 0x866C, "_meth_866C" }, + { 0x866D, "_meth_866D" }, + { 0x866E, "_meth_866E" }, + { 0x866F, "_meth_866F" }, + { 0x8670, "_meth_8670" }, + { 0x8671, "_meth_8671" }, + { 0x8672, "_meth_8672" }, + { 0x8673, "_meth_8673" }, + { 0x8674, "_meth_8674" }, + { 0x8675, "_meth_8675" }, + { 0x8676, "_meth_8676" }, + { 0x8677, "_meth_8677" }, + { 0x8678, "_meth_8678" }, + { 0x8679, "_meth_8679" }, + { 0x867A, "_meth_867A" }, + { 0x867B, "_meth_867B" }, + { 0x867C, "_meth_867C" }, + { 0x867D, "_meth_867D" }, + { 0x867E, "_meth_867E" }, + { 0x867F, "_meth_867F" }, + { 0x8680, "_meth_8680" }, + { 0x8681, "_meth_8681" }, + { 0x8682, "_meth_8682" }, + { 0x8683, "_meth_8683" }, + { 0x8684, "_meth_8684" }, + { 0x8685, "_meth_8685" }, + { 0x8686, "_meth_8686" }, + { 0x8687, "_meth_8687" }, + { 0x8688, "_meth_8688" }, + { 0x8689, "_meth_8689" }, + { 0x868A, "_meth_868A" }, + { 0x868B, "_meth_868B" }, + { 0x868C, "_meth_868C" }, + { 0x868D, "_meth_868D" }, + { 0x868E, "_meth_868E" }, + { 0x868F, "_meth_868F" }, + { 0x8690, "_meth_8690" }, + { 0x8691, "_meth_8691" }, + { 0x8692, "_meth_8692" }, + { 0x8693, "_meth_8693" }, + { 0x8694, "_meth_8694" }, + { 0x8695, "_meth_8695" }, + { 0x8696, "_meth_8696" }, + { 0x8697, "_meth_8697" }, + { 0x8698, "_meth_8698" }, + { 0x8699, "_meth_8699" }, + { 0x869A, "_meth_869A" }, + { 0x869B, "_meth_869B" }, + { 0x869C, "_meth_869C" }, + { 0x869D, "_meth_869D" }, + { 0x869E, "_meth_869E" }, + { 0x869F, "_meth_869F" }, + { 0x86A0, "_meth_86A0" }, + { 0x86A1, "_meth_86A1" }, + { 0x86A2, "_meth_86A2" }, + { 0x86A3, "_meth_86A3" }, +}}; + +const std::array file_list +{{ + { 0, "DUMMY" }, +}}; + +const std::array token_list +{{ + { 0, "DUMMY" }, +}}; + +struct __init__ +{ + __init__() + { + static bool init = false; + if(init) return; + init = true; + + for(const auto& entry : opcode_list) + { + opcode_map.insert({ entry.key, entry.value }); + opcode_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : function_list) + { + function_map.insert({ entry.key, entry.value }); + function_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : method_list) + { + method_map.insert({ entry.key, entry.value }); + method_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : file_list) + { + file_map.insert({ entry.key, entry.value }); + file_map_rev.insert({ entry.value, entry.key }); + } + + for(const auto& entry : token_list) + { + token_map.insert({ entry.key, entry.value }); + token_map_rev.insert({ utils::string::to_lower(entry.value), entry.key }); + } + } +}; + +__init__ _; + +} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/resolver.hpp b/src/s2/xsk/resolver.hpp new file mode 100644 index 00000000..474a4cd4 --- /dev/null +++ b/src/s2/xsk/resolver.hpp @@ -0,0 +1,33 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::s2 +{ + +class resolver +{ +public: + static auto opcode_id(const std::string& name) -> std::uint8_t; + static auto opcode_name(std::uint8_t id) -> std::string; + + static auto function_id(const std::string& name) -> std::uint16_t; + static auto function_name(std::uint16_t id) -> std::string; + + static auto method_id(const std::string& name) -> std::uint16_t; + static auto method_name(std::uint16_t id) -> std::string; + + static auto file_id(const std::string& name) -> std::uint16_t; + static auto file_name(std::uint16_t id) -> std::string; + + static auto token_id(const std::string& name) -> std::uint16_t; + static auto token_name(std::uint16_t id) -> std::string; + + static auto find_function(const std::string& name) -> bool; + static auto find_method(const std::string& name) -> bool; +}; + +} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/s2.cpp b/src/s2/xsk/s2.cpp new file mode 100644 index 00000000..c21306b9 --- /dev/null +++ b/src/s2/xsk/s2.cpp @@ -0,0 +1,183 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "s2.hpp" + +namespace xsk::gsc::s2 +{ + +auto opcode_size(std::uint8_t id) -> std::uint32_t +{ + switch (opcode(id)) + { + case opcode::OP_Return: + case opcode::OP_BoolNot: + case opcode::OP_CastBool: + case opcode::OP_inequality: + case opcode::OP_GetThisthread: + case opcode::OP_ClearLocalVariableFieldCached0: + case opcode::OP_checkclearparams: + case opcode::OP_CastFieldObject: + case opcode::OP_End: + case opcode::OP_size: + case opcode::OP_EmptyArray: + case opcode::OP_bit_and: + case opcode::OP_less_equal: + case opcode::OP_voidCodepos: + case opcode::OP_ClearVariableField: + case opcode::OP_divide: + case opcode::OP_GetSelf: + case opcode::OP_SetLocalVariableFieldCached0: + case opcode::OP_plus: + case opcode::OP_BoolComplement: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_inc: + case opcode::OP_clearparams: + case opcode::OP_EvalLocalVariableRefCached0: + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_endon: + case opcode::OP_greater_equal: + case opcode::OP_GetSelfObject: + case opcode::OP_SetVariableField: + case opcode::OP_EvalLocalArrayRefCached0: + case opcode::OP_less: + case opcode::OP_GetGameRef: + case opcode::OP_waitFrame: + case opcode::OP_waittillFrameEnd: + case opcode::OP_SafeSetVariableFieldCached0: + case opcode::OP_GetLevel: + case opcode::OP_notify: + case opcode::OP_DecTop: + case opcode::OP_shift_left: + case opcode::OP_greater: + case opcode::OP_EvalLocalVariableCached0: + case opcode::OP_EvalLocalVariableCached1: + case opcode::OP_EvalLocalVariableCached2: + case opcode::OP_EvalLocalVariableCached3: + case opcode::OP_EvalLocalVariableCached4: + case opcode::OP_EvalLocalVariableCached5: + case opcode::OP_GetZero: + case opcode::OP_wait: + case opcode::OP_minus: + case opcode::OP_EvalNewLocalVariableRefCached0: + case opcode::OP_multiply: + case opcode::OP_mod: + case opcode::OP_GetGame: + case opcode::OP_waittill: + case opcode::OP_dec: + case opcode::OP_PreScriptCall: + case opcode::OP_GetAnim: + case opcode::OP_GetUndefined: + case opcode::OP_GetAnimObject: + case opcode::OP_GetLevelObject: + case opcode::OP_bit_ex_or: + case opcode::OP_equality: + case opcode::OP_ClearArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_EvalArray: + case opcode::OP_vector: + case opcode::OP_bit_or: + case opcode::OP_AddArray: + case opcode::OP_waittillmatch2: + case opcode::OP_shift_right: + case opcode::OP_BoolNotAfterAnd: + return 1; + case opcode::OP_SetNewLocalVariableFieldCached0: + case opcode::OP_EvalNewLocalArrayRefCached0: + case opcode::OP_CallBuiltinPointer: + case opcode::OP_SafeCreateVariableFieldCached: + case opcode::OP_ClearLocalVariableFieldCached: + case opcode::OP_ScriptMethodThreadCallPointer: + case opcode::OP_SetLocalVariableFieldCached: + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableRefCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_ScriptMethodChildThreadCallPointer: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalLocalVariableObjectCached: + case opcode::OP_GetNegByte: + case opcode::OP_CallBuiltinMethodPointer: + case opcode::OP_EvalLocalArrayCached: + case opcode::OP_GetByte: + case opcode::OP_ScriptChildThreadCallPointer: + case opcode::OP_GetAnimTree: + return 2; + case opcode::OP_EvalSelfFieldVariable: + case opcode::OP_SetLevelFieldVariableField: + case opcode::OP_ClearFieldVariable: + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_EvalLevelFieldVariable: + case opcode::OP_SetAnimFieldVariableField: + case opcode::OP_SetSelfFieldVariableField: + case opcode::OP_EvalAnimFieldVariableRef: + case opcode::OP_EvalLevelFieldVariableRef: + case opcode::OP_EvalAnimFieldVariable: + case opcode::OP_EvalSelfFieldVariableRef: + case opcode::OP_CallBuiltin0: + case opcode::OP_CallBuiltin1: + case opcode::OP_CallBuiltin2: + case opcode::OP_CallBuiltin3: + case opcode::OP_CallBuiltin4: + case opcode::OP_CallBuiltin5: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_GetUnsignedShort: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_GetBuiltinFunction: + case opcode::OP_jumpback: + case opcode::OP_GetBuiltinMethod: + case opcode::OP_waittillmatch: + case opcode::OP_GetNegUnsignedShort: + case opcode::OP_CallBuiltinMethod0: + case opcode::OP_CallBuiltinMethod1: + case opcode::OP_CallBuiltinMethod2: + case opcode::OP_CallBuiltinMethod3: + case opcode::OP_CallBuiltinMethod4: + case opcode::OP_CallBuiltinMethod5: + case opcode::OP_JumpOnFalse: + case opcode::OP_endswitch: + return 3; + case opcode::OP_CallBuiltin: + case opcode::OP_ScriptLocalMethodCall: + case opcode::OP_ScriptLocalFunctionCall2: + case opcode::OP_ScriptLocalFunctionCall: + case opcode::OP_GetLocalFunction: + case opcode::OP_CallBuiltinMethod: + case opcode::OP_ScriptFarFunctionCall2: + case opcode::OP_ScriptFarFunctionCall: + case opcode::OP_GetFarFunction: + case opcode::OP_ScriptFarMethodCall: + return 4; + case opcode::OP_ScriptFarMethodThreadCall: + case opcode::OP_ScriptFarChildThreadCall: + case opcode::OP_ScriptFarMethodChildThreadCall: + case opcode::OP_ScriptFarThreadCall: + case opcode::OP_GetFloat: + case opcode::OP_ScriptLocalThreadCall: + case opcode::OP_switch: + case opcode::OP_ScriptLocalMethodThreadCall: + case opcode::OP_ScriptLocalMethodChildThreadCall: + case opcode::OP_jump: + case opcode::OP_ScriptLocalChildThreadCall: + case opcode::OP_GetInteger: + case opcode::OP_GetString: + case opcode::OP_GetIString: + return 5; + case opcode::OP_GetAnimation: + return 9; + case opcode::OP_GetVector: + return 13; + default: + throw std::runtime_error("Couldn't resolve instruction size for " + std::to_string(id)); + } +} + +} // namespace xsk::gsc::s2 diff --git a/src/s2/xsk/s2.hpp b/src/s2/xsk/s2.hpp new file mode 100644 index 00000000..0b0927d9 --- /dev/null +++ b/src/s2/xsk/s2.hpp @@ -0,0 +1,181 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "utils/xsk/utils.hpp" + +#include "assembler.hpp" +#include "disassembler.hpp" +#include "compiler.hpp" +#include "decompiler.hpp" +#include "resolver.hpp" + +namespace xsk::gsc::s2 +{ + +enum class opcode : std::uint8_t +{ + OP_SetNewLocalVariableFieldCached0 = 0x17, + OP_EvalSelfFieldVariable = 0x18, + OP_Return = 0x19, + OP_CallBuiltin0 = 0x1A, + OP_CallBuiltin1 = 0x1B, + OP_CallBuiltin2 = 0x1C, + OP_CallBuiltin3 = 0x1D, + OP_CallBuiltin4 = 0x1E, + OP_CallBuiltin5 = 0x1F, + OP_CallBuiltin = 0x20, + OP_BoolNot = 0x21, + OP_ScriptFarMethodThreadCall = 0x22, + OP_JumpOnTrueExpr = 0x23, + OP_SetLevelFieldVariableField = 0x24, + OP_CastBool = 0x25, + OP_EvalNewLocalArrayRefCached0 = 0x26, + OP_CallBuiltinPointer = 0x27, + OP_inequality = 0x28, + OP_GetThisthread = 0x29, + OP_ClearFieldVariable = 0x2A, + OP_GetFloat = 0x2B, + OP_SafeCreateVariableFieldCached = 0x2C, + OP_ScriptFarFunctionCall2 = 0x2D, + OP_ScriptFarFunctionCall = 0x2E, + OP_ScriptFarChildThreadCall = 0x2F, + OP_ClearLocalVariableFieldCached0 = 0x30, + OP_ClearLocalVariableFieldCached = 0x31, + OP_checkclearparams = 0x32, + OP_CastFieldObject = 0x33, + OP_End = 0x34, + OP_size = 0x35, + OP_EmptyArray = 0x36, + OP_bit_and = 0x37, + OP_less_equal = 0x38, + OP_voidCodepos = 0x39, + OP_ScriptMethodThreadCallPointer = 0x3A, + OP_endswitch = 0x3B, + OP_ClearVariableField = 0x3C, + OP_divide = 0x3D, + OP_ScriptFarMethodChildThreadCall = 0x3E, + OP_GetUnsignedShort = 0x3F, + OP_JumpOnTrue = 0x40, + OP_GetSelf = 0x41, + OP_ScriptFarThreadCall = 0x42, + OP_ScriptLocalThreadCall = 0x43, + OP_SetLocalVariableFieldCached0 = 0x44, + OP_SetLocalVariableFieldCached = 0x45, + OP_plus = 0x46, + OP_BoolComplement = 0x47, + OP_ScriptMethodCallPointer = 0x48, + OP_inc = 0x49, + OP_RemoveLocalVariables = 0x4A, + OP_JumpOnFalseExpr = 0x4B, + OP_switch = 0x4C, + OP_clearparams = 0x4D, + OP_EvalLocalVariableRefCached0 = 0x4E, + OP_EvalLocalVariableRefCached = 0x4F, + OP_ScriptLocalMethodCall = 0x50, + OP_EvalFieldVariable = 0x51, + OP_EvalFieldVariableRef = 0x52, + OP_GetString = 0x53, + OP_ScriptFunctionCallPointer = 0x54, + OP_EvalLevelFieldVariable = 0x55, + OP_GetVector = 0x56, + OP_endon = 0x57, + OP_greater_equal = 0x58, + OP_GetSelfObject = 0x59, + OP_SetAnimFieldVariableField = 0x5A, + OP_SetVariableField = 0x5B, + OP_ScriptLocalFunctionCall2 = 0x5C, + OP_ScriptLocalFunctionCall = 0x5D, + OP_EvalLocalArrayRefCached0 = 0x5E, + OP_EvalLocalArrayRefCached = 0x5F, + OP_GetFarFunction = 0x60, + OP_less = 0x61, + OP_GetGameRef = 0x62, + OP_waitFrame = 0x63, + OP_waittillFrameEnd = 0x64, + OP_SafeSetVariableFieldCached0 = 0x65, + OP_SafeSetVariableFieldCached = 0x66, + OP_ScriptMethodChildThreadCallPointer = 0x67, + OP_GetLevel = 0x68, + OP_notify = 0x69, + OP_DecTop = 0x6A, + OP_shift_left = 0x6B, + OP_ScriptLocalMethodThreadCall = 0x6C, + OP_ScriptLocalMethodChildThreadCall = 0x6D, + OP_greater = 0x6E, + OP_EvalLocalVariableCached0 = 0x6F, + OP_EvalLocalVariableCached1 = 0x70, + OP_EvalLocalVariableCached2 = 0x71, + OP_EvalLocalVariableCached3 = 0x72, + OP_EvalLocalVariableCached4 = 0x73, + OP_EvalLocalVariableCached5 = 0x74, + OP_EvalLocalVariableCached = 0x75, + OP_SafeSetWaittillVariableFieldCached = 0x76, + OP_jump = 0x77, + OP_ScriptThreadCallPointer = 0x78, + OP_GetZero = 0x79, + OP_wait = 0x7A, + OP_minus = 0x7B, + OP_SetSelfFieldVariableField = 0x7C, + OP_EvalNewLocalVariableRefCached0 = 0x7D, + OP_multiply = 0x7E, + OP_CreateLocalVariable = 0x7F, + OP_ScriptLocalChildThreadCall = 0x80, + OP_GetInteger = 0x81, + OP_mod = 0x82, + OP_EvalAnimFieldVariableRef = 0x83, + OP_GetBuiltinFunction = 0x84, + OP_GetGame = 0x85, + OP_waittill = 0x86, + OP_dec = 0x87, + OP_EvalLocalVariableObjectCached = 0x88, + OP_PreScriptCall = 0x89, + OP_GetAnim = 0x8A, + OP_GetUndefined = 0x8B, + OP_EvalLevelFieldVariableRef = 0x8C, + OP_GetAnimObject = 0x8D, + OP_GetLevelObject = 0x8E, + OP_bit_ex_or = 0x8F, + OP_equality = 0x90, + OP_ClearArray = 0x91, + OP_jumpback = 0x92, + OP_GetAnimation = 0x93, + OP_EvalAnimFieldVariable = 0x94, + OP_GetAnimTree = 0x95, + OP_GetIString = 0x96, + OP_EvalArrayRef = 0x97, + OP_EvalSelfFieldVariableRef = 0x98, + OP_GetNegByte = 0x99, + OP_GetBuiltinMethod = 0x9A, + OP_CallBuiltinMethodPointer = 0x9B, + OP_EvalArray = 0x9C, + OP_vector = 0x9D, + OP_ScriptFarMethodCall = 0x9E, + OP_EvalLocalArrayCached = 0x9F, + OP_GetByte = 0xA0, + OP_ScriptChildThreadCallPointer = 0xA1, + OP_bit_or = 0xA2, + OP_AddArray = 0xA3, + OP_waittillmatch2 = 0xA4, + OP_waittillmatch = 0xA5, + OP_GetLocalFunction = 0xA6, + OP_GetNegUnsignedShort = 0xA7, + OP_shift_right = 0xA8, + OP_CallBuiltinMethod0 = 0xA9, + OP_CallBuiltinMethod1 = 0xAA, + OP_CallBuiltinMethod2 = 0xAB, + OP_CallBuiltinMethod3 = 0xAC, + OP_CallBuiltinMethod4 = 0xAD, + OP_CallBuiltinMethod5 = 0xAE, + OP_CallBuiltinMethod = 0xAF, + OP_JumpOnFalse = 0xB0, + OP_BoolNotAfterAnd = 0xB1, + OP_Count = 0xB2, +}; + +auto opcode_size(std::uint8_t op) -> std::uint32_t; + +} // namespace xsk::gsc::s2 diff --git a/src/tool/stdafx.cpp b/src/tool/stdafx.cpp new file mode 100644 index 00000000..0f0f08c2 --- /dev/null +++ b/src/tool/stdafx.cpp @@ -0,0 +1,6 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" diff --git a/src/tool/stdafx.hpp b/src/tool/stdafx.hpp new file mode 100644 index 00000000..a26e6c31 --- /dev/null +++ b/src/tool/stdafx.hpp @@ -0,0 +1,36 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +// Warnings +#ifdef _WIN32 +#pragma warning(disable:4244) +#pragma warning(disable:4267) +#pragma warning(disable:4005) +#pragma warning(disable:4065) +#define _CRT_SECURE_NO_WARNINGS +#endif + +// C/C++ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Ext +using namespace std::literals; diff --git a/src/tool/xsk/main.cpp b/src/tool/xsk/main.cpp new file mode 100644 index 00000000..88af5c45 --- /dev/null +++ b/src/tool/xsk/main.cpp @@ -0,0 +1,578 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" + +#include "iw5/xsk/iw5.hpp" +#include "iw6/xsk/iw6.hpp" +#include "iw7/xsk/iw7.hpp" +#include "s1/xsk/s1.hpp" +#include "s2/xsk/s2.hpp" +#include "h1/xsk/h1.hpp" +#include "h2/xsk/h2.hpp" + +namespace xsk::gsc +{ + +enum class mode { __, ASM, DISASM, COMP, DECOMP }; +enum class game { __, IW5, IW6, IW7, S1, S2, H1, H2 }; + +std::map modes = +{ + { "-asm", mode::ASM }, + { "-disasm", mode::DISASM }, + { "-comp", mode::COMP }, + { "-decomp", mode::DECOMP }, +}; + +std::map games = +{ + { "-iw5", game::IW5 }, + { "-iw6", game::IW6 }, + { "-iw7", game::IW7 }, + { "-s1", game::S1 }, + { "-s2", game::S2 }, + { "-h1", game::H1 }, + { "-h2", game::H2 }, +}; + +auto overwrite_prompt(const std::string& file) -> bool +{ + auto overwrite = true; + + if (utils::file::exists(file)) + { + do + { + std::cout << "File \"" << file << "\" already exists, overwrite? [Y/n]: "; + auto result = std::getchar(); + + if (result == '\n' || result == 'Y' || result == 'y') + { + break; + } + else if (result == 'N' || result == 'n') + { + overwrite = false; + break; + } + } while (true); + } + + return overwrite; +} + +auto choose_resolver_file_name(uint32_t id, game& game) -> std::string +{ + switch (game) + { + case game::IW5: return iw5::resolver::file_name(static_cast(id)); + case game::IW6: return iw6::resolver::file_name(static_cast(id)); + case game::IW7: return iw7::resolver::file_name(id); + case game::S1: return s1::resolver::file_name(static_cast(id)); + case game::S2: return s2::resolver::file_name(static_cast(id)); + case game::H1: return h1::resolver::file_name(static_cast(id)); + case game::H2: return h2::resolver::file_name(static_cast(id)); + default: return ""; + } +} + +void assemble_file(gsc::assembler& assembler, std::string file, bool zonetool) +{ + try + { + const auto ext = std::string(".gscasm"); + const auto extpos = file.find(ext); + + if (extpos != std::string::npos) + { + file.replace(extpos, ext.length(), ""); + } + + auto data = utils::file::read(file + ext); + + assembler.assemble(file, data); + + if (overwrite_prompt(file + (zonetool ? ".cgsc" : ".gscbin"))) + { + if(zonetool) + { + utils::file::save(file + ".cgsc", assembler.output_script()); + utils::file::save(file + ".cgsc.stack", assembler.output_stack()); + std::cout << "assembled " << file << ".cgsc\n"; + } + else + { + gsc::asset script; + + auto uncompressed = assembler.output_stack(); + auto compressed = utils::zlib::compress(uncompressed); + + script.name = file; + script.bytecode = assembler.output_script(); + script.buffer = std::move(compressed); + script.len = uncompressed.size(); + script.compressedLen = script.buffer.size(); + script.bytecodeLen = script.bytecode.size(); + + auto output = script.serialize(); + utils::file::save(file + ".gscbin", output); + std::cout << "assembled " << file << ".gscbin\n"; + } + } + } + catch(const std::exception& e) + { + std::cerr << e.what() << '\n'; + } +} + +void disassemble_file(gsc::disassembler& disassembler, std::string file, game& game, bool zonetool) +{ + try + { + if(zonetool) + { + if (file.find(".stack") != std::string::npos) + { + std::cerr << "Cannot disassemble stack files\n"; + return; + } + + const auto ext = std::string(".cgsc"); + const auto extpos = file.find(ext); + + if (extpos != std::string::npos) + { + file.replace(extpos, ext.length(), ""); + } + + auto script = utils::file::read(file + ".cgsc"); + auto stack = utils::file::read(file + ".cgsc.stack"); + + disassembler.disassemble(file, script, stack); + } + else + { + const auto ext = std::string(".gscbin"); + const auto extpos = file.find(ext); + + if (extpos != std::string::npos) + { + file.replace(extpos, ext.length(), ""); + } + + auto data = utils::file::read(file + ext); + + gsc::asset script; + + script.deserialize(data); + + auto stack = utils::zlib::decompress(script.buffer, script.len); + + disassembler.disassemble(file, script.bytecode, stack); + } + + auto scriptid = std::filesystem::path(file).filename().string(); + + if (!isdigit(scriptid.data()[0])) + { + utils::file::save(file + ".gscasm", disassembler.output_data()); + std::cout << "disassembled " << file << ".gscasm\n"; + } + else + { + auto filename = choose_resolver_file_name(std::atoi(scriptid.data()), game); + auto count = file.find(scriptid); + + if (count != std::string::npos) + { + if (!filename.empty()) + { + file.erase(count, scriptid.length()); + } + } + + utils::file::save(file + filename + ".gscasm", disassembler.output_data()); + std::cout << "disassembled " << file << filename << ".gscasm\n"; + } + } + catch(const std::exception& e) + { + std::cerr << e.what() << '\n'; + } +} + +void compile_file(gsc::assembler& assembler, gsc::compiler& compiler, std::string file, bool zonetool) +{ + try + { + const auto ext = std::string(".gsc"); + const auto extpos = file.find(ext); + + if (extpos != std::string::npos) + { + file.replace(extpos, ext.length(), ""); + } + + auto data = utils::file::read(file + ext); + compiler.set_readf_callback(utils::file::read); + compiler.compile(file, data); + + auto assembly = compiler.output(); + + assembler.assemble(file, assembly); + + if (overwrite_prompt(file + (zonetool ? ".cgsc" : ".gscbin"))) + { + if(zonetool) + { + utils::file::save(file + ".cgsc", assembler.output_script()); + utils::file::save(file + ".cgsc.stack", assembler.output_stack()); + std::cout << "compiled " << file << ".cgsc\n"; + } + else + { + gsc::asset script; + + auto uncompressed = assembler.output_stack(); + auto compressed = utils::zlib::compress(uncompressed); + + script.name = file; + script.bytecode = assembler.output_script(); + script.buffer = std::move(compressed); + script.len = uncompressed.size(); + script.compressedLen = script.buffer.size(); + script.bytecodeLen = script.bytecode.size(); + + auto output = script.serialize(); + utils::file::save(file + ".gscbin", output); + std::cout << "compiled " << file << ".gscbin\n"; + } + } + } + catch(const std::exception& e) + { + std::cerr << e.what() << '\n'; + } +} + +void decompile_file(gsc::disassembler& disassembler, gsc::decompiler& decompiler, std::string file, game& game, bool zonetool) +{ + try + { + if(zonetool) + { + if (file.find(".stack") != std::string::npos) + { + std::cerr << "Cannot disassemble stack files\n"; + return; + } + + const auto ext = std::string(".cgsc"); + const auto extpos = file.find(ext); + + if (extpos != std::string::npos) + { + file.replace(extpos, ext.length(), ""); + } + + auto script = utils::file::read(file + ".cgsc"); + auto stack = utils::file::read(file + ".cgsc.stack"); + + disassembler.disassemble(file, script, stack); + } + else + { + const auto ext = std::string(".gscbin"); + const auto extpos = file.find(ext); + + if (extpos != std::string::npos) + { + file.replace(extpos, ext.length(), ""); + } + + auto data = utils::file::read(file + ext); + + gsc::asset script; + + script.deserialize(data); + + auto stack = utils::zlib::decompress(script.buffer, script.len); + + disassembler.disassemble(file, script.bytecode, stack); + } + + auto output = disassembler.output(); + + decompiler.decompile(file, output); + + auto scriptid = std::filesystem::path(file).filename().string(); + + if (!isdigit(scriptid.data()[0])) + { + utils::file::save(file + ".gsc", decompiler.output()); + std::cout << "decompiled " << file << ".gsc\n"; + } + else + { + auto filename = choose_resolver_file_name(std::atoi(scriptid.data()), game); + auto count = file.find(scriptid); + + if (count != std::string::npos) + { + if (!filename.empty()) + { + file.erase(count, scriptid.length()); + } + } + + utils::file::save(file + filename + ".gsc", decompiler.output()); + std::cout << "decompiled " << file << filename << ".gsc\n"; + } + } + catch(const std::exception& e) + { + std::cerr << e.what() << '\n'; + } +} + +int parse_flags(int argc, char** argv, game& game, mode& mode, bool& zonetool) +{ + if (argc != 4) return 1; + + std::string arg = utils::string::to_lower(argv[1]); + + const auto it1 = games.find(arg); + + if (it1 != games.end()) + { + game = it1->second; + } + else + { + std::cout << "Unknown game '" << argv[1] << "'.\n\n"; + return 1; + } + + arg = utils::string::to_lower(argv[2]); + + if(arg.at(1) == 'z') + { + arg.erase(arg.begin() + 1); + zonetool = true; + } + + const auto it2 = modes.find(arg); + + if (it2 != modes.end()) + { + mode = it2->second; + } + else + { + std::cout << "Unknown mode '" << argv[2] << "'.\n\n"; + return 1; + } + + return 0; +} + +void print_usage() +{ + std::cout << "usage: gsc-tool.exe \n"; + std::cout << " * games: -iw5, -iw6, -iw7, -s1, -s2, -h1, -h2\n"; + std::cout << " * modes: -asm, -disasm, -comp, -decomp\n"; +} + +std::uint32_t main(std::uint32_t argc, char** argv) +{ + std::string file = utils::string::fordslash(argv[argc - 1]); + mode mode = mode::__; + game game = game::__; + bool zonetool = false; + + if (parse_flags(argc, argv, game, mode, zonetool)) + { + print_usage(); + return 0; + } + + if (mode == mode::ASM) + { + if( game == game::IW5) + { + gsc::iw5::assembler assembler; + assemble_file(assembler, file, zonetool); + } + else if (game == game::IW6) + { + iw6::assembler assembler; + assemble_file(assembler, file, zonetool); + } + else if (game == game::IW7) + { + iw7::assembler assembler; + assemble_file(assembler, file, zonetool); + } + else if (game == game::S1) + { + s1::assembler assembler; + assemble_file(assembler, file, zonetool); + } + else if (game == game::S2) + { + s2::assembler assembler; + assemble_file(assembler, file, zonetool); + } + else if (game == game::H1) + { + h1::assembler assembler; + assemble_file(assembler, file, zonetool); + } + else if (game == game::H2) + { + h2::assembler assembler; + assemble_file(assembler, file, zonetool); + } + } + else if (mode == mode::DISASM) + { + if (game == game::IW5) + { + gsc::iw5::disassembler disassembler; + disassemble_file(disassembler, file, game, zonetool); + } + else if (game == game::IW6) + { + iw6::disassembler disassembler; + disassemble_file(disassembler, file, game, zonetool); + } + else if (game == game::IW7) + { + iw7::disassembler disassembler; + disassemble_file(disassembler, file, game, zonetool); + } + else if (game == game::S1) + { + s1::disassembler disassembler; + disassemble_file(disassembler, file, game, zonetool); + } + else if (game == game::S2) + { + s2::disassembler disassembler; + disassemble_file(disassembler, file, game, zonetool); + } + else if (game == game::H1) + { + h1::disassembler disassembler; + disassemble_file(disassembler, file, game, zonetool); + } + else if (game == game::H2) + { + h2::disassembler disassembler; + disassemble_file(disassembler, file, game, zonetool); + } + } + else if (mode == mode::COMP) + { + if (game == game::IW5) + { + gsc::iw5::assembler assembler; + gsc::iw5::compiler compiler; + compile_file(assembler, compiler, file ,zonetool); + } + else if (game == game::IW6) + { + iw6::assembler assembler; + iw6::compiler compiler; + compile_file(assembler, compiler, file ,zonetool); + } + else if (game == game::IW7) + { + iw7::assembler assembler; + iw7::compiler compiler; + compile_file(assembler, compiler, file ,zonetool); + } + else if (game == game::S1) + { + s1::assembler assembler; + s1::compiler compiler; + compile_file(assembler, compiler, file ,zonetool); + } + else if (game == game::S2) + { + s2::assembler assembler; + s2::compiler compiler; + compile_file(assembler, compiler, file ,zonetool); + } + else if (game == game::H1) + { + h1::assembler assembler; + h1::compiler compiler; + compile_file(assembler, compiler, file ,zonetool); + } + else if (game == game::H2) + { + h2::assembler assembler; + h2::compiler compiler; + compile_file(assembler, compiler, file ,zonetool); + } + } + else if (mode == mode::DECOMP) + { + if (game == game::IW5) + { + iw5::disassembler disassembler; + iw5::decompiler decompiler; + decompile_file(disassembler, decompiler, file, game, zonetool); + } + else if (game == game::IW6) + { + iw6::disassembler disassembler; + iw6::decompiler decompiler; + decompile_file(disassembler, decompiler, file, game, zonetool); + } + else if (game == game::IW7) + { + iw7::disassembler disassembler; + iw7::decompiler decompiler; + decompile_file(disassembler, decompiler, file, game, zonetool); + } + else if (game == game::S1) + { + s1::disassembler disassembler; + s1::decompiler decompiler; + decompile_file(disassembler, decompiler, file, game, zonetool); + } + else if (game == game::S2) + { + s2::disassembler disassembler; + s2::decompiler decompiler; + decompile_file(disassembler, decompiler, file, game, zonetool); + } + else if (game == game::H1) + { + h1::disassembler disassembler; + h1::decompiler decompiler; + decompile_file(disassembler, decompiler, file, game, zonetool); + } + else if (game == game::H2) + { + h2::disassembler disassembler; + h2::decompiler decompiler; + decompile_file(disassembler, decompiler, file, game, zonetool); + } + } + + return 0; +} + +} // namespace xsk::gsc + +int main(int argc, char** argv) +{ + xsk::gsc::main(argc, argv); +} diff --git a/src/utils/stdafx.cpp b/src/utils/stdafx.cpp new file mode 100644 index 00000000..0f0f08c2 --- /dev/null +++ b/src/utils/stdafx.cpp @@ -0,0 +1,6 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" diff --git a/src/utils/stdafx.hpp b/src/utils/stdafx.hpp new file mode 100644 index 00000000..f21c8d05 --- /dev/null +++ b/src/utils/stdafx.hpp @@ -0,0 +1,38 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +// Warnings +#ifdef _WIN32 +#pragma warning(disable:4244) +#pragma warning(disable:4267) +#pragma warning(disable:4005) +#pragma warning(disable:4065) +#define _CRT_SECURE_NO_WARNINGS +#endif + +// C/C++ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Ext +using namespace std::literals; + +#include "xsk/utils.hpp" diff --git a/src/utils/xsk/byte_buffer.cpp b/src/utils/xsk/byte_buffer.cpp new file mode 100644 index 00000000..47c71bd8 --- /dev/null +++ b/src/utils/xsk/byte_buffer.cpp @@ -0,0 +1,101 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" + +namespace xsk::gsc::utils +{ + +byte_buffer::byte_buffer() +{ + data_.resize(0x1000000); + std::fill(data_.begin(), data_.end(), 0); + size_ = data_.size(); + pos_ = 0; +} + +byte_buffer::byte_buffer(std::size_t size) +{ + data_.resize(size); + std::fill(data_.begin(), data_.end(), 0); + size_ = size; + pos_ = 0; +} + +byte_buffer::byte_buffer(const std::vector& data) +{ + data_ = data; + size_ = data.size(); + pos_ = 0; +} + +byte_buffer::~byte_buffer() +{ + data_.clear(); + pos_ = 0; +} + +void byte_buffer::clear() +{ + std::fill(data_.begin(), data_.end(), 0); +} + +auto byte_buffer::is_avail() -> bool +{ + if (pos_ < data_.size()) return true; + return false; +} + +void byte_buffer::seek(std::size_t pos) +{ + pos_ += pos; +} +void byte_buffer::seek_neg(std::size_t pos) +{ + pos_ -= pos; +} + +void byte_buffer::write_string(const std::string& data) +{ + strcpy(reinterpret_cast(data_.data() + pos_), data.data()); + pos_ += data.size(); +} + +void byte_buffer::write_c_string(const std::string& data) +{ + strcpy(reinterpret_cast(data_.data() + pos_), data.data()); + pos_ += data.size() + 1; +} + +auto byte_buffer::read_c_string() -> std::string +{ + auto ret = std::string(reinterpret_cast(data_.data() + pos_)); + pos_ += ret.size() + 1; + return ret; +} + +auto byte_buffer::print_bytes(std::size_t pos, std::size_t count) -> std::string +{ + std::string shit; + + for (auto i = pos; i < pos + count; i++) + { + shit += utils::string::va("%s %02X", shit.data(), (*reinterpret_cast(data_.data() + i))); + } + + return shit; +} + +auto byte_buffer::pos() -> std::size_t +{ + return pos_; +} + +auto byte_buffer::buffer() -> std::vector& +{ + return data_; +} + +} // namespace xsk::utils diff --git a/src/utils/xsk/byte_buffer.hpp b/src/utils/xsk/byte_buffer.hpp new file mode 100644 index 00000000..5f7d23a5 --- /dev/null +++ b/src/utils/xsk/byte_buffer.hpp @@ -0,0 +1,81 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::utils +{ + +class byte_buffer +{ + std::vector data_; + std::size_t size_; + std::size_t pos_; + +public: + byte_buffer(); + byte_buffer(std::size_t size); + byte_buffer(const std::vector& data); + ~byte_buffer(); + + template + auto read() -> T + { + auto ret = *reinterpret_cast(data_.data() + pos_); + pos_ += sizeof(T); + return ret; + } + + template + void write(T data) + { + T* mem = reinterpret_cast(data_.data() + pos_); + std::memcpy(mem, &data, sizeof(T)); + pos_ += sizeof(T); + } + + template + auto read_endian() -> T + { + std::array mem; + + for(auto i = 0; i < sizeof(T); i++) + { + mem[i] = reinterpret_cast(data_.data() + pos_)[sizeof(T) - 1 - i]; + } + + pos_ += sizeof(T); + + return *reinterpret_cast(mem.data()); + } + + template + void write_endian(T data) + { + auto* mem = data_.data() + pos_; + + for(auto i = 0; i < sizeof(T); i++) + { + mem[i] = reinterpret_cast(&data)[sizeof(T) - 1 - i]; + } + + pos_ += sizeof(T); + } + + void clear(); + auto is_avail() -> bool; + void seek(std::size_t pos); + void seek_neg(std::size_t pos); + void write_string(const std::string& data); + void write_c_string(const std::string& data); + auto read_c_string() -> std::string; + auto print_bytes(std::size_t pos, std::size_t count) -> std::string; + auto pos() -> std::size_t; + auto buffer() -> std::vector&; +}; + +using byte_buffer_ptr = std::unique_ptr; + +} // namespace xsk::utils diff --git a/src/utils/xsk/compression.cpp b/src/utils/xsk/compression.cpp new file mode 100644 index 00000000..dfe2a2c3 --- /dev/null +++ b/src/utils/xsk/compression.cpp @@ -0,0 +1,40 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" +#include "zlib.h" + +namespace xsk::gsc::utils +{ + +auto zlib::compress(const std::vector& data) -> std::vector +{ + auto length = compressBound(static_cast(data.size())); + + std::vector output; + output.resize(length); + + auto result = compress2(reinterpret_cast(output.data()), &length, reinterpret_cast(data.data()), static_cast(data.size()), Z_BEST_COMPRESSION); + + if(result != Z_OK) return {}; + + output.resize(length); + + return output; +} + +auto zlib::decompress(const std::vector& data, std::uint32_t length) -> std::vector +{ + std::vector output; + output.resize(length); + + auto result = uncompress(output.data(), (uLongf*)&length, (Bytef*)data.data(), data.size()); + + if(result != Z_OK) return {}; + + return output; +} + +} // namespace xsk::uitls diff --git a/src/utils/xsk/compression.hpp b/src/utils/xsk/compression.hpp new file mode 100644 index 00000000..51ed5ee6 --- /dev/null +++ b/src/utils/xsk/compression.hpp @@ -0,0 +1,18 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::utils +{ + +class zlib +{ +public: + static auto compress(const std::vector& data) -> std::vector; + static auto decompress(const std::vector& data, std::uint32_t length) -> std::vector; +}; + +} // namespace xsk::utils diff --git a/src/utils/xsk/file.cpp b/src/utils/xsk/file.cpp new file mode 100644 index 00000000..30a76ea2 --- /dev/null +++ b/src/utils/xsk/file.cpp @@ -0,0 +1,73 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" + +namespace xsk::gsc::utils +{ + +auto file::read(const std::string& file) -> std::vector +{ + std::vector data; + + std::ifstream stream(file, std::ios::binary); + + if (!stream.good() && !stream.is_open()) + { + throw std::runtime_error("Couldn't open file " + file); + } + + stream.seekg(0, std::ios::end); + std::streamsize size = stream.tellg(); + stream.seekg(0, std::ios::beg); + + if (size > -1) + { + data.resize(static_cast(size)); + stream.read(reinterpret_cast(data.data()), size); + } + + stream.close(); + + return data; +} + +void file::save(const std::string& file, const std::vector& data) +{ + const auto pos = file.find_last_of("/\\"); + + if (pos != std::string::npos) + { + std::filesystem::create_directories(file.substr(0, pos)); + } + + std::ofstream stream(file, std::ios::binary | std::ofstream::out); + + if (stream.is_open()) + { + stream.write(reinterpret_cast(data.data()), data.size()); + stream.close(); + } +} + +auto file::length(const std::string& file) -> size_t +{ + auto stream = std::ifstream(file, std::ios::binary); + + if (stream.good()) + { + stream.seekg(0, std::ios::end); + return static_cast(stream.tellg()); + } + + return 0; +} + +auto file::exists(const std::string& file) -> bool +{ + return std::filesystem::exists(file); +} + +} // namespace xsk::utils diff --git a/src/utils/xsk/file.hpp b/src/utils/xsk/file.hpp new file mode 100644 index 00000000..e1fae5c5 --- /dev/null +++ b/src/utils/xsk/file.hpp @@ -0,0 +1,20 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::utils +{ + +class file +{ +public: + static auto read(const std::string& file) -> std::vector; + static void save(const std::string& file, const std::vector& data); + static auto length(const std::string& file) -> size_t; + static auto exists(const std::string& file) -> bool; +}; + +} // namespace xsk::utils diff --git a/src/utils/xsk/gsc/assembly.hpp b/src/utils/xsk/gsc/assembly.hpp new file mode 100644 index 00000000..3a6d952c --- /dev/null +++ b/src/utils/xsk/gsc/assembly.hpp @@ -0,0 +1,37 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc +{ + +struct instruction +{ + std::uint32_t index; + std::uint32_t size; + std::uint8_t opcode; + std::vector data; + + instruction() : index(0), size(0), opcode(0xFF) { } +}; + +using instruction_ptr = std::unique_ptr; + +struct function +{ + std::uint32_t index; + std::uint32_t size; + std::uint32_t id; + std::string name; + std::vector instructions; + std::unordered_map labels; + + function() : index(0), size(0), id(0) { } +}; + +using function_ptr = std::unique_ptr; + +} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/asset.hpp b/src/utils/xsk/gsc/asset.hpp new file mode 100644 index 00000000..84a36ae5 --- /dev/null +++ b/src/utils/xsk/gsc/asset.hpp @@ -0,0 +1,76 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc +{ + +struct asset +{ + std::string name; + std::uint32_t compressedLen; + std::uint32_t len; + std::uint32_t bytecodeLen; + std::vector buffer; + std::vector bytecode; + + auto serialize() -> std::vector + { + std::vector data; + + data.resize(name.size() + 1 + compressedLen + bytecodeLen + 12); + std::memset(data.data(), 0, data.size()); + + auto pos = 0u; + + std::memcpy(&data[pos], name.data(), name.size() + 1); + pos += name.size() + 1; + + *reinterpret_cast(&data[pos]) = compressedLen; + pos += 4; + + *reinterpret_cast(&data[pos]) = len; + pos += 4; + + *reinterpret_cast(&data[pos]) = bytecodeLen; + pos += 4; + + std::memcpy(&data[pos], buffer.data(), buffer.size()); + pos += buffer.size(); + + std::memcpy(&data[pos], bytecode.data(), bytecode.size()); + + return data; + } + + auto deserialize(std::vector data) + { + auto pos = 0u; + + name = std::string(reinterpret_cast(data.data())); + pos += name.size() + 1; + + compressedLen = *reinterpret_cast(data.data() + pos); + pos += 4; + + len = *reinterpret_cast(data.data() + pos); + pos += 4; + + bytecodeLen = *reinterpret_cast(data.data() + pos); + pos += 4; + + buffer.resize(compressedLen); + std::memcpy(buffer.data(), data.data() + pos, compressedLen); + pos += buffer.size(); + + bytecode.resize(bytecodeLen); + std::memcpy(bytecode.data(), data.data() + pos, bytecodeLen); + } +}; + +using asset_ptr = std::unique_ptr; + +} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/context.hpp b/src/utils/xsk/gsc/context.hpp new file mode 100644 index 00000000..7e9b0719 --- /dev/null +++ b/src/utils/xsk/gsc/context.hpp @@ -0,0 +1,218 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc +{ + +struct context; +using context_ptr = std::unique_ptr; + +enum class abort_t +{ + abort_none = 0, + abort_continue = 1, + abort_break = 2, + abort_return = 3, +}; + +struct include_t +{ + std::string name; + std::vector funcs; + + include_t(const std::string& name, const std::vector& funcs) : name(name), funcs(funcs) {} +}; + +struct animtree_t +{ + std::string name; + bool loaded; +}; + +struct local_var +{ + std::string name; + std::uint8_t create; + bool init; +}; + +struct context +{ + std::string loc_end; + std::string loc_break; + std::string loc_continue; + std::vector local_vars; + std::uint32_t local_vars_create_count; + std::uint32_t local_vars_public_count; + abort_t abort; + bool is_last; + + context() : is_last(false), abort(abort_t::abort_none), + local_vars_create_count(0), local_vars_public_count(0) { } + + void transfer(const context_ptr& child) + { + child->loc_break = this->loc_break; + child->loc_continue = this->loc_continue; + + for (std::uint32_t i = 0; i < child->local_vars_public_count || i < this->local_vars_create_count; i++ ) + { + auto pos = child->find_variable(i, this->local_vars.at(i).name); + + if ( pos < 0 ) + { + child->local_vars_public_count++; + child->local_vars.insert(child->local_vars.begin() + i, this->local_vars.at(i)); + } + else + { + auto& v = child->local_vars; + if (pos > std::int32_t(i)) + std::rotate(v.rend() - pos - 1, v.rend() - pos, v.rend() - i); + else + std::rotate(v.begin() + pos, v.begin() + pos + 1, v.begin() + i + 1); + child->local_vars.at(i).init = this->local_vars.at(i).init; + + if(child->local_vars_public_count <= i) + child->local_vars_public_count++; + } + } + + child->local_vars_create_count = this->local_vars_create_count; + child->abort = abort_t::abort_none; + } + + void copy(const context_ptr& child) + { + child->local_vars = this->local_vars; + child->local_vars_create_count = this->local_vars_create_count; + child->local_vars_public_count = 0; + } + + void append(const std::vector& childs) + { + bool glob = true; + + if(childs.size() == 0) return; + + for (std::size_t i = 0; i < childs.at(0)->local_vars.size(); i++ ) + { + glob = true; + auto& var = childs.at(0)->local_vars.at(i); + + if (this->find_variable(0, var.name) < 0) + { + for (std::size_t j = 1; j < childs.size(); j++ ) + { + if (childs.at(j)->find_variable(0, var.name) < 0) + { + glob = false; + } + } + if(glob) + { + this->local_vars.push_back(var); + } + } + } + } + + void merge(const std::vector& childs) + { + if(childs.size() == 0) return; + + for (std::size_t childidx = 0; childidx < childs.size(); childidx++ ) + { + auto child = childs[childidx]; + + child->local_vars_public_count = this->local_vars.size(); + for (std::size_t i = 0; i < this->local_vars.size(); i++ ) + { + auto& name = this->local_vars.at(i).name; + + auto pos = child->find_variable(i, name); + + if ( pos < 0 ) + { + child->local_vars.insert(child->local_vars.begin() + i, this->local_vars.at(i)); + } + else if(pos > i) + { + auto& v = child->local_vars; + std::rotate(v.rend() - pos - 1, v.rend() - pos, v.rend() - i); + } + } + } + } + + void init_from_child(const std::vector& childs) + { + if(childs.size() == 0) return; + + auto create_count = childs[0]->local_vars_public_count; + + for (std::size_t i = 1; i < childs.size(); ++i ) + { + auto child = childs[i]; + if ( child->local_vars_public_count < create_count ) + create_count = child->local_vars_public_count; + } + + this->local_vars_create_count = create_count; + + bool init = true; + for (std::uint32_t i = 0; i < create_count; i++ ) + { + init = true; + if(!this->local_vars.at(i).init) + { + for (std::size_t j = 0; j < childs.size(); j++ ) + { + auto child = childs[j]; + + if(!child->local_vars.at(i).init) + { + init = false; + } + } + if (init) this->local_vars.at(i).init = true; + } + } + } + + auto find_variable(std::size_t start, const std::string& name) -> std::int32_t + { + for (std::size_t i = start; i < local_vars.size(); ++i ) + { + if ( local_vars.at(i).name == name ) + return i; + } + return -1; + } + + void transfer_decompiler(const context_ptr& child) + { + for (std::uint32_t i = 0; i < this->local_vars.size(); i++ ) + { + child->local_vars.push_back(this->local_vars.at(i)); + } + + child->local_vars_public_count = this->local_vars.size(); + } + + void append_decompiler(const context_ptr& child, bool all = false) + { + auto total = all ? child->local_vars.size() : child->local_vars_public_count; + + for (std::uint32_t i = this->local_vars.size(); i < total; i++ ) + { + this->local_vars.push_back(child->local_vars.at(i)); + } + } +}; + +} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/interfaces/assembler.hpp b/src/utils/xsk/gsc/interfaces/assembler.hpp new file mode 100644 index 00000000..279207a6 --- /dev/null +++ b/src/utils/xsk/gsc/interfaces/assembler.hpp @@ -0,0 +1,20 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc +{ + +class assembler +{ +public: + virtual auto output_script() -> std::vector = 0; + virtual auto output_stack() -> std::vector = 0; + virtual void assemble(const std::string& file, std::vector& data) = 0; + virtual void assemble(const std::string& file, std::vector& functions) = 0; +}; + +} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/interfaces/compiler.hpp b/src/utils/xsk/gsc/interfaces/compiler.hpp new file mode 100644 index 00000000..9e0ae30d --- /dev/null +++ b/src/utils/xsk/gsc/interfaces/compiler.hpp @@ -0,0 +1,19 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc +{ + +class compiler +{ +public: + virtual auto output() -> std::vector = 0; + virtual void compile(const std::string& file, std::vector& data) = 0; + virtual void set_readf_callback(std::function(const std::string&)> func) = 0; +}; + +} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/interfaces/decompiler.hpp b/src/utils/xsk/gsc/interfaces/decompiler.hpp new file mode 100644 index 00000000..7c13b47b --- /dev/null +++ b/src/utils/xsk/gsc/interfaces/decompiler.hpp @@ -0,0 +1,18 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc +{ + +class decompiler +{ +public: + virtual auto output() -> std::vector = 0; + virtual void decompile(const std::string& file, std::vector& functions) = 0; +}; + +} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/interfaces/disassembler.hpp b/src/utils/xsk/gsc/interfaces/disassembler.hpp new file mode 100644 index 00000000..0da88635 --- /dev/null +++ b/src/utils/xsk/gsc/interfaces/disassembler.hpp @@ -0,0 +1,19 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc +{ + +class disassembler +{ +public: + virtual auto output() -> std::vector = 0; + virtual auto output_data() -> std::vector = 0; + virtual void disassemble(const std::string& file, std::vector& script, std::vector& stack) = 0; +}; + +} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/interfaces/exception.hpp b/src/utils/xsk/gsc/interfaces/exception.hpp new file mode 100644 index 00000000..1fdf112c --- /dev/null +++ b/src/utils/xsk/gsc/interfaces/exception.hpp @@ -0,0 +1,45 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc +{ + +class error : public std::runtime_error +{ +public: + error(const std::string& what) : std::runtime_error("[gsc]: "s + what) { } +}; + +class asm_error : public std::runtime_error +{ +public: + asm_error(const std::string& what) : std::runtime_error("[gsc assembler]: "s + what) { } +}; + +class disasm_error : public std::runtime_error +{ +public: + disasm_error(const std::string& what) : std::runtime_error("[gsc disassembler]: "s + what) { } +}; + +class comp_error : public std::runtime_error +{ +public: + comp_error(gsc::location loc, const std::string& what) + : std::runtime_error("[gsc compiler]:" + + *loc.begin.filename + ":" + + std::to_string(loc.begin.line) + ":" + + std::to_string(loc.begin.column) + ": " + what) { } +}; + +class decomp_error : public std::runtime_error +{ +public: + decomp_error(const std::string& what) : std::runtime_error("[gsc decompiler]: "s + what) { } +}; + +} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/location.hpp b/src/utils/xsk/gsc/location.hpp new file mode 100644 index 00000000..9ad35663 --- /dev/null +++ b/src/utils/xsk/gsc/location.hpp @@ -0,0 +1,218 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc +{ + +/// A point in a source file. +class position +{ +public: + /// Type for file name. + typedef const std::string filename_type; + /// Type for line and column numbers. + typedef int counter_type; + + /// Construct a position. + explicit position(filename_type *f = nullptr, counter_type l = 1, counter_type c = 1) + : filename(f), line(l), column(c) {} + + /// Initialization. + void initialize(filename_type *fn = nullptr, counter_type l = 1, counter_type c = 1) + { + filename = fn; + line = l; + column = c; + } + + /** \name Line and Column related manipulators + ** \{ */ + /// (line related) Advance to the COUNT next lines. + void lines(counter_type count = 1) + { + if (count) + { + column = 1; + line = add_(line, count, 1); + } + } + + /// (column related) Advance to the COUNT next columns. + void columns(counter_type count = 1) + { + column = add_(column, count, 1); + } + /** \} */ + + /// File name to which this position refers. + filename_type *filename; + /// Current line number. + counter_type line; + /// Current column number. + counter_type column; + +private: + /// Compute max (min, lhs+rhs). + static counter_type add_(counter_type lhs, counter_type rhs, counter_type min) + { + return lhs + rhs < min ? min : lhs + rhs; + } +}; + +/// Add \a width columns, in place. +inline position& operator+=(position &res, position::counter_type width) +{ + res.columns(width); + return res; +} + +/// Add \a width columns. +inline position operator+(position res, position::counter_type width) +{ + return res += width; +} + +/// Subtract \a width columns, in place. +inline position& operator-=(position &res, position::counter_type width) +{ + return res += -width; +} + +/// Subtract \a width columns. +inline position operator-(position res, position::counter_type width) +{ + return res -= width; +} + +/** \brief Intercept output stream redirection. + ** \param ostr the destination output stream +** \param pos a reference to the position to redirect +*/ +template +std::basic_ostream& operator<<(std::basic_ostream &ostr, const position &pos) +{ + if (pos.filename) + ostr << *pos.filename << ':'; + return ostr << pos.line << '.' << pos.column; +} + +/// Two points in a source file. +class location +{ +public: + /// Type for file name. + typedef position::filename_type filename_type; + /// Type for line and column numbers. + typedef position::counter_type counter_type; + + /// Construct a location from \a b to \a e. + location(const position &b, const position &e) + : begin(b), end(e) {} + + /// Construct a 0-width location in \a p. + explicit location(const position &p = position()) + : begin(p), end(p) {} + + /// Construct a 0-width location in \a f, \a l, \a c. + explicit location(filename_type *f, counter_type l = 1, counter_type c = 1) + : begin(f, l, c), end(f, l, c) {} + + /// Initialization. + void initialize(filename_type *f = nullptr, counter_type l = 1, counter_type c = 1) + { + begin.initialize(f, l, c); + end = begin; + } + + /** \name Line and Column related manipulators + ** \{ */ +public: + /// Reset initial location to final location. + void step() + { + begin = end; + } + + /// Extend the current location to the COUNT next columns. + void columns(counter_type count = 1) + { + end += count; + } + + /// Extend the current location to the COUNT next lines. + void lines(counter_type count = 1) + { + end.lines(count); + } + /** \} */ + +public: + /// Beginning of the located region. + position begin; + /// End of the located region. + position end; +}; + +/// Join two locations, in place. +inline location& operator+=(location &res, const location &end) +{ + res.end = end.end; + return res; +} + +/// Join two locations. +inline location operator+(location res, const location &end) +{ + return res += end; +} + +/// Add \a width columns to the end position, in place. +inline location& operator+=(location &res, location::counter_type width) +{ + res.columns(width); + return res; +} + +/// Add \a width columns to the end position. +inline location operator+(location res, location::counter_type width) +{ + return res += width; +} + +/// Subtract \a width columns to the end position, in place. +inline location& operator-=(location &res, location::counter_type width) +{ + return res += -width; +} + +/// Subtract \a width columns to the end position. +inline location operator-(location res, location::counter_type width) +{ + return res -= width; +} + +/** \brief Intercept output stream redirection. + ** \param ostr the destination output stream +** \param loc a reference to the location to redirect +** +** Avoid duplicate information. +*/ +template +std::basic_ostream& operator<<(std::basic_ostream &ostr, const location &loc) +{ + location::counter_type end_col = 0 < loc.end.column ? loc.end.column - 1 : 0; + ostr << loc.begin; + if (loc.end.filename && (!loc.begin.filename || *loc.begin.filename != *loc.end.filename)) + ostr << '-' << loc.end.filename << ':' << loc.end.line << '.' << end_col; + else if (loc.begin.line < loc.end.line) + ostr << '-' << loc.end.line << '.' << end_col; + else if (loc.begin.column < end_col) + ostr << '-' << end_col; + return ostr; +} + +} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/nodetree.hpp b/src/utils/xsk/gsc/nodetree.hpp new file mode 100644 index 00000000..7f16abbd --- /dev/null +++ b/src/utils/xsk/gsc/nodetree.hpp @@ -0,0 +1,2375 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc +{ + +enum class node_t +{ + null, + data_true, + data_false, + data_integer, + data_float, + data_vector, + data_string, + data_istring, + data_file, + data_name, + data_animtree, + data_animation, + data_level, + data_anim, + data_self, + data_game, + data_undefined, + data_empty_array, + data_thisthread, + expr_size, + expr_field, + expr_array, + expr_add_array, + expr_function, + expr_arguments, + expr_call_pointer, + expr_call_function, + expr_call, + expr_complement, + expr_not, + expr_add, + expr_sub, + expr_mult, + expr_div, + expr_mod, + expr_shift_left, + expr_shift_right, + expr_bitwise_or, + expr_bitwise_and, + expr_bitwise_exor, + expr_equality, + expr_inequality, + expr_less_equal, + expr_greater_equal, + expr_less, + expr_greater, + expr_or, + expr_and, + expr_assign_equal, + expr_assign_add, + expr_assign_sub, + expr_assign_mult, + expr_assign_div, + expr_assign_mod, + expr_assign_shift_left, + expr_assign_shift_right, + expr_assign_bitwise_or, + expr_assign_bitwise_and, + expr_assign_bitwise_exor, + expr_increment, + expr_decrement, + stmt_list, + stmt_call, + stmt_assign, + stmt_endon, + stmt_notify, + stmt_wait, + stmt_waittill, + stmt_waittillmatch, + stmt_waittillframeend, + stmt_waitframe, + stmt_if, + stmt_ifelse, + stmt_while, + stmt_for, + stmt_foreach, + stmt_switch, + stmt_case, + stmt_default, + stmt_break, + stmt_continue, + stmt_return, + parameters, + thread, + constant, + usingtree, + include, + program, +// DECOMPILER + asm_loc, + asm_jump, + asm_jump_back, + asm_jump_cond, + asm_jump_true_expr, + asm_jump_false_expr, + asm_switch, + asm_endswitch, + asm_prescriptcall, + asm_voidcodepos, + asm_create, + asm_access, + asm_remove, + asm_clear, +}; + +struct node; +struct node_true; +struct node_false; +struct node_integer; +struct node_float; +struct node_vector; +struct node_string; +struct node_istring; +struct node_file; +struct node_name; +struct node_animtree; +struct node_animation; +struct node_level; +struct node_anim; +struct node_self; +struct node_game; +struct node_undefined; +struct node_empty_array; +struct node_thisthread; +struct node_expr_size; +struct node_expr_field; +struct node_expr_array; +struct node_expr_add_array; +struct node_expr_function; +struct node_expr_arguments; +struct node_expr_call_pointer; +struct node_expr_call_function; +struct node_expr_call; +struct node_expr_complement; +struct node_expr_not; +struct node_expr_binary; +struct node_expr_add; +struct node_expr_sub; +struct node_expr_mult; +struct node_expr_div; +struct node_expr_mod; +struct node_expr_shift_left; +struct node_expr_shift_right; +struct node_expr_bitwise_or; +struct node_expr_bitwise_and; +struct node_expr_bitwise_exor; +struct node_expr_equality; +struct node_expr_inequality; +struct node_expr_less_equal; +struct node_expr_greater_equal; +struct node_expr_less; +struct node_expr_greater; +struct node_expr_or; +struct node_expr_and; +struct node_expr_assign; +struct node_expr_assign_equal; +struct node_expr_assign_add; +struct node_expr_assign_sub; +struct node_expr_assign_mult; +struct node_expr_assign_div; +struct node_expr_assign_mod; +struct node_expr_assign_shift_left; +struct node_expr_assign_shift_right; +struct node_expr_assign_bitwise_or; +struct node_expr_assign_bitwise_and; +struct node_expr_assign_bitwise_exor; +struct node_expr_increment; +struct node_expr_decrement; +struct node_stmt_list; +struct node_stmt_call; +struct node_stmt_assign; +struct node_stmt_endon; +struct node_stmt_notify; +struct node_stmt_wait; +struct node_stmt_waittill; +struct node_stmt_waittillmatch; +struct node_stmt_waittillframeend; +struct node_stmt_waitframe; +struct node_stmt_if; +struct node_stmt_ifelse; +struct node_stmt_while; +struct node_stmt_for; +struct node_stmt_foreach; +struct node_stmt_switch; +struct node_stmt_case; +struct node_stmt_default; +struct node_stmt_break; +struct node_stmt_continue; +struct node_stmt_return; +struct node_parameters; +struct node_thread; +struct node_constant; +struct node_usingtree; +struct node_include; +struct node_program; +struct node_asm_loc; +struct node_asm_jump; +struct node_asm_jump_back; +struct node_asm_jump_cond; +struct node_asm_jump_false_expr; +struct node_asm_jump_true_expr; +struct node_asm_switch; +struct node_asm_endswitch; +struct node_asm_create; +struct node_asm_access; +struct node_asm_remove; +struct node_asm_clear; + +using node_ptr = std::unique_ptr; +using true_ptr = std::unique_ptr; +using false_ptr = std::unique_ptr; +using integer_ptr = std::unique_ptr; +using float_ptr = std::unique_ptr; +using vector_ptr = std::unique_ptr; +using string_ptr = std::unique_ptr; +using istring_ptr = std::unique_ptr; +using file_ptr = std::unique_ptr; +using name_ptr = std::unique_ptr; +using animtree_ptr = std::unique_ptr; +using animation_ptr = std::unique_ptr; +using level_ptr = std::unique_ptr; +using anim_ptr = std::unique_ptr; +using self_ptr = std::unique_ptr; +using game_ptr = std::unique_ptr; +using undefined_ptr = std::unique_ptr; +using empty_array_ptr = std::unique_ptr; +using thisthread_ptr = std::unique_ptr; +using expr_size_ptr = std::unique_ptr; +using expr_field_ptr = std::unique_ptr; +using expr_array_ptr = std::unique_ptr; +using expr_add_array_ptr = std::unique_ptr; +using expr_function_ptr = std::unique_ptr; +using expr_arguments_ptr = std::unique_ptr; +using expr_call_pointer_ptr = std::unique_ptr; +using expr_call_function_ptr = std::unique_ptr; +using expr_call_ptr = std::unique_ptr; +using expr_complement_ptr = std::unique_ptr; +using expr_not_ptr = std::unique_ptr; +using expr_binary_ptr = std::unique_ptr; +using expr_add_ptr = std::unique_ptr; +using expr_sub_ptr = std::unique_ptr; +using expr_mult_ptr = std::unique_ptr; +using expr_div_ptr = std::unique_ptr; +using expr_mod_ptr = std::unique_ptr; +using expr_shift_left_ptr = std::unique_ptr; +using expr_shift_right_ptr = std::unique_ptr; +using expr_bitwise_or_ptr = std::unique_ptr; +using expr_bitwise_and_ptr = std::unique_ptr; +using expr_bitwise_exor_ptr = std::unique_ptr; +using expr_equality_ptr = std::unique_ptr; +using expr_inequality_ptr = std::unique_ptr; +using expr_less_equal_ptr = std::unique_ptr; +using expr_greater_equal_ptr = std::unique_ptr; +using expr_less_ptr = std::unique_ptr; +using expr_greater_ptr = std::unique_ptr; +using expr_or_ptr = std::unique_ptr; +using expr_and_ptr = std::unique_ptr; +using expr_assign_ptr = std::unique_ptr; +using expr_assign_equal_ptr = std::unique_ptr; +using expr_assign_add_ptr = std::unique_ptr; +using expr_assign_sub_ptr = std::unique_ptr; +using expr_assign_mult_ptr = std::unique_ptr; +using expr_assign_div_ptr = std::unique_ptr; +using expr_assign_mod_ptr = std::unique_ptr; +using expr_assign_shift_left_ptr = std::unique_ptr; +using expr_assign_shift_right_ptr = std::unique_ptr; +using expr_assign_bitwise_or_ptr = std::unique_ptr; +using expr_assign_bitwise_and_ptr = std::unique_ptr; +using expr_assign_bitwise_exor_ptr = std::unique_ptr; +using expr_increment_ptr = std::unique_ptr; +using expr_decrement_ptr = std::unique_ptr; +using stmt_list_ptr = std::unique_ptr; +using stmt_call_ptr = std::unique_ptr; +using stmt_assign_ptr = std::unique_ptr; +using stmt_endon_ptr = std::unique_ptr; +using stmt_notify_ptr = std::unique_ptr; +using stmt_wait_ptr = std::unique_ptr; +using stmt_waittill_ptr = std::unique_ptr; +using stmt_waittillmatch_ptr = std::unique_ptr; +using stmt_waitframe_ptr = std::unique_ptr; +using stmt_waittillframeend_ptr = std::unique_ptr; +using stmt_if_ptr = std::unique_ptr; +using stmt_ifelse_ptr = std::unique_ptr; +using stmt_while_ptr = std::unique_ptr; +using stmt_for_ptr = std::unique_ptr; +using stmt_foreach_ptr = std::unique_ptr; +using stmt_switch_ptr = std::unique_ptr; +using stmt_case_ptr = std::unique_ptr; +using stmt_default_ptr = std::unique_ptr; +using stmt_break_ptr = std::unique_ptr; +using stmt_continue_ptr = std::unique_ptr; +using stmt_return_ptr = std::unique_ptr; +using parameters_ptr = std::unique_ptr; +using thread_ptr = std::unique_ptr; +using constant_ptr = std::unique_ptr; +using usingtree_ptr = std::unique_ptr; +using include_ptr = std::unique_ptr; +using program_ptr = std::unique_ptr; +using asm_loc_ptr = std::unique_ptr; +using asm_jump_ptr = std::unique_ptr; +using asm_jump_back_ptr = std::unique_ptr; +using asm_jump_cond_ptr = std::unique_ptr; +using asm_jump_false_expr_ptr = std::unique_ptr; +using asm_jump_true_expr_ptr = std::unique_ptr; +using asm_switch_ptr = std::unique_ptr; +using asm_endswitch_ptr = std::unique_ptr; +using asm_create_ptr = std::unique_ptr; +using asm_access_ptr = std::unique_ptr; +using asm_remove_ptr = std::unique_ptr; +using asm_clear_ptr = std::unique_ptr; + +union expr_call_type_ptr +{ + node_ptr as_node; + expr_call_pointer_ptr as_pointer; + expr_call_function_ptr as_func; + + expr_call_type_ptr() {} + expr_call_type_ptr(node_ptr val): as_node(std::move(val)) {} + expr_call_type_ptr(expr_call_type_ptr && val) { new(&as_node) node_ptr(std::move(val.as_node)); } + ~expr_call_type_ptr(){} +}; + +union expr_ptr +{ + node_ptr as_node; + true_ptr as_true; + false_ptr as_false; + integer_ptr as_integer; + float_ptr as_float; + vector_ptr as_vector; + string_ptr as_string; + istring_ptr as_istring; + file_ptr as_file; + name_ptr as_name; + animtree_ptr as_animtree; + animation_ptr as_animation; + level_ptr as_level; + anim_ptr as_anim; + self_ptr as_self; + game_ptr as_game; + undefined_ptr as_undefined; + empty_array_ptr as_empty_array; + thisthread_ptr as_thisthread; + expr_size_ptr as_size; + expr_field_ptr as_field; + expr_array_ptr as_array; + expr_add_array_ptr as_add_array; + expr_function_ptr as_function; + expr_arguments_ptr as_arguments; + expr_call_pointer_ptr as_call_pointer; + expr_call_function_ptr as_call_function; + expr_call_ptr as_call; + expr_complement_ptr as_complement; + expr_not_ptr as_not; + expr_add_ptr as_add; + expr_sub_ptr as_sub; + expr_mult_ptr as_mult; + expr_div_ptr as_div; + expr_mod_ptr as_mod; + expr_shift_left_ptr as_shift_left; + expr_shift_right_ptr as_shift_right; + expr_bitwise_or_ptr as_bitwise_or; + expr_bitwise_and_ptr as_bitwise_and; + expr_bitwise_exor_ptr as_bitwise_exor; + expr_equality_ptr as_equality; + expr_inequality_ptr as_inequality; + expr_less_equal_ptr as_less_equal; + expr_greater_equal_ptr as_greater_equal; + expr_less_ptr as_less; + expr_greater_ptr as_greater; + expr_or_ptr as_or; + expr_and_ptr as_and; + expr_binary_ptr as_binary; + expr_assign_ptr as_assign; + expr_assign_equal_ptr as_assign_equal; + expr_assign_add_ptr as_assign_add; + expr_assign_sub_ptr as_assign_sub; + expr_assign_mult_ptr as_assign_mult; + expr_assign_div_ptr as_assign_div; + expr_assign_mod_ptr as_assign_mod; + expr_assign_shift_left_ptr as_assign_shift_left; + expr_assign_shift_right_ptr as_assign_shift_right; + expr_assign_bitwise_or_ptr as_assign_bw_or; + expr_assign_bitwise_and_ptr as_assign_bw_and; + expr_assign_bitwise_exor_ptr as_assign_bw_xor; + expr_increment_ptr as_increment; + expr_decrement_ptr as_decrement; + asm_create_ptr as_asm_create; + asm_access_ptr as_asm_access; + + expr_ptr() {} + expr_ptr(node_ptr val): as_node(std::move(val)) {} + expr_ptr (expr_ptr && val) + { + new(&as_node) node_ptr(std::move(val.as_node)); + } + + expr_ptr& operator=(expr_ptr && val) + { + new(&as_node) node_ptr(std::move(val.as_node)); + return *(expr_ptr*)&as_node; + } + ~expr_ptr(){} +}; + +union stmt_ptr +{ + node_ptr as_node; + stmt_list_ptr as_list; + stmt_call_ptr as_call; + stmt_assign_ptr as_assign; + stmt_endon_ptr as_endon; + stmt_notify_ptr as_notify; + stmt_wait_ptr as_wait; + stmt_waittill_ptr as_waittill; + stmt_waittillmatch_ptr as_waittillmatch; + stmt_waittillframeend_ptr as_waittillframeend; + stmt_waitframe_ptr as_waitframe; + stmt_if_ptr as_if; + stmt_ifelse_ptr as_ifelse; + stmt_while_ptr as_while; + stmt_for_ptr as_for; + stmt_foreach_ptr as_foreach; + stmt_switch_ptr as_switch; + stmt_case_ptr as_case; + stmt_default_ptr as_default; + stmt_break_ptr as_break; + stmt_continue_ptr as_continue; + stmt_return_ptr as_return; + asm_loc_ptr as_loc; + asm_jump_cond_ptr as_cond; + asm_jump_ptr as_jump; + asm_jump_back_ptr as_jump_back; + asm_switch_ptr as_asm_switch; + asm_endswitch_ptr as_asm_endswitch; + asm_create_ptr as_asm_create; + asm_access_ptr as_asm_access; + asm_remove_ptr as_asm_remove; + asm_clear_ptr as_asm_clear; + + stmt_ptr() {} + stmt_ptr(node_ptr val): as_node(std::move(val)) {} + stmt_ptr(const stmt_ptr &) = delete; + stmt_ptr & operator=(const stmt_ptr &) = delete; + + stmt_ptr (stmt_ptr && val) { new(&as_node) node_ptr(std::move(val.as_node)); } + stmt_ptr& operator=(stmt_ptr &&val ) + { + new(&as_node) node_ptr(std::move(val.as_node)); + return *(stmt_ptr*)&as_node; + } + ~stmt_ptr(){} +}; + +union define_ptr +{ + node_ptr as_node; + usingtree_ptr as_usingtree; + constant_ptr as_constant; + thread_ptr as_thread; + + define_ptr() {} + define_ptr(node_ptr val): as_node(std::move(val)) {} + define_ptr(define_ptr && val) { new(&as_node) node_ptr(std::move(val.as_node)); } + ~define_ptr(){} +}; + +struct node +{ + node_t type; + location loc; + + node() : type(node_t::null) {} + node(node_t type) : type(type) {} + node(node_t type, const location& loc) : type(type), loc(loc) {} + node(const location& loc) : type(node_t::null), loc(loc) {} + + virtual ~node() = default; + virtual auto print() -> std::string { return ""; }; + +protected: + static std::uint32_t indent_; + static void reset_indentation() { indent_ = 0; } + static std::string indented(std::uint32_t indent) + { + static char buff[100]; + snprintf(buff, sizeof(buff), "%*s", indent, ""); + return std::string(buff); + } + +public: + static auto is_special_stmt(const gsc::stmt_ptr& stmt) -> bool + { + switch(stmt.as_node->type) + { + case gsc::node_t::stmt_if: + case gsc::node_t::stmt_ifelse: + case gsc::node_t::stmt_while: + case gsc::node_t::stmt_for: + case gsc::node_t::stmt_foreach: + case gsc::node_t::stmt_switch: + return true; + default: + return false; + } + } + + static auto is_special_stmt_noif(const stmt_ptr& stmt) -> bool + { + switch(stmt.as_node->type) + { + case gsc::node_t::stmt_while: + case gsc::node_t::stmt_for: + case gsc::node_t::stmt_foreach: + case gsc::node_t::stmt_switch: + return true; + default: + return false; + } + } +}; + +struct node_true : public node +{ + node_true() : node(node_t::data_true) {} + node_true(const location& loc) : node(node_t::data_true, loc) {} + + auto print() -> std::string override + { + return "true"; + } +}; + +struct node_false : public node +{ + node_false() : node(node_t::data_false) {} + node_false(const location& loc) : node(node_t::data_false, loc) {} + + auto print() -> std::string override + { + return "false"; + } +}; + +struct node_integer : public node +{ + std::string value; + + node_integer(const std::string& value) + : node(node_t::data_integer), value(std::move(value)) {} + + node_integer(const location& loc, const std::string& value) + : node(node_t::data_integer, loc), value(std::move(value)) {} + + auto print() -> std::string override + { + return value; + } +}; + +struct node_float : public node +{ + std::string value; + + node_float(const std::string& value) + : node(node_t::data_float), value(std::move(value)) {} + + node_float(const location& loc, const std::string& value) + : node(node_t::data_float, loc), value(std::move(value)) {} + + auto print() -> std::string override + { + return value; + } +}; + +struct node_vector : public node +{ + expr_ptr x; + expr_ptr y; + expr_ptr z; + + node_vector(expr_ptr x, expr_ptr y, expr_ptr z) + : node(node_t::data_vector), x(std::move(x)), y(std::move(y)), z(std::move(z)) {} + + node_vector(const location& loc, expr_ptr x, expr_ptr y, expr_ptr z) + : node(node_t::data_vector, loc), x(std::move(x)), y(std::move(y)), z(std::move(z)) {} + + auto print() -> std::string override + { + return "( "s + x.as_node->print() + ", " + y.as_node->print() + ", "+ z.as_node->print() + " )"; + } +}; + +struct node_string : public node +{ + std::string value; + + node_string(const std::string& value) + : node(node_t::data_string), value(value) {} + + node_string(const location& loc, const std::string& value) + : node(node_t::data_string, loc), value(value) {} + + auto print() -> std::string override + { + return value; + } +}; + +struct node_istring : public node +{ + std::string value; + + node_istring(const std::string& value) + : node(node_t::data_istring), value(std::move(value)) {} + + node_istring(const location& loc, const std::string& value) + : node(node_t::data_istring, loc), value(std::move(value)) {} + + auto print() -> std::string override + { + return "&"s += value; + } +}; + +struct node_file : public node +{ + std::string value; + + node_file() : node(node_t::data_file) {} + + node_file(const std::string& value) + : node(node_t::data_file), value(value) {} + + node_file(const location& loc) + : node(node_t::data_file, loc) {} + + node_file(const location& loc, const std::string& value) + : node(node_t::data_file, loc), value(value) {} + + auto print() -> std::string override + { + return value; + } +}; + +struct node_name : public node +{ + std::string value; + + node_name(const std::string& value) + : node(node_t::data_name), value(value) {} + + node_name(const location& loc, const std::string& value) + : node(node_t::data_name, loc), value(value) {} + + auto print() -> std::string override + { + return value; + } +}; + +struct node_animtree : public node +{ + node_animtree() : node(node_t::data_animtree) {} + + node_animtree(const location& loc) : node(node_t::data_animtree, loc) {} + + auto print() -> std::string override + { + return "#animtree"; + } +}; + +struct node_animation : public node +{ + std::string value; + + node_animation(const std::string& value) + : node(node_t::data_animation), value(value) {} + + node_animation(const location& loc, const std::string& value) + : node(node_t::data_animation, loc), value(value) {} + + auto print() -> std::string override + { + return "%"s += value; + } +}; + +struct node_level : public node +{ + node_level() : node(node_t::data_level) {} + + node_level(const location& loc) : node(node_t::data_level, loc) {} + + auto print() -> std::string override + { + return "level"; + } +}; + +struct node_anim : public node +{ + node_anim() : node(node_t::data_anim) {} + + node_anim(const location& loc) : node(node_t::data_anim, loc) {} + + auto print() -> std::string override + { + return "anim"; + } +}; + +struct node_self : public node +{ + node_self() : node(node_t::data_self) {} + + node_self(const location& loc) : node(node_t::data_self, loc) {} + + auto print() -> std::string override + { + return "self"; + } +}; + +struct node_game : public node +{ + node_game() : node(node_t::data_game) {} + + node_game(const location& loc) : node(node_t::data_game, loc) {} + + auto print() -> std::string override + { + return "game"; + } +}; + +struct node_undefined : public node +{ + node_undefined() : node(node_t::data_undefined) {} + + node_undefined(const location& loc) : node(node_t::data_undefined, loc) {} + + auto print() -> std::string override + { + return "undefined"; + } +}; + +struct node_empty_array : public node +{ + node_empty_array() : node(node_t::data_empty_array) {} + + node_empty_array(const location& loc) : node(node_t::data_empty_array, loc) {} + + auto print() -> std::string override + { + return "[]"; + } +}; + +struct node_thisthread : public node +{ + node_thisthread() : node(node_t::data_thisthread) {} + + node_thisthread(const location& loc) : node(node_t::data_thisthread, loc) {} + + auto print() -> std::string override + { + return "thisthread"; + } +}; + +struct node_expr_size : public node +{ + expr_ptr obj; + + node_expr_size(expr_ptr obj) + : node(node_t::expr_size), obj(std::move(obj)) {} + + node_expr_size(const location& loc, expr_ptr obj) + : node(node_t::expr_size, loc), obj(std::move(obj)) {} + + auto print() -> std::string override + { + return obj.as_node->print() + ".size"; + } +}; + +struct node_expr_field : public node +{ + expr_ptr obj; + name_ptr field; + + node_expr_field(expr_ptr obj, name_ptr field) + : node(node_t::expr_field), obj(std::move(obj)), field(std::move(field)) {} + + node_expr_field(const location& loc, expr_ptr obj, name_ptr field) + : node(node_t::expr_field, loc), obj(std::move(obj)), field(std::move(field)) {} + + auto print() -> std::string override + { + return obj.as_node->print() + "." + field->print(); + } +}; + +struct node_expr_array : public node +{ + expr_ptr obj; + expr_ptr key; + + node_expr_array(expr_ptr obj, expr_ptr key) + : node(node_t::expr_array), obj(std::move(obj)), key(std::move(key)) {} + + node_expr_array(const location& loc, expr_ptr obj, expr_ptr key) + : node(node_t::expr_array, loc), obj(std::move(obj)), key(std::move(key)) {} + + auto print() -> std::string override + { + return obj.as_node->print() + "[" + key.as_node->print() + "]"; + } +}; + +struct node_expr_arguments : public node +{ + std::vector list; + + node_expr_arguments() : node(node_t::expr_arguments) {} + + node_expr_arguments(const location& loc) : node(node_t::expr_arguments, loc) {} + + auto print() -> std::string override + { + std::string data; + + for (const auto& arg : list) + { + data += " " + arg.as_node->print(); + data += (&arg != &list.back()) ? "," : " "; + } + + return data; + } +}; + +struct node_expr_add_array : public node +{ + expr_arguments_ptr args; + + node_expr_add_array(expr_arguments_ptr args) + : node(node_t::expr_add_array), args(std::move(args)) {} + + node_expr_add_array(const location& loc, expr_arguments_ptr args) + : node(node_t::expr_add_array, loc), args(std::move(args)) {} + + auto print() -> std::string override + { + return "[" + args->print() + "]"; + } +}; + +struct node_expr_function : public node +{ + file_ptr file; + name_ptr name; + + node_expr_function(file_ptr file, name_ptr name) + : node(node_t::expr_function), file(std::move(file)), name(std::move(name)) {} + + node_expr_function(const location& loc, file_ptr file, name_ptr name) + : node(node_t::expr_function, loc), file(std::move(file)), name(std::move(name)) {} + + auto print() -> std::string override + { + return file->print() + "::" + name->print(); + } +}; + +struct node_expr_call_pointer : public node +{ + expr_ptr expr; + expr_arguments_ptr args; + bool builtin; + + node_expr_call_pointer(bool builtin, expr_ptr expr, expr_arguments_ptr args) + : node(node_t::expr_call_pointer), builtin(builtin), expr(std::move(expr)), args(std::move(args)) {} + + node_expr_call_pointer(const location& loc, bool builtin, expr_ptr expr, expr_arguments_ptr args) + : node(node_t::expr_call_pointer, loc), builtin(builtin), expr(std::move(expr)), args(std::move(args)) {} + + auto print() -> std::string override + { + if(builtin) + return "call [[ "s + expr.as_node->print() + " ]](" + args->print() + ")"; + else + return "[[ "s + expr.as_node->print() + " ]](" + args->print() + ")"; + } +}; + +struct node_expr_call_function : public node +{ + file_ptr file; + name_ptr name; + expr_arguments_ptr args; + + node_expr_call_function(file_ptr file, name_ptr name, expr_arguments_ptr args) + : node(node_t::expr_call_function), file(std::move(file)), name(std::move(name)), args(std::move(args)) {} + + node_expr_call_function(const location& loc, file_ptr file, name_ptr name, expr_arguments_ptr args) + : node(node_t::expr_call_function, loc), file(std::move(file)), name(std::move(name)), args(std::move(args)) {} + + auto print() -> std::string override + { + if(file->value == "") return name->print() + "(" + args->print() + ")"; + + return file->print() + "::" + name->print() + "(" + args->print() + ")"; + } +}; + +struct node_expr_call : public node +{ + expr_ptr obj; + expr_call_type_ptr func; + bool thread; + bool child; + + node_expr_call(bool thread, bool child, expr_ptr obj, expr_call_type_ptr func) + : node(node_t::expr_call), thread(thread), child(child), obj(std::move(obj)), func(std::move(func)){} + + node_expr_call(const location& loc, bool thread, bool child, expr_ptr obj, expr_call_type_ptr func) + : node(node_t::expr_call, loc), thread(thread), child(child), obj(std::move(obj)), func(std::move(func)){} + + auto print() -> std::string override + { + if(thread) + { + if(obj.as_node->type == node_t::null) return "thread " + func.as_node->print(); + return obj.as_node->print() + " thread " + func.as_node->print(); + } + + if(child) + { + if(obj.as_node->type == node_t::null) return "childthread " + func.as_node->print(); + return obj.as_node->print() + " childthread " + func.as_node->print(); + } + + if(obj.as_node->type == node_t::null) return func.as_node->print(); + return obj.as_node->print() + " " + func.as_node->print(); + } +}; + +struct node_expr_complement : public node +{ + expr_ptr rvalue; + + node_expr_complement(expr_ptr rvalue) + : node(node_t::expr_complement), rvalue(std::move(rvalue)) {} + + node_expr_complement(const location& loc, expr_ptr rvalue) + : node(node_t::expr_complement, loc), rvalue(std::move(rvalue)) {} + + auto print() -> std::string override + { + return "~" + rvalue.as_node->print(); + } +}; + +struct node_expr_not : public node +{ + expr_ptr rvalue; + + node_expr_not(expr_ptr rvalue) + : node(node_t::expr_not), rvalue(std::move(rvalue)) {} + + node_expr_not(const location& loc, expr_ptr rvalue) + : node(node_t::expr_not, loc), rvalue(std::move(rvalue)) {} + + auto print() -> std::string override + { + return "!" + rvalue.as_node->print(); + } +}; + +struct node_expr_binary : public node +{ + expr_ptr lvalue; + expr_ptr rvalue; + + node_expr_binary(node_t type, expr_ptr lvalue, expr_ptr rvalue) + : node(type), lvalue(std::move(lvalue)), rvalue(std::move(rvalue)) {} + + node_expr_binary(node_t type, const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node(type, loc), lvalue(std::move(lvalue)), rvalue(std::move(rvalue)) {} +}; + +struct node_expr_add : public node_expr_binary +{ + node_expr_add(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_add, std::move(lvalue), std::move(rvalue)) {} + + node_expr_add(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_add, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " + " + rvalue.as_node->print(); + } +}; + +struct node_expr_sub : public node_expr_binary +{ + node_expr_sub(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_sub, std::move(lvalue), std::move(rvalue)) {} + + node_expr_sub(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_sub, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " - " + rvalue.as_node->print(); + } +}; + +struct node_expr_mult : public node_expr_binary +{ + node_expr_mult( expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_mult, std::move(lvalue), std::move(rvalue)) {} + + node_expr_mult(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_mult, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " * " + rvalue.as_node->print(); + } +}; + +struct node_expr_div : public node_expr_binary +{ + node_expr_div(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_div, std::move(lvalue), std::move(rvalue)) {} + + node_expr_div(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_div, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " / " + rvalue.as_node->print(); + } +}; + +struct node_expr_mod : public node_expr_binary +{ + node_expr_mod(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_mod, std::move(lvalue), std::move(rvalue)) {} + + node_expr_mod(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_mod, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " % " + rvalue.as_node->print(); + } +}; + +struct node_expr_shift_left : public node_expr_binary +{ + node_expr_shift_left(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_shift_left, std::move(lvalue), std::move(rvalue)) {} + + node_expr_shift_left(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_shift_left, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " << " + rvalue.as_node->print(); + } +}; + +struct node_expr_shift_right : public node_expr_binary +{ + node_expr_shift_right(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_shift_right, std::move(lvalue), std::move(rvalue)) {} + + node_expr_shift_right(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_shift_right, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " >> " + rvalue.as_node->print(); + } +}; + +struct node_expr_bitwise_or : public node_expr_binary +{ + node_expr_bitwise_or(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_bitwise_or, std::move(lvalue), std::move(rvalue)) {} + + node_expr_bitwise_or(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_bitwise_or, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " | " + rvalue.as_node->print(); + } +}; + +struct node_expr_bitwise_and : public node_expr_binary +{ + node_expr_bitwise_and(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_bitwise_and, std::move(lvalue), std::move(rvalue)) {} + + node_expr_bitwise_and(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_bitwise_and, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " & " + rvalue.as_node->print(); + } +}; + +struct node_expr_bitwise_exor : public node_expr_binary +{ + node_expr_bitwise_exor(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_bitwise_exor, std::move(lvalue), std::move(rvalue)) {} + + node_expr_bitwise_exor(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_bitwise_exor, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " ^ " + rvalue.as_node->print(); + } +}; + +struct node_expr_equality : public node_expr_binary +{ + node_expr_equality(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_equality, std::move(lvalue), std::move(rvalue)) {} + + node_expr_equality(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_equality, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " == " + rvalue.as_node->print(); + } +}; + +struct node_expr_inequality : public node_expr_binary +{ + node_expr_inequality(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_inequality, std::move(lvalue), std::move(rvalue)) {} + + node_expr_inequality(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_inequality, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " != " + rvalue.as_node->print(); + } +}; + +struct node_expr_less_equal : public node_expr_binary +{ + node_expr_less_equal(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_less_equal, std::move(lvalue), std::move(rvalue)) {} + + node_expr_less_equal(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_less_equal, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " <= " + rvalue.as_node->print(); + } +}; + +struct node_expr_greater_equal : public node_expr_binary +{ + node_expr_greater_equal(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_greater_equal, std::move(lvalue), std::move(rvalue)) {} + + node_expr_greater_equal(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_greater_equal, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " >= " + rvalue.as_node->print(); + } +}; + +struct node_expr_less : public node_expr_binary +{ + node_expr_less(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_less, std::move(lvalue), std::move(rvalue)) {} + + node_expr_less(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_less, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " < " + rvalue.as_node->print(); + } +}; + +struct node_expr_greater : public node_expr_binary +{ + node_expr_greater(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_greater, std::move(lvalue), std::move(rvalue)) {} + + node_expr_greater(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_greater, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " > " + rvalue.as_node->print(); + } +}; + +struct node_expr_or : public node_expr_binary +{ + node_expr_or(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_or, std::move(lvalue), std::move(rvalue)) {} + + node_expr_or(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_or, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " || " + rvalue.as_node->print(); + } +}; + +struct node_expr_and : public node_expr_binary +{ + node_expr_and(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_and, std::move(lvalue), std::move(rvalue)) {} + + node_expr_and(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_binary(node_t::expr_and, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " && " + rvalue.as_node->print(); + } +}; + +struct node_expr_assign: public node +{ + expr_ptr lvalue; + expr_ptr rvalue; + + node_expr_assign(node_t type, expr_ptr lvalue, expr_ptr rvalue) + : node(type), lvalue(std::move(lvalue)), rvalue(std::move(rvalue)) {} + + node_expr_assign(node_t type, const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node(type, loc), lvalue(std::move(lvalue)), rvalue(std::move(rvalue)) {} +}; + +struct node_expr_assign_equal : public node_expr_assign +{ + node_expr_assign_equal(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_equal, std::move(lvalue), std::move(rvalue)) {} + + node_expr_assign_equal(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_equal, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " = " + rvalue.as_node->print() ; + }; +}; + +struct node_expr_assign_add : public node_expr_assign +{ + node_expr_assign_add(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_add, std::move(lvalue), std::move(rvalue)) {} + + node_expr_assign_add(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_add, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " += " + rvalue.as_node->print() ; + }; +}; + +struct node_expr_assign_sub : public node_expr_assign +{ + node_expr_assign_sub(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_sub, std::move(lvalue), std::move(rvalue)) {} + + node_expr_assign_sub(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_sub, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " -= " + rvalue.as_node->print() ; + }; +}; + +struct node_expr_assign_mult : public node_expr_assign +{ + node_expr_assign_mult(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_mult, std::move(lvalue), std::move(rvalue)) {} + + node_expr_assign_mult(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_mult, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " *= " + rvalue.as_node->print() ; + }; +}; + +struct node_expr_assign_div : public node_expr_assign +{ + node_expr_assign_div(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_div, std::move(lvalue), std::move(rvalue)) {} + + node_expr_assign_div(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_div, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " /= " + rvalue.as_node->print() ; + }; +}; + +struct node_expr_assign_mod : public node_expr_assign +{ + node_expr_assign_mod(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_mod, std::move(lvalue), std::move(rvalue)) {} + + node_expr_assign_mod(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_mod, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " %= " + rvalue.as_node->print() ; + }; +}; + +struct node_expr_assign_shift_left : public node_expr_assign +{ + node_expr_assign_shift_left(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_shift_left, std::move(lvalue), std::move(rvalue)) {} + + node_expr_assign_shift_left(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_shift_left, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " <<= " + rvalue.as_node->print() ; + }; +}; + +struct node_expr_assign_shift_right : public node_expr_assign +{ + node_expr_assign_shift_right(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_shift_right, std::move(lvalue), std::move(rvalue)) {} + + node_expr_assign_shift_right(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_shift_right, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " >>= " + rvalue.as_node->print() ; + }; +}; + +struct node_expr_assign_bitwise_or : public node_expr_assign +{ + node_expr_assign_bitwise_or(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_bitwise_or, std::move(lvalue), + std::move(rvalue)) {} + + node_expr_assign_bitwise_or(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_bitwise_or, loc, std::move(lvalue), + std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " |= " + rvalue.as_node->print(); + } +}; + +struct node_expr_assign_bitwise_and : public node_expr_assign +{ + node_expr_assign_bitwise_and(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_bitwise_and, std::move(lvalue), std::move(rvalue)) {} + + node_expr_assign_bitwise_and(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_bitwise_and, loc, std::move(lvalue), std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " &= " + rvalue.as_node->print(); + } +}; + +struct node_expr_assign_bitwise_exor : public node_expr_assign +{ + node_expr_assign_bitwise_exor(expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_bitwise_exor, std::move(lvalue), + std::move(rvalue)) {} + + node_expr_assign_bitwise_exor(const location& loc, expr_ptr lvalue, expr_ptr rvalue) + : node_expr_assign(node_t::expr_assign_bitwise_exor, loc, std::move(lvalue), + std::move(rvalue)) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + " ^= " + rvalue.as_node->print(); + } +}; + +struct node_expr_increment : public node_expr_assign +{ + node_expr_increment(expr_ptr lvalue) + : node_expr_assign(node_t::expr_increment, std::move(lvalue), std::make_unique()) {} + + node_expr_increment(const location& loc, expr_ptr lvalue) + : node_expr_assign(node_t::expr_increment, loc, std::move(lvalue), std::make_unique()) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + "++"; + } +}; + +struct node_expr_decrement : public node_expr_assign +{ + node_expr_decrement(expr_ptr lvalue) + : node_expr_assign(node_t::expr_decrement, std::move(lvalue), std::make_unique()) {} + + node_expr_decrement(const location& loc, expr_ptr lvalue) + : node_expr_assign(node_t::expr_decrement, loc, std::move(lvalue), std::make_unique()) {} + + auto print() -> std::string override + { + return lvalue.as_node->print() + "--"; + } +}; + +struct node_stmt_list : public node +{ + std::vector stmts; + bool is_case = false; + bool is_expr = false; + + node_stmt_list() : node(node_t::stmt_list) {} + + node_stmt_list(const location& loc) : node(node_t::stmt_list, loc) {} + + auto print() -> std::string override + { + if(is_expr) + { + if(stmts.size() > 0) return stmts[0].as_node->print(); + else return ""; + } + + std::string data; + bool last_special = false; + auto block_pad = indented(indent_); + indent_ += 4; + + auto stmts_pad = indented(indent_); + + if(!is_case) + data += block_pad + "{\n"; + + for (const auto& stmt : stmts) + { + if (&stmt != &stmts.front() && is_special_stmt(stmt) || last_special) + data += "\n"; + + data += stmts_pad + stmt.as_node->print(); + + if (&stmt != &stmts.back()) + data += "\n"; + + if(is_special_stmt(stmt)) + last_special = true; + else + last_special = false; + } + + indent_ -= 4; + + if(!is_case) + data += "\n" + block_pad + "}"; + + return data; + } +}; + +struct node_stmt_call : public node +{ + expr_call_ptr expr; + + node_stmt_call(expr_call_ptr expr) + : node(node_t::stmt_call), expr(std::move(expr)) {} + + node_stmt_call(const location& loc, expr_call_ptr expr) + : node(node_t::stmt_call, loc), expr(std::move(expr)) {} + + auto print()->std::string override + { + return expr->print() + ";"; + }; +}; + +struct node_stmt_assign : public node +{ + expr_assign_ptr expr; + + node_stmt_assign(expr_assign_ptr expr) + : node(node_t::stmt_assign), expr(std::move(expr)) {} + + node_stmt_assign(const location& loc, expr_assign_ptr expr) + : node(node_t::stmt_assign, loc), expr(std::move(expr)) {} + + auto print()->std::string override + { + return expr->print() + ";"; + }; +}; + +struct node_stmt_endon : public node +{ + expr_ptr obj; + expr_ptr expr; + + node_stmt_endon(expr_ptr obj, expr_ptr expr) + : node(node_t::stmt_endon), obj(std::move(obj)), expr(std::move(expr)) {} + + node_stmt_endon(const location& loc, expr_ptr obj, expr_ptr expr) + : node(node_t::stmt_endon, loc), obj(std::move(obj)), expr(std::move(expr)) {} + + auto print() -> std::string override + { + return obj.as_node->print() + " endon( " + expr.as_node->print() + " );"; + }; +}; + +struct node_stmt_notify : public node +{ + expr_ptr obj; + expr_ptr expr; + expr_arguments_ptr args; + + node_stmt_notify(expr_ptr obj, expr_ptr expr, expr_arguments_ptr args) + : node(node_t::stmt_notify), obj(std::move(obj)), expr(std::move(expr)), args(std::move(args)) {} + + node_stmt_notify(const location& loc, expr_ptr obj, expr_ptr expr, expr_arguments_ptr args) + : node(node_t::stmt_notify, loc), obj(std::move(obj)), expr(std::move(expr)), args(std::move(args)) {} + + auto print() -> std::string override + { + if (args->list.size() == 0) + return obj.as_node->print() + " notify( " + expr.as_node->print() + " );"; + else + return obj.as_node->print() + " notify( " + expr.as_node->print() + ", " + args->print() + " );"; + }; +}; + +struct node_stmt_wait : public node +{ + expr_ptr expr; + + node_stmt_wait(expr_ptr expr) + : node(node_t::stmt_wait), expr(std::move(expr)) {} + + node_stmt_wait(const location& loc, expr_ptr expr) + : node(node_t::stmt_wait, loc), expr(std::move(expr)) {} + + auto print() -> std::string override + { + if(expr.as_node->type == node_t::data_float || expr.as_node->type == node_t::data_integer) + return "wait " + expr.as_node->print() + ";"; + else + return "wait(" + expr.as_node->print() + ");"; + }; +}; + +struct node_stmt_waittill : public node +{ + expr_ptr obj; + expr_ptr expr; + expr_arguments_ptr args; + + node_stmt_waittill(expr_ptr obj, expr_ptr expr, expr_arguments_ptr args) + : node(node_t::stmt_waittill), obj(std::move(obj)), expr(std::move(expr)), args(std::move(args)) {} + + node_stmt_waittill(const location& loc, expr_ptr obj, expr_ptr expr, expr_arguments_ptr args) + : node(node_t::stmt_waittill, loc), obj(std::move(obj)), expr(std::move(expr)), args(std::move(args)) {} + + auto print() -> std::string override + { + if (args->list.size() == 0) + return obj.as_node->print() + " waittill( " + expr.as_node->print() + " );"; + else + return obj.as_node->print() + " waittill( " + expr.as_node->print() + ", " + args->print() + " );"; + }; +}; + +struct node_stmt_waittillmatch : public node +{ + expr_ptr obj; + expr_ptr expr; + expr_arguments_ptr args; + + node_stmt_waittillmatch(expr_ptr obj, expr_ptr expr, expr_arguments_ptr args) + : node(node_t::stmt_waittillmatch), obj(std::move(obj)), expr(std::move(expr)), args(std::move(args)) {} + + node_stmt_waittillmatch(const location& loc, expr_ptr obj, expr_ptr expr, expr_arguments_ptr args) + : node(node_t::stmt_waittillmatch, loc), obj(std::move(obj)), expr(std::move(expr)), args(std::move(args)) {} + + auto print() -> std::string override + { + if (args->list.size() == 0) + return obj.as_node->print() + " waittillmatch( " + expr.as_node->print() + " );"; + else + return obj.as_node->print() + " waittillmatch( " + expr.as_node->print() + ", " + args->print() + " );"; + }; +}; + +struct node_stmt_waittillframeend : public node +{ + node_stmt_waittillframeend() : node(node_t::stmt_waittillframeend) {} + + node_stmt_waittillframeend(const location& loc) : node(node_t::stmt_waittillframeend, loc) {} + + auto print() -> std::string override + { + return "waittillframeend;"; + }; +}; + +struct node_stmt_waitframe : public node +{ + node_stmt_waitframe() : node(node_t::stmt_waitframe) {} + + node_stmt_waitframe(const location& loc) : node(node_t::stmt_waitframe, loc) {} + + auto print() -> std::string override + { + return "waitframe;"; + }; +}; + +struct node_stmt_if : public node +{ + expr_ptr expr; + stmt_ptr stmt; + context_ptr ctx; + + node_stmt_if(expr_ptr expr, stmt_ptr stmt) + : node(node_t::stmt_if), expr(std::move(expr)), stmt(std::move(stmt)) {} + + node_stmt_if(const location& loc, expr_ptr expr, stmt_ptr stmt) + : node(node_t::stmt_if, loc), expr(std::move(expr)), stmt(std::move(stmt)) {} + + auto print() -> std::string override + { + std::string data = "if ( " + expr.as_node->print() + " )\n"; + + if (stmt.as_node->type == node_t::stmt_list) + { + data += stmt.as_list->print(); + } + else + { + indent_ += 4; + data += indented(indent_) + stmt.as_node->print(); + indent_ -= 4; + } + + return data; + }; +}; + +struct node_stmt_ifelse : public node +{ + expr_ptr expr; + stmt_ptr stmt_if; + stmt_ptr stmt_else; + context_ptr ctx_if; + context_ptr ctx_else; + + node_stmt_ifelse(expr_ptr expr, stmt_ptr stmt_if, stmt_ptr stmt_else) + : node(node_t::stmt_ifelse), expr(std::move(expr)), stmt_if(std::move(stmt_if)), stmt_else(std::move(stmt_else)) {} + + node_stmt_ifelse(const location& loc, expr_ptr expr, stmt_ptr stmt_if, stmt_ptr stmt_else) + : node(node_t::stmt_ifelse, loc), expr(std::move(expr)), stmt_if(std::move(stmt_if)), stmt_else(std::move(stmt_else)) {} + + auto print() -> std::string override + { + std::string pad = indented(indent_); + std::string data = "if ( " + expr.as_node->print() + " )\n"; + + if (stmt_if.as_node->type == node_t::stmt_list) + { + data += stmt_if.as_node->print(); + } + else + { + indent_ += 4; + data += indented(indent_) + stmt_if.as_node->print(); + indent_ -= 4; + } + + data += "\n" + pad + "else"; + + if (stmt_else.as_node->type == node_t::stmt_list) + { + data += "\n" + stmt_else.as_list->print(); + } + else + { + if(stmt_else.as_node->type == node_t::stmt_if || stmt_else.as_node->type == node_t::stmt_ifelse) + { + data += " " + stmt_else.as_node->print(); + } + else + { + indent_ += 4; + data += "\n" + indented(indent_) + stmt_else.as_node->print(); + indent_ -= 4; + } + } + + return data; + }; +}; + +struct node_stmt_while : public node +{ + expr_ptr expr; + stmt_ptr stmt; + context_ptr ctx; + + node_stmt_while(expr_ptr expr, stmt_ptr stmt) + : node(node_t::stmt_while), expr(std::move(expr)), stmt(std::move(stmt)) {} + + node_stmt_while(const location& loc, expr_ptr expr, stmt_ptr stmt) + : node(node_t::stmt_while, loc), expr(std::move(expr)), stmt(std::move(stmt)) {} + + auto print() -> std::string override + { + std::string data; + + if (expr.as_node->type == node_t::null) + { + data += "while ( true )\n"; + } + else + { + data += "while ( " + expr.as_node->print() + " )\n"; + } + + std::string pad = indented(indent_); + + if (stmt.as_node->type == node_t::stmt_list) + { + data += stmt.as_node->print(); + } + else + { + indent_ += 4; + data += indented(indent_) + stmt.as_node->print(); + indent_ -= 4; + } + + return data; + }; +}; + +struct node_stmt_for : public node +{ + stmt_ptr pre_expr; + expr_ptr expr; + stmt_ptr post_expr; + stmt_ptr stmt; + context_ptr ctx; + context_ptr ctx_post; + std::vector vars; + + node_stmt_for(stmt_ptr pre_expr, expr_ptr expr, stmt_ptr post_expr, stmt_ptr stmt) + : node(node_t::stmt_for), pre_expr(std::move(pre_expr)), expr(std::move(expr)), + post_expr(std::move(post_expr)), stmt(std::move(stmt)) {} + + node_stmt_for(const location& loc, stmt_ptr pre_expr, expr_ptr expr, stmt_ptr post_expr, stmt_ptr stmt) + : node(node_t::stmt_for, loc), pre_expr(std::move(pre_expr)), expr(std::move(expr)), + post_expr(std::move(post_expr)), stmt(std::move(stmt)) {} + + auto print() -> std::string override + { + std::string data; + + if (expr.as_node->type == node_t::null) + { + data += "for (;;)\n"; + } + else + { + data += "for ( " + pre_expr.as_node->print() + "; " + expr.as_node->print() + "; " + post_expr.as_node->print() + " )"; + data += "\n"; + } + + if (stmt.as_node->type == node_t::stmt_list) + { + data += stmt.as_node->print(); + } + else + { + indent_ += 4; + data += indented(indent_) + stmt.as_node->print(); + indent_ -= 4; + } + + return data; + }; +}; + +struct node_stmt_foreach : public node +{ + expr_ptr array_expr; + expr_ptr value_expr; + expr_ptr key_expr; + expr_ptr array; + stmt_ptr pre_expr; + expr_ptr cond_expr; + stmt_ptr post_expr; + stmt_ptr stmt0; + stmt_ptr stmt; + context_ptr ctx; + context_ptr ctx_post; + bool use_key; + std::vector vars; + + node_stmt_foreach(const location& loc, stmt_ptr stmt, bool use_key) + : node(node_t::stmt_foreach, loc), stmt(std::move(stmt)), use_key(use_key) {} + + node_stmt_foreach(expr_ptr element, expr_ptr container, stmt_ptr stmt) + : node(node_t::stmt_foreach), value_expr(std::move(element)), array_expr(std::move(container)), + stmt(std::move(stmt)), use_key(false) {} + + node_stmt_foreach(expr_ptr key, expr_ptr element, expr_ptr container, stmt_ptr stmt) + : node(node_t::stmt_foreach), key_expr(std::move(key)), value_expr(std::move(element)), array_expr(std::move(container)), + stmt(std::move(stmt)), use_key(true) {} + + node_stmt_foreach(const location& loc, expr_ptr element, expr_ptr container, stmt_ptr stmt) + : node(node_t::stmt_foreach, loc), value_expr(std::move(element)), array_expr(std::move(container)), + stmt(std::move(stmt)), use_key(false) {} + + node_stmt_foreach(const location& loc, expr_ptr key, expr_ptr element, expr_ptr container, stmt_ptr stmt) + : node(node_t::stmt_foreach, loc), key_expr(std::move(key)), value_expr(std::move(element)), array_expr(std::move(container)), + stmt(std::move(stmt)), use_key(true) {} + + auto print() -> std::string override + { + std::string data; + + data += "foreach ( "; + + if(use_key) data += key_expr.as_node->print() + ", "; + + data += value_expr.as_node->print() + " in " + array_expr.as_node->print() + " )\n"; + + if (stmt.as_node->type == node_t::stmt_list) + { + data += stmt.as_node->print(); + } + else + { + indent_ += 4; + data += indented(indent_) + stmt.as_node->print(); + indent_ -= 4; + } + + return data; + }; +}; + +struct node_stmt_switch : public node +{ + expr_ptr expr; + stmt_list_ptr stmt; + context_ptr ctx; + + node_stmt_switch(expr_ptr expr, stmt_list_ptr stmt) + : node(node_t::stmt_switch), expr(std::move(expr)), stmt(std::move(stmt)) {} + + node_stmt_switch(const location& loc, expr_ptr expr, stmt_list_ptr stmt) + : node(node_t::stmt_switch, loc), expr(std::move(expr)), stmt(std::move(stmt)) {} + + auto print() -> std::string override + { + std::string data; + + data += "switch ( " + expr.as_node->print() + " )\n"; + data += stmt->print(); + + return data; + }; +}; + +struct node_stmt_case : public node +{ + expr_ptr value; + stmt_list_ptr stmt; + context_ptr ctx; + + node_stmt_case(expr_ptr value) + : node(node_t::stmt_case), value(std::move(value)) {} + + node_stmt_case(const location& loc, expr_ptr value) + : node(node_t::stmt_case, loc), value(std::move(value)) {} + + node_stmt_case(const location& loc, expr_ptr value, stmt_list_ptr stmt) + : node(node_t::stmt_case, loc), value(std::move(value)), stmt(std::move(stmt)) {} + + auto print() -> std::string override + { + if(stmt->stmts.size() == 0) + return "case " + value.as_node->print() + ":"; + else + return "case " + value.as_node->print() + ":\n" + stmt->print(); + }; +}; + +struct node_stmt_default : public node +{ + stmt_list_ptr stmt; + context_ptr ctx; + + node_stmt_default() + : node(node_t::stmt_default) {} + + node_stmt_default(const location& loc) + : node(node_t::stmt_default, loc) {} + + node_stmt_default(const location& loc, stmt_list_ptr stmt) + : node(node_t::stmt_default, loc), stmt(std::move(stmt)) {} + + auto print() -> std::string override + { + if(stmt->stmts.size() == 0) + return "default:"; + else + return "default:\n" + stmt->print(); + }; +}; + +struct node_stmt_break : public node +{ + node_stmt_break() + : node(node_t::stmt_break) {} + + node_stmt_break(const location& loc) + : node(node_t::stmt_break, loc) {} + + auto print() -> std::string override + { + return "break;"; + }; +}; + +struct node_stmt_continue : public node +{ + node_stmt_continue() + : node(node_t::stmt_continue) {} + + node_stmt_continue(const location& loc) + : node(node_t::stmt_continue, loc) {} + + auto print() -> std::string override + { + return "continue;"; + }; +}; + +struct node_stmt_return : public node +{ + expr_ptr expr; + + node_stmt_return(expr_ptr expr) + : node(node_t::stmt_return), expr(std::move(expr)) {} + + node_stmt_return(const location& loc, expr_ptr expr) + : node(node_t::stmt_return, loc), expr(std::move(expr)) {} + + auto print() -> std::string override + { + if(expr.as_node->type == node_t::null) return "return;"; + + return "return " + expr.as_node->print() + ";"; + }; +}; + +struct node_parameters : public node +{ + std::vector list; + + node_parameters() + : node(node_t::parameters) {} + + node_parameters(const location& loc) + : node(node_t::parameters, loc) {} + + auto print() -> std::string override + { + std::string data; + + for (const auto& param : list) + { + data += " " + param->print(); + data += (¶m != &list.back()) ? "," : " "; + } + + return data; + } +}; + +struct node_thread : public node +{ + name_ptr name; + parameters_ptr params; + stmt_list_ptr block; + + node_thread(name_ptr name, parameters_ptr params, stmt_list_ptr block) + : node(node_t::thread), name(std::move(name)), params(std::move(params)), + block(std::move(block)) {} + + node_thread(const location& loc, name_ptr name, parameters_ptr params, stmt_list_ptr block) + : node(node_t::thread, loc), name(std::move(name)), params(std::move(params)), + block(std::move(block)) {} + + auto print() -> std::string override + { + return name->print() + "(" + params->print() + ")" + "\n" + block->print() + "\n"; + } +}; + +struct node_constant : public node +{ + name_ptr name; + expr_ptr value; + + node_constant(name_ptr name, expr_ptr value) + : node(node_t::constant), name(std::move(name)), value(std::move(value)) {} + + node_constant(const location& loc, name_ptr name, expr_ptr value) + : node(node_t::constant, loc), name(std::move(name)), value(std::move(value)) {} + + auto print() -> std::string override + { + return name->print() + " = "s + value.as_node->print() + ";\n"; + } +}; + +struct node_usingtree : public node +{ + string_ptr animtree; + + node_usingtree(string_ptr animtree) + : node(node_t::usingtree), animtree(std::move(animtree)) {} + + node_usingtree(const location& loc, string_ptr animtree) + : node(node_t::usingtree, loc), animtree(std::move(animtree)) {} + + auto print() -> std::string override + { + return "#using_animtree"s + "(" + animtree->print() + ");\n"; + } +}; + +struct node_include : public node +{ + file_ptr file; + + node_include(file_ptr file) + : node(node_t::include), file(std::move(file)) {} + + node_include(const location& loc, file_ptr file) + : node(node_t::include, loc), file(std::move(file)) {} + + auto print() -> std::string override + { + return "#include"s + " " + file->print() + ";\n"; + } +}; + +struct node_program : public node +{ + std::vector includes; + std::vector definitions; + + node_program() : node(node_t::program) {} + + node_program(const location& loc) : node(node_t::program, loc) {} + + auto print() -> std::string override + { + std::string data; + + for (const auto& include : includes) + { + data += include->print(); + } + + for (const auto& def : definitions) + { + if(def.as_node->type == node_t::thread) + { + data += "\n"; + } + + data += def.as_node->print(); + } + + return data; + } +}; + +struct node_asm_loc : public node +{ + std::string value; + + node_asm_loc(std::string value) + : node(node_t::asm_loc), value(std::move(value)) {} + + node_asm_loc(const location& loc, std::string value) + : node(node_t::asm_loc, loc), value(std::move(value)) {} + + auto print() -> std::string override + { + return value + ":"; + } +}; + +struct node_asm_jump : public node +{ + std::string value; + + node_asm_jump(std::string value) + : node(node_t::asm_jump), value(std::move(value)) {} + + node_asm_jump(const location& loc, std::string value) + : node(node_t::asm_jump, loc), value(std::move(value)) {} + + auto print() -> std::string override + { + return "jump " + value; + } +}; + +struct node_asm_jump_back : public node +{ + std::string value; + + node_asm_jump_back(std::string value) + : node(node_t::asm_jump_back), value(std::move(value)) {} + + node_asm_jump_back(const location& loc, std::string value) + : node(node_t::asm_jump_back, loc), value(std::move(value)) {} + + auto print() -> std::string override + { + return "jump_back " + value; + } +}; + +struct node_asm_jump_cond : public node +{ + std::string value; + expr_ptr expr; + + node_asm_jump_cond(expr_ptr expr, std::string value) + : node(node_t::asm_jump_cond), expr(std::move(expr)), value(std::move(value)) {} + + node_asm_jump_cond(const location& loc, expr_ptr expr, std::string value) + : node(node_t::asm_jump_cond, loc), expr(std::move(expr)), value(std::move(value)) {} + + auto print() -> std::string override + { + return "jump_cond( " + expr.as_node->print() + " ) " + value; + } +}; + +struct node_asm_jump_true_expr : public node +{ + expr_ptr expr; + std::string value; + + node_asm_jump_true_expr(expr_ptr expr, std::string value) + : node(node_t::asm_jump_true_expr), expr(std::move(expr)), value(std::move(value)) {} + + node_asm_jump_true_expr(const location& loc, expr_ptr expr, std::string value) + : node(node_t::asm_jump_true_expr, loc), expr(std::move(expr)), value(std::move(value)) {} + + auto print() -> std::string override + { + return "expr_true " + value; + } +}; + +struct node_asm_jump_false_expr : public node +{ + expr_ptr expr; + std::string value; + + node_asm_jump_false_expr(expr_ptr expr, std::string value) + : node(node_t::asm_jump_false_expr), expr(std::move(expr)), value(std::move(value)) {} + + node_asm_jump_false_expr(const location& loc, expr_ptr expr, std::string value) + : node(node_t::asm_jump_false_expr, loc), expr(std::move(expr)), value(std::move(value)) {} + + auto print() -> std::string override + { + return "expr_false " + value; + } +}; + +struct node_asm_switch : public node +{ + expr_ptr expr; + std::string value; + + node_asm_switch(expr_ptr expr, std::string value) + : node(node_t::asm_switch), expr(std::move(expr)), value(std::move(value)) {} + + node_asm_switch(const location& loc, expr_ptr expr, std::string value) + : node(node_t::asm_switch, loc), expr(std::move(expr)), value(std::move(value)) {} + + auto print() -> std::string override + { + return "switch( " + expr.as_node->print() + " ) " + value; + } +}; + +struct node_asm_endswitch : public node +{ + std::vector data; + std::string count; + + node_asm_endswitch(std::vector data, std::string count) + : node(node_t::asm_endswitch), data(std::move(data)), count(std::move(count)) {} + + node_asm_endswitch(const location& loc, std::vector data, std::string count) + : node(node_t::asm_endswitch, loc), data(std::move(data)), count(std::move(count)) {} + + auto print() -> std::string override + { + std::string p; + for(auto& d : data) + { + p+= " " + d; + } + return "endswitch( " + count + " ) " + p; + } +}; + +struct node_asm_prescriptcall : public node +{ + node_asm_prescriptcall() + : node(node_t::asm_prescriptcall) {} + + node_asm_prescriptcall(const location& loc) + : node(node_t::asm_prescriptcall, loc) {} + + auto print() -> std::string override + { + return "prescriptcall"; + } +}; + +struct node_asm_voidcodepos : public node +{ + node_asm_voidcodepos() + : node(node_t::asm_voidcodepos) {} + + node_asm_voidcodepos(const location& loc) + : node(node_t::asm_voidcodepos, loc) {} + + auto print() -> std::string override + { + return "voidcodepos"; + } +}; + +struct node_asm_create : public node +{ + std::string index; + std::vector vars; + + node_asm_create(const std::string& index) + : node(node_t::asm_create), index(index) {} + + node_asm_create(const location& loc, const std::string& index) + : node(node_t::asm_create, loc), index(index) {} + + auto print() -> std::string override + { + return "var_create_" + index; + } +}; + +struct node_asm_access : public node +{ + std::string index; + + node_asm_access(const std::string& index) + : node(node_t::asm_access), index(index) {} + + node_asm_access(const location& loc, const std::string& index) + : node(node_t::asm_access, loc), index(index) {} + + auto print() -> std::string override + { + return "var_access_" + index; + } +}; + +struct node_asm_remove : public node +{ + std::string index; + + node_asm_remove(const std::string& index) + : node(node_t::asm_remove), index(index) {} + + node_asm_remove(const location& loc, const std::string& index) + : node(node_t::asm_remove, loc), index(index) {} + + auto print() -> std::string override + { + return "var_remove_" + index; + } +}; + +struct node_asm_clear : public node +{ + std::string index; + + node_asm_clear(const std::string& index) + : node(node_t::asm_clear), index(index) {} + + node_asm_clear(const location& loc, const std::string& index) + : node(node_t::asm_clear, loc), index(index) {} + + auto print() -> std::string override + { + return "var_clear_" + index; + } +}; + +} // namespace xsk::gsc diff --git a/src/utils/xsk/gsc/pair.hpp b/src/utils/xsk/gsc/pair.hpp new file mode 100644 index 00000000..e67ed13b --- /dev/null +++ b/src/utils/xsk/gsc/pair.hpp @@ -0,0 +1,29 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc +{ + +struct pair_8C +{ + std::uint8_t key; + const char* value; +}; + +struct pair_16C +{ + std::uint16_t key; + const char* value; +}; + +struct pair_32C +{ + std::uint32_t key; + const char* value; +}; + +} // namespace xsk::gsc diff --git a/src/utils/xsk/string.cpp b/src/utils/xsk/string.cpp new file mode 100644 index 00000000..3425d19d --- /dev/null +++ b/src/utils/xsk/string.cpp @@ -0,0 +1,208 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" + +namespace xsk::gsc::utils +{ + +auto string::iequals(const std::string& a, const std::string& b) -> bool +{ + return (a.size() == b.size()) && std::equal(a.begin(), a.end(), b.begin(), b.end(), + [](char a, char b) + { + return std::tolower(a) == std::tolower(b); + }); +} + +auto string::is_number(const std::string& s) -> bool +{ + return !s.empty() && std::all_of(s.begin(), s.end(), isdigit); +} + +auto string::is_hex_number(const std::string& s) -> bool +{ + return !s.empty() && std::all_of(s.begin(), s.end(), isxdigit); +} + +auto string::to_lower(const std::string& input) -> std::string +{ + std::string data(input.begin(), input.end()); + + for (std::size_t i = 0; i < data.size(); i++) + { + data[i] = std::tolower(input[i]); + } + + return data; +} + +auto string::to_code(const std::string& input) -> std::string +{ + std::string data = input.substr(1, input.size() - 2); + std::size_t pos; + + while ((pos = data.find("\\n")) != std::string::npos) + { + data.erase(data.begin() + pos); + data = data.replace(pos, 1, "\n"); + } + while ((pos = data.find("\\t")) != std::string::npos) + { + data.erase(data.begin() + pos); + data = data.replace(pos, 1, "\t"); + } + while ((pos = data.find("\\r")) != std::string::npos) + { + data.erase(data.begin() + pos); + data = data.replace(pos, 1, "\r"); + } + while ((pos = data.find("\\\"")) != std::string::npos) + { + data.erase(data.begin() + pos); + } + + return data; +} + +auto string::to_literal(const std::string& input) -> std::string +{ + std::string data(input.begin(), input.end()); + std::size_t pos; + + while ((pos = data.find('\n')) != std::string::npos) + { + data = data.replace(pos, 1, "n"); + data.insert(data.begin() + pos, '\\'); + } + while ((pos = data.find('\t')) != std::string::npos) + { + data = data.replace(pos, 1, "t"); + data.insert(data.begin() + pos, '\\'); + } + while ((pos = data.find('\r')) != std::string::npos) + { + data = data.replace(pos, 1, "r"); + data.insert(data.begin() + pos, '\\'); + } + for(pos = 0; pos < data.size(); pos++) + { + if(data.at(pos) == '\"') + { + data.insert(data.begin() + pos, '\\'); + pos++; + } + } + + data.insert(data.begin(), '\"'); + data.insert(data.end(), '\"'); + + return data; +} + +auto string::fordslash(const std::string& s) -> std::string +{ + std::string data(s.begin(), s.end()); + + for (std::size_t i = 0; i < data.size(); i++) + { + if(data[i] == '\\') data[i] = '/'; + } + + return data; +} + +auto string::backslash(const std::string& s) -> std::string +{ + std::string data(s.begin(), s.end()); + + for (std::size_t i = 0; i < data.size(); i++) + { + if(data[i] == '/') data[i] = '\\'; + } + + return data; +} + +auto string::quote(const std::string& s, bool single) -> std::string +{ + std::string data(s.begin(), s.end()); + + if(single) + { + data.insert(data.begin(), '\''); + data.insert(data.end(), '\''); + } + else + { + data.insert(data.begin(), '\"'); + data.insert(data.end(), '\"'); + } + + return data; +} + +auto string::unquote(const std::string& s) -> std::string +{ + if(s.at(0) == '\'' || s.at(0) == '\"') + return s.substr(1, s.size() - 2); + + return s; +} + +auto string::split(std::string& str, char delimiter) -> std::vector +{ + std::vector tokens; + std::stringstream ss(str); + std::string tok; + + while (std::getline(ss, tok, delimiter)) + { + tokens.push_back(tok); + } + + return tokens; +} + +auto string::clean_buffer_lines(std::vector& buffer) -> std::vector +{ + std::string data = std::string(reinterpret_cast(buffer.data()), buffer.size()); + std::size_t pos; + + while ((pos = data.find("\t")) != std::string::npos) + { + data = data.replace(pos, 1, ""); + } + while ((pos = data.find("\r")) != std::string::npos) + { + data = data.replace(pos, 1, ""); + } + + std::vector lines; + std::stringstream ss(data); + std::string tok; + + while (std::getline(ss, tok, '\n')) + { + lines.push_back(tok); + } + + return lines; +} + +auto string::parse_code(std::string& line) -> std::vector +{ + std::vector data; + std::regex exp(R"(([_A-Za-z0-9\-]+|\"(?:\\.|[^\"])*?\"|\'(?:\\.|[^\'])*?\')(?:\s+|$))"); + + for(auto i = std::sregex_iterator(line.begin(), line.end(), exp); i != std::sregex_iterator(); ++i) + { + data.push_back(i->format("$1")); + } + + return data; +} + +} // namespace xsk::utils diff --git a/src/utils/xsk/string.hpp b/src/utils/xsk/string.hpp new file mode 100644 index 00000000..5db7d130 --- /dev/null +++ b/src/utils/xsk/string.hpp @@ -0,0 +1,39 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::gsc::utils +{ + +class string +{ +public: + template + static auto va(const std::string& format, Args ... args) -> std::string + { + size_t size = snprintf(nullptr, 0, format.data(), args ...) + 1; + std::vector buf; + buf.resize(size); + snprintf(buf.data(), size, format.data(), args ...); + return std::string(buf.data(), buf.data() + size - 1); + } + + static auto iequals(const std::string& a, const std::string& b) -> bool; + static auto is_number(const std::string& s) -> bool; + static auto is_hex_number(const std::string& s) -> bool; + static auto to_lower(const std::string& input) -> std::string; + static auto to_code(const std::string& input) -> std::string; + static auto to_literal(const std::string& input) -> std::string; + static auto fordslash(const std::string& s) -> std::string; + static auto backslash(const std::string& s) -> std::string; + static auto quote(const std::string& s, bool single = true) -> std::string; + static auto unquote(const std::string& s) -> std::string; + static auto split(std::string& str, char delimiter) -> std::vector; + static auto clean_buffer_lines(std::vector& buffer) -> std::vector; + static auto parse_code(std::string& line) -> std::vector; +}; + +} // namespace xsk::utils diff --git a/src/utils/xsk/utils.cpp b/src/utils/xsk/utils.cpp new file mode 100644 index 00000000..7fbc37e8 --- /dev/null +++ b/src/utils/xsk/utils.cpp @@ -0,0 +1,8 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "stdafx.hpp" + +std::uint32_t xsk::gsc::node::indent_; diff --git a/src/utils/xsk/utils.hpp b/src/utils/xsk/utils.hpp new file mode 100644 index 00000000..86160a5e --- /dev/null +++ b/src/utils/xsk/utils.hpp @@ -0,0 +1,27 @@ +// Copyright 2021 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +// Utility +#include "file.hpp" +#include "string.hpp" +#include "byte_buffer.hpp" +#include "compression.hpp" + +// GSC Types +#include "gsc/pair.hpp" +#include "gsc/asset.hpp" +#include "gsc/assembly.hpp" +#include "gsc/context.hpp" +#include "gsc/location.hpp" +#include "gsc/nodetree.hpp" + +// GSC Interfaces +#include "gsc/interfaces/exception.hpp" +#include "gsc/interfaces/assembler.hpp" +#include "gsc/interfaces/disassembler.hpp" +#include "gsc/interfaces/compiler.hpp" +#include "gsc/interfaces/decompiler.hpp" diff --git a/tools/macos/premake5 b/tools/macos/premake5 new file mode 100755 index 00000000..d192618b Binary files /dev/null and b/tools/macos/premake5 differ diff --git a/tools/windows/premake5.exe b/tools/windows/premake5.exe new file mode 100644 index 00000000..9048d51e Binary files /dev/null and b/tools/windows/premake5.exe differ